I'm running kali and metasploitable2 in Virtualbox, and have them connected via the host-only networking mode. I can ping and ssh from kali to metasploitable, and have assigned the following IP addresses: 192.168.56.1 (kali) and 192.168.56.13 (metasploitable). For some reason, I was unable to see most open ports when running a simple scan:
kali$ nmap -sV 192.168.56.13 Starting Nmap 7.70 ( https://nmap.org ) at 2019-06-16 09:04 CEST Nmap scan report for 18.104.22.168 Host is up (0.011s latency). Not shown: 997 filtered ports PORT STATE SERVICE VERSION 80/tcp open http? 443/tcp open https? 8080/tcp open http-proxy?
But if I open another shell and run the same command I get a very different result:
kali$ nmap -sV 192.168.56.13 Starting Nmap 7.70 ( https://nmap.org ) at 2019-06-16 09:05 CEST Nmap scan report for 192.168.56.13 Host is up (0.00029s latency). Not shown: 977 closed ports PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 2.3.4 22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0) 23/tcp open telnet Linux telnetd 25/tcp open smtp Postfix smtpd 53/tcp open domain ISC BIND 9.4.2 80/tcp open http Apache httpd 2.2.8 ((Ubuntu) DAV/2) 111/tcp open rpcbind 2 (RPC #100000) 139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP) 445/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP) 512/tcp open exec netkit-rsh rexecd --- snip ----
This is a potentially very much a beginner question but what could be giving these differences between the shells? The env variables were identical in both.