Results 1 to 9 of 9

Thread: HttpWebRequest help

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2011
    Posts
    44

    Question HttpWebRequest help

    here is my code to log into my bank sorry no passwords no usernames given im not a dumb lol




    Code:
     Sub post()
            Dim EVENTVALIDATION = "/wEWAgKtxsLgBgLq+LO5Ad+NdnQm+T4IWqelkoLu3kPVgHtm"
            Dim urlLocator = "https://www.regions.com/Locations.rf"
            Dim locationZipCode = "ZIP+Code"
            Dim locationCity = "City"
            Dim locationState = "State"
            Dim googleSearch = ""
            Dim OnlineID = "removed"
            Dim Password = "removed"
    
            Dim mainCookie As New System.Net.CookieContainer
            Dim post = "ignore=" & "&__EVENTVALIDATION=" & EVENTVALIDATION & "&ctl00%24hfurlLocator=" & urlLocator & "&locationZipCode=" & locationZipCode & "&locationCity=" & locationCity & "&locationState=" & locationState & "&googleSearch=" & googleSearch & "&OnlineID=" & OnlineID & "&Password=" & Password
    
            'login
            Dim postData As String = post
            Dim bytes() As Byte = System.Text.ASCIIEncoding.UTF8.GetBytes(postData)
            Dim postReq As System.Net.HttpWebRequest = System.Net.WebRequest.Create("https://securebank.regions.com/login.aspx?brand=regions")
            postReq.Method = "POST"
            postReq.Host = "securebank.regions.com"
            postReq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0"
            postReq.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
            postReq.ContentType = "application/x-www-form-urlencoded"
            postReq.KeepAlive = True
            postReq.Referer = "https://www.regions.com/personal_banking.rf"
            postReq.CookieContainer = mainCookie
            postReq.ContentType = "application/x-www-form-urlencoded"
            postReq.ContentLength = bytes.Length
    
            Dim postStream As System.IO.Stream = postReq.GetRequestStream()
            postStream.Write(bytes, 0, bytes.Length)
            postStream.Close()
    
            Dim postResponse As System.Net.HttpWebResponse
            postResponse = postReq.GetResponse()
            mainCookie.Add(postResponse.Cookies)
            Dim reader As New System.IO.StreamReader(postResponse.GetResponseStream())
            Dim strSource As String = reader.ReadToEnd
            RichTextBox1.Text = strSource
    
        End Sub
    when i run it it takes about a minute to show the main form and displays nothing on the richtext document does anyone have a idea what may be wrong? i got the post data from live http headers firefox addon im trying to get the source of the webpage after it logs in
    to add to that when i take away the post data it shows the https://securebank.regions.com/login.aspx (not loged in )


    it seems to be getting stuck at postResponse = postReq.GetResponse()
    i finally got this error The underlying connection was closed: An unexpected error occurred on a receive.


    here is the values with omitted information as "removed" im really lost on getting this to work

    post https://securebank.regions.com/login.aspx?brand=regions

    http header

    Host: securebank.regions.com
    User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip, deflate
    DNT: 1
    Connection: keep-alive
    Referer: https://www.regions.com/
    Cookie: WT_FPC=id=removed:lv=removed:ss=removed
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 266

    post data

    ignore=&__EVENTVALIDATION=%2FwEWAgKtxsLgBgLq%2BLO5Ad%2BNdnQm%2BT4IWqelkoLu3kPVgHtm&ctl00%24hfurlLoca tor=https%3A%2F%2Fwww.regions.com%2FLocations.rf&locationZipCode=ZIP+Code&locationCity=City&location State=State&googleSearch=&OnlineID=removed&Password=removed
    Last edited by michael040990; Aug 11th, 2013 at 10:59 PM.

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: HttpWebRequest help

    Iv worked with the http class for years. I don't think I could even get close to logging into a bank.

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: HttpWebRequest help

    does anyone have a idea what may be wrong?
    As ident hints, what's wrong is that the bank will have done everything in its power to stop people logging in in this way. There is a certain irony in ...

    no passwords no usernames given im not a dumb
    ... co-existing with a request to undermine the bank's security measures!!!!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  4. #4
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: HttpWebRequest help

    I dont think even zero cool could do this.

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2011
    Posts
    44

    Re: HttpWebRequest help

    well it was worth a try i wanted to be able to bring up my account page and extract my account balance and display it in a lcd picture frame

  6. #6
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: HttpWebRequest help

    extract my account balance and display it in a lcd picture frame
    On the whole I prefer not to look at mine at all!!!! Doesn't your bank have 'an app for that'? Most seem to these days.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 2011
    Posts
    44

    Re: HttpWebRequest help

    all they have is a mobile app for iphone and android im ultimately going to convert this to python and run it on a raspberry pi with a matrix lcd displaying the most updated ballence so i know when money gets withdrawn from paypal because they like to wait a few days i guess webbrowser manipulation is going to have to be my next rought although memory hungry and slow it works darn auto login forms

    still not giving up though

  8. #8
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: HttpWebRequest help

    There are various ways available of running an Android app in Windows. I think I might investigate those first!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  9. #9

    Thread Starter
    Member
    Join Date
    Oct 2011
    Posts
    44

    Re: HttpWebRequest help

    the hole point was to lean how to do it in my native language and translate it to python and put it on my raspberry pi to make a picture frame i android version has small text and useless features i was going to do that but the outcome wasing what i was going for i just want a number to be shown that takes up the whole frame so you can see around the room easy lol
    i learned a lot though maybe i have the header formated wrong?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width