Luís Bastião ( few words)

Just another blog in the world

Archive for the ‘Python’ Category

Aware of all issues

Posted by Luís Bastião on October 31, 2010

When you have an idea, the next step is to implement it for real. Some people are very creative and in some cases even visionary. Do you think that have ideas is enough? It is not. The idea is very important but you need to be smart to implement it.
There is many ways of “implementing ideas” but the deal is: abstract from all details, and for instance even you know lot of details, forget it. Do it step-by-step. If you focus in all details you will never start.

Cheers!
Bastião

Posted in Friends, Python | Leave a Comment »

Umit Project in BarcampPT

Posted by Luís Bastião on September 13, 2009

Hi Everybody!

BarCamp[1] is an open event where participants can share some context with others and make social networking. Portuguese guys realized also the event, during this weekend in Coimbra, named BarcampPT[2].

It was a very nice event, beginning with all guys making a shortest personal presentation following the Half-Baked and some talks. And Sunday was a great day with lot of “talks” including the Umit Project presentation [3].

The presentation have a goal: spread Umit Project for audience.

Official Post: http://blog.umitproject.org/2009/09/umit-project-in-barcamppt.html

Posted in Python, UmitProject | Leave a Comment »

Umit Project – GSoC

Posted by Luís Bastião on August 24, 2009

Hi,

This Summer I was mentoring two students on Google Summer of Code in Umit Project organization: Bartosz Skowron and Francesco Piccinno.

UMPA – new features implementation

UMPA is a library to make packet manipulation  made in Python. This new features was the GSoC project of Bartosz (Poland student) and it was:

  • Sniffer Feature – he had to made a pypcap stripped to have full support on libpcap

It capture packets over the network using libpcap or winpcap. It also provide an API to register some callbacks and it can be useful to trigger in some specific events.

  • Improvements on Schedule: running in a separated thread – detach
  • Write some generic models to help users using UMPA
  • Write ARP Protocol in UMPA

The code can be found: http://trac.umitproject.org/browser/branch/UMPA

Information about project can be found there: http://umpa.umitproject.org

Umit PacketManipulator – Audit Framework

Umit PacketManipulator is Graphical Interface to sniffer packets over the network and Audit Framework is an extension. This Framework was developed by Francesco, an Italian student. Basically with this new features users are able to access the sniffed packets and interact with them, providing necessary API to users can write easier plugins.

There is two kind of audit plugins:

  • Passive: it read the sniffed packets and allow user interact all packets.

There is some examples of this kind plugins provided:
- FingerPrint
- UDP Decoder
- TCP Decoder
- etc..

  • Active: it is able to react on network actions and modification replies to test networks functionality and vulnerability.

Some examples:
- ARP Poison
- ARP Ping
- Etc..

The code can be found: http://trac.umitproject.org/browser/branch/PacketManipulator

Information about project can be found there: http://manipulator.umitproject.org and http://trac.umitproject.org/wiki/AttackFramework

—————————————————————————–

Congrats to this guys that help growing up Umit Project and Open Source Software!

If you willing to help us in development look for us in #umit in irc.freenode.net or join mailing list umit-devel@lists.sourceforge.net.

Posted in Python, UmitProject | Leave a Comment »

Distributing a python application with empty dirs

Posted by Luís Bastião on August 24, 2009

I was wondering with a bug with Umit Network Scanner from Umit Project [0] and the right solution for the bug was distribute it with a empty directory.

How to do that with Python?

python setup sdist –formats=bztar

When you run the command above it will package your application, but no empty dirs are allowed in MANIFEST.in, nor  in setup(**options). If you intend to know more about distutils and how it works the better solutions is go to Python Docs [1]. Unfortunately the commands help are empty and you can’t get help about it there.

When we’re producing open source software we don’t have a customize support of upstream libraries ( It does not happen with propriety software either in most part of cases). And I was there without any solution. So if I’m developing an Open Source Software and I’m using open library and open environment why not look the code? And I went look in distutil code [2]. In the worst case it will a common pitfalls wasting lot of time and got nothing.

Overwrite sdist command or any other


from distutils.core import setup, Command
from distutils.command.install import install
from distutils.command.build import build

from distutils.command.sdist import sdist

class wht_sdist(sdist):
        def run(self):
        (..)


cmdclasses = {
        "sdist": wtv_sdist}

setup(...
    cmdclass = cmdclasses,
...)

It was the sample to overwrite. After that there is another function to overwrite in sdist: make_distribution(). There you should look the code and verify where you can call a function to include empty directories.

Further information see an example there [3], lines 427 and 464 and you will understand it.

[0] – http://www.umitproject.org
[1] - http://docs.python.org/distutils/apiref.html#module-distutils.command
[2] - http://svn.python.org/projects/python/trunk/Lib/distutils/command/
[3] – http://trac.umitproject.org/browser/trunk/setup.py?rev=5324

Posted in Python, UmitProject | Leave a Comment »

PyRegex – Check regular expressions in Python

Posted by Luís Bastião on August 21, 2009

Hi,

I was talking with Rodolfo (a contributor of UmitProject and author of UmitWeb)  few days ago about some Python Regex expressions.

It was hard for us test this expressions on the fly, opening Python interpretor and just check if it really works as expected and then Rodolfo have a nice ideia to create a online regex check expression similar of other projects for Java, Ruby and others languages.

In less than one day Rodolfo was create the project and it is hosted on github and appspot. It is a project under Licence GPL.

If you willing to learn Python in Web matter it is a good code to look!

Enjoy and join the project if you willing to contribute.

Posted in Python, UmitProject | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.