For thoes of you who're looking to generate an NTLM hash (not an LM hash), I found out it's quite simple..
It uses the basic MD4 function, but the password needs to be in Unicode Little Endian encode first (this canbe achieved by the iconv function).
This can be done easily by using the following code:
<?php
function NTLMHash($Input) {
$Input=iconv('UTF-8','UTF-16LE',$Input);
$MD4Hash=bin2hex(mhash(MHASH_MD4,$Input));
$NTLMHash=strtoupper($MD4Hash);
return($NTLMHash);
}
?>
To produce an LM hash requires a fully-written script containing the algorithm used to make it.
Enjoy,
CraquePipe.