Jump to content

md5 calculation


NTBM
 Share

Recommended Posts

I have a site that requires a valid md5 checksum to be given back to it in a form post, I am trying to utilize winhttp to pass the form data but need assistance with the md5 checksum.

The page source code:-

<script LANGUAGE="javascript" SRC="/md5.js" TYPE="text/javascript">
</script>
<script LANGUAGE="javascript" TYPE="text/javascript">
    function calcResponse() {
        str = Data1.value +
            Data2.value +
            Data3.value;

        Response.value = hex_md5(str);
        document.data.submit();
    }
</script>

Is there a way that I can generate the required md5 to pass back in a _WinHttpSimpleFormFill command?

Regards

Link to comment
Share on other sites

Use of the forum search feature turns up a number of posted implementations.

Among them is the one by trancexx

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Thankyou for your response. i had searched and found lots of pages but not that one, thankyou.

if it helps, the important part is

Data3 = {a hidden field value that is random with each page load}

so i assume that the web enabled device is parsing the three variables to the script before submitting them.

Form Data from web device

<form NAME="Form1" ACTION="/tgi/page1.tgi" METHOD="post">
<center>
<table NAME="myTable" ALIGN="center" CELLPADDING="10" WIDTH="96%"
CELLSPACING="0">
<tr ALIGN="left" VALIGN="top">
<td COLSPAN="2"><font SIZE="2" FACE=
"Arial, Helvetica, sans-serif">Please enter Data1 &amp;
Data2.</font></td></tr>
<tr ALIGN="left" VALIGN="top">
<td><font FACE="Verdana,Arial"><font SIZE="-1">Data1</font></font></td>
<td><input TYPE="text" NAME="Data1" VALUE="" SIZE="32"
MAXLENGTH="32"></td></tr>
<tr ALIGN="left" VALIGN="top">
<td HEIGHT="46"><font FACE="Verdana,Arial"><font SIZE=
"-1">Data2</font></font></td>
<td HEIGHT="46"><input TYPE="text" NAME="Data2" VALUE=""
       SIZE="32" MAXLENGTH="32"></td></tr>
<tr ALIGN="left" VALIGN="top">
<td></td>
<td>
<p ALIGN="center"><input ONCLICK="calcResponse(); return false;"
TYPE="Submit" NAME="Submitbtn" VALUE="    OK      ">
       <input TYPE="button" NAME="Cancel" VALUE="   Cancel   "
       ONCLICK=
       "data1.value='';data1.value=''">
</p></td></tr></table></center>
<input TYPE="hidden" NAME="Challenge" VALUE=
"hS0r...."> <input TYPE="hidden" NAME="Response"
       VALUE="">
</form>

The Value of <input TYPE="hidden" NAME="Challenge"..> is random and but i can get it using winhttp

Having next to no working knowledge of java script or MD5, what i am trying to figure out is if simply adding them all together and then creating an MD5 hex hash will give an answer that the web page will accept, or do i need (if possible) to parse it to the java script of the page?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...