· 7 years ago · Feb 02, 2018, 09:04 AM
1ncat -l 9999 -c 'read i; /home/abhishek/hello.sh $i'
2
3#!/bin/bash
4echo "Hello $1"
5
6echo abhishek | ncat -v localhost 9999
7Ncat: Version 7.60 ( https://nmap.org/ncat )
8Ncat: Connected to ::1:9999.
9Hello abhishek
10Ncat: 9 bytes sent, 17 bytes received in 0.04 seconds.
11
12echo abhishek | ncat -v 192.168.1.12 9999
13Ncat: Version 7.60 ( https://nmap.org/ncat )
14Ncat: Connected to 129.221.43.94:9999.
15Ncat: 9 bytes sent, 0 bytes received in 0.44 seconds.