Skip to content

Commit 59003a9

Browse files
committed
Updated Poison Ivy Scanner
1 parent 226cd24 commit 59003a9

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

modules/auxiliary/scanner/misc/poisonivy_control_scanner.rb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,18 @@ class Metasploit3 < Msf::Auxiliary
1717
def initialize
1818
super(
1919
'Name' => 'Poison Ivy C&C Scanner',
20-
'Description' => 'Enumerate Poison Ivy C&C on ports 3460,80,8080 and 443. Adaptation of iTrust Python script.
21-
www.malware.lu/Pro/RAP002_APT1_Technical_backstage.1.0.pdf',
20+
'Description' => 'Enumerate Poison Ivy C&C on ports 3460,80,8080 and 443. Adaptation of iTrust Python script.',
21+
'References' =>
22+
[
23+
['URL', 'www.malware.lu/Pro/RAP002_APT1_Technical_backstage.1.0.pdf'],
24+
],
2225
'Author' => [ 'SeawolfRN'],
2326
'License' => MSF_LICENSE
2427
)
2528

2629
register_options(
2730
[
28-
OptInt.new('TIMEOUT', [true, "The socket connect timeout in milliseconds", 1000]),
31+
OptString.new('PORTS', [true, "Ports to Check","80,8080,443,3460"])
2932
OptInt.new('CONCURRENCY', [true, "The number of concurrent ports to check per host", 10]),
3033
], self.class)
3134

@@ -38,7 +41,7 @@ def run_host(ip)
3841

3942
timeout = datastore['TIMEOUT'].to_i
4043

41-
ports = Rex::Socket.portspec_crack("3460,80,443,8080")
44+
ports = Rex::Socket.portspec_crack(datastore['PORTS'])
4245

4346
while(ports.length > 0)
4447
t = []
@@ -56,24 +59,23 @@ def run_host(ip)
5659
'ConnectTimeout' => (timeout / 1000.0)
5760
}
5861
)
59-
r << [ip,port,"open"]
62+
r << [ip,port,"open",'Unknown']
6063
s.send("\x00"*0x100,0) #Send 0x100 zeros, wait for answer
6164
data=s.recv(0x100)
6265
if data.length==0x100
6366
data=s.recv(0x4)
6467
if data=="\xD0\x15\x00\x00" #Signature for PIVY C&C
6568
print_status("#{ip}:#{port} - C&C Server Found")
69+
r << [ip,port,"open",'Poison Ivy C&C']
6670
end
6771
end
6872
rescue ::Rex::ConnectionRefused
6973
vprint_status("#{ip}:#{port} - TCP closed")
70-
r << [ip,port,"closed"]
74+
r << [ip,port,"closed",'']
7175
rescue ::Rex::ConnectionError, ::IOError, ::Timeout::Error
7276
rescue ::Rex::Post::Meterpreter::RequestError
7377
rescue ::Interrupt
7478
raise $!
75-
rescue ::Exception => e
76-
print_error("#{ip}:#{port} exception #{e.class} #{e} #{e.backtrace}")
7779
ensure
7880
disconnect(s) rescue nil
7981
end
@@ -87,7 +89,7 @@ def run_host(ip)
8789
end
8890

8991
r.each do |res|
90-
report_service(:host => res[0], :port => res[1], :state => res[2])
92+
report_service(:host => res[0], :port => res[1], :state => res[2], :name=> res[3])
9193
end
9294
end
9395
end

0 commit comments

Comments
 (0)