forked from Redshoee/WPSeku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wpseku.py
executable file
·73 lines (69 loc) · 2.32 KB
/
wpseku.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
"""The WPSeku main part."""
import getopt
from lib.scan import *
from lib.usage import *
from modules.bruteforce.wpxmlrpc import *
from modules.discovery.generic.generic import *
from modules.discovery.plugins.wpplugins import *
from modules.discovery.themes.wpthemes import *
from modules.discovery.users.wpusers import *
from modules.fingerprint.fingerprint import *
class wpseku(object):
"""WPSeku main object"""
kwargs = {
'agent':ragent(),'ragent':False,'redirect':True,
'cookie':None,'proxy':None,'timeout':None,'verbose':False,'headers':{}
}
def main(self):
# default value
self.brute = False
self.user = "admin"
self.wordlist = "db/wordlist.txt"
self.url = None
self.user = None
self.scan = None
#
if len(sys.argv) < 2:
usage(True)
try:
opts,args = getopt.getopt(sys.argv[1:],'u:U:s:p:c:a:t:w:Rrhvb:',['url=',
'brute','user=','scan=','proxy=','cookie=','agent=','wordlist=','timeout=',
'redirect','ragent','help','verbose'])
except getopt.GetoptError as e:
usage(True)
for opt,arg in opts:
if opt in ('-u','--url'):self.url=urlCheck(arg)
if opt in ('-b','--brute'):self.brute=True
if opt in ('-U','--user'):self.user=arg
if opt in ('-s','--scan'):self.scan=arg
if opt in ('-p','--proxy'):self.kwargs['proxy']=arg
if opt in ('-c','--cookie'):self.kwargs['cookie']=arg
if opt in ('-a','--agent'):self.kwargs['agent']=arg
if opt in ('-t','--timeout'):self.kwargs['timeout']=arg
if opt in ('-R','--redirect'):self.kwargs['redirect']=True
if opt in ('-r','--ragent'):self.kwargs['ragent']=True
if opt in ('-v','--verbose'):self.kwargs['verbose']=True
if opt in ('-h','--help'):usage(True)
# start
try:
if self.scan != None:
banner()
Scan().run(self.scan)
elif self.brute is True:
ptime(self.url)
XMLRPCBrute(self.url,None,self.user,
self.wordlist,self.kwargs).run()
elif self.url:
ptime(self.url)
fingerprint(self.url,None,self.kwargs).run()
generic(self.url,None,self.kwargs)
wpthemes(self.url,None,self.kwargs).run()
wpplugins(self.url,None,self.kwargs).run()
wpusers(self.url,None,self.kwargs).run()
except UnboundLocalError as e:
pass
if __name__ == "__main__":
try:
wpseku().main()
except KeyboardInterrupt:
exit(warn('CTRL+C...'))