Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

BYPASSING ANTIVIRUS AND ANTIVIRUS VULNERABILITIES

Aryan Jadon1, Dr. Gagandeep Kaur2


1
JIIT, Noida, India , 2Dept. of CSE & IT JIIT, Noida, India

ABSTRACT 1) Hide the code which may be recognized


This paper describes the findings of the as malicious. This is generally done
research concentrating on Bypassing using encryption.
antivirus and defense against malware. The 2) Code the decryption stub in such a way
overall goal is to study the areas of that it is not detected as a suspicious
penetration testing. The focus is on finding activity or virus not bypassed by
how the antivirus works and how to exploit
emulation /sandboxing.
its limitations and finding solutions to those
limitations. Antivirus has to deal with hundreds of file types
Malware is used to perform multiple and formats [1-6]:
offensive activities: launching distributed 1) Executable files like .exe, .dll, .msi,
denial of service attacks, collecting classified .com, .pif, .cpl, .elf , .ocx, .sys, .scr.
information etc. Consequently, testing and 2) Documents files like .doc, .xls, .ppt, .pdf,
understanding the efficiency and .rtf, .chm, .hlp.
configurations of malware defense system is
3) Compressed archives
of uttermost importance.
like .arj, .arc, .cab, .tar, .zip, .rar, .lzh , .a
The paper describes how antivirus programs
ce, .iso.
can be bypassed. it also describes how to 4) Executable packers like.
prevent your credentials from malware. The upx, .fsg, .mew, .nspack, .wwpack, .aspa
study of this paper will tell you that how an ck
antivirus programs detects any suspicious 5) Media files like .jpg, .gif, .swf, .mp3,
activity in your machine. .rm, .wmv, .avi, .wmf
Keywords: Bypassing antivirus, antivirus It is amply clear from recent research into
evasion, methods for antivirus evasion. antivirus vulnerabilities [13]. It reveals that
most vulnerabilities exist in the executable
INTRODUCTION
decompression components and data
Antivirus software is a program or set of compression components. Antivirus software
programs that are designed to prevent , search will try to decompress the compressed
for, detect and remove software viruses, and executable file and data before processing them.
other malicious software like worms , Trojans,
adware etc. There are various ways to analyses BACKGROUND STUDY
or scan any information based on where it HOW ANTIVIRUS DETECTS
comes from. MALWARE?
Antivirus is mandatory in defence in depth. 1) STATIC SIGNATURE ANALYSIS [10]
After doing some research, we came to the Signature analysis is based on a blacklist
conclusion that bypassing antivirus consists of
method. When a new malware is detected by
two steps [6-10]:
antivirus analyst, a signature is issued. Most of
the antivirus solutions are signature based.

ISSN (PRINT): 2393-8374, (ONLINE): 2394-0697, VOLUME-3, ISSUE-9, 2016


91
INTERNATIONAL JOURNAL OF CURRENT ENGINEERING AND SCIENTIFIC RESEARCH (IJCESR)

These systems search executables and other self-decrypted in antivirus sandbox, then
documents for strings of character, known to analysis of the new code can trigger some
occur in specific pieces of malware. If a file suspicious behavior. If one uses
contains the exact same string as one the string encryption/decryption stub to hide a malicious,
in the antivirus database, the file will be most antivirus will be able to detect it provide
detected as malicious otherwise it will not. they can bypass the decryption phase.
It is still possible to build a signature on an This means that bypassing dynamic analysis
encrypted malicious code when looking at implies two things:
specific instructions in decryption stub. 1. Having an undetectable self-decryption
mechanism.
From the offense side, studies have shown that 2. Prevent the antivirus to execute the
approximately more than 20,000 new stains of decryption stub.
malware appear every day [12]. For a signature
based antivirus to accurately detect all these ANTIVIRUS LIMITATIONS
strains it would require knowledge of every Dynamic analysis is a complex stuff, being able
single strain released, which is quite an to scan millions of file, running them on
impossible task. Some malware is bound to be emulated environment, checking all signatures,
missed. it also has limitations.

2) STATIC HEURISTIC ANALYSIS [10] The dynamic analysis model has three main
Static Heuristic are a branch of heuristic limitations which can be exploited [6-7]:
techniques that try to determine if a suspect 1. Scans has to very fast so there is a limit
to the number of operations it can run for
program is malicious by examining the structure
each scan at a particular time.
and contents of the program in an inactive state 2. The environment is emulated not so
and trying to find code fragments that have been aware of the specific of the machine and
commonly used for malicious end in the past. malware environment
This type of technique is especially dependent 3. The emulated/sandbox environment has
on having detailed knowledge not only of the some specification which can be
contents past malware but also the contents of detected by the malware
legitimate programs so as to avoid alerting on
the presence of code that though heavily used by Recent researches [1-5] have shown that most of
malware is also common in legitimate software. the malwares/vulnerabilities exist in executable
One of the strengths of static heuristic is that decompression and data decompression
unlike dynamic heuristic it is able to examine components.
Any mistake in these throws open door for the
multiple possible program execution paths due
vulnerabilities.
to the fact that it’s looking at all the contents of
the program instead of just code that would get BYPASSING ANTIVIRUS
executed during one particular invocation of the The more options you have to re-encode your
program. malware, the better chance you have of re-
Unfortunately, malware writers have developed encoding malware to get past of antiviruses.
a number of techniques to obfuscate their code For the antivirus evasion research purpose, we
in such way as to present a heuristic engine used shellter [16]. Shellter is a program, which
from being able to see the actual code and thus is capable of re-encoding any native 32-bit
preventing it from performing static analysis on standalone windows application.
that code.
3) Dynamic analysis [10] Since we are trying to avoid antivirus detection,
Nowadays most of the antivirus will rely on a we need to avoid anything that might look
suspicious to antivirus software such as packed
dynamic approach. When an executable is
applications or applications that have more than
scanned, it is launched in a virtual environment one section containing executable code.
for a short amount of time. Indeed, the code is

ISSN (PRINT): 2393-8374, (ONLINE): 2394-0697, VOLUME-3, ISSUE-9, 2016


92
INTERNATIONAL JOURNAL OF CURRENT ENGINEERING AND SCIENTIFIC RESEARCH (IJCESR)

Next, we have discussed various methods for Here’s the copy of the main function:
bypassing antivirus
#define MEM 100000000
1. METHOD A: int main()
We created a c code, Function 1, calling non {
encoded Meterpreter shellcode. char * memdmp=NULL;
Here’s the main function: memdmp=(char *) malloc(MEM);
int main(void) if(memdmp!=NULL){
{ memset(memdmp,00,MEM);
Decryptcodesection();
Startshellcode(); free(memdmp);
return 0; decryptCodeSection();
} startShellCode();
Function 1: C code of Meterpreter shellcode.
}
return 0;
This version of the code has a virus total score }
of 2/56 [17].
Function 2: C code of allocating 100
megabytes of memory

This version of the code has a virus total score


of 0/56[17].

FIGURE 1- Screenshot of virus total with


score of 2/56.
Figure 1 shows the screenshot of results
received from Function 1.
This shows that nowadays antivirus relies more
and more on dynamic analysis but it is not yet
the case for the majority of them.
The main limit with antivirus scanner is the
amount of time they can spend on each file. FIGURE 2- Screenshot of virus total with
During a regular system scan, antivirus will Score of 0/56.
have to analyse thousands of files.it just cannot
spend too much time or power on a single file. Figure 2 shows the screenshot of results
So based on this fact, the simplest way to bypass obtained from Function 2.
an antivirus just consist into buying enough time This method relies on classic and very common
before the code is decrypted. malloc function and does not need any strings
which could be used to build signature.
2. METHOD B:
We allocated and filled 100 megabytes of 3. METHOD C:
memory. This is enough to discourage any This time we will use non uniform memory
emulation antivirus out there. access. It is a method to configure memory
management in multiprocessing systems.it is

ISSN (PRINT): 2393-8374, (ONLINE): 2394-0697, VOLUME-3, ISSUE-9, 2016


93
INTERNATIONAL JOURNAL OF CURRENT ENGINEERING AND SCIENTIFIC RESEARCH (IJCESR)

linked to a whole set of functions declare in In this code, it will only start decryption code if
Kernal32.dll. a certain mutex object already exists on the
system. The method is that if the object does not
Here’s the copy of the main function : exist, this code will create and call a new
int main( void ) { instance to itself. The child process will try to
LPVOID mem = NULL; create the mutex before the father process dies
mem = and will fall in to the error code branch.
VirtualAllocExNuma(GetCurrentProcess Here’s the copy of the main function:
(), NULL, 1000, MEM_RESERVE |
MEM_COMMIT, int main()
PAGE_EXECUTE_READWRITE,0); {
if (mem != NULL) HANDLE mutex;
{ mutex = CreateMutex(NULL, TRUE,
decryptCodeSection(); "muuuu");
startShellCode(); if (GetLastError()
} ==ERROR_ALREADY_EXISTS) {
return 0; decryptCodeSection();
} startShellCode();
}
Function 3: C code to configure memory else
management. {
startExe("File.exe");
This version of the code has a virus total score Sleep(100);
of 0/56[17]. }
return 0;
}

Function 4 : C code for decryption of mutex


object.
This version of the code has a virus total score
of 0/56[17].

FIGURE 3- Screenshot of virus total with


score of 0/56.
Figure 3 shows the screenshot of results
obtained from Function 3.

4. METHOD D:
Antivirus are generally not able to follow parent FIGURE 4- Screenshot of virus total with
and child process. They will scan the parent and
score of 0/56.
not the child process even if it is in fact the
Figure 4 shows the screenshot of results
same code.
obtained from Function 4.

ISSN (PRINT): 2393-8374, (ONLINE): 2394-0697, VOLUME-3, ISSUE-9, 2016


94
INTERNATIONAL JOURNAL OF CURRENT ENGINEERING AND SCIENTIFIC RESEARCH (IJCESR)

DEFENSE AGAINST MALWARES 5. Maciej Korczynski, G. B.-S. (2013). Two


Recommendations against malwares: Methods for Detecting Malware.
1. Never run as administrator. It’s a golden Multimedia Communications, Services and
rule, it can avoid 99% malwares without Security.
having an AV. 6. Antivirus in security-
2. Harden the systems, with recent versions http://events.ccc.de/camp/2007/Fahrplan/att
of Windows have really strong security achments/1324AntivirusInSecuritySergiosh
features, use them. adownAlvarez.pdf
3. Invest in Network Intrusion Detection 7. Bypassing antivirus packet storm-
Systems and monitor your network. Often, https://dl.packetstormsecurity.net/papers/by
malware infections are not detected on the pass/bypassing-av.pdf
victim’s PC but thanks to weird NIDS or 8. Windows Sysinternals-
firewall logs. https://technet.microsoft.com/enus/sysintern
4. Use several AV products from different als/default.aspx
vendors. One product can cover the 9. National Vulnerabilities database- http:
weakness of another //nvd.nist. gov/home. cfm
10. Searchsecurity- http://www. searchsecurity.
CONCLUSION: techtarget.com/
In this paper we have examined the techniques 11. Help net Security
of finding vulnerabilities in antivirus software. https://www.helpnetsecurity.com/
Bypassing antivirus is simple when you exploit 12. Antivirus ware-
their weakness.it requires some knowledge on https://www.antivirusware.com/
windows system and how antivirus works. 13. Symantec Analysis –
Antivirus is useful in detecting millions of wild https://www.symantexanalysis.com
bots which are already in database, also they are 14. Search-Security-http://searchsecurity.
useful for system recovery. techtarget.com/tip/ How-antivirus-software-
works-Virus-detection-techniques
REFRENCES:
1. Lawrence Teo, Yuliang Zheng ,Gail-Joon 15. Panda Security-
Ahm.Intrusion Detection Force: An https://en.wikipedia.org/wiki/Panda_Securit
Infrastructure for Internet-Scale Intrusion y
Detection.Proceedings of the first IEEE 16. Shellter Project –
Internation Workshop on Information https://www.shellterproject.com
Assurance,2003. 17. Virus Total – https://www.virustotal.com
2. Skoudis E. Counter Hack Reloaded: A step-
by -step Guide to Computer Attacks and
Effective Defense, 2nd ed. Prentice Hall
,2006
3. I'Connor, R. (2011). Violent Python: A
Cookbook for Hackers, Forensic Analysts,
Penetration Testers and Security Engineers.
In Violent Python: A Cookbook for
Hackers, Forensic Analysts, Penetration
Testers and Security Engineers (pp. 245-
256). Syngress.
4. Jon Oberheide, M. B. (2009). PolyPack: an
automated online packing service for
optimal antivirus evasion. USENIX
association Berkeley.

ISSN (PRINT): 2393-8374, (ONLINE): 2394-0697, VOLUME-3, ISSUE-9, 2016


95

You might also like