views:

86

answers:

3

Quick question.

There is a legacy website (that is not under my control and cannot be modified), that gives users a form to fill in data and then the user 'submits' the form for processing. There is virtually no error checking on this form, and very little help for the user (i.e. it was very poorly designed about 12 years ago and hasn't been updated since).

None-the-less, the back-end of this application performs a critical function.

My question is, is it possible (without having any ability to modify the legacy website), to write my own new front-end in asp.net (with proper pre-submit validation) living on a different server & domain, and then simulate the 'submit' to another webserver as long as I reproduce the form/data that is being sent?

The key question here I guess, is it possible to submit a form produce on one website, to another, and can this be done with ANY changes to the legacy site?

Comments appreciated.

+1  A: 

The key question here I guess, is it possible to submit a form produce on one website, to another, and can this be done with ANY changes to the legacy site?

Yes, I've done this before - provided that the target site doesn't do any referer checking. A POST request is a POST request, no matter where it originates from.

You just need to make sure that all the fields are exactly the same in your request as they would be coming from the original page, i.e. - same field names, same encoding etc.

Phill Sacre
Thanks: How could I confirm if refer checking is done, without having access to the server?
EJB
A: 

Beware that if the existing site is authenticating users you'll need to find a way to also collect and pass that info along. Otherwise, though, Phill's point is spot-on.

rp
A: 

The short answer is "yes", the long answer is "it depends". The basics of HTML and HTTP allow for it, but without knowing a little more about the implementation of the legacy site you can't know for sure that it will work.

In theory you just need to make sure that the name of the fields are the same and set the target of the form to the legacy site's page URL.

In practice the legacy site could be doing various things that make it difficult or impossible to achieve (it could require cookies set correctly or hold internal state for example).

The best thing would be just to try it. It shouldn't take long just to mock up the basic fields and post the form to see if it works. Once you know it works then you can worry about adding your extra validation etc

andynormancx