Penetration testers who want to use nmap and other tools to scan the hosts beyond the network can utilize the Metasploit module socks4a by running the following code:
msf post(inject_host) > use auxiliary/server/socks4a msf auxiliary(socks4a) > run [*] Auxiliary module execution completed
Configure the Proxychains configuration after running the module by editing /etc/proxychains.conf and updating the socks4 configuration to port 1080 (or the port number you set in the Metasploit module), as shown in the following screenshot:
Now, the attackers will be able to run nmap directly by running proxychains nmap -vv -sV 192.168.52.129 from the Terminal.