diff --git a/LOST_THE_GAME.png b/LOST_THE_GAME.png deleted file mode 100644 index 5b0adf4..0000000 Binary files a/LOST_THE_GAME.png and /dev/null differ diff --git a/app.js b/app.js index 11f1977..1c1dd6e 100644 --- a/app.js +++ b/app.js @@ -1,306 +1 @@ -//----------Constant Values and Objects--------- -let targetIpAddress = ''; -const lockoutMax = 9; -let lockoutHits = 0; -let ipAttempts = []; -let time = 460000; -let lose = false; -let win = false; -let timerElement = document.getElementById('timer'); -let timeInterval = {}; -let score = 0; -let winScore = 7; - -const systemTypes = ["HIDDEN", "KALILINUX", "WINDOWSXP", "WINDOWS2000", - "WINDOWS10", "REDHAT", "ANDROID4.4", "NETHUNTER"]; - -const Entry = function(){ - return { - value: createIP(), - machineType: systemTypes[randomInRange(0, systemTypes.length - 1, 0)], - status: "ACTIVE", - hostName: createRandomName(), - lastResponse: randomInRange(1000, 10000000, 0), - systemLocation: { - long: randomInRange(-180, 180, 3), - lat: randomInRange(-180, 180, 3) - } - } -} - - - -//-----------Helper Functions----------- -function createIP() { - let text = ""; - let possible = "0123456789"; - - for (var i = 0; i < 10; i++) - text += possible.charAt(Math.floor(Math.random() * possible.length)); - - return text; -} - - -function formatIP(ip){ - let newIP = ip; - - newIP = newIP.slice(0, 2) + '.' + newIP.slice(2); - newIP = newIP.slice(0, 6) + '.' + newIP.slice(6); - newIP = newIP.slice(0, 9) + '.' + newIP.slice(9); - - return newIP; -} - - -function randomInRange(min, max, fixed){ - return (Math.random() * (max - min) + min).toFixed(fixed) * 1; -} - - -function createEntryHTML(entry){ - - let {value, status, machineType, hostName, lastResponse, systemLocation} = entry; - let ipAddress = formatIP(value); - let htmlString = "\ - \ - \ - "+ formatIP(value) +"\ - "+ status +"\ - "+ hostName +"\ - "+ machineType +"\ - "+ lastResponse +"MS\ - "+ systemLocation.long + "_" + systemLocation.lat +"\ - \ - " - - return htmlString; - -} - -function createEntryHTMLArray(entries){ - - let htmlStrings = []; - - entries.forEach(function(e) { - htmlStrings.push(createEntryHTML(e)); - }, this); - - return htmlStrings; -} - - -function createRandomName(){ - let text = ""; - let possible = "0123456789QWERTYUIOP_-ASDFGHJKLZXCVBNM"; - - for (var i = 0; i < 10; i++) - text += possible.charAt(Math.floor(Math.random() * possible.length)); - - return text; -} - - -function createEntryArray(){ - - let entries = []; - - for(i = 0; i < 27; i++){ - entries.push(new Entry()); - } - - return entries; -} - - -function concatEntryHTMLArray(entries){ - - let htmlString = ""; - - entries.forEach(function(e) { - htmlString += e; - }, this); - - return htmlString; -} - - -function renderEntries(htmlString){ - document.getElementById('entry_table').innerHTML = htmlString; -} - - -function extractIpAddressFromElement(element){ - ipAddress = element.getAttribute('data-ip-value'); - return ipAddress; -} - - -function selectTargetIpAddress(entries){ - let value = entries[randomInRange(0, entries.length - 1, 0)].value; - return value; -} - - -function compareIpAddress(value){ - let levDis = new Levenshtein(value, targetIpAddress); - let similarCount = 10 - levDis.distance; - return similarCount; -} - - - -//----------Business Logic-------- - -function beginRound(){ - document.getElementById('entry_table').innerHTML = ""; - ipAttempts = []; - let entryArray = createEntryArray(); - let htmlArray = createEntryHTMLArray(entryArray); - let entryHTMLString = concatEntryHTMLArray(htmlArray); - let entryElements = document.getElementsByClassName('entry'); - - targetIpAddress = selectTargetIpAddress(entryArray); - renderEntries(entryHTMLString); - assignClickEvent(entryElements); - renderSuccessPrecentage(score * 100/winScore); - renderAttempts(); - - console.log(targetIpAddress); - -} - -function beginClicked(){ - let instructions = document.getElementById('messege'); - instructions.innerHTML = "" - instructions.className = "hidden"; - timeInterval = setInterval(countDown, 10); - beginRound(); -} - - -function assignClickEvent(elements){ - - for(i = 0; i < elements.length; i++){ - let entry = elements[i]; - entry.onclick = function(){ - clickedEntry(entry); - } - } -} - - -function clickedEntry(entry){ - - if(!lose && !win){ - let ipDifference = compareIpAddress(extractIpAddressFromElement(entry)); - - if(ipDifference === 10){ - targetIpAddressFound(entry); - } - else{ - wrongEntrySelected(entry, ipDifference); - renderLockout(); - renderSuccessPrecentage(ipDifference * 10); - checkStatus(); - } - } -} - - -function targetIpAddressFound(entry){ - score += 1; - if(score > winScore - 1){ - gameWin(); - } - else{ - beginRound(); - } -} - - -function wrongEntrySelected(entry, similarity){ - let value = extractIpAddressFromElement(entry); - - lockoutHits = lockoutHits + 1; - saveAttempt(value); - renderAttempts(); - - - console.log(value + " was incorrect. Tries left: " + (lockoutMax - lockoutHits)); - console.log(similarity + " characters were correct. Try Again!") -} - -function renderSuccessPrecentage(percentage){ - let successPercentage = document.getElementById('precentage'); - successPercentage.innerHTML = Math.floor(percentage) + "%"; -} - - -function renderLockout(){ - let lockoutElement = document.getElementById('lockout'); - - lockoutElement.innerHTML = ''; - - for(i = 0; i < lockoutHits; i++){ - lockoutElement.innerHTML = lockoutElement.innerHTML + " X "; - } -} - - -function saveAttempt(value){ - ipAttempts.push(value); -} - - -function renderAttempts(){ - let attemptsTable = document.getElementById('attempts_table'); - attemptsTable.innerHTML = ""; - - ipAttempts.forEach(function(e) { - attemptsTable.innerHTML += "" + formatIP(e) + "\ - " + compareIpAddress(e) + " similar chars" - }, this); -} - -function checkStatus(){ - if(lockoutHits >= lockoutMax){ - gameLose(); - } -} - - -function gameLose(){ - let entryElements = document.getElementsByClassName('entry'); - let entryArray = []; - - lose = true; - - timerElement.innerHTML = 0; - clearInterval(timeInterval); - - Array.prototype.forEach.call(entryElements, function(e) { - e.className = "entry error" - }, this); -} - -function gameWin(){ - let targetElement = document.querySelector('[data-ip-value="' + targetIpAddress + '"]') - - win = true; - targetElement.className = "win"; - clearInterval(timeInterval); - timerElement.innerHTML = 0; - - console.log("Game Win"); -} - -function countDown(){ - if(time > 0 && !lose){ - time -= 10; - timerElement.innerHTML = time; - } - else{ - gameLose(); - } -} +(function(a,b){'function'==typeof define&&'object'==typeof define.amd&&define.amd?define(function(){return b(a)}):'object'==typeof module&&module&&module.exports?module.exports=b(a):a.Levenshtein=b(a)})(this,function(){function b(g,h){var j,k;for(j=-1,k=g.length;++jc;c++)a+=b.charAt(Math.floor(Math.random()*b.length));return a}function formatIP(a){let b=a;return b=b.slice(0,2)+'.'+b.slice(2),b=b.slice(0,6)+'.'+b.slice(6),b=b.slice(0,9)+'.'+b.slice(9),b}function randomInRange(a,b,c){return 1*(Math.random()*(b-a)+a).toFixed(c)}function createEntryHTML(a){let{value:b,status:c,machineType:d,hostName:f,lastResponse:g,systemLocation:h}=a,j=formatIP(b),k=' '+formatIP(b)+' '+c+' '+f+' '+d+' '+g+'MS '+h.long+'_'+h.lat+' ';return k}function createEntryHTMLArray(a){let b=[];return a.forEach(function(c){b.push(createEntryHTML(c))},this),b}function createRandomName(){let a='',b='0123456789QWERTYUIOP_-ASDFGHJKLZXCVBNM';for(var c=0;10>c;c++)a+=b.charAt(Math.floor(Math.random()*b.length));return a}function createEntryArray(){let a=[];for(i=0;27>i;i++)a.push(new Entry);return a}function concatEntryHTMLArray(a){let b='';return a.forEach(function(c){b+=c},this),b}function renderEntries(a){document.getElementById('entry_table').innerHTML=a}function extractIpAddressFromElement(a){return ipAddress=a.getAttribute('data-ip-value'),ipAddress}function selectTargetIpAddress(a){let b=a[randomInRange(0,a.length-1,0)].value;return b}function compareIpAddress(a){let b=new Levenshtein(a,targetIpAddress),c=10-b.distance;return c}function beginRound(){document.getElementById('entry_table').innerHTML='',ipAttempts=[];let a=createEntryArray(),b=createEntryHTMLArray(a),c=concatEntryHTMLArray(b),d=document.getElementsByClassName('entry');targetIpAddress=selectTargetIpAddress(a),renderEntries(c),assignClickEvent(d),renderSuccessPrecentage(100*score/winScore),renderAttempts(),console.log(targetIpAddress)}function beginClicked(){let a=document.getElementById('messege');a.innerHTML='',a.className='hidden',timeInterval=setInterval(countDown,10),beginRound()}function assignClickEvent(a){for(i=0;iwinScore-1?gameWin():beginRound()}function wrongEntrySelected(a,b){let c=extractIpAddressFromElement(a);++lockoutHits,saveAttempt(c),renderAttempts(),console.log(c+' was incorrect. Tries left: '+(lockoutMax-lockoutHits)),console.log(b+' characters were correct. Try Again!')}function renderSuccessPrecentage(a){let b=document.getElementById('precentage');b.innerHTML=Math.floor(a)+'%'}function renderLockout(){let a=document.getElementById('lockout');for(a.innerHTML='',i=0;i X '}function saveAttempt(a){ipAttempts.push(a)}function renderAttempts(){let a=document.getElementById('attempts_table');a.innerHTML='',ipAttempts.forEach(function(b){a.innerHTML+=''+formatIP(b)+' '+compareIpAddress(b)+' similar chars'},this)}function checkStatus(){lockoutHits>=lockoutMax&&gameLose()}function gameLose(){let a=document.getElementsByClassName('entry');lose=!0,timerElement.innerHTML=0,clearInterval(timeInterval),Array.prototype.forEach.call(a,function(c){c.className='entry error'},this)}function gameWin(){let a=document.querySelector('[data-ip-value="'+targetIpAddress+'"]');win=!0,a.className='win',clearInterval(timeInterval),timerElement.innerHTML=0,console.log('Game Win')}function countDown(){0 -

Several months ago, your loved one Katlyen Hicks went missing. You have connections - do several deep and dark web users. They have informed you that they ave seen websites known for human - trafficing that have posted advertisements with her picture. These websites are only accessible by using - the T.O.R network. A network designed to mask origins of internet conections to keep communications hidden. - Like any system, it has its weak points. These dark web user friends of yours have taught you secrets of - the trade of computer hacking and tracking. You have now build a tool to help you narrorw down the source - of these website owners. The T.O.R. network masks its users by bouncing their signals all accross the globe - so much so that they are almost impossible to track. You however are able to track the different network nodes - and find the roots of the signals. Your tool will allow you select IP addresses and determine if it is an actual - node being used. This tool will let you know how accurate your choice is so you can accuratly make a new selection. - You only have so long before you are lockout out of the system's vulnerabilities. Use this toime appropriately, you - will need to lock onto several signals to find rthe capture of your loved one. +

+ Several months ago, your loved one Katlyen Hicks went missing. You have connections to several deep and dark web users. They have informed you that they have seen websites, known for human trafficking, that have posted advertisements with her picture. These websites are only accessible by using the T.O.R network. A network designed to mask origins of internet connections to keep communications hidden. Like any system, it has its weak points. These dark web user friends of yours have taught you secrets of the trade of computer hacking and tracking. You have now built a tool to help you narrow down the I.P. addresses of these website owners. The T.O.R. network masks its users by bouncing their signals all across the globe so much so that they are almost impossible to track. You however are able to pinpoint the different nodes and find the roots of the signals. Your tool will allow you to select IP addresses and determine if it is a node being used. This tool will let you know how accurate your choice is so you can make a more precise selection to further your tracking. You only have so long before you are locked out of the system's vulnerabilities and only have so many attempts to analyze I.P. addresses as well. Use this time appropriately! You will need to lock onto several signals to find the captor of your loved one. Happy Hunting!

diff --git a/index.html b/index.html index ba4a0d5..42179ff 100644 --- a/index.html +++ b/index.html @@ -1,95 +1 @@ - - - - - Lost - - - - - - -
-

DISPLAY REPORT

-
- -
-

TRACKING SUCCESS:

-

QUERY: KATLYEN HICKS

-
- -
-

BRUTE FORCE LOCKOUT:

-

TIME LOCKOUT: MS

-
-
- -
- -
- -
- -

Several months ago, your loved one Katlyen Hicks went missing. You have connections - do several deep and dark web users. They have informed you that they ave seen websites known for human - trafficing that have posted advertisements with her picture. These websites are only accessible by using - the T.O.R network. A network designed to mask origins of internet conections to keep communications hidden. - Like any system, it has its weak points. These dark web user friends of yours have taught you secrets of - the trade of computer hacking and tracking. You have now build a tool to help you narrorw down the source - of these website owners. The T.O.R. network masks its users by bouncing their signals all accross the globe - so much so that they are almost impossible to track. You however are able to track the different network nodes - and find the roots of the signals. Your tool will allow you select IP addresses and determine if it is an actual - node being used. This tool will let you know how accurate your choice is so you can accuratly make a new selection. - You only have so long before you are lockout out of the system's vulnerabilities. Use this toime appropriately, you - will need to lock onto several signals to find rthe capture of your loved one. -

- - - -
- - - - - - - - - - - - - - - - -
IP ADDRESSACTIVEHOST_NAMEMACHINE_TYPELAST_RESPONCESYSTEM_LOCATION
-
- -
- -
- - - - - - - - - -
ATTEMPTSSHARED CHARS
-
- -
- - - - - - - - - - - \ No newline at end of file +Lost

DISPLAY REPORT

TRACKING SUCCESS:

QUERY: KATLYEN HICKS

BRUTE FORCE LOCKOUT:

TIME LOCKOUT: MS


Several months ago, your loved one Katlyen Hicks went missing. You have connections to several deep and dark web users. They have informed you that they have seen websites, known for human trafficking, that have posted advertisements with her picture. These websites are only accessible by using the T.O.R network. A network designed to mask origins of internet connections to keep communications hidden. Like any system, it has its weak points. These dark web user friends of yours have taught you secrets of the trade of computer hacking and tracking. You have now built a tool to help you narrow down the I.P. addresses of these website owners. The T.O.R. network masks its users by bouncing their signals all across the globe so much so that they are almost impossible to track. You however are able to pinpoint the different nodes and find the roots of the signals. Your tool will allow you to select IP addresses and determine if it is a node being used. This tool will let you know how accurate your choice is so you can make a more precise selection to further your tracking. You only have so long before you are locked out of the system's vulnerabilities and only have so many attempts to analyze I.P. addresses as well. Use this time appropriately! You will need to lock onto several signals to find the captor of your loved one. Happy Hunting!

IP ADDRESSACTIVEHOST_NAMEMACHINE_TYPELAST_RESPONCESYSTEM_LOCATION

ATTEMPTSSHARED CHARS
\ No newline at end of file diff --git a/levenshtein.js b/levenshtein.js deleted file mode 100644 index 77e3924..0000000 --- a/levenshtein.js +++ /dev/null @@ -1,106 +0,0 @@ -(function(root, factory){ - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - define(function(){ - return factory(root); - }); - } else if (typeof module == 'object' && module && module.exports) { - module.exports = factory(root); - } else { - root.Levenshtein = factory(root); - } -}(this, function(root){ - - function forEach( array, fn ) { var i, length - i = -1 - length = array.length - while ( ++i < length ) - fn( array[ i ], i, array ) - } - - function map( array, fn ) { var result - result = Array( array.length ) - forEach( array, function ( val, i, array ) { - result[i] = fn( val, i, array ) - }) - return result - } - - function reduce( array, fn, accumulator ) { - forEach( array, function( val, i, array ) { - accumulator = fn( val, i, array ) - }) - return accumulator - } - - // Levenshtein distance - function Levenshtein( str_m, str_n ) { var previous, current, matrix - // Constructor - matrix = this._matrix = [] - - // Sanity checks - if ( str_m == str_n ) - return this.distance = 0 - else if ( str_m == '' ) - return this.distance = str_n.length - else if ( str_n == '' ) - return this.distance = str_m.length - else { - // Danger Will Robinson - previous = [ 0 ] - forEach( str_m, function( v, i ) { i++, previous[ i ] = i } ) - - matrix[0] = previous - forEach( str_n, function( n_val, n_idx ) { - current = [ ++n_idx ] - forEach( str_m, function( m_val, m_idx ) { - m_idx++ - if ( str_m.charAt( m_idx - 1 ) == str_n.charAt( n_idx - 1 ) ) - current[ m_idx ] = previous[ m_idx - 1 ] - else - current[ m_idx ] = Math.min - ( previous[ m_idx ] + 1 // Deletion - , current[ m_idx - 1 ] + 1 // Insertion - , previous[ m_idx - 1 ] + 1 // Subtraction - ) - }) - previous = current - matrix[ matrix.length ] = previous - }) - - return this.distance = current[ current.length - 1 ] - } - } - - Levenshtein.prototype.toString = Levenshtein.prototype.inspect = function inspect ( no_print ) { var matrix, max, buff, sep, rows - matrix = this.getMatrix() - max = reduce( matrix,function( m, o ) { - return Math.max( m, reduce( o, Math.max, 0 ) ) - }, 0 ) - buff = Array( ( max + '' ).length ).join( ' ' ) - - sep = [] - while ( sep.length < (matrix[0] && matrix[0].length || 0) ) - sep[ sep.length ] = Array( buff.length + 1 ).join( '-' ) - sep = sep.join( '-+' ) + '-' - - rows = map( matrix, function( row ) { var cells - cells = map( row, function( cell ) { - return ( buff + cell ).slice( - buff.length ) - }) - return cells.join( ' |' ) + ' ' - }) - - return rows.join( "\n" + sep + "\n" ) - } - - Levenshtein.prototype.getMatrix = function () { - return this._matrix.slice() - } - - Levenshtein.prototype.valueOf = function() { - return this.distance - } - - return Levenshtein - -})); diff --git a/lost_the_game_UI.xd b/lost_the_game_UI.xd deleted file mode 100644 index 57a33d5..0000000 Binary files a/lost_the_game_UI.xd and /dev/null differ diff --git a/style.css b/style.css index 7132adb..4c1430e 100644 --- a/style.css +++ b/style.css @@ -1,146 +1 @@ -.hidden{ - display: none; -} - -.screen{ - width: 900px; - min-height: 800px; - margin: 30px auto; - border-color: #00FF00; - border-width: 1px; - border-style: solid; - border-radius: 26px; - background-color: black; - color: white; - font-family: monospace; - overflow: hidden; -} - -#messege{ - height: 560px; - text-transform: uppercase; - font-size: 16px; -} - -button{ - padding: 10px 25px; - color: black; - background-color: #00FF00; - border-width: 1px; - border-style: none; - border-bottom-style: solid; - border-radius: 0px; - border-color: #00FF00; - font-family: monospace; - display: block; - margin: 30px auto; -} - -button:hover{ - color: white; - background-color: black; -} - -#title{ - text-align: center; -} - -.green{ - color: #00FF00; -} - -.error{ - background-color: red; - color: white; -} - -.win{ - background-color: white; - color: #00FF00; -} - -.win :hover{ - background-color: white; - color: #00FF00; -} - -.score-wrapper{ - padding: 5px; -} - -.score-wrapper h3{ - margin: 0px; -} - -.score-wrapper .left{ - float: left; - width: 50%; - margin: 0px; -} - -.score-wrapper .right{ - float: right; - width: 50%; - margin: 0px; -} - -.response-wrapper{ - padding-bottom: 8px; -} - -hr{ - border-color: #00ff00; - margin: 6px 0px; -} - -table{ - width: 900px; - font-size: 14px; -} - -th{ - text-align: left; - padding: 0px 4px; -} - -td{ - padding: 0px 4px; - overflow: hidden; -} - -.column-titles{ - margin-bottom: 2px; -} - -#play-wrapper{ - padding:0px 2px; - margin: 0px; -} - -.column{ - padding: 0px 1px; - overflow: hidden; - margin: 0px; -} - - - -.address-choice{ - margin: 0px; - padding: 0px; -} - -.address-choice span{ - overflow: hidden; - display: inline-block; -} - -.entry:hover{ - color: black; - background-color: #00ff00; - cursor: pointer; -} - -.lockoutMark{ - display: inline; -} \ No newline at end of file +.screen,button{border-width:1px;border-color:#0F0;font-family:monospace;margin:30px auto}.screen,button:hover{color:#fff;background-color:#000}.column,.screen,td{overflow:hidden}.hidden{display:none}.screen{width:900px;min-height:800px;border-style:solid;border-radius:26px}#messege{height:560px;text-transform:uppercase;font-size:16px}button{padding:10px 25px;color:#000;background-color:#0F0;border-style:none none solid;border-radius:0;display:block}#title{text-align:center}.green{color:#0F0}.error{background-color:red;color:#fff}.win,.win :hover{background-color:#fff;color:#0F0}.score-wrapper{padding:5px}.score-wrapper h3{margin:0}.score-wrapper .left{float:left;width:50%;margin:0}.score-wrapper .right{float:right;width:50%;margin:0}.response-wrapper{padding-bottom:8px}td,th{padding:0 4px}hr{border-color:#0f0;margin:6px 0}table{width:900px;font-size:14px}th{text-align:left}.column-titles{margin-bottom:2px}#play-wrapper{padding:0 2px;margin:0}.column{padding:0 1px;margin:0}.address-choice{margin:0;padding:0}.address-choice span{overflow:hidden;display:inline-block}.entry:hover{color:#000;background-color:#0f0;cursor:pointer}.lockoutMark{display:inline} \ No newline at end of file