internetwache/GitTools

Dumper tool is broken :(

securitybites opened this issue · 10 comments

Thanks for creating this awesome tool that I have been using for a long time. However, I recently updated it and noticed the latest version of the dumper tool is broken.

When running: bash gitdumper.sh http://target.com/.git ~/temp/dump , I get the following output:

[-] // missing in url and the program exits.

Hi,

Did you try adding / at the end or the URL.

gitdumper.sh http://target.com/.git/ ~/temp/dump

It does not seem to be the case here, but it also won't work on macOS, as it's bash version (3.2) is to old, there you may see the following error:

./gitdumper.sh: line 25: declare: -n: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
\e[31m[-] // missing in url\e[0m

You are correct. I am running it on a Mac and have tried adding a / with no luck. The older version of Dumper, prior to adding the --git-dir flag worked just fine on a Mac.

You may try to install a newer bash version with homebrew, see https://apple.stackexchange.com/a/24635/72643:

Binaries in /{,usr/}{,s}bin/ should not usually be replaced with other files. Other programs expect them to be the versions that came with OS X, and they are replaced by OS upgrades.

After running brew install bash, you can change the default shell safely by:

  • Adding /usr/local/bin/bash to /etc/shells
  • Running chsh -s /usr/local/bin/bash.

Settings in Terminal or iTerm 2 don't normally have to be changed. Both of them default to opening new windows with a login shell of the default shell.

The default shell can also be changed from System Preferences or with dscl, but all three options just modify /var/db/dslocal/nodes/Default/users/$USER.plist.

@securitybites Did the solution given by @osopolar work out for you?

@gehaxelt I am also on macOS (Mojave 10.14) and have the same issues as @securitybites
I tried updating my bash (to Version 4.4.23) via Homebrew as @osopolar suggested
However, the problem is not fixed and I get the exact same error as @securitybites
Edit: I went back to an older commit (b6332c1) and there it worked

@WeberNick do you get the same error message as @securitybites missing / in url or something else that could help me locate the bug?

I don't have a Mac to test on unfortunately :/

I got the following error:

./gitdumper.sh: line 25: declare: -n: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
\e[31m[-] // missing in url\e[0m

Other than that I don’t know how to find the problem. Any idea?

Btw:
These color codes „\e[31m“ and so on don‘t work on my bash. I don’t know the \e syntax but instead I use \033 on my Unix machines.

@WeberNick thank you!

Do you mind reviewing #18 to see if that fixes the issue?

@gehaxelt Thanks for the fix!