You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you get error **“connection refused”**, the SSH server is not running in another machine. So you need to start the SSH server.
207
199
208
-
<br />
209
-
210
200
## Create SSH Keys
211
201
212
202
### Generate Keys
@@ -228,8 +218,6 @@ In target machine,
228
218
ssh-copy-id username@<target-ip>
229
219
```
230
220
231
-
<br />
232
-
233
221
## Generate SSH Keys and Set Up Public Key to Connect Remote Machine
234
222
235
223
### 1. Check if authorized_keys Exists in Remote Machine
@@ -270,8 +258,6 @@ chmod 600 key
270
258
ssh victim@<target-ip> -i key
271
259
```
272
260
273
-
<br />
274
-
275
261
## SSH Server
276
262
277
263
### Start/Stop/Restart
@@ -330,8 +316,6 @@ sudo pkill -f pts/#
330
316
grep 'sshd' /var/log/auth.log
331
317
```
332
318
333
-
<br />
334
-
335
319
## SSH Proxy Server
336
320
337
321
### Sshuttle
@@ -365,8 +349,6 @@ Then you can access to other networks.
365
349
366
350
Run sshuttle again.
367
351
368
-
<br />
369
-
370
352
## SSH-MITM for Stealing Credentials
371
353
372
354
If the target system user try to connect arbitrary host using SSH, we might be able to steal credentials by listening via the SSH man-in-the-middle server.
# --listen-port: Specify the ip address to listen in local machine
382
364
ssh-mitm server --enable-trivial-auth --remote-host example.com --listen-port 2222
383
-
```
365
+
```
366
+
367
+
## 2FA Bypass
368
+
369
+
When logging in to SSH with 2FA enabled, we will be asked for a **Verification Code**.
370
+
371
+
### Google Authenticator
372
+
373
+
If the Google Authenticator is used, the secret key of TOTP can be stored in`$HOME/.google_authenticator` according to [the repo](https://github.com/google/google-authenticator-libpam).
374
+
375
+
After getting the secret key, now access to [Online one-time password generator](https://totp.app/) and input the secret key, then get TOTP.
376
+
Now login SSH with `ssh`command and input the TOTP for verification code.
0 commit comments