Random agent fixed - ungzip for user-agents and timthumbs

pull/17/merge
Swissky 2017-10-05 10:14:11 +02:00
parent e78cfda969
commit ec588f7f4d
8 changed files with 2971 additions and 683 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -43,6 +43,15 @@ def format_url(url):
return "http://"+url
return url
"""
name : unzip_file()
description : unzip a file, used for user-agents.txt and timthumbs.txt
"""
# TODO improve this , os.system is a dirty method
def unzip_file(filename):
os.system('mv '+ filename + ' ' + filename + ".gz")
os.system('gzip -d '+ filename+".gz")
"""
name : database_update()
description : download and update the database from wpscan website
@ -59,6 +68,9 @@ def database_update():
print "\t\033[93mDownloading \033[0m"+ f +" \033[92mFile updated !\033[0m"
download_raw_file(update_url+f, "database/"+f, True)
unzip_file("database/user-agents.txt")
unzip_file("database/timthumbs.txt")
"""
name : database_last_date()

View File

@ -3,6 +3,7 @@
import requests
import re
import json
from random import randint
from core import *
class Wordpress:
@ -44,14 +45,21 @@ class Wordpress:
"""
name : random_agent()
description : give a random user agent
todo : user-agent.txt -> unzip -> random line
"""
def random_agent(self):
if self.agent != "random_agent":
self.agent = "Wordpresscan - For educational purpose only !"
else:
self.agent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36"
with open('database/user-agents.txt','r') as f:
uas = f.read()
# remove '#SOMETHING' and '\n\n'
uas = re.sub("#.*","", uas)
uas = uas.replace("\n\n","")
uas = uas.split('\n')
random = randint(0, len(uas))
self.agent = uas[random]
"""
name : is_wordpress()