WangYihang/GitHacker

AssertionError: Invalid index file header: b'cons'

zzluca opened this issue · 2 comments

When I run the tool via docker command:

docker run --rm -ti \
    -v /tmp/githack/results:/tmp/githacker/results \
    -v /tmp/githack/__init__.py:/usr/local/lib/python3.10/site-packages/GitHacker/__init__.py \ # Custom file, see issue #26 
    wangyihang/githacker \
     --output-folder /tmp/githacker/results --url http://WXYZ.com/.git/config

I get back this error

Traceback (most recent call last):
  File "/usr/local/bin/githacker", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/GitHacker/__init__.py", line 482, in main
    ).start()
  File "/usr/local/lib/python3.10/site-packages/GitHacker/__init__.py", line 92, in start
    return self.blind()
  File "/usr/local/lib/python3.10/site-packages/GitHacker/__init__.py", line 165, in blind
    tn = self.add_blob_file_tasks()
  File "/usr/local/lib/python3.10/site-packages/GitHacker/__init__.py", line 351, in add_blob_file_tasks
    for _, blob in self.repo.index.iter_blobs():
  File "/usr/local/lib/python3.10/site-packages/git/index/base.py", line 463, in iter_blobs
    for entry in self.entries.values():
  File "/usr/local/lib/python3.10/site-packages/gitdb/util.py", line 253, in __getattr__
    self._set_cache_(attr)
  File "/usr/local/lib/python3.10/site-packages/git/index/base.py", line 143, in _set_cache_
    self._deserialize(stream)
  File "/usr/local/lib/python3.10/site-packages/git/index/base.py", line 171, in _deserialize
    self.version, self.entries, self._extension_data, _conten_sha = read_cache(stream)
  File "/usr/local/lib/python3.10/site-packages/git/index/fun.py", line 226, in read_cache
    version, num_entries = read_header(stream)
  File "/usr/local/lib/python3.10/site-packages/git/index/fun.py", line 192, in read_header
    raise AssertionError("Invalid index file header: %r" % type_id)
AssertionError: Invalid index file header: b'cons'

and no result :(

Ah 🤦 nevermind, I was hitting one honeypot server... so the /.git folder didn't actually serve any real git file

Okay, never mind.

Warning

Please DO NOT run GitHacker on your own machine. Consider a jailed environment like Docker container.
Malicious .git/ folder could be dangerous.