LoginSignup
5
3

More than 5 years have passed since last update.

Kali Linuxに最新版のGitとMetasploitをいれて... さらに!! Node.jsまでつけちゃうんです。

Last updated at Posted at 2015-01-19

全部Root権限で実行。
(PostgreSQLいじるところだけ、PostgreSQL用ユーザ)

※ #だとコメントアウトになっちゃうんで、rootだけど$にしてます。
※ VirtualBoxで動かしてます。

事前準備

apt-getが古いので最新の状態にしてパッケージも更新

$ apt-get update && apt-get upgrade

Virtualbox Guest Editionを入れる。
CD ROMからだとrunがミスるので、ローカルにコピーして実行

$ apt-get install -y linux-headers-$(uname -r)
$ cd /media/cdrom/
$ cp /media/cdrom/VBoxLinuxAdditions.run /root/
$ cd
$ chmod 755 VBoxLinuxAdditions.run
$ ./VBoxLinuxAdditions.run

Git

Gitを最新にする。
CurlのSSLパッケージを事前に入れておく

$ apt-get install libcurl4-openssl-dev gettext
$ wget https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz
$ tar zvxf git-2.2.1.tar.gz
$ cd git-2.2.1/
$ ./configure
$ make
$ make install

このままだとGitのバージョンがそのままなので、
一旦閉じて開き直すとバージョンが新しくなってると思います

$ git version
> git version 2.2.1

Metasploit

metasploitの最新版をいれる
PostgreSQLを起動して、既存のmetasploitはデーモンを停止してから実行

$ service postgresql start
$ service metasploit stop
$ apt-get install build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev openjdk-7-jre subversion git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev vncviewer libyaml-dev ruby-dev libpq-dev ruby-pcap libpcap-ruby libpcap0.8-dev
$ git clone https://github.com/rapid7/metasploit-framework.git
$ cd metasploit-framework
$ bundle install

初期セットアップ(1)
metasploitのデータベースとそのユーザを作る

$ su - postgres
$ createuser msfgit -P -S -R -D
# パスワードはmsfとかで
$ createdb -O msfgit msfgit
$ exit

初期セットアップ(2)
設定ファイルを作る

$ msfconsole
(しばらく待ちます)
msf> quit

(これで /root/.msf4ができる)

$ vi /root/.msf4/database.yml
database.yml
production:
  adapter: "postgresql"
  database: "msfgit"
  username: "msfgit"
  password: "msf"
  port: 5432
  host: "localhost"
  pool: 256
  timeout: 5

Node.js

node.jsを入れる

$ apt-get install python g++ make checkinstall fakeroot
$ src=$(mktemp -d) && cd $src
$ wget -N http://nodejs.org/dist/node-latest.tar.gz
$ tar xzvf node-latest.tar.gz && cd node-v*
$ ./configure
$ fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
$ dpkg -i node_*

備考

あとはこれをVagrant+ansibleとかでやっちゃえば最強!
(他力本願)

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3