Open karnamonkster opened 2 years ago
Wondering how to use this code for getting scanners - from engine-openvas.py
def get_scanners(name=None):
"""Return the list of scanners' ID."""
scanners_list = []
connection = TLSConnection(
hostname=engine.scanner["options"]["gmp_host"]["value"],
port=engine.scanner["options"]["gmp_port"]["value"],
timeout=int(engine.scanner["options"].get("timeout", DEFAULT_TIMEOUT))
)
with Gmp(connection) as gmp_cnx:
gmp_cnx.authenticate(
engine.scanner["options"]["gmp_username"]["value"],
engine.scanner["options"]["gmp_password"]["value"])
scanners_xml = gmp_cnx.get_scanners()
try:
scanners = ET.fromstring(scanners_xml)
except Exception:
return None
if not scanners.get("status") == "200":
return None
for scanner in scanners.findall("scanner"):
if name is not None:
if name == scanner.find('name').text:
return [scanner.get("id")]
else:
scanners_list.append(scanner.get("id"))
connection.disconnect()
return scanners_list
Bump
Hi @MaKyOtOx ,
Could you please see if this is possible ?
Hi,
I am running a GVMD version 21.4.5 (Source install) PatrowlManager - 1.8.4 Community Edition PatrowlEngine - 1.5.3
I am able to scan with the default OpenVAS scanner, however I have multiple satellite scanners which are integrated to the GVMD (say its a Master). I need to know if on Patrowl - while starting a scan, can I get the list of scanners from GVMD ? similar to running a command
gvmd --get-scanners
Would be great to have this sorted :)