自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

ssh_scan:遠(yuǎn)程驗(yàn)證你SSH服務(wù)的配置和策略

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

[[193169]]

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

ssh_scan 有如下好處:

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

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

如何在 Linux 上安裝 ssh_scan

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

使用 Ruby gem 來(lái)安裝運(yùn)行,如下:

  1. ----------- 在 Debian/Ubuntu -----------  
  2. $ sudo apt-get install ruby gem 
  3. $ sudo gem install ssh_scan 
  4. ----------- 在 CentOS/RHEL -----------  
  5. # yum install ruby rubygem 
  6. # gem install ssh_scan 

使用docker 容器來(lái)運(yùn)行,如下:

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

使用源碼安裝運(yùn)行,如下:

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

如何在 Linux 上使用 ssh_scan

使用 ssh_scan 的語(yǔ)法如下:

  1. $ ssh_scan -t ip地址 
  2. $ ssh_scan -t 主機(jī)名 

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

  1. $ ssh_scan -t 192.168.43.198 

注意你同時(shí)也可以像下方展示的給 -t 選項(xiàng)傳入一個(gè)[IP地址/地址段/主機(jī)名]:

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

輸出示例:

  1. I, [2017-05-09T10:36:17.913644 #7145]  INFO -- : You're using the latest version of ssh_scan 0.0.19 
  2.   { 
  3.     "ssh_scan_version""0.0.19"
  4.     "ip""192.168.43.198"
  5.     "port": 22, 
  6.     "server_banner""SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1"
  7.     "ssh_version": 2.0, 
  8.     "os""ubuntu"
  9.     "os_cpe""o:canonical:ubuntu:16.04"
  10.     "ssh_lib""openssh"
  11.     "ssh_lib_cpe""a:openssh:openssh:7.2p2"
  12.     "cookie""68b17bcca652eeaf153ed18877770a38"
  13.     "key_algorithms": [ 
  14.       "curve25519-sha256@libssh.org"
  15.       "ecdh-sha2-nistp256"
  16.       "ecdh-sha2-nistp384"
  17.       "ecdh-sha2-nistp521"
  18.       "diffie-hellman-group-exchange-sha256"
  19.       "diffie-hellman-group14-sha1" 
  20.     ], 
  21.     "server_host_key_algorithms": [ 
  22.       "ssh-rsa"
  23.       "rsa-sha2-512"
  24.       "rsa-sha2-256"
  25.       "ecdsa-sha2-nistp256"
  26.       "ssh-ed25519" 
  27.     ], 
  28.     "encryption_algorithms_client_to_server": [ 
  29.       "chacha20-poly1305@openssh.com"
  30.       "aes128-ctr"
  31.       "aes192-ctr"
  32.       "aes256-ctr"
  33.       "aes128-gcm@openssh.com"
  34.       "aes256-gcm@openssh.com" 
  35.     ], 
  36.     "encryption_algorithms_server_to_client": [ 
  37.       "chacha20-poly1305@openssh.com"
  38.       "aes128-ctr"
  39.       "aes192-ctr"
  40.       "aes256-ctr"
  41.       "aes128-gcm@openssh.com"
  42.       "aes256-gcm@openssh.com" 
  43.     ], 
  44.     "mac_algorithms_client_to_server": [ 
  45.       "umac-64-etm@openssh.com"
  46.       "umac-128-etm@openssh.com"
  47.       "hmac-sha2-256-etm@openssh.com"
  48.       "hmac-sha2-512-etm@openssh.com"
  49.       "hmac-sha1-etm@openssh.com"
  50.       "umac-64@openssh.com"
  51.       "umac-128@openssh.com"
  52.       "hmac-sha2-256"
  53.       "hmac-sha2-512"
  54.       "hmac-sha1" 
  55.     ], 
  56.     "mac_algorithms_server_to_client": [ 
  57.       "umac-64-etm@openssh.com"
  58.       "umac-128-etm@openssh.com"
  59.       "hmac-sha2-256-etm@openssh.com"
  60.       "hmac-sha2-512-etm@openssh.com"
  61.       "hmac-sha1-etm@openssh.com"
  62.       "umac-64@openssh.com"
  63.       "umac-128@openssh.com"
  64.       "hmac-sha2-256"
  65.       "hmac-sha2-512"
  66.       "hmac-sha1" 
  67.     ], 
  68.     "compression_algorithms_client_to_server": [ 
  69.       "none"
  70.       "zlib@openssh.com" 
  71.     ], 
  72.     "compression_algorithms_server_to_client": [ 
  73.       "none"
  74.       "zlib@openssh.com" 
  75.     ], 
  76.     "languages_client_to_server": [ 
  77.     ], 
  78.     "languages_server_to_client": [ 
  79.     ], 
  80.     "hostname""tecmint"
  81.     "auth_methods": [ 
  82.       "publickey"
  83.       "password" 
  84.     ], 
  85.     "fingerprints": { 
  86.       "rsa": { 
  87.         "known_bad""false"
  88.         "md5""0e:d0:d7:11:f0:9b:f8:33:9c:ab:26:77:e5:66:9e:f4"
  89.         "sha1""fc:8d:d5:a1:bf:52:48:a6:7e:f9:a6:2f:af:ca:e2:f0:3a:9a:b7:fa"
  90.         "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" 
  91.       } 
  92.     }, 
  93.     "start_time""2017-05-09 10:36:17 +0300"
  94.     "end_time""2017-05-09 10:36:18 +0300"
  95.     "scan_duration_seconds": 0.221573169, 
  96.     "duplicate_host_key_ips": [ 
  97.     ], 
  98.     "compliance": { 
  99.       "policy""Mozilla Modern"
  100.       "compliant"false
  101.       "recommendations": [ 
  102.         "Remove these Key Exchange Algos: diffie-hellman-group14-sha1"
  103.         "Remove these MAC Algos: umac-64-etm@openssh.com, hmac-sha1-etm@openssh.com, umac-64@openssh.com, hmac-sha1"
  104.         "Remove these Authentication Methods: password" 
  105.       ], 
  106.       "references": [ 
  107.         "https://wiki.mozilla.org/Security/Guidelines/OpenSSH" 
  108.       ] 
  109.     } 
  110.   } 

你可以使用 -p 選項(xiàng)來(lái)指定不同的端口,-L 選項(xiàng)來(lái)開(kāi)啟日志記錄配合 -V 選項(xiàng)來(lái)指定日志級(jí)別:

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

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

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

ssh_scan 使用幫助與其它示例: 

  1. $ ssh_scan -h 

輸出示例:

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

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

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

如果需要更詳細(xì)的信息可以訪問(wèn) ssh_scan 的 Github 倉(cāng)庫(kù):https://github.com/mozilla/ssh_scan

責(zé)任編輯:龐桂玉 來(lái)源: Linux中國(guó)
相關(guān)推薦

2011-09-09 13:28:01

Ubuntussh

2011-06-02 11:13:07

2010-03-10 11:31:31

2010-07-01 14:42:16

SSH協(xié)議

2010-06-28 09:46:17

2019-04-08 08:50:02

2021-09-29 11:46:05

遠(yuǎn)程服務(wù)器VSCode

2010-02-05 10:22:07

2014-05-21 13:39:56

ApacheSSH雙因子驗(yàn)證

2019-11-21 09:24:50

SSH服務(wù)器工具

2022-03-11 13:28:54

SSHLinux命令

2010-02-22 17:45:50

CentOS VSFT

2010-01-13 14:45:25

CentOS配置

2009-12-31 14:11:12

2010-07-02 14:37:20

配置SSH協(xié)議

2018-04-27 10:55:52

2023-02-21 10:07:23

2024-03-13 08:11:39

2018-09-20 09:12:16

2010-07-01 13:54:02

SSH協(xié)議
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)