Port redirection with Netcat
I am having some problem regrading the phases of the redirection of ports.I have two communications've been having a look at port redirection with netcat and detecting some problem getting duplex communication accross the link.
The transformation of the contents are going as -
source box nc -nvv 192.168.1.111 80
redirector box nc -lvvp 80|nc -vv 192.168.1.222 555
target box - nc -lvvp 555
I can send text one way i.e. The target successfully but not back from the target but the result is not getting back from the target box.Can you provide me some suggestion regarding this then please tell me the solution for it.
Port redirection with Netcat
You need to use a backpipe to communicate and get the required result from the target server.The following command can help you to create this-
Code:
mknod backpipe p
nc -l -p 80 0<backpipe | tee -a inflow | nc localhost 81 | tee -a outflow 1>backpipe
The mknode will create a back-pipe and attatch the appropriate port number of every phases and deliver it on the prompt.
Port redirection with Netcat
The Netcat is one of the Linux command line tools which is used to perform not only for scanning the ports of the network node,it can be used for many purposes.
The netcat creates a TCP socket (it's an automatic behavior of this command)either in listening mode or a socket that is used in order to connect to a server. The netcat command does not perform different function for server and a client. It captures the data from stdin and send back to the request node in the network.
There are so many task can be performed using the netcat command which are as follows -
- Transferring Files
- Security purpose
- Telnet-like Usage
- used to scan the Port
Linux port scanning with netcat (nc) command
If the nmap is currently not installed in the system then you can use another network level command which is very useful for different purposes.You can issue the nc / netcat command to check the status of the port.
The -z option specifies that report the status of open ports.One of the example is given below to find out the same,execute the nc command associated with -z flag and the host name or ip address along with the port range.
Code:
$ nc -z www.techarena.in 1-1023
Transferring Files using netcat command
Transferring Files using netcat command
The necat command can be used to Transferring Files in the network.The same method would be used to transfer the files between two computers. You have to specify a server that available the file with the following manner:
$ cat bkup.iso | nc -l 3333
Receive the iso file from the client side machine using -
$ nc 192.168.0.1 3333 > bkup.iso
Port redirection with nmap
Another command provided by the Linux library named nmap command.In case,when you not installed the netcat command in the linux registry,you can use it very successfully.The network user can scan the whole network or specific host or single server.
TCP Connected scanning for localhost and network 192.168.0.0/24 and the command would be issued as -
Code:
# nmap -v -sT localhost
# nmap -v -sT 192.168.0.0/24