tags:

views:

79

answers:

2

Hi,

I've been trying to automatically log in to specific web page but no success till now.

I would really appreciate any help to get me moving....

This is the URL for the login page:

https://www.cellcom.co.il/login/pages/default.aspx

The first field is for the username and the second is for the password.

I've been using the Live HTTP header plug in but did not manage to log in.

Thanks.

A: 

I'm close to crack this down. I figured out that one POST form field as embed partial value which changes dynamically. so all i need to do is getting this embed partial value and adding some static text to it. to get the complete field value.

How do i get a POST form field value? (I've seen the value while looking at the form source code)

I've also noticed that there is a small string at the end that changes dynamically

Here is an example for that string:

1)__EVENTVALIDATION=%2FwEWBQLh6fTmCwLEh%2FPQBQLquryWCwLdkfOzBAKJwsCnBDoiuyJEoeA1mA05RcQwJ0YqLNx4

2)__EVENTVALIDATION=%2FwEWBQLj%2BKPzBgLEh%2FPQBQLquryWCwLdkfOzBAKJwsCnBELoi3vgs%2BqAdCbcwk%2BkyCQwEq30

Does anyone know how to generate this string? Is it related to date or something like this?

Thanks

EDIT: all the dynamically values are embedded in the HTTP source file. Is it possible to parse those values in ease using PHP? If so, how?

Embedded
We aren't able to think anything without seeing code. Please post the code you're having a problem with or none of us can do anything to help you.
mattbasta
That is the state of the form. that value ist generated by dotnet.you have to post the current value always back to the form.when you get the response you have to take care about the new value!
Bernd Ott
What do u mean by:when you get the response you have to take care about the new value!?How can i get this field value?I need to get the value and encode it to url string.
Embedded
A: 

Still no success. I think I'm missing some tiny detail.

here is the POST form:

form name="aspnetForm" method="post" action="default.aspx" id="aspnetForm" autocomplete="off"

input type="hiden" name="_SPSCEditMenu" id="_SPSCEditMenu" value="true" / input type="hidden" name="MSOWebPartPage_PostbackSource" id="MSOWebPartPage_PostbackSource" value="" / input type="hidden" name="MSOTlPn_SelectedWpId" id="MSOTlPn_SelectedWpId" value="" /> input type="hidden" name="MSOTlPn_View" id="MSOTlPn_View" value="0" />

input type="hidden" name="MSOTlPn_ShowSettings" id="MSOTlPn_ShowSettings" value="False" /> input type="hidden" name="MSOGallery_SelectedLibrary" id="MSOGallery_SelectedLibrary" value="" /> input type="hidden" name="MSOGallery_FilterString" id="MSOGallery_FilterString" value="" /> input type="hidden" name="MSOTlPn_Button" id="MSOTlPn_Button" value="none" /> input type="hidden" name="_REQUESTDIGEST" id="_REQUESTDIGEST" value="0xFFD5F7BB65113ADA485BE8F57AF640C45348305D1590E21AEF42305F6FB76DAF255DAD98F5110B3065ADAC1AE647B87F1309481C513057EC9C2C9EB5C71770D4,15 Jan 2010 19:29:23 -0000" /> input type="hidden" name="MSOAuthoringConsole_FormContext" id="MSOAuthoringConsole_FormContext" value="" /> input type="hidden" name="MSOAC_EditDuringWorkflow" id="MSOAC_EditDuringWorkflow" value="" /> input type="hidden" name="MSOSPWebPartManager_DisplayModeName" id="MSOSPWebPartManager_DisplayModeName" value="Browse" /> input type="hidden" name="MSOWebPartPage_Shared" id="MSOWebPartPage_Shared" value="" /> input type="hidden" name="MSOLayout_LayoutChanges" id="MSOLayout_LayoutChanges" value="" /> input type="hidden" name="MSOLayout_InDesignMode" id="MSOLayout_InDesignMode" value="" /> input type="hidden" name="MSOSPWebPartManager_OldDisplayModeName" id="MSOSPWebPartManager_OldDisplayModeName" value="Browse" /> input type="hidden" name="MSOSPWebPartManager_StartWebPartEditingName" id="MSOSPWebPartManager_StartWebPartEditingName" value="false" /> input type="hidden" name="_VIEWSTATE" id="_VIEWSTATE" value="/wEPDwUBMA9kFgJmD2QWAgIBDxYCH==" />

and this is the code I'm using: function http($target, $ref, $method, $data_array, $incl_head) { # Initialize PHP/CURL handle $ch = curl_init();

# HEAD method configuration
if($method == HEAD)
    {
    curl_setopt($ch, CURLOPT_HEADER, TRUE);                // No http head
    curl_setopt($ch, CURLOPT_NOBODY, TRUE);                // Return body
    }
else
    {
    # GET method configuration
    if($method == GET)
        {
        if(isset($query_string))
            $target = $target . "?" . $query_string;
        curl_setopt ($ch, CURLOPT_HTTPGET, TRUE); 
        curl_setopt ($ch, CURLOPT_POST, FALSE); 
        }
    # POST method configuration
    if($method == POST)
        {
        if(isset($data_array))
            curl_setopt ($ch, CURLOPT_POSTFIELDS, $data_array);
        curl_setopt ($ch, CURLOPT_POST, TRUE); 
        curl_setopt ($ch, CURLOPT_HTTPGET, FALSE); 
        }
    curl_setopt($ch, CURLOPT_HEADER, $incl_head);   // Include head as needed
    curl_setopt($ch, CURLOPT_NOBODY, FALSE);        // Return body
    }

curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIE_FILE);   // Cookie management.
curl_setopt($ch, CURLOPT_COOKIEFILE, COOKIE_FILE);
curl_setopt($ch, CURLOPT_TIMEOUT, CURL_TIMEOUT);    // Timeout
curl_setopt($ch, CURLOPT_USERAGENT, WEBBOT_NAME);   // Webbot name
curl_setopt($ch, CURLOPT_URL, $target);             // Target site
curl_setopt($ch, CURLOPT_REFERER, $ref);            // Referer value
curl_setopt($ch, CURLOPT_VERBOSE, FALSE);           // Minimize logs
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);    // No certificate
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);     // Follow redirects
curl_setopt($ch, CURLOPT_MAXREDIRS, 4);             // Limit redirections to four
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);     // Return in string

I'm using this URL which I extracted from Live HTPP header for the form: https://www.cellcom.co.il/siteminderagent/forms/login.fcc

what Do u think? does it make sense?

Embedded