-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathMalfind.ps1
144 lines (135 loc) · 4.68 KB
/
Malfind.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
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
138
139
140
141
142
143
144
# Author: Chris Harrod
#
# Downloads malware samples from the following sources:
# malc0de.com
# zeustracker.abuse.ch
# malwaredomainlist.com
# vxvault.net
# support.clean-mx.de
$OutputDirectory = "C:\Scripting\Malfind\Output"
$Completed = "C:\Scripting\Malfind\completed.txt"
$arrCompleted = @()
$arrCompleted = Get-Content $Completed
Write-Host Scanning for new content on malc0de
[xml]$RSS = Invoke-WebRequest "http://malc0de.com/rss/"
[xml]$RSS = $RSS.InnerXml
$arrItems = $rss.rss.channel.item
foreach ($Object in $arrItems){
$ObjectPath = $Object.description.split(" ").replace(",","")[1]
$ObjectURL = "http://$ObjectPath"
if($arrCompleted -notcontains $ObjectURL){
Write-Host $ObjectURL
try{
$File = Invoke-Webrequest $ObjectURL -OutFile "$OutputDirectory/temp.temp" -PassThru
}
catch{}
if($File){
$MD5 = (Get-FileHash $OutputDirectory/temp.temp -Algorithm MD5).Hash
if(!(Test-Path $OutputDirectory/$MD5)){
Rename-Item $OutputDirectory/temp.temp $MD5
}
}
$File = $Null
}
Add-Content $Completed $ObjectURL
$arrCompleted += $ObjectURL
}
Write-Host Scanning for new content on Zeustracker
[xml]$RSS = Invoke-WebRequest "https://zeustracker.abuse.ch/monitor.php?urlfeed=binaries"
[xml]$RSS = $RSS.InnerXml
$arrItems = $rss.rss.channel.item
foreach ($Object in $arrItems){
$ObjectURL = $Object.description.split(" ").replace(",","")[1]
if($arrCompleted -notcontains $ObjectURL){
Write-Host $ObjectURL
try{
$File = Invoke-Webrequest $ObjectURL -OutFile "$OutputDirectory/temp.temp" -PassThru
}
catch{}
if($File){
$MD5 = (Get-FileHash $OutputDirectory/temp.temp -Algorithm MD5).Hash
if(!(Test-Path $OutputDirectory/$MD5)){
Rename-Item $OutputDirectory/temp.temp $MD5
}
}
$File = $Null
}
Add-Content $Completed $ObjectURL
$arrCompleted += $ObjectURL
}
Write-Host Scanning for new content on MalwareDomainList
[xml]$RSS = Invoke-WebRequest "http://www.malwaredomainlist.com/hostslist/mdl.xml"
[xml]$RSS = $RSS.InnerXml
$arrItems = $rss.rss.channel.item
foreach ($Object in $arrItems){
$ObjectPath = $Object.description.split(" ").replace(",","")[1]
$ObjectURL = "http://$ObjectPath"
if($arrCompleted -notcontains $ObjectURL){
Write-Host $ObjectURL
try{
$File = Invoke-Webrequest $ObjectURL -OutFile "$OutputDirectory/temp.temp" -PassThru
}
catch{}
if($File){
$MD5 = (Get-FileHash $OutputDirectory/temp.temp -Algorithm MD5).Hash
if(!(Test-Path $OutputDirectory/$MD5)){
Rename-Item $OutputDirectory/temp.temp $MD5
}
}
$File = $Null
}
Add-Content $Completed $ObjectURL
$arrCompleted += $ObjectURL
}
Write-Host Scanning for new content on VXVault
$Content = (Invoke-WebRequest "http://vxvault.net/URL_List.php").Content.Split('')
$arrItems = @()
foreach($Item in $Content){
if ($Item -like "*http://*"){
$arrItems += $Item
}
}
foreach ($ObjectURL in $arrItems){
if($arrCompleted -notcontains $ObjectURL){
Write-Host $ObjectURL
try{
$File = Invoke-Webrequest $ObjectURL -OutFile "$OutputDirectory/temp.temp" -PassThru
}
catch{}
if($File){
$MD5 = (Get-FileHash $OutputDirectory/temp.temp -Algorithm MD5).Hash
if(!(Test-Path $OutputDirectory/$MD5)){
Rename-Item $OutputDirectory/temp.temp $MD5
}
}
$File = $Null
}
Add-Content $Completed $ObjectURL
$arrCompleted += $ObjectURL
}
Write-Host Scanning for new content on Clean-MX
[xml]$RSS = (Invoke-WebRequest "http://support.clean-mx.de/clean-mx/rss?scope=viruses&limit=0%2C64")
[xml]$RSS = $RSS.InnerXml
$Content = $rss.rss.channel.item
$arrItems = @()
foreach($Item in $Content){
$arrItems += $Item.title.'#cdata-section'
}
foreach ($ObjectURL in $arrItems){
if($arrCompleted -notcontains $ObjectURL){
Write-Host $ObjectURL
try{
$File = Invoke-Webrequest $ObjectURL -OutFile "$OutputDirectory/temp.temp" -PassThru
}
catch{}
if($File){
$MD5 = (Get-FileHash $OutputDirectory/temp.temp -Algorithm MD5).Hash
if(!(Test-Path $OutputDirectory/$MD5)){
Rename-Item $OutputDirectory/temp.temp $MD5
}
}
$File = $Null
}
Add-Content $Completed $ObjectURL
$arrCompleted += $ObjectURL
}