Main > Free Download Search >

Free how does packet loss occur at output ports software for linux

how does packet loss occur at output ports

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 4492
Layer-7 Packet Classifier for Linux 2007-07-27 (Pattern Definitions)

Layer-7 Packet Classifier for Linux 2007-07-27 (Pattern Definitions)


Layer-7 Packet Classifier for Linux is a packet classifier for Netfilter that identifies packets based on application layer. more>>
Layer-7 Packet Classifier for Linux is a packet classifier for Netfilter that identifies packets based on application layer (OSI layer 7) data. This means that it is able to classify packets as HTTP, FTP, Gnucleus, Kazaa, etc., regardless of ports.
It complements existing matches that classify based on port numbers, packet length, TOS bits, and so on. Combined with Linux QoS, it allows for full layer 7 packet shaping.
Main features:
- Patches for Linux 2.4 and 2.6
- Support for TCP, UDP and ICMP over IPv4
- Uses Netfilters connection tracking of FTP, IRC, etc
- Examines data across multiple packets
- Number of packets examined tunable on the fly through /proc
- Number of bytes examined tunable at module load time
- Distinguishes between new connections (those still being tested) and old unidentified connections
- Gives access to both Netfilter and QoS (rate limiting) features
- With the Netfilter "helper" match, you can distinguish between parent and child connections (e.g. ftp command/data)
<<less
Download (MB)
Added: 2007-07-30 License: GPL (GNU General Public License) Price:
820 downloads
 
Other version of Layer-7 Packet Classifier for Linux
Layer-7 Packet Classifier for Linux 2.12.1Layer-7 Packet Classifier for Linux is a classifier for the Linux kernels Netfilter subsystem ... , port numbers and so on. Our intent is for l7-filter to be used in conjunction with Linux QoS to do
License:GPL (GNU General Public License)
Download (0.087MB)
842 downloads
Added: 2007-07-10
Layer-7 Packet Classifier for Linux 0.4 (Userspace)connections can evade l7-filter by sending a bunch of empty packets at the beginning. Perhaps a ... may be necessary at some point. - Made number of packets user selectable. Defaults to 10 (not 8
License:GPL (GNU General Public License)
Download (0.016MB)
950 downloads
Added: 2007-03-23
DNS Blacklist Packet Filter 0.6 Beta1

DNS Blacklist Packet Filter 0.6 Beta1


DNS Blacklist Packet Filter is a Linux netfilter client that decides whether to accept or drop packets. more>>
DNS Blacklist Packet Filter project is a Linux netfilter client that decides whether to accept or drop packets based on the results of a DNS blacklist query (such as MAPS, SORBS, or SPEWS, to name a few).

One use is to filter all incoming SMTP SYN packets for spam filtering.

<<less
Download (0.16MB)
Added: 2006-07-11 License: GPL (GNU General Public License) Price:
1209 downloads
Packet Construction Set 0.5 Beta

Packet Construction Set 0.5 Beta


Packet Construction Set is a set of Python modules and objects that make building network protocol code easier. more>>
Packet Construction Set is a set of Python modules and objects that make building network protocol code easier for the protocol developer.
The core of the system is the pcs module itself which provides the necessary functionality to create classes that implement packets.
Installation Instructions for Packet Construction Set (PCS)
PCS follows the normal Python conventions for building and installing and there is very little, if any, magic. To install the library and the associated packet classes into your system do:
> python setup.py install < return >
To test your installation do:
> cd tests/ < return >
> python *.py
Some tests fail if you do not have enough privileges to work with the Berkeley Packet Filter. If you wish to run those tests run them using sudo.
To build the documentation you will need pdflatex and a BSD version of make installed. Go into the docs directory and build the documentation:
> cd docs/ < return >
> bsdmake all
you will see PDF versions of the docs.
Enhancements:
- Move my version of Doug Songs Python pcap library into the package.
- Update the Makefile to make sure that we install correctly no matter what target is selected.
<<less
Download (0.36MB)
Added: 2007-03-22 License: BSD License Price:
947 downloads
Weight Loss Recipe Book 3.1

Weight Loss Recipe Book 3.1


Weight Loss Recipe Book is a free, online, community-built recipe book. more>>
Weight Loss Recipe Book is a free, online, community-built recipe book. Weight Loss Recipe Book contains everything you need to allow your web site visitors to submit recipes and everything your administrator needs to administer the recipes.
When a visitor submits a recipe, the recipe is added to a database and awaits approval from the administrator before being added to the public site.
Main features:
- Community built, meaning you just have to approve entries and watch your web site expand!
- Captcha validation to prevent automated entries into the recipe book.
- Complete administrator system - add administrators, recipe categories, manage recipes and more!
- Best of all, Weight Loss Recipe Book is totally free!
<<less
Download (0.061MB)
Added: 2006-05-08 License: Freeware Price:
1267 downloads
Advanced Packet Sniffer 0.19

Advanced Packet Sniffer 0.19


Aps is a small tool for analyzing network traffic. more>>
Aps is a small tool for analyzing network traffic. It prints out a great deal of information about the relevant protocols including TCP, UDP, ARP, and ICMP.
It allows you to filter IP addresses, hardware addresses, ports, and specific protocols. It comes with a little GTK-GUI displaying packet counters for each protocol.
APS tries to print detailed info about network frames that are received from the SOCK_RAW (ETH_P_ALL) socket. I am not sure if this is the clean way, but it works fine. APS prints info about the hardware layer and the IP and TCP/UDP/ICMP header.
The tail of the packet (mostly the data) wich could not be interpreted is written on the screen as ascii/hex-dump or both (your choice).
Example
HW-ADDR: 00:60:8c:f6:40:96 -----> 00:80:ad:30:8f:3b
IP-ADDR: 192.168.17.52 -----> 192.168.17.50
IP-Ver4 || Head:0x0a (bytes) || Service(TOS):16 || Length over all:0061
Fragmentation: ID:0x4079 - Flags: 0 1 0 - Offset:00000
TTL:064 || Protokoll:006 (TCP) || HeaderCRC:0x567b
TCP-HEADER:
Ports: 0023-->1034 (telnet) Seq./Ack. Nr.:0x70843468 / 0xeae29434
Data-Offset:0x05 Reserved-6Bit:00 Flags:-urg-ACK-PSH-rst-syn-fin-
Window:0x7fe0 CRC:0x9420 Urgent-Pointer:0x0000
73 61 74 75 72 6e 32 3a 2f 73 72 76 2f 70 72 69 6e 74 71 23 20
HW-ADDR: 52:54:40:25:8d:88 -----> ff:ff:ff:ff:ff:ff
SAMBA/NetBios
e0 e0 03 ff ff 00 22 00 11 00 00 00 00 ff ff ff ff ff ff 04 52 00 00 00 00 52
40 25 8d 88 40 08 00 03 00 04 20 20 20 20 20 20 20 20 20
HW-ADDR: 00:80:ad:30:8f:3b -----> 00:60:8c:f6:40:96
IP-ADDR: 192.168.17.50 -----> 194.112.123.200
IP-Ver4 || Head:0x0a (bytes) || Service(TOS):0 || Length over all:0029
Fragmentation: ID:0x29ae - Flags: 0 0 0 - Offset:00000
TTL:064 || Protokoll:001 (ICMP) || HeaderCRC:0x411f
echo request CODE:0x0 CRC:0xf9f5 SIG:0x602 NUM:0x0
00 ea
Enhancements:
- added break for Packet-counter and fixed some minor bugs
<<less
Download (0.088MB)
Added: 2005-09-21 License: GPL (GNU General Public License) Price:
1512 downloads
Packet Debugger 0.1 Beta

Packet Debugger 0.1 Beta


Packet Debugger presents a debugger-like UI for pcap packet capture files. more>>
Packet Debugger presents a debugger-like UI for pcap packet capture files.

The Packet Debugger (pdb) allows users to work with packet streams as if they were working with a source code debugger.

Users can list, inspect, modify, and retransmit any packet from captured files, as well as work with live packet captures.

<<less
Download (0.15MB)
Added: 2007-01-20 License: BSD License Price:
1010 downloads
fairly fast packet filter 1.5.0

fairly fast packet filter 1.5.0


The fairly fast packet filter (FFPF) is an approach to network packet processing. more>>
The fairly fast packet filter (FFPF) is an approach to network packet processing that adds many new features to existing filtering solutions like BPF.
fairly fast packet filter is designed for high speed by pushing computationally intensive tasks to the kernel or even network processors and by minimising packet copying.
By providing both access to richer programming languages and explicit extensibility, it is also considerably more flexible than existing approaches.
FFPF provides a complete solution for network monitoring that caters to all applications available today. Exploiting its extensibility, the language can even be used as a meta-filter to `script together filters from other approaches, such as BPF.
Main features:
- fast: processes significantly more packets per second than LSF (reference)
- scalable: transparently supports hardware assist, like that given by the Intel IXP2x00 network processors
- backward compatible: supports all existing libpcap based applications
- extensible: separates functionality from the framework. FFPF currently ships with implementations of BPF, Aho Corasick, Boyer Moore Horspool, and many more
- modular: new functions can be written in as little as 3 lines of code
- secure: relies on Keynote for authentication and resource control
- open and standard adherent: licensed under the GNU General Public License (GPL). It implements the Monitoring API (MAPI) draft as designed by the EU-SCAMPI consortium
Enhancements:
- enabled kernelspace processing
- enabled all 5 buffer implementations (Continuous, Fixed-size slot, Variable sized slot, Double ring and Index)
- added TCP stream reassembly and early implementation of zero-copy reassembly
- added PCAP input and output support, for userspace testing and offline use
- added additional minor functions: TCP Synprotect, output to files, ...
- added support for UDEV
- extended controlplane: flowspaces can now be queried for live state
- fixed up many bugs, hacks and irregularities.
<<less
Download (0.60MB)
Added: 2006-02-20 License: GPL (GNU General Public License) Price:
1342 downloads
Stone TCP/IP packet repeater 2.3c

Stone TCP/IP packet repeater 2.3c


Stone is an application layer TCP/IP packet repeater. more>>
Stone is an application layer TCP/IP packet repeater. It repeats TCP and UDP packets from the inside of a firewall to the outside or vice versa.

It is simple, supports OpenSSL for encrypting and decrypting packets, performing client and server verifications, and sending a substring of the subject of the certificate to the destination, can operate as an HTTP proxy, and performs POP to APOP conversion. It also supports IPv6 and can convert between IPv4 and IPv6 each other.

<<less
Download (0.082MB)
Added: 2006-09-30 License: GPL (GNU General Public License) Price:
1125 downloads
Servlet::ServletOutputStream 0.9.2

Servlet::ServletOutputStream 0.9.2


Servlet::ServletOutputStream is a servlet output stream interface. more>>
Servlet::ServletOutputStream is a servlet output stream interface.

SYNOPSIS

$stream->print($string);

$stream->println();
$stream->println($string);

$stream->write($string);
$stream->write($string, $length);
$stream->write($string, $length, $offset);

$stream->flush();

$stream->close();

Provides an output stream for writing binary data to a servlet response.
An output stream object is normally retrieved via "getOutputStream" in Servlet::ServletResponse.

NOTE: While this is an abstract class in the Java API, the Perl API provides it as an interface. The main difference is that the Perl version has no constructor. Also, it merges the methods declared in java.io.OutputStream and javax.servlet.ServletOutputStream into a single interface.

METHODS

close()

Closes the stream and releases any system resources associated with the stream.

Throws:

Servlet::Util::IOException

if an output exception occurred

flush()

Flushes this input stream and forces any buffered output bytes to be written out.

Throws:

Servlet::Util::IOException

if an output exception occurred

print($value)

Writes a scalar value to the client, with no carriage return-line feed (CRLF) character at the end.

Parameters:

$value

the value to send to the client

Throws:

Servlet::Util::IOException

if an output exception occurred

println([$value])

Writes a scalar value to the client, if specified, followed by a carriage return-line feed (CRLF) character.

Parameters:

$value

the (optional) value to send to the client

Throws:

Servlet::Util::IOException

if an output exception occurred

write($value)

write($value, $length)

write($value, $length, $offset)

Writes the scalar $value to the stream.

If no arguments are specified, functions exactly equivalently to print().

If $length is specified, writes that many bytes from $value. If $offset is specified, starts writing that many bytes from the beginning of $value. $offset and $length must not be negative, and $length must not be greater than the amount of data in $value starting from $offset.

Blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Parameters:

$value

a scalar value to be written

$length

the maximum number of bytes to write

$offset

the location in $value where data is read from

Throws:

Servlet::Util::IOException

if an input exception occurs

Servlet::Util::IndexOutOfBoundsException

if $buffer is specified as undef

<<less
Download (0.088MB)
Added: 2007-06-13 License: Perl Artistic License Price:
864 downloads
Packet Excalibur 1.0.2

Packet Excalibur 1.0.2


Packet Excalibur is a multi-platform graphical and scriptable network packet engine with extensible text-based protocol descript more>>
Packet Excalibur is a multi-platform graphical and scriptable network packet engine with extensible text-based protocol descriptions. It is a network tool designed to build and receive custom packets from network.

Pen testing firewalls, routers, or any network enable equipment. Validating your custom built protocols without the burden of writting lines of code. Teaching yourself how protocols works and articulates around each other.

Download the install package (PacketExcalibur_*.*_linux_tgz)

Unzip and untar the archive, run "make" in the "PacketExcalibur_*/main" directory,
- binaries are installed in /usr/sbin
- support packages are installed in /var/cache/excalibur
- preference file is created in the user home directory
<<less
Download (1.8MB)
Added: 2006-07-04 License: GPL (GNU General Public License) Price:
1259 downloads
NetPacket::UDP 0.04

NetPacket::UDP 0.04


NetPacket::UDP is a Perl module to assemble and disassemble UDP (User Datagram Protocol) packets. more>>
NetPacket::UDP is a Perl module to assemble and disassemble UDP (User Datagram Protocol) packets.

SYNOPSIS

use NetPacket::UDP;

$udp_obj = NetPacket::UDP->decode($raw_pkt);
$udp_pkt = NetPacket::UDP->encode($ip_obj);
$udp_data = NetPacket::UDP::strip($raw_pkt);

NetPacket::UDP provides a set of routines for assembling and disassembling packets using UDP (User Datagram Protocol).

Methods

NetPacket::UDP->decode([RAW PACKET])

Decode the raw packet data given and return an object containing instance data. This method will quite happily decode garbage input. It is the responsibility of the programmer to ensure valid packet data is passed to this method.

NetPacket::UDP->encode(param => value)

Return a UDP packet encoded with the instance data specified. Needs parts of the ip header contained in $ip_obj, the IP object, in order to calculate the UDP checksum. The length field will also be set automatically.

Functions

NetPacket::UDP::strip([RAW PACKET])

Return the encapsulated data (or payload) contained in the UDP packet. This data is suitable to be used as input for other NetPacket::* modules.

This function is equivalent to creating an object using the decode() constructor and returning the data field of that object.

Instance data

The instance data for the NetPacket::UDP object consists of the following fields.

src_port

The source UDP port for the datagram.

dest_port

The destination UDP port for the datagram.

len

The length (including length of header) in bytes for this packet.

cksum

The checksum value for this packet.

data

The encapsulated data (payload) for this packet.

<<less
Download (0.011MB)
Added: 2007-02-28 License: Perl Artistic License Price:
972 downloads
NetPacket::TCP 0.04

NetPacket::TCP 0.04


NetPacket::TCP is a Perl module to assemble and disassemble TCP (Transmission Control Protocol) packets. more>>
NetPacket::TCP is a Perl module to assemble and disassemble TCP (Transmission Control Protocol) packets.

SYNOPSIS

use NetPacket::TCP;

$tcp_obj = NetPacket::TCP->decode($raw_pkt);
$tcp_pkt = NetPacket::TCP->encode($ip_pkt);
$tcp_data = NetPacket::TCP::strip($raw_pkt);

NetPacket::TCP provides a set of routines for assembling and disassembling packets using TCP (Transmission Control Protocol).

Methods

NetPacket::TCP->decode([RAW PACKET])

Decode the raw packet data given and return an object containing instance data. This method will quite happily decode garbage input. It is the responsibility of the programmer to ensure valid packet data is passed to this method.

NetPacket::TCP->encode($ip_obj)

Return a TCP packet encoded with the instance data specified. Needs parts of the ip header contained in $ip_obj in order to calculate the TCP checksum.

Functions

NetPacket::TCP::strip([RAW PACKET])

Return the encapsulated data (or payload) contained in the TCP packet. This data is suitable to be used as input for other NetPacket::* modules.

This function is equivalent to creating an object using the decode() constructor and returning the data field of that object.

Instance data

The instance data for the NetPacket::TCP object consists of the following fields.

src_port

The source TCP port for the packet.

dest_port

The destination TCP port for the packet.

seqnum

The TCP sequence number for this packet.

acknum

The TCP acknowledgement number for this packet.

hlen

The header length for this packet.

reserved

The 6-bit "reserved" space in the TCP header.

flags

Contains the urg, ack, psh, rst, syn, fin, ece and cwr flags for this packet.

winsize

The TCP window size for this packet.

cksum

The TCP checksum.

urg

The TCP urgent pointer.

options

Any TCP options for this packet in binary form.

data

The encapsulated data (payload) for this packet.

<<less
Download (0.011MB)
Added: 2007-02-28 License: Perl Artistic License Price:
971 downloads
Script for a multi-homed firewall 1.2b2

Script for a multi-homed firewall 1.2b2


Script for a multi-homed firewall is an example IPTables 1.2.1 script for a dual-homed firewall. more>>
Script for a multi-homed firewall is an example IPTables 1.2.1 script for a dual-homed firewall.

This script has not yet been tested thoroughly on a dual-homed firewall. If you find any problems, please drop me an email.

Current versions and documentation are available at http://www.sentry.net/~obsid/IPTables/rc.scripts.dir/current/

## User-defined Chains ##

Chain KEEP_STATE
The KEEP_STATE chain holds a few rules for generic stateful packet filtering.
This chain is called from many of the INPUT/OUTPUT chains to DROP "INVALID"
and perhaps "UNCLEAN" packets and allow other packets from "RELATED" or
"ESTABLISHED" connections.

CHECK_FLAGS
The CHECK_FLAGS chain contains a few rules to filter based on TCP flags.
These rules do indeed filter mainly bogus/malicious traffic(scans, etc). It
would be a good idea to keep an eye on what these rules send to the logs.
Null scans are also logged and dropped, in the mangle table.

DENY_PORTS
The DENY_PORTS chains contains a few rules to DROP and/or LOG packets based
on the source and/or destination port number of the packet.

Packets destined to/from the following ports are dropped by default in the script. These are just some examples of some commonly used ports that certain daemons/trojans/DDoS agents may utilize.

## TCP ##
137:139 SMB
2049 NFS
6000:6063 X
20034 Netbus 2 Pro
12345:12346 Netbus
27374 SubSeven
27665,27444,31335 Trinoo
10498,12754 Mstream

## UDP ##
2049 NFS
31337 BO2k
27444,31335 Trinoo
10498 mstream

These are just examples to stare at. They guarantee no real protection against the associated trojans.

For more common port numbers check out:
http://www.sans.org/newlook/resources/IDFAQ/oddports.htm

ALLOW_PORTS
The ALLOW_PORTS chain simply ACCEPTs packets based on port number. If you have
a default FORWARD policy of DROP, then you would need to utilize a chain like
this if you are DNATing/routing connections behind the firewall or perhaps
running services on(!!!) the firewall.

ALLOW_ICMP
The ALLOW_ICMP chains simply allows packets based on ICMP type. Currently
the firewall allows the flow of the following ICMP types:
Echo Reply (pong)
Destination Unreachable
Echo Request (ping)
TTL Exceeded (traceroute)

SRC_EGRESS && DST_EGRESS
The SRC_EGRESS and DST_EGRESS chains filter packets that have a source or
destination IP address matching an array of private or reserved subnets.

TOS_OUTPUT
The TOS_OUTPUT chain exists in the mangle table and mangles the TOS(Type
of Service) field in the IP header of locally generated, outgoing packets.

TOS_PREROUTING
The TOS_PREROUTING chain exists in the mangle table and mangles the TOS(Type
of Service) field in the IP header of packets being routed through the firewall.

The following user-defined chains are pretty obvious. The firewall script is designed to have a user-defined INPUT and OUTPUT chain for every available interface. From these user-defined chains are called the user-defined chains
mentioned above, which I call "Special Chains". The chains below are then called by the built-in INPUT/OUTPUT/FORWARD chains. This isnt really the rule, of course, alot of the user-defined chains mentioned above are called directly from the built-in INPUT/OUTPUT/FORWARD chains. This is done to assure proper flow of the packets through the filters.

EXTERNAL_INPUT
INTERNAL_INPUT
DMZ_INPUT
LO_INPUT
EXTERNAL_OUTPUT
INTERNAL_OUTPUT
DMZ_OUTPUT
LO_OUTPUT
<<less
Download (MB)
Added: 2007-02-13 License: GPL (GNU General Public License) Price:
992 downloads
deja-packet 1.0

deja-packet 1.0


deja-packet transmits raw packets through a specified interface. more>>
deja-packet transmits raw packets through a specified interface.

Usage: ./deja-packet -pcap < libpcap capture file > < interface name >
or: ./deja-packet -raw < raw packet file > < interface name >

Note: you must be root to successfully transmit packets with deja-packet due to the Linux security restrictions with raw sockets.

In the [-p]cap mode, deja-packet transmits selected packets from a libpcap capture file (such as one created by Ethereal/Wireshark, or tcpdump). In the [-r]aw mode, deja-packet transmits the raw contents of a file as one whole packet.

The [-p]cap mode is interactive: the user will be continuously prompted to select which packet from the libpcap capture file to transmit, until the “q” character is encountered, where the program will quit.

Example pcap mode:

$ sudo ./deja-packet -p icmp_ping.pcap eth0
Select packet number (1 to 6) for transmission or q for quit: 1
Successfully transmitted packet!
Select packet number (1 to 6) for transmission or q for quit: 2
Successfully transmitted packet!
Select packet number (1 to 6) for transmission or q for quit: 5
Successfully transmitted packet!
Select packet number (1 to 6) for transmission or q for quit: 6
Successfully transmitted packet!
Select packet number (1 to 6) for transmission or q for quit: q
$

In the [-r]aw mode, deja-packet exits immediately after the attempted transmission is complete (allows deja-packet to be easily used with a script).

Example raw mode:

$ sudo ./deja-packet -r samplepacket eth0
Successfully transmitted packet!
$

icmp_ping.pcap is included as a sample libpcap capture file.

To compile deja-packet, simply use the command “make”.

deja-packet remains Linux-only because it requires PF_PACKET sockets.

This project is released under the GNU General Public License version 2.
<<less
Download (0.004MB)
Added: 2007-07-04 License: GPL (GNU General Public License) Price:
847 downloads
Packet filtering setup script

Packet filtering setup script


Packet filtering setup script by Anthony C. Zboralski. more>>
Packet filtering setup script by Anthony C. Zboralski. Adapted by Didi Damian for iptables version 1.0.0

Sample:

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Set up variables
EXT_IF="eth0"
INT_IF="eth1"
EXT_IP=24.x.x.x/32
INT_IP=192.168.0.1/32
EXT_NET=24.x.x.0/24
INT_NET=192.168.0.0/24
MASQ_NETS="192.168.0.0/24"
LOCAL_ADDRS="127.0.0.0/8 192.168.0.1/32 24.x.x.x/32"
MAIL_RELAY=24.x.x.x/32
SMB_ACCESS="192.168.0.2/32"
SMB_BCAST="192.168.0.255/32"

# Turn on IP forwarding
echo Turning on IP forwarding.
echo 1 > /proc/sys/net/ipv4/ip_forward

# Load the ip_tables module
echo Loading ip_tables module.
/sbin/modprobe ip_tables || exit 1
# I let the kernel dynamically load the other modules

echo Flush standard tables.
iptables --flush INPUT
iptables --flush OUTPUT
iptables --flush FORWARD
echo Deny everything until firewall setup is completed.
iptables --policy INPUT DROP
iptables --policy OUTPUT DROP
iptables --policy FORWARD DROP

CHAINS=`iptables -n -L |perl -n -e /Chains+(S+)/ && !($1 =~ /^(INPUT|FORWARD|OUTPUT)$/) && print "$1 "`
echo Remove remaining chains:
echo $CHAINS
for chain in $CHAINS; do
iptables --flush $chain
done
# 2nd step cause of dependencies
for chain in $CHAINS; do
iptables --delete-chain $chain
done

for net in $MASQ_NETS; do
# I delete all the rules so you can rerun the scripts without bloating
# your nat entries.
iptables -D POSTROUTING -t nat -s $MASQ_NETS -j MASQUERADE 2>/dev/null
iptables -A POSTROUTING -t nat -s $MASQ_NETS -j MASQUERADE || exit 1
done
iptables --policy FORWARD ACCEPT

# Create a target for logging and dropping packets
iptables --new LDROP 2>/dev/null
iptables -A LDROP --proto tcp -j LOG --log-level info
--log-prefix "TCP Drop "
iptables -A LDROP --proto udp -j LOG --log-level info
--log-prefix "UDP Drop "
iptables -A LDROP --proto icmp -j LOG --log-level info
--log-prefix "ICMP Drop "
iptables -A LDROP --proto gre -j LOG --log-level info
--log-prefix "GRE Drop "

iptables -A LDROP -f -j LOG --log-level emerg
--log-prefix "FRAG Drop "
iptables -A LDROP -j DROP

# Create a table for watching some accepting rules
iptables --new WATCH 2>/dev/null
iptables -A WATCH -m limit -j LOG --log-level warn --log-prefix "ACCEPT "
iptables -A WATCH -j ACCEPT


echo Special target for local addresses:
iptables --new LOCAL 2>/dev/null
echo $LOCAL_ADDRS
for ip in $LOCAL_ADDRS; do
iptables -A INPUT --dst $ip -j LOCAL
# iptables -A INPUT --src $ip -i ! lo -j LDROP # lame spoof protect
done
echo Authorize mail from mail relay.
iptables -A LOCAL --proto tcp --syn --src $MAIL_RELAY --dst $EXT_IP --dport 25 -j ACCEPT


echo Authorizing samba access to:
echo $SMB_ACCESS
iptables --new SMB 2>/dev/null
for ip in $SMB_ACCESS; do
iptables -A SMB -s $ip -j ACCEPT
done
iptables -A LOCAL --proto udp -i ! $EXT_IF --dport 135:139 -j SMB
iptables -A LOCAL --proto tcp -i ! $EXT_IF --dport 135:139 -j SMB
iptables -A LOCAL --proto tcp -i ! $EXT_IF --dport 445 -j SMB
iptables -A INPUT -i ! $EXT_IF --dst $SMB_BCAST -j ACCEPT #lame samba broadcast

echo Drop and log every other incoming tcp connection attempts.
iptables -A LOCAL -i ! lo --proto tcp --syn --j LDROP

echo Authorize dns access for local nets.
for net in $MASQ_NETS 127.0.0.0/8; do
iptables -A INPUT --proto udp --src $net --dport 53 -j ACCEPT
done


echo Enforcing up ICMP policies, use iptables -L ICMP to check.
# If you deny all ICMP messages you head for trouble since it would
# break lots of tcp/ip algorythm (acz)
iptables --new ICMP 2>/dev/null
iptables -A INPUT --proto icmp -j ICMP
iptables -A ICMP -p icmp --icmp-type echo-reply -j ACCEPT
iptables -A ICMP -p icmp --icmp-type destination-unreachable -j WATCH
iptables -A ICMP -p icmp --icmp-type network-unreachable -j WATCH
iptables -A ICMP -p icmp --icmp-type host-unreachable -j WATCH
iptables -A ICMP -p icmp --icmp-type protocol-unreachable -j WATCH
iptables -A ICMP -p icmp --icmp-type port-unreachable -j ACCEPT
iptables -A ICMP -p icmp --icmp-type fragmentation-needed -j LDROP
iptables -A ICMP -p icmp --icmp-type source-route-failed -j WATCH
iptables -A ICMP -p icmp --icmp-type network-unknown -j WATCH
iptables -A ICMP -p icmp --icmp-type host-unknown -j WATCH
iptables -A ICMP -p icmp --icmp-type network-prohibited -j WATCH
iptables -A ICMP -p icmp --icmp-type host-prohibited -j WATCH
iptables -A ICMP -p icmp --icmp-type TOS-network-unreachable -j WATCH
iptables -A ICMP -p icmp --icmp-type TOS-host-unreachable -j WATCH
iptables -A ICMP -p icmp --icmp-type communication-prohibited -j WATCH
iptables -A ICMP -p icmp --icmp-type host-precedence-violation -j LDROP
iptables -A ICMP -p icmp --icmp-type precedence-cutoff -j LDROP
iptables -A ICMP -p icmp --icmp-type source-quench -j LDROP
iptables -A ICMP -p icmp --icmp-type redirect -j LDROP
iptables -A ICMP -p icmp --icmp-type network-redirect -j LDROP
iptables -A ICMP -p icmp --icmp-type host-redirect -j LDROP
iptables -A ICMP -p icmp --icmp-type TOS-network-redirect -j LDROP
iptables -A ICMP -p icmp --icmp-type TOS-host-redirect -j LDROP
iptables -A ICMP -p icmp --icmp-type echo-request -j WATCH
iptables -A ICMP -p icmp --icmp-type router-advertisement -j LDROP
iptables -A ICMP -p icmp --icmp-type router-solicitation -j LDROP
iptables -A ICMP -p icmp --icmp-type time-exceeded -j WATCH
iptables -A ICMP -p icmp --icmp-type ttl-zero-during-transit -j WATCH
iptables -A ICMP -p icmp --icmp-type ttl-zero-during-reassembly -j WATCH
iptables -A ICMP -p icmp --icmp-type parameter-problem -j WATCH
iptables -A ICMP -p icmp --icmp-type ip-header-bad -j WATCH
iptables -A ICMP -p icmp --icmp-type required-option-missing -j WATCH
iptables -A ICMP -p icmp --icmp-type timestamp-request -j LDROP
iptables -A ICMP -p icmp --icmp-type timestamp-reply -j LDROP
iptables -A ICMP -p icmp --icmp-type address-mask-request -j LDROP
iptables -A ICMP -p icmp --icmp-type address-mask-reply -j LDROP
iptables -A ICMP -p icmp -j LDROP

echo Authorize tcp traffic.
iptables -A INPUT --proto tcp -j ACCEPT

echo Authorize packet output.
iptables --policy OUTPUT ACCEPT

#echo reject ident if you drop em you gotta wait for timeout
#iptables -I LOCAL --proto tcp --syn --dst $EXT_IP --dport 113 -j REJECT

echo Drop and log all udp below 1024.
iptables -A INPUT -i ! lo --proto udp --dport :1023 -j LDROP

echo Drop rpc dynamic udp port:
RPC_UDP=`rpcinfo -p localhost|perl -n -e /.*udps+(d+)s+/ && print $1,"n"|sort -u`
echo $RPC_UDP
for port in $RPC_UDP; do
iptables -A LOCAL -i ! lo --proto udp --dport $port -j LDROP
done

echo Authorize udp above 1024.
iptables -A INPUT --proto udp --dport 1024: -j ACCEPT
<<less
Download (MB)
Added: 2007-02-14 License: GPL (GNU General Public License) Price:
984 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5