Installation

JSDetox should work on most Linux distributions - major versions get tested on the current LTS version of Linux Mint / Ubuntu. The development is currently done on Gentoo Linux with the latest chrome browser, so that combination should always work.

The code can be found in my github repository: https://github.com/svent/jsdetox

If you want to get notified on updates, watch the repository on github or follow me on twitter.


While it does use the browser as user interface, the whole analysis/execution of the javascript code is done in the backend. As with any tool that handles malicious, unknown code, you should consider installing JSDetox into an isolated environment.


Installation on Linux Mint 13 / Ubuntu 12.04

sudo apt-get install ruby1.9.1 ruby1.9.1-dev libxslt1-dev libxml2-dev build-essential git
sudo gem install bundler
cd #target-dir#
git clone https://github.com/svent/jsdetox.git
cd jsdetox
sudo bundle install
sudo apt-get install rubygems libxslt1-dev libxml2-dev build-essential git
sudo gem install bundler
cd #target-dir#
git clone https://github.com/svent/jsdetox.git
cd jsdetox
sudo bundle install
sudo apt-get install ruby1.9.1 ruby1.9.1-dev libxslt1-dev libxml2-dev build-essential git
# select ruby 1.9:
sudo update-alternatives --config ruby
# select ruby 1.9:
sudo update-alternatives --config gem
sudo gem install bundler
cd #target-dir#
git clone https://github.com/svent/jsdetox.git
cd jsdetox
sudo bundle install

Installation on Debian Squeeze

sudo apt-get install ruby rubygems libxslt1-dev libxml2-dev build-essential git
sudo gem install bundler
cd #target-dir#
git clone https://github.com/svent/jsdetox.git
cd jsdetox
sudo /var/lib/gems/1.8/bin/bundle install
sudo apt-get install ruby1.9.1 ruby1.9.1-dev libxslt1-dev libxml2-dev build-essential git
sudo gem1.9.1 install bundler
cd #target-dir#
git clone https://github.com/svent/jsdetox.git
cd jsdetox
sudo /var/lib/gems/1.9.1/bin/bundle install
# Ruby 1.9.1 is not installed as system default - start jsdetox with
ruby1.9.1 jsdetox
# instead of
./jsdetox

Installation with chruby

chruby and ruby-build can be used to manage ruby installations. See https://github.com/postmodern/chruby for more information.
# install ruby-build, see https://github.com/sstephenson/ruby-build#installation
git clone https://github.com/sstephenson/ruby-build.git
cd ruby-build
sudo ./install.sh

# install ruby
sudo ruby-build 1.9.3-p392 /opt/rubies/ruby-1.9.3-p392

# install chruby, see https://github.com/postmodern/chruby#install
wget -O chruby-0.3.4.tar.gz https://github.com/postmodern/chruby/archive/v0.3.4.tar.gz
tar -xzvf chruby-0.3.4.tar.gz
cd chruby-0.3.4/
sudo make install

# load chruby by default
echo "source /usr/local/share/chruby/chruby.sh" >>~/.bashrc

# load chruby for the current session
source /usr/local/share/chruby/chruby.sh

# enable ruby 1.9
chruby ruby-1.9

# install jsdetox
gem install bundler
cd #target-dir#
git clone https://github.com/svent/jsdetox.git
cd jsdetox
bundle install

Updating

The master branch in the github repository is stable, so just run this to update to the latest version:

cd #jsdetox-dir#
git pull
sudo bundle install

If you want to get notified on updates, watch the repository on github or follow me on twitter.

Dependencies

JSDetox is written in ruby and compatible with version 1.8 and 1.9. Ruby 1.9 has a much better performance, so it is the recommended version.

JSDetox has the following gem dependencies, managed with bundler:

The libraries metasm and taka come bundled with JSDetox as there is no maintained gem of the latest version available.

You should use a modern HTML 5 capable browser to access the web gui (chrome and firefox get tested).