当前位置:网站首页>vulnhub之darkhole_2
vulnhub之darkhole_2
2022-07-05 18:00:00 【梅_花_七】
目录
一、主机发现
二、端口扫描

三、服务版本发现
这里值得注意的就是.git,这是源码也放上来了。其他还是老样子。

四、信息收集
1.主页
主页一张图片,源码中啥都没有。

有个登录界面。

2.扫目录
大部分有用信息都指向了.git,这与我们上面收集到的信息是相同的

五、.git
注意:最好用2021版的kali,2022最新版的git clone会报错,也不知道为啥
1.下载.git
wget -r http://192.168.0.108/.git/
2.查看版本历史

3.生成最新版本源码
git clone . backup
在源码中的登录php中,我们可以看到这里进行了对输入参数进行了转义,防止注入

4.查看有漏洞的那一版
这里在转换分支的时候,有时候要先执行
git stash
转换分支
git checkout a4d900a8d85e8938d3601f3cef113ee293028e10

进入查看,得到了上个版本用的账号密码。很有可能上个版本的账号密码在这个版本可以用于登录

5.登录

六、sqlmap注入
1' 无回显结果。
1'and+1=1--+ 和1输出结果相同。
证明存在sql注入,sqlmap跑一下
burp抓包,
(1)跑库
sqlmap -r ~/Desktop/1 --dbs
四个默认库,一个darkhole_2

(2)跑表

(3)dump下来
ssh:

users:

七、ssh登录
1.
拿到了一个jehad的shell。

在信息收集中,我们看到.bash_history中有很多提示信息。这里给了我们提示,做一个端口转发,然后来执行命令。

2.9999端口服务信息
内容:

ps -aux | grep 9999
可以看到程序是以losy运行的,我们利用他执行反弹shell后得到一个losy的shell

八、端口转发
为什么要做这个端口转发呢,因为我们在kali端访问不到目标靶机9999端口部署的服务脚本。
这里的127.0.0.1视为目标靶机(远程目标)的地址。
当然其实我们可以直接用拿到的jehad这个用户,在本地执行命令。
1.kali端
ssh -L 9633:127.0.0.1:9999 [email protected]
在端口转发后我们可以在kali端实现命令执行操作。

2.反弹shell
在.bash_history其实给我们提供了几种反弹shell的方式,其实就是黑客在入侵时尝试的几种方式,但是好像是都没用

进行url编码:

提交后成功反弹。

九、losy信息收集
升级shell,密码都告诉我们了

十、sudo提权

用上面给的python命令就行
sudo python3 -c 'import os; os.system("/bin/sh")'

十一、hydra暴力破解
lama权限过大,密码过于简单。

登陆后使用sudo提权
边栏推荐
- Zabbix
- 隐私计算助力数据的安全流通与共享
- Numerical calculation method chapter8 Numerical solutions of ordinary differential equations
- 职场进阶指南:大厂人必看书籍推荐
- 吳恩達團隊2022機器學習課程,來啦
- Generate classes from XML schema
- [utiliser Electron pour développer le Bureau sur youkirin devrait]
- Redis基础
- [JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business
- Cmake tutorial step1 (basic starting point)
猜你喜欢

Leetcode daily question: merge two ordered arrays

Leetcode exercise - 206 Reverse linked list

Tupu software digital twin | visual management system based on BIM Technology

ISPRS2020/云检测:Transferring deep learning models for cloud detection between Landsat-8 and Proba-V

ELK日志分析系统

Leetcode daily practice: rotating arrays

星环科技数据安全管理平台 Defensor重磅发布
![[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business](/img/a6/aa0b8d30913dc64f3c0cd891528c40.png)
[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business

Cmake tutorial Step2 (add Library)
![最大人工岛[如何让一个连通分量的所有节点都记录总节点数?+给连通分量编号]](/img/8b/a60fc36115580f018445e4c2a28a9d.png)
最大人工岛[如何让一个连通分量的所有节点都记录总节点数?+给连通分量编号]
随机推荐
How awesome is the architecture of "12306"?
Eliminate the writing of 'if () else{}'
【pm2详解】
第十一届中国云计算标准和应用大会 | 华云数据成为全国信标委云计算标准工作组云迁移专题组副组长单位副组长单位
Cmake tutorial Step2 (add Library)
Xiaobai getting started with NAS - quick building private cloud tutorial series (I) [easy to understand]
ISPRS2020/云检测:Transferring deep learning models for cloud detection between Landsat-8 and Proba-V
Star ring technology data security management platform defender heavy release
苹果手机炒股安全吗?打新债是骗局吗?
破解湖+仓混合架构顽疾,星环科技推出自主可控云原生湖仓一体平台
Compared with the loss of Wenxin, the performance is improved a lot
JVM第三话 -- JVM性能调优实战和高频面试题记录
node_exporter内存使用率不显示
Simulate the hundred prisoner problem
Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
ConvMAE(2022-05)
Notes on common management commands of openshift
What are the requirements for PMP certification? How much is it?
IDC report: Tencent cloud database ranks top 2 in the relational database market!
How to solve the error "press any to exit" when deploying multiple easycvr on one server?