The unified diff between revisions [51afdf76..] and [34cacda2..] is displayed below. It can also be downloaded as a raw diff.
#
#
# patch "plugins/x11.py"
# from [3a44e48bcc9e2533cec4514e36af9ef5eea9b0c7]
# to [b9a0175dc96e6e471d3f2eb08d488bb120047325]
#
# patch "test-plugin.py"
# from [ccefef7993184b42bc9c95ede38af797841645ab]
# to [ef93a68cb2aa9eacd00f67f331db29179ce9ea17]
#
============================================================
--- plugins/x11.py 3a44e48bcc9e2533cec4514e36af9ef5eea9b0c7
+++ plugins/x11.py b9a0175dc96e6e471d3f2eb08d488bb120047325
@@ -21,8 +21,10 @@ def host_callback(library, host, tcp_por
if len(ip_addresses) == 0: return rv
address, protocol = ip_addresses[0]
for port in tcp_ports:
- display = "%s:%s" % (address, port - 6000)
- result = run_command("%s/x11/x11 %s >/dev/null 2>&1" % (library.plugin_path, display), library.config.socket_timeout)
+ if port >= 6000: display_id = port - 6000
+ else: display_id = 0
+ display = "%s:%s" % (address, display_id)
+ result = run_command("%s/x11/x11 %s >/dev/null 2>&1" % (library.config.plugin_path, display), library.config.socket_timeout)
if result['timeout']: return rv
if result['exitcode'] == 0:
response = scan.ScannerResponse()
============================================================
--- test-plugin.py ccefef7993184b42bc9c95ede38af797841645ab
+++ test-plugin.py ef93a68cb2aa9eacd00f67f331db29179ce9ea17
@@ -11,8 +11,10 @@ if __name__ == '__main__':
if __name__ == '__main__':
plugin_name, address, tcp_ports, udp_ports = sys.argv[1:]
- tcp_ports = tcp_ports.split(',')
- udp_ports = udp_ports.split(',')
+ if tcp_ports != '': tcp_ports = map(int, tcp_ports.split(','))
+ else: tcp_ports = None
+ if udp_ports != '': udp_ports = map(int, udp_ports.split(','))
+ else: udp_ports = None
sys.path.insert(0, config.plugin_path)
mod = __import__('%s' % plugin_name, globals(), locals(), [''])
result = mod.host_callback(PluginLibrary(config), DummyHost(address), tcp_ports, udp_ports)