forked from Veil-Framework/Veil-Evasion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
a864df3
commit c1cf91a
Showing
194 changed files
with
29,797 additions
and
716 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
veil.py | ||
*.pyc |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> <br> | ||
<font color="#ffffff" face="helvetica, arial"> <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 end launcher for the Veil AV-evasion framework.<br> | ||
<br> | ||
Handles command line switches for all options. <br> | ||
A modules.commoncontroller.Controller() object is instantiated with the<br> | ||
appropriate switches, or the interactive menu is triggered if no switches<br> | ||
are provided.</tt></p> | ||
<p> | ||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | ||
<tr bgcolor="#aa55cc"> | ||
<td colspan=3 valign=bottom> <br> | ||
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> | ||
|
||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> <br> | ||
<font color="#ffffff" face="helvetica, arial"> <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> <br> | ||
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr> | ||
|
||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> <br> | ||
<font color="#ffffff" face="helvetica, arial"> <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> <br> | ||
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> | ||
|
||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </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> <br> | ||
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> | ||
|
||
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> | ||
<td width="100%"><dl><dt><a name="-generateConfig"><strong>generateConfig</strong></a>(options)</dt></dl> | ||
</td></tr></table> | ||
</body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> <br> | ||
<font color="#ffffff" face="helvetica, arial"> <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> | ||
# Veil configuration file <br> | ||
#<br> | ||
# Run update.py to automatically set all these 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> <br> | ||
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> | ||
|
||
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </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> |
Oops, something went wrong.