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 thatrc
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 thatrc
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
.