Open source saves lives, closed source is evil. We have all encountered encrypted or pre-compiled Java bytecode cfm/cfc files. Seldom times the original developers have left us options to change links, rename fields, change form action pages, add form fields, and even hide sections of the pages. What if you could (or had to) leave the original code in place and still make the changes on the client side of the code? What if I told you it was FREE?
Using jQuery and onRequestEnd (in Application.cfc or OnRequestEnd.cfm) we can totally transform the client side of the code giving you complete control to make the necessary changes.
Getting Started Run to http://www.jquery.com and download the latest copy Create an empty file called OnRequestEnd.cfm or use the existing file if it already is present. Using onRequestEnd in Application.cfc could also give you the same result.
Add the following code to OnRequestEnd.cfm
Save the file and browse to the page. If you view page source for the page, you should see your jQuery script call at the bottom of the page. Back to our encrypted page which is called secret.cfm. Say the page contains the following simple form and a couple of page links like this:
Zip code to attack: <input type="text" name="zip"><br>
<input type="submit" value="Launch Nukes">
<a href="secret2.cfm">Sell Arms</A>
Since we know the original developer didn't use selector IDs, we can use the power of jQuery to change the elements for us.
Walking through the code - find all links with url of secret1.cfm and change them to www.greenpeace.org, find all links with url of secret2.cfm and redirect them to www.ebay.com, and redirect any forms with action page of secret_encrypted_action.cfm to unsecret.cfm.
That is it - we have changed the client side code of encrypted pages. We took back control of the application. Write less, do more indeed.