<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>post on Hugo ʕ•ᴥ•ʔ Bear Blog</title><link>https://blog.chenxuexin.com/blog/post/</link><description>Recent content in post on Hugo ʕ•ᴥ•ʔ Bear Blog</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><copyright>Copyright © 2020, Jane Doe.</copyright><lastBuildDate>Thu, 24 Apr 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.chenxuexin.com/blog/post/index.xml" rel="self" type="application/rss+xml"/><item><title>Observation of SQL Injection</title><link>https://blog.chenxuexin.com/blog/observation-of-sql-injection/</link><pubDate>Thu, 24 Apr 2025 00:00:00 +0000</pubDate><guid>https://blog.chenxuexin.com/blog/observation-of-sql-injection/</guid><description>Pulling the Image and Starting the sqli-lab Container First, pull and start the sqli-lab container using Docker:
docker run -dt --name sqli-lab -p 80:80 acgpiano/sqli-labs:latest Once started, you should be able to access http://localhost.
Installing the Database Visit http://localhost/sql-connections/setup-db.php to install the SQL injection lab database.
Accessing the Injection Lab Page Next, visit the following URL to access the SQL injection lab page:
http://localhost/Less-1/ Performing SQL Queries Try accessing:
http://localhost/Less-1/?id=1 At this point, the page will execute an SQL query and display the corresponding content:</description></item><item><title>SQL 注入的观测</title><link>https://blog.chenxuexin.com/blog/sql-%E6%B3%A8%E5%85%A5%E7%9A%84%E8%A7%82%E6%B5%8B/</link><pubDate>Thu, 24 Apr 2025 00:00:00 +0000</pubDate><guid>https://blog.chenxuexin.com/blog/sql-%E6%B3%A8%E5%85%A5%E7%9A%84%E8%A7%82%E6%B5%8B/</guid><description>拉取镜像并启动 sqli-lab 容器 首先，通过 Docker 拉取并启动 sqli-lab 容器：
docker run -dt --name sqli-lab -p 80:80 acgpiano/sqli-labs:latest 启动完成后，你应该能够访问 http://localhost。
安装数据库 访问 http://localhost/sql-connections/setup-db.php 以安装 SQL 注入实验数据库。
访问注入实验页面 接着，访问以下 URL 进入 SQL 注入实验页面：
http://localhost/Less-1/ 进行 SQL 查询 尝试访问：
http://localhost/Less-1/?id=1 这时，页面会发起 SQL 查询，展示相应内容：
进入容器 为了进一步观察日志和数据库查询，进入 sqli-lab 容器：
docker exec -it sqli-lab bash 查看 Apache 访问日志 在容器内，使用以下命令查看 Apache 的访问日志：
tail -f /var/log/apache2/access.log 进入 MySQL 并开启日志功能 接下来，我们将进入 MySQL，开启通用查询日志以观察执行的 SQL 查询。首先进入 MySQL：
mysql -u root 然后执行以下命令开启日志功能：
mysql&amp;gt; SET global general_log = 1; mysql&amp;gt; SET global log_output = &amp;#39;FILE&amp;#39;; mysql&amp;gt; SET global general_log_file = &amp;#39;/var/lib/mysql/general.</description></item></channel></rss>