labunix's blog

labunixのラボUnix

Smoothwall Express 3.0 SP3をvmplayerに導入する。

 

■Smoothwall Express 3.0 SP3を導入する。

 要約すると、Linuxベースのセキュリティアプライアンスで、
 Web管理画面での設定が可能。
 ただし、デフォルトでも動作するが、様々な制限がある為、カスタマイズが必要。

■SmoothWallがどんなものかは以下を参照。

 SmoothWall Expressでネットワークを保護する
 http://sourceforge.jp/magazine/08/12/11/0114235i386のkernelバージョンは「2.6.32.26+drm33.12-0」
 一般的なisolinux。

$ sudo mount -o loop smoothwall-express-3.0-sp3-i386.iso /media/cdrom0/
$ ls /media/cdrom
PTStart.exe  README.txt  autorun.inf  docs      smoothwall.ico
README.html  autorun     boot.cat     isolinux  smoothwall.tgz
$ tar ztvf /media/cdrom/smoothwall.tgz | grep '/lib/modules/' | sed s%".*lib/modules/\|/.*"%%g | sort -u
2.6.32.26+drm33.12-0-runtime
2.6.32.26+drm33.12-0-runtimebig

■ISOLINXのバージョンは2.09でインストーラの起動オプションがあらかじめ設定されている。

$ strings /media/cdrom/isolinux/isolinux.bin  | grep ISOLINUX
ISOLINUX 2.09 2004-04-26

$ grep . /media/cdrom/isolinux/isolinux.cfg
default linux
prompt 1
display message.txt
label linux
  kernel vmlinuz
  append initrd=initrd.img root=/dev/ram0 rw no-scroll ramdisk_size=8192

■MBRは空なので、USB起動をしたい場合には、別途ブートローダが必要。

$ sudo umount /media/cdrom
$ sudo dd if=smoothwall-express-3.0-sp3-i386.iso bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 3.0841e-05 s, 16.6 MB/s

■時期から考えると、Ubuntu Lucidベースだろうか。

 Lucid update to 2.6.32.26+drm33.12 stable release
 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/683257

■インストール [001]~[034]

■001 [Press Enter]
 ※起動
 

f:id:labunix:20130128214818p:plain

■002 [OK]
 ※welcomeメッセージ
 

f:id:labunix:20130128214821p:plain

■003 [OK]
 ※CDの挿入確認(カスタムブートを想定している?)

f:id:labunix:20130128214822p:plain

■004 [OK]
 ※ディスクドライブの選択(出来なくは無いが、マルチブートは止めた方が良い)

f:id:labunix:20130128214829p:plain

■005 [OK]
 ※ハードディスクのデータ消去警告

f:id:labunix:20130128214830p:plain

■006 [Installing files...]
 ※インストールはすぐ終わる。
 

f:id:labunix:20130128214833p:plain

■007 [OK]
 ※おめでとう。

f:id:labunix:20130128214839p:plain

■008 [No]
 ※Vyatta同様アプライアンスなので保存した設定から復元可能。
  初回なので、FD保存はしていない。

f:id:labunix:20130128214843p:plain

■009 [jp106]
 ※日本語キーボードの選択

f:id:labunix:20130128214851p:plain

■010 [smoothwall] (デフォルト)
 ※ホスト名の設定

f:id:labunix:20130128214903p:plain

■011 [Half-open] (デフォルト)

f:id:labunix:20130128214859p:plain

■012 [初期設定]
 ※色で設定する面白いポリシー。

f:id:labunix:20130128214905p:plain

■013 [OK]
 ※NICが認識されていないなら。。。

f:id:labunix:20130128214918p:plain

■014 [VMWare vmxnet virtual NIC driver]
 ※ドライバを選択。

f:id:labunix:20130128214928p:plain

■015 [OK]
 ※どの色のNICにドライバを設定するか。

f:id:labunix:20130128214933p:plain

■016 [OK]
 ※ドライバの設定成功
 

f:id:labunix:20130128214938p:plain

■017 [Address settings]
 ※静的IP設定

f:id:labunix:20130128214942p:plain

■018 [OK]
 ※NICは色で表現される
 

f:id:labunix:20130128214944p:plain

■019 [OK]
 ※IPを変更するとアクセスできなくなるかも知れないので気をつけてね。
 

f:id:labunix:20130128214952p:plain

■020 [192.168.0.1/24] (デフォルト)

f:id:labunix:20130128214955p:plain

■021 [Done]

f:id:labunix:20130128215005p:plain

■022 [Done]

f:id:labunix:20130128215009p:plain

■023 [Web proxy]
 ※プロキシを設定しないとお外に出れない人は。。。
 

f:id:labunix:20130128215010p:plain

■023 [Hostname/Port]
 ※HostnameはIPでも可。
 

f:id:labunix:20130128215015p:plain

■024 [Finished]

f:id:labunix:20130128215019p:plain

■025 [adminパスワード] (Web管理用)

f:id:labunix:20130128215024p:plain

■026 [rootパスワード] (shell用)

f:id:labunix:20130128215033p:plain

■028 [OK]
 ※初期設定の完了、再起動します。
 

f:id:labunix:20130128215038p:plain

■029 [login]
 ※見ての通り、81/441でWeb管理に繋がる。

f:id:labunix:20130128215043p:plain

■「penetration.sh」によるチェック

$ w3m -dump https://raw.github.com/labunix/penetration/master/penetration.sh > penetration.sh
$ test -f penetration.sh && chmod +x penetration.sh
$ sudo ./penetration.sh 192.168.0.1 | tail -A 25
Interesting ports on 192.168.0.1:
Not shown: 65532 closed ports
PORT    STATE SERVICE VERSION
53/tcp  open  domain  dnsmasq 2.57
81/tcp  open  http    Apache httpd 2.2.17 ((Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/0.9.8r)
|  html-title: Error 401
|_ Requested resource was http://192.168.0.1/cgi-bin/index.cgi
441/tcp open  http    Apache httpd 2.2.17 (DAV/2 mod_ssl/2.2.17 OpenSSL/0.9.8r)
|_ html-title: 400 Bad Request
MAC Address: 00:XX:XX:XX:XX:XX (VMware)
Device type: general purpose
Running: Linux 2.6.X
OS details: Linux 2.6.13 - 2.6.27
Uptime guess: 0.000 days (since Mon Jan 28 21:30:16 2013)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=205 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: Host: smoothwall

Read data files from: /usr/share/nmap
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 15.72 seconds
           Raw packets sent: 65562 (2.885MB) | Rcvd: 65551 (2.623MB)

■w3mでログインチェック。「admin/パスワード」

$ w3m http://192.168.164.222:81

■マスカレードと、必要ならばルーティングテーブルも。

$ sudo iptables -t nat -A POSTROUTING -o vmnet8 -j MASQUERADE

■NAT経由でも問題なし。hostsかDNSに登録しても良いし、
 「port:441」なので、「https」を忘れなければIPでも良い。
 ポート転送でも問題ないようだ。

■030 [home] (Web管理/adminログイン)

f:id:labunix:20130128215045p:plain

■031 [click here to begin]

f:id:labunix:20130128215054p:plain

■032 [https] (Chromeの場合、「https」は必須)

f:id:labunix:20130128215058p:plain

■033 [hosts/DNS] (Port:441 自己証明書)

f:id:labunix:20130128215102p:plain

■034 https://IP:441

f:id:labunix:20130128215112p:plain

■何もかもWeb管理で設定しなくてはならない。毎回キャプチャするのはちょっとw。。。
 ※良く言えば、統一されているということです。

■Web管理画面はJavaベースで動きます。
 sshもWeb管理画面から利用できます。
 

f:id:labunix:20130128224046p:plain