Skip to content

Instantly share code, notes, and snippets.

@dorneanu
Created August 26, 2016 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dorneanu/d87da02b3e883bdc82d79bd0c937926c to your computer and use it in GitHub Desktop.
Save dorneanu/d87da02b3e883bdc82d79bd0c937926c to your computer and use it in GitHub Desktop.
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