Skip to content

Commit

Permalink
Released.: Version 2.0
Browse files Browse the repository at this point in the history
Added....: payloads: powershell, c#, native (hyperion/pecrypter)
Added....: python encrypter "pyherion" functionality
Added....: ./tools/ directory "pyherion" crypter standalone
Added....: automatic loading of payload modules
Added....: automatic loading of metasploit payloads available and config option extraction
Added....: tab completion of available msfvenom payload modules
Added....: ability to specify any metasploit payload for shellcode generation
Added....: command line switches
Added....: Output folder for payload source/compiled .exes
Added....: ./doc/ folder for autogenerated pydoc documentation
Added....: ./config/* for configuration of various options
Added....: created tab completion for almost all menus
Modified.: Massive refactor of most of the code base
Modified.: Payload files won't overwrite (automatic renaming)
Modified.: Payload files properly modularized
Modified.: Eliminated /auxiliary/ folder, combined everything /common/
Modified.: Standardized doc strings so pydoc will work properly
Modified.: Cosmetics
  • Loading branch information
thegrayhound committed Jun 17, 2013
1 parent a864df3 commit c1cf91a
Show file tree
Hide file tree
Showing 194 changed files with 29,797 additions and 716 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
[06.16.2013]
Released.: Version 2.0
Added....: payloads: powershell, c#, native (hyperion/pecrypter)
Added....: python encrypter "pyherion" functionality
Added....: ./tools/ directory "pyherion" crypter standalone
Added....: automatic loading of payload modules
Added....: automatic loading of metasploit payloads available and config option extraction
Added....: tab completion of available msfvenom payload modules
Added....: ability to specify any metasploit payload for shellcode generation
Added....: command line switches
Added....: Output folder for payload source/compiled .exes
Added....: ./doc/ folder for autogenerated pydoc documentation
Added....: ./config/* for configuration of various options
Added....: created tab completion for almost all menus
Modified.: Massive refactor of most of the code base
Modified.: Payload files won't overwrite (automatic renaming)
Modified.: Payload files properly modularized
Modified.: Eliminated /auxiliary/ folder, combined everything /common/
Modified.: Standardized doc strings so pydoc will work properly
Modified.: Cosmetics

[06.01.2013]
Released.: Version 1.2
Added....: C-based payloads (many more coming)
Added....: Ability to use custom shellcode.
Modified.: Organized payloads by language.
Modified.: Split all payloads into single files.
Modified.: Costmetics
Modified.: Cosmetics

[05.31.2013]
Released.: Version 1.1.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Veil is a tool designed to generate metasploit payloads that bypass common anti-virus solutions.

Veil is currently under active support by @ChrisTruncer, @TheMightyShiv, and @the_grayhound.
Veil is currently under active support by @ChrisTruncer, @TheMightyShiv, @The_Grayhound

Greetz:
@jasonjfrank
Expand Down
88 changes: 82 additions & 6 deletions Veil.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,87 @@
#!/usr/bin/python

# Module Import
"""
Front end launcher for the Veil AV-evasion framework.
Handles command line switches for all options.
A modules.commoncontroller.Controller() object is instantiated with the
appropriate switches, or the interactive menu is triggered if no switches
are provided.
"""

# Import Modules
import sys
import argparse
import time

from modules.common import controller
from modules.common import messages
from modules.common import msfparams
from modules.common import supportfiles
from config import veil

if __name__ == '__main__':
try:
# keep Veil.pyc from appearing?
sys.dont_write_bytecode = True

parser = argparse.ArgumentParser()
parser.add_argument('-l', metavar="LANGUAGE", nargs='?', const="list", help='Language of payload to generate. Lists available languages if none specified.')
parser.add_argument('-p', metavar="PAYLOAD", nargs='?', const="list", help='Payload to generate. Lists available payloads if none specified.')
parser.add_argument('-c', metavar='OPTION=value', nargs='*', help='Custom payload module options.')
parser.add_argument('-o', metavar="OUTPUTBASE", default="payload", help='Output file base to write source and compiled .exes to.')
parser.add_argument('--msfpayload', metavar="windows/meterpreter/reverse_tcp", nargs='?', help='Metasploit payload to generate.')
parser.add_argument('--msfoptions', metavar="OPTION=value", nargs='*', help='Options for the specified metasploit payload.')
parser.add_argument('--custshell', metavar="\\x00...", help='Custom shellcode string to use.')
args = parser.parse_args()

# Print main title
messages.title()

# Print Title
messages.title()
# instantiate the main controller object
controller = controller.Controller()

# use interactive menu if a language isn't specified
if not args.l:
controller.MainMenu()
sys.exit()

# list languages available if "-l" is present but no language specified
elif args.l == "list":
controller.ListLangs()
sys.exit()

# if a language is specified but a payload isn't, list available
# payload for that language
elif args.p == "list" or not args.p:
controller.ListPayloads(args.l)
sys.exit()

# pull out any required options from the command line and
# build the proper dictionary so we can set the payload manually
options = {}
if args.c:
options['required_options'] = {}
for option in args.c:
name,value = option.split("=")
options['required_options'][name] = [value, ""]

# pull out any msfvenom payloads/options
if args.msfpayload:
if args.msfoptions:
options['msfvenom'] = [args.msfpayload, args.msfoptions]
else:
options['msfvenom'] = [args.msfpayload, None]

# manually set the payload
controller.SetPayload(args.l, args.p, options)

# generate the payload code
code = controller.GeneratePayload()

# write out the payload code to the proper output file
outName = controller.OutputMenu(controller.payload, code, showTitle=False, interactive=False, OutputBaseChoice=args.o)


# Initialize MsfParams
msfparams.SetPayloadType()
# Catch ctrl + c interrupts from the user
except KeyboardInterrupt:
print "\n[!] Exiting...\n"
2 changes: 2 additions & 0 deletions config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
veil.py
*.pyc
File renamed without changes.
124 changes: 124 additions & 0 deletions config/update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#!/usr/bin/python

import platform, os, sys

"""
Take an options dictionary and update ./config/veil.py
"""
def generateConfig(options):

config = """#!/usr/bin/python
##################################################################################################
#
# Veil configuration file
#
# Run update.py to automatically set all these options.
#
##################################################################################################
"""

config += '# OS to use (Kali/Backtrack/Debian/Windows)\n'
config += 'OPERATING_SYSTEM="'+options['OPERATING_SYSTEM']+'"\n\n'

config += '# Veil base install path\n'
config += 'VEIL_PATH="'+options['VEIL_PATH']+'"\n\n'

config += '# Path to output the source of payloads\n'
config += 'PAYLOAD_SOURCE_PATH="'+options["PAYLOAD_SOURCE_PATH"]+'"\n\n'

config += '# Path to output compiled payloads\n'
config += 'PAYLOAD_COMPILED_PATH="'+options["PAYLOAD_COMPILED_PATH"]+'"\n\n'

config += '# Path to temporary directory\n'
config += 'TEMP_DIR="' + options["TEMP_DIR"] + '"\n\n'

config += '# The path to the metasploit framework, for example: /usr/share/metasploit-framework/\n'
config += 'METASPLOIT_PATH="'+options['METASPLOIT_PATH']+'"\n\n'

f = open("veil.py", 'w')
f.write(config)
f.close()

# create the output directories if they don't exist
if not os.path.exists(options["PAYLOAD_SOURCE_PATH"] ):
os.makedirs(options["PAYLOAD_SOURCE_PATH"] )
print " [*] " + options["PAYLOAD_SOURCE_PATH"] + " created"

if not os.path.exists(options["PAYLOAD_COMPILED_PATH"] ):
os.makedirs(options["PAYLOAD_COMPILED_PATH"] )
print " [*] " + options["PAYLOAD_COMPILED_PATH"] + " created"

print " [*] Configuration file successfully written to 'veil.py'\n"


if __name__ == '__main__':

options = {}

if platform.system() == "Linux":

# check /etc/issue for the exact linux distro
issue = open("/etc/issue").read()

if issue.startswith("Kali"):
print " [*] OPERATING_SYSTEM = Kali"

options["OPERATING_SYSTEM"] = "Kali"
options["METASPLOIT_PATH"] = "/usr/share/metasploit-framework/"
print " [*] METASPLOIT_PATH = /usr/share/metasploit-framework/"

elif issue.startswith("BackTrack"):
print " [*] OPERATING_SYSTEM = BackTrack"
options["OPERATING_SYSTEM"] = "BackTrack"
options["METASPLOIT_PATH"] = "/opt/metasploit/msf3/"
print " [*] METASPLOIT_PATH = /opt/metasploit/msf3/"

else:
print " [*] OPERATING_SYSTEM = Linux"
options["OPERATING_SYSTEM"] = "Linux"

msfpath = raw_input(" [>] Please enter the path of your metasploit installation: ")
options["METASPLOIT_PATH"] = msfpath

veil_path = "/".join(os.getcwd().split("/")[:-1]) + "/"
options["VEIL_PATH"] = veil_path
print " [*] VEIL_PATH = " + veil_path

options["PAYLOAD_SOURCE_PATH"] = veil_path + "output/source/"
print " [*] PAYLOAD_SOURCE_PATH = " + veil_path + "output/source/"
options["PAYLOAD_COMPILED_PATH"] = veil_path + "output/compiled/"
print " [*] PAYLOAD_COMPILED_PATH = " + veil_path + "output/compiled/"

options["TEMP_DIR"]="/tmp/"
print " [*] TEMP_DIR = /tmp/"

# not current supported
elif platform.system() == "Windows":
print " [*] OPERATING_SYSTEM = Windows"
options["OPERATING_SYSTEM"] = "Windows"

veil_path = "\\".join(os.getcwd().split("\\")[:-1]) + "\\"
options["VEIL_PATH"] = veil_path
print " [*] VEIL_PATH = " + veil_path

options["PAYLOAD_SOURCE_PATH"] = veil_path + "output\\source\\"
print " [*] PAYLOAD_SOURCE_PATH = " + veil_path + "output\\source\\"
options["PAYLOAD_COMPILED_PATH"] = veil_path + "output\\compiled\\"
print " [*] PAYLOAD_COMPILED_PATH = " + veil_path + "output\\compiled\\"

options["TEMP_DIR"]="C:\\Windows\\Temp\\"
print " [*] TEMP_DIR = C:\\Windows\\Temp\\"

msfpath = raw_input(" [>] Please enter the path of your metasploit installation: ")
options["METASPLOIT_PATH"] = msfpath

# unsupported platform...
else:
print " [!] ERROR: PLATFORM NOT SUPPORTED"
sys.exit()

generateConfig(options)
33 changes: 33 additions & 0 deletions doc/Veil.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module Veil</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>Veil</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/root/git/veil-public/Veil.py">/root/git/veil-public/Veil.py</a></font></td></tr></table>
<p><tt>Front&nbsp;end&nbsp;launcher&nbsp;for&nbsp;the&nbsp;Veil&nbsp;AV-evasion&nbsp;framework.<br>
&nbsp;<br>
Handles&nbsp;command&nbsp;line&nbsp;switches&nbsp;for&nbsp;all&nbsp;options.&nbsp;<br>
A&nbsp;modules.commoncontroller.Controller()&nbsp;object&nbsp;is&nbsp;instantiated&nbsp;with&nbsp;the<br>
appropriate&nbsp;switches,&nbsp;or&nbsp;the&nbsp;interactive&nbsp;menu&nbsp;is&nbsp;triggered&nbsp;if&nbsp;no&nbsp;switches<br>
are&nbsp;provided.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>

<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="argparse.html">argparse</a><br>
<a href="modules.common.controller.html">modules.common.controller</a><br>
</td><td width="25%" valign=top><a href="modules.common.messages.html">modules.common.messages</a><br>
<a href="modules.common.supportfiles.html">modules.common.supportfiles</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
<a href="time.html">time</a><br>
</td><td width="25%" valign=top><a href="config.veil.html">config.veil</a><br>
</td></tr></table></td></tr></table>
</body></html>
23 changes: 23 additions & 0 deletions doc/config.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package config</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>config</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/root/git/veil-public/config/__init__.py">/root/git/veil-public/config/__init__.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>

<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="config.update.html">update</a><br>
</td><td width="25%" valign=top><a href="config.veil.html">veil</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table>
</body></html>
32 changes: 32 additions & 0 deletions doc/config.update.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module config.update</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="config.html"><font color="#ffffff">config</font></a>.update</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/root/git/veil-public/config/update.py">/root/git/veil-public/config/update.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>

<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="platform.html">platform</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>

<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-generateConfig"><strong>generateConfig</strong></a>(options)</dt></dl>
</td></tr></table>
</body></html>
32 changes: 32 additions & 0 deletions doc/config.veil.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module config.veil</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="config.html"><font color="#ffffff">config</font></a>.veil</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/root/git/veil-public/config/veil.py">/root/git/veil-public/config/veil.py</a></font></td></tr></table>
<p><tt>##################################################################################################<br>
#<br>
#&nbsp;Veil&nbsp;configuration&nbsp;file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
#<br>
#&nbsp;Run&nbsp;update.py&nbsp;to&nbsp;automatically&nbsp;set&nbsp;all&nbsp;these&nbsp;options.<br>
#<br>
##################################################################################################</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>

<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>METASPLOIT_PATH</strong> = '/usr/share/metasploit-framework/'<br>
<strong>OPERATING_SYSTEM</strong> = 'Kali'<br>
<strong>PAYLOAD_COMPILED_PATH</strong> = '/root/git/veil-public/output/compiled/'<br>
<strong>PAYLOAD_SOURCE_PATH</strong> = '/root/git/veil-public/output/source/'<br>
<strong>TEMP_DIR</strong> = '/tmp/'<br>
<strong>VEIL_PATH</strong> = '/root/git/veil-public/'</td></tr></table>
</body></html>
Loading

0 comments on commit c1cf91a

Please sign in to comment.