-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
Hi! Just a quick one here.
I was using it to scan a machine today. But since I renamed the parent directory (from scans to scans_v1), the .json output file is not created. So I will have to run enum4linux-ng again.
Command to replicate the issue:
mkdir -p ~/Vault/scans_v1
enum4linux-ng -A <ip_address> -v -oJ "~/Vault/scans/e4l-Gm"
sudo updatedb && locate -i e4l-GmError message is seen in the last line of the output.
[!] Could not write JSON output to ~/Vault/scans/e4l-Gm.json
The suggested fix for -oJ, also possibly improved the edge case of no write permission
Add near line 851 and 852 of enum4linux-ng.py
def _write_json(self):
try:
# Make directory. Use current directory "." if only the filename is supplied
os.makedirs(os.path.dirname(self.out_file) or ".", exist_ok=True)
with open(f"{self.out_file}.json", 'w') as f:
f.write(json.dumps(self.out_dict, indent=4))
except OSError as e: # Throws error if write permission is denied
print(f"Failed to write JSON: {e}")
return False
return TrueProbably you could do the same for -oY by adding the same thing near line 859 and 860.
Thank you for your time.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels