-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxss.py
49 lines (43 loc) · 1.28 KB
/
xss.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
try:
import time
from sys import __stdout__, stdout
from threading import Thread
from subprocess import *
import os
import sys
import subprocess
import threading
import readline
from termcolor import colored
except ImportError:
print("\ncheck for prerequisities ")
def scanXSS(target):
os.system('clear')
p = './output/xss/'
xssStrike = '~/Tools/XSStrike/xsstrike.py'
try:
os.mkdir(p)
except FileExistsError as exc:
print(exc)
delCMD = 'rm ' + p + 'xss.txt'
try:
subprocess.run(delCMD, shell=True, stdout=PIPE)
except:
pass
cmd = [
'python3 ' + xssStrike + ' -u "' + target +
'" --crawl --file-log-level INFO --log-file ' + p + 'xss.txt'
]
try:
print(cmd[0])
proc = subprocess.run(cmd[0], shell=True, stderr=STDOUT, stdout=PIPE)
if(proc.returncode != 0):
print(colored('Step 1 Failed! Check/Update prerequisitie packages. \nError: ',
'blue', attrs=['bold']) + proc.stderr.rstrip())
return False
else:
print(colored("[x] Executed", 'blue', attrs=['bold']))
return True
except:
print("Something went wrong! Check prerequisities.\n")
return False