Automaticaly Connecting to a Secure site

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

rcunn87
Posts: 9
Joined: Thu Jul 26, 2007 7:12 pm UTC
Contact:

Automaticaly Connecting to a Secure site

Postby rcunn87 » Mon Nov 19, 2007 1:31 pm UTC

I am working on a program that will parse a file and create reports for me. The file is an invoice for trucks that my company leases and I have to login to the companies website and navigate to the latest file and download it. I plan on making weekly reports for all the trucks, (fuel millage, etc) and I want it to be as automatic as possible. But right now I am looking at logging into the website once a week and downloading the file and running the program. I was wondering if it was possible to automate login step?

Waterhouse
Posts: 54
Joined: Wed Oct 03, 2007 12:37 pm UTC

Re: Automaticaly Connecting to a Secure site

Postby Waterhouse » Mon Nov 19, 2007 3:57 pm UTC

That's heavily dependent on the way that the website works and the type of security they are using. It's probably possible to reverse-engineer the website by looking at the page sources and/or using some other techniques and then to include logic in your program that does what your browser would do.

How well do you understand HTTP security? Would you be willing to post the URL to the website? (You wouldn't need to post your login/password)

User avatar
Hammer
Because all of you look like nails.
Posts: 5491
Joined: Thu May 03, 2007 7:32 pm UTC
Contact:

Re: Automaticaly Connecting to a Secure site

Postby Hammer » Mon Nov 19, 2007 4:09 pm UTC

When deciding, please don't forget that this forum is public and crawlable by search engines. This is in no way a private conversation.
"What's wrong with you mathematicians? Cake is never a problem."

trickster721
Posts: 282
Joined: Tue Nov 13, 2007 4:26 am UTC

Re: Automaticaly Connecting to a Secure site

Postby trickster721 » Mon Nov 19, 2007 7:02 pm UTC

Darn, so close.

rcunn87
Posts: 9
Joined: Thu Jul 26, 2007 7:12 pm UTC
Contact:

Re: Automaticaly Connecting to a Secure site

Postby rcunn87 » Mon Nov 19, 2007 7:32 pm UTC

Yea it is https://www.onlineinvoice.ryder.com/eip ... Dispatcher
I do not really know anything about http security

Waterhouse
Posts: 54
Joined: Wed Oct 03, 2007 12:37 pm UTC

Re: Automaticaly Connecting to a Secure site

Postby Waterhouse » Tue Nov 20, 2007 1:53 am UTC

Your basic strategy is this:

1. Use a network library with HTTPS to make a POST request to the ACTION element of the login form...

Code: Select all

<FORM name="login" method="POST" action="../servlet/SelectDispatcher"><font class="Head">Login</font><br>
                        User Id (4-8 a/n characters)<br>
                        <input type="text" name="username" size="25" value=""><br>
                        Password (6 char min. 1 number.)<br>
                        <INPUT type="password" name="password" size="25"><br>
                        <br>

                        <INPUT type="image" src="../images/b_login_w.gif" alt="Login"><br>
                        <br>
                        <INPUT type="HIDDEN" name="controllerName" value="LogonControllerNV"/>
                        </form>


2. Keep track of the browser session id that is handed back to you by the server. This will probably be either by a cookie or possibly by some other mechanism. You will need to include this in subsequent interactions with the server.

3. Using the session id you obtained in step 2 above, make a call to the URL of the document you want to download.

The implementation details are left as an exercise, etc.

P.S.: This method would need a lot of trial-and-error, and, ultimately, might not work, so I would recommend that you only try to continue if you have a genuine interest in learning how to do it.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 10 guests