view · edit · history · print

Bind IP address

Download & compile:

 
gcc -nostartfiles -fpic -shared bind.c -o bind.so -ldl -D_GNU_SOURCE
strip bind.so
cp -i bind.so /usr/lib/

set additional IP
ifconfig lo:2 127.0.0.2 netmask 255.0.0.0 up

root@begentw006248:/home/wvh# BIND_ADDR="127.0.0.2" LD_PRELOAD=/usr/lib/bind.so telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 begentw006248 ESMTP Exim 4.76 Wed, 13 Nov 2013 16:28:57 +0100


root@begentw006248:~# tcpdump -i lo -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
16:28:57.945308 IP 127.0.0.2.40999 > 127.0.0.1.25: Flags [S], seq 4256629627, win 32792, options [mss 16396,sackOK,TS val 4609769 ecr 0,nop,wscale 7], length 0
16:28:57.945318 IP 127.0.0.1.25 > 127.0.0.2.40999: Flags [S.], seq 4250989312, ack 4256629628, win 32768, options [mss 16396,sackOK,TS val 4609769 ecr 4609769,nop,wscale 7], length 0
16:28:57.945323 IP 127.0.0.2.40999 > 127.0.0.1.25: Flags [.], ack 1, win 257, options [nop,nop,TS val 4609769 ecr 4609769], length 0
16:28:57.945676 IP 127.0.0.1.53347 > 127.0.0.2.113: Flags [S], seq 4247972978, win 32792, options [mss 16396,sackOK,TS val 4609769 ecr 0,nop,wscale 7], length 0
16:28:57.945682 IP 127.0.0.2.113 > 127.0.0.1.53347: Flags [R.], seq 0, ack 4247972979, win 0, length 0
16:28:57.946745 IP 127.0.0.1.25 > 127.0.0.2.40999: Flags [P.], seq 1:68, ack 1, win 256, options [nop,nop,TS val 4609770 ecr 4609769], length 67
16:28:57.946754 IP 127.0.0.2.40999 > 127.0.0.1.25: Flags [.], ack 68, win 257, options [nop,nop,TS val 4609770 ecr 4609770], length 0
admin · attr · attach · edit · history · print
Page last modified on December 20, 2013, at 04:04 AM