Skip to content

Commit

Permalink
add manual
Browse files Browse the repository at this point in the history
  • Loading branch information
phith0n committed Jan 20, 2019
1 parent c8f7f06 commit dea9c74
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Binary file added httpd/ssi-rce/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added httpd/ssi-rce/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions httpd/ssi-rce/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Apache SSI 远程命令执行漏洞

在测试任意文件上传漏洞的时候,目标服务端可能不允许上传php后缀的文件。如果目标服务器开启了SSI与CGI支持,我们可以上传一个shtml文件,并利用`<!--#exec cmd="id" -->`语法执行任意命令。

参考链接:

- https://httpd.apache.org/docs/2.4/howto/ssi.html
- https://www.w3.org/Jigsaw/Doc/User/SSI.html

## 漏洞环境

运行一个支持SSI与CGI的Apache服务器:

```
docker-compose up -d
```

环境启动后,访问`http://your-ip:8080/upload.php`,即可看到一个上传表单。

## 漏洞复现

正常上传PHP文件是不允许的,我们可以上传一个shell.shtml文件:

![](1.png)

成功上传,然后访问shell.shtml,可见命令已成功执行:

![](2.png)

0 comments on commit dea9c74

Please sign in to comment.