JonValt / ratigan

ratigan
1 stars 0 forks source link

Hardcoded path to ratproxy #1

Closed jgor closed 10 years ago

jgor commented 10 years ago

Feature request: allow user to change path to ratproxy from the default /usr/bin/ratproxy.

In OS X I run ratproxy from a local directory rather than installed as system. I tried symlinking /usr/bin/ratproxy to my local copy but that's not enough, ratproxy complains of missing files unless you use the path to its folder to run it.

JonValt commented 10 years ago

We're sorry that you're experiencing a problem. Please copy and paste the exact error message you are receiving.

Thank you for using ratigan!

JonValt commented 10 years ago

When running ratproxy, ratigan issues the command found in the Command box. You can change the location to match your specific location for ratproxy. I've verified this by renaming /usr/bin/ratproxy to /usr/bin/ratproxy2 on the filesystem and then changing the command in ratproxy.

For the reporting feature, ratigan uses the command 'ratproxy-report' which, if in your path, should execute correctly. Please try this and let me know.

jgor commented 10 years ago

Forgot to add, the ratproxy error is when you try to visit ssl links. Here's an example run of ratproxy (without ratigan) launching it from the symlink:

$ sudo ln -s /Users/jgor/Programs/ratproxy/ratproxy /usr/bin/ratproxy
$ /usr/bin/ratproxy -cefgijlmstx -v /tmp/ratproxy/ -w /tmp/ratproxy/ratproxy.log -d "mydomain.com" -p 8081
ratproxy version 1.58-beta by <lcamtuf@google.com>
[*] Proxy configured successfully. Have fun, and please do not be evil.
[+] Accepting connections on port 8081/tcp (local only)...
35303:error:02001002:system library:fopen:No such file or directory:/SourceCache/OpenSSL098/OpenSSL098-50/src/crypto/bio/bss_file.c:356:fopen('keyfile.pem','r')
35303:error:20074002:BIO routines:FILE_CTRL:system lib:/SourceCache/OpenSSL098/OpenSSL098-50/src/crypto/bio/bss_file.c:358:
35303:error:140DC002:SSL routines:SSL_CTX_use_certificate_chain_file:system lib:/SourceCache/OpenSSL098/OpenSSL098-50/src/ssl/ssl_rsa.c:722:
PROGRAM ABORT: certificate load failed [ssl_start(), ssl.c:147]

At that point Firefox gets "The connection was interrupted" and the request fails. After further testing it looks like even if you use the full path it will fail the same way unless you are in the same directory as the ratproxy install when you launch it. I confirmed that just changing the path to ratproxy in ratigan's command box isn't enough. I assume since your particular ratproxy is a system install it has put the files it needs into some other directory it knows to look for under /usr, so even if you rename yours it has no problems finding the resource files.

So I guess this is really more of a request to support local ratproxy directories in addition to system-wide ratproxy installs. I don't know enough about it but it would probably be an option to specify the ratproxy folder location then the programmatic equivalent of changing directories to that folder and running ./ratproxy from there. It would be especially cool if ratigan shipped with its own ratproxy directory, or on first run offered to download ratproxy if there are licensing issues.

JonValt commented 10 years ago

Are you otherwise able to run ratproxy without error or is this specific to your setup when trying to use it with ratigan? I've heard that certain components of ratproxy proper only work inside *nix. I have not tried on OSX.

On Tue, Dec 24, 2013 at 5:35 PM, jgor notifications@github.com wrote:

Forgot to add, the ratproxy error is when you try to visit ssl links. Here's an example run of ratproxy (without ratigan) launching it from the symlink:

$ sudo ln -s /Users/jgor/Programs/ratproxy/ratproxy /usr/bin/ratproxy $ /usr/bin/ratproxy -cefgijlmstx -v /tmp/ratproxy/ -w /tmp/ratproxy/ratproxy.log -d "mydomain.com" -p 8081 ratproxy version 1.58-beta by lcamtuf@google.com [*] Proxy configured successfully. Have fun, and please do not be evil. [+] Accepting connections on port 8081/tcp (local only)... 35303:error:02001002:system library:fopen:No such file or directory:/SourceCache/OpenSSL098/OpenSSL098-50/src/crypto/bio/bss_file.c:356:fopen('keyfile.pem','r') 35303:error:20074002:BIO routines:FILE_CTRL:system lib:/SourceCache/OpenSSL098/OpenSSL098-50/src/crypto/bio/bss_file.c:358: 35303:error:140DC002:SSL routines:SSL_CTX_use_certificate_chain_file:system lib:/SourceCache/OpenSSL098/OpenSSL098-50/src/ssl/ssl_rsa.c:722: PROGRAM ABORT: certificate load failed [ssl_start(), ssl.c:147]

At that point Firefox gets "The connection was interrupted" and the request fails. After further testing it looks like even if you use the full path it will fail the same way unless you are in the same directory as the ratproxy install when you launch it. I confirmed that just changing the path to ratproxy in ratigan's command box isn't enough. I assume since your ratigan is a system install it has put the files it needs into some other directory it knows to look for under /usr, so even if you rename yours it has no problems finding the resource files.

So I guess this is really more of a request to support local ratproxy directories in addition to system-wide ratproxy installs. I don't know enough about it but it would probably be an option to specify the ratproxy folder location then the programmatic equivalent of changing directories to that folder and running ./ratproxy from there. It would be especially cool if ratigan shipped with its own ratproxy directory, or on first run offered to download ratproxy if there are licensing issues.

— Reply to this email directly or view it on GitHubhttps://github.com/JonValt/ratigan/issues/1#issuecomment-31187567 .

Joshua Harper GCFE GCFA GSEC PI Digital Forensic Analyst, Radix Forensics LLC Austin, TX

http://www.RadixForensics.com http://www.facebook.com/RadixForensics

jgor commented 10 years ago

I think this is a "building ratproxy in-place" vs "installing ratproxy system-wide" issue. I usually prefer not to run "make install" on tools, I just build them in-place with "make" and then run them directly from there. My ratproxy works when I run it from the build directory, e.g. cd /Users/jgor/Programs/ratproxy && ./ratproxy --blah.

JonValt commented 10 years ago

Interesting. I'll see if I can programmatically do a cd of sorts before executing ratproxy.

On Tuesday, December 24, 2013, jgor wrote:

I think this is a "building ratproxy in-place" vs "installing ratproxy system-wide" issue. I usually prefer not to run "make install" on tools, I just build them in-place with "make" and then run them directly from there. My ratproxy works when I run it from the build directory, e.g. cd /Users/jgor/Programs/ratproxy && ./ratproxy --blah.

— Reply to this email directly or view it on GitHubhttps://github.com/JonValt/ratigan/issues/1#issuecomment-31187915 .

Joshua Harper GCFE GCFA GSEC PI Digital Forensic Analyst, Radix Forensics LLC Austin, TX

http://www.RadixForensics.com http://www.facebook.com/RadixForensics

jgor commented 10 years ago

Here's my workaround so far for this issue:

$ cat /usr/bin/ratproxy

#!/bin/bash
cd /Users/jgor/Programs/ratproxy && ./ratproxy $@

If you can make the path to ratproxy user-editable I can move this to the local ratproxy folder and just point it at my script instead of the binary. Or perhaps you can extract the parent directory from the user-provided path and add the cd part in code?

jgor commented 10 years ago

Specifying path works now with 0e3a0f5.