Gehacktes-Overview

#!/bin/bash

# Prompt the user for input
read -p "Enter the IP address: " ip
read -p "Enter the domain name: " domain

# Check if the IP and domain are not empty
if [ -z "$ip" || -z "$domain" ]; then
   echo "IP or domain name cannot be empty."
   exit 1
fi

# Add entry to /etc/hosts
echo "$ip $domain" | sudo tee -a /etc/hosts

# Create a new folder in the home directory with the domain name
mkdir -p "$HOME/projects/$domain"

# Create a note file inside the new folder
touch "$HOME/projects/$domain/note.txt"

# Run the nmap scan and save the results to a file
nmap -sC -sV "$ip" -oN "$HOME/projects/$domain/nmapResult"

echo "Operation completed successfully."