cURL werkt niet zoals het moet

Gestart doorJoeryy21 reacties50 weergaven

22 berichten · pagina 1 van 2

Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hey,

Ik heb dus op google een cURL script gevonden, en het werkt maar bij http://www.z8games.com/loging/globelogin.aspx werkt hij niet.

Hier de code:

[COLOR= #0000BB]<?php
$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]naam[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$loginUrl[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]http://www.site.com/login[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Als ik http://www.z8games.com/loging/globelogin.aspx doe werkt het niet[/COLOR]


[COLOR= #0000BB]$ch[/COLOR] [COLOR= #007700]=[/COLOR] curl_init[COLOR= #007700]();[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$loginUrl[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_POST[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_POSTFIELDS[COLOR= #007700],[/COLOR] [COLOR= #DD0000]username=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]&password=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_COOKIEJAR[COLOR= #007700],[/COLOR] [COLOR= #DD0000]cookie.txt[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_RETURNTRANSFER[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]


[COLOR= #0000BB]$store[/COLOR] [COLOR= #007700]=[/COLOR] curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #FF8000]//ingelogd[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #DD0000]http://site.com/[/COLOR][COLOR= #007700]);[/COLOR]


[COLOR= #0000BB]$content[/COLOR] [COLOR= #007700]=[/COLOR] curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700]);[/COLOR]


?>


Bedankt als iemand kan helpen smile!
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
HTTP Headers goed? (Regel 13)
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
HTTP Headers goed? (Regel 13)
Heb ik geprobeerd, werkt nog niet :I!

toevoeging op 10 februari 2013, 02:51:15:
Bump
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bump
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Wat toont Liveheaders voor die site na het inloggen? Je zult denk ik ergens een header missen.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je postfields kloppen niet
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Wat Luuk zegt.
Deze velden moet je hebben:

Array
(
    [__EVENTTARGET] => 
    [__EVENTARGUMENT] => 
    [__VIEWSTATE] => CODE HIER
    [__EVENTVALIDATION] => CODE HIER
    [tb_loginid] => USERNAME HIER
    [tb_password] => PASSWORD HIER
    [ib_login_x] => 1
    [ib_login_y] => 1
)


Die codes zijn variabel en moet je dus eerst van de pagina afhalen.
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lennard schreef:
Wat Luuk zegt.
Deze velden moet je hebben:
Array
(
    [__EVENTTARGET] => 
    [__EVENTARGUMENT] => 
    [__VIEWSTATE] => CODE HIER
    [__EVENTVALIDATION] => CODE HIER
    [tb_loginid] => USERNAME HIER
    [tb_password] => PASSWORD HIER
    [ib_login_x] => 1
    [ib_login_y] => 1
)


Die codes zijn variabel en moet je dus eerst van de pagina afhalen.

Gedaan, nu krijg ik dit:

HTTP/1.1 302 Redirect Content-Type: text/html; charset=UTF-8 Location: http://www.z8games.com/Loging/GlobeLogin.aspx Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Sun, 10 Feb 2013 11:47:20 GMT Content-Length: 168
Object Moved

This document may be found hereHTTP/1.1 302 Redirect Content-Type: text/html; charset=UTF-8 Location: http://www.z8games.com/Loging/GlobeLogin.aspx Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Sun, 10 Feb 2013 11:47:20 GMT Content-Length: 168
Object Moved

This document may be found hereHTTP/1.1 302 Redirect Content-Type: text/html; charset=UTF-8 Location: http://www.z8games.com/Loging/GlobeLogin.aspx Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Sun, 10 Feb 2013 11:47:20 GMT Content-Length: 168
Object Moved

This document may be found hereHTTP/1.1 500 Internal Server Error Cache-Control: private Content-Length: 7398 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET Date: Sun, 10 Feb 2013 11:47:21 GMT
Server Error in / Application.
0
Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Post je nieuwe script is?
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zal wel niet veel van kloppen maar:

[COLOR= #0000BB]<?php
$url[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]http://www.z8games.com/loging/globelogin.aspx[/COLOR][COLOR= #007700];[/COLOR]

     [COLOR= #0000BB]$header[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL] 
    [COLOR= #007700]([/COLOR]
        [COLOR= #DD0000]"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0"[/COLOR][COLOR= #007700],[/COLOR]
        [COLOR= #DD0000]"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"[/COLOR][COLOR= #007700],[/COLOR]
        [COLOR= #DD0000]"Accept-Encoding: gzip, deflate"[/COLOR][COLOR= #007700],[/COLOR]
        [COLOR= #DD0000]"Accept-Language: en-US,en;q=0.5"[/COLOR][COLOR= #007700],[/COLOR]
        [COLOR= #DD0000]"Cache-Control:   max-age=0"[/COLOR][COLOR= #007700],[/COLOR]
        [COLOR= #DD0000]"Connection: keep-alive"[/COLOR][COLOR= #007700],[/COLOR]
        [COLOR= #DD0000]"Pragma: no-cache"[/COLOR][COLOR= #007700],[/COLOR]
        [COLOR= #DD0000]"Content-Type: application/x-www-form-urlencoded; charset=utf-8"[/COLOR]
    [COLOR= #007700]);[/COLOR]

    [COLOR= #0000BB]$post_fields[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]
        __EVENTTARGET=
        &__EVENTARGUMENT=
        &__VIEWSTATE=/wEPDwULLTE0NjU0OTUxNTQPFgIeC2dhbWVJZGxvZ2luBQE0FgICAw9kFgJmD2QWDAIEDw9kFgQeCm9ubW91c2VvdXQFUGphdmFzY3JpcHQ6ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2liX2xvZ2luJykuc3JjPScvaW1hZ2VzL3RvcC9idF9sb2dpblJOLnBuZyc7Hgtvbm1vdXNlb3ZlcgVQamF2YXNjcmlwdDpkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWJfbG9naW4nKS5zcmM9Jy9pbWFnZXMvdG9wL2J0X2xvZ2luUk8ucG5nJztkAgUPD2QWBB8BBWZqYXZhc2NyaXB0OmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdsYl9teWFjY291bnQnKS5zcmM9Jy4uL2ltYWdlcy9sb2dpbl9oZWFkL3o4YmFyX215YWNjb3VudGJ0Uk4uZ2lmJzsfAgVmamF2YXNjcmlwdDpkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnbGJfbXlhY2NvdW50Jykuc3JjPScuLi9pbWFnZXMvbG9naW5faGVhZC96OGJhcl9teWFjY291bnRidFJPLmdpZic7ZAIGDw9kFgQfAQViamF2YXNjcmlwdDpkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnbGJfZGVwb3NpdCcpLnNyYz0nLi4vaW1hZ2VzL2xvZ2luX2hlYWQvejhiYXJfZGVwb3NpdGJ0Uk4uZ2lmJzsfAgViamF2YXNjcmlwdDpkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnbGJfZGVwb3NpdCcpLnNyYz0nLi4vaW1hZ2VzL2xvZ2luX2hlYWQvejhiYXJfZGVwb3NpdGJ0Uk8uZ2lmJztkAgcPD2QWBB8BBV5qYXZhc2NyaXB0OmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpYl9sb2dvdXQnKS5zcmM9Jy9pbWFnZXMvbG9naW5faGVhZC96OGJhcl9sb2dvdXRidFJOLmdpZic7HwIFXmphdmFzY3JpcHQ6ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2liX2xvZ291dCcpLnNyYz0nL2ltYWdlcy9sb2dpbl9oZWFkL3o4YmFyX2xvZ291dGJ0Uk8uZ2lmJztkAgoPD2QWBB8BBWBqYXZhc2NyaXB0OmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpYl9sb3N0aWQnKS5zcmM9Jy4uL2ltYWdlcy9sb2dpbl9oZWFkL3o4YmFyX2xvc3RpZGJ0Uk4uZ2lmJzsfAgVgamF2YXNjcmlwdDpkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWJfbG9zdGlkJykuc3JjPScuLi9pbWFnZXMvbG9naW5faGVhZC96OGJhcl9sb3N0aWRidFJPLmdpZic7ZAIMDw9kFgQfAQVPZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImliX3JlZ2lzdGVyIikuc3JjPScvaW1hZ2VzL2xvZ2luX2hlYWQvYnRfc2lnbnVwUk4ucG5nJx8CBU9kb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiaWJfcmVnaXN0ZXIiKS5zcmM9Jy9pbWFnZXMvbG9naW5faGVhZC9idF9zaWdudXBSTy5wbmcnZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAgUIaWJfbG9naW4FC2liX3JlZ2lzdGVysnS5Mluj2adV1CnNKfE6LJ6xsLI=
        &__EVENTVALIDATION=/wEWBgLf1/HiAgK9/5LZBALF8dDtCgKu7Mq6CAL+l4jbCgK96tyPDk0UZY2BmpvVzSjEApdV2qiu5mP5
        &tb_loginid=poedelnoob
        &tb_password=********
        &ib_login.x=11
        &ib_login.y=19
    [/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$ch[/COLOR] [COLOR= #007700]=[/COLOR] curl_init[COLOR= #007700]();[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR] 

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_HEADER[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_POST[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_POSTFIELDS[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$post_fields[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_COOKIEJAR[COLOR= #007700],[/COLOR] [COLOR= #DD0000]cookie.txt[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_RETURNTRANSFER[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]


[COLOR= #0000BB]$store[/COLOR] [COLOR= #007700]=[/COLOR] curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$store[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]//ingelogd[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #DD0000]http://z8games.com/[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$content[/COLOR] [COLOR= #007700]=[/COLOR] curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$content[/COLOR][COLOR= #007700];[/COLOR]
?>


En krijg nu dit:
Spoiler tonen
Server Error in / Application.

The state information is invalid for this page and might be corrupted.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.

Source Error: 

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace: 


[FormatException: Invalid length for a Base-64 char array.]
   System.Convert.FromBase64String(String s) +0
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +98
   System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +205

[ViewStateException: Invalid viewstate. 
    Client IP: 212.84.155.121
    Port: 62589
    User-Agent: 
    ViewState: /wEWBgLf1/HiAgK9/5LZBALF8dDtCgKu7Mq6CAL l4jbCgK96tyPDk0UZY2BmpvVzSjEApdV2qiu5mP5
        
    Referer: 
    Path: /loging/globelogin.aspx]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +148
   System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +10973054
   System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +64
   System.Web.UI.WebControls.TextBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +47
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +507
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11070247
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11069786
   System.Web.UI.Page.ProcessRequest() +91
   System.Web.UI.Page.ProcessRequest(HttpContext context) +240
   ASP.loging_globelogin_aspx.ProcessRequest(HttpContext context) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5456
Object Moved

This document may be found here
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Lennard schreef:
Die codes zijn variabel en moet je dus eerst van de pagina afhalen.
Die veranderen per pageview/sessie ofzo dus die moet je elke keer voor je inlogt ophalen en gebruiken in je loginscript.
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lennard schreef:
Eerdere citaten tonen
Lennard schreef:
Die codes zijn variabel en moet je dus eerst van de pagina afhalen.
Die veranderen per pageview/sessie ofzo dus die moet je elke keer voor je inlogt ophalen en gebruiken in je loginscript.
Bedankt, zal het proberen.

toevoeging op 10 februari 2013, 14:20:57:
Oke, dat is gelukt:

[COLOR= #0000BB]<?php
$url[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]http://www.z8games.com/loging/globelogin.aspx[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #0000BB]$html[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR]

    [URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]~<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="(.*?)" />~[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$html[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$viewstate[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]~<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="(.*?)" />~[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$html[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$eventvalidation[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #0000BB]$vstate[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$viewstate[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$eval[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$eventvalidation[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR]
        
    [COLOR= #0000BB]$post_fields[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]
        __EVENTTARGET=
        &__EVENTARGUMENT=
        &__VIEWSTATE=[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/urlencode"]urlencode[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$vstate[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]
        &__EVENTVALIDATION=[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/urlencode"]urlencode[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$eval[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]
        &tb_loginid=poedelnoob
        &tb_password=********
        &ib_login.x=11
        &ib_login.y=19
    [/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$ch[/COLOR] [COLOR= #007700]=[/COLOR] curl_init[COLOR= #007700]();[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR] 

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_RETURNTRANSFER[COLOR= #007700],[/COLOR] true[COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_HEADER[COLOR= #007700],[/COLOR] false[COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_ENCODING[COLOR= #007700],[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_USERAGENT[COLOR= #007700],[/COLOR] [COLOR= #DD0000]"Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7s"[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_REFERER[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_POST[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_POSTFIELDS[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$post_fields[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_COOKIEJAR[COLOR= #007700],[/COLOR] [COLOR= #DD0000]cookie.txt[/COLOR][COLOR= #007700]);[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_RETURNTRANSFER[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]


[COLOR= #0000BB]$store[/COLOR] [COLOR= #007700]=[/COLOR] curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$store[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]//ingelogd[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #DD0000]http://z8games.com/[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$content[/COLOR] [COLOR= #007700]=[/COLOR] curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700]);[/COLOR]

?>


geeft
Spoiler tonen
Server Error in / Application.

The state information is invalid for this page and might be corrupted.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.

Source Error: 

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace: 


[ViewStateException: Invalid viewstate. 
    Client IP: 212.84.155.121
    Port: 63151
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7s
    ViewState: /wEWBgLf1/HiAgK9/5LZBALF8dDtCgKu7Mq6CAL+l4jbCgK96tyPDk0UZY2BmpvVzSjEApdV2qiu5mP5
        
    Referer: http://www.z8games.com/loging/globelogin.aspx
    Path: /loging/globelogin.aspx]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +148
   System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +343
   System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +64
   System.Web.UI.WebControls.TextBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +47
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +507
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11070247
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11069786
   System.Web.UI.Page.ProcessRequest() +91
   System.Web.UI.Page.ProcessRequest(HttpContext context) +240
   ASP.loging_globelogin_aspx.ProcessRequest(HttpContext context) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5456
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Haal de code in dezelfde cURL sessie want file_get_contents heeft een andere sessie dan cURL waardoor het alsnog niet werkt. (kan het verkeerd hebben, heb de site niet bekeken maar wat ik uit de posts hier haal is dat nu het probleem)
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
en je stuurt nu bij elke waarde een newline + zooi tabs/spaties mee, dus dat moet ook niet.
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt allemaal, de oplossing was:

[COLOR= #0000BB]<?php
$post_fields[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/urlencode"]urlencode[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$vstate[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]&__EVENTVALIDATION=[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/urlencode"]urlencode[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$eval[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]&tb_loginid=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$username[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]&tb_password=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$password[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]&ib_login.x=11&ib_login.y=19[/COLOR][COLOR= #007700];[/COLOR]
?>


dus wat Lennard zei.

toevoeging op 20 maart 2013, 18:37:31:
Hmm, op een of andere manier werkt hij niet meer..

function checkaccount($username, $password) {

$url = http://www.z8games.com/loging/globelogin.aspx;

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url); 

    $html = file_get_contents($url);

    preg_match(~<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="(.*?)" />~,$html,$viewstate);
    preg_match(~<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="(.*?)" />~,$html,$eventvalidation);

    $vstate = $viewstate[1];
    $eval = $eventvalidation[1];

    $post_fields=__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE= . urlencode($vstate) . &__EVENTVALIDATION= . urlencode($eval) . &tb_loginid= . $username . &tb_password= . $password . &ib_login.x=40&ib_login.y=10;

curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7s");
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_COOKIEJAR, cookie.txt);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);


$store = curl_exec($ch);



curl_close($ch);

file_put_contents("cookie.txt", "");
}
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren