init
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "Apache",
|
||||||
|
"host": "192.168.50.166",
|
||||||
|
"protocol": "sftp",
|
||||||
|
"port": 22,
|
||||||
|
"username": "vdev",
|
||||||
|
"remotePath": "/home/vdev/search/frontend",
|
||||||
|
"uploadOnSave": true,
|
||||||
|
"password": "omajda",
|
||||||
|
"useTempFile": false,
|
||||||
|
"openSsh": false
|
||||||
|
}
|
After Width: | Height: | Size: 126 KiB |
After Width: | Height: | Size: 5.6 KiB |
@ -0,0 +1,69 @@
|
|||||||
|
.logo {
|
||||||
|
display: block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchbar {
|
||||||
|
background: transparent;
|
||||||
|
color: white;
|
||||||
|
outline: 0.05cm solid #5f6368;
|
||||||
|
border-color: transparent;
|
||||||
|
border-radius: 25px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchbar:hover {
|
||||||
|
background: #303134;
|
||||||
|
color: white;
|
||||||
|
outline: none;
|
||||||
|
border-color: transparent;
|
||||||
|
border-radius: 25px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchContainer {
|
||||||
|
margin: auto;
|
||||||
|
width: 50%;
|
||||||
|
padding: 10px;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchbuttons {
|
||||||
|
|
||||||
|
margin-top: 3%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keywords {
|
||||||
|
overflow-wrap: break-all;
|
||||||
|
inline-size: 70%;
|
||||||
|
font-size: larger;
|
||||||
|
height: 1.25cm;
|
||||||
|
text-align: left;
|
||||||
|
padding-left: 3%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin-top: 10%;
|
||||||
|
background-color: #202124;
|
||||||
|
color: white;
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-size: medium;
|
||||||
|
margin-right: 10px;
|
||||||
|
color: white;
|
||||||
|
width: 3.5cm;
|
||||||
|
height: 1cm;
|
||||||
|
background-color: #303134;
|
||||||
|
border: none;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
border: 0.05cm solid #5f6368;;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
@ -0,0 +1,108 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="Search engine that crawls IPv4 addresses, written in Golang.">
|
||||||
|
<meta name="keywords"
|
||||||
|
content="Go search engine, Golang web crawler, search indexing, information retrieval, scalable search engine, concurrent indexing">
|
||||||
|
<meta property="og:title" content="Googet - Search engine">
|
||||||
|
<meta property="og:description" content="Search engine that crawls IPv4 addresses, written in Golang.">
|
||||||
|
<meta property="og:url" content="https://googet.nazev.eu">
|
||||||
|
<meta property="og:image" content="https://googet.nazev.eu/googeticon.png">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:site_name" content="Googet">
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta name="twitter:site" content="@googet">
|
||||||
|
<meta name="twitter:title" content="Googet">
|
||||||
|
<meta name="twitter:description" content="Search engine that crawls IPv4 addresses, written in Golang.">
|
||||||
|
<meta name="twitter:image" content="https://googet.nazev.eu/googeticon.png">
|
||||||
|
<title>Googet - Search Engine</title>
|
||||||
|
<link rel="icon" type="image/png" href="https://googet.nazev.eu/googeticon.png">
|
||||||
|
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"> -->
|
||||||
|
<link rel="stylesheet" href="index.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<img src="goget_logo.png" class="logo"></img>
|
||||||
|
<form id="searchForm">
|
||||||
|
<div class="searchContainer">
|
||||||
|
<input class="searchbar" type="text" id="keywords" name="keywords"
|
||||||
|
placeholder="" list="keywordList">
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<div id="searchbuttons">
|
||||||
|
<button type="submit">Googet Search</button>
|
||||||
|
<button id="random">I'm Felling Lucky</button>
|
||||||
|
<h5 id="timetaken"></h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div id="results">
|
||||||
|
<!-- Results will be displayed here -->
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
document.getElementById('searchForm').addEventListener('submit', function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const keywords = document.getElementById('keywords').value.trim().split(',');
|
||||||
|
fetch('https://api.nazev.eu/search', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ keywords: keywords })
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const resultsDiv = document.getElementById('results');
|
||||||
|
resultsDiv.innerHTML = ''; // Clear previous results
|
||||||
|
data.forEach(item => {
|
||||||
|
const url = item.url;
|
||||||
|
const keywords = item.keywords;
|
||||||
|
const resultItem = document.createElement('div');
|
||||||
|
resultItem.innerHTML = `<p><strong>URL:</strong> <a href=${url}>${url}</a></p><p><strong>Keywords:</strong> ${keywords}</p>`;
|
||||||
|
resultsDiv.appendChild(resultItem);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching search results:', error));
|
||||||
|
});
|
||||||
|
document.getElementById('random').addEventListener('submit', function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const keywords = document.getElementById('keywords').value.trim().split(',');
|
||||||
|
|
||||||
|
const startTime = Date.now(); // Start the timer
|
||||||
|
|
||||||
|
fetch('https://api.nazev.eu/random', {
|
||||||
|
method: 'GET',
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const endTime = Date.now(); // End the timer
|
||||||
|
const timeTaken = endTime - startTime; // Calculate the time taken
|
||||||
|
console.log(timeTaken)
|
||||||
|
document.getElementById("timetaken").innerHTML = "Time taken: " + stringify(timeTaken)
|
||||||
|
|
||||||
|
|
||||||
|
const resultsDiv = document.getElementById('results');
|
||||||
|
resultsDiv.innerHTML = ''; // Clear previous results
|
||||||
|
|
||||||
|
const timeTakenDiv = document.createElement('div');
|
||||||
|
timeTakenDiv.innerHTML = `<p><strong>Time taken:</strong> ${timeTaken} ms</p>`;
|
||||||
|
resultsDiv.appendChild(timeTakenDiv); // Display the time taken
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
const url = item.url;
|
||||||
|
const keywords = item.keywords;
|
||||||
|
const resultItem = document.createElement('div');
|
||||||
|
resultItem.innerHTML = `<p><strong>URL:</strong> <a href=${url}>${url}</a></p><p><strong>Keywords:</strong> ${keywords}</p>`;
|
||||||
|
resultsDiv.appendChild(resultItem);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching search results:', error));
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -0,0 +1,40 @@
|
|||||||
|
.logo {
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 6%;
|
||||||
|
padding-right: 2%;
|
||||||
|
padding-left: 3%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar {
|
||||||
|
background-color: gray;
|
||||||
|
width: fit-content;
|
||||||
|
height: fit-content;
|
||||||
|
position: absolute;
|
||||||
|
top: 10px; /* Offset from the top */
|
||||||
|
/* left: 10px; Offset from the left */
|
||||||
|
right: auto; /* Ensure it's not centered horizontally */
|
||||||
|
bottom: auto; /* Ensure it's not centered vertically */
|
||||||
|
margin: 0; /* Remove auto margin */
|
||||||
|
padding: 10px;
|
||||||
|
/* border-radius: 10px; Optional: add border radius for rounded corners */
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchbar {
|
||||||
|
background: #303134;
|
||||||
|
color: white;
|
||||||
|
border-color: transparent;
|
||||||
|
border-radius: 25px;
|
||||||
|
height: 1.15cm;
|
||||||
|
width: 36%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchbar:hover {
|
||||||
|
border-radius: 25px;
|
||||||
|
box-shadow: 5px 10px 10px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: #202124;
|
||||||
|
color: white;
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
}
|
@ -0,0 +1,99 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="Search engine that crawls IPv4 addresses, written in Golang.">
|
||||||
|
<meta name="keywords"
|
||||||
|
content="Go search engine, Golang web crawler, search indexing, information retrieval, scalable search engine, concurrent indexing">
|
||||||
|
<meta property="og:title" content="Googet - Search engine">
|
||||||
|
<meta property="og:description" content="Search engine that crawls IPv4 addresses, written in Golang.">
|
||||||
|
<meta property="og:url" content="https://googet.nazev.eu">
|
||||||
|
<meta property="og:image" content="https://googet.nazev.eu/googeticon.png">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:site_name" content="Googet">
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta name="twitter:site" content="@googet">
|
||||||
|
<meta name="twitter:title" content="Googet">
|
||||||
|
<meta name="twitter:description" content="Search engine that crawls IPv4 addresses, written in Golang.">
|
||||||
|
<meta name="twitter:image" content="https://googet.nazev.eu/googeticon.png">
|
||||||
|
<title>Googet - Search Engine</title>
|
||||||
|
<link rel="icon" type="image/png" href="https://googet.nazev.eu/googeticon.png">
|
||||||
|
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"> -->
|
||||||
|
<link rel="stylesheet" href="pico.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="topbar">
|
||||||
|
<img src="goget_logo.png" class="logo" alt="Googet Logo">
|
||||||
|
<input class="searchbar" type="text" id="keywords" name="keywords" placeholder="" list="keywordList">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="results">
|
||||||
|
<!-- Results will be displayed here -->
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
document.getElementById('searchForm').addEventListener('submit', function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const keywords = document.getElementById('keywords').value.trim().split(',');
|
||||||
|
fetch('https://api.nazev.eu/search', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ keywords: keywords })
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const resultsDiv = document.getElementById('results');
|
||||||
|
resultsDiv.innerHTML = ''; // Clear previous results
|
||||||
|
data.forEach(item => {
|
||||||
|
const url = item.url;
|
||||||
|
const keywords = item.keywords;
|
||||||
|
const resultItem = document.createElement('div');
|
||||||
|
resultItem.innerHTML = `<p><strong>URL:</strong> <a href=${url}>${url}</a></p><p><strong>Keywords:</strong> ${keywords}</p>`;
|
||||||
|
resultsDiv.appendChild(resultItem);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching search results:', error));
|
||||||
|
});
|
||||||
|
document.getElementById('random').addEventListener('submit', function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const keywords = document.getElementById('keywords').value.trim().split(',');
|
||||||
|
|
||||||
|
const startTime = Date.now(); // Start the timer
|
||||||
|
|
||||||
|
fetch('https://api.nazev.eu/random', {
|
||||||
|
method: 'GET',
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const endTime = Date.now(); // End the timer
|
||||||
|
const timeTaken = endTime - startTime; // Calculate the time taken
|
||||||
|
console.log(timeTaken)
|
||||||
|
document.getElementById("timetaken").innerHTML = "Time taken: " + stringify(timeTaken)
|
||||||
|
|
||||||
|
|
||||||
|
const resultsDiv = document.getElementById('results');
|
||||||
|
resultsDiv.innerHTML = ''; // Clear previous results
|
||||||
|
|
||||||
|
const timeTakenDiv = document.createElement('div');
|
||||||
|
timeTakenDiv.innerHTML = `<p><strong>Time taken:</strong> ${timeTaken} ms</p>`;
|
||||||
|
resultsDiv.appendChild(timeTakenDiv); // Display the time taken
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
const url = item.url;
|
||||||
|
const keywords = item.keywords;
|
||||||
|
const resultItem = document.createElement('div');
|
||||||
|
resultItem.innerHTML = `<p><strong>URL:</strong> <a href=${url}>${url}</a></p><p><strong>Keywords:</strong> ${keywords}</p>`;
|
||||||
|
resultsDiv.appendChild(resultItem);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching search results:', error));
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "scraper"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "search"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "frontend"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
module portscanner
|
||||||
|
|
||||||
|
go 1.18
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/PuerkitoBio/goquery v1.9.2 // indirect
|
||||||
|
github.com/andybalholm/cascadia v1.3.2 // indirect
|
||||||
|
github.com/blang/semver v3.5.1+incompatible // indirect
|
||||||
|
github.com/iverly/go-mcping v1.0.1 // indirect
|
||||||
|
github.com/jmoiron/jsonq v0.0.0-20150511023944-e874b168d07e // indirect
|
||||||
|
github.com/tebeka/selenium v0.9.9 // indirect
|
||||||
|
golang.org/x/net v0.24.0 // indirect
|
||||||
|
)
|
@ -0,0 +1,144 @@
|
|||||||
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||||
|
cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg=
|
||||||
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
|
github.com/BurntSushi/xgbutil v0.0.0-20160919175755-f7c97cef3b4e/go.mod h1:uw9h2sd4WWHOPdJ13MQpwK5qYWKYDumDqxWWIknEQ+k=
|
||||||
|
github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE=
|
||||||
|
github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk=
|
||||||
|
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
|
||||||
|
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
|
||||||
|
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||||
|
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
|
||||||
|
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||||
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
|
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||||
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
|
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
|
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||||
|
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
github.com/google/go-github/v27 v27.0.4/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0=
|
||||||
|
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||||
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
|
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/iverly/go-mcping v1.0.1 h1:Gmza80C+CZw1XjDNWDdPg0lARlUqR5Q2/uGuEcReSZE=
|
||||||
|
github.com/iverly/go-mcping v1.0.1/go.mod h1:OTdb13yxI0zg1VKs7G53T43N2hAduaPeUcY+PbP608g=
|
||||||
|
github.com/jmoiron/jsonq v0.0.0-20150511023944-e874b168d07e h1:ZZCvgaRDZg1gC9/1xrsgaJzQUCQgniKtw0xjWywWAOE=
|
||||||
|
github.com/jmoiron/jsonq v0.0.0-20150511023944-e874b168d07e/go.mod h1:+rHyWac2R9oAZwFe1wGY2HBzFJJy++RHBg1cU23NkD8=
|
||||||
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
|
github.com/tebeka/selenium v0.9.9 h1:cNziB+etNgyH/7KlNI7RMC1ua5aH1+5wUlFQyzeMh+w=
|
||||||
|
github.com/tebeka/selenium v0.9.9/go.mod h1:5Fr8+pUvU6B1OiPfkdCKdXZyr5znvVkxuPd0NOdZCQc=
|
||||||
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
|
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||||
|
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||||
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
|
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||||
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
|
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||||
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
|
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
|
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||||
|
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
|
||||||
|
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
|
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||||
|
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
|
||||||
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
|
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
|
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||||
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
|
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||||
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||||
|
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||||
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||||
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
|
||||||
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
|
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||||
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
@ -0,0 +1,19 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// parseIPRange parses a string of IP ranges into start and end IP slices
|
||||||
|
func parseIPRange(input string) ([]string, []string) {
|
||||||
|
lines := strings.Split(input, "\n")
|
||||||
|
var srange, erange []string
|
||||||
|
for _, line := range lines {
|
||||||
|
parts := strings.Fields(line)
|
||||||
|
if len(parts) >= 2 {
|
||||||
|
srange = append(srange, parts[0])
|
||||||
|
erange = append(erange, parts[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return srange, erange
|
||||||
|
}
|
@ -0,0 +1,165 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"net"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Function to scan a single port on a single IP address
|
||||||
|
func scanPort(ip string, port int, results chan<- string) {
|
||||||
|
address := fmt.Sprintf("%s:%d", ip, port)
|
||||||
|
conn, err := net.DialTimeout("tcp", address, 1*time.Second)
|
||||||
|
if err != nil {
|
||||||
|
results <- fmt.Sprintf("Closed: %s:%d", ip, port)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
conn.Close()
|
||||||
|
results <- fmt.Sprintf("Open: %s:%d", ip, port)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to parse the IP range and perform port scanning
|
||||||
|
func scanRange(startIP, endIP string, ports []int, results chan<- string, wg *sync.WaitGroup) {
|
||||||
|
defer wg.Done()
|
||||||
|
start := net.ParseIP(startIP)
|
||||||
|
end := net.ParseIP(endIP)
|
||||||
|
for ip := start; !ip.Equal(end); ip = nextIP(ip) {
|
||||||
|
for _, port := range ports {
|
||||||
|
go scanPort(ip.String(), port, results)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func nextIP(ip net.IP) net.IP {
|
||||||
|
ip = ip.To4()
|
||||||
|
for j := len(ip) - 1; j >= 0; j-- {
|
||||||
|
ip[j]++
|
||||||
|
if ip[j] != 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ip
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to process scan results
|
||||||
|
func processResults(results chan string, wg *sync.WaitGroup, scannedCount *int, totalCount int, progressCh chan<- int) {
|
||||||
|
defer wg.Done()
|
||||||
|
for result := range results {
|
||||||
|
if strings.HasPrefix(result, "Open") {
|
||||||
|
fmt.Println(result)
|
||||||
|
parts := strings.Split(result, ":")
|
||||||
|
ip := parts[1]
|
||||||
|
port := parts[2]
|
||||||
|
url := fmt.Sprintf("http://%s:%s", ip, port)
|
||||||
|
data, err := scrapeData(strings.Replace(url, " ", "", -1))
|
||||||
|
fmt.Println(data)
|
||||||
|
if err == nil {
|
||||||
|
err = postData(map[string]interface{}{"url": url, "keywords": data})
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error posting data for %s: %v", url, err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.Printf("Error scraping data for %s: %v", url, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*scannedCount++
|
||||||
|
if *scannedCount%100 == 0 || *scannedCount == totalCount {
|
||||||
|
progressCh <- (*scannedCount * 100) / totalCount
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
//https://lite.ip2location.com
|
||||||
|
ipRanges := `
|
||||||
|
96.125.176.0 96.125.177.255 512
|
||||||
|
96.125.180.0 96.125.223.255 11,264
|
||||||
|
96.125.240.0 96.125.255.255 4,096
|
||||||
|
96.126.70.0 96.126.70.255 256
|
||||||
|
96.127.192.0 96.127.255.255 16,384
|
||||||
|
96.20.0.0 96.23.255.255 262,144
|
||||||
|
96.30.128.0 96.30.191.255 16,384
|
||||||
|
96.43.224.0 96.43.239.255 4,096
|
||||||
|
96.44.192.0 96.45.15.255 20,480
|
||||||
|
96.44.32.0 96.44.127.255 24,576
|
||||||
|
96.45.192.0 96.45.207.255 4,096
|
||||||
|
96.45.43.0 96.45.43.255 256
|
||||||
|
96.45.68.0 96.45.68.255 256
|
||||||
|
96.46.192.0 96.46.207.255 4,096
|
||||||
|
96.46.32.0 96.46.63.255 8,192
|
||||||
|
96.47.176.0 96.47.191.255 4,096
|
||||||
|
96.47.74.0 96.47.74.255 256
|
||||||
|
96.48.0.0 96.55.255.255 524,288
|
||||||
|
96.6.145.0 96.6.145.255 256
|
||||||
|
96.6.152.0 96.6.157.255 1,536
|
||||||
|
96.63.0.0 96.63.63.255 16,384
|
||||||
|
96.63.128.0 96.63.175.255 12,288
|
||||||
|
96.7.231.0 96.7.231.255 256
|
||||||
|
96.7.68.0 96.7.71.255 1,024
|
||||||
|
96.9.226.0 96.9.226.255 256
|
||||||
|
96.9.96.0 96.9.127.255 8,192
|
||||||
|
97.107.176.0 97.107.191.255 4,096
|
||||||
|
`
|
||||||
|
|
||||||
|
// Define the ports to be scanned
|
||||||
|
ports := []int{80, 8080, 8880}
|
||||||
|
results := make(chan string)
|
||||||
|
progressCh := make(chan int)
|
||||||
|
|
||||||
|
var totalCount, scannedCount int
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
|
||||||
|
// Calculate total count of IP addresses
|
||||||
|
scanner := bufio.NewScanner(strings.NewReader(ipRanges))
|
||||||
|
for scanner.Scan() {
|
||||||
|
line := scanner.Text()
|
||||||
|
parts := strings.Fields(line)
|
||||||
|
if len(parts) >= 2 {
|
||||||
|
_, endIP := parts[0], parts[1]
|
||||||
|
totalCount += countIPs(parts[0], endIP)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start processing results
|
||||||
|
wg.Add(1)
|
||||||
|
go processResults(results, &wg, &scannedCount, totalCount, progressCh)
|
||||||
|
|
||||||
|
// Parse IP ranges and start scanning
|
||||||
|
scanner = bufio.NewScanner(strings.NewReader(ipRanges))
|
||||||
|
for scanner.Scan() {
|
||||||
|
line := scanner.Text()
|
||||||
|
parts := strings.Fields(line)
|
||||||
|
if len(parts) >= 2 {
|
||||||
|
startIP := parts[0]
|
||||||
|
endIP := parts[1]
|
||||||
|
wg.Add(1)
|
||||||
|
go scanRange(startIP, endIP, ports, results, &wg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Progress reporting
|
||||||
|
go func() {
|
||||||
|
for progress := range progressCh {
|
||||||
|
fmt.Printf("Progress: %d%%\n", progress)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Allow some time for scans to complete
|
||||||
|
wg.Wait()
|
||||||
|
close(results)
|
||||||
|
close(progressCh)
|
||||||
|
}
|
||||||
|
|
||||||
|
func countIPs(startIP, endIP string) int {
|
||||||
|
start := net.ParseIP(startIP)
|
||||||
|
end := net.ParseIP(endIP)
|
||||||
|
count := 0
|
||||||
|
for ip := start; !ip.Equal(end); ip = nextIP(ip) {
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
return count + 1 // Include endIP
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/iverly/go-mcping/mcping"
|
||||||
|
)
|
||||||
|
|
||||||
|
func pingMinecraft(ip string) {
|
||||||
|
// Create a new Pinger instance
|
||||||
|
pinger := mcping.NewPinger()
|
||||||
|
|
||||||
|
// Ping the Minecraft server
|
||||||
|
response, err := pinger.Ping(ip, 25565)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to ping server: %v\n", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print server information
|
||||||
|
fmt.Println("Server Version: %s\n", response.Version)
|
||||||
|
fmt.Println("Players Online: %d / %d\n", response.PlayerCount.Online, response.PlayerCount.Max)
|
||||||
|
fmt.Println("MOTD: %s\n", response.Motd)
|
||||||
|
fmt.Println("Latency: %d ms\n", response.Latency)
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/tls"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"golang.org/x/net/html"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Function to scrape data from a URL
|
||||||
|
func scrapeData(url string) ([]string, error) {
|
||||||
|
client := &http.Client{
|
||||||
|
Timeout: 4 * time.Second,
|
||||||
|
Transport: &http.Transport{
|
||||||
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
return nil, fmt.Errorf("error fetching URL: %s", resp.Status)
|
||||||
|
}
|
||||||
|
|
||||||
|
doc, err := html.Parse(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var title, metaTags, headers []string
|
||||||
|
|
||||||
|
var f func(*html.Node)
|
||||||
|
f = func(n *html.Node) {
|
||||||
|
if n.Type == html.ElementNode {
|
||||||
|
switch n.Data {
|
||||||
|
case "title":
|
||||||
|
if n.FirstChild != nil {
|
||||||
|
titleText := strings.TrimSpace(n.FirstChild.Data)
|
||||||
|
if titleText != "" {
|
||||||
|
title = append(title, titleText)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "meta":
|
||||||
|
var name, content string
|
||||||
|
for _, attr := range n.Attr {
|
||||||
|
if attr.Key == "name" || attr.Key == "property" {
|
||||||
|
name = attr.Val
|
||||||
|
}
|
||||||
|
if attr.Key == "content" {
|
||||||
|
content = attr.Val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (name == "keywords" || name == "description" ||
|
||||||
|
name == "og:site_name" || name == "og:description" || name == "og:title") &&
|
||||||
|
content != "" {
|
||||||
|
metaTags = append(metaTags, content)
|
||||||
|
}
|
||||||
|
case "h1", "h2", "h3":
|
||||||
|
if n.FirstChild != nil {
|
||||||
|
headerText := strings.TrimSpace(n.FirstChild.Data)
|
||||||
|
if headerText != "" {
|
||||||
|
headers = append(headers, headerText)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||||
|
f(c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
f(doc)
|
||||||
|
|
||||||
|
// Combine title, metaTags, and headers into a single result slice
|
||||||
|
var parts []string
|
||||||
|
if len(title) > 0 {
|
||||||
|
parts = append(parts, title...)
|
||||||
|
}
|
||||||
|
if len(metaTags) > 0 {
|
||||||
|
parts = append(parts, metaTags...)
|
||||||
|
}
|
||||||
|
if len(headers) > 0 {
|
||||||
|
parts = append(parts, headers...)
|
||||||
|
}
|
||||||
|
|
||||||
|
return parts, nil
|
||||||
|
}
|
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 243 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 197 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 243 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 218 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 163 KiB |
After Width: | Height: | Size: 222 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 205 KiB |
After Width: | Height: | Size: 993 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 658 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 737 KiB |
After Width: | Height: | Size: 198 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 946 KiB |
After Width: | Height: | Size: 934 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 184 KiB |
After Width: | Height: | Size: 166 KiB |
After Width: | Height: | Size: 198 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 428 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 125 KiB |
After Width: | Height: | Size: 586 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 429 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 692 KiB |
After Width: | Height: | Size: 198 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 204 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 708 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 202 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 88 KiB |