def _newVulnImport(self,ip,port,protocol,name,desc,severity,type): if port == "": #vuln host h_id = guiapi.createAndAddHost(ip) v_id = guiapi.createAndAddVulnToHost(h_id, name, desc, [],severity) else: #vuln port h_id = guiapi.createAndAddHost(ip) if self._isIPV4(ip): i_id = guiapi.createAndAddInterface(h_id,ip,ipv4_address=ip) else: i_id = guiapi.createAndAddInterface(h_id,ip,ipv6_address=ip) s_id = guiapi.createAndAddServiceToInterface(h_id,i_id,port,protocol,ports=[port]) if type == "2": v_id = guiapi.createAndAddVulnWebToService(h_id,s_id, name, desc, [], severity, "/", "/") else: v_id = guiapi.createAndAddVulnToService(h_id,s_id, name, desc, [],severity) api.devlog("type:" + type)
def _newVulnImport(self,ip,port,protocol,name,desc,severity,type): if port == "0": #vuln host h_id = guiapi.createAndAddHost(ip) v_id = guiapi.createAndAddVulnToHost(h_id, name, desc, [],severity) else: #vuln port h_id = guiapi.createAndAddHost(ip) if self._isIPV4(ip): i_id = guiapi.createAndAddInterface(h_id,ip,ipv4_address=ip) else: i_id = guiapi.createAndAddInterface(h_id,ip,ipv6_address=ip) s_id = guiapi.createAndAddServiceToInterface(h_id,i_id,port,protocol,ports=[port]) if type == "2": v_id = guiapi.createAndAddVulnWebToService(h_id,s_id, name, desc, "/","/",[],severity) else: v_id = guiapi.createAndAddVulnToService(h_id,s_id, name, desc, [],severity) api.devlog("type:" + type)