Skip to content

Commit aa03db1

Browse files
author
Brent Cook
committed
update meterpreter scripts to check the right prerequisites
1 parent 0ae6142 commit aa03db1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+57
-62
lines changed

scripts/meterpreter/arp_scanner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def save_found(found_ip)
102102
save2log = true
103103
end
104104
}
105-
if client.platform =~ /win32|win64/
105+
if client.platform == 'windows'
106106
if args.length > 0
107107
if save2log
108108
save_found(arp_scan(cidr2scan))

scripts/meterpreter/checkvm.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def qemuchk(session)
344344

345345
end
346346

347-
if client.platform =~ /win32|win64/
347+
if client.platform == 'windows'
348348
print_status("Checking if target is a Virtual Machine .....")
349349
found = hypervchk(session)
350350
found = vmwarechk(session) if not found

scripts/meterpreter/credcollect.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,9 @@
2626
end
2727
}
2828

29-
if client.platform =~ /win32|win64/
29+
if client.platform == 'windows'
3030
# Collect even without a database to store them.
31-
if client.framework.db.active
32-
db_ok = true
33-
else
34-
db_ok = false
35-
end
36-
31+
db_ok = client.framework.db.active
3732

3833
# Make sure we're rockin Priv and Incognito
3934
client.core.use("priv") if not client.respond_to?("priv")

scripts/meterpreter/domain_list_gen.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def reg_getvaldata(key,valname)
5656
# Create Filename info to be appended to downloaded files
5757
filenameinfo = "_" + ::Time.now.strftime("%Y%m%d.%M%S")
5858

59-
unsupported if client.platform !~ /win32|win64/i
59+
unsupported if client.platform != 'windows'
6060

6161
# Create a directory for the logs
6262
logs = ::File.join(Msf::Config.log_directory, 'scripts','domain_admins')

scripts/meterpreter/dumplinks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def get_time(lo_byte, hi_byte)
369369
end
370370
return time
371371
end
372-
if client.platform =~ /win32|win64/
372+
if client.platform == 'windows'
373373
enum_users(os).each do |user|
374374
if user['userpath']
375375
print_status "Extracting lnk files for user #{user['username']} at #{user['userpath']}..."

scripts/meterpreter/duplicate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
'RunAsJob' => true
8585
)
8686

87-
if client.platform =~ /win32|win64/
87+
if client.platform == 'windows'
8888
server = client.sys.process.open
8989

9090
print_status("Current server process: #{server.name} (#{server.pid})")

scripts/meterpreter/enum_firefox.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def kill_firefox
254254
kill_frfx = true
255255
end
256256
}
257-
if client.platform =~ /win32|win64/
257+
if client.platform == 'windows'
258258
if frfxchk
259259
user = @client.sys.config.getuid
260260
if not is_system?

scripts/meterpreter/enum_logged_on_users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def ls_current
8989
ls_current
9090
end
9191
}
92-
if client.platform =~ /win32|win64/
92+
if client.platform == 'windows'
9393
if args.length == 0
9494
print_line "Meterpreter Script for enumerating Current logged users and users that have loged in to the system."
9595
print_line(@@exec_opts.usage)

scripts/meterpreter/enum_powershell_env.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def enum_powershell
124124

125125
end
126126
end
127-
if client.platform =~ /win32|win64/
127+
if client.platform == 'windows'
128128
enum_powershell
129129
else
130130
print_error("This version of Meterpreter is not supported with this Script!")

scripts/meterpreter/enum_putty.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def enum_saved_sessions(reg_key_base)
9191
end
9292
end
9393
end
94-
if client.platform =~ /win32|win64/
94+
if client.platform == 'windows'
9595
hkcu_base.each do |hkb|
9696
if check_putty(hkb)
9797
enum_known_ssh_hosts(hkb)

0 commit comments

Comments
 (0)