Results 1 to 9 of 9

Thread: HTTP request SSL connection

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2008
    Posts
    353

    Question HTTP request SSL connection

    Hello,

    I am trying to get a insurance policy info through a license plate check available online by inputing date and license plate info. The url in question is and the details can be added at the bottom of the page :
    Code:
    https://huo.hr/hr/provjera-osiguranja
    Here is my code:

    Code:
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
    
            Dim reader As StreamReader
    
            Dim Request As HttpWebRequest = HttpWebRequest.Create("https://huo.hr/lib/classes/SAjax.php")
    
            Request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14"
            Request.AllowAutoRedirect = False
            Request.ContentType = "application/x-www-form-urlencoded"
            Dim postData As String = "fja=provjeraOsiguranja&data%5B%5D=03AGdBq263C18tswSs2yGcsXZ4g5LQZ8czQIJCGk7TEQnomTP3atSXk7SvGEOWYiLMdFhz62W45ATH8qDkapq1MDpYc127VRDbSGfKgDno-3mbCnoR2VuShx1PAYcZY3XHHGsvJ_heWi7nLwCVYNG3vDMT-cxfTF70JhJf7wAMx0thxcdOcw_dCC9Gi8ByeynBdEVm3AJbQpIyXpM7bX_x4QotB9AkH9wm_HUa6HeTFWfHzJQdjj2B7fkCQ9RC6pFXW7mdKnILpT1p7kZWMPIWCkUxpjJOc4i45h3EwYjhMdu4vcal1XBDObPzHgJSFvLf1GfBHIdjGVTE9Ky9ozjevnBreRPnoQc4NW_cxnLdwwbFkNiNJ88pgEs1b0-Tq04zx9MPJzgizpuNupXRxpy7tIfCHwpvjrRCfHNlsUNr6-oom0FhAJIFLZY&data%5B%5D=BM&data%5B%5D=111A&data%5B%5D=16.02.2022&data%5B%5D=hr"
    
    
            Request.Method = "POST"
            Request.ContentLength = PostData.Length
    
            Dim requestStream As Stream = Request.GetRequestStream()
            Dim postBytes As Byte() = Encoding.ASCII.GetBytes(PostData)
    
            requestStream.Write(postBytes, 0, postBytes.Length)
            requestStream.Close()
    
            Dim Response As HttpWebResponse = Request.GetResponse()
            reader = New StreamReader(Response.GetResponseStream())
            Response.Close()

    This is what i get back from FIDDLER while debugging http even thogh in HTML i get document moved 302.
    Code:
    FD
    [{"type":"script","content":"$('body').addClass(\"loading\");","id":false},{"type":"script","content":"$('#insurance-result').html('');","id":false},{"type":"script","content":"alert(\"Security Error\");$('body').removeClass('loading');","id":false}]
    0

    Any ideas guys? Any info is greatly appreciated
    Thanks for helping me out.

  2. #2
    Addicted Member
    Join Date
    Feb 2017
    Posts
    151

    Re: HTTP request SSL connection

    im not sure i fully understand your issue, are you getting a different response in fiddler when you send the request from a web browser such as chrome?
    Last edited by Beanoid; Mar 17th, 2022 at 05:39 PM.

  3. #3
    Addicted Member
    Join Date
    Feb 2017
    Posts
    151

    Re: HTTP request SSL connection

    when i send your postdata with headers created with chrome i still get
    Code:
    [{"type":"script","content":"$('body').addClass(\"loading\");","id":false},{"type":"script","content":"$('#insurance-result').html('');","id":false},{"type":"script","content":"alert(\"Security Error\");$('body').removeClass('loading');","id":false}]
    as a response, which leads me to think the postdata is incorrect

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2008
    Posts
    353

    Re: HTTP request SSL connection

    Hi,

    Thank sou very much for your interest.

    Well i did copy the postdata from fiddler while testing on the webpage.
    Thanks for helping me out.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2008
    Posts
    353

    Re: HTTP request SSL connection

    But while comparing response of ssl request i saw a difference while using the webpage and my code...maybe that could be the problem?
    Thanks for helping me out.

  6. #6
    Addicted Member
    Join Date
    Feb 2017
    Posts
    151

    Re: HTTP request SSL connection

    the problem is with the postdata, the hash generated is a response from google captcha, you cant send more then 1 request with the same hash, Name:  1s.jpg
Views: 211
Size:  23.8 KBName:  2s.jpg
Views: 237
Size:  33.8 KB
    Last edited by Beanoid; Mar 18th, 2022 at 03:34 PM.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2008
    Posts
    353

    Re: HTTP request SSL connection

    Thanks!

    I tried to click your attachment but it says it's invalid.

    On the web page i didn't see any captcha to fill?

    Is there a way to "bypass" that?
    Thanks for helping me out.

  8. #8
    Addicted Member
    Join Date
    Feb 2017
    Posts
    151

    Re: HTTP request SSL connection

    you cant bypass it you would have to emulate the steps taken by the browser to generate the correct hash by sending multiple request in the correct order, but the problem is , is that the website has put this security in place for a reason, the reason being they don't want botted applications accessing it, so i don't really want to explain in depth what you need to do

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2008
    Posts
    353

    Re: HTTP request SSL connection

    I see.

    Well, thanks for helping out and pointing me in the right direction buddy, I really appreciate it 💪👍🙂
    Thanks for helping me out.

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