842 Evading Anti Virus Detection

Download 842 Evading Anti Virus Detection

Post on 06-Apr-2018

216 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

<ul><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 1/9</p><p>* Home * Discussion Forum </p><p>* Forgotten Password * Register </p><p>HellBound Hackers </p><p>Join us at IRC! One mans freedom fighter, another's terrorist.Wednesday, December 21, 2011Navigation*Home*HellBoundHackers *Main:*</p><p>* Home / News </p><p>HellBoundHackers *Find:*</p><p>* Search </p><p>* Members </p><p>HellBoundHackers *Information:*</p><p>* Development * Newsletters * HBH Services * Media * Info for Schools </p><p>HellBoundHackers *Additional:*</p><p>* Userbar </p><p>* FAQ * Advertise * Contact HBH * Disclaimer </p><p>*Shop*</p><p>* Exclusive Membership </p><p>*Learn*</p><p>* Articles </p><p>* Lessons * Code Bank </p><p>*Communicate*</p><p>* Discussion Forum * HBH irc </p><p>*Submit*</p><p>* Submit News * Submit Link * Submit Article </p><p>* Submit Code * Submit Bug </p></li><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 2/9</p><p>*Challenges*</p><p>* Rankings * Challenge Points </p><p>HellBoundHackers *Exploit:*</p><p>* Basic Web Hacking * Application Cracking * Javascript Hacking * Realistic Challenges * Rooting Challenges * Flash Challenges * Pen-Testing Challenges </p><p>HellBoundHackers *Programming:*</p><p>* Timed Challenges </p><p>HellBoundHackers *Think:*</p><p>* Encryption * Logical * Stegano </p><p>HellBoundHackers *Track:*</p><p>* Tracking </p><p>HellBoundHackers *Patch:*</p><p>* Web Patching </p><p>* App Patching </p><p>HellBoundHackers *Other:*</p><p>* Other Challenges * S. Engineering </p><p>HellBoundHackers *Need Help?*</p><p>* HBHBot </p><p>*Interact*</p><p>* HBH Podcasts * Interview with a Hacker </p><p>*Other*HellBoundHackers *Executive:*</p><p>* Hall of Fame * Hall of Generosity </p><p>HellBoundHackers *Leisure:*</p><p>* Urban Defacements </p><p>* Link to Us </p><p>Members Online</p></li><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 3/9</p><p>Total Online: 25Web Spiders: 6Guests Online: 18Members Online: 7rock4ever56 , pangd, Jimbojams , NopPop, Galligator ,</p><p>cphackz , Evandta </p><p>Registered Members: 65508Newest Member: *Jimbojams*Latest Articles</p><p>Mapping Memory...</p><p>Javascript 16 *may c...</p><p>Advanced DLL Injecti...</p><p>Tweaking Firefox Plu...</p><p>An Intoduction to Ga...</p><p>Positional Number Sy...</p><p>Dream Interpretation...</p><p>Freewebhosts and sub...</p></li><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 4/9</p><p>The Dunning-Kruger E...</p><p>Me and my router...</p><p>Hardware Hacking Par...</p><p>Encryption 11-The si...</p><p>Realistic 13...</p><p>Uniguest bypass...</p><p>javascript16...</p><p>Evading Anti Virus Detection</p><p>FLV Blaster - Download Music and Videos Faster</p><p>website security Learn how to hide your trojans, backdoors, etc fromanti virus.</p><p>Hiding backdoors and trojans from antivirus software---------------------------------------------------------</p><p>This is a POC on how to evade detection from AV. In this article I willtry toguide you through the generic steps needed for this process, and show you byexample on a specific back door available. This is a POC and not applicableto modern AV. However, the process for developing your own encoding/decodingscheme, so that this will work, is entirely valid.</p><p>Programs usedhttp://www.white-scorpion.nl/programs/backdoor.zip -- basic back door</p></li><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 5/9</p><p>http://www.4shared.com/file/32660382/3562d77f/LordPE.html -- LordPEhttp://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm -- Hex Editorhttp://www.ollydbg.de/ -- ollydbg</p><p>General Overview----------------</p><p>We are going to start by increasing the file size of our backdoor givingus roomof our own to write code in. We will then hijack then entry point of theprogram,redirect it to our own encoder. This encoder for the POC will XOR thefile contents,and then jump back to the original starting place. XOR is a reversibleprocess, sothat when saved in this encoded state, the signatures will not matchthose in theAV database. When ran however, the same XOR loop, will decode the programwhile in memory where AV does not affect it.</p><p>Lets get started----------------</p><p>Note: Your addresses might not match mine exactly, so look at the generalstructure and you will be able to follow along.</p><p>Step - 1--------</p><p>Open up backdoor.exe (located in the bin folder) in LordPE. LordPE is aportable executable viewer and editor.</p><p>-Click on PE editor to open file-Click sections in the new windowHere we see 3 sections .text .rdata and .data. For this example we willselect .data. Right click and select edit section header.-Add 1000 hex bytes to the virtual size and the raw size.VirtualSize = 00001B4ARawSize = 00001200-Click on the (...) next to the flags and set 'Executable as code'. Thisis wherewe will build our encoder/decoder and thus need to have it executed.-Edit the section header for .text as well to writable (also underflags)-Save and close LordPE</p><p>Step - 2--------</p><p>If you tried to open your backdoor now you will notice an errorindicating it isnot a valid Win32 Application. This is because our sizes do no balance. Weindicated there were an extra 1000 hex bytes, but have not actually addedanything to the program. So we will now pad our program.</p><p>-Open it up in XVI32 (or other hex editor of your choice)-Scroll to the end of the file, and this is where we will add our 1000</p><p>hex bytes.-Edit &gt; insert (Select Hex String: 00 Insert times - choosehexadecimal $1000)</p></li><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 6/9</p><p>This inserts our 1000 bytes needed to write our code in. Now save andclose thehex editor.</p><p>If you were to run the backdoor.exe now, you will notice it does work,but still</p><p>detected by the antivirus. We have not changed our code, or signature yet.</p><p>Step - 3--------Ollydbg: I am going to assume you have a basic understanding of what olly isand how to use a few basic features.</p><p>--Preparing for our code injection--</p><p>Open the back door and first look at a few things.-Address of the entry point-Address of our 1000 hex bytes (you can select an address anywhere in</p><p>this area)</p><p>Copy the first few lines of the backdoor.exe to clipboard, and keepavailable innotepad for later reference.</p><p>Now scroll down to the padded 00 bytes and choose and address where wewill injectour encoder. For this example I am going to choose address 00401590.</p><p>--Altering the code--</p><p>First thing we will need to do now, is hijack the ModuleEntryPoint and</p><p>redirect it to oursection.</p><p>JMP 00401590 #This will force the jump from module entry point to ourcode cave</p><p>select this line and save the file. Rightclick &gt; copy to executable &gt;selection. Then save file asbackdoor_v2.exe.</p><p>Note if you change the file name from the original like I did, go aheadand close the first andopen up the altered one.</p><p>You will now notice the first two lines of code have changed.</p><p>00401000 &gt; $ E9 8B050000 JMP backdoor.0040159000401005 . 68 34 31 40 00&gt;ASCII "h41@",0</p><p>If you step 1 time in this program now you will notice you end onaddress, 00401590.Now we can begin writing our XOR loop.</p><p>MOV EAX, 0040100A # Start of encoding address.XOR BYTE PTR DS: [EAX], 5E # XOR the contents of EAX with the key 5EINC EAX # Increase EAX</p></li><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 7/9</p><p>CMP EAX, 004014EB # Tests to see if we've reached the end of our encJLE SHORT 00401595 # If not, jump back to XOR command</p><p>After this we need to put the code in that we overwrote at the beginning.</p><p>CALL 00401468PUSH 00403134</p><p>Then we will jump to the address after the push command. At address 0040100A</p><p>JMP 0040100A</p><p>At this point we now have the XOR loop written, the following commands,and a return tothe beginning. However we are not quite done yet. Save yourmodifications, and set a breakpoint (f2) after the JLE SHORT command. Now run the program, and it will</p><p>stop in at the breakpoint, and the program will now be encoded. Highlight the entire programand again save this file(backdoor_v3.exe).</p><p>The program is now entire encoded except the first few lines, and ourcode cave. When this isnow ran, it will again, jump to our XOR loop, decode itself, and thenproceed to function as itwas written.</p><p>This article was written by stdio in reference to a demo preformed byMati Aharoni (Muts).</p><p>security article Posted by stdio on July 26 2008- 12:26:10 6 Commentsevading-anti-virus-detection.html&gt; 8913 Reads Print print this tutorial </p><p>Comments</p><p>Uber0n on July 27 2008 - 09:58:10Really interesting and very well written. I'm impressed B)korg on August 19 2008 - 08:15:29Nice job. I have read most of Mati's articles I have found, He has someinteresting topics.Zephyr_Pure on August 29 2008 - 04:17:11It's very rare that I say this... but, that was a damn good article.Showed a great deal of technique and knowledge, while keeping it simple.stdio on August 29 2008 - 17:54:11Thanks for all the kind replies. However I did manage to stumble acrossa more detailed paper describing the same process written after mine.Here's the link if interested: http://www.milw0rm.com/papers/217sam207 on October 17 2008 - 07:07:53very nice one... Thanks a lot for this one..</p><p>hellboundhackersok on November 082008 - 21:28:57The backdoor program makes McAfee SiteAdvisor turn red. nice job. ahahah</p></li><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 8/9</p><p>Post Comment</p><p>*Sorry.*</p><p>You must have completed the challenge *Basic 1* and have *100 points* ormore, to be able to post.</p><p>RatingsRating is available to members only.</p><p>Please login or register to vote.------------------------------------------------------------------------Awesome! 100% [8 Votes]Very Good 0% [No Votes]Good 0% [No Votes]Average 0% [No Votes]Poor 0% [No Votes]</p><p>GuestUsername</p><p>Password</p><p>Remember Me</p><p>Bullet Register Bullet Lost Password? Bookmark This Page </p><p>AffiliatesPHP-Fusion HackThisSite Elites0ft psych0tik.blog Valhalla Adverts</p><p>160 x 600 </p><p>Links</p></li><li><p>8/3/2019 842 Evading Anti Virus Detection</p><p> 9/9</p><p>Anime Wallpaper Site </p><p>By using, viewing or obtaining any information contained on this site,you agree to the disclaimer .</p><p> HellBound Hackers 2008- 2009. Since 3rd December 2004.</p><p>19231550 Unique Visits</p><p>Powered by HBH-Fusion</p></li></ul>