Bruce forces Simulation

Einfach Simulation wie Bruce forces arbeitet,in dem Beispiel nur mit Zahlen

Der hier verwendete Code

<!doctype html> <html lang="de"> <head> <style> body { background-color:#000; color:#999; font-size:20pt; line-height:40px; text-align:center; vertical-align:middle; } table { border-spacing:10px; } td { background-color:#111; border:2px solid #60C; border-radius:5px; box-shadow:0px 0px 16px -8px #999 inset; height:40px; width:40px; } #container { margin:5px auto 0px auto; text-align:center; width:280px; } .cd{ background-color:#111; border:2px solid #60C; border-radius:5px; box-shadow:0px 0px 16px -8px #999 inset; height:40px; width:113%; margin:0px 10px 10px 10px; } .go { border:2px solid green; color:#eee; box-shadow:0px 0px 32px -16px green inset; } .ti { border:2px solid green; color:#eee; box-shadow:0px 0px 32px -16px #eee inset; } .co { border:2px solid green; color:#eee; box-shadow:0px 0px 32px -16px #eee inset; } .ha { border:2px solid green; color:#eee; box-shadow:0px 0px 32px -16px #eee inset; } .ce1{ border:2px solid red !important; box-shadow:0px 0px 32px -16px #eee inset !important; color:#eee !important; } .ce2{ border:2px solid yellow; box-shadow:0px 0px 32px -16px yellow inset !important; color:#eee !important; } </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <style> a { color: #99f; } a:hover { color: #99c; } .linksTooltip { border: 3px solid #933; background-color: #600; padding: 10px; color: #ccc; } .inputsTooltip { border: 1px solid #000; background-color: #444; padding: 4px; color: #ccc; font-family: Arial, Helvetica, sans-serif; font-size: 11px; width: 150px; } .inputsTooltip #tooltipTitle { font-weight: bold; } </style> </head> <body> <h3>Bruce Force Simulation</h3> <h4>Wie schnell soll der Hack laufen ?</h4> <input value="100" type="number" min="10" max="1000" step="10" maxlength="4" id="fast"> Millisekunden <p id="erg"></p> <div class='' id="container"> <table class='' id="display"></table> <div class='cd' id="goal"></div> <div class='cd' id="time">00:00</div> <div class='cd' id="count">0</div> <div class='cd' id="hack"><input title="gebe eine Zahl ein die das Hacking Tool knacken soll.An besten wre eine kleinere Zahl weil eine 10 Stellige Zahl kann schon mal paarStunden dauer,jenachdem wie schnell ihr Computer ist" class='' id="youpw" type="text"><button class='' id="go">Go hack</button><button class='' id="reset">Reset</button></div> </div> <script> var chars = "0123456789", combos = new Array(), start = new Date(), password, guess, timer, millis1, maxzahlen = 10, maxtr=6, index = 0; function color() { var cell, i, j; for (i = 0; i < maxtr; i++) { for (j = 0; j < maxzahlen; j++) { cell = document.getElementById(i + chars[j]); cell.style.boxShadow = "0px 0px 16px -8px #999 inset"; cell.style.borderColor = "#60C"; cell.style.color = "#999"; } } } function generate() { "use strict"; var table = document.getElementById("display"), tr, td, row, col, i, j, k, l, m,ia, index = 0; for (row = 0; row < maxtr; row++) { tr = document.createElement("tr"); table.appendChild(tr); for (col = 0; col < maxzahlen; col++) { td = document.createElement("td"); td.id = row + chars[col]; td.innerHTML = chars[col]; tr.appendChild(td); } } index = 0; for (i = 0; i < maxzahlen; i++) { for (j = 0; (j < maxzahlen); j++) { for (k = 0; (k < maxzahlen); k++) { for (l = 0; (l < maxzahlen); l++) { for (m = 0; (m < maxzahlen); m++) { for (ia = 0; ia < maxzahlen; ia++) { combos[index] = ""; combos[index] += chars[i] + chars[j] + chars[k] + chars[l] + chars[m]+ chars[ia]; index++; } } } } } } } function validate() { if(pla==6){ da='000000'; }else if(pla==5){ da='00000'; }else if(pla==4){ da='0000'; }else if(pla==3){ da='000'; }else if(pla==2){ da='00'; }else if(pla==1){ da='0'; }else if(pla==0){ da=''; } // console.log(guess+'-'+da+password) if (''+guess+'' == ''+da+password+'') { document.getElementById("goal").innerHTML = 'Dein Passwort ist '+password; return true; } } function animate() { var goal = document.getElementById("goal"), count = document.getElementById("count"), current = new Date(), millis2 = current.getTime() - millis1, seconds = millis2 / 1000, remainingSeconds = Math.floor(seconds % 60), minutes = seconds / 60, remainingMinutes = Math.floor(minutes % 60), clock = document.getElementById("time"), combo = "", id = "", cell, j; if (remainingMinutes < 10) { remainingMinutes = "0" + remainingMinutes; } if (remainingSeconds < 10) { remainingSeconds = "0" + remainingSeconds; } clock.innerHTML = remainingMinutes + ":" + remainingSeconds; if (validate()) { goal.style.borderColor = "#9F3"; goal.style.color = "#eee"; goal.style.boxShadow = "0px 0px 32px -16px #eee inset"; var time=document.getElementById("time"); time.style.borderColor = "#9F3"; time.style.color = "#eee"; time.style.boxShadow = "0px 0px 32px -16px #eee inset"; count.style.borderColor = "#9F3"; count.style.color = "#eee"; count.style.boxShadow = "0px 0px 32px -16px #eee inset"; timer = window.clearInterval(timer); } else { color(); combo = combos[index]; for (j = 0; j < maxtr; j++) { id = j + combo[j]; cell = document.getElementById(id); cell.style.borderColor = "#9F3"; cell.style.boxShadow = "0px 0px 32px -16px #eee inset"; cell.style.color = "#eee"; } guess = combo; index++; count.innerHTML++; } } function initiate() { } function rese() { $('#goal').removeClass('go').html(''); $('#time').removeClass('ti').html(0); $('#count').removeClass('co').html(0); $('#hack').removeClass('ha'); $("#goal").html('Dein Pw wahr '+password); //$('#youpw').val(password); timer = window.clearInterval(timer); index=0; seconds=0; millis1=0; current = new Date(); millis2=0; $('table').html(''); } $(document).ready(function () { $('#go').click(function(){ $("#goal").html('Scanner Startet...') password = $('#youpw').val(); pla=maxtr-password.length; speed=$('#fast').val(); if(password==''){ $('#erg').html('Gebe ein passwort ein'); return } if(speed>1000){ speed=1000; $('#fast').val(speed); } er=password*speed/1000; hour = Math.floor(er / 3600); minute = Math.floor((er%3600) / 60); second = Math.floor(er%60); if ( hour < 10 ) { hour = "0"+hour; } if ( minute < 10 ) { minute = "0"+minute; } if ( second < 10 ) { second = "0"+second; } if(hour<=0){ var zeit22 ='<br>'+minute+' Minuten,<br> '+second+' Sekunden<br>'; }else{ hour = Math.floor(er/3600)%24; days = Math.floor((er/3600)/24); var tt='Tage'; if(days==1){ var tt='Tag'; } var zeit22 ='<br>'+days+' '+tt+' ,<br> '+hour+' Stunden,<br> '+minute+' Minuten,<br> '+second+' Sekunden<br>'; } // console.log(hour+'-'+minute+'-'+second+'- -'+password+'-'+speed) var i; start = new Date(), millis1 = start.getTime(); timer = window.setInterval(animate, speed); $('#erg').html('Bei deinen Einstellungen brauch das Script ca '+zeit22+'Sekunden um das Passwort zu knacken') generate(); // initiate(); }); $('#reset').click(function(){ rese() }); }); </script> </body> </html>