PHP Curl taklit web giriş

1 Cevap php

Ben otomatik olarak belirli bir web sayfasına giriş yapmaya çalışıyorum oldum ama şimdiye kadar hiçbir başarı.

Ben gerçekten beni hareketli olsun herhangi bir yardım takdir ediyorum ....

Bu giriş sayfası için URL:

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

İlk alan adı için ve ikinci şifre için.

Ben Live HTTP başlık fişi kullanarak oldum ama oturum yönetmek yoktu

Teşekkürler.


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)

Ben de küçük bir dize dinamik olarak değişir ucunda olduğunu fark ettik

İşte bu dizi için bir örnek:

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?

Teşekkürler

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?

1 Cevap

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

Burada POST şeklidir:

Form name = "aspnetForm" method = "post" action = "default.aspx" id = "aspnetForm" otomatik tamamlama = "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?