Malicious Software And Spoofed Ip Addresses - Red Hat ENTERPRISE LINUX 5 - DEPLOYMENT Deployment Manual

Hide thumbs Also See for ENTERPRISE LINUX 5 - DEPLOYMENT:
Table of Contents

Advertisement

Malicious Software and Spoofed IP Addresses

43.8.5.3. DMZs and IPTables
You can create iptables rules to route traffic to certain machines, such as a dedicated HTTP or
FTP server, in a demilitarized zone (DMZ). A DMZ is a special local subnetwork dedicated to providing
services on a public carrier, such as the Internet.
For example, to set a rule for routing incoming HTTP requests to a dedicated HTTP server at 10.0.4.2
(outside of the 192.168.1.0/24 range of the LAN), NAT uses the PREROUTING table to forward the
packets to the appropriate destination:
[root@myServer ~ ] # iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-
destination 10.0.4.2:80
With this command, all HTTP connections to port 80 from outside of the LAN are routed to the HTTP
server on a network separate from the rest of the internal network. This form of network segmentation
can prove safer than allowing HTTP connections to a machine on the network.
If the HTTP server is configured to accept secure connections, then port 443 must be forwarded as
well.
43.8.6. Malicious Software and Spoofed IP Addresses
More elaborate rules can be created that control access to specific subnets, or even specific nodes,
within a LAN. You can also restrict certain dubious applications or programs such as trojans, worms,
and other client/server viruses from contacting their server.
For example, some trojans scan networks for services on ports from 31337 to 31340 (called the elite
ports in cracking terminology).
Since there are no legitimate services that communicate via these non-standard ports, blocking them
can effectively diminish the chances that potentially infected nodes on your network independently
communicate with their remote master servers.
The following rules drop all TCP traffic that attempts to use port 31337:
[root@myServer ~ ] # iptables -A OUTPUT -o eth0 -p tcp --dport 31337 --sport 31337 -j DROP
[root@myServer ~ ] # iptables -A FORWARD -o eth0 -p tcp --dport 31337 --sport 31337 -j DROP
You can also block outside connections that attempt to spoof private IP address ranges to infiltrate
your LAN.
For example, if your LAN uses the 192.168.1.0/24 range, you can design a rule that instructs the
Internet-facing network device (for example, eth0) to drop any packets to that device with an address
in your LAN IP range.
Because it is recommended to reject forwarded packets as a default policy, any other spoofed IP
address to the external-facing device (eth0) is rejected automatically.
[root@myServer ~ ] # iptables -A FORWARD -s 192.168.1.0/24 -i eth0 -j DROP
707

Advertisement

Table of Contents
loading

Table of Contents