Socket - Fiirewall
Salvatore
salvatore at wanadoo.fr
Sat Mar 1 10:16:17 EST 2003
Thank you for your quick response,
I'm totally agreee with you concerning the fact of developping a real
firewall.
In fact, what I would like to do is using a program
like windump or tcpdump, dump the data in a file that I could parse
with Python, and blocking the port I'd consider as intrusive.
Salvatore
Rene Pijlman wrote:
> Salvatore:
>
>>I would like to create a little firewall in Python,
>>Does anybody know how to block a port like a FireWall ?
>
>
> That's the easy part.
>
> receive(packet)
> if packet.destination_port == 80:
> send(packet)
> else:
> pass
> # :-)
>
> Firewalls are typically implemented in a primitive
> high-performance language (C) at the TCP/IP routing layer in the
> OS kernel. I don't think this is a good application for an
> interpreted high level scripting language like Python, that
> typically resides ~3 layers higher in the protocol stack.
>
More information about the Python-list
mailing list