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

fix(configtest,scan): support SSH config file #1388

Merged
merged 2 commits into from Feb 12, 2022

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Feb 11, 2022

What did you implement:

I would like to support the case where a user tries to scan vuls with the host written in SSH Config.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • /home/mainek00n/.ssh/config
Host vuls-target
    HostName 127.0.0.1
    Port 2222
    Identityfile ~/github/github.com/MaineK00n/vuls-targets-docker/.ssh/id_rsa
    Identitiesonly yes
    User root
    KexAlgorithms +diffie-hellman-group1-sha1

ssh(1) obtains configuration data from the following sources in the following order:
1. command-line options
2. user's configuration file (~/.ssh/config)
3. system-wide configuration file (/etc/ssh/ssh_config)

ref: https://man7.org/linux/man-pages/man5/ssh_config.5.html

When user, port, and keyPath are not specified

  • config.toml
[default]

[servers.vuls-target]
host                = "vuls-target"
scanMode           = ["fast"]
scanModules        = ["ospkg"]

master

It seems that user is always required.

$ vuls configtest -debug
[Feb 11 22:26:21]  INFO [localhost] vuls-v0.19.3-build-20220211_201157_671be3f
[Feb 11 22:26:21] ERROR [localhost] Error loading /home/mainek00n/github/github.com/MaineK00n/vuls/config.toml
If you update Vuls and get this error, there may be incompatible changes in config.toml
Please check config.toml template : https://vuls.io/docs/en/usage-settings.html
Failed to set default value to config. server: vuls-target, err:
    github.com/future-architect/vuls/config.TOMLLoader.Load
        /home/mainek00n/go/src/github.com/future-architect/vuls/config/tomlloader.go:39
  - server.user is empty:
    github.com/future-architect/vuls/config.setDefaultIfEmpty
        /home/mainek00n/go/src/github.com/future-architect/vuls/config/tomlloader.go:162

MaineK00n/support-ssh-config

The user, port, and keypath information are all from ssh config, so they are not necessary.
Also, even if user and port are empty, they are set from the ssh settings. In this case, user = root and port = 2222.

$ vuls configtest -debug
[Feb 11 22:29:53]  INFO [localhost] vuls-v0.19.3-build-20220211_222448_c0c4e66
[Feb 11 22:29:53]  INFO [localhost] Validating config...
[Feb 11 22:29:53]  INFO [localhost] Detecting Server/Container OS... 
[Feb 11 22:29:53]  INFO [localhost] Detecting OS of servers... 
[Feb 11 22:29:53] DEBUG [localhost] Validating SSH Settings for Server:vuls-target ...
[Feb 11 22:29:53] DEBUG [localhost] Executing... /usr/bin/ssh -G vuls-target
[Feb 11 22:29:53] DEBUG [localhost] Setting SSH User:root for Server:vuls-target ...
[Feb 11 22:29:53] DEBUG [localhost] Validating SSH HostName:127.0.0.1 for Server:vuls-target ...
[Feb 11 22:29:53] DEBUG [localhost] Setting SSH Port:2222 for Server:vuls-target ...
[Feb 11 22:29:53] DEBUG [localhost] Checking if the host's public key is in known_hosts...
[Feb 11 22:29:53] DEBUG [localhost] Executing... /usr/bin/ssh-keygen -F "[127.0.0.1]:2222" -f ~/.ssh/known_hosts
[Feb 11 22:29:53] DEBUG [localhost] Executing... ls /etc/debian_version
[Feb 11 22:29:53] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/debian_version
  exitstatus: 2
  stdout: ls: cannot access '/etc/debian_version': No such file or directory

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:29:53] DEBUG [localhost] Not Debian like Linux. execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/debian_version
  exitstatus: 2
  stdout: ls: cannot access '/etc/debian_version': No such file or directory

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:29:53] DEBUG [localhost] Executing... ls /etc/fedora-release
[Feb 11 22:29:53] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/fedora-release
  exitstatus: 0
  stdout: /etc/fedora-release

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:29:53] DEBUG [localhost] Executing... cat /etc/fedora-release
[Feb 11 22:29:53] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; cat /etc/fedora-release
  exitstatus: 0
  stdout: Fedora release 35 (Thirty Five)

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:29:53] DEBUG [localhost] Redhat like Linux. Host: vuls-target:2222
[Feb 11 22:29:53]  INFO [localhost] (1/1) Detected: vuls-target: fedora 35
[Feb 11 22:29:53]  INFO [localhost] Detecting OS of containers... 
[Feb 11 22:29:53]  INFO [localhost] Checking Scan Modes...
[Feb 11 22:29:53]  INFO [localhost] Checking dependencies...
[Feb 11 22:29:53]  INFO [vuls-target] Dependencies ... Pass
[Feb 11 22:29:53]  INFO [localhost] Checking sudo settings...
[Feb 11 22:29:53]  INFO [vuls-target] Sudo... Pass
[Feb 11 22:29:53]  INFO [localhost] It can be scanned with fast scan mode even if warn or err messages are displayed due to lack of dependent packages or sudo settings in fast-root or deep scan mode
[Feb 11 22:29:53]  INFO [localhost] Scannable servers are below...
vuls-target

When port, and keyPath are not specified

  • config.toml
[default]

[servers.vuls-target]
host                = "vuls-target"
user                = "root"
scanMode           = ["fast"]
scanModules        = ["ospkg"]

master

$ vuls configtest -debug
[Feb 11 22:31:17]  INFO [localhost] vuls-v0.19.3-build-20220211_201157_671be3f
[Feb 11 22:31:17]  INFO [localhost] Validating config...
[Feb 11 22:31:17]  INFO [localhost] Detecting Server/Container OS... 
[Feb 11 22:31:17]  INFO [localhost] Detecting OS of servers... 
[Feb 11 22:31:17] ERROR [localhost] (1/1) Failed: vuls-target, err: [Failed to find the host in known_hosts. Plaese exec `$ ssh -i  root@vuls-target` or `$ ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts`:
    github.com/future-architect/vuls/scanner.checkHostinKnownHosts
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:395]
[Feb 11 22:31:17] ERROR [localhost] Failed to configtest: Failed to init servers. err:
    github.com/future-architect/vuls/scanner.Scanner.Configtest
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:114
  - No scannable host OS:
    github.com/future-architect/vuls/scanner.Scanner.initServers
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:250

MaineK00n/support-ssh-config

$ vuls configtest -debug
[Feb 11 22:31:50]  INFO [localhost] vuls-v0.19.3-build-20220211_222448_c0c4e66
[Feb 11 22:31:50]  INFO [localhost] Validating config...
[Feb 11 22:31:50]  INFO [localhost] Detecting Server/Container OS... 
[Feb 11 22:31:50]  INFO [localhost] Detecting OS of servers... 
[Feb 11 22:31:50] DEBUG [localhost] Validating SSH Settings for Server:vuls-target ...
[Feb 11 22:31:50] DEBUG [localhost] Executing... /usr/bin/ssh -G -l root vuls-target
[Feb 11 22:31:50] DEBUG [localhost] Setting SSH User:root for Server:vuls-target ...
[Feb 11 22:31:50] DEBUG [localhost] Validating SSH HostName:127.0.0.1 for Server:vuls-target ...
[Feb 11 22:31:50] DEBUG [localhost] Setting SSH Port:2222 for Server:vuls-target ...
[Feb 11 22:31:50] DEBUG [localhost] Checking if the host's public key is in known_hosts...
[Feb 11 22:31:50] DEBUG [localhost] Executing... /usr/bin/ssh-keygen -F "[127.0.0.1]:2222" -f ~/.ssh/known_hosts
[Feb 11 22:31:50] DEBUG [localhost] Executing... ls /etc/debian_version
[Feb 11 22:31:50] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/debian_version
  exitstatus: 2
  stdout: ls: cannot access '/etc/debian_version': No such file or directory

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:31:50] DEBUG [localhost] Not Debian like Linux. execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/debian_version
  exitstatus: 2
  stdout: ls: cannot access '/etc/debian_version': No such file or directory

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:31:50] DEBUG [localhost] Executing... ls /etc/fedora-release
[Feb 11 22:31:50] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/fedora-release
  exitstatus: 0
  stdout: /etc/fedora-release

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:31:50] DEBUG [localhost] Executing... cat /etc/fedora-release
[Feb 11 22:31:50] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; cat /etc/fedora-release
  exitstatus: 0
  stdout: Fedora release 35 (Thirty Five)

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:31:50] DEBUG [localhost] Redhat like Linux. Host: vuls-target:2222
[Feb 11 22:31:50]  INFO [localhost] (1/1) Detected: vuls-target: fedora 35
[Feb 11 22:31:50]  INFO [localhost] Detecting OS of containers... 
[Feb 11 22:31:50]  INFO [localhost] Checking Scan Modes...
[Feb 11 22:31:50]  INFO [localhost] Checking dependencies...
[Feb 11 22:31:50]  INFO [vuls-target] Dependencies ... Pass
[Feb 11 22:31:50]  INFO [localhost] Checking sudo settings...
[Feb 11 22:31:50]  INFO [vuls-target] Sudo... Pass
[Feb 11 22:31:50]  INFO [localhost] It can be scanned with fast scan mode even if warn or err messages are displayed due to lack of dependent packages or sudo settings in fast-root or deep scan mode
[Feb 11 22:31:50]  INFO [localhost] Scannable servers are below...
vuls-target

When port is not specified

  • config.toml
[default]

[servers.vuls-target]
host                = "vuls-target"
user                = "root"
keyPath            = "/home/mainek00n/github/github.com/MaineK00n/vuls-targets-docker/.ssh/id_rsa"
scanMode           = ["fast"]
scanModules        = ["ospkg"]

master

The port will always be set to the default value or 22, and it will look for known_hosts on that port.
The actual port to be used this time is 2222.

vuls/config/tomlloader.go

Lines 152 to 156 in 671be3f

if Conf.Default.Port != "" {
server.Port = Conf.Default.Port
} else {
server.Port = "22"
}

$ vuls configtest -debug
[Feb 11 22:32:58]  INFO [localhost] vuls-v0.19.3-build-20220211_201157_671be3f
[Feb 11 22:32:58]  INFO [localhost] Validating config...
[Feb 11 22:32:58]  INFO [localhost] Detecting Server/Container OS... 
[Feb 11 22:32:58]  INFO [localhost] Detecting OS of servers... 
[Feb 11 22:32:58] ERROR [localhost] (1/1) Failed: vuls-target, err: [Failed to find the host in known_hosts. Plaese exec `$ ssh -i /home/mainek00n/github/github.com/MaineK00n/vuls-targets-docker/.ssh/id_rsa root@vuls-target` or `$ ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts`:
    github.com/future-architect/vuls/scanner.checkHostinKnownHosts
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:395]
[Feb 11 22:32:58] ERROR [localhost] Failed to configtest: Failed to init servers. err:
    github.com/future-architect/vuls/scanner.Scanner.Configtest
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:114
  - No scannable host OS:
    github.com/future-architect/vuls/scanner.Scanner.initServers
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:250

MaineK00n/support-ssh-config

$ vuls configtest -debug
[Feb 11 22:33:33]  INFO [localhost] vuls-v0.19.3-build-20220211_222448_c0c4e66
[Feb 11 22:33:33]  INFO [localhost] Validating config...
[Feb 11 22:33:33]  INFO [localhost] Detecting Server/Container OS... 
[Feb 11 22:33:33]  INFO [localhost] Detecting OS of servers... 
[Feb 11 22:33:33] DEBUG [localhost] Validating SSH Settings for Server:vuls-target ...
[Feb 11 22:33:33] DEBUG [localhost] Executing... /usr/bin/ssh -G -l root vuls-target
[Feb 11 22:33:33] DEBUG [localhost] Setting SSH User:root for Server:vuls-target ...
[Feb 11 22:33:33] DEBUG [localhost] Validating SSH HostName:127.0.0.1 for Server:vuls-target ...
[Feb 11 22:33:33] DEBUG [localhost] Setting SSH Port:2222 for Server:vuls-target ...
[Feb 11 22:33:33] DEBUG [localhost] Checking if the host's public key is in known_hosts...
[Feb 11 22:33:33] DEBUG [localhost] Executing... /usr/bin/ssh-keygen -F "[127.0.0.1]:2222" -f ~/.ssh/known_hosts
[Feb 11 22:33:33] DEBUG [localhost] Executing... ls /etc/debian_version
[Feb 11 22:33:33] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 -i /home/mainek00n/github/github.com/MaineK00n/vuls-targets-docker/.ssh/id_rsa -o PasswordAuthentication=no vuls-target stty cols 1000; ls /etc/debian_version
  exitstatus: 2
  stdout: ls: cannot access '/etc/debian_version': No such file or directory

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:33:33] DEBUG [localhost] Not Debian like Linux. execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 -i /home/mainek00n/github/github.com/MaineK00n/vuls-targets-docker/.ssh/id_rsa -o PasswordAuthentication=no vuls-target stty cols 1000; ls /etc/debian_version
  exitstatus: 2
  stdout: ls: cannot access '/etc/debian_version': No such file or directory

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:33:33] DEBUG [localhost] Executing... ls /etc/fedora-release
[Feb 11 22:33:33] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 -i /home/mainek00n/github/github.com/MaineK00n/vuls-targets-docker/.ssh/id_rsa -o PasswordAuthentication=no vuls-target stty cols 1000; ls /etc/fedora-release
  exitstatus: 0
  stdout: /etc/fedora-release

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:33:33] DEBUG [localhost] Executing... cat /etc/fedora-release
[Feb 11 22:33:33] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 -i /home/mainek00n/github/github.com/MaineK00n/vuls-targets-docker/.ssh/id_rsa -o PasswordAuthentication=no vuls-target stty cols 1000; cat /etc/fedora-release
  exitstatus: 0
  stdout: Fedora release 35 (Thirty Five)

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:33:33] DEBUG [localhost] Redhat like Linux. Host: vuls-target:2222
[Feb 11 22:33:33]  INFO [localhost] (1/1) Detected: vuls-target: fedora 35
[Feb 11 22:33:33]  INFO [localhost] Detecting OS of containers... 
[Feb 11 22:33:33]  INFO [localhost] Checking Scan Modes...
[Feb 11 22:33:33]  INFO [localhost] Checking dependencies...
[Feb 11 22:33:33]  INFO [vuls-target] Dependencies ... Pass
[Feb 11 22:33:33]  INFO [localhost] Checking sudo settings...
[Feb 11 22:33:33]  INFO [vuls-target] Sudo... Pass
[Feb 11 22:33:33]  INFO [localhost] It can be scanned with fast scan mode even if warn or err messages are displayed due to lack of dependent packages or sudo settings in fast-root or deep scan mode
[Feb 11 22:33:33]  INFO [localhost] Scannable servers are below...
vuls-target

When keyPath is not specified

  • config.toml
[default]

[servers.vuls-target]
host                = "vuls-target"
user                = "root"
port                 = "2222"
scanMode           = ["fast"]
scanModules        = ["ospkg"]

master

c.Host does not resolve names, so it is necessary to use hostname.
https://github.com/future-architect/vuls/blob/master/scanner/serverapi.go#L378
https://github.com/future-architect/vuls/blob/master/scanner/serverapi.go#L383

$ vuls configtest -debug
[Feb 11 22:36:47]  INFO [localhost] vuls-v0.19.3-build-20220211_201157_671be3f
[Feb 11 22:36:47]  INFO [localhost] Validating config...
[Feb 11 22:36:47]  INFO [localhost] Detecting Server/Container OS... 
[Feb 11 22:36:47]  INFO [localhost] Detecting OS of servers... 
[Feb 11 22:36:47] ERROR [localhost] (1/1) Failed: vuls-target, err: [Failed to find the host in known_hosts. Plaese exec `$ ssh -i  -p 2222 root@vuls-target` or `$ ssh-keyscan -H -p 2222 127.0.0.1 >> ~/.ssh/known_hosts`:
    github.com/future-architect/vuls/scanner.checkHostinKnownHosts
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:395]
[Feb 11 22:36:47] ERROR [localhost] Failed to configtest: Failed to init servers. err:
    github.com/future-architect/vuls/scanner.Scanner.Configtest
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:114
  - No scannable host OS:
    github.com/future-architect/vuls/scanner.Scanner.initServers
        /home/mainek00n/go/src/github.com/future-architect/vuls/scanner/serverapi.go:250

MaineK00n/support-ssh-config

$ vuls configtest -debug
[Feb 11 22:38:49]  INFO [localhost] vuls-v0.19.3-build-20220211_222448_c0c4e66
[Feb 11 22:38:49]  INFO [localhost] Validating config...
[Feb 11 22:38:49]  INFO [localhost] Detecting Server/Container OS... 
[Feb 11 22:38:49]  INFO [localhost] Detecting OS of servers... 
[Feb 11 22:38:49] DEBUG [localhost] Validating SSH Settings for Server:vuls-target ...
[Feb 11 22:38:49] DEBUG [localhost] Executing... /usr/bin/ssh -G -p 2222 -l root vuls-target
[Feb 11 22:38:49] DEBUG [localhost] Setting SSH User:root for Server:vuls-target ...
[Feb 11 22:38:49] DEBUG [localhost] Validating SSH HostName:127.0.0.1 for Server:vuls-target ...
[Feb 11 22:38:49] DEBUG [localhost] Setting SSH Port:2222 for Server:vuls-target ...
[Feb 11 22:38:49] DEBUG [localhost] Checking if the host's public key is in known_hosts...
[Feb 11 22:38:49] DEBUG [localhost] Executing... /usr/bin/ssh-keygen -F "[127.0.0.1]:2222" -f ~/.ssh/known_hosts
[Feb 11 22:38:49] DEBUG [localhost] Executing... ls /etc/debian_version
[Feb 11 22:38:49] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/debian_version
  exitstatus: 2
  stdout: ls: cannot access '/etc/debian_version': No such file or directory

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:38:49] DEBUG [localhost] Not Debian like Linux. execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/debian_version
  exitstatus: 2
  stdout: ls: cannot access '/etc/debian_version': No such file or directory

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:38:49] DEBUG [localhost] Executing... ls /etc/fedora-release
[Feb 11 22:38:49] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; ls /etc/fedora-release
  exitstatus: 0
  stdout: /etc/fedora-release

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:38:49] DEBUG [localhost] Executing... cat /etc/fedora-release
[Feb 11 22:38:49] DEBUG [localhost] execResult: servername: vuls-target
  cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPath=/home/mainek00n/.vuls/controlmaster-%r-vuls-target.%p -o Controlpersist=10m -l root -p 2222 vuls-target stty cols 1000; cat /etc/fedora-release
  exitstatus: 0
  stdout: Fedora release 35 (Thirty Five)

  stderr: 
  err: %!s(<nil>)
[Feb 11 22:38:49] DEBUG [localhost] Redhat like Linux. Host: vuls-target:2222
[Feb 11 22:38:49]  INFO [localhost] (1/1) Detected: vuls-target: fedora 35
[Feb 11 22:38:49]  INFO [localhost] Detecting OS of containers... 
[Feb 11 22:38:49]  INFO [localhost] Checking Scan Modes...
[Feb 11 22:38:49]  INFO [localhost] Checking dependencies...
[Feb 11 22:38:49]  INFO [vuls-target] Dependencies ... Pass
[Feb 11 22:38:49]  INFO [localhost] Checking sudo settings...
[Feb 11 22:38:49]  INFO [vuls-target] Sudo... Pass
[Feb 11 22:38:49]  INFO [localhost] It can be scanned with fast scan mode even if warn or err messages are displayed due to lack of dependent packages or sudo settings in fast-root or deep scan mode
[Feb 11 22:38:49]  INFO [localhost] Scannable servers are below...
vuls-target

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n MaineK00n self-assigned this Feb 11, 2022
@MaineK00n MaineK00n marked this pull request as ready for review February 11, 2022 13:50
@MaineK00n MaineK00n force-pushed the MaineK00n/support-ssh-config branch 2 times, most recently from 9cf50a5 to dff57f5 Compare February 11, 2022 14:00
@kotakanbe kotakanbe merged commit 0733561 into master Feb 12, 2022
@kotakanbe kotakanbe deleted the MaineK00n/support-ssh-config branch February 12, 2022 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants