Jump to content

HTML and PHP page for radius user creation


lucas_robb

Recommended Posts

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,

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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);
?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.