Announcement

Collapse
No announcement yet.

Online Serial Number Authentication Checker

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Online Serial Number Authentication Checker

    Can someone share a simple code that only checks the serial number. No name or anything else. And i want to have a php as well that i can insert the MD5 hash tags for security on my serial numbers along with it emailing me info. If you make a code i use HTTPS not HTTP. Would really appreciate it. If you want to take it a step further i would like it to add a counter to each installation that updates the php so i now if someone is abusing the installer.

    Here is a code i have been trying. Includes everything i requested. But it only returns no match.

    Code:
    -- Gets the username and serial from the text fields named UserName
    -- And UserSerial.
    sUsername = SessionVar.Expand("%UserName%");
    sPassword = SessionVar.Expand("%UserSerial%");
    
    -- Setup the data to be sent. (No md5 though)
    sCheckScriptURL = "https://www.flysimware.com/authenticate.php";
    tValuesToPass = {reguser = sUsername, regserial = sPassword};
    nSubmitMethod = SUBMITWEB_POST;
    nTimeout = 20;
    nPort = 80;
    tAuthData = nil;
    tProxyData = nil;
    
    -- Just some simple stuff to set up
    strProductName = SessionVar.Expand("%ProductName%");
    -- Email address you want to receive the details on
    strEmailTo = "[email protected]";
    -- Location of the mail script to send the details out.
    strURL = "https://www.flysimware.com/mail.php";
    
    -- System Variable Values About The User Passed For The Email
    userinfo = System.GetUserInfo();
    regowner = userinfo.RegOwner;
    netdetails = System.GetLANInfo();
    nicaddress = netdetails.NIC;
    regorganization = userinfo.RegOrganization;
    driveserial = Drive.GetInformation(_SourceDrive).SerialNumber;
    time = System.GetTime(TIME_FMT_AMPM);
    current_time = System.GetTime(1);
    date = System.GetDate(DATE_FMT_EUROPE);
    current_date = System.GetDate(2);
    emailaddress = "strEmailTo";
    
    -- Prepare the message to be sent
    local strMessage = "";
    strMessage = strMessage.."Product: "..strProductName.."\r\n";
    strMessage = strMessage.."Name: "..SessionVar.Expand("%UserName%").."\r\n";
    strMessage = strMessage.."Serial: "..SessionVar.Expand("%UserSerial%").."\r\n";
    strMessage = strMessage.."Info: "..regowner.."\r\n";
    strMessage = strMessage.."Mac Address: "..nicaddress.."\r\n";
    strMessage = strMessage.."Reg Organization: "..regorganization.."\r\n";
    strMessage = strMessage.."Drive Serial: "..driveserial.."\r\n";
    strMessage = strMessage.."Registration Time: "..current_time.."\r\n";
    strMessage = strMessage.."Registration Date: "..current_date;
    
    local strSubject = "Registration for "..strProductName;
    local strFrom = emailaddress;
    local strTo = strEmailTo;
    
    -- Create the message data to be sent to the mail.php script:
    local tblValues = {MailTo=strTo,MailFrom=strFrom,MailSubject=strSubject,MailMessage=strMessage};
    local nLastError = Application.GetLastError();
    
    -- Show a dialog box while the persons details are being checked
    StatusDlg.Show();
    StatusDlg.ShowProgressMeter(true);
    StatusDlg.SetTitle("Validating");
    StatusDlg.SetStatusText("Please wait while your details are being checked with the server...");
    --  Presto Send to the web and hide the activation dialog box
    sResult = HTTP.Submit(sCheckScriptURL, tValuesToPass, nSubmitMethod, nTimeout, nPort, tAuthData, tProxyData);
    local strResult = HTTP.Submit(strURL,tblValues,SUBMITWEB_POST);
    StatusDlg.Hide();
    
    -- The details were correct. (the installer received a value of one)
    if sResult == "1" then
        -- The username and password was right
        Screen.Next();
    else
        -- Those details provided were wrong. Or no longer in the database.
        Dialog.Message("ERROR", "Those details are invalid. Or they have been removed from the server", MB_OK, MB_ICONSTOP);
    end

  • #2


    PHP Code:
    <? 

    // Returns '1' if details received are correct, or '0' if the details were incorrect 

    // Set the table of users 
    // Add some entries to the table "Username"=>"Serial" 
    // You must complete all entrie with a comma, except the last table entry(or it won't work) 
    $user_table = array( 
        
    "Test"=>"6771-1863-0916-62376"
        
    "John"=>"6439-6712-0452-34419"
        
    "Mr Smith"=>"0367-9465-9762-61028"
        
    "Gary??"=>"4235-9686-7813-91870"
        
    "NEVER"=>"9861-2206-4899-55662" 
    ); 

    // Was data posted to the script? 
    if ($_POST

        
    // Search through the table 
        
    foreach($user_table as $username=>$serial
        { 
            
    // Check if the details received via the installer are correct 
            
    if (($_POST['reguser'] == ("$username")) AND ($_POST['regserial'] == ("$serial"))) 
            { 
                
    // The Details Were Correct And Authenticated, Then Send the result to the installer. 
                
    echo '1'
                exit; 
            } 
        } 
    // The details supplied were not correct.Return the value of 0 to tell the installer to not let the install continue without the proper details 
    echo '0'
    exit; 


    else 

        
    // The script wasn't sent any post data by the installer. Or it was loaded through a web browser etc. 
        
    echo "No Registration data found. h4x0r"


    ?>

    Comment


    • #3
      I used a MD5 hash for the first test entry. Does not work. And tried a actual serial code.

      Comment


      • #4
        And php code to email info.

        PHP Code:
        <?php 

        // Send the details received from the users system to yuor email address you specified 

        $MessageNoSlashes stripslashes($MailMessage); 
        $SubjectNoSlashes stripslashes($MailSubject); 

        mail(    "$MailTo"
                
        "$SubjectNoSlashes"
                
        "$MessageNoSlashes"
                
        "From: $MailFrom\r\n" 
                
        ."Reply-To: $MailFrom\r\n"); 
        ?>

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎