Authforce
提供:MDWiki
Authforce は、HTTP認証に対してブルートフォース攻撃を加えるツールである。さまざまな方法を使って、このツールはユーザ名とパスワードの組み合わせからなる攻撃を目的のサイトに対して加える。つまり、よく使われているユーザ名やパスワード、ユーザ名から派生する綴り、そしてよく使われるユーザ名とパスワードの組み合わせで攻撃を仕掛けられる。このツールを使って、あなたのサイトのセキュリティをテストできるし、ユーザがまさによいパスワードを使っていないという事実にもとづいてHTTP認証に攻撃を加え、どれほど通信を暗号化してもパスワードが脆弱なら意味が無いことを証明するために利用できる。
インストール
FreeBSD 8.2 release 上での操作を想定する。
freebsd# cd /usr/ports/security/authforce freebsd# cat distinfo SHA256 (authforce-0.9.9.tar.bz2) = 8df475c066151fbdfe1f1f41d05a9c717ff5b734ec0bc42e280705988a2b0712 SIZE (authforce-0.9.9.tar.bz2) = 303077 freebsd# cat pkg-descr Authforce is an HTTP authentication brute forcer. Using various methods, it attempts brute force username and password pairs for a site. It has the ability to try common username and passwords, username derivations, and common username/password pairs. It is used to both test the security of your site and to prove the insecurity of HTTP authentication based on the fact that users just don't pick good passwords. WWW: http://www.divineinvasion.net/authforce/
freebsd# make ===> Vulnerability check disabled, database not found ===> License check disabled, port has not defined LICENSE => authforce-0.9.9.tar.bz2 doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch http://www.divineinvasion.net/authforce/authforce-0.9.9.tar.bz2 authforce-0.9.9.tar.bz2 100% of 295 kB 187 kBps ===> Extracting for authforce-0.9.9 => SHA256 Checksum OK for authforce-0.9.9.tar.bz2. ===> Patching for authforce-0.9.9 ===> Applying FreeBSD patches for authforce-0.9.9 ===> authforce-0.9.9 depends on shared library: curl.6 - found ===> authforce-0.9.9 depends on shared library: intl - found ===> Configuring for authforce-0.9.9 checking build system type... i386-portbld-freebsd8.2 checking host system type... i386-portbld-freebsd8.2 checking target system type... i386-portbld-freebsd8.2 checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel checking whether build environment is sane... yes checking for gawk... no checking for mawk... no checking for nawk... nawk checking whether make sets $(MAKE)... yes checking if malloc debugging is wanted... no checking whether NLS is requested... yes checking for msgfmt... /usr/local/bin/msgfmt checking for gmsgfmt... /usr/local/bin/msgfmt checking for xgettext... /usr/local/bin/xgettext checking for msgmerge... /usr/local/bin/msgmerge checking for style of include used by make... GNU checking for gcc... cc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking dependency style of cc... gcc3 checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for shared library run path origin... ./config.rpath: Can't open ./config.rpath: No such file or directory done checking for CFPreferencesCopyAppValue... no checking for CFLocaleCopyCurrent... no checking for GNU gettext in libc... no checking for iconv... yes checking for GNU gettext in libintl... yes checking whether to use NLS... yes checking where the gettext function comes from... external libintl checking how to link with libintl... -lintl checking for gcc... (cached) cc checking whether we are using the GNU C compiler... (cached) yes checking whether cc accepts -g... (cached) yes checking for cc option to accept ISO C89... (cached) none needed checking dependency style of cc... (cached) gcc3 checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel checking for curl_easy_init in -lcurl... yes checking for initscr in -lncurses... yes checking for readline in -lreadline... yes checking how to run the C preprocessor... cpp checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking malloc.h usability... no checking malloc.h presence... no checking for malloc.h... no checking for unistd.h... (cached) yes checking for an ANSI C-conforming const... yes checking for size_t... yes checking return type of signal handlers... void checking for strdup... yes checking for strstr... yes configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating doc/Makefile config.status: creating po/Makefile.in config.status: creating data/Makefile config.status: creating authforce.spec config.status: creating config.h config.status: executing po-directories commands config.status: creating po/POTFILES config.status: creating po/Makefile config.status: executing depfiles commands ===> Building for authforce-0.9.9 make all-recursive Making all in data Making all in src if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT config.o -MD -MP -MF ".deps/config.Tpo" -c -o config.o config.c; then mv -f ".deps/config.Tpo"\ ".deps/config.Po"; else rm -f ".deps/config.Tpo"; exit 1; fi if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT debug.o -MD -MP -MF ".deps/debug.Tpo" -c -o debug.o debug.c; then mv -f ".deps/debug.Tpo"\ ".deps/debug.Po"; else rm -f ".deps/debug.Tpo"; exit 1; fi if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT extract.o -MD -MP -MF ".deps/extract.Tpo" -c -o extract.o extract.c; then mv -f ".deps/extract.Tpo"\ ".deps/extract.Po"; else rm -f ".deps/extract.Tpo"; exit 1; fi if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT files.o -MD -MP -MF ".deps/files.Tpo" -c -o files.o files.c; then mv -f ".deps/files.Tpo"\ ".deps/files.Po"; else rm -f ".deps/files.Tpo"; exit 1; fi files.c: In function 'textlist': files.c:73: warning: cast from pointer to integer of different size files.c: In function 'copy_list': files.c:86: warning: cast from pointer to integer of different size files.c:94: warning: cast from pointer to integer of different size files.c:99: warning: cast from pointer to integer of different size files.c: In function 'free_list': files.c:107: warning: cast from pointer to integer of different size if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT http.o -MD -MP -MF ".deps/http.Tpo" -c -o http.o http.c; then mv -f ".deps/http.Tpo"\ ".deps/http.Po"; else rm -f ".deps/http.Tpo"; exit 1; fi if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.c; then mv -f ".deps/main.Tpo"\ ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi main.c: In function 'main': main.c:191: warning: passing argument 1 of 'help' discards qualifiers from pointer target type if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT methods.o -MD -MP -MF ".deps/methods.Tpo" -c -o methods.o methods.c; then\ mv -f ".deps/methods.Tpo" ".deps/methods.Po"; else rm -f ".deps/methods.Tpo"; exit 1; fi methods.c: In function 'transform': methods.c:78: warning: cast from pointer to integer of different size methods.c: In function 'common_pairs': methods.c:122: warning: cast from pointer to integer of different size if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT misc.o -MD -MP -MF ".deps/misc.Tpo" -c -o misc.o misc.c; then mv -f ".deps/misc.Tpo"\ ".deps/misc.Po"; else rm -f ".deps/misc.Tpo"; exit 1; fi if cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -O2\ -pipe -fno-strict-aliasing -MT signal.o -MD -MP -MF ".deps/signal.Tpo" -c -o signal.o signal.c; then mv -f ".deps/signal.Tpo"\ ".deps/signal.Po"; else rm -f ".deps/signal.Tpo"; exit 1; fi cc -O2 -pipe -fno-strict-aliasing -L/usr/local/lib -o authforce config.o debug.o extract.o files.o http.o main.o methods.o\ misc.o signal.o -lintl -lreadline -lncurses -lintl -lcurl Making all in doc Making all in po test ! -f ./authforce.pot || test -z "nl.gmo" || make nl.gmo `nl.gmo' is up to date. touch stamp-po
freebsd# make install clean ===> Installing for authforce-0.9.9 ===> authforce-0.9.9 depends on shared library: curl.6 - found ===> authforce-0.9.9 depends on shared library: intl - found ===> Generating temporary packing list ===> Checking if security/authforce already installed Making install in data test -z "/usr/local/share/authforce" || /usr/ports/security/authforce/work/authforce-0.9.9/install-sh -d "/usr/local/share/authforce" install -o root -g wheel -m 444 'blank.lst' '/usr/local/share/authforce/blank.lst' install -o root -g wheel -m 444 'dummy.lst' '/usr/local/share/authforce/dummy.lst' install -o root -g wheel -m 444 'password.lst' '/usr/local/share/authforce/password.lst' install -o root -g wheel -m 444 'username.lst' '/usr/local/share/authforce/username.lst' install -o root -g wheel -m 444 'userpass.lst' '/usr/local/share/authforce/userpass.lst' Making install in src test -z "/usr/local/bin" || /usr/ports/security/authforce/work/authforce-0.9.9/install-sh -d "/usr/local/bin" install -s -o root -g wheel -m 555 'authforce' '/usr/local/bin/authforce' Making install in doc test -z "/usr/local/info/" || /usr/ports/security/authforce/work/authforce-0.9.9/install-sh -d "/usr/local/info/" install -o root -g wheel -m 444 './authforce.info' '/usr/local/info//authforce.info' install-info --info-dir='/usr/local/info/' '/usr/local/info//authforce.info' install-info: warning: no info dir entry in `/usr/local/info//authforce.info' test -z "/usr/local/man/man1" || /usr/ports/security/authforce/work/authforce-0.9.9/install-sh -d "/usr/local/man/man1" install -o root -g wheel -m 444 './authforce.1.gz' '/usr/local/man/man1/authforce.1.gz' Making install in po /bin/sh /usr/ports/security/authforce/work/authforce-0.9.9/install-sh -d /usr/local/share installing nl.gmo as /usr/local/share/locale/nl/LC_MESSAGES/authforce.mo if test "authforce" = "gettext-tools"; then /bin/sh /usr/ports/security/authforce/work/authforce-0.9.9/install-sh -d\ /usr/local/share/gettext/po; for file in Makefile.in.in remove-potcdate.sin Makevars.template; do install -o root -g wheel\ -m 444 ./$file /usr/local/share/gettext/po/$file; done; for file in Makevars; do rm -f /usr/local/share/gettext/po/$file;\ done; else : ; fi install-info --quiet /usr/local/info/authforce.info /usr/local/info/dir install-info: warning: no info dir entry in `/usr/local/info/authforce.info' ===> Registering installation for authforce-0.9.9 ===> Cleaning for curl-7.21.3_2 ===> Cleaning for ca_root_nss-3.12.11_1 ===> Cleaning for authforce-0.9.9 freebsd#
使い方
実行ファイルは /usr/local/bin/authforce である。辞書ファイル(.lst)は、/usr/local/share/authforce にある。
SYNOPSIS
authforce [オプション] URL
OPTIONS
-b マッチしたらビープ音を鳴らす。
-d, --debug
0から5までのデバッグレベルを指定する。
--dummy-file
[ユーザ名:パスワード] 形式のダミーファイルにもマッチさせる。
-h, --help
ヘルプを表示して抜ける。
-l FILE, --logfile=FILE
FILE にログファイルを出力する。
-r, --resume[=FILE]
ディフォールトでは session.save された古いセッション(FILEを使う)を使ってレジュームする。
-s, --save[=FILE]
ディフォールトでは session.save された SIGUSR1 上のセッションを FILE に保存する。
-c, --max-connects=NUMBER
NUMBER 以下に接続数を制限する。
-u, --max-users=NUMBER
NUMBER 以上のユーザで試行しない。
-U, --user-agent=STRING
ユーザーエージェント文字列を STRING にセットする。
--pairs-file=FILE
username:password のファイルを使う。
--password-delay=NUMBER
再試行まで NUMBER 秒だけ待つ。
--password-file=FILE
一般的なパスワードファイルを FILE として指定する。
-p, --path=STRING
STRING のパスを検索する。
-P, --proxy=STRING
STRING にプロキシをセットする。
-q, --quiet
標準出力に何も表示しない。
--user-delay=NUMBER
ユーザ名の再試行まで NUMBER 秒だけ待つ。
--username-file=FILE
ユーザ名のリストを FILE として指定する。
-v, --verbose
--quiet の逆で、標準出力に表示する。(ディフォールトの挙動)
-V, --version
バージョン番号を出力して抜ける。
リモートサーバに対して使うのは気が引けるため、まずはローカルで動かしてみるのがよい。
freebsd# ./authforce -p /usr/local/share/authforce -l ./authforce.log http://localhost/index.html match [bob:bob] match [joe:joe] match [susan:susan] match [david:david] match [test:test] match [admin:admin] match [user:pass] match [1234:1234] match [12345:12345] match [1234:4321] match [username:password] match [guest:guest] Congratulations: 12 passwords found. freebsd#
のようになって、ログには
freebsd# cat authforce.log scan started: Tue Oct 11 10:21:31 2011
と出力される。なんとなく非力な印象があるので、他のツールで代用できればそちらの方がいいかも。
リンク
- セキュリティ関連メモ のトップページへ
- メインページへ