Browse Source

Make SIP note, service and print output more similar

Jon Hart 5 years ago
parent
commit
316a952e9c
No account linked to committer's email address
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      lib/msf/core/exploit/sip.rb

+ 9
- 3
lib/msf/core/exploit/sip.rb View File

@@ -16,7 +16,9 @@ module Msf
16 16
         return false
17 17
       end
18 18
 
19
-      # Do header extraction as necessary
19
+      # Extracted headers, stored as a hash where the key is the header name
20
+      # and the value is a list of all values seen for the header, covering the
21
+      # case where the same header value is seen multiple times
20 22
       extracted_headers = {}
21 23
       unless desired_headers.nil? || desired_headers.empty?
22 24
         desired_headers.each do |desired_header|
@@ -32,13 +34,17 @@ module Msf
32 34
         'message' => options_response.message
33 35
       }
34 36
 
37
+      # compact the header values, append the header information to the
38
+      # fingerprint hash
35 39
       extracted_headers.each_pair do |k,v|
36
-        fprint['header_' + k.gsub('-', '_').downcase] = v.join(',')
40
+        value = v.join(',')
41
+        extracted_headers[k] = value
42
+        fprint['header_' + k.gsub('-', '_').downcase] = value
37 43
       end
38 44
 
39 45
       # Create a summary of the response
40 46
       status = options_response.status_line.dup
41
-      unless extracted_headers.keys.length == 0
47
+      unless extracted_headers.keys.empty?
42 48
         status << ": #{extracted_headers}"
43 49
       end
44 50
 

Loading…
Cancel
Save