This is a small tool using Tinyscript and PyBots for downloading a .git
folder left on a Web server. Note that this tool does NOT rely on Directory Indexing.
$ pip install pybots tinyscript
$ tsm install git-web-recovery
This is a small tool using Tinyscript and PyBots for downloading a .git
folder left on a Web server. Note that this tool does NOT rely on Directory Indexing.
$ pip install pybots tinyscript
$ tsm install git-web-recovery
#!/usr/bin/env python | |
from pybots import GitRecoveryBot | |
from tinyscript import * | |
__author__ = "Alexandre D'Hondt" | |
__version__ = "1.2" | |
__copyright__ = ("A. D'Hondt", 2021) | |
__license__ = "gpl-3.0" | |
__examples__ = ["http://example.com/path/to/repo", "http://example.com/path/to/repo master dev"] | |
__doc__ = """ | |
*Git Web Recovery* is a siple tool for downloading a .git folder disclosed on a Web server. | |
""" | |
BANNER_FONT = "standard" | |
BANNER_STYLE = {'fgcolor': "lolcat"} | |
DEFAULT_BRANCHES = ["main", "master", "dev", "test"] | |
if __name__ == '__main__': | |
parser.add_argument("url", help="URL of the Web repository") | |
parser.add_argument("branch", default=DEFAULT_BRANCHES, nargs="*", help="branches to be checked out") | |
initialize() | |
with GitRecoveryBot(re.sub(r"/(\.git/?)?$", "", args.url), verbose=args.verbose) as bot: | |
for b in args.branch: | |
bot.checkout(b) |