21y4d / nmapAutomator

A script that you can run in the background!
MIT License
2.67k stars 790 forks source link

Kali terminal freezing #37

Closed 11nf0s3c closed 3 years ago

11nf0s3c commented 3 years ago

Thanks for addressing the high CPU and expression errors. Great work. I can not repeat the same issues now.

The third issue which I have noticed is, once the scan is finished, it freezes my kali terminal. I have repeated the same issue 3 times. Even ran the scan with the latest changes 20minutes ago and it freezes the kali terminal again.

21y4d commented 3 years ago

I have tested it on Parrot and Ubuntu, on Bash and Zsh terminal shells, and through SSH as well, and couldn't replicate the issue. All of those are Debian based and use the same shells/terminals as Kali, so they should act the same.

I don't currently have a Kali VM, but if you are sure this issue is with Kali and not your personal VM, then i'll download it and check again.

Also, is there any occasion when it will not freeze the terminal? Like a certain type os scan? So we can limit the potential causes.

Please check and let me know.

11nf0s3c commented 3 years ago

Thanks. I have scanned again, it is the same. It is freezing the terminal. Never happened with the old script.

I am using VMWare workstation 15 player and kali version with the following details.

Distributor ID: Kali Description: Kali GNU/Linux Rolling Release: 2020.4 Codename: kali-rolling

11nf0s3c commented 3 years ago

Few findings.

I interrupted the scan at the last step with control +C, it did not feeze the terminal and I can type etc in the terminal.

Found something strange which might help. Actually, It is not freezing the terminal. What is happening like after the scan is finished I can see the current directory like root@kali:/home/kali/ in the terminal but can not type anything etc you think the keyboard is not responsive, but if you use the up arrow button one time and hit enter and it will start the scan. Note using the up arrow button will not show you the last command in the terminal. That is strange.

21y4d commented 3 years ago

i'll download a Kali instance a test is when I can.. let me know if you notice anything new until then

11nf0s3c commented 3 years ago

Thanks, overall performance seems great much faster. See if this issue can be fixed.

21y4d commented 3 years ago

I downloaded a live Kali VM and tried running all scans, but it ran as expected and didn't cause any issues. Perhaps there's a certain case that would cause an output which would hang the terminal. However, if i can't replicate this i won't know this specific case to be able to fix it.

If your terminal does hang, just type reset and hit enter twice and it should work again. This is because it's probably not hang, but just not printing anything, which may be caused by special characters printed for coloring/buffering purposes.

Does this happen with all websites, or is there a certain case that would cause this? If yes, kindly share the case or the output so i have more info to diagnose.

11nf0s3c commented 3 years ago

Thanks for your time and effort. It is not for all, but I have noticed it most of the times.

21y4d commented 3 years ago

I have tested this further with Kali, and never faced an issue. Perhaps it may be like i mentioned above, or something on your VM that's causing this.

Does the reset command fixes the terminal? If so, perhaps the terminal is not liking the color/buffered output of nmapAutomator. Try it with terminator or tilix terminals, and see if the issue still occurs.

I'm closing this issue for now, if you ever know why your VM is not liking nmapAutomator, please let me know so i can fix it :)

11nf0s3c commented 3 years ago

As suggested, I have tried the same machine "Bastard" from HTB in Terminator. See the issues:

  1. No message/results in "NMAP UDP Scan", just empty. At least it should display some message.
  2. Nothing in "Recon Recommendations".
  3. Same behaviour as before. It is not freezing the terminal. What is happening like after the scan is finished I can see the current directory like root@kali:/home/kali/ in the terminal but can not type anything etc you think the keyboard is not responsive, but if you use the up arrow button one time and hit enter and it will start the scan. Note using the up arrow button will not show you the last command in the terminal.

Definitely, something wrong is going on.

21y4d commented 3 years ago

Thanks for the update. You are right about the UDP message. I added a message that says "no UDP ports are open" if none are found.

I tested the script with '--type all' on the Bastard machine, and it ran as expected, the recon worked as expected. Not sure what the issue is.

I'll run it on Kali with Terminator on bash/zsh, to see if the same issue happens. If I can't replicate the issue, and no one else is facing it, it may not be an issue with the script itself.

11nf0s3c commented 3 years ago

Is there anything I can do at my end? I have already updated my machine to the latest version of Kali with all the updates. Started using Terminator. I am quite used to nmapAutomator script. I will be doing some exams in the next few days. It would be great if we can check and fix where the problem is. I never have had any issues with the scripts in the past. Recently noticed the old script getting at

"Starting Nmap Vulns Scan - > Running Vuln scan on basic ports". Pre-scan script results: |_broadcast-avahi-dos: ERROR: Script execution failed (use -d to debug)

21y4d commented 3 years ago

As a short term fix, if the terminal freezes, just type 'reset' -even if you don't see it typing- and hit enter, and it should fix the terminal.

The nmap Vulns script is known to have issues -from nmap-, so keep it as a last step, as it may take too long as well.

For general usage, the Recon scan should cover the majority of things. So you can run: nmapAutomator -H 10.10.10.10 -t Recon && nmapAutomator -H 10.10.10.10 -t Full

This should run everything without any duplicates, and give the most important results first.

I'll try to look more into to determine which odd cases may cause issues. You can of course go to an old commit and download the script from there to use an older version if it doesn't cause any issues for you.