Netcat Tutorial - Transferring Data
Skills:
Tool Use & Function Calling90%
Key Takeaways
This video tutorial by HackerSploit demonstrates how to use Netcat for transferring data, specifically files, between systems.
Full Transcript
hello everyone and welcome to this video in this video i'm going to be showing you how to transfer data with netcat and i'll be doing this with two examples one of them is going to be a simple chat uh application well not really an application uh but it'll be a simple client server connection that has a chat functionality and this is to this this is to expose or to show you uh how powerful netcat is and that cat is and then i'll also also show you how to transfer data from client to server and vice versa all right so let's get started now as i mentioned uh client uh with netcat you can initialize two types of connections uh you can have the client and the server and that is how data or connections are written either in tcp or udp all right so let's get started with creating our chat application now given that one uh we have to have an instance of a server and an instance of a client i am going to set up the cali operating system or the kali computer as my server as my netcat server and i'm going to set up my host operating system which is windows 10 as my client all right and i'll show you how that works so i already have netcat installed on my windows 10 operating system and of course you can run this on any configuration you have and just to test out the functionality and to understand what's going on here all right so i'm just going to open up my command prompt right over here and we'll keep that open while we work on creating the server all right so i'm going to open up my terminal back and go into kali linux and if we just open up the uh help menu right over here you can see that we will be using the n command which essentially is no dns v which is which is verbose and we will be using the l command which means we are listening that is for the server connection so it will bind and listen for incoming connections on your local ip uh and we'll be looking and we'll be also using the p option right over here which allows us to specify the port that will be listening on that is for the server connection it will it can also be used uh to connect to a port as we'll be looking at with the the client all right so to set up the server all we need to do is clearly just clear that out let me just clear that up and all we need to do is type in nc and the syntax is now going to be nv lp all right so we're saying uh no dns uh we want to we want verbose data of reverse output we are listening uh on our local host or local ip and the port that we want to use is port one two three four just a simple example all right so once i hit enter it's going to start a server or it's going to start the server on this local ip and you might be wondering what's your local ip and that's a very very good question so before we actually run that let me just type in ifconfig you can see that my local ip for my local area network is 192.168.1.110 or 110 all right so now that i know that we know that the server is going to be running on 192.168.1.110 on port one two three four now of course you can change the ports and test it however you like it's all up to you all right so netcat nvlp and port one two three four and i'm gonna hit enter and the server is running you can see it's going to tell you that's listening on your local ip on the port 1 2 3 4 and it's going to wait for connections all right so let's connect to this server with my host operating system which is windows 10 and what i'm going to do is i'm just going to type in nc and again we're using the nv command because we are going to we don't want any dns and we want verbose output and now we need to type in the server's ip address so we're going to type in 192.168.1.110 all right and now we specify the port which is port one two three four so in this uh in this scenario the client is essentially connecting to the server on that on the port that it is listening on so once i hit enter you can see that is it is going to connect and will give us the host name of unknown don't worry about that and it's going to tell us the port is open and it will give you an empty prompt right over here that means that the connection was successful so to test the this out we're going to be testing the chat functionality and how data is transferred so let me just uh minimize this if i can and let me bring up the command prompt so i can say for example from the client and the server you know vice versa uh for example in here in in the windows command prompt i can type in hello and once i hit hello you can see that it is displayed on the server hello so i can also type a message back so you can say hello client how are you all right and i can hit enter and that is going to be sent to the client so let me just open up my command prompt and as you can see hello client how are you and i can say i can say uh i am fine server uh how about you and you know you can go on and on like that and it'll be printed back right over here to the server so really awesome stuff you can see that netcat can be used for a lot of stuff and this is very basic data transfer but it gets really interesting when we talk about saving data to a file for example which is what i want to show you now all right so i'm just going to go back into my full screen mode here and i'm going to close that instance i'm going to close the server and now what we're looking to do is we want to transfer data that is going to be sent by the client into a file for example all right so let's say i wanted to send all the the data that is being sent you know from the client uh to a specific file so you know it could be anything it could be a simple uh it could be text could be data could be commands that can be used you know to do to run on ftp you know whatever you comes in your mind you can use this for that all right so um what i'm going to do is i'm going to type in nc and again we're using the same syntax for starting up a server on port one two three four however we want all the data that is incoming to the server to be saved into a file now the file can be any file it can be an exe file it can be a pdf file a txt file which is what i'm going to use so i'm just going to say i'm just going to call it data.txt so any data that is going to be sent from the client uh will be stored in this file so i'm going to hit enter and it's going to start the server like normal and we we want to just minimize this and let me just open up my command prompt here and that server closed up as you would expect so i'm going to connect with the new instance so i'm just going to type in like so so netcat nv 192.168.1.110 and port one two three four and i'm gonna hit enter and we're gonna get the connection and now if i type in hello from the client you can see that no data will be displayed on the server side because all the data is being stored in the data.txt file really awesome now we'll confirm this in a second but i can add as many as as much data as i want so for example we could uh we could be sending or writing a script that is how uh penetration testers go about transferring data from the operating system to the target operating system so let's say they do not have direct access or a shell but they do have you know connection through netcat and they want to send a list of commands that should be executed so we could say for example uh we want to execute a few comments like go back uh go back and we can then say uh for example uh run a following exploit like so and you know exit and of course that would be in the form of a bash script or whatever you want so that means the data.txt would have to be a shell.txt and i'll show you that in a second so if i enter that data is going to be sent and it's going to be stored in the data.txt file so what i can show you or to demonstrate this let me just close this server and if we just get the the data.txt file you can see that all the data that we sent from the client will be displayed here so i'm going to hit enter and as you can see all the data was displayed exactly as we entered it now you can see how important and how useful this can be for a penetration tester so what i'm going to do is i'm just going to get rid of this so i'm just going to say remove the data.txt file because we don't need it and what i'm going to do now is i want to store uh i want to set i want to store all the commands all the data into a data dot shell uh into a data dot shell script all right so then we'll execute the script and we'll be able to send the commands that we want to be saved and executed all right so i'm going to hit enter and i'm just going to go back into my windows command prompt and i'm going to just hit enter we're going to connect to the server i'm going to enter and now we can say something like we can create the shebang so bin bash and we can create a simple script we can say echo uh this uh this was sent over netcat you know something really simple netcat and that'll essentially just print that out and um yeah that's pretty that's a very very basic script and uh uh that should be it so after this we can also you know then prompt it to launch itself but that would be redundant so i'm just going to exit i'm just going to close the server and if we list the file right now you can see that we have the data.sh file so let's see if we can run it of course we have to give it executable permission so chmod 775 and we're going to use data.s8 and i'm going to hit enter and let's launch the data. shell script and grenade enter and as you can see the script was successfully compiled over netcat which is excellent and this is a fantastic way of transferring data between client and server and vice versa you can do this as well so you can see that the script ran and it and it tells us this was sent over netcat and you can understand the implications of uh you know you know transferring commands in the form of a by script they can run a whole multi multitude of other services and uh you know give you further access to the system that you're trying to exploit all right so that is going to be it for this video and i'll be seeing you in the next video
Original Description
Hey guys! HackerSploit here back again with another video, in this video, I will be showing you how to transfer files with Netcat.
Our Platforms:
Hsploit: https://hsploit.com/
HackerSploit Forum: https://hackersploit.org/
HackerSploit Academy: https://hackersploit.io/
HackerSploit Podcast: https://soundcloud.com/hackersploit
iTunes: https://itunes.apple.com/us/podcast/the-hackersploit-podcast/id1439732519?mt=2
⭐SUPPORT HACKERSPLOIT BY USING THE FOLLOWING LINKS:
NordVPN: https://nordvpn.org/hacker
Use the link above or the code below for 77% Off your order
Promo Code: hacker
Patreon: http://patreon.com/hackersploit
I Hope you enjoy/enjoyed the video.
If you have any questions or suggestions feel free to ask them in the comments section or on my social networks.
🔗 HackerSploit Website: https://hsploit.com/
🔹 SUPPORT THE CHANNEL
NordVPN Affiliate Link: https://nordvpn.org/hacker
Patreon: http://patreon.com/hackersploit
🔹 GET OUT COURSES
Get a special discount on our courses:
The Complete Deep Web Course 2018:
https://www.udemy.com/the-complete-deep-web-course-2017/?couponCode=DWCBP2017
🔹 SOCIAL NETWORKS - Connect With Us!
-------------------------------
Facebook: https://www.facebook.com/HackerSploit/
Twitter: https://twitter.com/HackerSploit
Instagram: https://www.instagram.com/hackersploit/
Patreon: http://patreon.com/hackersploit
--------------------------------
Thanks for watching!
Благодаря за гледането
Kiitos katsomisesta
Danke fürs Zuschauen!
感谢您观看
Merci d'avoir regardé
Grazie per la visione
Gracias por ver
شكرا للمشاهدة
دیکھنے کے لیے شکریہ
देखने के लिए धन्यवाद
#KaliLinux#Netcat
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from HackerSploit · HackerSploit · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How To Install Kali Linux 2.0 On Virtual Box
HackerSploit
100 Subscriber Q&A! - How I Learned Ethical Hacking
HackerSploit
BlackArch Linux Review - Better Than Kali Linux?
HackerSploit
How to Access the Deep Web Safely | Deep Web Starter Guide 1.0
HackerSploit
Wireshark Tutorial for Beginners - Installation
HackerSploit
Wireshark Tutorial for Beginners - Overview of the environment
HackerSploit
Wireshark Tutorial for Beginners - Capture options
HackerSploit
Wireshark Tutorial for Beginners - Filters
HackerSploit
Complete Ethical Hacking Course - Become a Hacker Today - #1 Hacking Terminology
HackerSploit
Complete Ethical Hacking Course #2 - Installing Kali Linux
HackerSploit
Parrot OS 3.5 Review | The Best Kali Linux Alternative
HackerSploit
Nmap Tutorial For Beginners - 1 - What is Nmap?
HackerSploit
Katoolin | How To Install Pentesting Tools On Any Linux Distro
HackerSploit
Nmap Tutorial For Beginners - 2 - Advanced Scanning
HackerSploit
Nmap Tutorial For Beginners - 3 - Aggressive Scanning
HackerSploit
Zenmap Tutorial For Beginners
HackerSploit
How To Setup Proxychains In Kali Linux - #1 - Stay Anonymous
HackerSploit
How To Setup Proxychains In Kali Linux - #2 - Change Your IP
HackerSploit
How To Change Mac Address In Kali Linux | Macchanger
HackerSploit
How To Setup And Use anonsurf On Kali Linux | Stay Anonymous
HackerSploit
Ubuntu 17.04 "Zesty Zapus" Review - Bye Unity
HackerSploit
VPN And DNS For Beginners | Kali Linux
HackerSploit
Tails OS Installation And Review - Access The Deep Web/Dark Net
HackerSploit
Steganography Tutorial - Hide Messages In Images
HackerSploit
The Lazy Script - Kali Linux 2017.1 - Automate Penetration Testing!
HackerSploit
Best Linux Distributions For Penetration Testing
HackerSploit
Netcat Tutorial - The Swiss Army Knife Of Networking - Reverse Shell
HackerSploit
Gaining Access - Web Server Hacking - Metasploitable - #1
HackerSploit
Web Server Hacking - FTP Backdoor Command Execution With Metasploit - #2
HackerSploit
How To Install Kali Linux On VMware - Complete Guide 2018
HackerSploit
Q&A #1 - Best Cyber-security Certifications?
HackerSploit
Terminator - Kali Linux - Multiple Terminals
HackerSploit
Shodan Search Engine Tutorial - Access Routers,Servers,Webcams + Install CLI
HackerSploit
Q&A #2 - Mr Robot?
HackerSploit
Metasploit Community Web GUI - Installation And Overview
HackerSploit
Linux Expl0rer - Forensics Toolbox - Installation & Configuration
HackerSploit
QuasarRAT - The Best Windows RAT? - Remote Administration Tool for Windows
HackerSploit
Metasploit For Beginners - #1 - The Basics - Modules, Exploits & Payloads
HackerSploit
Metasploit For Beginners - #2 - Understanding Metasploit Modules
HackerSploit
Kali Linux Quick Tips - #1 - Adding a non-root user
HackerSploit
Metasploit For Beginners - #3 - Information Gathering - Auxiliary Scanners
HackerSploit
Spectre Meltdown Vulnerability - How To Check Your System
HackerSploit
Metasploit For Beginners - #4 - Basic Exploitation
HackerSploit
ARP Spoofing With arpspoof - MITM
HackerSploit
WordPress Vulnerability Scanning With WPScan
HackerSploit
Generating A PHP Backdoor with weevely
HackerSploit
Nikto Web Vulnerability Scanner - Web Penetration Testing - #1
HackerSploit
How To Install Kali Linux On Windows 10 - Windows Subsystem For Linux
HackerSploit
Stacer - System Optimizer And Monitoring Tool For Linux
HackerSploit
Kali Linux 2018.1 - Kernel Updates & Patches
HackerSploit
MITM With Ettercap - ARP Poisoning
HackerSploit
Password Cracking With John The Ripper - RAR/ZIP & Linux Passwords
HackerSploit
How To Detect Rootkits On Kali Linux - chkrootkit & rkhunter
HackerSploit
Channel Updates - How To Post Questions & Video Suggestions
HackerSploit
Web App Penetration Testing - #1 - Setting Up Burp Suite
HackerSploit
Web App Penetration Testing - #2 - Spidering & DVWA
HackerSploit
Cl0neMast3r - GitHub Repository Cloning Tool
HackerSploit
Kali Linux On Windows 10 Official - WSL - Installation & Configuration
HackerSploit
DoS/DDoS Protection - How To Enable ICMP, UDP & TCP Flood Filtering
HackerSploit
Web App Penetration Testing - #3 - Brute Force With Burp Suite
HackerSploit
More on: Tool Use & Function Calling
View skill →
🎓
Tutor Explanation
DeepCamp AI