thegroundzero / openvasreporting_server Goto Github PK
View Code? Open in Web Editor NEWOpenVAS Reporting Server: Automatically receive and parse OpenVAS XML reports using OpenVAS Reporting
License: GNU General Public License v3.0
OpenVAS Reporting Server: Automatically receive and parse OpenVAS XML reports using OpenVAS Reporting
License: GNU General Public License v3.0
The stream closes as soon as the buffer is full so only the first 1024 bytes of a report are received.
def setup_socket(host, port, report_format):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((host, int(port)))
print('Server started on {}:{}'.format(host, str(port)))
print('Will create reports in {} format'.format(report_format))
s.listen(5)
while True:
conn, addr = s.accept()
file = create_temp_file()
print('Temp file creates at: {}'.format(file))
with conn:
print('Connected by: {}'.format(addr))
while True:
data = conn.recv(1024)
if not data:
break
print('Received data, writing to temp file at: {}'.format(file))
write_to_file(file, data)
report = '{}/openvas_report_{}'.format(os.getcwd(), file)
print('Writing report to: {}.{}'.format(report, report_format))
config = openvasreporting.create_config([file], report, filetype=report_format)
openvasreporting.convert(config)
print('Connection closed')
os.remove(file)
This is because the final report starts being written/converted from the tmp report at the same time which kills the loop and shuts down the socket.
Move lines 62 & 63 to the previous/first loop:
def setup_socket(host, port, report_format):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((host, int(port)))
print('Server started on {}:{}'.format(host, str(port)))
print('Will create reports in {} format'.format(report_format))
s.listen(5)
while True:
conn, addr = s.accept()
file = create_temp_file()
print('Temp file creates at: {}'.format(file))
with conn:
print('Connected by: {}'.format(addr))
buffer = 8192
while True:
data = conn.recv(buffer)
if not data:
break
print('Received data, writing to temp file at: {}'.format(file))
write_to_file(file, data)
report = '{}/openvas_report_{}'.format(os.getcwd(), file)
print('Writing report to: {}.{}'.format(report, report_format))
config = openvasreporting.create_config([file], report, filetype=report_format)
openvasreporting.convert(config)
print('Connection closed')
os.remove(file)
This works and writes the full report before beginning the conversion. Forgive me if I got some terminology wrong, I'm new to python.
Tried to go through some of the python code and figure out how the "Hostname" field was being populated.. but alas I am no expert
When exporting to xlsx, there is a Host name field on the vulnerability tabs.
This is just marked as "-"
Ask questions, and I will try and explain more if needed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.