nikto as seen from the server

Ever wondered how a vulnerability scan is seen from the server? Well, not very quiet :P

In real time, if every ball represents a petition, the ones who bounce are the one answered succesfully and the other ones do not:

Visualized with logstalgia

scripting a torrent tracker with twisted

Some weeks ago I knew about Twisted, a asynchronous networking library... something like to node.js for python.

Among a lot of protocols (including SSH, client and server) it suports, of course, HTTP, which allows us to get a dinamic web server running without configuring any apache, nginx or something like that, just doing

1
pip install twisted

And what web application can be built fast on a web server? a Bittorrent tracker!

Montando un tracker de torrent con twisted

Hace unas semanas supe de Twisted, una librería asíncrona de programación en red para python... lo que viene siendo node.js para python.

Entre otros muchos protocolos (incluyendo SSH, cliente y servidor) que soporta está por supuesto HTTP, lo que nos permite montar un servidor web dinámico sin necesidad de pararse a configurar apache, nginx o algo por el estilo, simplemente haciendo

1
pip install twisted

Y que aplicación web se puede montar rápidamente en un servidor web? un tracker de Bittorrent!

Just for fun

Últimamente encuentro bastantes sítios de humor por aquí dejo los que he encontrado (dádle al título del post para ver las imágenes):

Sólo lo toque y la aplicación cayo sola

Desarrollando sin especificaciones

Cuando llega un informe de error el viernes a las 4

“Cuando los compañeros intentan explicar por que deberíamos programar en Java”

Cuando los compañeros intentan explicar por que deberíamos programar en Java

 

1
saveurl() { cat > /dev/null; } # Save a url for reading later when you "have time".

Zombie process cleaning script

Takes the zombie parent process id as parameter and uses GDB to waitpid them surely it'll need root.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# Kills zombie process spawning from a parent PID

# check parameter number
if [ -z "$1" ];then
    echo "$0 <zombie parent pid>"
    exit 0
fi

# assign reasonable names to variables
ppid=$1
fname=`tempfile`

# GDB instructions
(for zpid in `ps h --ppid=$ppid|grep -P '^\s*\d+\s+[^ ]+\s+Z'|awk '{print $1;}'`;do
    echo "print waitpid($zpid, 0, 0)" # wait for each zombie
 done
 # and detach
 echo "detach") > $fname

# launch GDB
gdb -batch -p $ppid /proc/$ppid/exe -x $fname

# and cleanup
rm $fname

Script para limpiar zombies

Toma como parámetro el id del proceso que generó los zombies y usa GDB para hacer waitpid, lo más seguro es que haga falta root :/

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# Kills zombie process spawning from a parent PID

# check parameter number
if [ -z "$1" ];then
    echo "$0 <zombie parent pid>"
    exit 0
fi

# assign reasonable names to variables
ppid=$1
fname=`tempfile`

# GDB instructions
(for zpid in `ps h --ppid=$ppid|grep -P '^\s*\d+\s+[^ ]+\s+Z'|awk '{print $1;}'`;do
    echo "print waitpid($zpid, 0, 0)" # wait for each zombie
 done
 # and detach
 echo "detach") > $fname

# launch GDB
gdb -batch -p $ppid /proc/$ppid/exe -x $fname

# and cleanup
rm $fname

Estamos de vuelta!

Después de 3 meses vuelve Código para llevar, habrá cambios, para empezar los cambios el sistema de blogging ha pasado de Wordpress a acrylamid, mucho más ligero. La migración no está del todo completa y los comentarios tardarán un rato :P.

Newer posts Older posts