
웹사이트에서 git 저장소를 덤프하는 도구
웹사이트에서 git 저장소를 덤프하는 도구입니다.
pip를 사용하여 간편하게 설치할 수 있습니다:
pip install git-dumper
usage: git-dumper [options] URL DIR
Dump a git repository from a website.
positional arguments:
URL url
DIR output directory
optional arguments:
-h, --help show this help message and exit
--proxy PROXY use the specified proxy
-j JOBS, --jobs JOBS number of simultaneous requests
-r RETRY, --retry RETRY
number of request attempts before giving up
-t TIMEOUT, --timeout TIMEOUT
maximum time in seconds before giving up
-u USER_AGENT, --user-agent USER_AGENT
user-agent to use for requests
-H HEADER, --header HEADER
additional http headers, e.g `NAME=VALUE`
--client-cert-p12 CLIENT_CERT_P12
client certificate in PKCS#12 format
--client-cert-p12-password CLIENT_CERT_P12_PASSWORD
password for the client certificate
-b BRANCH, --branch BRANCH
additional branch name to check for (repeatable)
git-dumper http://website.com/.git ~/website
이 소프트웨어는 사용자 본인의 책임 하에 사용하십시오!
만약 다운로드하려는 저장소가 공격자에 의해 제어되고 있다면, 이로 인해 원격 코드 실행이 발생할 수 있음을 인지해야 합니다.
pip로 의존성을 설치하기만 하면 됩니다:
pip install -r requirements.txt
그런 다음 간단히 다음을 사용하세요:
./git_dumper.py http://website.com/.git ~/website
이 도구는 먼저 디렉터리 목록을 사용할 수 있는지 확인합니다. 가능하다면 .git 디렉터리를 재귀적으로 다운로드합니다(wget으로 수행하는 방식).
디렉터리 목록을 사용할 수 없는 경우, 가능한 많은 파일을 찾기 위해 여러 방법을 사용합니다. 단계별로 git-dumper는 다음을 수행합니다:
.gitignore, .git/HEAD, .git/index 등);.git/HEAD, .git/logs/HEAD, .git/config, .git/packed-refs 등을 분석하여 가능한 많은 refs(예: refs/heads/master, refs/remotes/origin/HEAD 등)를 찾습니다;.git/packed-refs, .git/index, .git/refs/*, .git/logs/*를 분석하여 가능한 많은 객체(sha1)를 찾습니다;git checkout .을 실행하여 현재 작업 트리를 복구합니다.