Created
August 26, 2016 12:18
-
-
Save dorneanu/d87da02b3e883bdc82d79bd0c937926c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas as pd | |
import os | |
# Config stuff | |
url="https://www.yourapp.com/add/new/file" | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' | |
# Add here more headers | |
} | |
# You may want to see the requests in some proxy (burp) | |
proxies = { | |
'http': 'http://192.168.0.1:8080', | |
'https': 'http://192.168.0.1:8081', | |
} | |
# For a given path, iterate through files and repeat the request | |
def do_fuzz(path): | |
from glob import glob | |
for f in glob(path): | |
# Create attachment | |
files = { | |
'attachment': ("petter.jpg", open(f, 'rb'), 'image/jpeg'), | |
'name': "image.jpg" | |
} | |
# Send attachment | |
r = requests.post( | |
url, | |
headers=headers, | |
proxies=proxies, | |
verify=False, | |
files=files | |
) | |
# Here do whatever with the response | |
# Do fuzzing | |
do_fuzz("/home/victor/fuzz/Pictures/*") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment