How to use the command 'rc' (with examples)

How to use the command 'rc' (with examples)

The rc command is a modern simplistic port listener and reverse shell, similar to nc (netcat). It provides a user-friendly way to listen on a specific port or establish a reverse shell connection with a host.

Use case 1: Start listening on a specific port

Code:

rc -lp <port>

Motivation: This use case can be helpful when you want to monitor incoming network connections on a specific port. It allows you to establish a listening socket and capture data sent to that port.

Explanation:

  • -lp: The -l option indicates that rc should start listening on the specified port, and the -p option specifies the port number to listen on.
  • <port>: Replace this with the desired port number to start listening on.

Example output:

Listening on port 5000...

Use case 2: Start a reverse shell

Code:

rc <host> <port> -r <shell>

Motivation: This use case is useful when you want to establish a reverse shell connection to a remote host, allowing you to execute commands on that host from your local machine.

Explanation:

  • <host>: Replace this with the IP address or hostname of the remote host to connect to.
  • <port>: Replace this with the port number on the remote host to connect to.
  • -r: The -r option indicates that rc should establish a reverse shell connection.
  • <shell>: Replace this with the shell type or command you want to execute on the remote host.

Example output:

Reverse shell connection established with host: 192.168.1.100, port: 8080

Conclusion:

The rc command is a versatile tool for monitoring network connections and establishing reverse shell connections. It provides a simplified way of interacting with ports and remote hosts, making it a handy utility for various use cases. Whether you want to listen on a specific port or gain remote access to a host, rc simplifies the process while providing similar functionality to nc.

Related Posts

How to use the command trash (with examples)

How to use the command trash (with examples)

The trash command is a Linux utility that allows users to manage the trashcan or recycling bin.

Read More
How to use the command git check-mailmap (with examples)

How to use the command git check-mailmap (with examples)

Git is a distributed version control system that allows multiple people to work on a project simultaneously without overwriting or losing each other’s changes.

Read More
How to use the command netstat (with examples)

How to use the command netstat (with examples)

Netstat is a command-line network utility tool that displays active TCP connections, ports on which the computer is listening, network adapter statistics, the IP routing table, as well as IPv4 statistics and IPv6 statistics.

Read More