Update SSH/ssh_reverse_shell.adoc

Anonimizzazione degli host
This commit is contained in:
Celestino Amoroso 2025-06-01 11:34:30 +02:00
parent 5d24fcec0d
commit 1eb58a7f37

View File

@ -38,22 +38,22 @@ L'__IP-remoto__ e la _porta-remota_ si riferiscono al _bridge-host_; se _IP-remo
L'__IP-locale__ e la _porta-locale_, nel caso di reverse-shell, specificano il riferimento al servizio SSH del _target-host_; pertanto i valori standard sono _localhost_ e _22_.
.Esempio: Reverse-shell sul mini-pc minis verso il server www.portale-stac.it
.Esempio: Reverse-shell da PC verso il server my-server.domain.it
[source,ssh]
----
# NOTA-1: il servizio SSH su portale-stac (bridge) è attivo sulla porta 110.
# NOTA-2: il servizio SSH sul mini-pc (target) è attivo sulla porta 2222.
[camoroso@minis ~]$ ssh -NR 7022:127.0.0.1:110 -p 110 camoroso@www.portale-stac.it
# NOTA-1: il servizio SSH su my-server.domain.it (bridge) è attivo sulla porta 110.
# NOTA-2: il servizio SSH sul PC (target) è attivo sulla porta 22.
[local-user@minis ~]$ ssh -NR 7022:127.0.0.1:110 -p 110 remote-user@my-server.domain.it
----
.Accesso alla reverse-shell dell'host portale-stac (bridge)
.Accesso alla reverse-shell dell'host my-server.domain.it (bridge)
[source,sh]
----
# Connessione a portal-stac dalla propria postazione (PC)
[camoroso@localhost ~]$ ssh -p 110 camoroso@www.portale-stac.it
# Connessione a my-server.domain.it dalla propria postazione (PC)
[local-user@localhost ~]$ ssh -p 110 remote-user@my-server.domain.it
# Connessione al mini-pc (minis.internet) da portale-stac
[camoroso@www ~]$ ssh -p 7022 camoroso@localhost
# Connessione al PC (non raggiungibile direttamente via Internet) da my-server.domain.it
[remote-user@my-server ~]$ ssh -p 7022 local-user@localhost
----
Per accedere direttamente dal PC alla reverse-shell, il valore di _IP-remoto_ dev'essere l'indirizzo o il nome dell'host bridge visibile da Internet e dev'essere disponibile il flusso entrante sulla porta remota *7022*.
@ -62,13 +62,13 @@ Se questo condizioni sono soddisfatte, la reverse-shell dev'essere attivata con
.Reverse-shell su Internet
[source,sh]
----
[camoroso@minis ~]$ ssh -NR www.portale-stac.it:7022:127.0.0.1:110 -p 110 camoroso@www.portale-stac.it
[local-user@localhost ~]$ ssh -NR my-server.domain.it:7022:127.0.0.1:110 -p 110 remote-user@my-server.domain.it
----
.Accesso diretto via Internet
[source,sh]
----
[camoroso@localhost ~]$ ssh -p 7022 camoroso@www.portale-stac.it
[local-user@localhost ~]$ ssh -p 7022 remote-user@my-server.domain.it
----
'''