Need help with redirecting requests

phatzilla

Supreme Member
Joined
Apr 9, 2009
Messages
1,428
Reaction score
980
Heres the quick scoop:

- My programmer is on vacation and i dont have source code to his application.

- His program requests a certain url and parses its response, lets call it https://abc.com/123.js

- Recently, https://abc.com/123.js has been taken down and the required information has been moved to https://abc.com/1234.js

- So now, i need to be hitting the new file, would it be possible to systematically route all requests from https://abc.com/123.js --> https://abc.com/1234.js ?


As far as im aware, editing the hosts file wont be able to solve this conundrum, i tried some WAMP server fuckery, but was unsucessful as i didn't want to go through the trouble of setting up ssl certs and all that stuff, as this is a https request.

Help would be greatly appreciated.
 
Last edited:
You need to edit your hosts file to point the abc.com domain on localhost and set up wamp to serve it (or you could host it on another https site you own and modify the hosts file accordingly)
 
The problem with the hosts/wamp setup is that setting up ssl on wamp is such a PITA. And i dont own any dedicated hosting with a cert.

:( are these my only options
 
the problem with using fiddler is that the application uses proxied requests to https://abc.com/123.js, so it wont really work with fiddler iirc. Plus, fiddler really doesn't play well with ssl requests coming from an application (or the application doesn't play well with fiddler i should say), as the certificate isn't trusted or whatever. Im guessing the hosts file along with wamp/your own server is the only option, arg.
 
Last edited:
Okay a bit of an update:

Got wamp server working with https connections (was a bitch), now the hosts file / wamp server are doing their thing when the bot makes a request to https://abc.com/123.js it gets redirected properly to https://abc.com/1234.js. However, when attempting to use proxies with the bot, it doesn't work (same issues as previously). So does the hosts file not account for proxied requests?

I tried using a localhost proxy 127.0.0.1:8888 alongside fiddler, and it also worked. But when i use external http proxies, it seemingly still hits the old url, as if the hosts file isn't rerouting it.

My guess is its because the proxy is still making the request to https://abc.com/123.js , get's 404'd, and im back to square one, i guess the request gets routed through the proxy before it's looked up in the Hosts file. LAME
 
Last edited:
If the program is routing the dns requests via the proxies, yes, the proxies do not get affected by the hosts settings (they are on different machines).
 
Welp, learn something new everyday i guess.
 
I agree with you if there is any problem in DNS than you can do if with proxy site. There is not any effect when you do it with proxy site.
 
Cheers


Didn't get lucky though ;(
 
Try disassembling the code? There is a free trial of .NET Reflector available that will return the code to readable source code / alternatively find a freelancer that will disassemble the code if encrypted?
 
Well, i think the only solution you got is to write a simple php module with cURL and rotate proxies.
It will be ~10-15 lines, less than an hour for someone familiar with cURL.
 
Back
Top