rofl0r / proxychains-ng

proxychains ng (new generation) - a preloader which hooks calls to sockets in dynamically linked programs and redirects it through one or more socks/http proxies. continuation of the unmaintained proxychains project. the sf.net page is currently not updated, use releases from github release page instead.
http://sourceforge.net/projects/proxychains-ng/files
GNU General Public License v2.0
9.82k stars 1.08k forks source link

Read options from environment #62

Open eyeinsky opened 9 years ago

eyeinsky commented 9 years ago

I'd be great if proxychains read options from env too, overriding the configuration in files.

When wanting to start more than one proxychains with a different config, then creating a separate file for each is not really reqired since these files will ever be used once. Setting variables like "PORT=$some_port proxychains $some_cmd" would be much nicer.

rofl0r commented 9 years ago

suggestion: create a script wrapper that generates a conf file with a unique name in /tmp for one-time usage, converting your command line parameters into an appropriate config file (and then starts proxychains with and -f paramater pointing to that file)

eyeinsky commented 9 years ago

This was what I was actually hoping to avoid, but poin taken.

I found something that implemented the simplest version of this in https://github.com/haad/proxychains (the function 'simple_socks5_env' does it in the file 'libproxychains.c'), but the solution there seems kind of hacky.. And as /tmp goes, or can be made to go through, an in-ram filesystem, it seems an adequate solution.