Skip to content

Instantly share code, notes, and snippets.

@GitSumito
Last active December 26, 2017 11:40
Show Gist options
  • Save GitSumito/a1bfb029471f6c7674a352a9e5284b75 to your computer and use it in GitHub Desktop.
Save GitSumito/a1bfb029471f6c7674a352a9e5284b75 to your computer and use it in GitHub Desktop.
VulsをDockerで構築したけどHostKeyを登録しろと永遠言われる問題 ref: https://qiita.com/S-T/items/33d2a9d67fd8ccb40879
[Dec 26 09:28:48] ERROR [localhost] (5/5) Failed: SERVER, err: [Failed to detect OS: Unable to connect via SSH. Check SSH settings. If you have never SSH to the host to be scanned, SSH to the host before scanning in order to add the HostKey. [email protected] port: 22
execResult: servername: SERVER
cmd: /usr/bin/ssh -tt -o StrictHostKeyChecking=yes -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none [email protected] -p 22 -i /root/.ssh/id_rsa_vuls -o PasswordAuthentication=no stty cols 1000; ls /etc/debian_version
exitstatus: 255
stdout:
stderr:
err: %!s(<nil>)]
$ docker run --rm -it -v ~/.ssh:/root/.ssh:ro -v $PWD:/vuls -v $PWD/vuls-log:/var/log/vuls vuls/vuls configtest -config=./config.toml --debug
(略)
o SERVER, err: dial tcp 172.17.2.62:22: getsockopt: no route to host, Retrying in 3.749548963s...
[Dec 26 09:37:36] DEBUG [localhost] Failed to Dial to SERVER, err: dial tcp 172.17.2.61:22: getsockopt: no route to host, Retrying in 5.535907099s...
# docker network ls
NETWORK ID NAME DRIVER SCOPE
ae5bb0c38a2c bridge bridge local
dd1c38f5429e host host local
6519945407d0 none null local
#
$ docker network inspect ae5bb0c38a2c
[
{
"Name": "bridge",
(略)
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
},
# vi /usr/lib/systemd/system/docker.service
(略)
[Service]
(略)
#ExecStart=/usr/bin/dockerd
ExecStart=/usr/bin/dockerd --bip=10.0.0.1/8
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default GATEWAY 0.0.0.0 UG 100 0 0 eth0
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 docker0
$ docker run --rm -it -v ~/.ssh:/root/.ssh:ro -v $PWD:/vuls -v $PWD/vuls-log:/var/log/vuls vuls/vuls scan -config=./config.toml
(略)
(5/5) Detected: SERVER: centos 7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment