internetwache / GitTools

A repository with 3 tools for pwn'ing websites with .git repositories available
MIT License
3.87k stars 624 forks source link

Dumper tool is broken :( #16

Closed securitybites closed 6 years ago

securitybites commented 6 years ago

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.

nicelife90 commented 6 years ago

Hi,

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

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

osopolar commented 6 years ago

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
securitybites commented 6 years ago

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.

osopolar commented 6 years ago

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.

gehaxelt commented 6 years ago

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

WeberNick commented 6 years ago

@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 (b6332c1c95ba11ef85f6e863d90e036f238f7e23) and there it worked

gehaxelt commented 6 years ago

@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 :/

WeberNick commented 6 years ago

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.

gehaxelt commented 6 years ago

@WeberNick thank you!

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

securitybites commented 6 years ago

@gehaxelt Thanks for the fix!