日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
ssh_scan:遠(yuǎn)程驗證你SSH服務(wù)的配置和策略

ssh_scan 是一個面向 Linux 和 UNIX 服務(wù)器的易用的 SSH 服務(wù)參數(shù)配置和策略的掃描器程序,其思路來自Mozilla OpenSSH 安全指南,這個指南為 SSH 服務(wù)參數(shù)配置提供了一個可靠的安全策略基線的建議,如加密算法(Ciphers),報文認(rèn)證信息碼算法(MAC),密鑰交換算法(KexAlgos)和其它。

目前創(chuàng)新互聯(lián)公司已為1000+的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)站空間、網(wǎng)站托管、服務(wù)器托管、企業(yè)網(wǎng)站設(shè)計、秦淮網(wǎng)站維護等服務(wù),公司將堅持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。

ssh_scan 有如下好處:

  • 它的依賴是最小化的,ssh_scan 只引入了本地 Ruby 和 BinData 來進行它的工作,沒有太多的依賴。
  • 它是可移植的,你可以在其它的項目中使用 ssh_scan 或者將它用在自動化任務(wù)上。
  • 它是易于使用的,只需要簡單的將它指向一個 SSH 服務(wù)就可以獲得一個該服務(wù)所支持的選項和策略狀態(tài)的 JSON 格式報告。
  • 它同時也是易于配置的,你可以創(chuàng)建適合你策略需求的策略。

建議閱讀: 如何在 Linux 上安裝配置 OpenSSH 服務(wù)

如何在 Linux 上安裝 ssh_scan

有如下三種安裝 ssh_scan 的方式:

使用 Ruby gem 來安裝運行,如下:

----------- 在 Debian/Ubuntu ----------- 
$ sudo apt-get install rubygems
$ sudo gem install ssh_scan
----------- 在 CentOS/RHEL ----------- 
# yum install ruby rubygems
# gem install ssh_scan

使用docker 容器來運行,如下:

# docker pull mozilla/ssh_scan
# docker run -it mozilla/ssh_scan /app/bin/ssh_scan -t github.com

使用源碼安裝運行,如下:

# git clone https://github.com/mozilla/ssh_scan.git
# cd ssh_scan
# gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
# curl -sSL https://get.rvm.io | bash -s stable
# rvm install 2.3.1
# rvm use 2.3.1
# gem install bundler
# bundle install
# ./bin/ssh_scan

如何在 Linux 上使用 ssh_scan

使用 ssh_scan 的語法如下:

$ ssh_scan -t ip地址
$ ssh_scan -t 主機名

舉個例子來掃描 192.168.43.198 這臺服務(wù)器的 SSH 配置和策略,鍵入:

$ ssh_scan -t 192.168.43.198

注意你同時也可以像下方展示的給 -t 選項傳入一個[IP地址/地址段/主機名]:

$ ssh_scan -t 192.168.43.198,200,205
$ ssh_scan -t test.tecmint.lan

輸出示例:

I, [2017-05-09T10:36:17.913644 #7145]  INFO -- : You're using the latest version of ssh_scan 0.0.19
[
  {
    "ssh_scan_version": "0.0.19",
    "ip": "192.168.43.198",
    "port": 22,
    "server_banner": "SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1",
    "ssh_version": 2.0,
    "os": "ubuntu",
    "os_cpe": "o:canonical:ubuntu:16.04",
    "ssh_lib": "openssh",
    "ssh_lib_cpe": "a:openssh:openssh:7.2p2",
    "cookie": "68b17bcca652eeaf153ed18877770a38",
    "key_algorithms": [
      "curve25519-sha256@libssh.org",
      "ecdh-sha2-nistp256",
      "ecdh-sha2-nistp384",
      "ecdh-sha2-nistp521",
      "diffie-hellman-group-exchange-sha256",
      "diffie-hellman-group14-sha1"
    ],
    "server_host_key_algorithms": [
      "ssh-rsa",
      "rsa-sha2-512",
      "rsa-sha2-256",
      "ecdsa-sha2-nistp256",
      "ssh-ed25519"
    ],
    "encryption_algorithms_client_to_server": [
      "chacha20-poly1305@openssh.com",
      "aes128-ctr",
      "aes192-ctr",
      "aes256-ctr",
      "aes128-gcm@openssh.com",
      "aes256-gcm@openssh.com"
    ],
    "encryption_algorithms_server_to_client": [
      "chacha20-poly1305@openssh.com",
      "aes128-ctr",
      "aes192-ctr",
      "aes256-ctr",
      "aes128-gcm@openssh.com",
      "aes256-gcm@openssh.com"
    ],
    "mac_algorithms_client_to_server": [
      "umac-64-etm@openssh.com",
      "umac-128-etm@openssh.com",
      "hmac-sha2-256-etm@openssh.com",
      "hmac-sha2-512-etm@openssh.com",
      "hmac-sha1-etm@openssh.com",
      "umac-64@openssh.com",
      "umac-128@openssh.com",
      "hmac-sha2-256",
      "hmac-sha2-512",
      "hmac-sha1"
    ],
    "mac_algorithms_server_to_client": [
      "umac-64-etm@openssh.com",
      "umac-128-etm@openssh.com",
      "hmac-sha2-256-etm@openssh.com",
      "hmac-sha2-512-etm@openssh.com",
      "hmac-sha1-etm@openssh.com",
      "umac-64@openssh.com",
      "umac-128@openssh.com",
      "hmac-sha2-256",
      "hmac-sha2-512",
      "hmac-sha1"
    ],
    "compression_algorithms_client_to_server": [
      "none",
      "zlib@openssh.com"
    ],
    "compression_algorithms_server_to_client": [
      "none",
      "zlib@openssh.com"
    ],
    "languages_client_to_server": [
    ],
    "languages_server_to_client": [
    ],
    "hostname": "tecmint",
    "auth_methods": [
      "publickey",
      "password"
    ],
    "fingerprints": {
      "rsa": {
        "known_bad": "false",
        "md5": "0e:d0:d7:11:f0:9b:f8:33:9c:ab:26:77:e5:66:9e:f4",
        "sha1": "fc:8d:d5:a1:bf:52:48:a6:7e:f9:a6:2f:af:ca:e2:f0:3a:9a:b7:fa",
        "sha256": "ff:00:b4:a4:40:05:19:27:7c:33:aa:db:a6:96:32:88:8e:bf:05:a1:81:c0:a4:a8:16:01:01:0b:20:37:81:11"
      }
    },
    "start_time": "2017-05-09 10:36:17 +0300",
    "end_time": "2017-05-09 10:36:18 +0300",
    "scan_duration_seconds": 0.221573169,
    "duplicate_host_key_ips": [
    ],
    "compliance": {
      "policy": "Mozilla Modern",
      "compliant": false,
      "recommendations": [
        "Remove these Key Exchange Algos: diffie-hellman-group14-sha1",
        "Remove these MAC Algos: umac-64-etm@openssh.com, hmac-sha1-etm@openssh.com, umac-64@openssh.com, hmac-sha1",
        "Remove these Authentication Methods: password"
      ],
      "references": [
        "https://wiki.mozilla.org/Security/Guidelines/OpenSSH"
      ]
    }
  }
]

你可以使用 -p 選項來指定不同的端口,-L 選項來開啟日志記錄配合 -V 選項來指定日志級別:

$ ssh_scan -t 192.168.43.198 -p 22222 -L ssh-scan.log -V INFO

另外,可以使用 -P--policy 選項來指定一個策略文件(默認(rèn)是 Mozilla Modern)(LCTT 譯注:這里的 Modern 可能指的是 https://wiki.mozilla.org/Security/Server_Side_TLS 中提到的 Modern compatibility ):

$ ssh_scan -t 192.168.43.198 -L ssh-scan.log -V INFO -P /path/to/custom/policy/file

ssh_scan 使用幫助與其它示例:

$ ssh_scan -h

輸出示例:

ssh_scan v0.0.17 (https://github.com/mozilla/ssh_scan)
Usage: ssh_scan [options]
-t, --target [IP/Range/Hostname] IP/Ranges/Hostname to scan
-f, --file [FilePath]            File Path of the file containing IP/Range/Hostnames to scan
-T, --timeout [seconds]          Timeout per connect after which ssh_scan gives up on the host
-L, --logger [Log File Path]     Enable logger
-O, --from_json [FilePath]       File to read JSON output from
-o, --output [FilePath]          File to write JSON output to
-p, --port [PORT]                Port (Default: 22)
-P, --policy [FILE]              Custom policy file (Default: Mozilla Modern)
--threads [NUMBER]           Number of worker threads (Default: 5)
--fingerprint-db [FILE]      File location of fingerprint database (Default: ./fingerprints.db)
--suppress-update-status     Do not check for updates
-u, --unit-test [FILE]           Throw appropriate exit codes based on compliance status
-V [STD_LOGGING_LEVEL],
--verbosity
-v, --version                    Display just version info
-h, --help                       Show this message
Examples:
ssh_scan -t 192.168.1.1
ssh_scan -t server.example.com
ssh_scan -t ::1
ssh_scan -t ::1 -T 5
ssh_scan -f hosts.txt
ssh_scan -o output.json
ssh_scan -O output.json -o rescan_output.json
ssh_scan -t 192.168.1.1 -p 22222
ssh_scan -t 192.168.1.1 -p 22222 -L output.log -V INFO
ssh_scan -t 192.168.1.1 -P custom_policy.yml
ssh_scan -t 192.168.1.1 --unit-test -P custom_policy.yml

SSH 服務(wù)器相關(guān)參考閱讀:

  1. 使用 SSH Keygen(ssh-keygen)五步實現(xiàn) SSH 免密登錄
  2. 安全 SSH 服務(wù)器的 5 個最佳實踐
  3. 使用 Chroot 來限制 SSH 用戶進入某些目錄
  4. 如何配置 SSH 連接來簡化遠(yuǎn)程登錄

如果需要更詳細(xì)的信息可以訪問 ssh_scan 的 Github 倉庫:https://github.com/mozilla/ssh_scan


Aaron Kili 是 Linux 與 F.O.S.S (自由及開源軟件)愛好者,一位將來的 Linux 系統(tǒng)管理員,網(wǎng)站開發(fā)者,現(xiàn)在是一個熱愛與計算機一起工作并且擁有強烈知識分信念的 TecMint 內(nèi)容貢獻(xiàn)者。



網(wǎng)頁題目:ssh_scan:遠(yuǎn)程驗證你SSH服務(wù)的配置和策略
URL鏈接:http://www.dlmjj.cn/article/cddcghi.html