BloodHoundAD / SharpHound2

The Old BloodHound C# Ingestor (Deprecated)
509 stars 113 forks source link

SharpHound ends execution upon network disconnection #89

Open HawkSec opened 4 years ago

HawkSec commented 4 years ago

Hello.

Sharphound does not validate before each action whether the network connection is up or not. As soon as the connection drops, bloodhound thinks the task finished, saving and closing the resulting zip file. When importing to the UI, the files are damaged, so it cannot proceed.

I had an assessment where I had only 30 seconds connected to the network before being moved to a quarantined vlan, so it would be wonderful if you can add a way to validate connection state before continuing and pause the execution until it is reestablished.

Something like this should work. Maybe the interface index to check could be a parameter: $networkavailable = $false; foreach ($adapter in Get-NetAdapter -InterfaceIndex 1){ if ($adapter.status -eq "Up"){$networkavailable = $true; break;} } echo $networkavailable;

Alternatively, I can do it myself, if you point me in the right direction (I don't know which file to modify for this).