Gitdumper sometimes hangs forever
It's not clear exactly which part is hanging, but on some URLs gitdumper can run forever.
This should also be remedied by a global timeout on module runs .
Discovered by @shart123456
Hey, I've just been running it on a URL with a large git repository, So far I'm at the ~2 hour mark. It is downloading new objects so its not frozen (And there is a object counter so it wont get caught in a loop downloading objects). I think a timeout is sensible though as you dont want to be downloading a repository for a huge amount of time and holding up the scan.
But for this module if a global timeout kills the download it will exit unsafely and you will be left with an invalid .git repository :{
So I think what we can do for this module is apply the timeout to the object download step specifically and if that step takes to long it will stop it and just reconstruct the git repository using what its downloaded
Not sure if this is helpful.. But a quick breakdown of when we first encountered this...
Going thru the log.... Here is what happened
BBot emit's 5 "CODE_REPOSITORY" events...
All 5 events were infested by Gitdumper... And since Directory Listing was not enabled on any of the repos, it went to fuzzing.
But thats where my trace stops... I dont know if its self.download_git_packs, self.download_git_objects, or self.download_current_branch thats stopping it..
Gitdumper did write the dir "repo_folder", but its contents were empty
Last week I ran BBot against the "problem" URL a second time, and got the same result. So I dropped into the container..
The commands available were very limited , but I could see that it still had an active web-socket with the target, despite 48 hours passing since I started the scan and nothing new being written
Fixed in https://github.com/blacklanternsecurity/bbot/pull/2466.