Skip to content

Commit

Permalink
added the ability to mess with user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
almandin committed Oct 27, 2017
1 parent 44306a7 commit a329739
Show file tree
Hide file tree
Showing 2 changed files with 4,216 additions and 2 deletions.
23 changes: 21 additions & 2 deletions fuxploider.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/python3
import re,requests,argparse,logging,os,coloredlogs,datetime,getpass,tempfile,itertools,json,concurrent.futures
import re,requests,argparse,logging,os,coloredlogs,datetime,getpass,tempfile,itertools,json,concurrent.futures,random
from utils import *
from UploadForm import UploadForm
from threading import Lock
Expand Down Expand Up @@ -49,9 +49,28 @@
parser.add_argument("-y",action="store_true",required=False,dest="detectAllEntryPoints",help="Force detection of every entry points. Will not stop at first code exec found.")
parser.add_argument("-T","--threads",metavar="Threads",nargs=1,dest="nbThreads",help="Number of parallel tasks (threads).",type=int,default=[4])

exclusiveUserAgentsArgs = parser.add_mutually_exclusive_group()
exclusiveUserAgentsArgs.add_argument("-U","--user-agent",metavar="useragent",nargs=1,dest="userAgent",help="User-agent to use while requesting the target.",type=str,default=[requests.utils.default_user_agent()])
exclusiveUserAgentsArgs.add_argument("--random-user-agent",action="store_true",required=False,dest="randomUserAgent",help="Use a random user-agent while requesting the target.")

args = parser.parse_args()
args.uploadsPath = args.uploadsPath[0]
args.nbThreads = args.nbThreads[0]
args.userAgent = args.userAgent[0]

if args.randomUserAgent :
with open("user-agents.txt","r") as fd :
nb = 0
for l in fd :
nb += 1
fd.seek(0)
nb = random.randint(0,nb)
for i in range(0,nb) :
args.userAgent = fd.readline()[:-1]

print(args.userAgent)
exit()


if args.template :
args.template = args.template[0]
Expand Down Expand Up @@ -138,7 +157,7 @@
if args.cookies :
for key in args.cookies.keys() :
s.cookies[key] = args.cookies[key]

s.headers = {'User-Agent':args.userAgent}
##### PROXY HANDLING #####
s.trust_env = False
if args.proxy :
Expand Down
Loading

0 comments on commit a329739

Please sign in to comment.