Skip to content

Commit 200d640

Browse files
committed
Fully-qualify Msf::ServiceState
MSP-11152 Replace unqualified `ServiceState` with `Msf::ServiceState`.
1 parent 9f32cbd commit 200d640

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

lib/msf/core/db_manager/service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def report_service(opts)
9595
dlog("Unknown attribute for Service: #{k}")
9696
end
9797
}
98-
service.state ||= ServiceState::Open
98+
service.state ||= Msf::ServiceState::Open
9999
service.info ||= ""
100100

101101
if (service and service.changed?)
@@ -118,7 +118,7 @@ def report_service(opts)
118118
def services(wspace = workspace, only_up = false, proto = nil, addresses = nil, ports = nil, names = nil)
119119
::ActiveRecord::Base.connection_pool.with_connection {
120120
conditions = {}
121-
conditions[:state] = [ServiceState::Open] if only_up
121+
conditions[:state] = [Msf::ServiceState::Open] if only_up
122122
conditions[:proto] = proto if proto
123123
conditions["hosts.address"] = addresses if addresses
124124
conditions[:port] = ports if ports

lib/msf/core/rpc/v10/rpc_db.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def rpc_services( xopts)
181181
offset = opts.delete(:offset) || 0
182182

183183
conditions = {}
184-
conditions[:state] = [ServiceState::Open] if opts[:only_up]
184+
conditions[:state] = [Msf::ServiceState::Open] if opts[:only_up]
185185
conditions[:proto] = opts[:proto] if opts[:proto]
186186
conditions["hosts.address"] = opts[:addresses] if opts[:addresses]
187187
conditions[:port] = Rex::Socket.portspec_to_portlist(opts[:ports]) if opts[:ports]
@@ -381,7 +381,7 @@ def rpc_get_service(xopts)
381381
sret = host.services.find_by_proto_and_port(opts[:proto], opts[:port])
382382
elsif(opts[:proto] && opts[:port])
383383
conditions = {}
384-
conditions[:state] = [ServiceState::Open] if opts[:up]
384+
conditions[:state] = [Msf::ServiceState::Open] if opts[:up]
385385
conditions[:proto] = opts[:proto] if opts[:proto]
386386
conditions[:port] = opts[:port] if opts[:port]
387387
conditions[:name] = opts[:names] if opts[:names]

scripts/resource/auto_brute.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ end
7272
framework.db.hosts.each do |host|
7373
host.services.each do |serv|
7474
next if not serv.host
75-
next if (serv.state != ServiceState::Open)
75+
next if (serv.state != Msf::ServiceState::Open)
7676

7777
# for now we only brute force these services, you can add some more ...
7878
next if not (serv.name =~ /smb/ or

scripts/resource/auto_cred_checker.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ framework.db.creds.each do |creds|
5656
framework.db.hosts.each do |host|
5757
host.services.each do |serv|
5858
next if not serv.host
59-
next if (serv.state != ServiceState::Open)
59+
next if (serv.state != Msf::ServiceState::Open)
6060
# for now we only check these services, you can add some more ...
6161
next if not (serv.name =~ /smb/ or
6262
serv.name =~ /microsoft-ds/ or

scripts/resource/auto_pass_the_hash.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ framework.db.creds.each do |creds| # just checking if we have any smb_hashes in
8080

8181
host.services.each do |serv|
8282
next if not serv.host
83-
next if (serv.state != ServiceState::Open)
83+
next if (serv.state != Msf::ServiceState::Open)
8484
next if (serv.name !~ /smb/)
8585

8686
print_line("using psexec - Pass the hash")

scripts/resource/autocrawler.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ end
3434
framework.db.workspace.hosts.each do |host|
3535
host.services.each do |serv|
3636
next if not serv.host
37-
next if (serv.state != ServiceState::Open)
37+
next if (serv.state != Msf::ServiceState::Open)
3838
next if (serv.name !~ /http/)
3939

4040
if(verbose == 1)

scripts/resource/basic_discovery.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ run_single("unsetg RHOSTS") # we dont need it anymore
114114
framework.db.workspace.hosts.each do |host|
115115
host.services.each do |serv|
116116
next if not serv.host
117-
next if (serv.state != ServiceState::Open)
117+
next if (serv.state != Msf::ServiceState::Open)
118118
#next if (serv.name =~ /smb/ or serv.name =~ /microsoft-ds/ or serv.name =~ /netbios/ or serv.port == 445 or serv.port == 139 or serv.port == 137 or serv.name =~ /smtp/ or serv.port == 25 or serv.name =~ /snmp/ or serv.port == 161 or serv.name =~ /ssh/ or serv.port == 22 or serv.name =~ /telnet/ or serv.port == 23)
119119
if (serv.name =~ /smb/ or serv.name =~ /microsoft-ds/ or serv.name =~ /netbios/ or serv.port == 445 or serv.port == 139 or serv.port == 137)
120120
if(serv.port == 445)

scripts/resource/port_cleaner.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ counter = 0
1616
framework.db.hosts.each do |host|
1717
host.services.each do |serv|
1818
next if not serv.host
19-
if (serv.state != ServiceState::Open)
19+
if (serv.state != Msf::ServiceState::Open)
2020
print_line("cleaning closed services (Port: #{serv.port.to_i} / Host: #{host.address})")
2121
run_single("services -d -p #{serv.port.to_i} -r #{serv.proto} #{host.address}")
2222
counter = counter + 1

scripts/resource/wmap_autotest.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ end
4747
framework.db.hosts.each do |host|
4848
host.services.each do |serv|
4949
next if not serv.host
50-
next if (serv.state != ServiceState::Open)
50+
next if (serv.state != Msf::ServiceState::Open)
5151
next if (serv.name !~ /http/)
5252

5353
if(verbose == 1)

0 commit comments

Comments
 (0)