@@ -699,7 +699,7 @@ def report_session(opts)
699
699
if session . via_exploit == "exploit/multi/handler" and sess_data [ :datastore ] [ 'ParentModule' ]
700
700
mod_fullname = sess_data [ :datastore ] [ 'ParentModule' ]
701
701
mod_name = ::Mdm ::ModuleDetail . find_by_fullname ( mod_fullname ) . name
702
- else
702
+ else
703
703
mod_name = mod . name
704
704
mod_fullname = mod . fullname
705
705
end
@@ -719,7 +719,7 @@ def report_session(opts)
719
719
vuln_info [ :service ] = service if service
720
720
721
721
vuln = framework . db . report_vuln ( vuln_info )
722
-
722
+
723
723
if session . via_exploit == "exploit/multi/handler" and sess_data [ :datastore ] [ 'ParentModule' ]
724
724
via_exploit = sess_data [ :datastore ] [ 'ParentModule' ]
725
725
else
@@ -738,7 +738,7 @@ def report_session(opts)
738
738
}
739
739
740
740
framework . db . report_exploit_success ( attempt_info )
741
-
741
+
742
742
end
743
743
744
744
s
@@ -871,7 +871,7 @@ def report_exploit_success(opts)
871
871
ref . to_s
872
872
end
873
873
} )
874
-
874
+
875
875
# Try find a matching vulnerability
876
876
vuln = find_vuln_by_refs ( ref_objs , host , svc )
877
877
end
@@ -890,7 +890,7 @@ def report_exploit_success(opts)
890
890
attempt_info [ :loot_id ] = opts [ :loot_id ] if opts [ :loot_id ]
891
891
892
892
vuln . vuln_attempts . create ( attempt_info )
893
-
893
+
894
894
# Correct the vuln's associated service if necessary
895
895
if svc and vuln . service_id . nil?
896
896
vuln . service = svc
@@ -909,12 +909,12 @@ def report_exploit_success(opts)
909
909
attempt_info [ :vuln_id ] = vuln . id if vuln
910
910
attempt_info [ :session_id ] = opts [ :session_id ] if opts [ :session_id ]
911
911
attempt_info [ :loot_id ] = opts [ :loot_id ] if opts [ :loot_id ]
912
-
912
+
913
913
if svc
914
914
attempt_info [ :port ] = svc . port
915
915
attempt_info [ :proto ] = svc . proto
916
916
end
917
-
917
+
918
918
if port and svc . nil?
919
919
attempt_info [ :port ] = port
920
920
attempt_info [ :proto ] = prot || "tcp"
@@ -937,7 +937,7 @@ def report_exploit_failure(opts)
937
937
938
938
timestamp = opts . delete ( :timestamp )
939
939
freason = opts . delete ( :fail_reason )
940
- fdetail = opts . delete ( :fail_detail )
940
+ fdetail = opts . delete ( :fail_detail )
941
941
username = opts . delete ( :username )
942
942
mname = opts . delete ( :module )
943
943
@@ -968,7 +968,7 @@ def report_exploit_failure(opts)
968
968
ref . to_s
969
969
end
970
970
} )
971
-
971
+
972
972
# Try find a matching vulnerability
973
973
vuln = find_vuln_by_refs ( ref_objs , host , svc )
974
974
end
@@ -1003,7 +1003,7 @@ def report_exploit_failure(opts)
1003
1003
attempt_info [ :port ] = svc . port
1004
1004
attempt_info [ :proto ] = svc . proto
1005
1005
end
1006
-
1006
+
1007
1007
if port and svc . nil?
1008
1008
attempt_info [ :port ] = port
1009
1009
attempt_info [ :proto ] = prot || "tcp"
@@ -1018,7 +1018,7 @@ def report_vuln_attempt(vuln, opts)
1018
1018
::ActiveRecord ::Base . connection_pool . with_connection {
1019
1019
return if not vuln
1020
1020
info = { }
1021
-
1021
+
1022
1022
# Opts can be keyed by strings or symbols
1023
1023
::Mdm ::VulnAttempt . column_names . each do |kn |
1024
1024
k = kn . to_sym
@@ -1037,7 +1037,7 @@ def report_exploit_attempt(host, opts)
1037
1037
::ActiveRecord ::Base . connection_pool . with_connection {
1038
1038
return if not host
1039
1039
info = { }
1040
-
1040
+
1041
1041
# Opts can be keyed by strings or symbols
1042
1042
::Mdm ::VulnAttempt . column_names . each do |kn |
1043
1043
k = kn . to_sym
@@ -1623,7 +1623,7 @@ def report_vuln(opts)
1623
1623
# If a match is found on a vulnerability with no associated service,
1624
1624
# update that vulnerability with our service information. This helps
1625
1625
# prevent dupes of the same vuln found by both local patch and
1626
- # service detection.
1626
+ # service detection.
1627
1627
if rids and rids . length > 0
1628
1628
vuln = find_vuln_by_refs ( rids , host , service )
1629
1629
vuln . service = service if vuln
@@ -1651,7 +1651,7 @@ def report_vuln(opts)
1651
1651
else
1652
1652
vuln = host . vulns . find_by_name ( name )
1653
1653
end
1654
-
1654
+
1655
1655
unless vuln
1656
1656
1657
1657
vinf = {
@@ -1660,7 +1660,7 @@ def report_vuln(opts)
1660
1660
:info => info
1661
1661
}
1662
1662
1663
- vinf [ :service_id ] = service . id if service
1663
+ vinf [ :service_id ] = service . id if service
1664
1664
vuln = Mdm ::Vuln . create ( vinf )
1665
1665
end
1666
1666
end
@@ -1681,7 +1681,7 @@ def report_vuln(opts)
1681
1681
1682
1682
# Handle vuln_details parameters
1683
1683
report_vuln_details ( vuln , details ) if details
1684
-
1684
+
1685
1685
vuln
1686
1686
}
1687
1687
end
@@ -4196,9 +4196,9 @@ def import_nexpose_rawxml(args={}, &block)
4196
4196
# Takes an array of vuln hashes, as returned by the NeXpose rawxml stream
4197
4197
# parser, like:
4198
4198
# [
4199
- # {"id"=>"winreg-notes-protocol-handler", severity="8", "refs"=>[{"source"=>"BID", "value"=>"10600"}, ...]}
4200
- # {"id"=>"windows-zotob-c", severity="8", "refs"=>[{"source"=>"BID", "value"=>"14513"}, ...]}
4201
- # ]
4199
+ # {"id"=>"winreg-notes-protocol-handler", severity="8", "refs"=>[{"source"=>"BID", "value"=>"10600"}, ...]}
4200
+ # {"id"=>"windows-zotob-c", severity="8", "refs"=>[{"source"=>"BID", "value"=>"14513"}, ...]}
4201
+ # ]
4202
4202
# and transforms it into a struct, containing :id, :refs, :title, and :severity
4203
4203
#
4204
4204
# Other attributes can be added later, as needed.
@@ -5095,7 +5095,7 @@ def nmap_msf_service_map(proto)
5095
5095
#
5096
5096
# This method normalizes an incoming service name to one of the
5097
5097
# the standard ones recognized by metasploit
5098
- #
5098
+ #
5099
5099
def service_name_map ( proto )
5100
5100
return proto unless proto . kind_of? String
5101
5101
case proto . downcase
0 commit comments