Anyone know of any good netcat tutorials?

Son Goku

No lover of dogma
Joined
14 Jun 2004
Messages
1,980
Umm, OK, I'm a bit lost here. Today's assignment includes

create a script using NC to create a server and client that uses a port not presently registere that logs in and gives you a shell

I'm currently trying to find a tutorial that describes the use of netcat, but don't seem to be finding something via google that's all too good in describing this for someone totally unfamiliar with the netcat command. Anyone know of any kind of tutorial or something, that can get me started in figuring out how to use this so I can then script it? There doesn't seem to be any man pages on it either...

thx in advance...
 
That's easy. Not much too it. Some simple shell scripting, and you are on your way. Since this is a homework assignment, i will complete the work required in exactly 1 week from now, or now at an onetime charge of $120.

You don't need a tutorial at all for this.

I'll give you a hint:

man nc

Incase you don't have the man page local, here it is on the web: http://www.freebsd.org/cgi/man.cgi?...ath=FreeBSD+5.3-RELEASE+and+Ports&format=html
 
OK, thx, I tried both man netcat and man nc and both came up document not found...
 
Like i had said, i'd give it to you in a week:

Code:
mkfifo in; nc -l 5000 < in | bash > in 2>&1

The 2>&1 causes all errors that bash reports, to be put into the pipe in as well, so that if you type in a bad command it will tell you.

Do note: no promt is available, as bash is not running on a TTY.

Code:
nc localhost 5000

and talk shell. standard commands like ps auxww, and whatnot all work. Only thing to watch out for, when bash dies, nc does not know. So you'd need to script it to check wether bash is dead or not, also, only one client at a time, but you never specified you need multiple. Otherwise it's still an easy fix, just a bit more scripting needed.
 
OK, thx

Actually a chat client is what the whole class was getting first...as the students started messaging each other in class :D

The teacher mentioned 2 lines...I'm gathering you incorporated both into a single command line...
 
no, i just put a semicolon between the two commands, this way the shell will execute them one after the other.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back