How To Use NetCat Tool In Linux - AndroGeek88

Latest

Download Latest Android Mod Apk . This is the Best Modded APK site of We share Modded Games and other android apps for Free and Hacking related stuff with proper details

Search

How To Use NetCat Tool In Linux

How To Use NetCat Tool In Linux


Netcat is a very powerful tool. it can be used in many ways. we define netcat as nc in commands. it is called swiss army knife of a hacker. here, we will talk about various functions of netcat that can help you in the future.

if you don’t have netcat, you can install it by clicking here
I am performing everything on my local network and if you want to connect to someone who is not in your LAN, you will need to perform port forwarding. I will explain it later.

  • Use netcat as a messenger:


type this command to open a listener:

nc -lvp <port-no.>                                         

the -l key is for listening to a connection that is being sent to your local IP address. -v is to show some output(hard to explain for me) and the -p stands for port-no. which we will assign in our next command.

type this command to send data to a listener:

nc <local-ip> <port-no.>                               

in this case, we have many ways to send data packets. if you wanna use another option you can use telnet.

Now if there is nothing wrong you can talk in a LAN network to a different person.

share a file in LAN using netcat:

for sharing files, you will need to install netcat at in both machines that you are using. as I told you before about netcat listener, we will use it here with some modifications.

type this command :

nc -lvp "port-no." > "path to the file"
> is to tell netcat to send the file.

now we are ready to receive the file.

  • type this command:


nc "local-ip" "port" < "filename"
< is to tell netcat to receive the file. if you have done it well, it would work.

  • connect to a reverse shell with netcat:

the situation is-  A reverse shell is sending data to our IP, but the question is how can we listen to it.

for example, we a server in which we have uploaded a PHP reverse shell. by the way, the server is on LAN. now we have netcat tool preinstalled in our Kali Linux. we will be able to listen to a connection if we start a listener.

  • type this command:

nc -lvp <port-no.>

most important this is, you must have entered the correct IP and port-no. in the Reverse shell. now you can access server as you want.

tip- the shell is some kinda terminal or command prompt that gives you command line access to a machine.

No comments:

Post a Comment

Hey Geek Welcome to Androgeek