Tools - rinetd - port forwarding/redirection

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 rinetd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libafpclient0 libcrypt-passwdmd5-perl
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  rinetd
0 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 overrides
insserv: warning: script 'dnsmasq' missing LSB tags and overrides
Starting 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  connectport
0.0.0.0  8080  127.0.0.1 80

# logging information
logfile /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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值