This script automates the process of checking the installation of necessary tools, verifying the anonymity of the local server, and performing network reconnaissance tasks on a remote server.
- Log File Creation: Checks if a log file exists; if not, creates one.
- Tool Installation Check: Verifies if
tor,sshpass, andnipeare installed; installs them if not. - IP Anonymity Check: Determines the country of the current IP address and verifies anonymity.
- Remote Server Connection: SSH into a remote server if the local server is spoofed.
- Nmap Scan: Performs an Nmap scan on the remote server to check for open ports.
- Whois Scan: Executes a Whois scan on a target domain or IP on the remote server.
- File Transfer: Retrieves the saved Whois scan file from the remote server via FTP.
- Activity Logging: Logs the date and time of the Whois data collection in a log file.
- tor
- sshpass
- nipe
- nmap
- whois
Ensure these tools are installed on your system.
- Save the script to a file, e.g.,
network_recon.sh. - Make the script executable:
chmod +x network_recon.sh
- Run the script:
./network_recon.sh
-
Log File Creation:
- Checks if
nr.logexists in the current directory. If not, it creates the log file.
- Checks if
-
Tool Installation Check:
- Verifies the installation of
tor,sshpass, andnipe. If any tool is not installed, the script installs it.
- Verifies the installation of
-
IP Anonymity Check:
- Retrieves the current IP address and checks its country. If the IP address is from Singapore (SG), the script exits.
-
Remote Server Connection:
- Prompts the user for the remote server's IP, user, password, and the target domain/IP for the Whois scan.
- Performs an Nmap scan on the remote server to check for open ports.
- SSH into the remote server and performs a Whois scan on the target domain/IP.
- Retrieves the Whois scan file from the remote server via FTP.
-
Activity Logging:
- Logs the date and time of the Whois data collection in
nr.log.
- Logs the date and time of the Whois data collection in