Skip to main content

Antivirus Evasion : Bypassing AV with Veil.

Prerequisites

You should know how the basics of generating payloads using metasploit, i.e. have a basic idea about pentesting. I have covered these already, and won't do so again.
If you haven't got the prerequisites covered, I'd suggesting you start by hacking into an unpatched Windows XP machine.

Install Veil-evasion

This is one the rare moments when you actually have to install a hacking tool in Kali Linux. That said, the process is incredibly simple, and a simple apt-get will work.
sudo apt-get update
sudo apt-get install veil-evasion



 Type veil-evasion in the terminal and you'll be asked if you want to continue with the installation.
Type y. Wait for the installation to finish. It could take a while. The installation would ask you to install Python & Ruby (don't change installation directories even if it says that Python is already installed), which is just a matter of clicking next and finish.

Veil Evasion - Creating a simple payload

Type veil-evasion on the terminal to start it.
1) Type list to see available payloads.
list
2) Use any payload you want to. I'm using python/shellcode_inject/flat. Type
use python/shellcode_inject/flat
3) You can use set option to change any values you want to change. We don't need that right now. Type info to see the settings you can change.
info
4) Type generate
generate
5) Choose option 1
6) Press enter, or if you want to use some other exploit, then type it's name.
7) Enter LHOST (listener IP, i.e. your IP from ifconfig) and LPORT (any unused port works), enter any extra  msfoptions you want to enter (not required here). Enter any name you want.
8) Give your payload a name. Then choose 1 or 2 for Payload creation method. I chose 1.



Your payload will get generated in a bit. Don't upload it to online scanners, since they distribute it to different AV companies and the detection rate increases.
PS: If  you are having issues, scroll down to the troubleshooting section below.

Veil Evasion - Creating An encrypted payload

Let's try to create an encypted payload, one which will be undetectable by most AVs.

We'll use AES encryption to encrypt the payload. This is a pretty strong algorithm and should provide pretty low detection rate.

1) Select the payload (this step is the only difference between the encrypted payload and simple payload)
use python/shellcode_inject/aes_encrypt
Don't be confused by the directory at which I currently am in (/Veil-Evasion/Setup)
in all the screenshots.
I created a troubleshooting section below for which I was in this directory, and never
switched back to home directory. This doesn't change anything.
2) Look at the parameters/options that we can choose
info
3) Change anything you want to change. I'm not changing anything and using all the default options.
4) Generate the encrypted payload.
generate
5) Choose option 1, press enter for default payload. Follow the same procedure as the previous case. Choose the LHOST, LPORT.
6) Give your payload a name. I call it veiled.

7) Choose 1 (pyinstaller).

Generated executable can be seen here-
/usr/share/veil-output/compiled/veiled.exe
This is the second payload I created with the name veiled so it got changed to
veiled1.exe
That's it, you now have a payload that can bypass a lot of AVs easily.

Troubleshooting

If you're getting this error
ERROR: Can't find python.exe in /root/.config/wine/veil/drive_c/Python27/
Then it means apt-get failed you, and there are some uninstalled/mis-configured dependencies
Try this solution-
git clone https://github.com/Veil-Framework/Veil-Evasion.git 
It's going to be approximately a 300 MB download.

 then
cd Veil-Evasion/setup/
then
./setup.sh -c
This step may take some time. You'll have to wait.
You'll have to install a lot of stuff including python, ruby, etc. with Wine

then
cd ../setup/
then
python update.py
This should fix the issues.

Tinkering

I just generated an encrypted payload without a lot of tinkering. You can play with the options, try out everything that veil offers, and get a much more 'veiled' payload. As far as bypassing antiviruses is concerned, experimentation is key. Keep trying out different options till one generates a payload that your target AV won't detect.

Comments

Popular posts from this blog

The 20 Most Popular Hacking Tools for "Kali Linux"

Top 20 Most Popular Hacking Tools for "Kali Linux". I n the world of cyber security, there are many tools available on the internet, many of them are free and others are paid. 1.  Aircrack-ng Aircrack-ng.org is an 802.11 WEP and WPA-PSK keys breaking program that can resolve keys once enough information regarding the term stolen. It executes the standard FMS attack alongside a few improvements like KoreK breachand additionally the all-new PTW attack, in this way making the assault much quicker contrasted with other WEP splitting devices. Actually, Aircrack-ng is an arrangement of software for evaluating remote systems. 2.  sqlmap sqlmap is an open source infiltration testing device that robotized the procedure of recognizing and abusing SQL infusion imperfections and assuming control of database servers. Full support for  MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase, SAP MaxDB and HSQLDB  data...

Fix Windows Update Problems Using "Automatic Reset Script"

Fix Windows Update Problems Using "Automatic Reset Script " Almost all Windows users are aware of the built-in “ Windows Update ” program or service which keeps Windows updated by downloading and installing latest updates, service packs, drivers and hotfixes released by Microsoft. But sometimes users face various problems related to Windows Update such as not being able to download or install updates, getting random error messages, not being able to search for new updates, etc. These kind of issues can occur when Windows Update database or components are corrupted, one or more services related to Windows Update are not running, etc. Today in this article, we are going to share a simple  batch script which can help you in fixing various kind of issues  related to Windows Update.  This script can be used in all Windows versions . This batch script simply resets Windows Update components such as system folders (catroot2, SoftwareDistribution, etc) and services (B...

Tutorial on Hacking with Kali Linux.

Hacking With Kali Linux   Why Kali Linux? With Kali Linux, hacking becomes much easier since you have all the tools (more than 300 pre-installed tools) you are probably ever gonna need. Others can be downloaded easily. Now this tutorial will get you started and you'll be hacking with Kali Linux before you know it.       The problem with beginners   Now, I've been dealing with beginners since a long time (and myself was one for a long time too). What they want is magic. A tool which is easy to use, works on Windows, can be download by searching on Google and clicking on the first link we see, and will do all the hacking itself on the push of a button. Sadly, no such tool exists (lets be real, would you use Facebook if a tool existed which you could install on Windows, simply type the person's username/mobile number/email and then just like that get his/her Facebook password?).  Hacking is an art, and it takes years of practice to maste...