Archive for the ‘Linux’ Category

ruby: stack level too deep

Wednesday, May 19th, 2010

I have been working on a ruby script that sends the payloads from Metasploit to a certain server in order to save a trace of the actual payload. I need these traces to test the effectiveness of snort against the attacks in Metasploit. However some payloads are kinda big and I ran into the following error:

ruby: stack level too deep (SystemStackError)

I found a simple solution for this problem here. A simple increase of the stack size of the shell solved the problem. The following command shows the stack size of the shell:

ulimit -a
stack size (kbytes, -s) 8192

I simply increased this to 25000 which was a bit bigger than the largest payload I have generated out of Metasploit:

ulimit -s 25000

I have no idea what the consequences are but at least my script is running now :). Keep in mind that the stack size only increases for the active shell. It has no influence on other shells or newly created shells.

Count words in Latex Document

Friday, May 14th, 2010

Counting the words in a latex document can sometimes be a troublesome task because of all the LaTeX coding in a document. However there is a simple tool which strips the document from all its LaTeX code, untex. It is a simple command line tool which can be installed from the Ubuntu repositories.

apt-get install untex

In order to count the words simply run:

$ untex document.tex |wc -w
998

nmap, farpd, honeyd

Tuesday, May 4th, 2010

I am currently working on some projects involving honeyd, farpd and nmap. Scanning a honeyd host with nmap which is on the same network as the farpd daemon will result in a host is down response. The problem lies in the fact that by default nmap sends an ARP ping instead of an ICMP ping for an IP which is in the same network. To mitigate this problem the following parameter should be used:

nmap --send-ip 172.16.0.2

This will result in nmap sending raw IP packets.