Solved

Uses of netcat (nc) with named pipe (mkfifo)

Posted on 2011-09-30
2
1,227 Views
Last Modified: 2012-05-12
Hello, I would like to know if there is a well known usage of using named pipe with nc. I vaguely remember there was something to put a temporary arrangement on port 80 in case web server goes down using netcat and mkfifo. Please let me know if someone is aware of this. Thanks!
0
Comment
Question by:beer9
2 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 250 total points
Comment Utility
Sure there is.

If you may remember, a named pipe is just a pipe except that it is a file in *nix.  So you can redirect data stream to it and at the other end you can read data stream from it.

Netcat is a utility that can act both as a client and as server.  You can listen to any port number as either TCP or UDP.  Then you may redirect that data to a named pipe and then read it from the named pipe.
0
 
LVL 9

Assisted Solution

by:expert_tanmay
expert_tanmay earned 250 total points
Comment Utility
The following command will listen on port 80. Any request on port 80, will be returned with the file content of work_in_progress.html and also the request from the client will be logged in /tmp/requests.

while true ; do cat /var/httpd/error/work_in_progress.html  | nc -l -p 80 | head --bytes 2000 >>/tmp/requests ; date >>/tmp/requests ; done

Cheers
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now