Jump to content


Photo

HTML and PHP page for radius user creation


  • Please log in to reply
2 replies to this topic

#1 lucas_robb

lucas_robb

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 19 November 2013 - 02:57 PM

Hey All,

 

I'm having difficulty as I would like to create a simple HTML page that will create for me new RADIUS users.  Can someone help me pass text from the HTML page into the PHP script.  I'm trying to setup new users for radius, I can figure out the server side but what I want is to have PHP input a username and a password (masked) and a button that activates the script which will then append to the bottom of a file '$username NT-Password=: "$NTLMHash".  Can anyone provide any suggestions?  I'm already running a php script and html page found here: upload.lucasrobb.com so I know PHP server works

 

Thank you,



#2 lucas_robb

lucas_robb

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 19 November 2013 - 07:33 PM

Hello all

 

I hunted around and I thought... if I were to use this code to hash my password the way I need, would it work?

<?php
function MD4Hash($_POST["password"]) {
  // Convert the password from UTF8 to UTF16 (little endian)
  $_POST["password"]=iconv('UTF-8','UTF-16LE',$_POST["password"]);

  // Encrypt it with the MD4 hash
  $MD4Hash=bin2hex(mhash(MHASH_MD4,$_POST["password"]));

  // Return the result
  return($MD4Hash);
}
?>

Also, how would I then move on to use the $MD4Hash as a variable inside of my edited file later on?



#3 QuickOldCar

QuickOldCar

    Advanced Member

  • Members
  • PipPipPip
  • 1,825 posts
  • LocationNorthEast Pennsylvania

Posted 20 November 2013 - 10:58 PM

Try the following code.

 

<?php
function MD4Hash($post_password) {
// Convert the password from UTF8 to UTF16 (little endian)
$post_password=iconv('UTF-8','UTF-16LE',$post_password);
     
// Encrypt it with the MD4 hash
$MD4Hash=bin2hex(hash(md4, $post_password));
     
// Return the result
return($MD4Hash);
}

//you may want to do additional checking on the post values
$post_password = trim($_POST["password"]);
echo MD4Hash($post_password);
?>

DynaIndex.com
Dynamic search index of websites, links, feeds, title, description, keywords and thumbnail snapshot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com