Modules used threading, Optparse, URLLIB2
Local need to put a dictionary, the name should be capitalized.
On the Code
1 defrequest (Url,pathname):2 Try:3 ImportUrllib24page ='/ http'+url+'/'+PathName5Request =Urllib2. Request (page)6Response =Urllib2.urlopen (Request)7 Print '[+]'+url+PathName8 exceptexception,e:9 PassTen One defMain_main (): A forPathNameinchfile.readlines (): - request (Options.target_url,pathname) - file.close () the - defMain_mdb (): - forPathmdbinchfile_dbs.readlines (): - request (Options.target_url,pathmdb) + file_dbs.close () - + fromOptparseImportOptionparser AUsage ='[-u <website/target_url>][-l <website\ ' s language>]' atParser =optionparser (usage) -Parser.add_option ('- u', dest='Target_url', help='example:-u www.example.com') -Parser.add_option ('- L', dest='Target_language', type='string', help='example:-l PHP') -options,args=Parser.parse_args () -Pathtxt =options.target_language.upper () +'. txt' -File = Open (Pathtxt,'R') inPathmdbs ='MDB.txt' -File_dbs = open (Pathmdbs,'R') to if __name__=='__main__': + ImportThreading -Threads = [] thet_asp = Threading. Thread (target=Main_main) *T_mdb = Threading. Thread (target=Main_mdb) $ threads.append (t_asp)Panax Notoginseng threads.append (T_mdb) -Lock =Threading. Lock () the forThreadinchThreads: + Try: A Lock.acquire () the Thread.Start () + finally: -Lock.release ()
Parameter-u url-l Web language
His own fantasy of a crude Python website scanner