summaryrefslogtreecommitdiff
path: root/op-mode-definitions/execute-port-scan.xml.in
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-09-11 07:32:07 +0200
committerGitHub <noreply@github.com>2024-09-11 07:32:07 +0200
commitabf3bc93f24ff2fbe3b60e47d5070a2e328b9aea (patch)
treea40d96da7eb23e0f7583af126c83ee4224253361 /op-mode-definitions/execute-port-scan.xml.in
parent256fb8974bed38352c893dc9a048d9956feb925a (diff)
parent6032223ef5f06b46f101d740f381ddf24f5a9996 (diff)
downloadvyos-1x-abf3bc93f24ff2fbe3b60e47d5070a2e328b9aea.tar.gz
vyos-1x-abf3bc93f24ff2fbe3b60e47d5070a2e328b9aea.zip
Merge pull request #4043 from vyos/mergify/bp/circinus/pr-4038
op_mode: T6181: A feature for checking ports (backport #4038)
Diffstat (limited to 'op-mode-definitions/execute-port-scan.xml.in')
-rw-r--r--op-mode-definitions/execute-port-scan.xml.in34
1 files changed, 34 insertions, 0 deletions
diff --git a/op-mode-definitions/execute-port-scan.xml.in b/op-mode-definitions/execute-port-scan.xml.in
new file mode 100644
index 000000000..52cdab5f0
--- /dev/null
+++ b/op-mode-definitions/execute-port-scan.xml.in
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="execute">
+ <children>
+ <node name="port-scan">
+ <properties>
+ <help>Scan network for open ports</help>
+ </properties>
+ <children>
+ <tagNode name="host">
+ <properties>
+ <help>IP address or domain name of the host to scan (scan all ports 1-65535)</help>
+ <completionHelp>
+ <list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>nmap -p- -T4 --max-retries=1 --host-timeout=30s "$4"</command>
+ <children>
+ <leafNode name="node.tag">
+ <properties>
+ <help>Port scan options</help>
+ <completionHelp>
+ <script>${vyos_op_scripts_dir}/execute_port-scan.py --get-options-nested "${COMP_WORDS[@]}"</script>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/execute_port-scan.py "${@:4}"</command>
+ </leafNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>