Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo -e"Made By ClumsyLulz"
- # Check if domain is provided
- if [ -z "$1" ]; then
- echo "Usage: $0 <domain>"
- exit 1
- fi
- DOMAIN=$1
- # Get IP address
- IP=$(dig +short "$DOMAIN" | head -n 1)
- # Get open ports
- PORTS=$(nmap -p- --open -T4 "$DOMAIN" | grep -oP '(\d+)/open' | cut -d '/' -f 1 | jq -cs '.')
- # Get hostnames associated with IP
- HOSTNAMES=$(dig +short -x "$IP" | jq -Rcs '.')
- # Get CPEs (example with `nmap` scan; actual CPE detection is limited without extensive tools)
- CPES=$(nmap -sV --script vulners "$DOMAIN" -oX - | grep 'cpe:/a:' | sed 's/<.*cpe://;s/">.*//' | jq -cs '.')
- # Get vulnerabilities (example using a vulnerability database; requires `vulners` nmap script)
- VULNS=$(nmap -sV --script vulners "$DOMAIN" -oX - | grep -oP 'CVE-[0-9]{4}-[0-9]+' | jq -cs '.')
- # Collect tags (Example: SSL, self-signed cert detection with `curl`)
- SSL_CHECK=$(curl -I https://"$DOMAIN" 2>&1 | grep -i 'self-signed' && echo '"self-signed"' || echo '""')
- TAGS=$(echo "$SSL_CHECK" | jq -cs '.')
- # Build the JSON structure
- JSON=$(jq -n \
- --argjson cpes "$CPES" \
- --argjson hostnames "$HOSTNAMES" \
- --arg ip "$IP" \
- --argjson ports "$PORTS" \
- --argjson tags "$TAGS" \
- --argjson vulns "$VULNS" \
- '{cpes: $cpes, hostnames: $hostnames, ip: $ip, ports: $ports, tags: $tags, vulns: $vulns}')
- # Print JSON
- echo "$JSON"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement