2024-02-08 04:49:53 +00:00
# 22 - SSH/SFTPのペンテスト
2022-04-28 16:01:33 +00:00
< details >
2024-02-18 14:52:15 +00:00
< summary > < strong > htARTE( HackTricks AWS Red Team Expert) < / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > でAWSハッキングをゼロからヒーローまで学ぶ< / strong > < / a > < strong > ! < / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-02-08 04:49:53 +00:00
HackTricksをサポートする他の方法:
2024-01-03 00:54:19 +00:00
2024-02-18 14:52:15 +00:00
- **HackTricksで企業を宣伝したい**または**HackTricksをPDFでダウンロードしたい**場合は、[**SUBSCRIPTION PLANS** ](https://github.com/sponsors/carlospolop )をチェックしてください!
2024-02-09 09:15:30 +00:00
- [**公式PEASS& HackTricksのグッズ** ](https://peass.creator-spring.com )を入手する
2024-02-18 14:52:15 +00:00
- [**The PEASS Family** ](https://opensea.io/collection/the-peass-family )を発見し、独占的な[**NFTs** ](https://opensea.io/collection/the-peass-family )のコレクションを見つける
- **💬 [Discordグループ ](https://discord.gg/hRep4RUj7f )**に参加するか、[telegramグループ ](https://t.me/peass )に参加するか、**Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks\_live )をフォローする
- **HackTricks**および**HackTricks Cloud**のGitHubリポジトリにPRを提出して、**あなたのハッキングテクニックを共有**してください。
2022-04-28 16:01:33 +00:00
< / details >
2024-02-18 14:52:15 +00:00
< figure > < img src = "../.gitbook/assets/i3.png" alt = "" > < figcaption > < / figcaption > < / figure >
2022-05-24 00:07:19 +00:00
2024-02-18 14:52:15 +00:00
**バグバウンティのヒント**: **ハッカーによって作成されたプレミアムなバグバウンティプラットフォーム**である**Intigriti**に**サインアップ**してください!今すぐ[**https://go.intigriti.com/hacktricks** ](https://go.intigriti.com/hacktricks )に参加して、最大**$100,000**のバウンティを獲得し始めましょう!
{% embed url="https://go.intigriti.com/hacktricks" %}
## 基本情報
**SSH( Secure ShellまたはSecure Socket Shell) **は、セキュアな接続を可能にするネットワークプロトコルであり、セキュリティのないネットワーク経由でコンピュータに安全に接続することができます。リモートシステムにアクセスする際にデータの機密性と整合性を維持するために重要です。
2020-07-15 15:43:14 +00:00
2023-12-26 02:42:22 +00:00
**デフォルトポート:** 22
2022-04-27 08:21:36 +00:00
```
2020-07-15 15:43:14 +00:00
22/tcp open ssh syn-ack
```
2023-12-26 02:42:22 +00:00
**SSHサーバー:**
2020-07-15 15:43:14 +00:00
2024-02-18 14:52:15 +00:00
* [openSSH ](http://www.openssh.org ) – OpenBSD SSH、BSD、Linuxディストリビューション、およびWindows( Windows 10以降) に搭載されています
* [Dropbear ](https://matt.ucc.asn.au/dropbear/dropbear.html ) – 低メモリとプロセッサリソース環境向けのSSH実装で、OpenWrtに搭載されています
* [PuTTY ](https://www.chiark.greenend.org.uk/\~sgtatham/putty/ ) – Windows向けのSSH実装で、クライアントは一般的に使用されていますが、サーバーの使用は稀です
2024-02-08 04:49:53 +00:00
* [CopSSH ](https://www.itefix.net/copssh ) – Windows向けのOpenSSHの実装
2020-12-14 16:53:57 +00:00
2024-02-08 04:49:53 +00:00
**SSHライブラリ( サーバーサイド実装) :**
2020-12-14 16:53:57 +00:00
2024-02-18 14:52:15 +00:00
* [libssh ](https://www.libssh.org ) – SSHv2プロトコルを実装したマルチプラットフォームのCライブラリで、[Python ](https://github.com/ParallelSSH/ssh-python )、[Perl ](https://github.com/garnier-quentin/perl-libssh/ )、および[R ](https://github.com/ropensci/ssh )向けのバインディングがあります。KDEではsftpに使用され、GitHubではgit SSHインフラに使用されています
* [wolfSSH ](https://www.wolfssl.com/products/wolfssh/ ) – ANSI Cで記述されたSSHv2サーバーライブラリで、組み込み、RTOS、およびリソース制約の環境向けです
* [Apache MINA SSHD ](https://mina.apache.org/sshd-project/index.html ) – Apache SSHD JavaライブラリはApache MINAに基づいています
2023-07-07 23:42:27 +00:00
* [paramiko ](https://github.com/paramiko/paramiko ) – Python SSHv2プロトコルライブラリ
2020-12-14 16:53:57 +00:00
2023-07-07 23:42:27 +00:00
## 列挙
2020-07-15 15:43:14 +00:00
2024-02-08 04:49:53 +00:00
### バナーの取得
2020-07-15 15:43:14 +00:00
```bash
nc -vn < IP > 22
```
2023-07-07 23:42:27 +00:00
### 自動化されたssh-audit
2020-07-15 15:43:14 +00:00
2024-02-08 04:49:53 +00:00
ssh-auditはsshサーバーおよびクライアントの構成監査のためのツールです。
2020-09-25 08:37:19 +00:00
2024-02-18 14:52:15 +00:00
[https://github.com/jtesta/ssh-audit ](https://github.com/jtesta/ssh-audit )は[https://github.com/arthepsy/ssh-audit/ ](https://github.com/arthepsy/ssh-audit/ )から更新されたフォークです。
2020-09-25 08:37:19 +00:00
2024-02-08 04:49:53 +00:00
**機能:**
2020-09-23 15:36:14 +00:00
2024-02-08 04:49:53 +00:00
* SSH1およびSSH2プロトコルサーバーサポート;
* SSHクライアント構成の分析;
* バナーの取得、デバイスまたはソフトウェアおよびオペレーティングシステムの認識、圧縮の検出;
* 鍵交換、ホストキー、暗号化およびメッセージ認証コードアルゴリズムの収集;
* アルゴリズム情報の出力(利用可能な期間、削除/無効化、安全でない/弱い/レガシーなど);
2023-12-26 02:42:22 +00:00
* アルゴリズムの推奨事項の出力(認識されたソフトウェアバージョンに基づいて追加または削除);
* セキュリティ情報の出力( 関連する問題、割り当てられたCVEリストなど) ;
2024-02-08 04:49:53 +00:00
* アルゴリズム情報に基づいたSSHバージョンの互換性の分析;
* OpenSSH、Dropbear SSH、libsshからの履歴情報;
* LinuxおよびWindowsで実行可能;
2023-07-07 23:42:27 +00:00
* 依存関係なし
2020-09-23 15:36:14 +00:00
```bash
usage: ssh-audit.py [-1246pbcnjvlt] < host >
2023-07-07 23:42:27 +00:00
-1, --ssh1 force ssh version 1 only
-2, --ssh2 force ssh version 2 only
-4, --ipv4 enable IPv4 (order of precedence)
-6, --ipv6 enable IPv6 (order of precedence)
-p, --port=< port > port to connect
-b, --batch batch output
-c, --client-audit starts a server on port 2222 to audit client
software config (use -p to change port;
use -t to change timeout)
-n, --no-colors disable colors
-j, --json JSON output
-v, --verbose verbose output
-l, --level=< level > minimum output level (info|warn|fail)
-t, --timeout=< secs > timeout (in seconds) for connection and reading
(default: 5)
2020-09-23 15:36:14 +00:00
$ python3 ssh-audit < IP >
```
2023-12-26 02:42:22 +00:00
### サーバーの公開SSHキー
2024-02-09 09:15:30 +00:00
[アクションを見る( Asciinema) ](https://asciinema.org/a/96ejZKxpbuupTK9j7h8BdClzp )
2020-07-15 15:43:14 +00:00
```bash
ssh-keyscan -t rsa < IP > -p < PORT >
```
2024-02-18 14:52:15 +00:00
### 弱い暗号アルゴリズム
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
これはデフォルトで**nmap**によって発見されます。しかし、**sslcan**や**sslyze**を使用することもできます。
2021-07-06 18:15:59 +00:00
2024-02-08 04:49:53 +00:00
### Nmapスクリプト
2021-07-06 18:15:59 +00:00
```bash
nmap -p22 < ip > -sC # Send default nmap scripts for SSH
nmap -p22 < ip > -sV # Retrieve version
2023-07-07 23:42:27 +00:00
nmap -p22 < ip > --script ssh2-enum-algos # Retrieve supported algorythms
2021-07-06 18:15:59 +00:00
nmap -p22 < ip > --script ssh-hostkey --script-args ssh_hostkey=full # Retrieve weak keys
nmap -p22 < ip > --script ssh-auth-methods --script-args="ssh.user=root" # Check authentication methods
```
2022-05-01 13:25:53 +00:00
### Shodan
2020-07-15 15:43:14 +00:00
* `ssh`
2024-02-08 04:49:53 +00:00
## Brute force usernames, passwords and private keys
2020-07-15 15:43:14 +00:00
2024-02-08 04:49:53 +00:00
### ユーザー名の列挙
2020-07-15 15:43:14 +00:00
2024-02-08 04:49:53 +00:00
一部のOpenSSHバージョンでは、タイミング攻撃を使用してユーザーを列挙することができます。これを悪用するためにmetasploitモジュールを使用できます:
2022-04-27 08:21:36 +00:00
```
2020-07-15 15:43:14 +00:00
msf> use scanner/ssh/ssh_enumusers
```
2024-02-08 04:49:53 +00:00
### [Brute force](../generic-methodologies-and-resources/brute-force.md#ssh)
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
一般的なsshの資格情報は[こちら ](https://github.com/danielmiessler/SecLists/blob/master/Passwords/Default-Credentials/ssh-betterdefaultpasslist.txt )と[こちら ](https://github.com/danielmiessler/SecLists/blob/master/Passwords/Common-Credentials/top-20-common-SSH-passwords.txt )にあります。
2020-07-15 15:43:14 +00:00
2024-02-08 04:49:53 +00:00
### プライベートキーの総当たり攻撃
2020-07-15 15:43:14 +00:00
2024-02-08 04:49:53 +00:00
使用可能なsshプライベートキーを知っている場合は、試してみましょう。nmapスクリプトを使用できます:
2022-04-27 08:21:36 +00:00
```
2020-07-15 15:43:14 +00:00
https://nmap.org/nsedoc/scripts/ssh-publickey-acceptance.html
```
2024-02-08 04:49:53 +00:00
または、MSF補助モジュール:
2022-04-27 08:21:36 +00:00
```
2020-07-15 15:43:14 +00:00
msf> use scanner/ssh/ssh_identify_pubkeys
```
2024-02-09 09:15:30 +00:00
#### Known badkeys can be found here:
2020-07-15 15:43:14 +00:00
2022-04-27 08:21:36 +00:00
{% embed url="https://github.com/rapid7/ssh-badkeys/tree/master/authorized" %}
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
#### Weak SSH keys / Debian predictable PRNG
2023-01-21 22:13:23 +00:00
2024-02-18 14:52:15 +00:00
Some systems have known flaws in the random seed used to generate cryptographic material. This can result in a dramatically reduced keyspace which can be bruteforced. Pre-generated sets of keys generated on Debian systems affected by weak PRNG are available here: [g0tmi1k/debian-ssh ](https://github.com/g0tmi1k/debian-ssh ).
2023-08-16 05:18:52 +00:00
2024-02-18 14:52:15 +00:00
You should look here in order to search for valid keys for the victim machine.
2020-07-15 15:43:14 +00:00
2022-05-01 13:25:53 +00:00
### Kerberos
2020-09-20 21:47:09 +00:00
2024-02-18 14:52:15 +00:00
**crackmapexec** using the `ssh` protocol can use the option `--kerberos` to **authenticate via kerberos** .\
For more info run `crackmapexec ssh --help` .
2020-09-20 21:47:09 +00:00
2024-02-18 14:52:15 +00:00
## Default Credentials
2020-07-15 15:43:14 +00:00
2024-02-18 14:52:15 +00:00
| **Vendor** | **Usernames** | **Passwords** |
2023-12-16 14:46:09 +00:00
| ---------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| APC | apc, device | apc |
| Brocade | admin | admin123, password, brocade, fibranne |
| Cisco | admin, cisco, enable, hsa, pix, pnadmin, ripeop, root, shelladmin | admin, Admin123, default, password, secur4u, cisco, Cisco, \_Cisco, cisco123, C1sco!23, Cisco123, Cisco1234, TANDBERG, change\_it, 12345, ipics, pnadmin, diamond, hsadb, c, cc, attack, blender, changeme |
| Citrix | root, nsroot, nsmaint, vdiadmin, kvm, cli, admin | C1trix321, nsroot, nsmaint, kaviza, kaviza123, freebsd, public, rootadmin, wanscaler |
| D-Link | admin, user | private, admin, user |
| Dell | root, user1, admin, vkernel, cli | calvin, 123456, password, vkernel, Stor@ge !, admin |
| EMC | admin, root, sysadmin | EMCPMAdm7n, Password#1 , Password123#, sysadmin, changeme, emc |
| HP/3Com | admin, root, vcx, app, spvar, manage, hpsupport, opc\_op | admin, password, hpinvent, iMC123, pvadmin, passw0rd, besgroup, vcx, nice, access, config, 3V@rpar , 3V#rpar , procurve, badg3r5, OpC\_op, !manage, !admin |
| Huawei | admin, root | 123456, admin, root, Admin123, Admin@storage , Huawei12#$, HwDec@01 , hwosta2.0, HuaWei123, fsp200@HW , huawei123 |
| IBM | USERID, admin, manager, mqm, db2inst1, db2fenc1, dausr1, db2admin, iadmin, system, device, ufmcli, customer | PASSW0RD, passw0rd, admin, password, Passw8rd, iadmin, apc, 123456, cust0mer |
| Juniper | netscreen | netscreen |
| NetApp | admin | netapp123 |
| Oracle | root, oracle, oravis, applvis, ilom-admin, ilom-operator, nm2user | changeme, ilom-admin, ilom-operator, welcome1, oracle |
| VMware | vi-admin, root, hqadmin, vmware, admin | vmware, vmw@re , hqadmin, default |
2022-04-27 08:21:36 +00:00
2022-05-01 13:25:53 +00:00
## SSH-MitM
2022-04-27 08:21:36 +00:00
2024-02-18 14:52:15 +00:00
If you are in the local network as the victim which is going to connect to the SSH server using username and password you could try to **perform a MitM attack to steal those credentials:**
2022-04-27 08:21:36 +00:00
2024-02-18 14:52:15 +00:00
**Attack path:**
2022-04-27 08:21:36 +00:00
2024-02-18 14:52:15 +00:00
* **Traffic Redirection:** The attacker **diverts** the victim's traffic to their machine, effectively **intercepting** the connection attempt to the SSH server.
* **Interception and Logging:** The attacker's machine acts as a **proxy** , **capturing** the user's login details by pretending to be the legitimate SSH server.
* **Command Execution and Relay:** Finally, the attacker's server **logs the user's credentials** , **forwards the commands** to the real SSH server, **executes** them, and **sends the results back** to the user, making the process appear seamless and legitimate.
2022-04-27 08:21:36 +00:00
2024-02-18 14:52:15 +00:00
[**SSH MITM** ](https://github.com/jtesta/ssh-mitm ) does exactly what is described above.
2022-04-27 08:21:36 +00:00
2024-02-18 14:52:15 +00:00
In order to capture perform the actual MitM you could use techniques like ARP spoofing, DNS spoofin or others described in the [**Network Spoofing attacks** ](../generic-methodologies-and-resources/pentesting-network/#spoofing ).
2024-01-11 00:14:10 +00:00
## SSH-Snake
2024-02-18 14:52:15 +00:00
If you want to traverse a network using discovered SSH private keys on systems, utilizing each private key on each system for new hosts, then [**SSH-Snake** ](https://github.com/MegaManSec/SSH-Snake ) is what you need.
2024-01-11 00:14:10 +00:00
2024-02-18 14:52:15 +00:00
SSH-Snake performs the following tasks automatically and recursively:
2024-01-11 00:14:10 +00:00
2024-02-18 14:52:15 +00:00
1. On the current system, find any SSH private keys,
2. On the current system, find any hosts or destinations (user@host ) that the private keys may be accepted,
3. Attempt to SSH into all of the destinations using all of the private keys discovered,
4. If a destination is successfully connected to, repeats steps #1 - #4 on the connected-to system.
2024-01-11 00:14:10 +00:00
2024-02-18 14:52:15 +00:00
It's completely self-replicating and self-propagating -- and completely fileless.
2020-07-15 15:43:14 +00:00
2024-02-18 14:52:15 +00:00
## Config Misconfigurations
2020-07-15 15:43:14 +00:00
2024-02-18 14:52:15 +00:00
### Root login
2020-12-14 16:53:57 +00:00
2024-02-18 14:52:15 +00:00
It's common for SSH servers to allow root user login by default, which poses a significant security risk. **Disabling root login** is a critical step in securing the server. Unauthorized access with administrative privileges and brute force attacks can be mitigated by making this change.
2020-07-15 15:43:14 +00:00
2024-02-18 14:52:15 +00:00
**To Disable Root Login in OpenSSH:**
2020-09-25 08:37:19 +00:00
2024-02-18 14:52:15 +00:00
1. **Edit the SSH config file** with: `sudoedit /etc/ssh/sshd_config`
2. **Change the setting** from `#PermitRootLogin yes` to ** `PermitRootLogin no` **.
3. **Reload the configuration** using: `sudo systemctl daemon-reload`
4. **Restart the SSH server** to apply changes: `sudo systemctl restart sshd`
2020-09-25 08:37:19 +00:00
2024-02-18 14:52:15 +00:00
### SFTP Brute Force
2023-12-26 22:04:57 +00:00
2024-02-18 14:52:15 +00:00
* [**SFTP Brute Force** ](../generic-methodologies-and-resources/brute-force.md#sftp )
2023-12-26 22:04:57 +00:00
2024-02-18 14:52:15 +00:00
### SFTP command execution
2020-07-15 15:43:14 +00:00
2024-02-18 14:52:15 +00:00
There is a common oversight occurs with SFTP setups, where administrators intend for users to exchange files without enabling remote shell access. Despite setting users with non-interactive shells (e.g., `/usr/bin/nologin` ) and confining them to a specific directory, a security loophole remains. **Users can circumvent these restrictions** by requesting the execution of a command (like `/bin/bash` ) immediately after logging in, before their designated non-interactive shell takes over. This allows for unauthorized command execution, undermining the intended security measures.
2024-02-08 04:49:53 +00:00
2024-02-18 14:52:15 +00:00
[Example from here ](https://community.turgensec.com/ssh-hacking-guide/ ):
2023-12-26 22:04:57 +00:00
```bash
ssh -v noraj@192 .168.1.94 id
2020-12-14 16:53:57 +00:00
...
Password:
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to 192.168.1.94 ([192.168.1.94]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh .com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh .com want_reply 0
debug1: Sending command: id
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh .com reply 0
uid=1000(noraj) gid=100(users) groups=100(users)
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2412, received 2480 bytes, in 0.1 seconds
Bytes per second: sent 43133.4, received 44349.5
debug1: Exit status 0
$ ssh noraj@192 .168.1.94 /bin/bash
```
2024-02-18 14:52:15 +00:00
以下は、ユーザー`noraj` のセキュアなSFTP構成の例です( `/etc/ssh/sshd_config` – openSSH) :
2023-07-07 23:42:27 +00:00
```
Match User noraj
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
PermitTunnel no
X11Forwarding no
PermitTTY no
```
2024-02-18 14:52:15 +00:00
この設定では、シェルアクセスを無効にして、開始コマンドを強制し、TTYアクセスを無効にするだけでなく、すべての種類のポート転送やトンネリングも無効にします。
2020-07-15 15:43:14 +00:00
2024-02-08 04:49:53 +00:00
### SFTPトンネリング
2020-07-15 15:43:14 +00:00
2024-02-08 04:49:53 +00:00
SFTPサーバーへのアクセス権がある場合、一般的なポート転送を使用してトラフィックをトンネリングすることもできます。
2023-12-26 22:04:57 +00:00
```bash
2020-09-25 08:37:19 +00:00
sudo ssh -L < local_port > :< remote_host > :< remote_port > -N -f < username > @< ip_compromised >
2020-07-15 15:43:14 +00:00
```
2024-02-08 04:49:53 +00:00
### SFTP シンボリックリンク
2020-07-15 15:43:14 +00:00
2024-02-18 14:52:15 +00:00
**sftp** には **symlink** コマンドがあります。したがって、あるフォルダで **書き込み権限** がある場合、**他のフォルダ/ファイル** の **シンボリックリンク** を作成できます。おそらくあなたは **chroot** に **閉じ込められている** ため、これはあなたにとって **特に有用ではない**かもしれませんが、作成した **シンボリックリンク** に **no-chroot** **サービス** から **アクセス**できる場合( たとえば、Web からシンボリックリンクにアクセスできる場合)、**Web を介してシンボリックリンクされたファイルを開く**ことができます。
2020-07-15 15:43:14 +00:00
2024-02-18 14:52:15 +00:00
たとえば、新しいファイル ** "froot"** から ** "/"** への **シンボリックリンク** を作成するには:
2023-12-26 22:04:57 +00:00
```bash
2020-07-15 15:43:14 +00:00
sftp> symlink / froot
```
2023-07-07 23:42:27 +00:00
### 認証方法
2020-12-14 16:53:57 +00:00
2024-02-18 14:52:15 +00:00
高セキュリティ環境では、単純なパスワード認証よりも鍵ベース認証や二要素認証を有効にすることが一般的です。しかし、より強力な認証方法を有効にしながらも、弱い認証方法を無効にしないことがよくあります。よくあるケースとして、openSSH構成で`publickey` を有効にし、デフォルトの方法として設定するが、`password` を無効にしないことが挙げられます。そのため、SSHクライアントの冗長モードを使用することで、攻撃者は弱い方法が有効になっていることを確認できます。
2023-12-26 22:04:57 +00:00
```bash
ssh -v 192.168.1.94
2020-12-14 16:53:57 +00:00
OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
...
debug1: Authentications that can continue: publickey,password,keyboard-interactive
```
2024-02-18 14:52:15 +00:00
たとえば、認証失敗の制限が設定されており、パスワードメソッドに到達する機会がない場合は、`PreferredAuthentications` オプションを使用してこのメソッドを強制的に使用することができます。
2023-12-26 22:04:57 +00:00
```bash
ssh -v 192.168.1.94 -o PreferredAuthentications=password
2020-12-14 16:53:57 +00:00
...
debug1: Next authentication method: password
```
2024-02-09 09:15:30 +00:00
### 設定ファイル
2020-12-14 16:53:57 +00:00
2024-02-09 09:15:30 +00:00
SSHサーバーの構成を確認することは重要です。予想されるメソッドのみが\
2024-02-18 14:52:15 +00:00
認可されていることを確認する必要があります。クライアントで詳細モードを\
2024-02-09 09:15:30 +00:00
使用すると、構成の効果を確認できます。
2023-12-26 22:04:57 +00:00
```bash
2020-12-14 16:53:57 +00:00
ssh_config
sshd_config
authorized_keys
ssh_known_hosts
known_hosts
id_rsa
```
2024-02-08 04:49:53 +00:00
## Fuzzing
2023-07-07 23:42:27 +00:00
* [https://packetstormsecurity.com/files/download/71252/sshfuzz.txt ](https://packetstormsecurity.com/files/download/71252/sshfuzz.txt )
* [https://www.rapid7.com/db/modules/auxiliary/fuzzers/ssh/ssh\_version\_2 ](https://www.rapid7.com/db/modules/auxiliary/fuzzers/ssh/ssh\_version\_2 )
2024-02-08 04:49:53 +00:00
## References
2023-07-07 23:42:27 +00:00
2024-02-08 04:49:53 +00:00
* You can find interesting guides on how to harden SSH in [https://www.ssh-audit.com/hardening\_guides.html ](https://www.ssh-audit.com/hardening\_guides.html )
2023-07-07 23:42:27 +00:00
* [https://community.turgensec.com/ssh-hacking-guide ](https://community.turgensec.com/ssh-hacking-guide )
2024-02-18 14:52:15 +00:00
< figure > < img src = "../.gitbook/assets/i3.png" alt = "" > < figcaption > < / figcaption > < / figure >
2023-07-07 23:42:27 +00:00
2024-02-18 14:52:15 +00:00
**Bug bounty tip**: **sign up** for **Intigriti** , a premium **bug bounty platform created by hackers, for hackers** ! Join us at [**https://go.intigriti.com/hacktricks** ](https://go.intigriti.com/hacktricks ) today, and start earning bounties up to ** $100,000**!
2023-07-07 23:42:27 +00:00
2024-02-18 14:52:15 +00:00
{% embed url="https://go.intigriti.com/hacktricks" %}
2023-07-07 23:42:27 +00:00
2024-02-08 04:49:53 +00:00
## HackTricks Automatic Commands
2022-04-27 08:21:36 +00:00
```
2021-09-13 11:32:29 -04:00
Protocol_Name: SSH
Port_Number: 22
Protocol_Description: Secure Shell Hardening
Entry_1:
2023-07-07 23:42:27 +00:00
Name: Hydra Brute Force
Description: Need Username
2023-09-12 08:55:48 +00:00
Command: hydra -v -V -u -l {Username} -P {Big_Passwordlist} -t 1 {IP} ssh
2023-07-07 23:42:27 +00:00
2021-10-27 12:00:25 -04:00
Entry_2:
2023-07-07 23:42:27 +00:00
Name: consolesless mfs enumeration
Description: SSH enumeration without the need to run msfconsole
Note: sourced from https://github.com/carlospolop/legion
Command: msfconsole -q -x 'use auxiliary/scanner/ssh/ssh_version; set RHOSTS {IP}; set RPORT 22; run; exit' & & msfconsole -q -x 'use scanner/ssh/ssh_enumusers; set RHOSTS {IP}; set RPORT 22; run; exit' & & msfconsole -q -x 'use auxiliary/scanner/ssh/juniper_backdoor; set RHOSTS {IP}; set RPORT 22; run; exit'
2022-04-28 16:01:33 +00:00
2023-07-07 23:42:27 +00:00
```
2022-04-28 16:01:33 +00:00
< details >
2024-02-18 14:52:15 +00:00
< summary > < strong > AWSハッキングをゼロからヒーローまで学ぶ< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE( HackTricks AWS Red Team Expert) < / strong > < / a > < strong > ! < / strong > < / summary >
2024-01-03 00:54:19 +00:00
2024-02-18 14:52:15 +00:00
HackTricksをサポートする他の方法:
2022-04-28 16:01:33 +00:00
2024-02-18 14:52:15 +00:00
* **HackTricksで企業を宣伝したい**または**HackTricksをPDFでダウンロードしたい**場合は、[**SUBSCRIPTION PLANS** ](https://github.com/sponsors/carlospolop )をチェックしてください!
* [**公式PEASS& HackTricksのグッズ** ](https://peass.creator-spring.com )を入手する
* [**The PEASS Family** ](https://opensea.io/collection/the-peass-family )を発見し、独占的な[**NFTs** ](https://opensea.io/collection/the-peass-family )のコレクションを見つける
* **💬 [**Discordグループ** ](https://discord.gg/hRep4RUj7f )に参加するか、[**telegramグループ** ](https://t.me/peass )に参加するか、**Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks\_live )**をフォローする。**
* **ハッキングトリックを共有するために、PRを** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) **および** [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) **のGitHubリポジトリに提出してください。**
2022-04-28 16:01:33 +00:00
< / details >