Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Logowanie w Orange.pl
bpp
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 11.12.2010

Ostrzeżenie: (0%)
-----


Witam, potrzebuje skryptu który zaloguje się w Orange.pl. Użyłem sniffera żeby zobaczyć co jest wysyłane metodą POST i okazuje się, że do serwera nic nie jest wysyłane. Nie wiem jak ten portal funkcjonuje. Znalazłem kilka skryptów w internecie jednak żaden nie działa, bo prawdopodobnie Orange zmieniło parametry POST, których nie da się znaleźć, bo albo Wireshark nie widzi żeby coś było wysyłane, albo nic nie jest wysyłane. Jeśli nie skrypt to proszę chociaż o te parametry. No i czy curl tworzy sobie sam ciastka?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
aart3k
post
Post #2





Grupa: Zarejestrowani
Postów: 72
Pomógł: 10
Dołączył: 2.02.2008
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Wystarczy spojrzeć do html i już wiadomo co jak działa
  1. <form id="loginForm" method="post" action="https://www.orange.pl/start.phtml?_DARGS=/gear/infoportal/header/user-box.jsp"><input type="hidden" name="_dyncharset" value="UTF-8"><ul class="login-form"><li class="first"><label for="login-field">login lub nr telefonu</label><input type="text" id="login-field" name="/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.userLogin" class="text" value=""><input type="hidden" name="_D:/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.userLogin" value=" "></li><li><label for="password-field">hasło</label><input type="password" id="password-field" name="/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.userPassword" class="text" value="asdasd"><input type="hidden" name="_D:/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.userPassword" value=" "></li><li class="error"><span class="error-box">Podaj poprawny login i hasło</span></li><li class="button"><input type="hidden" name="/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.successUrl" value="/start.phtml"><input type="hidden" name="_D:/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.successUrl" value=" "><input type="hidden" name="/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.errorUrl" value="/start.phtml"><input type="hidden" name="_D:/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.errorUrl" value=" "><input type="hidden" name="/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.login" value="loguj"><input type="hidden" name="_D:/ptk/map/infoportal/portlet/header/formhandler/ProxyProfileFormhandler.login" value=" "><ul class="links"><li><a title="przypomnij mi hasło" href="/portal/map/map/passwd_recovery" class="gray-full-box">przypomnij mi hasło</a></li><li><a title="zarejestruj się" href="/portal/map/map/register?step=1" class="gray-full-box">zarejestruj się</a></li></ul><input type="image" title="zaloguj się" src="https://www.orange.pl/binaries-https/map/infoportal/button/zaloguj_sie.gif" value="loguj" class="button"></li></ul><input type="hidden" name="_DARGS" value="/gear/infoportal/header/user-box.jsp"></form>

W firebugu ładniej to wygląda, poza tym i Data Tamper i Firebug znalazły co jest wysyłane postem.

Powodzenia
Go to the top of the page
+Quote Post
bpp
post
Post #3





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 11.12.2010

Ostrzeżenie: (0%)
-----


Zrobiłem coś takiego i niestety nic się nie pokazuje. Dane POST znalazłem Data Tamperem(nie wiedziałem, że coś takiego istnieje).

  1. <?php
  2. $c = curl_init();
  3. curl_setopt($c, CURLOPT_URL, 'http://www.orange.pl/portal/zaloguj.phtml');
  4. curl_setopt($c, CURLOPT_POST, 1);
  5. curl_setopt($c, CURLOPT_POSTFIELDS, '_dyncharset=UTF-8&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.loginErrorURL=http%3A%2F%2Fwww.orange.pl%2Fzaloguj.phtml&_D%3A%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.loginErrorURL=+&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.value.login=XXXXXXX&_D%3A%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.value.login=+&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.value.password=XXXXXXX&_D%3A%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.value.password=+&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.login.x=0&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.login.y=0&_D%3A%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.login=+&_DARGS=%2Fgear%2Fstatic%2FsignInLoginBox.jsp');
  6. curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  7. curl_exec($c);
  8. curl_close($c);
  9.  
  10. $c = curl_init();
  11. curl_setopt($c, CURLOPT_URL, "https://www.orange.pl/start.phtml");
  12. curl_exec($c);
  13. curl_close($c);
  14. ?>


Ten post edytował bpp 11.12.2010, 12:22:43
Go to the top of the page
+Quote Post
aart3k
post
Post #4





Grupa: Zarejestrowani
Postów: 72
Pomógł: 10
Dołączył: 2.02.2008
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Musisz jeszcze sobie ciasteczko przechować gdzieś z curla.
Go to the top of the page
+Quote Post
bpp
post
Post #5





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 11.12.2010

Ostrzeżenie: (0%)
-----


Niestety dalej nic. Chyba nie powinienem zamykać pierwszego curl i ciągnąć do dalej z tymi ciasteczkami, ale ja się kompletnie na php nie znam.

  1. <?php
  2. $c = curl_init();
  3. curl_setopt($c, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookie.txt');
  4. curl_setopt($c, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookie.txt');
  5. curl_setopt($c, CURLOPT_URL, 'http://www.orange.pl/portal/zaloguj.phtml');
  6. curl_setopt($c, CURLOPT_POST, 1);
  7. curl_setopt($c, CURLOPT_POSTFIELDS, '_dyncharset=UTF-8&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.loginErrorURL=http%3A%2F%2Fwww.orange.pl%2Fzaloguj.phtml&_D%3A%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.loginErrorURL=+&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.value.login=XXXXXXX&_D%3A%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.value.login=+&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.value.password=XXXXXXX&_D%3A%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.value.password=+&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.login.x=0&%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.login.y=0&_D%3A%2Famg%2Fptk%2Fmap%2Fcore%2Fformhandlers%2FAdvancedProfileFormHandler.login=+&_DARGS=%2Fgear%2Fstatic%2FsignInLoginBox.jsp');
  8. curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  9. curl_exec($c);
  10. curl_close($c);
  11.  
  12. $c = curl_init();
  13. curl_setopt($c, CURLOPT_URL, "https://www.orange.pl/start.phtml");
  14. curl_exec($c);
  15. curl_close($c);
  16. ?>


EDIT: Już wszystko działa, dzięki za pomoc!
EDIT2: Jeszcze jedno. Dałem sobie $strona = curl_exec($c); żeby strona mi się w zmiennej znalazła, jednak w środku jest tylko '1', a mimo to stronka się normalnie w przeglądarce wyświetla. O co chodzi?
EDIT3: Znów sobie poradziłem.

Ten post edytował bpp 11.12.2010, 13:40:22
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.08.2025 - 00:25