Login Über HttpRequest

  • VB.NET

Es gibt 23 Antworten in diesem Thema. Der letzte Beitrag () ist von MoK12211.

    Login Über HttpRequest

    Hallo Liebe Userinnen und User

    ich würde gerne ein webclient erstellen
    mithilfe von webbrowser control

    1.) Angedacht war es so mann hat 2 textboxen und ein butten
    in der ersten form
    sollte mann sich erfolgreich eingelogt haben soll er dann form 2 öffnen
    wo mann dann eingelogt ist

    2.) wollte ich das ganze über HttpRequest laufen lassen da ich es sicher finde

    3.) ich bekomme es leider nur nicht hin er lässt mich immer auf der login seite

    4.) Ich habe auch ein Live Header mitschnitt gemacht weiß aber nicht ob das was ich gepostet habe reicht
    Mit geänderter adresse und Unkentlich gemachter zugangsdaten


    Spoiler anzeigen

    Brainfuck-Quellcode

    1. https://website.info/index.php/site/login/index.php
    2. GET /index.php/site/login/index.php HTTP/1.1
    3. Host: website.info
    4. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    5. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    6. Accept-Language: de
    7. Accept-Encoding: gzip, deflate
    8. Cookie: PHPSESSID=r2ctdoiqr54gmupi68cgtkiv19094g7g; YII_CSRF_TOKEN=f9b8eb665c096ca79794ec1ce0b331988849026c
    9. Connection: keep-alive
    10. HTTP/1.1 200 OK
    11. Date: Sun, 05 May 2013 17:15:57 GMT
    12. Server: Apache
    13. Access-Control-Allow-Origin: *
    14. Access-Control-Allow-Methods: POST, GET
    15. Expires: Thu, 19 Nov 1981 08:52:00 GMT
    16. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    17. Pragma: no-cache
    18. Vary: Accept-Encoding
    19. Content-Encoding: gzip
    20. P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
    21. Content-Length: 2487
    22. Connection: close
    23. Content-Type: text/html
    24. ----------------------------------------------------------
    25. https://website.info/index.php/site/login/index.php
    26. POST /index.php/site/login/index.php HTTP/1.1
    27. Host: website.info
    28. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    29. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    30. Accept-Language: de
    31. Accept-Encoding: gzip, deflate
    32. Referer: https://website.info/index.php/site/login/index.php
    33. Cookie: PHPSESSID=r2ctdoiqr54gmupi68cgtkiv19094g7g; YII_CSRF_TOKEN=f9b8eb665c096ca79794ec1ce0b331988849026c
    34. Connection: keep-alive
    35. Content-Type: application/x-www-form-urlencoded
    36. Content-Length: 162
    37. YII_CSRF_TOKEN=f9b8eb665c096ca79794ec1ce0b331988849026c&LoginForm%5Busername%5D=BENUTZERNAME&LoginForm%5Bpassword%5D=PASSWORT&yt0=Login&hideselector=.tohide&workflow=
    38. HTTP/1.1 302 Found
    39. Date: Sun, 05 May 2013 17:16:07 GMT
    40. Server: Apache
    41. Access-Control-Allow-Origin: *
    42. Access-Control-Allow-Methods: POST, GET
    43. Expires: Thu, 19 Nov 1981 08:52:00 GMT
    44. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    45. Pragma: no-cache
    46. Set-Cookie: __sps_eNpTVFVRVVFRVdTX09XX1VYDABHaAlU=f23t75d7vfjktjbsedhc65ajfig1muiv; path=/; secure; HttpOnly
    47. Set-Cookie: __sps_eNpTVFVRVVFRVdTX09XX1VYDABHaAlU=as506pqc08rpo9rdmaou4md85nj6pob3; path=/; secure; HttpOnly
    48. Location: https://website.info/site/index?__sps=eNpTVFVRVVFRVdTX09XX1VYDABHaAlU
    49. Vary: Accept-Encoding
    50. Content-Encoding: gzip
    51. P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
    52. Content-Length: 20
    53. Connection: close
    54. Content-Type: text/html
    55. ----------------------------------------------------------
    56. https://website.info/site/index?__sps=eNpTVFVRVVFRVdTX09XX1VYDABHaAlU
    57. GET /site/index?__sps=eNpTVFVRVVFRVdTX09XX1VYDABHaAlU HTTP/1.1
    58. Host: website.info
    59. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    60. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    61. Accept-Language: de
    62. Accept-Encoding: gzip, deflate
    63. Referer: https://website.info/index.php/site/login/index.php
    64. Cookie: PHPSESSID=r2ctdoiqr54gmupi68cgtkiv19094g7g; YII_CSRF_TOKEN=f9b8eb665c096ca79794ec1ce0b331988849026c; __sps_eNpTVFVRVVFRVdTX09XX1VYDABHaAlU=as506pqc08rpo9rdmaou4md85nj6pob3
    65. Connection: keep-alive



    Ich Hoffe ihr wisst eine Lösung

    Mit Freundlichen Grüßen
    Yolanda

    Edit by der_Kurt:
    * Topic verschoben *

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „der_Kurt“ ()

    Hi binn grad auch dabei sowas zu schreiben :D

    VB.NET-Quellcode

    1. Imports System
    2. Imports System.Net
    3. Imports System.IO
    4. Imports System.Text
    5. Public Class Form1
    6. Private Sub LOGIN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
    7. If UsernameTextBox.Text = "" Then
    8. MsgBox("Name eintippen")
    9. ElseIf PasswordTextBox.Text = "" Then
    10. MsgBox("Password eintippen")
    11. Else
    12. Dim URL = "http://MeineSeite.de"
    13. Dim Request As HttpWebRequest = CType(WebRequest.Create(URL), HttpWebRequest)
    14. Request.Method = "POST"
    15. Request.ContentType = "application/x-www-form-urlencoded"
    16. Dim Post As String = "loginForm_username=" & UsernameTextBox.Text & "&loginForm_password=" & PasswordTextBox.Text & "&loginForm_login_submit=Login"
    17. Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
    18. Request.ContentLength = byteArray.Length
    19. Dim DataStream As Stream = Request.GetRequestStream()
    20. DataStream.Write(byteArray, 0, byteArray.Length)
    21. DataStream.Close()
    22. Dim Response As HttpWebResponse = Request.GetResponse()
    23. DataStream = Response.GetResponseStream()
    24. Dim reader As New StreamReader(DataStream)
    25. Dim ServerResponse As String = reader.ReadToEnd()
    26. reader.Close()
    27. DataStream.Close()
    28. Response.Close()
    29. If InStr(ServerResponse, "Serverauswahl") Then
    30. MessageBox.Show("Login OK")
    31. Form2.Show() 'wenn eingelogt kommst du so auf Form 2
    32. Me.Hide() ' login box wird versteckt
    33. Else
    34. MessageBox.Show("Login nicht OK")
    35. End If
    36. End If
    37. End Sub
    38. End Class


    Das

    Quellcode

    1. Dim Post As String = "loginForm_username=" & UsernameTextBox.Text & "&loginForm_password=" & PasswordTextBox.Text & "&loginForm_login_submit=Login"

    /*Must du anpassen

    Quellcode

    1. Serverauswahl /* auch anpassen kann alles mögliches heisen


    lg :)
    Danke erstmal für die schnelle Antwort

    Wo Übergibt er die daten denn ab den Webbrowser der sich in form 2 verbirgt
    denn sonst öffnen er die form2 ja ohne sich einzuloggen

    Was kann ich mir darunter vorstellen
    Serverauswahl /* auch anpassen kann alles mögliches heisen
    Kann mann dein Scribt auch für https seiten benutzten ?
    Über den POST natürlich ;D

    Quellcode

    1. Dim Post As String = "loginForm_username=" & UsernameTextBox.Text & "&loginForm_password=" & PasswordTextBox.Text & "&loginForm_login_submit=Login"


    und hier ckeckt er ok der server sagt ist ok komm rein...

    Quellcode

    1. If InStr(ServerResponse, "Serverauswahl") Then
    2. MessageBox.Show("Login OK")


    Kann mann dein Scribt auch für https seiten benutzten ?
    Ja kannst du Jede server muss antrorten und sagen ob login ok oder false, du must nur wissen was gennau der server antwortet :)
    hmm ohne weitere quelcode kann ich dir nicht helfen hast du den post auch richtig abgehändert?

    Dim Post As String = "loginForm_username=" & UsernameTextBox.Text & "&loginForm_password=" & PasswordTextBox.Text & "&loginForm_login_submit=Login"
    gehen mus es ich kann mcih mit mein csript auch bei der sparkasse einloggen, und ist auch https...
    Antworten tut der serer mit HTTP/1.1 200 OK
    Ich habe den Text Jetzt So

    VB.NET-Quellcode

    1. Imports System
    2. Imports System.Net
    3. Imports System.IO
    4. Imports System.Text
    5. Public Class Form1
    6. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    7. If TextBox1.Text = "" Then
    8. MsgBox("Name eintippen")
    9. ElseIf TextBox2.Text = "" Then
    10. MsgBox("Password eintippen")
    11. Else
    12. Dim URL = "https://website/index.php/site/login/index.php"
    13. Dim Request As HttpWebRequest = CType(WebRequest.Create(URL), HttpWebRequest)
    14. Request.Method = "POST"
    15. Request.ContentType = "application/x-www-form-urlencoded"
    16. Dim Post As String = "LoginForm[username]=" & TextBox1.Text & "&LoginForm[password]=" & TextBox2.Text & "&yt0=Login"
    17. Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
    18. Request.ContentLength = byteArray.Length
    19. Dim DataStream As Stream = Request.GetRequestStream()
    20. DataStream.Write(byteArray, 0, byteArray.Length)
    21. DataStream.Close()
    22. Dim Response As HttpWebResponse = Request.GetResponse()
    23. DataStream = Response.GetResponseStream()
    24. Dim reader As New StreamReader(DataStream)
    25. Dim ServerResponse As String = reader.ReadToEnd()
    26. reader.Close()
    27. DataStream.Close()
    28. Response.Close()
    29. If InStr(ServerResponse, "HTTP/1.1 200 OK ") Then
    30. MessageBox.Show("Login OK")
    31. Form2.Show()
    32. Me.Hide()
    33. Else
    34. MessageBox.Show("Login nicht OK")
    35. End If
    36. End If
    37. End Sub
    38. End Class


    Wenn ich jetzt auf den Button Klicke
    Sagt er mit folgendes an

    Quellcode

    1. Dim Response As HttpWebResponse = Request.GetResponse()
    2. An dieser Stelle zeigt er mir den Fehler an
    3. Der Remoteserver hat einen Fehler zurückgegeben: (400) Ungültige Anforderung.


    Und hier ist der dazugehörige php code
    Spoiler anzeigen

    PHP-Quellcode

    1. <div class="loginForm">
    2. <form id="login-form" action="/index.php/site/login" method="post">
    3. <div style="display:none"><input value="f9b8eb665c096ca79794ec1ce0b331988849026c" name="YII_CSRF_TOKEN" type="hidden"></div>
    4. <p class="tohide note"><span class="required">*</span> Pflichtfelder.</p>
    5. <div class="tohide row">
    6. <label for="LoginForm_username" class="required">Username <span class="required">*</span></label> <input name="LoginForm[username]" id="LoginForm_username" type="text"> <div class="errorMessage" id="LoginForm_username_em_" style="display:none"></div> </div>
    7. <div class="tohide row error">
    8. <label for="LoginForm_password" class="required">Password <span class="required">*</span></label> <input name="LoginForm[password]" id="LoginForm_password" type="password"> <div class="errorMessage" id="LoginForm_password_em_" style="">Password darf nicht leer sein.</div>
    9. </div>
    10. <div class="tohide row">
    11. <span class="error"></span>
    12. </div>
    13. <div class="tohide row buttons">
    14. <input class="Btn colored" name="yt0" value="Login" type="submit"> </div>
    15. <div class="row">
    16. <label>&nbsp;</label>
    17. <div id="pwvergessen_container" style="display: block; overflow: hidden; ">
    18. <a tabindex="-1" style="" href="#" id="yt1">Passwort vergessen?</a> <input value=".tohide" name="hideselector" id="hideselector" type="hidden"> <input value="" name="workflow" id="workflow" type="hidden">
    19. </div>
    20. </div>
    21. </form></div>
    Ok also der link oben ist aber nicht richtig?
    https://website/index.php/site/login/index.php
    eventuel meinst du

    https://website/index.php?action=site/login/index.php

    Und dasHTTP/1.1 200 OK
    "Gehört nicht da rein sollte nur heißen das der server der ich angesprochen habe geantwortet hatt. deiner weiß ich ja nicht :D"

    Wobei du deine php bearbeiten müstest

    Quellcode

    1. <form id="login-form" action="/index.php/site/login" method="post">

    Normalerweiser IN

    Quellcode

    1. <form id="login-form" action="login" method="post">



    In deiner Index.php dann

    Quellcode

    1. if ($_GET["action"] == "login"){
    2. require_once("login.php"); 'jergend wie zu login php schicken
    3. }else


    Oder dein login steht noch vor den index.php
    und danacht wirst du zu index geschickt, ich blicke bei deinem code nicht dursch sorry :D

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „seby1302“ ()

    der link ist richtig
    ihn fehlte der Cooki
    nun sagt er mitr trort richtiger daten Login nicht OK

    hier der code

    VB.NET-Quellcode

    1. Imports System
    2. Imports System.Net
    3. Imports System.IO
    4. Imports System.Text
    5. Public Class Form1
    6. Private Containa As CookieContainer = New CookieContainer
    7. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    8. Dim getRequest As HttpWebRequest = DirectCast(HttpWebRequest.Create("https://website.info/index.php"), HttpWebRequest)
    9. getRequest.CookieContainer = Containa
    10. Dim Response As HttpWebResponse = DirectCast(getRequest.GetResponse(), HttpWebResponse)
    11. If TextBox1.Text = "" Then
    12. MsgBox("Name eintippen")
    13. ElseIf TextBox2.Text = "" Then
    14. MsgBox("Password eintippen")
    15. Else
    16. Dim URL = "https://website.info/index.php"
    17. Dim Request As HttpWebRequest = CType(WebRequest.Create(URL), HttpWebRequest)
    18. Request.Method = "POST"
    19. Request.ContentType = "application/x-www-form-urlencoded"
    20. Dim Post As String = "LoginForm[username]=" & TextBox1.Text & "&LoginForm[password]=" & TextBox2.Text & "&yt0=Login"
    21. Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
    22. Request.ContentLength = byteArray.Length
    23. Dim DataStream As Stream = Request.GetRequestStream()
    24. DataStream.Write(byteArray, 0, byteArray.Length)
    25. DataStream.Close()
    26. DataStream = Response.GetResponseStream()
    27. Dim reader As New StreamReader(DataStream)
    28. Dim ServerResponse As String = reader.ReadToEnd()
    29. reader.Close()
    30. DataStream.Close()
    31. Response.Close()
    32. If InStr(ServerResponse, "200") Then
    33. MessageBox.Show("Login OK")
    34. Form2.Show() 'wenn eingelogt kommst du so auf Form 2
    35. Me.Hide() ' login box wird versteckt
    36. Else
    37. MessageBox.Show("Login nicht OK")
    38. End If
    39. End If
    40. End Sub
    41. End Class



    Und dasHTTP/1.1 200 OK

    "Gehört nicht da rein sollte nur heißen das der server der ich angesprochen habe geantwortet hatt. deiner weiß ch ja nciht
    Was soll da denn hin

    seby1302 schrieb:

    Das der jetzt immer sagt login nicht ok liegt daran das du nun bei

    http://1.1 200 ok



    Dein login message abfangen must, heist wenn z.b nach dem login, ein message kommt.



    GLückwunsch sie sind nun eingelogt!!!



    Das ersetzt du dursch


    http://1.1 200 ok


    nee es ist so gesichert der link kann auf gekürzt werden dann landet mann direckt auf der seite
    https://website/index.php

    und mann landet direckt auf die seite ohne zwischenseite
    wenn ich das feld leer lasse sagt er selbst bei test test login ok
    wenn ich 200 eintrage als beispiel sagt er mit bei test test login falsch und mit echten daten hängt sich das programm auf

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Yolanda“ ()

    axo ok wens leuft ist ja gut :D

    Wenn du es leer läst ist ja auch normal..

    Das er sich aufhängt ist komisch, kommt kein fehler?


    [/color]
    cookies fals gebraucht kannst du im httprequest einbinden.

    Im zweiten post findest du den code dafür

    Quellcode

    1. http://www.vb-paradise.de/programmieren/internet-und-netzwerkprogrammierung/22970-httpwebrequest-und-cookies/#post150089


    Edit by der_Kurt:
    Die Farbe Rot bitte nicht verwenden. Diese ist der Moderation vorbehalten

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „der_Kurt“ ()

    axo und als login begrüssung kommt ja nicht 200 deshalb hängt der sich auf

    weil logindaten sind ok

    und nun weiß er nicht was er machen soll.

    If InStr(ServerResponse, "200") Then
    MessageBox.Show("Login OK")?

    Ne ist es sich 200 ist nicht ok

    Else
    MessageBox.Show("Login nicht OK")?

    Ne auch nicht daten sind ok

    Der muss also wissen was der server antwortet nach dem login ;)
    Das ist der Live mitschnitt mit set Cookie

    code

    Brainfuck-Quellcode

    1. https://website.info/
    2. GET / HTTP/1.1
    3. Host: website.info
    4. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    5. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    6. Accept-Language: de
    7. Accept-Encoding: gzip, deflate
    8. Connection: keep-alive
    9. HTTP/1.1 302 Found
    10. Date: Sun, 05 May 2013 20:12:06 GMT
    11. Server: Apache
    12. Access-Control-Allow-Origin: *
    13. Access-Control-Allow-Methods: POST, GET
    14. Set-Cookie: PHPSESSID=thp16p0ss11ossr1loaf1or346emgt7j; path=/; secure; HttpOnly
    15. Expires: Thu, 19 Nov 1981 08:52:00 GMT
    16. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    17. Pragma: no-cache
    18. Location: https://website.info/index.php/site/login
    19. Vary: Accept-Encoding
    20. Content-Encoding: gzip
    21. P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
    22. Content-Length: 20
    23. Connection: close
    24. Content-Type: text/html
    25. ----------------------------------------------------------
    26. https://website.info/index.php/site/login
    27. GET /index.php/site/login HTTP/1.1
    28. Host: website.info
    29. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    30. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    31. Accept-Language: de
    32. Accept-Encoding: gzip, deflate
    33. Cookie: PHPSESSID=thp16p0ss11ossr1loaf1or346emgt7j
    34. Connection: keep-alive
    35. HTTP/1.1 200 OK
    36. Date: Sun, 05 May 2013 20:12:06 GMT
    37. Server: Apache
    38. Access-Control-Allow-Origin: *
    39. Access-Control-Allow-Methods: POST, GET
    40. Expires: Thu, 19 Nov 1981 08:52:00 GMT
    41. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    42. Pragma: no-cache
    43. Set-Cookie: YII_CSRF_TOKEN=91de9a068531d2e92c8c564860498bf94f056895; path=/; secure; httponly
    44. Vary: Accept-Encoding
    45. Content-Encoding: gzip
    46. P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
    47. Content-Length: 2488
    48. Connection: close
    49. Content-Type: text/html
    50. ----------------------------------------------------------
    51. https://website.info/index.php/site/login
    52. POST /index.php/site/login HTTP/1.1
    53. Host: website.info
    54. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    55. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    56. Accept-Language: de
    57. Accept-Encoding: gzip, deflate
    58. Referer: https://website.info/index.php/site/login
    59. Cookie: PHPSESSID=thp16p0ss11ossr1loaf1or346emgt7j; YII_CSRF_TOKEN=91de9a068531d2e92c8c564860498bf94f056895
    60. Connection: keep-alive
    61. Content-Type: application/x-www-form-urlencoded
    62. Content-Length: 162
    63. YII_CSRF_TOKEN=91de9a068531d2e92c8c564860498bf94f056895&LoginForm%5Busername%5D=Yolanda&LoginForm%5Bpassword%5D=Tyler2012&yt0=Login&hideselector=.tohide&workflow=
    64. HTTP/1.1 302 Found
    65. Date: Sun, 05 May 2013 20:12:22 GMT
    66. Server: Apache
    67. Access-Control-Allow-Origin: *
    68. Access-Control-Allow-Methods: POST, GET
    69. Expires: Thu, 19 Nov 1981 08:52:00 GMT
    70. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    71. Pragma: no-cache
    72. Set-Cookie: __sps_eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw=kp54dqd837gfrji86acgua6lc24mv4dq; path=/; secure; HttpOnly
    73. Set-Cookie: __sps_eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw=aa1885t35emr5far6kr2ugj4mp08gr45; path=/; secure; HttpOnly
    74. Location: https://website.info/site/index?__sps=eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw
    75. Vary: Accept-Encoding
    76. Content-Encoding: gzip
    77. P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
    78. Content-Length: 20
    79. Connection: close
    80. Content-Type: text/html
    81. ----------------------------------------------------------
    82. https://website.info/site/index?__sps=eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw
    83. GET /site/index?__sps=eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw HTTP/1.1
    84. Host: website.info
    85. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    86. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    87. Accept-Language: de
    88. Accept-Encoding: gzip, deflate
    89. Referer: https://website.info/index.php/site/login
    90. Cookie: PHPSESSID=thp16p0ss11ossr1loaf1or346emgt7j; YII_CSRF_TOKEN=91de9a068531d2e92c8c564860498bf94f056895; __sps_eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw=aa1885t35emr5far6kr2ugj4mp08gr45
    91. Connection: keep-alive
    92. HTTP/1.1 302 Found
    93. Date: Sun, 05 May 2013 20:12:24 GMT
    94. Server: Apache
    95. Access-Control-Allow-Origin: *
    96. Access-Control-Allow-Methods: POST, GET
    97. Expires: Thu, 19 Nov 1981 08:52:00 GMT
    98. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    99. Pragma: no-cache
    100. Location: https://website.info/index.php/2website/index?__sps=eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw
    101. Vary: Accept-Encoding
    102. Content-Encoding: gzip
    103. P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
    104. Content-Length: 20
    105. Connection: close
    106. Content-Type: text/html
    107. ----------------------------------------------------------
    108. https://website.info/index.php/2website/index?__sps=eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw
    109. GET /index.php/2website/index?__sps=eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw HTTP/1.1
    110. Host: website.info
    111. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    112. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    113. Accept-Language: de
    114. Accept-Encoding: gzip, deflate
    115. Referer: https://website.info/index.php/site/login
    116. Cookie: PHPSESSID=thp16p0ss11ossr1loaf1or346emgt7j; YII_CSRF_TOKEN=91de9a068531d2e92c8c564860498bf94f056895; __sps_eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw=aa1885t35emr5far6kr2ugj4mp08gr45
    117. Connection: keep-alive
    118. HTTP/1.1 200 OK
    119. Date: Sun, 05 May 2013 20:12:24 GMT
    120. Server: Apache
    121. Access-Control-Allow-Origin: *
    122. Access-Control-Allow-Methods: POST, GET
    123. Expires: Thu, 19 Nov 1981 08:52:00 GMT
    124. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    125. Pragma: no-cache
    126. Vary: Accept-Encoding
    127. Content-Encoding: gzip
    128. P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
    129. Content-Length: 23741
    130. Connection: close
    131. Content-Type: text/html
    132. ----------------------------------------------------------
    133. https://2website.vpportal.de/login/?view=show/StrukturBaum&cred=~cW0pKjavkV5/brpQNlEHhOET1DQrMVHbtVLfNDVX
    134. GET /login/?view=show/StrukturBaum&cred=~cW0pKjavkV5/brpQNlEHhOET1DQrMVHbtVLfNDVX HTTP/1.1
    135. Host: 2website.vpportal.de
    136. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    137. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    138. Accept-Language: de
    139. Accept-Encoding: gzip, deflate
    140. Referer: https://website.info/index.php/2website/index?__sps=eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw
    141. Connection: keep-alive
    142. HTTP/1.1 302 FOUND
    143. Server: nginx/0.7.62
    144. Date: Sun, 05 May 2013 20:12:26 GMT
    145. Content-Type: text/html; charset=utf-8
    146. Transfer-Encoding: chunked
    147. Connection: keep-alive
    148. Vary: Accept-Language, Cookie
    149. Location: https://2website.vpportal.de/show/StrukturBaum
    150. Content-Language: de-de
    151. Cache-Control: no-cache
    152. Set-Cookie: sessionid=b88ce0aee4dea9df33a1d11d6aae26a1; Path=/; secure
    153. P3P: CP="CAO PSA OUR"
    154. ----------------------------------------------------------
    155. https://2website.vpportal.de/show/StrukturBaum
    156. GET /show/StrukturBaum HTTP/1.1
    157. Host: 2website.vpportal.de
    158. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    159. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    160. Accept-Language: de
    161. Accept-Encoding: gzip, deflate
    162. Referer: https://website.info/index.php/2website/index?__sps=eNpTVFVRVVFRVdTXU9LX1tQBABGfAkw
    163. Cookie: sessionid=b88ce0aee4dea9df33a1d11d6aae26a1
    164. Connection: keep-alive
    165. HTTP/1.1 200 OK
    166. Server: nginx/0.7.62
    167. Date: Sun, 05 May 2013 20:12:27 GMT
    168. Content-Type: text/html; charset=utf-8
    169. Transfer-Encoding: chunked
    170. Connection: keep-alive
    171. Vary: Accept-Language, Cookie
    172. Content-Language: de-de
    173. Cache-Control: no-cache
    174. Set-Cookie: sessionid=b88ce0aee4dea9df33a1d11d6aae26a1; Path=/; secure
    175. P3P: CP="CAO PSA OUR"
    176. Content-Encoding: gzip
    177. ----------------------------------------------------------
    178. https://2website.vpportal.de/customer/2website/public/style.css?343a1dad38f64835c32e25d8fc043596dac42138
    179. GET /customer/2website/public/style.css?343a1dad38f64835c32e25d8fc043596dac42138 HTTP/1.1
    180. Host: 2website.vpportal.de
    181. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    182. Accept: text/css,*/*;q=0.1
    183. Accept-Language: de
    184. Accept-Encoding: gzip, deflate
    185. Referer: https://2website.vpportal.de/show/StrukturBaum
    186. Cookie: sessionid=b88ce0aee4dea9df33a1d11d6aae26a1
    187. Connection: keep-alive
    188. If-Modified-Since: Mon, 15 Apr 2013 08:09:34 GMT
    189. HTTP/1.1 304 Not Modified
    190. Server: nginx/0.7.62
    191. Date: Sun, 05 May 2013 20:12:27 GMT
    192. Last-Modified: Mon, 15 Apr 2013 08:09:34 GMT
    193. Connection: keep-alive
    194. P3P: CP="CAO PSA OUR"
    195. ----------------------------------------------------------
    196. https://2website.vpportal.de/jsi18n/commons/?343a1dad38f64835c32e25d8fc043596dac42138
    197. GET /jsi18n/commons/?343a1dad38f64835c32e25d8fc043596dac42138 HTTP/1.1
    198. Host: 2website.vpportal.de
    199. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    200. Accept: */*
    201. Accept-Language: de
    202. Accept-Encoding: gzip, deflate
    203. Referer: https://2website.vpportal.de/show/StrukturBaum
    204. Cookie: sessionid=b88ce0aee4dea9df33a1d11d6aae26a1
    205. Connection: keep-alive
    206. HTTP/1.1 200 OK
    207. Server: nginx/0.7.62
    208. Date: Sun, 05 May 2013 20:12:27 GMT
    209. Content-Type: text/javascript
    210. Connection: keep-alive
    211. Content-Length: 659
    212. Content-Language: de-de
    213. Content-Encoding: gzip
    214. Expires: Sun, 12 May 2013 20:12:27 GMT
    215. Vary: Accept-Encoding, Accept-Language, Cookie
    216. Last-Modified: Sun, 05 May 2013 20:12:27 GMT
    217. Cache-Control: max-age=604800
    218. P3P: CP="CAO PSA OUR"
    219. ----------------------------------------------------------
    220. https://log.xpecto.de/piwik.php?idsite=5&rec=1&url=https://vpportal.de/2website.vpportal.de/show/StrukturBaum&urlref=https%3A//website.info/index.php/2website/index%3F__sps%3DeNpTVFVRVVFRVdTXU9LX1tQBABGfAkw&action_name=&rand=1367784747s
    221. GET /piwik.php?idsite=5&rec=1&url=https://vpportal.de/2website.vpportal.de/show/StrukturBaum&urlref=https%3A//website.info/index.php/2website/index%3F__sps%3DeNpTVFVRVVFRVdTXU9LX1tQBABGfAkw&action_name=&rand=1367784747s HTTP/1.1
    222. Host: log.xpecto.de
    223. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    224. Accept: image/png,image/*;q=0.8,*/*;q=0.5
    225. Accept-Language: de
    226. Accept-Encoding: gzip, deflate
    227. Referer: https://2website.vpportal.de/show/StrukturBaum
    228. Connection: keep-alive
    229. HTTP/1.1 200 OK
    230. Date: Sun, 05 May 2013 20:12:27 GMT
    231. Server: Apache/2.2.14 (Ubuntu)
    232. X-Powered-By: PHP/5.3.2-1ubuntu4.18
    233. Keep-Alive: timeout=15, max=100
    234. Connection: Keep-Alive
    235. Transfer-Encoding: chunked
    236. Content-Type: image/gif
    237. ----------------------------------------------------------


    Edit by der_Kurt:
    Für längere Code-Passagen bitte den Expander-Tag verwenden. Danke

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „der_Kurt“ ()

    Nee der Tocken ist voher schon da in der login form der wird aber ausgeblendet
    Ich weiß echt nicht mehr weiter

    Ich habe den Wichtigsten bereich jetzt mal rausgefiltert für die anmeldung
    er benutzt den TOKEN schon mit den Login

    Quellcode

    1. https://website.info/index.php/site/login_m?parameter=10251
    2. POST /index.php/site/login_m?parameter=10251 HTTP/1.1
    3. Host: website.info
    4. User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20100101 Firefox/20.0
    5. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    6. Accept-Language: de
    7. Accept-Encoding: gzip, deflate
    8. Referer: https://website.info/index.php/site/login_m?parameter=10251
    9. Cookie: PHPSESSID=lt77d9hq0ku3gf4he7jmvtmkvgva67mk; YII_CSRF_TOKEN=060c52f3b263c34418698459553565900a49ca17
    10. Connection: keep-alive
    11. Content-Type: application/x-www-form-urlencoded
    12. Content-Length: 160
    13. YII_CSRF_TOKEN=060c52f3b263c34418698459553565900a49ca17&parameter=10251&LoginForm%5Busername%5D=BENUTZERNAME&LoginForm%5Bpassword%5D=PASSWORT&yt0=Login&pass_forgot=
    14. HTTP/1.1 200 OK
    15. Date: Mon, 06 May 2013 12:18:13 GMT
    16. Server: Apache
    17. Access-Control-Allow-Origin: *
    18. Access-Control-Allow-Methods: POST, GET
    19. Expires: Thu, 19 Nov 1981 08:52:00 GMT
    20. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    21. Pragma: no-cache
    22. Set-Cookie: __sps_eNpTVFVRVVFRVdRX1NPUUtECABFmAj0=i28bkl1btqjed99gd8i99rjdnh40j2l3; path=/; secure; HttpOnly
    23. Set-Cookie: __sps_eNpTVFVRVVFRVdRX1NPUUtECABFmAj0=9gttjmkfmiq3d3bi6eb9gci9vsajhg92; path=/; secure; HttpOnly
    24. Vary: Accept-Encoding
    25. Content-Encoding: gzip
    26. P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
    27. Content-Length: 21835
    28. Connection: close
    29. Content-Type: text/html


    Hoffe jemand kann helfen

    Mit freundlichen Grüßen Yolanda
    ich würd mir die cookies integrieren
    dann kannst du diese debugen , und sehen was er an cookies nach dem login gespeichert hat.

    aber müstest dann 2x testen 1x richtiges login und 1x falsches, zum vergleich ob der beim falschen was anderes abspeichert.
    Dann könntest du den richtigen login cookie als LOGIN OK nehmen.


    VB.NET-Quellcode

    1. 'Diesen habe ich zwischen Dim ServerResponse As String = reader.ReadToEnd() und reader.Close() stehen
    2. Dim Request2 As HttpWebRequest = HttpWebRequest.Create(URL)
    3. Request2.CookieContainer = New CookieContainer()
    4. Dim Response2 As HttpWebResponse = Request2.GetResponse
    5. Response2.Cookies = Request2.CookieContainer.GetCookies(Request2.RequestUri)
    6. Dim Reader2 As IO.StreamReader = New IO.StreamReader(Response2.GetResponseStream)
    7. For Each SetCookie As Cookie In Response2.Cookies
    8. Debug.Print(SetCookie.Name)
    9. Next




    VB.NET-Quellcode

    1. ' Diese Über den 200ok status setzen (auserhabt des if )
    2. Debug.Print(SetCookie.Name) Zeigt dir die gespeicherten namen an Z.b IP
    3. Debug.Print(SetCookie.Value) Zeigt dir die gespeicherten wetern z.b 194.65.789.012
    4. mit
    5. Dim aCookie As Cookie = Response2.Cookies("IP")
    6. Dim IP = (aCookie.Name)


    Kannst du Der name ip was im cookie gespeichert ist aufrufen und dann z.b IP anstadt dieses 200 ok nehmen, ip müste aber wie gesagt nur beim richtigen login vorkommen.
    Naja ich dachte der token würdest du bekommen, wenn du dich eingelogt hast,als bestetigung das eingelogt bist.
    Für jergend was muss es ja gut sein.


    Probiers doch einfach aus, tu das mal debuggen..


    ersetze den abschnit ganz oben..
    Spoiler anzeigen

    Quellcode

    1. Dim ServerResponse As String = reader.ReadToEnd()
    2. reader.Close()
    3. DataStream.Close()
    4. Response.Close()


    dursch


    Quellcode

    1. Dim ServerResponse As String = reader.ReadToEnd()
    2. Debug.Print(ServerResponse)
    3. reader.Close()
    4. DataStream.Close()
    5. Response.Close()


    schau dann in dem VB directfenster das ist da wo die (fehlern angezeigt werden)
    Ob es da was brauchbares aufgezeichnet wird, z.b den token bei eingabe des richtigen login..
    mehr wie erklären kann ich für dich leider nicht tun. :|

    Dieser Beitrag wurde bereits 6 mal editiert, zuletzt von „seby1302“ ()