Tuesday, October 9, 2012

Ncat HTTP Proxy

[root@localhost Downloads]# uname -a
Linux localhost.localdomain 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost Downloads]# 
[root@localhost Downloads]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.3 (Santiago)
[root@localhost Downloads]# 
[root@localhost Downloads]# ls -l
total 892
-rw-r--r--. 1 root root 909460 Oct  9 15:37 ncat-6.01-1.x86_64.rpm
[root@localhost Downloads]# 
[root@localhost Downloads]# rpm -vhU ncat-6.01-1.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:ncat                   ########################################### [100%]
[root@localhost Downloads]# 
[root@localhost Downloads]# which ncat
/usr/bin/ncat
[root@localhost Downloads]# 
[root@localhost Downloads]# netstat -an | grep 8080
[root@localhost Downloads]# 
[root@localhost Downloads]# ncat -l 8080 --proxy-type http &
[1] 28406
[root@localhost Downloads]# 
[root@localhost Downloads]# ps -ef | grep ncat
root     28064     1  0 15:38 ?        00:00:01 gedit /root/Desktop/ncat
root     28406 27911  0 15:46 pts/0    00:00:00 ncat -l 8080 --proxy-type http
root     28408 27911  0 15:46 pts/0    00:00:00 grep ncat
[root@localhost Downloads]# 
[root@localhost Downloads]# netstat -an | grep 8080
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN      
tcp        0      0 :::8080                     :::*                        LISTEN      
[root@localhost Downloads]# 
[root@localhost Downloads]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:BC:40:01  
          <span style="background-color: #fdff7b;">inet addr:192.168.18.101</span>  Bcast:192.168.18.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:febc:4001/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13042 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2318 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2924825 (2.7 MiB)  TX bytes:761972 (744.1 KiB)

[root@localhost Downloads]# 



[root@localhost Downloads]# netstat -an | grep 8080
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN      
tcp        0      0 192.168.18.101:8080         192.168.18.1:5929           ESTABLISHED 
tcp        0      0 192.168.18.101:8080         192.168.18.1:5927           TIME_WAIT   
tcp        0      0 :::8080                     :::*                        LISTEN      
[root@localhost Downloads]# 
[root@localhost Downloads]# ps -ef | grep ncat
root     28064     1  0 15:38 ?        00:00:01 gedit /root/Desktop/ncat
root     28406 27911  0 15:46 pts/0    00:00:00 ncat -l 8080 --proxy-type http
root     28424 27911  0 15:47 pts/0    00:00:00 grep ncat
[root@localhost Downloads]# 

Note: Make sure that the Linux iptables firewall is disabled or permit TCP/8080.

No comments:

Post a Comment