in reply to How?
in thread Problems with sending data over Socket SSL

First you get a clue. Then you read the HTML. You will either see the function pointed to by the onClick handler on the submit button or a tag(s) like <script language="javascript" src="/js/review.js"></script>

If you can't find something that says function WhateverItWasCalled you will need to get the included external javascript files and trawl through them. That is the review.js file in the example above.

cheers

tachyon

Replies are listed 'Best First'.
Re: Re: How?
by Anonymous Monk on Feb 29, 2004 at 21:53 UTC
    Are there a way to find out what query string the registrar is using? You know, what type of textfield names, values, submit button names, values are required to submit the data for registration. It's a pain in the ass to go through each registrar's registration page, and do a view source.

      Look you need to get with the program. Data can be sent by GET or POST or both. You may or may not need to send a session cookie or other session data. If it is HTTPS it is encrypted the moment it leaves your browser so you can't capture packets, if not you can. Some browsers let you look at what the browser is doing in more detail than say IE. Get a copy of Mizilla Firebird and have a look at Tools|Page Info which will show you all the forms and form fields and Tools|Options|Privacy|Cookies|View Cookies to see cookies including memory resident ones.

      It's a pain in the ass to go through each registrar's registration page, and do a view source.

      You are breaking my heart. That is likely what you will have to do most/all of the time. Every time they change their API you code will typically break as well BTW. Some registrars offer back end APIs.

      cheers

      tachyon

Re: Re: How?
by onLOoker (Initiate) on Feb 29, 2004 at 22:47 UTC

    Haha, those sneaky sobs! I figured it out. I knew they had to use some sort of value to submit that particular page. Therefore, I looked for the value within that javascript button. Then searched for the same value within that registration page. Guess what I have found? The field name for that value. All I had to do next was pop in the name pertaining to that value. Bam, registration success.

    But what I still need to do is get the io::socket::ssl to register the domain name. This works for LWP using useragent, but I'm still not good enough in PERL to implement LWP into my script that uses socket.

    For some reason, when I run the script using IO::Socket::SSL, the values of the query string is posted. I notice it because I printed out the query. I didn't really change the script a whole lot.

    Before it was IO::Socket::INET, now I changed it to IO::Socket:SSL.

    It submits it using INET, but won't work with SSL. The website uses HTTPS, therefore, INET won't work. It needs SSL. But when I run the script, it just freezes when it prints out the query string. It shouldn't be any error with the SSL connection, if so, it would print out an error message to the text file.

    Therefore, the problem must be within posting the data to the server for validation. How do you post data through IO::Socket:SSL? Is it the same as IO::Socket::INET?

    This is how I post it with IO::Socket::INET.

    $state{'username'} = $username; $state{'username'} = $password;

    username is the textfield name, $username is the variable that stores value. That in which is called from a external file that stores all the registration/personal info.

    So is this how you would do it for posting data using IO::Socket::SSL or different? If so, what is the correct way? Thanks again for the help... Damn this is fun!

      I gave you the exact code you need to use to POST using LWP::UserAgent. I also told you how to debug SSLsockets and suggested you don't know enough to be using them directly. You don't. Use LWP of read the fine RFCs, run debug level 4 and fix whatever the problem(s) are.

      cheers

      tachyon

        I know you gave me the exact codes. That wasn't the problem. I already written a script in LWP to register the domain with that registrar. But I was having that problem with the javascript button, which I have resolved and it could register domain names now.

        But I'm trying to say that I don't know how to implement the script that uses LWP to register domain names with the script that register domains with sockets. That script checks if the domain is register or not then it register. Therefore, the function of the registration script from the socket is different from LWP.

        That is why I prefer doing it with sockets as everything has been written to support sockets. I have done what you said by using debug 4. But it's given me all these junk which I don't understand what it is or how to use it to debug the script. Below is what printed after running script with debug 4.

        got `HTTP/1.1 200 OK
        (17:0 bytes, VM=vm_unknown)
        got `Date: Mon, 01 Mar 2004 01:41:50 GMT
        (37:0 bytes, VM=vm_unknown)
        got `Server: Apache/2.0.47 (Unix) mod_ssl/2.0.47
        OpenSSL/0.9.7b mod_jk/1.2.2
        (73:0 bytes, VM=vm_unknown)
        got `Set-Cookie:
        JSESSIONID=07F7FEAF3E49D02951BACF23E700D181; Path=/website;
        Secure
        (80:0 bytes, VM=vm_unknown)
        got `Content-Length: 4493
        (22:0 bytes, VM=vm_unknown)
        got `Connection: close
        (19:0 bytes, VM=vm_unknown)
        got `Content-Type: text/html;charset=ISO-8859-1
        (44:0 bytes, VM=vm_unknown)
        got `(2:0 bytes, VM=vm_unknown)
        got `' (0:0 bytes, VM=vm_unknown)
        got `' (0:0 bytes, VM=vm_unknown)
        got `' (0:0 bytes, VM=vm_unknown)