text stringlengths 0 828 |
|---|
name - lowercase name of module |
"""""" |
selected_registry = registry |
if category is not None: |
selected_registry = [re for re in selected_registry if re.category==category] |
if namespace is not None: |
selected_registry = [re for re in selected_registry if re.namespace==namespace] |
if name is not None: |
selected_registry = [re for re in selected_registry if re.name==name] |
if len(selected_registry)>0: |
return [sr.cls for sr in selected_registry] |
return None" |
927,"def list(self, service_rec=None, host_rec=None, hostfilter=None): |
"""""" |
List a specific service or all services |
:param service_rec: t_services.id |
:param host_rec: t_hosts.id |
:param hostfilter: Valid hostfilter or None |
:return: [(svc.t_services.id, svc.t_services.f_hosts_id, svc.t_hosts.f_ipaddr, |
svc.t_hosts.f_hostname, svc.t_services.f_proto, |
svc.t_services.f_number, svc.t_services.f_status, svc.t_services.f_name, |
svc.t_services.f_banner), ...] |
"""""" |
return self.send.service_list(service_rec, host_rec, hostfilter)" |
928,"def info(self, svc_rec=None, ipaddr=None, proto=None, port=None): |
"""""" |
Information about a service. |
:param svc_rec: t_services.id |
:param ipaddr: IP Address |
:param proto: Protocol (tcp, udp, info) |
:param port: Port (0-65535) |
:return: [ service_id, host_id, ipv4, ipv6, hostname, proto, number, status, name, banner ] |
"""""" |
return self.send.service_info(svc_rec, ipaddr, proto, port)" |
929,"def add(self, ipaddr=None, proto=None, port=None, fields=None): |
"""""" |
Add a service record |
:param ipaddr: IP Address |
:param proto: Protocol (tcp, udp, info) |
:param port: Port (0-65535) |
:param fields: Extra fields |
:return: (True/False, t_services.id or response message) |
"""""" |
return self.send.service_add(ipaddr, proto, port, fields)" |
930,"def delete(self, svc_rec=None, ipaddr=None, proto=None, port=None): |
"""""" |
Delete a t_services record |
:param svc_rec: t_services.id |
:param ipaddr: IP Address or t_hosts.id |
:param proto: Protocol (tcp, udp, info) |
:param port: Port (0-65535) |
:return: [True, Response Message] |
"""""" |
return self.send.service_del(svc_rec, ipaddr, proto, port)" |
931,"def report_list(self, service_id=None, service_port=None, hostfilter=None): |
"""""" |
Returns a list of ports with IPs, banners and vulnerabilities (warning, slow!) |
:param service_id: t_services.id |
:param service_port: Port (tcp/#, udp/#, info/#) |
:param hostfilter: Valid hostfilter or None |
:return: { 'port': [t_hosts.f_ipaddr, t_services.f_banner, |
(t_vulndata.f_vulnid, t_vulndata.f_title, t_vulndata.f_severity, t_vulndata.f_cvss_score), ...} |
"""""" |
return self.send.service_report_list(service_id, service_port, hostfilter)" |
932,"def vulns_list(self, service_id=None, service_port=None, hostfilter=None): |
"""""" |
List of vulnerabilities for a service |
:param service_id: t_services.id |
:param service_port: tcp/#, udp/# or info/# |
:param hostfilter: Valid hostfilter or None |
:return: t_services.rows.as_list() |
"""""" |
return self.send.service_vulns_list(service_id, service_port, hostfilter)" |
933,"def connect(nodes): |
''' |
Connect a list of nodes. |
Connected nodes have an ``output`` member which is the following node in |
the line. The last node's ``output`` is a :class:`Queue` for |
easy plumbing. |
''' |
for a, b in zip(nodes[:-1], nodes[1:]): |
a.output = b |
b.output = queues.Queue()" |
934,"def render_layout(layout_name, content, **context): |
""""""Uses a jinja template to wrap the content inside a layout. |
Wraps the content inside a block and adds the extend statement before rendering it |
with jinja. The block name can be specified in the layout_name after the filename separated |
by a colon. The default block name is ""content"". |
"""""" |
layout_block = ""content"" |
if "":"" in layout_name: |
layout_name, layout_block = layout_name.split("":"") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.