forked from kira2040k/php_code_analysis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
code.py
66 lines (58 loc) · 1.74 KB
/
code.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
from os import listdir
import code_analysis as CA
from sys import argv
import os
import colors
print(f"""
{colors.color.purple('[+]------------------------------------------[+]')}
twitter:kira_321k
insta:at9w
[+]-----------------------------------[+]
""")
colors.color.reset()
def scan_files_in_folder(path):
folders = listdir(path)
for i2 in folders:
try:
if('.php' in i2):
file = open(f"{path}/{i2}","r",encoding="utf8",errors='ignore')
file = file.read()
line_number = 0
print(f"{path}/{i2}")
CA.info.GET_parameters(file)
CA.info.POST_parameters(file)
CA.check.check_all(f"{path}/{i2}")
CA.search.SQLi(file)
CA.search.check_file_upload(file)
except:
pass
for i in folders:
try:
if (os.path.isdir(f"{path}/{i}")):
scan_files_in_folder(f"{path}/{i}")
except:
pass
return folders
if(len(argv) == 2):
try:
if(".php" in argv[1]):
file = open(f"{argv[1]}","r",encoding="utf8",errors='ignore')
file = file.read()
line_number = 0
CA.info.GET_parameters(file)
CA.info.POST_parameters(file)
CA.check.check_all(f"{argv[1]}")
CA.search.SQLi(file)
CA.search.check_file_upload(file)
CA.info.finish()
else:
scan_files_in_folder(argv[1])
CA.info.finish()
except:
pass
else:
try:
folders = scan_files_in_folder('.')
CA.info.finish()
except:
pass