Quantcast
Viewing all articles
Browse latest Browse all 52

IP Packet Manipulation in Ruby: Goodbye PacketFu Hello Racket

My success with installing PacketFu was short-lived. I updated Metasploit and it broke. I updated the system and it broke. I closed the computer and it broke. That’s it, even my patience has limits.

The alternative Ruby Packet manipulation software appears to be Racket. As with PacketFu I believe it is (or was) bundled with Metasploit. I tried installing Racket (and Scruby and RubyForger) and it failed. I just happened to notice a comment written on the blog of the guy who coded Racket which said:

I realize I’m a bit behind the times here with my comment but I got the same error. I was able to solve it by switching my ruby version back to 1.8.7 … yayyy for RVM.

And so began my journey into the world of Ruby Version Manager (RVM). Put simply this allows us to run different version of Ruby. As I have Ruby version 1.9.3 I needed an RVM running version 1.8.7.

I installed RVM with this in script in the Command Prompt:

\curl -L https://get.rvm.io | bash -s stable

Then to test the installation in the Terminal:

source /usr/local/rvm/scripts/rvm <– This puts us in the RVM environment.

type rvm | head -n 1

 rvm is a function

The “rvm is a function” confirms RVM is installed and working.

Next step was to have Ruby version 1.8.7 running in RVM:

rvm install 1.8.7

Now we need to install the Gem in the RVM

source /usr/local/rvm/scripts/rvm

Gem Install Racket

And it’s loaded, now to check the install works.

To start with I wanted to run some of the Ruby example files files in Racket, but we have to make sure we’re in the RVM environment first:

source /usr/local/rvm/scripts/rvm

And then navigate to the correct folder:

cd /usr/local/rvm/gems/ruby-1.8.7-p374/gems/racket-1.0.11/examples

And then run the example file:

ruby arp-send

Output

Usage: arp-send <interface> <opcode>

So I know it’s working.

Then to run Ruby Racket proper:

source /usr/local/rvm/scripts/rvm
rvm use 1.8.7
irb
require ‘rubygems’
require ‘racket’

And we’re ready to code instruction for Racket in the Interavtive Ruby Shell

That’s as far as I’ve got. I now need to learn Racket and hope in the meantime it remains stable.


Viewing all articles
Browse latest Browse all 52

Trending Articles