Skip to content
KitploitKITPLOIT
StrumentiExploitsBlog
Log in
Invia
StrumentiExploitsBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

FeedContattoPrivacy© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
ssh-tpm-agent — Agente SSH che crea e gestisce chiavi sigillate TPM per l'autenticazione vincolata all'hardware, supportando generazione, importazione, wrapping, protezione tramite PIN e fallback proxy. | Kitploit
Strumenti/GitHubGitHub/foxboron/ssh-tpm-agent
Strumenti di Crittografia/DecrittografiaSicurezza CloudDevSecOpsSicurezza HardwareGestione Identità e Accessi (IAM)Autenticazione
GitHubfoxboron/ssh-tpm-agent

ssh-tpm-agent

Agente SSH che crea e gestisce chiavi sigillate TPM per l'autenticazione vincolata all'hardware, supportando generazione, importazione, wrapping, protezione tramite PIN e fallback proxy.

Vedi Repository
74339477 giorni faRevisionato da Kitploit
Condividi

Agente SSH per TPM

ssh-tpm-agent è un agente compatibile con ssh-agent che consente di creare chiavi tramite il Trusted Platform Module (TPM) per l'autenticazione verso server ssh.

Le chiavi sigillate dal TPM sono chiavi private create all'interno del Trusted Platform Module (TPM) e sigillate in file con suffisso .tpm. Sono vincolate all'hardware su cui sono prodotte e non possono essere trasferite su altre macchine.

Ciò consente di utilizzare un client nativo invece di dover caricare lateralmente librerie PKCS11 esistenti nell'ssh-agent e/o nel client ssh.

Il progetto utilizza i TPM 2.0 Key Files implementati tramite il progetto go-tpm-keyfiles.

Funzionalità

  • Un ssh-agent funzionante.
  • Creazione di chiavi ssh schermate sul TPM.
  • Creazione di chiavi SSH incapsulate remotamente per l'importazione.
  • Supporto PIN, la protezione contro gli attacchi a dizionario da parte del TPM consente di utilizzare PIN a bassa entropia invece di passphrase.
  • Crittografia della sessione TPM.
  • Supporto proxy verso altri server ssh-agent per i fallback.

Supporto SWTPM

Invece di utilizzare direttamente il TPM, è possibile usare --swtpm o export SSH_TPM_AGENT_SWTPM=1 per creare un'identità supportata da swtpm che verrà memorizzata in /var/tmp/ssh-tpm-agent.

Si noti che swtpm non fornisce alcuna proprietà di sicurezza e dovrebbe essere utilizzato solo per test.

Installazione

Il modo più semplice per installare questo plugin è eseguire quanto segue:

go install github.com/foxboron/ssh-tpm-agent/cmd/...@latest

In alternativa, scarica i binari precompilati.

Utilizzo

# Create key
$ ssh-tpm-keygen
Generating a sealed public/private ecdsa key pair.
Enter file in which to save the key (/home/fox/.ssh/id_ecdsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/fox/.ssh/id_ecdsa.tpm
Your public key has been saved in /home/fox/.ssh/id_ecdsa.pub
The key fingerprint is:
SHA256:NCMJJ2La+q5tGcngQUQvEOJP3gPH8bMP98wJOEMV564
The key's randomart image is the color of television, tuned to a dead channel.

$ cat /home/fox/.ssh/id_ecdsa.pub
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOTOsMXyjTc1wiQSKhRiNhKFsHJNLzLk2r4foXPLQYKR0tuXIBMTQuMmc7OiTgNMvIjMrcb9adgGdT3s+GkNi1g=

# Using the socket
$ ssh-tpm-agent -l /var/tmp/tpm.sock

$ export SSH_AUTH_SOCK="$(ssh-tpm-agent --print-socket)"

$ ssh [email protected]

Nota: Per ssh-tpm-agent puoi specificare la password del proprietario del TPM utilizzando i flag da riga di comando -o o --owner-password, che sono preferiti. In alternativa, puoi utilizzare la variabile d'ambiente SSH_TPM_AGENT_OWNER_PASSWORD.

Importare una chiave esistente

Utile se desideri eseguire il backup della chiave su un archivio sicuro remoto mentre utilizzi la chiave quotidianamente dal TPM.

# Create a key, or use an existing one
$ ssh-keygen -t ecdsa -f id_ecdsa
Generating public/private ecdsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_ecdsa
Your public key has been saved in id_ecdsa.pub
The key fingerprint is:
SHA256:bDn2EpX6XRX5ADXQSuTq+uUyia/eV3Z6MW+UtxjnXvU fox@framework
The key's randomart image is:
+---[ECDSA 256]---+
|           .+=o..|
|           o. oo.|
|          o... .o|
|       . + ..  ..|
|        S .   . o|
|       o * . oo=*|
|        ..+.oo=+E|
|        .++o...o=|
|       .++++. .+ |
+----[SHA256]-----+

# Import the key
$ ssh-tpm-keygen --import id_ecdsa
Sealing an existing public/private ecdsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_ecdsa.tpm
The key fingerprint is:
SHA256:bDn2EpX6XRX5ADXQSuTq+uUyia/eV3Z6MW+UtxjnXvU
The key's randomart image is the color of television, tuned to a dead channel.

Installare il servizio utente

I servizi attivati da socket consentono di avviare ssh-tpm-agent quando è necessario al sistema.

# Using the socket
$ ssh-tpm-agent --install-user-units
Installed /home/fox/.config/systemd/user/ssh-tpm-agent.socket
Installed /home/fox/.config/systemd/user/ssh-tpm-agent.service
Enable with: systemctl --user enable --now ssh-tpm-agent.socket

$ systemctl --user enable --now ssh-tpm-agent.socket

$ export SSH_AUTH_SOCK="$(ssh-tpm-agent --print-socket)"

$ ssh [email protected]

Supporto proxy

# Start the usual ssh-agent
$ eval $(ssh-agent)

# Create a strong RSA key
$ ssh-keygen -t rsa -b 4096 -f id_rsa -C ssh-agent
...
The key fingerprint is:
SHA256:zLSeyU/6NKHGEvyZLA866S1jGqwdwdAxRFff8Z2N1i0 ssh-agent

$ ssh-add id_rsa
Identity added: id_rsa (ssh-agent)

# Print looonnggg key
$ ssh-add -L
ssh-rsa AAAAB3NzaC1yc[...]8TWynQ== ssh-agent

# Create key on the TPM
$ ssh-tpm-keygen -C ssh-tpm-agent
Generating a sealed public/private ecdsa key pair.
Enter file in which to save the key (/home/fox/.ssh/id_ecdsa):
Enter passphrase (empty for no passphrase):
Confirm passphrase:
Your identification has been saved in /home/fox/.ssh/id_ecdsa.tpm
Your public key has been saved in /home/fox/.ssh/id_ecdsa.pub
The key fingerprint is:
SHA256:PoQyuzOpEBLqT+xtP0dnvyBVL6UQTiQeCWN/EXIxPOo
The key's randomart image is the color of television, tuned to a dead channel.

# Start ssh-tpm-agent with a proxy socket
$ ssh-tpm-agent -A "${SSH_AUTH_SOCK}" &

$ export SSH_AUTH_SOCK="$(ssh-tpm-agent --print-socket)"

# ssh-tpm-agent is proxying the keys from ssh-agent
$ ssh-add -L
ssh-rsa AAAAB3NzaC1yc[...]8TWynQ== ssh-agent
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNo[...]q4whro= ssh-tpm-agent

ssh-tpm-add

$ ssh-tpm-agent --no-load &
2023/08/12 13:40:50 Listening on /run/user/1000/ssh-tpm-agent.sock

$ export SSH_AUTH_SOCK="$(ssh-tpm-agent --print-socket)"

$ ssh-add -L
The agent has no identities.

$ ssh-tpm-add $HOME/.ssh/id_ecdsa.tpm
Identity added: /home/user/.ssh/id_ecdsa.tpm

$ ssh-add -L
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJCxqisGa9IUNh4Ik3kwihrDouxP7S5Oun2hnzTvFwktszaibJruKLJMxHqVYnNwKD9DegCNwUN1qXCI/UOwaSY= test

Creare e incapsulare la chiave privata per la macchina client sul server remoto

Sul lato client creare una chiave primaria all'interno di una gerarchia. Questo esempio utilizzerà la gerarchia owner con una SRK.

Il file di output srk.pem deve essere trasferito all'estremità remota che crea la chiave. Questo potrebbe essere fatto come parte del provisioning del client.

$ tpm2_createprimary -C o -G ecc -g sha256 -c prim.ctx -a 'restricted|decrypt|fixedtpm|fixedparent|sensitivedataorigin|userwithauth|noda' -f pem -o srk.pem

Sul lato remoto creiamo una chiave ssh p256, senza password, e la avvolgiamo con ssh-tpm-keygen usando il file srk.pem dal lato client.

$ ssh-keygen -t ecdsa -b 256 -N "" -f ./ecdsa.key
# OR with openssl
$ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:prime256v1 -out ecdsa.key

# Wrap with ssh-tpm-keygen
$ ssh-tpm-keygen --wrap-with srk.pub --wrap ecdsa.key -f wrapped_id_ecdsa

Sul lato client possiamo scartare wrapped_id_ecdsa per ottenere una chiave caricabile.

$ ssh-tpm-keygen --import ./wrapped_id_ecdsa.tpm -f id_ecdsa.tpm
$ ssh-tpm-add id_ecdsa.tpm

ssh-tpm-hostkey

ssh-tpm-agent supporta anche l'archiviazione delle chiavi host all'interno del TPM.

$ sudo ssh-tpm-keygen -A
2023/09/03 17:03:08 INFO Generating new ECDSA host key
2023/09/03 17:03:08 INFO Wrote /etc/ssh/ssh_tpm_host_ecdsa_key.tpm
2023/09/03 17:03:08 INFO Generating new RSA host key
2023/09/03 17:03:15 INFO Wrote /etc/ssh/ssh_tpm_host_rsa_key.tpm
Scarica lo strumento

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 Il toolkit OSINT definitivo: grafo di indagine, punteggio di affidabilità, famiglie di alias, mappa, timeline e report. 49 moduli, oltre 400 siti, nessuna chiave API richiesta.

    891
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # App di esecuzione con un tocco GhostLock (CVE-2026-43499)

    547
  • 3

    ARTEX

    baarai/artex

    Piattaforma di penetration testing autonoma multi-agente basata su LLM con agenti planner/worker, grafi di asset e di esplorazione, registrazione del traffico MITM e retesting delle vulnerabilità.

    369
  • 4

    redforge

    cybersecurity91/redforge

    Toolkit red team lato browser con 102 strumenti offline per ricognizione, generazione di payload, attacchi alle credenziali, crittografia, codifica e reportistica dell'engagement.

    366
  • 5

    looking-glass

    anonghosty/looking-glass

    Piattaforma CSIRT che importa i report di Shadowserver in MongoDB e li riproduce come mappe interattive, analisi, risultati, avvisi e dashboard executive.

    309
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    Il sistema d'azione per la cybersecurity nativa AI—dove l'intento diventa esecuzione governata, le evidenze diventano memoria operativa, e ogni operazione migliora la successiva.

    282

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →