138 lines
4.8 KiB
HTML
138 lines
4.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Password Crackculator</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
background-color: #000; /* Set background color to black */
|
|
color: #fff; /* Set text color to white */
|
|
text-align: center; /* Center-align text */
|
|
}
|
|
table {
|
|
margin: auto;
|
|
width: 500px;
|
|
border-collapse: collapse;
|
|
}
|
|
td {
|
|
padding: 10px;
|
|
}
|
|
input[type="text"], input[type="number"] {
|
|
width: 90%;
|
|
background-color: #333; /* Dark background for inputs */
|
|
color: white; /* White text for inputs */
|
|
border: 1px solid #555; /* Slight border for inputs */
|
|
}
|
|
input[type="button"] {
|
|
width: 100%;
|
|
padding: 10px;
|
|
background-color: #28a745;
|
|
color: white;
|
|
border: none;
|
|
cursor: pointer;
|
|
}
|
|
input[type="button"]:hover {
|
|
background-color: #218838;
|
|
}
|
|
.result {
|
|
background-color: gray;
|
|
text-align: center;
|
|
padding: 10px;
|
|
}
|
|
/* Add styling for the image */
|
|
img {
|
|
display: block; /* Make it block-level to center it */
|
|
margin: 0 auto; /* Center the image */
|
|
max-width: 100%; /* Responsive image */
|
|
height: auto; /* Maintain aspect ratio */
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- Image at the top -->
|
|
<img src="https://i.ibb.co/py2VgYV/securityops-logo.jpg" alt="Follow the white rabbit">
|
|
|
|
<form method="POST" onsubmit="event.preventDefault(); doit();">
|
|
<table>
|
|
<tr>
|
|
<td align="right">Password length:</td>
|
|
<td><input type="number" id="len" value="7" min="1" required></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right">Speed:</td>
|
|
<td>
|
|
<input type="number" id="speed" value="348000000000" required> passwords per second
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right">Number of computers:</td>
|
|
<td>
|
|
<input type="number" id="pcn" value="1" min="1" required>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<label><input type="checkbox" id="cslwr" checked> chars in lower case</label><br>
|
|
<label><input type="checkbox" id="csuppr" checked> chars in upper case</label><br>
|
|
<label><input type="checkbox" id="csdigits" checked> digits</label><br>
|
|
<label><input type="checkbox" id="cssymb" checked> common punctuation</label><br>
|
|
<label><input type="checkbox" id="csascii"> full ASCII</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<input type="button" value="Calculate!" onclick="doit();">
|
|
</td>
|
|
</tr>
|
|
<tr class="result">
|
|
<td colspan="2">
|
|
Brute Force Attack will take up to <strong><span id="result2">a minute</span></strong>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<script>
|
|
function doit() {
|
|
// Gather input values
|
|
const n = parseInt(document.getElementById("len").value);
|
|
const speed = parseFloat(document.getElementById("speed").value);
|
|
const pcn = parseInt(document.getElementById("pcn").value);
|
|
|
|
// Calculate character set length based on selected options
|
|
let cslen = 0;
|
|
if (document.getElementById("cslwr").checked) cslen += 26; // lowercase letters
|
|
if (document.getElementById("csuppr").checked) cslen += 26; // uppercase letters
|
|
if (document.getElementById("csdigits").checked) cslen += 10; // digits
|
|
if (document.getElementById("cssymb").checked) cslen += 12; // common punctuation
|
|
if (document.getElementById("csascii").checked) cslen = 188; // full ASCII
|
|
|
|
// Calculate time (in seconds)
|
|
const totalCombinations = Math.pow(cslen, n);
|
|
let timeInSeconds = totalCombinations / (speed * pcn);
|
|
|
|
// Convert time to a readable format
|
|
let resultString = formatTime(timeInSeconds);
|
|
document.getElementById("result2").innerHTML = resultString;
|
|
}
|
|
|
|
// Format time into a human-readable format
|
|
function formatTime(seconds) {
|
|
if (seconds < 60) return "less than a minute";
|
|
if (seconds < 3600) return Math.ceil(seconds / 60) + " minutes";
|
|
if (seconds < 86400) return Math.ceil(seconds / 3600) + " hours";
|
|
if (seconds < 2592000) return Math.ceil(seconds / 86400) + " days";
|
|
if (seconds < 31536000) return Math.ceil(seconds / 2592000) + " months";
|
|
return Math.ceil(seconds / 31536000) + " years";
|
|
}
|
|
|
|
// Call the calculate function once on load
|
|
doit();
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|