From 9955cb5b27f1da2e9b9ad6b65642962d3fc18bb2 Mon Sep 17 00:00:00 2001 From: Jon Hart Date: Fri, 18 Jul 2014 17:39:52 -0700 Subject: [PATCH] Enforce proper protocol case where necessary --- lib/msf/core/exploit/sip.rb | 6 +++--- modules/auxiliary/scanner/sip/options.rb | 4 ++-- modules/auxiliary/scanner/sip/options_tcp.rb | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/msf/core/exploit/sip.rb b/lib/msf/core/exploit/sip.rb index 507c05da49..2087ddaa00 100644 --- a/lib/msf/core/exploit/sip.rb +++ b/lib/msf/core/exploit/sip.rb @@ -20,7 +20,7 @@ module Msf report_service( host: rhost, port: rport, - proto: proto, + proto: proto.downcase, name: 'sip' ) @@ -38,7 +38,7 @@ module Msf report_note( host: rhost, port: rport, - proto: proto, + proto: proto.downcase, type: "sip_#{k}", data: v ) @@ -57,7 +57,7 @@ module Msf src = "#{shost}:#{datastore['RPORT']}" data = "OPTIONS sip:#{datastore['TO']}@#{ip} SIP/2.0\r\n" - data << "Via: SIP/2.0/#{proto} #{src};branch=z9hG4bK.#{format('%.8x', rand(0x100000000))};rport;alias\r\n" + data << "Via: SIP/2.0/#{proto.upcase} #{src};branch=z9hG4bK.#{format('%.8x', rand(0x100000000))};rport;alias\r\n" data << "From: sip:#{suser}@#{src};tag=70c00e8c\r\n" data << "To: sip:#{datastore['TO']}@#{ip}\r\n" data << "Call-ID: #{rand(0x100000000)}@#{shost}\r\n" diff --git a/modules/auxiliary/scanner/sip/options.rb b/modules/auxiliary/scanner/sip/options.rb index bc5702a2e8..7acf4b25bd 100644 --- a/modules/auxiliary/scanner/sip/options.rb +++ b/modules/auxiliary/scanner/sip/options.rb @@ -34,10 +34,10 @@ class Metasploit3 < Msf::Auxiliary end def scan_host(ip) - scanner_send(create_probe(ip, 'UDP'), ip, datastore['RPORT']) + scanner_send(create_probe(ip, 'udp'), ip, datastore['RPORT']) end def scanner_process(data, shost, _) - parse_response(data, shost, 'UDP') + parse_response(data, shost, 'udp') end end diff --git a/modules/auxiliary/scanner/sip/options_tcp.rb b/modules/auxiliary/scanner/sip/options_tcp.rb index f373cae7c3..ccf8569bb2 100644 --- a/modules/auxiliary/scanner/sip/options_tcp.rb +++ b/modules/auxiliary/scanner/sip/options_tcp.rb @@ -32,7 +32,7 @@ class Metasploit3 < Msf::Auxiliary def run_host(ip) begin connect - sock.put(create_probe(ip, 'TCP')) + sock.put(create_probe(ip, 'tcp')) res = sock.get_once(-1, 5) parse_response(res, rhost, 'tcp') if res rescue ::Interrupt