|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>IP Reputation Checker - Both Services</title> |
| 7 | + <style> |
| 8 | + body { |
| 9 | + font-family: Arial, sans-serif; |
| 10 | + background: #121212; |
| 11 | + color: #00ff00; |
| 12 | + text-align: center; |
| 13 | + padding: 20px; |
| 14 | + } |
| 15 | + input, button { |
| 16 | + padding: 10px; |
| 17 | + margin: 10px; |
| 18 | + font-size: 16px; |
| 19 | + border-radius: 5px; |
| 20 | + border: none; |
| 21 | + outline: none; |
| 22 | + } |
| 23 | + button { |
| 24 | + background: #1f1f1f; |
| 25 | + color: #00ff00; |
| 26 | + cursor: pointer; |
| 27 | + } |
| 28 | + button:hover { |
| 29 | + background: #333; |
| 30 | + } |
| 31 | + .result { |
| 32 | + margin-top: 20px; |
| 33 | + text-align: left; |
| 34 | + display: inline-block; |
| 35 | + } |
| 36 | + </style> |
| 37 | +</head> |
| 38 | +<body> |
| 39 | + <h1>IP Reputation Checker - Both Services</h1> |
| 40 | + <input type="text" id="ipInput" placeholder="Enter IP Address"> |
| 41 | + <button onclick="checkBoth()">Check Both Services</button> |
| 42 | + <div class="result" id="result"></div> |
| 43 | + |
| 44 | + <script> |
| 45 | + async function checkBoth() { |
| 46 | + const ip = document.getElementById("ipInput").value.trim(); |
| 47 | + const resultDiv = document.getElementById("result"); |
| 48 | + |
| 49 | + if (!ip) { |
| 50 | + resultDiv.innerHTML = "<p>Please enter a valid IP address.</p>"; |
| 51 | + return; |
| 52 | + } |
| 53 | + |
| 54 | + resultDiv.innerHTML = "<p>Checking AbuseIPDB and VirusTotal...</p>"; |
| 55 | + |
| 56 | + try { |
| 57 | + const abuseResponse = await fetch(`/api/abuseipdb?ip=${ip}`); |
| 58 | + const abuseData = await abuseResponse.json(); |
| 59 | + |
| 60 | + const virusResponse = await fetch(`/api/virustotal?ip=${ip}`); |
| 61 | + const virusData = await virusResponse.json(); |
| 62 | + |
| 63 | + resultDiv.innerHTML = ` |
| 64 | + <h3>Results for IP: ${ip}</h3> |
| 65 | +
|
| 66 | + <h4>AbuseIPDB</h4> |
| 67 | + <p><b>Abuse Confidence Score:</b> ${abuseData.data?.abuseConfidenceScore || "N/A"}</p> |
| 68 | + <p><b>Categories:</b> ${abuseData.data?.category?.join(", ") || "N/A"}</p> |
| 69 | + <p><b>Country:</b> ${abuseData.data?.countryCode || "N/A"}</p> |
| 70 | + <p><b>ISP:</b> ${abuseData.data?.isp || "N/A"}</p> |
| 71 | + <p><b>Domain:</b> ${abuseData.data?.domain || "N/A"}</p> |
| 72 | +
|
| 73 | + <h4>VirusTotal</h4> |
| 74 | + <p><b>Reputation:</b> ${virusData.data?.attributes?.reputation || "N/A"}</p> |
| 75 | + <p><b>Network:</b> ${virusData.data?.attributes?.network || "N/A"}</p> |
| 76 | + <p><b>Last Analysis Stats:</b> ${ |
| 77 | + virusData.data?.attributes?.last_analysis_stats |
| 78 | + ? JSON.stringify(virusData.data.attributes.last_analysis_stats) |
| 79 | + : "N/A" |
| 80 | + }</p> |
| 81 | + <p><b>Tags:</b> ${virusData.data?.attributes?.tags?.join(", ") || "N/A"}</p> |
| 82 | + <p><b>Whois:</b> ${virusData.data?.attributes?.whois || "N/A"}</p> |
| 83 | + `; |
| 84 | + } catch (error) { |
| 85 | + console.error(error); |
| 86 | + resultDiv.innerHTML = "<p>Error fetching data from both services.</p>"; |
| 87 | + } |
| 88 | + } |
| 89 | + </script> |
| 90 | +</body> |
| 91 | +</html> |
0 commit comments