Posts tagged as programming

Using Python to be the Man in the Middle

2010-08-20 by Motoma, tagged as hacking, mitm, programming, python, sockets

I've started working on a private project which is on par with the type of programming I like to do. The basic premise is that the program acts as a man in the middle, routing traffic between client and server, occasionally altering or injecting data into the stream each way.

Read more »

PyLoris

PyLoris is a scriptable tool for testing a service's level of vulnerability to a particular class of Denial of Service (DoS) attack. Any service that places restrictions on the total number of simultaneous TCP connections has the potential for vulnerability to PyLoris. Additionally, services that handle connections in independent threads, services that poorly manage concurrent connections, and services that have high memory footprint per connection are prone to this form of vulnerability.

Read more »

PyLoris: A Python implementation of Slowloris

2009-06-19 by Motoma, tagged as denial of service, dos, hacking, linux, mac os x, networking, programming, python, windows

I came across a wonderful idea on Hack a Day recently: a Denial of Service attack that overwhelms only the service under attack. After reading through RSnake's two writeups, I decided to take a swing at the code. Thus PyLoris was born.

Read more »

A Simple Extension to the Python CSV Object

2008-06-22 by Motoma, tagged as csv, database, import, programming, python

One of the side effects of working with database driven software is that you eventually find yourself needing to pull in large amounts of information from old and terrible systems. When talking to your counterparts on the other side of the line (the inter-company line, that is), you will invariably be told that you will only receive your data in one of a few straight forward formats. What follows is a small extension to Python's CSV object which streamlines the process of coding these data transformations.

Read more »

Daemonizing a Python Script

2007-08-10 by Motoma, tagged as daemon, daemonize, hacking, programming, python

As my knowledge of Python continues to grow, I find myself using it more in my own systems. This is one of my more useful snippets of code; it allows a Python script to continue running as a daemon even if you log out or your session gets disconnected. A nice side effect of this is that the process is immediately run in the background, returning the user to a command prompt instantly.

I originally picked up the code to run a Python script as a daemon from the Python Cookbook on the ActiveState Programmer Network.

Read more »

Turning on PHP Debugging and Error Messages

2007-08-02 by Motoma, tagged as debugging, error messages, error reporting, errors, function, php, programming

Debugging messages are a powerful tool; however, many production systems (and test systems for that matter) have them disabled by default. If your PHP script is crashing horribly and you are not getting any runtime error messages, it is likely that this is the case for you.

You can initiate PHP debugging messages for the server by changing the display_errors and error_level settings in php.ini. Unfortunately, this is not the best situation in a production system.

Read more »

Gumstix u-boot 1.2

I took the plunge and, at the risk of bricking my Verdex, updated u-boot. I can only begin to describe the improvements! The process was not nearly as perilous as I anticipated (though I did hold my breath when I rebooted the first time). Noteworthy improvements are the ability to load the kernel directly into the U-Boot environment, and the inclusion of ymodem file transfers over the serial line. The former reduces my boot time to a breathtaking 23 seconds, while the latter reduces rootfs flash time via serial connection by more than half!

Read more »

Verdex && Belkin 802.11

2007-06-27 by Motoma, tagged as console-vx, gumstix, kernel, programming, usb, verdex, webcam, wifi, wireless

With a lot of grunting and groaning, a good amount of grepping through forum posts, and gallons of patience (coffee), I have finally got my verdex board to acknowledge my Belkin F5D7050 and bring the interface up. Due to a small bug in the zd1211rw drivers, the device needs to be brought up before an ESSID can be assigned to it. Without doing so, I would receive a permission denied error for a majority of the iwconfig options:

Read more »