Tools - rinetd - port forwarding/redirection

来源:互联网 发布:淘宝如何看自己的等级 编辑:程序博客网 时间:2024/05/19 07:43

Install rinetd

Port forwarding/redirection is the simplest traffic manipulation technique we will examine. It involves accepting traffic on a given IP address and port and then simply redirecting it to a different IP address and port . A simple port-forwarding tool such as rinetd is convenient and easy to configure.

root:~ /# apt-get install rinetdReading package lists... DoneBuilding dependency tree       Reading state information... DoneThe following packages were automatically installed and are no longer required:  libafpclient0 libcrypt-passwdmd5-perlUse 'apt-get autoremove' to remove them.The following NEW packages will be installed:  rinetd0 upgraded, 1 newly installed, 0 to remove and 32 not upgraded.Need to get 22.9 kB of archives.After this operation, 143 kB of additional disk space will be used.Get:1 http://repo.kali.org/kali/ kali/main rinetd i386 0.62-5.1 [22.9 kB]Fetched 22.9 kB in 1s (18.4 kB/s)Selecting previously unselected package rinetd.(Reading database ... 356615 files and directories currently installed.)Unpacking rinetd (from .../rinetd_0.62-5.1_i386.deb) ...Processing triggers for man-db ...Setting up rinetd (0.62-5.1) ...update-rc.d: We have no instructions for the rinetd init script.update-rc.d: It looks like a non-network service, we enable it.insserv: warning: script 'redis' missing LSB tags and overridesinsserv: warning: script 'dnsmasq' missing LSB tags and overridesStarting internet redirection server: rinetd.

rinetd service

root:~ /# service rinetd restart Stopping internet redirection server: rinetd.Starting internet redirection server: rinetd.

Configuration file

root:~ /# cat /etc/rinetd.conf ## this is the configuration file for rinetd, the internet redirection server## you may specify global allow and deny rules here# only ip addresses are matched, hostnames cannot be specified here# the wildcards you may use are * and ?## allow 192.168.2.*# deny 192.168.2.1?## forwarding rules come here## you may specify allow and deny rules after a specific forwarding rule# to apply to only that forwarding rule## bindadress    bindport  connectaddress  connectport0.0.0.0  8080  127.0.0.1 80# logging informationlogfile /var/log/rinetd.log# uncomment the following line if you want web-server style logfile format# logcommon

You can connect to port 8080, and traffic will be redirected to port 80.

0 0
原创粉丝点击