-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completed scan leaves no results file #178
Comments
Hi @jboger - thanks for posting an issue. What version of Scantron are you using? You can find it here: |
I should probably dump the entire
modules.logger.ROOT_LOGGER.info(f"scan_job: {scan_job}") so it looks like this:
and mark the "Scan status" to pending
cd /root/agent
source .venv/bin/activate
python agent.py |
Hi, I have implemented the changes to the logging, that you suggested. The result is as follows: Mind you, the resumed scan is one of a much larger network that I scanned yesterday, to try and see if it was an issue with scanning a single IP (it was not). That is not the reason for my current issue. It appears to me that the .dotfiles are created in pending, but that once the scan is complete, these are never converted to the file formats that are linked from the main scanatron page (IE '.nmap' and '.xml). Both of those links result in a 404. |
It appears the dotfiles are now appearing. I get '.nmap' '.gnmap' and '.xml' in ~/agent/scan_results/complete. However, the links from the GUI start page do not work. |
Actually, just noticed this line: My version is: version = "1.21" |
Thanks for the debug line...looks like The https://github.com/rackerlabs/scantron/blob/master/master/scan_scheduler.py#L115 result_file_base_name = f"{clean_text(site_name)}__{clean_text(scan_agent)}__{timestamp}" It should at least populate with the Let's try this:
#Ansible: Schedule any new scans every minute.
#* * * * * /home/scantron/master/scan_scheduler.sh
cd /root/agent
source .venv/bin/activate
python agent.py
cd /home/scantron/master
source /home/scantron/master/.venv/bin/activate
python scan_scheduler.py
That should successfully schedule the scan which will be picked up by the agent. Let me know of any issues or errors that come up. If everything looks good, as root on Master, open up crontab ( #Ansible: Schedule any new scans every minute.
* * * * * /home/scantron/master/scan_scheduler.sh |
Hi, I followed your steps, and this is the output of the agent.log:
scan_scheduler.log shows nothing in particular. Just like before I only get a.gnmap file in "complete". |
I started having the exact same issue so I followed the steps @derpadoo suggested. Unfortunatly after rebuilding the server, agent, and VMs they lived on I am still having this issue. |
Thanks for the additional data point @JonLMyers . I just pulled down v1.22 (master branch) and was able to deploy and scan without issues on Ubuntu 18.04. Before answer the questions below, go ahead and reboot both the agent and Master boxes.
cd /root/agent
ls -la target_files
echo test > scan_results/pending/test.txt
cat scan_results/pending/test.txt then on Master, checking cat /home/scantron/master/scan_results/pending/test.txt |
Just pushed v1.23 to add some protection mechanisms to prevent scheduling a scan if values are empty. Not a root cause solution for this, just an FYI. |
Hi derpadoo,
(server rebuilt and rebooted) |
@jboger Check your twitter DMs...I sent you a message. |
@derpadoo: Hey, I don’t have any new twitter DMs. Did you send them to the right person (@johanboger)? |
Hi Derpadoo, I seem to be having this issue as well. I get the error below in agent.log. Any advice? I took the following steps as described.
Ansible Server = 10.0.50.92
|
Thanks for submitting that information @nachobytes - it will probably be a few days before I can take a good look at it. If possible, could you and @jboger let me know where the boxes are being hosted...like AWS, GCP, Digital Ocean, simple VMs, bare metal, etc. |
@nachobytes Can you let me know what the
Should look something like:
|
@jboger / @nachobytes - There have been quite a few updates since this ticket was opened. Try installing the latest and let me know if you still have this issue. Going to close this ticket for now. |
Hi!
Just installed scantron with one master and one agent.
In the master UI I have added a scan command, a scan, a site, and I've added a schedules scan.
The agent finds it:
2020-02-26 09:07:59,492 [MainThread ] [INFO] No scan jobs found...checking back in 60 seconds.
2020-02-26 09:08:59,525 [MainThread ] [INFO] check_for_scans URL: https://127.0.0.1:4430/api/scheduled_scans
2020-02-26 09:08:59,554 [MainThread ] [INFO] Executing scan job ID: 2
2020-02-26 09:08:59,606 [Thread-1 ] [INFO] Starting scan for site 'svea' with command: nmap -Pn -A -iL ./target_files/.targets -oG ./scan_results/pending/.gnmap -oN ./scan_results/pending/.nmap -oX ./scan_results/pending/.xml --script-args http.useragent='user-agent'
2020-02-26 09:09:04,558 [MainThread ] [INFO] update_scan_information URL: https://127.0.0.1:4430/api/scheduled_scans/2
2020-02-26 09:09:04,660 [MainThread ] [INFO] Successfully updated scan information for scan ID 2 with data {'scan_status': 'started'}
2020-02-26 09:09:04,660 [MainThread ] [INFO] check_for_scans URL: https://127.0.0.1:4430/api/scheduled_scans
2020-02-26 09:09:04,733 [MainThread ] [INFO] No scan jobs found...checking back in 60 seconds.
2020-02-26 09:09:13,280 [Thread-1 ] [INFO] update_scan_information URL: https://127.0.0.1:4430/api/scheduled_scans/2
2020-02-26 09:09:13,386 [Thread-1 ] [INFO] Successfully updated scan information for scan ID 2 with data {'completed_time': '2020-02-26 09:09:13', 'scan_status': 'completed', 'result_file_base_name': ''}
2020-02-26 09:10:04,757 [MainThread ] [INFO] check_for_scans URL: https://127.0.0.1:4430/api/scheduled_scans
As you can see result_file_base_name is empty, so perhaps that is why no results files are created. The actual scan itself should surely prompt results. Running it as a standalone command does. I set up both master and agent using ansible playbooks with zero errors. The GUI and everything else seems to work just fine.
Any idea what could be wrong?
The text was updated successfully, but these errors were encountered: