From 33063ff568cf3d9269dc938847e14fd0ecba7629 Mon Sep 17 00:00:00 2001 From: Alaeddine Mesbahi Date: Fri, 9 Aug 2024 12:47:20 +0100 Subject: [PATCH 1/3] Change default to all ports with SYN scan. --- agent/nmap_options.py | 2 +- ostorlab.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/nmap_options.py b/agent/nmap_options.py index f1235668..d26a4198 100644 --- a/agent/nmap_options.py +++ b/agent/nmap_options.py @@ -55,7 +55,7 @@ class NmapOptions: version_detection: bool = True port_scanning_techniques: List[PortScanningTechnique] = dataclasses.field( default_factory=lambda: [ - PortScanningTechnique.TCP_CONNECT, + PortScanningTechnique.TCP_SYN, ] ) no_ping: bool = True diff --git a/ostorlab.yaml b/ostorlab.yaml index c287b54b..03cfc02f 100755 --- a/ostorlab.yaml +++ b/ostorlab.yaml @@ -83,7 +83,7 @@ args: - name: "fast_mode" description: "Fast mode scans fewer ports than the default mode." type: "boolean" - value: true + value: false - name: "ports" type: "string" description: "List of ports to scan." From a7bc6c32fe0720fc10740d76d8fd16cec4103628 Mon Sep 17 00:00:00 2001 From: Alaeddine Mesbahi Date: Fri, 9 Aug 2024 13:24:01 +0100 Subject: [PATCH 2/3] Change default to all ports with SYN scan. --- tests/nmap_wrapper_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/nmap_wrapper_test.py b/tests/nmap_wrapper_test.py index 5bb5380d..dcce9b96 100644 --- a/tests/nmap_wrapper_test.py +++ b/tests/nmap_wrapper_test.py @@ -35,7 +35,7 @@ def testNmapWrapper_whenFastMode_returnCommand( "-n", "-F", "-T3", - "-sT", + "-sS", "--script", "banner", "-sC", @@ -73,7 +73,7 @@ def testNmapWrapper_whenTopPortsUsed_returnCommand( "--top-ports", "420", "-T3", - "-sT", + "-sS", "--script", "banner", "-sC", @@ -111,7 +111,7 @@ def testNmapWrapper_whenAllTopPortsUsed_returnCommand( "-p", "0-65535", "-T3", - "-sT", + "-sS", "--script", "banner", "-sC", From 22328a8367f8814b2bcb834f53fbef11ff054dfb Mon Sep 17 00:00:00 2001 From: Alaeddine Mesbahi Date: Fri, 9 Aug 2024 13:48:47 +0100 Subject: [PATCH 3/3] Change default to all ports with SYN scan. --- tests/nmap_agent_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nmap_agent_test.py b/tests/nmap_agent_test.py index 951e3a5f..21042298 100644 --- a/tests/nmap_agent_test.py +++ b/tests/nmap_agent_test.py @@ -322,7 +322,7 @@ def testAgentNmapOptions_whenUrlsScriptsGivent_RunScan( assert all( a in options.command_options - for a in ["-sV", "-n", "-p", "0-65535", "-T3", "-sT", "-Pn", "--script"] + for a in ["-sV", "-n", "-p", "0-65535", "-T3", "-sS", "-Pn", "--script"] ) @@ -359,7 +359,7 @@ def testAgentNmapOptions_whenUrlsScriptsGivent_RunScan2( assert all( a in options.command_options - for a in ["-sV", "-n", "-p", "0-65535", "-T3", "-sT", "-Pn", "--script"] + for a in ["-sV", "-n", "-p", "0-65535", "-T3", "-sS", "-Pn", "--script"] )