前言之前对.htaccess文件上传漏洞的理解还是有些太浅显了,故在这里进行补充。简介.htaccess是一个配置文件,用于运行Apache网络服务器软件的网络服务器上。当.htaccess文件被放置在一个通过Apache Web服务器加载的目录中时,.htaccess文件会被Apache Web服务器软件检测并执行。这些.htaccess文件可以用来改变Apache Web服务器软件的配置,以启用/禁用Apache Web服务器软件所提供的额外功能和特性。.htaccess文件提供了针对目录改变配置的方法, 即在一个特定的文档目录中放置一个包含一条或多条指令的文件, 以作用于此目录及其所有子目录。作为用户,所能使用的命令受到限制。管理员可以通过 Apache 的 AllowOverride 指令来设置。.htaccess文件上传漏洞我们可以通过上传.htaccess来将图片文件解析为可执行文件,来执行我们上传的图片马。常见利用方法#在当前目录下,所有文件都会被解析成php代码执行 <IfModule > SetHandler application/x-httpd
一、源码审计进入靶场,发现有一个表单和源码展示链接。先看源码,进行审计。include 'config.php'; // FLAG is defined in config.php if (preg_match('/config\.php\/*$/i', $_SERVER['PHP_SELF'])) { exit("I don't know what you are thinking, but I won't let you read it :)"); } if (isset($_GET['source'])) { highlight_file(basename($_SERVER['PHP_SELF'])); exit(); } //------------------分界线------------------ $secret = bin2hex(random_bytes(64)); if (isset($_POST['guess'])) { $guess = (string) $_POST['guess']; if (ha
一、代码审计打开靶场,获得以下代码:// php版本:5.4.44 header("Content-type: text/html; charset=utf-8"); highlight_file(__FILE__); class evil{ public $hint; public function __construct($hint){ $this->hint = $hint; } public function __destruct(){ if($this->hint==="hint.php") @$this->hint = base64_encode(file_get_contents($this->hint)); var_dump($this->hint); } function __wakeup() { if ($this->hint != "
道格安全CTF-EZSSRF1. 代码审计进入靶场,我们发现一页PHP代码。<?php highlight_file(__FILE__); //find something in flag1.php <-- 提示1 $d = $_GET['d']; $file = $_GET['ctf']; if (filter_var($d, FILTER_VALIDATE_URL)) { $r = parse_url($d); if (isset($file)) { if (strpos($file, "lai") !== false && strpos($file, "ya") !== false) { @include($file . '.php');//解题点一 } else { die("Sorry, you can not pass"); } if (preg_matc
一、代码审计include("flag.php"); highlight_file(__FILE__); class FileHandler { protected $op; protected $filename; protected $content; function __construct() { $op = "1"; $filename = "/tmp/tmpfile"; $content = "Hello World!"; $this->process(); } public function process() { if($this->op == "1") { $this->write(); } else if($this->op == "2") {
Equinox
一个乐于分享的网安人