none
hellp How to get token cookis vb.net RRS feed

  • Question


  • cookie: _xsrf=2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836; bsid=2c7e3f2538d04f1697f134d63dc57e85; _timezone=3; sweeper_uuid=a00fa6886ec1495bbba1d127649fb6c5; G_ENABLED_IDPS=google; cto_lwid=dd098b43-aa5c-4c07-83af-16490084089b; __stripe_mid=07ec9d17-13c9-4c96-993e-e7884e11efac; __stripe_sid=248e83d6-5b50-434c-a7ca-068f86955060
    
    
    How to get this code
    
    
    
    x-xsrftoken: 2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836
    


    Imports xNet
    Imports System.Text.RegularExpressions
    Public Class form1
       Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
           Using httpRequest As HttpRequest = New HttpRequest()
               Dim cookies As CookieDictionary = New CookieDictionary(False)
               httpRequest.Cookies = cookies
               httpRequest.IgnoreProtocolErrors = True
               httpRequest.AllowAutoRedirect = True
               httpRequest.KeepAlive = True
               httpRequest.UserAgent = Http.ChromeUserAgent()
               httpRequest.AddHeader("x-requested-with:", "XMLHttpRequest")
               Dim xc As String = httpRequest.Get("url").ToString
               Dim cc As String = New Regex("").Match(xc).Groups(1).Value
               MsgBox(cc.ToString)
           End Using
       End Sub
    End Class

    Thursday, November 8, 2018 3:32 PM

Answers

  •  Perhaps the old fashion String methods will work for you.  The below seems to find the 'cookie' part you want from the string that you supplied to us as an example.  It will find the first occurrence of "_xsrf=" and then the very next ";" character.  From those two indexes you can get the substring.

        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim s As String = "cookie: _xsrf=2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836; bsid=2c7e3f2538d04f1697f134d63dc57e85; _timezone=3; sweeper_uuid=a00fa6886ec1495bbba1d127649fb6c5; G_ENABLED_IDPS=google; cto_lwid=dd098b43-aa5c-4c07-83af-16490084089b; __stripe_mid=07ec9d17-13c9-4c96-993e-e7884e11efac; __stripe_sid=248e83d6-5b50-434c-a7ca-068f86955060"
            Dim StartIndex As Integer = s.IndexOf("_xsrf=") + 6 '_xsrf= is six/6 characters long
            Dim EndIndex As Integer = s.IndexOf(";", StartIndex + 1)
            If StartIndex > -1 AndAlso EndIndex > StartIndex Then
                Dim cookie As String = s.Substring(StartIndex, EndIndex - StartIndex)
                MessageBox.Show(cookie)
            End If
        End Sub
     

     Here is what it shows...


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Friday, November 23, 2018 10:52 PM
    • Marked as answer by XTOOLX Sunday, November 25, 2018 8:06 PM
    Friday, November 23, 2018 10:52 PM

All replies

  • If the format is fixed, then check an example:

    Dim xc = "2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836; bsid=2c7e3f2538d04f1697f134d63dc57e85; _timezone=3; sweeper_uuid=a00fa6886ec1495bbba1d127649fb6c5; G_ENABLED_IDPS=google; cto_lwid=dd098b43-aa5c-4c07-83af-16490084089b; __stripe_mid=07ec9d17-13c9-4c96-993e-e7884e11efac; __stripe_sid=248e83d6-5b50-434c-a7ca-068f86955060"
    Dim cc = Regex.Match(xc, "^(.+?)(?=;)").Value
    MsgBox(cc)


    • Edited by Viorel_MVP Thursday, November 8, 2018 4:48 PM
    Thursday, November 8, 2018 4:47 PM
  • If the format is fixed, then check an example:

    Dim xc = "2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836; bsid=2c7e3f2538d04f1697f134d63dc57e85; _timezone=3; sweeper_uuid=a00fa6886ec1495bbba1d127649fb6c5; G_ENABLED_IDPS=google; cto_lwid=dd098b43-aa5c-4c07-83af-16490084089b; __stripe_mid=07ec9d17-13c9-4c96-993e-e7884e11efac; __stripe_sid=248e83d6-5b50-434c-a7ca-068f86955060"
    Dim cc = Regex.Match(xc, "^(.+?)(?=;)").Value
    MsgBox(cc)


    The code is variable variable when logging on
    Friday, November 9, 2018 3:52 PM
  • If the format is fixed, then check an example:

    Dim xc = "2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836; bsid=2c7e3f2538d04f1697f134d63dc57e85; _timezone=3; sweeper_uuid=a00fa6886ec1495bbba1d127649fb6c5; G_ENABLED_IDPS=google; cto_lwid=dd098b43-aa5c-4c07-83af-16490084089b; __stripe_mid=07ec9d17-13c9-4c96-993e-e7884e11efac; __stripe_sid=248e83d6-5b50-434c-a7ca-068f86955060"
    Dim cc = Regex.Match(xc, "^(.+?)(?=;)").Value
    MsgBox(cc)


    You can not afford to hard   XD JAJAJA
    Sunday, November 18, 2018 7:54 PM

  • cookie: _xsrf=2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836; bsid=2c7e3f2538d04f1697f134d63dc57e85; _timezone=3; sweeper_uuid=a00fa6886ec1495bbba1d127649fb6c5; G_ENABLED_IDPS=google; cto_lwid=dd098b43-aa5c-4c07-83af-16490084089b; __stripe_mid=07ec9d17-13c9-4c96-993e-e7884e11efac; __stripe_sid=248e83d6-5b50-434c-a7ca-068f86955060
    
    
    How to get this code
    
    
    
    x-xsrftoken: 2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836


    Imports xNet
    Imports System.Text.RegularExpressions
    Public Class form1
       Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
           Using httpRequest As HttpRequest = New HttpRequest()
               Dim cookies As CookieDictionary = New CookieDictionary(False)
               httpRequest.Cookies = cookies
               httpRequest.IgnoreProtocolErrors = True
               httpRequest.AllowAutoRedirect = True
               httpRequest.KeepAlive = True
               httpRequest.UserAgent = Http.ChromeUserAgent()
               httpRequest.AddHeader("x-requested-with:", "XMLHttpRequest")
               Dim xc As String = httpRequest.Get("www. wish .com").ToString
               Dim cc As String = New Regex("").Match(xc).Groups(1).Value
               MsgBox(cc.ToString)
           End Using
       End Sub
    End Class

    No one puts a solution on the site

    www  .   wish  .  com

    • Edited by XTOOLX Sunday, November 18, 2018 7:58 PM
    Sunday, November 18, 2018 7:57 PM
  • up get token cookis site wish
    Thursday, November 22, 2018 9:54 PM
  •  Perhaps the old fashion String methods will work for you.  The below seems to find the 'cookie' part you want from the string that you supplied to us as an example.  It will find the first occurrence of "_xsrf=" and then the very next ";" character.  From those two indexes you can get the substring.

        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim s As String = "cookie: _xsrf=2|0a95822a|ca1398508b143f515b6ba3fd9b284d60|1541690836; bsid=2c7e3f2538d04f1697f134d63dc57e85; _timezone=3; sweeper_uuid=a00fa6886ec1495bbba1d127649fb6c5; G_ENABLED_IDPS=google; cto_lwid=dd098b43-aa5c-4c07-83af-16490084089b; __stripe_mid=07ec9d17-13c9-4c96-993e-e7884e11efac; __stripe_sid=248e83d6-5b50-434c-a7ca-068f86955060"
            Dim StartIndex As Integer = s.IndexOf("_xsrf=") + 6 '_xsrf= is six/6 characters long
            Dim EndIndex As Integer = s.IndexOf(";", StartIndex + 1)
            If StartIndex > -1 AndAlso EndIndex > StartIndex Then
                Dim cookie As String = s.Substring(StartIndex, EndIndex - StartIndex)
                MessageBox.Show(cookie)
            End If
        End Sub
     

     Here is what it shows...


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Friday, November 23, 2018 10:52 PM
    • Marked as answer by XTOOLX Sunday, November 25, 2018 8:06 PM
    Friday, November 23, 2018 10:52 PM