Closed zenire closed 4 years ago
Hello Peter. I just downloaded fresh build of image from DockerHub and cannot replicate this issue:
I added exception handling to execute_command function so it will show an actual error. Please wait for new build to finish, then pull an image and try one again.
Thank you for your quick response! It now doesn't go further than Starting OpenVAS...
.
Starting OpenVAS...
^CTraceback (most recent call last):
File "scan.py", line 324, in <module>
start_scan(arguments)
File "scan.py", line 227, in start_scan
subprocess.check_call(["/start"], shell=True, stdout=subprocess.DEVNULL)
File "/usr/lib/python3.6/subprocess.py", line 306, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 289, in call
return p.wait(timeout=timeout)
File "/usr/lib/python3.6/subprocess.py", line 1477, in wait
(pid, sts) = self._try_wait(0)
File "/usr/lib/python3.6/subprocess.py", line 1424, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
Looks like I'm impatient, ps aux
returns openvasmd: Rebuilding
. Will get back to you.
KeyboardInterrupt
It seems that you stopped it by yourself 😄
OpenVAS can take few minutes to start, because it needs to rebuild whole cache.
Starting OpenVAS...
Starting scan with settings:
* Target: 192.168.1.0/24
* Excluded hosts:
* Scan profile: Full and fast
* Alive tests: ICMP, TCP-ACK Service & ARP Ping
* Max hosts: 10
* Max checks: 3
* Report format: PDF
* Output file: openvas.report
Performed initial cleanup.
Created target with id: d4546b98-e1f1-4a51-a1c2-2d384abc1961.
Created task with id: e07af34d-81e6-4655-9222-d9736f62172e.
Started task.
Waiting for task to finish...
Task status: Requested 1%
Task status: Running 1%
Task status: Running 1%
Task status: Running 1%
Task status: Running 1%
Task status: Running 1%
Task status: Running 1%
Task status: Running 1%
Task status: Running 1%
Task status: Running 1%
[ERROR] Response: b'Failed to authenticate.\n'
Oh, it was definitely my mistake to add exit(1) after error in execute_command in last commit. From time to time OpenVAS socket will return authentication error on task status check, but that's totally normal and in next check it should properly return status.
It seems that beside that everything else works fine now for you, so I'll just make a fast commit to ignore that authentication error.
Starting OpenVAS...
Starting scan with settings:
* Target: 192.168.1.0/24
* Excluded hosts:
* Scan profile: Full and fast
* Alive tests: ICMP, TCP-ACK Service & ARP Ping
* Max hosts: 10
* Max checks: 3
* Report format: PDF
* Output file: openvas.report
Performed initial cleanup.
Created target with id: 1278a5f2-ccb4-4bf7-b768-7463192315cc.
Created task with id: e048bbae-e405-46f0-8905-a8caa359d4c2.
Started task.
Waiting for task to finish...
Task status: Requested 1%
Task status: Running 1%
Task status: Running 1%
Traceback (most recent call last):
File "scan.py", line 330, in <module>
start_scan(arguments)
File "scan.py", line 247, in start_scan
'output': "/reports/" + args.output})
File "scan.py", line 196, in make_scan
report_id = process_task(task_id)
File "scan.py", line 143, in process_task
status = etree.XML(task).xpath("string(//status/text())")
File "src/lxml/etree.pyx", line 3214, in lxml.etree.XML
File "src/lxml/parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1757, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1068, in lxml.etree._BaseParser._parseUnicodeDoc
File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError
File "<string>", line 1
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1
This may be an error from OpenVAS itself or no hosts were alive in scanned network.
I just scanned a single host in my network (with report in PDF format) without any problem:
root@965d183b40b2:/# python3 -u scan.py 192.168.1.1 --format PDF
Starting OpenVAS...
Starting scan with settings:
* Target: 192.168.1.1
* Excluded hosts:
* Scan profile: Full and fast
* Alive tests: ICMP, TCP-ACK Service & ARP Ping
* Max hosts: 10
* Max checks: 3
* Report format: PDF
* Output file: openvas.report
Performed initial cleanup.
Created target with id: c6d9c8a4-46a7-4886-9a54-ca6ccda1b7df.
Created task with id: 2e334d48-016b-41a9-974b-15e00d356aa3.
Started task.
Waiting for task to finish...
Task status: Running 1%
Task status: Running 1%
Task status: Running 1%
Task status: Complete
Finished processing task.
Generated report.
Saved report to /reports/openvas.report.
Done!
root@965d183b40b2:/#
@ZeNiRe, I assume that this issue can be closed?
It seems to work now, but I'm still getting the error "lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1" periodically. Maybe we should enclose it in a try catch to not abort?
That error implies that generated report is empty and that is possible in case of:
Yeah, I think it make sense to catch this error, print info about empty report and go on. I'll change it today or tomorrow.
I also experience it with hosts that are online but I will check again about the vulnerabilities. The strange thing is the error may occur on the first try, but the second one succeeds. I will try to gather some more information.
Thank you again!
This issue has not reoccured over the past few days.
docker run --rm -v $(pwd):/reports/:rw thedoctor0/openvas-docker-lite python3 -u scan.py 192.168.1.0/24
returns