Linux Terminal 101: How to Use Netcat To Chat
HTML-код
- Опубликовано: 5 окт 2024
- Hak5 -- Cyber Security Education, Inspiration, News & Community since 2005:
____________________________________________
This week we are getting into using Netcat to setup an instant chat network.
~-~~-~~~-~~-~
Please watch: "Bash Bunny Primer - Hak5 2225"
• Bash Bunny Primer - Ha...
~-~~-~~~-~~-~
____________________________________________
Founded in 2005, Hak5's mission is to advance the InfoSec industry. We do this through our award winning educational podcasts, leading pentest gear, and inclusive community - where all hackers belong.
It's the modern way to 'pass notes' during class. :)
Video starts from 3:03
Xt3rminator why lose the sight of her marvellous RACK?
@@danilodistefanis5990 my bad ,😂😂. I was too focused on netcat at the time of watching the video.
You're a heroe without cape
that moment when you get it to I felt like a kid aging a had this huge burst of joy! I love hak5
Great video, thanks for that! Some versions of netcat don't require the "-p" so commands would be only
nc -l 31337
nc 10.73.31.145 31337
If in "man nc" it says for the "-p"option: "It is an error to use this option in conjunction with the -l option.", that's your case!
You are not talking about GNU netcat right? because I am pretty sure BSD-netcat has that "It is an error to use this option in conjunction with the -l option." phrase in their man page.
There seems to be a little confusion in the comments. What netcat does, is transmit data over network sockets from the stdin of the terminal, and writes anything we get back to stdout. Every net protocol uses this method. Sometimes the data is encrypted (Like SSH), sometimes you're talking to a program (Like FTP), and sometimes you're talking to people (Like IRC). Homework: Try netcatting some servers, and see what you get back (FTP is usually user friendly from netcat).
Thanks for your input!
Netcat is a good way to copy/paste between different machines.
i used it on my own computer and it is awesome. it worked perfectly
You can pipe commands into the chat terminal so you can send text files, other command outputs and kind of play command line based games.
I love you Shannon. Ok, I do use NC, I actually have a small script that will base64 encode your outgoing message but then use crypt to encrypt w/Hash using the MM/DD/YY & on the other machine when received with the date timestamp before the message it'll decrypt the message using that TS as the Hash to decode the Msg. But now you're stuck with a base64 message so that's where the Node.JS comes in w/jQuery & auto-loads the var to an IMG tag from the WebSocket and display the message within an image, no actual text.
nice, that would be what a png? plz share..
I am using PNG because it's super light-weight. But you can encode it to any image format you'd like.
My project is done via Browser (this way it can be cross-platform compatible & literally P2P) using PHP. I am also using BLOWFISH.
So, chop(mcrypt_ecb(MCRYPT_BLOWFISH,$curKEY,base64_decode($incomingSocket),MCRYPT_DECRYPT));
Obviously more to it but that's the gest of it. I once thought about making it public as a service (free) or as open source but I figured I would be laughed at.
Highest port number you could listen is 65535 and the lowest number would be somewhere around 100.All the ports that are less than 100 are for the superuser(for os).
Less than 1024
stilll loving it that netcat command
I've used netcat with a tar pipe to get a large amount of files over the network
+Joshua Kleiner As an example:
On the receiving end do:
# netcat -l -p 7000 | tar xAnd on the sending end do:
# tar cf - * | netcat otherhost 7000tar cf - * is copy everything in the current working directory.
(from toast.djw.org.uk/tarpipe.html)
Thnx. Actually did not know you could chat on netcat. But i use other software for that ;) Thanks for the video thou. Netcat is really a swiss army knife.
I have a question Hak5 please do answer!!!!! I want to send a file from one computer to another, and the computer which receives the file always listens for the file of that specific name f0r days( like 7 days) can you tell me if it is possible to act as a server for a week's time without getting disturbed by others except that computer which sends me a file( I know the name of file and also the ip address of the sender)
Maybe can be used in communication between distributed processes across various platforms?
The cat command copies standard input to standard output.
I recently used netcat to answer http requests with the output of curl... proxying an authenticated API call.
Is it only possible if the two devices connected to a same network or wifi ?
I have been trying to connect my two pc which is connected to my mobile hotspot , but the connection is not getting established.
could anyone help me?
how can i chat in android tab with netcat in termux terminal please tell me
Use the builtin package manager to install netcat, then use a keyboard (physical or software) and chat away.
How would you spell the "-" key? "tack", "teck", "takey", "tab key" ??? Is it correct to call it like that? not dash?
+김세진 It originates as a navy term for flag signalling which has seen cross over into other parts of the navy (e.g. marines):"In addition to the 68 flags in the bag, you have a tackline. A tackline is a length of halyard approximately 6 feet long; the exact length depends upon the size of flags in use. The tackline is transmitted and spoken as tack and is written as a dash (hyphen) "-". It is used to avoid ambiguity. It separates signals or groups of numerals that, if not separated, could convey a different meaning from that intended.Example: If the signal SL2 means “Prepare to receive personnel casualties,” TACK would be inserted between the digit 2 and the given number of casualties: SL2 TACK 27.TACK also is used to separate range and bearing figures. If C3 means “Investigate possible sighting,” the signal might be C3 TACK 345 TACK 20, indicating the sighting at a bearing of 345 and a distance of 20 miles."
If we want to chat between to out of network terminal
Can we solve this via port forward ?
If no so what to do ?
interesting! It is worth a try ;)
Just use the talk command. It's been in Linux since the 1990s.
Which version of linux mint is she using ?
imagine being able to look at something except the doubld d'zz
Although, I got one question Hak5...
Can we chat over WAN? Like, I am in San Francisco and my friend is in Barcelona, can we establish a connection and communicate??
As long as the person that's running the listener/server has the port open, you should be good. Do note that chatting over ncat is unencrypted.
using netcat for transferring between virtualized systems
What if we went to chat in 2 different networks
cool. works on android too : )
This might be a dumb question, but does this command work for Mac OS X too? since OS X also uses a UNIX based system?
As long as there's someone building macOS binaries for netcat (if it's not already available), then it would work.
pretty decent for making pranks and plans.
Day 3000... still cant get it to work on windows :(
Thanks
I tried and it doesn't work, what can be a problem?
the government s watching you
netchat?
Yeeee boiii
the smiling languaje is the way we always expect being happy in that moment we found alone and together. the smiling languaje is hard to learm ,just becouse if it need a kiss would be whith a hug
bish how do ya get dis weed i want sum
how can we use this over LAN
can you chat with more than 2 people?
only if I'm in the mood....
Thanks you (from Ukraine)
Уже началась, наша власть невинных людей бъет
Если ты с России то знай, Ваше телевиденье врет что люди нападали на "Беркут"... Люди пели гимн Украины а их били...
muy buenos sus videos...estaria bueno que puedan hacer subtitulos para español...saludos
Awesome :)
netcat is flagged by all av .including defender. use meterpreter instead.
Why don't you update to Windows 8.1? Its free and they bring the start button back
Its just a button to take you to start screen, people are still spreading this misinformation
HackedTech Yes, that is true but right clicking adds a nice list of "Power User" options... Simply adding that functionality into the system was well worth the upgrade to me. Prior to 8.1 I despised the whole Metro interface, but now I have a hybrid system that uses the best parts of both experiences on a desktop.
It also improves performance, especially at start up
Better performance, ability to boot to desktop and more customization. And its a free upgrade so there's nothing to lose
***** why?
Haha! 31337 = elite in 1337 speak ;)
I thought i was the only one who caught that
Please don't use port 31337, a lot of software and hardware protection tools deny port 31337, if you don't know why, please fell free to look it up.
NMAP uses port 31337 for ssh ncat-chat.
Go ahead and run a scan on scanme.nmap.org - it's perfectly legal and you'll see that even they have it open/running. I have a hard time believing professionals the likes of nmap devs and their domain admins would give the same advice you did.
Thanks for the permission to look it up!
Run its working atlast!
I'm guessing you could tunnel this through ssh for security? I'd think it'd work...? Anyone- Yes, no, maybe?
Technically, this is all SSH is, except the 'messages' are encrypted, and the listener mimics bash. You could write a nice little program to generate a private key, share a public key, and then chat securely using any encryption method you want.
Taiiwo Llort Mmmmmm...but ssh has more functionality than netcat?
You don't understand. Netcat sends data over network sockets, and shows the data it receives. SSH also uses network sockets by transmitting your commands over to a program waiting to execute them, and sending back the response. This is the same for all network protocols such as FTP and HTTP.
Taiiwo Llort Aaahhhhh...ok.
You could use gpg on the netcat input/output streams, that's kinda the same.
Here's an example I found of encrypting a file transfer with nc and gpg.
mishotips.blogspot.com/2013/05/redirecting-standard-input-and-output.html
so many love bites
i think you can steal peoples banners with dat :)
Windows :/
Fail
if u run putty and connect to a server it works.
you Know what i find funny is snubs running servers jesus christ! lol oh boy.
+ereal2 whats funny about being new?
YAV AMMA TALKİNG
31337
We don't need to 'take a break' as you put it, after 1 minute and 27 seconds because a) we are not in America where you are used to bombarding each other with ads every 15 seconds - we are on the Internet. b) your show isn't that interesting that I want to sit through any adverts. So drop your ridiculous 'take a break' approach and grow a brain. Here's me pausing your show, writing this comment, and then switching off. Blip.
Jenalgo Please provide an example more interesting netcat tutorial series. If you're not interested in the subject matter of the show, why are you watching? It's amazing to see they can earn some money for helping us sysadmins. It's youtube too, if you hate the ad so much just fast forward through it.
+Jenalgo it's called sponsorships, it's how they can afford to keep their series going without relying entirely on adsense revenue, which isn't much.
the break isn't for you it for them they do everything live
Jenalgo Repling to your comment. I'd say it's Understandable... But ask yourself this. Would you rather have malicious Google AdSense? How about Ads that are irrelevant, or those crappy 30sec Ads you can't skip??? I will just assume you wouldn't.
ALSO..
We all love the crew at Hak5 and they put out content that's extremely valuable to some viewers. I myself am thankful for this because I'm thirsty for knowledge and I hate reading... Making my point. I don't mind seeing sponsor advertising becuase all I got to do is click on the right side of RUclips video and it will fast forward as far as I'd like, Anytime I desire. The sponsors are tech related and I find the spons.. worth it. Ive gotten so many deals and free trials all because I waited 15 sec.
Don't watch this show then, instead of demanding her to stop doing things.
Terrible example. Very bad. I can do better!!