-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwascan.py
46 lines (35 loc) · 1.46 KB
/
wascan.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
import argparse
import scanner
import sys
from termcolor import colored
from util.files import slurp
from util.lists import trim
class Scanner(scanner.Scanner):
def __init__(self, unique=False, brute=False, base=None):
scanner.Scanner.__init__(self, base)
self.unique = unique
def on_request(self, url):
sys.stderr.write('%s\r%s\r' % (' '*64, trim(url, 64, '...')))
def on_response(self, response, chash, unique):
if self.unique:
if unique:
print((colored('[%08x]', 'green') + ' %s') % (chash, response.url))
else:
if unique:
color = 'green'
else:
color = 'yellow'
print((colored('[%08x]', color) + ' %s') % (chash, response.url))
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Web Application Scanner')
parser.add_argument('target', metavar='target', type=str, help='target url to scan')
parser.add_argument('-u', '--unique', action='store_true', help='print only unique content')
parser.add_argument('-b', '--brute', action='store_true', help='bruteforce urls')
parser.add_argument('-w', metavar='path', help='set the wordlist to use', default='wordlists/directory-list-2.3-small.txt')
args = parser.parse_args()
s = Scanner(args.unique)
if args.brute:
wordlist = slurp(args.w)
else:
wordlist = None
s.scan(url=args.target, wordlist=wordlist)