-
Notifications
You must be signed in to change notification settings - Fork 467
/
spaghetti.py
63 lines (61 loc) · 1.8 KB
/
spaghetti.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Spaghetti: Web Application Security Scanner
#
# @url: https://github.com/m4ll0k/Spaghetti
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'doc/LICENSE'
from lib.utils import banner
from lib.net import utils
from modules.discovery import All
from modules.fingerprints import CheckAll
import os
import sys
import getopt
class Spaghetti(object):
parse = utils.Parser()
redirect = True
proxy = None
agent = "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0"
cookie = None
def Main(self,argv):
if len(sys.argv) <= 4:
banner.Usage(True)
try:
opts,args = getopt.getopt(argv,'u:s:',['url=','scan=','agent=','random-agent','cookie=','proxy=','redirect=','help='])
except getopt.error,Error:
banner.Usage(True)
for o,a in opts:
if o in ('-u','--url'):
self.target = self.parse.ParserUrl(a)
if o in ('-s','--scan'):
self.scan = a
if o in ('--agent'):
self.agent = a
if o in ('--random-agent'):
pass
if o in ('--cookie'):
self.cookie = a
if o in ('--proxy'):
self.proxy = a
if o in ('--redirect'):
self.redirect = a
if o in ('--help'):
banner.Usage(True)
banner.banner()
banner.strftime(self.target)
CheckAll.CheckAll(self.target,self.agent,self.proxy,self.redirect).Run()
if self.scan == '0':
All.All(self.target,self.agent,self.proxy,self.redirect)
elif self.scan == '1':
All.AdminInterface(self.target,self.agent,self.proxy,self.redirect)
elif self.scan == '2':
All.Misconfiguration(self.target,self.agent,self.proxy,self.redirect)
elif self.scan == '3':
All.InfoDisclosure(self.target,self.agent,self.proxy,self.redirect)
if __name__ == "__main__":
try:
Spaghetti().Main(sys.argv[1:])
except KeyboardInterrupt:
sys.exit('[!] Keyboard Interrupt...')