Eikonal Blog

2010.01.07

Cisco “Password 7” Cracker – javascript code

Filed under: crypto, infosec — Tags: , , — sandokan65 @ 13:48

Source: http://www.ifm.net.nz/cookbooks/passwordcracker.html

<script language="JavaScript1.2" type="text/javascript">
<!--
// Is the character a digit?
function isDigit(theDigit) 
{ 
    var digitArray = new Array('0','1','2','3','4','5','6','7','8','9')

    for (j = 0; j < digitArray.length; j++)  {
        if (theDigit == digitArray[j]) 
            return true 
    } 
    return false 
} 


// Generate a config file ready for loading
function crackPassword(form)
{
    var crypttext=form.crypttext.value.toUpperCase()
    var plaintext=''
    var xlat="dsfd;kfoA,.iyewrkldJKDHSUBsgvca69834ncxv9873254k;fg87"
    var seed, i, val=0

    if(crypttext.length & 1)
        return

    seed = (crypttext.charCodeAt(0) - 0x30) * 10 + crypttext.charCodeAt(1) - 0x30

    if (seed > 15 || !isDigit(crypttext.charAt(0)) || !isDigit(crypttext.charAt(1)))
        return

        for (i = 2 ; i <= crypttext.length; i++) {
                if(i !=2 && !(i & 1)) {
                        plaintext+=String.fromCharCode(val ^ xlat.charCodeAt(seed++))
            seed%=xlat.length
                        val = 0;
                }

                val *= 16

        if(isDigit(crypttext.charAt(i))) {
            val += crypttext.charCodeAt(i) - 0x30
            continue
        }


        if(crypttext.charCodeAt(i) >= 0x41 && crypttext.charCodeAt(i) <= 0x46) {
            val += crypttext.charCodeAt(i) - 0x41 + 0x0a
            continue
        }

        if(crypttext.length != i)
            return
        }

    form.plaintext.value=plaintext
}

-->
</script>

<form name="never-you-mind" id="never-you-mind" action="#">
<table border="1">
  <tbody><tr><td>
<p>
Type 7 Password:
  <input name="crypttext" size="60" type="text">
</p>

<p>
  <input value="Crack Password" onclick="crackPassword(this.form)" type="button">
</p>
<p>Plain text:
  <input name="plaintext" size="40" type="text">
</p>
</td></tr></tbody></table>
</form>



Related: https://eikonal.wordpress.com/2010/05/21/cisco-%e2%80%9cpassword-7%e2%80%b3/

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: