ShellSpells
  • đŸ§™â€â™‚ī¸Welcome!
    • ShellSpells
    • FAQs
    • License & Disclaimer
  • 🐧Linux
    • System Ops
      • Transcripts
      • Help
      • System Info
        • Date/Time
        • System Details
        • Patches & Updates
        • Init System Identification
        • Hostname / Host ID
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Shares
        • Packages
        • Connected Devices
        • Kernel Modules (Drivers)
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Jobs
        • Enumerate
        • Modify
      • Processes
        • Enumerate
        • Modify
        • Custom Script and Shared Object
        • Process I/O Redirection
      • Services
        • Enumerate
        • Modify
        • Create a Service
      • Startup/Boot Scripts
        • Enumerate
        • Modify
      • Security
        • Antivirus
        • Firewall
        • SSH Keys
      • History & Logs
        • History
        • Logs
    • File Ops
      • Search
        • Filename
        • Content
        • Users (Owners)
        • Time
        • Size
        • Permission
        • Hidden Files
        • Inode
        • Find + Exec
        • Notes
      • Enumerate Metadata
      • Modify Metadata
      • Read Content
      • Modify Content
      • Extract Content
      • Sort / Compare / Count
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
    • Terminal Ops
      • Keyboard Shortcuts
      • Tmux Shortcuts
  • đŸĒŸWindows
    • System Ops
      • Transcripts
      • Help
      • System Info
        • One-liners
        • Date/Time
        • System Details
        • Hotfixes
        • Domain or Workgroup
        • Data Execution Prevention
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Installed Software
        • Drivers
        • Shares
      • Registry
        • Enumerate
        • Modify
        • Forensically Relevant Keys
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Tasks
      • Processes
        • Enumerate
        • Modify
      • Services
        • Enumerate
        • Modify
      • Autorun / Startup
        • Enumerate
        • Modify
      • Security
        • Permissions
          • Enumerate
          • Page
        • Antivirus
        • Firewall
          • Enumerate
          • Modify
        • Audit Policies
        • Remoting
          • Enumerate
          • Modify
          • Registry Locations
        • Stored Credentials
      • Remote Command Execution
      • Active Directory
        • Enumerate
        • Modify
      • History & Logs
        • History
        • Logs
      • PowerShell Config
      • Scripting
      • WMIC Notes
    • File Ops
      • Search
        • Filename
        • Time
        • Size
        • Permissions
        • Attributes
        • Wildcarding
      • Enumerate Metadata
        • One Liners
        • Users (Owners)
        • Timestamps
        • Size
        • Permissions
        • Attributes
      • Modify Metadata
        • Change Owner
        • Timestamps
        • Size
        • Attributes
      • Read Content
      • Modify Content
        • Overwrite
        • Insert
        • Append
        • Replace / Remove
        • Convert Case
        • Alternate Data Streams
      • Extract Content
      • Sort / Compare / Count
        • Sort
        • Count
        • Compare
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
      • Output Formatting / Filtering
      • File Formatting
      • Operators
  • â›“ī¸Network
    • Traffic Manipulation
      • iptables
        • Option List
        • General Commands
        • Filter Tables
        • NAT
        • Mangle
        • Filter for SSH Traffic (Example)
      • nftables
    • Packet Capture
      • Syntax
      • TCPDump Examples
    • Packet Analysis
      • Wireshark
  • 🚗Maneuver
    • SSH
    • Control Sockets
    • RDP
    • Windows Port Proxy
  • đŸ›Šī¸Data Transfer
    • SCP
    • FTP
    • Netcat
      • Netcat Relays
    • Server Interactions
    • Alternate Methods
  • đŸĒ„REGEX
    • Examples
Powered by GitBook
On this page
  • Un-named Pipe Pipes
  • Un-named Pipe Example (Flow chart)
  • Named Pipes

Was this helpful?

  1. Data Transfer
  2. Netcat

Netcat Relays

PreviousNetcatNextServer Interactions

Last updated 1 year ago

Was this helpful?

Un-named Pipe Pipes

Un-named pipes in netcat relays are like secret tunnels for one-way communication between processes.

They help transfer data between netcat instances on different hosts or ports without needing specific file names or setups. They make sending and receiving data easy and direct.

Two-way communication between processes can be achieved by using two pipes in opposite "directions".

The STDOUT (1) of the command on the left is sent as STDIN (0) to the command on the right.

Example:

On the local machine, send data using netcat to the remote machine:

echo "Hello, Remote Machine!" | nc <remote_ip> <remote_port>

On the remote machine, receive the data using netcat:

nc -l -p <remote_port> > received_data.txt

Un-named Pipe Example (Flow chart)

You can use 1 or more relays to transfer your connection.

NC relays typically can only send data in one direction and that is from left to right.

To ssend data back (right to left) you need to use named pipes.

Named Pipes

AKA "FIFOs", Named Pipes are treated like files. They let processes read and write to each other.

Two-way communication so processes can share information.

Example:

You can create a named pipe using mknod or mkfifo.

mknod mypipe p

Mknod = make node

Mypipe = the name of the pipe

p = the file descriptor. p is for Pipe.

b = Block-oriented device file

c = Character-oriented device file

OR

mkfifo mypipe

On the relay machine (This would be the machine in the middle of the sender and receiver)

mkfifo mypipe
nc 10.1.0.2 9002 0< mypipe | nc 10.2.0.2 9001 1> mypipe

On Listener2 (sends info):

nc -l -p 9002 < infile.txt

On Listener1 (receives info):

nc -l -p 9001 > outfile.txt

Writes the output to listener1 and listener2 through the named pipe

đŸ›Šī¸