Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op_mode: T6181: A feature for checking ports #4038

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

natali-rs1985
Copy link
Contributor

@natali-rs1985 natali-rs1985 commented Sep 9, 2024

Change Summary

Added op mode command to scan specific host for open ports

execute port-scan host <target> [ <Options> ]

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

op_mode: execute port-scan

Proposed changes

How to test

op mode command:

vyos@vyos:~$ execute port-scan host 192.0.2.2
Starting Nmap 7.93 ( https://nmap.org ) at 2024-09-05 08:18 UTC
Nmap scan report for 192.0.2.2
Host is up (0.0018s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT    STATE SERVICE
22/tcp  open  ssh
443/tcp open  https

Nmap done: 1 IP address (1 host up) scanned in 17.84 seconds

With options:

vyos@vyos:~$ execute port-scan host 192.0.2.2
Possible completions:
  <Enter>               Execute the current command
  ipv6                  Port scan options
  port
  skip-ping
  tcp
  udp

vyos@vyos:~$ execute port-scan host 192.0.2.2 skip-ping tcp port 22,100-105,440-450
Starting Nmap 7.93 ( https://nmap.org ) at 2024-09-05 08:20 UTC
Nmap scan report for 192.0.2.2
Host is up (0.0010s latency).

PORT    STATE  SERVICE
22/tcp  open   ssh
100/tcp closed newacct
101/tcp closed hostname
102/tcp closed iso-tsap
103/tcp closed gppitnp
104/tcp closed acr-nema
105/tcp closed csnet-ns
440/tcp closed sgcp
441/tcp closed decvms-sysmgt
442/tcp closed cvc_hostd
443/tcp open   https
444/tcp closed snpp
445/tcp closed microsoft-ds
446/tcp closed ddm-rdb
447/tcp closed ddm-dfm
448/tcp closed ddm-ssl
449/tcp closed as-servermap
450/tcp closed tserver

Nmap done: 1 IP address (1 host up) scanned in 13.04 seconds

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Sep 9, 2024

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Sep 9, 2024

✅ No issues found in unused-imports check.. Please refer the workflow run

<interfaceDefinition>
<node name="execute">
<properties>
<help>Initiate an operation</help>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic node settings like this should only be in its top-level template, we shouldn't duplicate them.

@@ -1,8 +0,0 @@
<?xml version="1.0"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave the file so that other execute commands can reuse it.

@natali-rs1985 natali-rs1985 force-pushed the T6181-current branch 2 times, most recently from 93a0918 to e0df958 Compare September 9, 2024 15:34
@dmbaturin dmbaturin merged commit 5729112 into vyos:current Sep 10, 2024
12 of 14 checks passed
@dmbaturin
Copy link
Member

@Mergifyio backport circinus

Copy link

mergify bot commented Sep 10, 2024

backport circinus

✅ Backports have been created

c-po added a commit that referenced this pull request Sep 11, 2024
op_mode: T6181: A feature for checking ports (backport #4038)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants