2020-12-10 03:24:05 +01:00
|
|
|
function findWebsites() {
|
|
|
|
|
|
|
|
async function main_loop() {
|
|
|
|
for (let i = 0; i < times; i++) {
|
|
|
|
count.innerHTML = `COUNT: ${i+1}/${times}`
|
|
|
|
const url = await url_generator()
|
|
|
|
url_show.innerHTML = `CHECKING: ${url}`
|
2021-03-06 17:12:51 +01:00
|
|
|
|
2020-12-10 03:24:05 +01:00
|
|
|
try {
|
|
|
|
const response = await fetch(url, {mode: "no-cors"})
|
|
|
|
let li = document.createElement("LI")
|
|
|
|
let a = document.createElement("A")
|
|
|
|
a.innerHTML = url
|
|
|
|
a.href = url
|
|
|
|
li.appendChild(a)
|
|
|
|
list.appendChild(li)
|
|
|
|
}
|
2021-03-06 17:12:51 +01:00
|
|
|
catch (e) {} // No server for this URL
|
2020-12-10 03:24:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
console.log('\nFinished at ' + String(new Date().getHours()) + 'h' + String(new Date().getMinutes()) + 'm')
|
|
|
|
status.innerHTML = "STATUS: STOPPED"
|
2021-03-06 17:12:51 +01:00
|
|
|
document.getElementById("btn").disabled = false
|
2020-12-10 03:24:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function url_generator() {
|
|
|
|
let result = mode[Math.round(Math.random() * (mode.length - 1))] + "://"
|
|
|
|
const characters = "abcdefghijklmnopqrstuvwxyz0123456789"
|
|
|
|
const url_length = Math.floor(Math.random() * (maxi - mini) + mini)
|
|
|
|
for (let i = 0; i < url_length; i++) {result += characters.charAt(Math.floor(Math.random() * characters.length))}
|
|
|
|
result += domains[Math.floor(Math.random() * domains.length)]
|
|
|
|
if (Math.floor(Math.random() * (100 - 1) + 1) <= second) result += domains[Math.floor(Math.random() * domains.length)]
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2020-12-11 18:44:24 +01:00
|
|
|
const times = document.getElementById("times").value ? Math.round(Number(document.getElementById("times").value)) : 3000
|
|
|
|
const domains = document.getElementById("domains").value ? document.getElementById("domains").value.split(", ") : ['.co', '.com', '.net', '.edu', '.gov', '.cn', '.org', '.cc', '.us', '.mil', '.ac', '.it', '.de']
|
|
|
|
const second = document.getElementById("second").value ? Math.round(Number(document.getElementById("second").value)) : 1
|
2020-12-12 15:56:23 +01:00
|
|
|
const mode = document.getElementById("mode").value ? document.getElementById("mode").value.split(", ") : ['https']
|
2020-12-11 18:44:24 +01:00
|
|
|
const mini = document.getElementById("mini").value ? Math.round(Number(document.getElementById("mini").value)) : 2
|
|
|
|
const maxi = document.getElementById("maxi").value ? Math.round(Number(document.getElementById("maxi").value)) : 50
|
2020-12-10 03:24:05 +01:00
|
|
|
|
|
|
|
const list = document.getElementsByTagName("UL")[0]
|
|
|
|
const status = document.getElementsByTagName("P")[0]
|
|
|
|
const count = document.getElementsByTagName("P")[1]
|
|
|
|
const url_show = document.getElementsByTagName("P")[2]
|
|
|
|
|
2020-12-11 18:44:24 +01:00
|
|
|
console.log('Started at', String(new Date().getHours()) + 'h' + String(new Date().getMinutes()) + 'm\n')
|
|
|
|
console.log('Number of URLs being checked:', times)
|
|
|
|
console.log('Domains used in URLs:', domains)
|
|
|
|
console.log('How many URLs out of 100 will feature two domains:', second)
|
|
|
|
console.log('Application protocols used by URLs:', mode)
|
|
|
|
console.log('Minimum length of URLs:', mini)
|
|
|
|
console.log('Maximum length of URLs:', maxi)
|
|
|
|
|
|
|
|
|
2020-12-10 03:24:05 +01:00
|
|
|
status.innerHTML = "STATUS: ACTIVE"
|
2021-03-06 17:12:51 +01:00
|
|
|
document.getElementById("btn").disabled = true
|
2020-12-10 03:24:05 +01:00
|
|
|
|
|
|
|
main_loop()
|
|
|
|
|
|
|
|
}
|