Pages

Wednesday, June 15, 2011

Back to my Python days

I am writing a Splunk module for work to analyze IP addresses of possible attackers, and Splunk modules can only be written in Python.


I came across a nice module http://code.google.com/p/python-iptools/ for manipulating IP addresses. Using that module, it becomes very easy to check if a particular IP address is not in the blacklisted range:

#!/usr/bin/env python
import iptools

INTERNAL_IPS
= iptools.IpRangeList(
'127.0.0.1',
'192.168/16',
('10.0.0.1', '10.0.0.19'))
>>>print '192.168.1.2' in INTERNAL_IPS True


Reactions:

7 comments:

Alexander - the actual link is broken - though the visible text is right...

I want you to share your Splunk module with us here after complete it's writing but you can write is fast with the help of resume writing service au and i hope to see it here next time.

I want you to share your Splunk module with us here after complete it'sschulterfreie bh writing but you can write is fast with the help of paper writing service and i hope to see it here next time.

We are always interested in the "neglect" of us. But we are "abandoning" who cares about us ...
Friv | Unblocked | ABCya | Yepi

Post a Comment