Networking Forums

Networking Forums > Computer Networking > Linux Networking > Howto redirect traffic from local machine to internet back to local machine?

Reply
Thread Tools Display Modes

Howto redirect traffic from local machine to internet back to local machine?

 
 
Martin Kahlert
Guest
Posts: n/a

 
      11-25-2005, 07:40 AM
Hi!

I have the following problem:
A program (malware) is running on my linux box and i want to check what it
does.
This program sends a lot of traffic to different IP addresses on the internet.
I know the destination port(s), but i do not know the IP in advance.

How can i redirect all traffic (with known dest port) originating from my
local box to the internet back to my local machine?

To make it clearer:
Assume i want to redirect all connection attempts to external mail-servers
coming from my local machine back to my own box.

This is what i tried so far (my box has IP 192.168.100.182):
# cat fw.sh

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -t nat -A PREROUTING -p tcp -d ! 192.168.100.0/24 --dport 25 \
-j DNAT --to 127.0.0.1:25

but unfortunately, it does not work:
$ telnet mail.gmx.net 25
Trying 213.165.64.20...
Connected to mail.gmx.net. <---- of course, that's not my machine
Escape character is '^]'.
220 {mp033} GMX Mailservices ESMTP

The same happens with
iptables -t nat -A PREROUTING -p tcp -d ! 192.168.100.182 --dport 25 \
-j DNAT --to 127.0.0.1:25

Why does this not work?

Can any kind soul please help me?

Thanks in advance!

Regards
Martin.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Similar function on a local machine? Linksys WiFi Wireless Internet 0 12-11-2007 12:37 AM
Windows 98 machine won't access Internet or local shared devices on startup Ture Magnusson Wireless Networks 1 06-21-2005 10:03 AM
ME machine not found on local network Phil Windows Networking 2 03-08-2005 11:14 AM
Samba: local machine NT accounts. Andrey Asadchev Linux Networking 0 02-24-2004 09:56 AM
Bandwidth shaping on the local machine HELP! Graeme Hinchliffe Linux Networking 3 09-12-2003 03:25 AM



1 2 3 4 5 6 7 8 9 10 11