In this article, my first one, I decided to talk about a tool that I developed in June of 2017. This tool is designed to bypass AVs. I called it BPAV (ByPass AntiVirus). It doesn't use any framework neither metasploit nor another and it's written in C#. No packers and no obfuscation softwares were used.
To develop such tool, a good knowledge of Memory Management and especially PE file structure are a MUST.
The Story
I used to see all the videos of Marcus Murray from TrueSec about security. All began when I saw his video Ignite 2015, where he presented a tool called "hidevirus". I liked the idea of bypassing AVs but had no idea how it could be done. Since there's no trace of the tool on internet, I decided to develop it by my own in my free time. It was challenging.
It doesn't use any advanced technique. It's just based on changing the signature of the input file (virus file) by encrypting it and generating a new executable file that will decrypt and execute the virus file at runtime.
Initial Testing and Results
In almost of my tests, I used Mimikatz as input file. As shown below, it was detected as a virus by 45 / 66 AV Engines.
BPAV generates each time a new file with a different signature even if the input file is the same.
The first attempt was quite good. Just 6 on 58 AV engines (scanned using VirusTotal) detected the virus. This was in June 2017. But few months later, the number of AV detecting the virus was growing. In (maybe) April 2018, the number reached 13 on 65.
Evolution and Adaptation
This technique didn't stop the number of AV engines detecting the virus from growing. It was clear that it's not about signatures since they change every time, it's about behavior of the generated file execution.
Advanced Technique Implementation
It consists on changing some behavior of execution and generating two files: the first is the generated executable file and the second is the encrypted input file (virus file) with ".dat" extension. Of course, this means that the second file is not a PE file.
Results Analysis
Below, the result of VirusTotal after scanning the generated executable file.
Below, the result of VirusTotal after scanning the generated non-executable file.
In the tests I did, the biggest number of AV engines which detected the virus was 4 on 66. This was good enough and makes me satisfied (for the moment).
Key Findings
- Signature-based detection can be bypassed through encryption and obfuscation
- Behavioral analysis is becoming more prevalent in modern AV solutions
- Multi-file approaches can reduce detection rates significantly
- Continuous adaptation is required as AV engines evolve
Conclusion
The BPAV tool demonstrates how relatively simple techniques can be effective against traditional signature-based antivirus solutions. However, the increasing adoption of behavioral analysis and machine learning in modern security solutions continues to raise the bar for evasion techniques.
Organizations should adopt a multi-layered security approach that doesn't rely solely on antivirus solutions, incorporating network monitoring, endpoint detection, user behavior analytics, and regular security assessments.
Discussion
Leave a Reply
Your email address will not be published.