[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: anti-bruteforce PAM module



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andy Armstrong wrote:
>> There is the first version of my anti bruteforce PAM module available.
>> It's primarily intended for preventing bruteforce attacks on 
>> authentification-protected services (SSH, telnet, etc).
> That looks somewhat similar to pam_abl - although I haven't checked 
> your module in detail. Are there features we should be merging? :)

I did intend to do a comparison of the two but, unfortunately,
Stanislav's module just won't compile and then I got distracted by work...

I just quickly gave it another go under Fedora Core 3:

$ make
if [ "`uname -s`" = "FreeBSD" ]; then \
        make CFLAGS="-I./common/ -DPIC -O2 -Wall -Werror -Wno-format-y2k
- -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
- -Wchar-subscripts -Winline -Wnested-externs -fPIC -D_HAVE_PATHS_H_
- -D_HAVE_ERR_H_ -D_HAVE_GETPROGNAME_ -D_USE_MODULE_ENTRY_" \
                LD=ld LDFLAGS=" -s --shared -lpam -lcrypt" \
                ./pam_af.so; \
        make CFLAGS="-I./common/ -DPIC -O2 -Wall -Werror -Wno-format-y2k
- -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
- -Wchar-subscripts -Winline -Wnested-externs -fPIC -D_HAVE_PATHS_H_
- -D_HAVE_ERR_H_ -D_HAVE_GETPROGNAME_ -D_USE_MODULE_ENTRY_" \
                LDFLAGS="" ./pam_af_tool/pam_af_tool; \
elif [ "`uname -s`" = "Linux" ]; then \
        make CFLAGS="-I./common/ -DPIC -O2 -Wall -Werror -Wno-format-y2k
- -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
- -Wchar-subscripts -Winline -Wnested-externs -fPIC -D_GNU_SOURCE
- -D_HAVE_PATHS_H_ -D_HAVE_ERR_H_ -D_HAVE_FLOCK_ -D_HAVE_SYS_FILE_H_
- -D_USE_MODULE_ENTRY_" \
                LD=ld LDFLAGS="-lgdbm -lgdbm_compat -s --shared -lpam
- -lcrypt" \
                ./pam_af.so; \
        make CFLAGS="-I./common/ -DPIC -O2 -Wall -Werror -Wno-format-y2k
- -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
- -Wchar-subscripts -Winline -Wnested-externs -fPIC -D_GNU_SOURCE
- -D_HAVE_PATHS_H_ -D_HAVE_ERR_H_ -D_HAVE_FLOCK_ -D_HAVE_SYS_FILE_H_
- -D_USE_MODULE_ENTRY_" \
                LDFLAGS="-lgdbm -lgdbm_compat" ./pam_af_tool/pam_af_tool; \
elif [ "`uname -s`" = "SunOS" ]; then \
        make CFLAGS="-I./common/ -DPIC -KPIC -xO2 -D_SUN_PAM_
- -D_HAVE_USERDEFS_H_" \
                LD=ld LDFLAGS="-lnsl -lsocket -s -G -lpam -lcrypt" \
                ./pam_af.so; \
        make CFLAGS="-I./common/ -DPIC -KPIC -xO2 -D_SUN_PAM_
- -D_HAVE_USERDEFS_H_" \
                LDFLAGS="-lnsl -lsocket" ./pam_af_tool/pam_af_tool; \
elif [ "`uname -s`" = "HP-UX" ]; then \
        make CFLAGS="-Ae +w1 +W 474,486,542 +z +O2" \
                LD=ld LDFLAGS=" -s -b -lpam -lsec" \
                ./pam_af.so; \
        make CFLAGS="-I./common/ -DPIC -Ae +w1 +W 474,486,542 +z +O2" \
                LDFLAGS="" ./pam_af_tool/pam_af_tool; \
else \
        make ./pam_af.so; \
        make ./pam_af_tool/pam_af_tool; \
fi
make[1]: Entering directory `/chroot/home/benjamin/pam_af-1.0alpha'
cc -I./common/ -DPIC -O2 -Wall -Werror -Wno-format-y2k -Wreturn-type
- -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
- -Wchar-subscripts -Winline -Wnested-externs -fPIC -D_GNU_SOURCE
- -D_HAVE_PATHS_H_ -D_HAVE_ERR_H_ -D_HAVE_FLOCK_ -D_HAVE_SYS_FILE_H_
- -D_USE_MODULE_ENTRY_ -c ./pam_af.c -o pam_af.o
./pam_af.c:45:18: ndbm.h: No such file or directory
./pam_af.c: In function `pam_sm_authenticate':
./pam_af.c:188: error: `DBM' undeclared (first use in this function)
./pam_af.c:188: error: (Each undeclared identifier is reported only once
./pam_af.c:188: error: for each function it appears in.)
./pam_af.c:188: error: `stdbp' undeclared (first use in this function)
./pam_af.c:190: error: `datum' undeclared (first use in this function)
./pam_af.c:190: error: syntax error before "key"
./pam_af.c:236: warning: implicit declaration of function `dbm_open'
./pam_af.c:236: warning: nested extern declaration of `dbm_open'
./pam_af.c:255: warning: implicit declaration of function `dbm_pagfno'
./pam_af.c:255: warning: nested extern declaration of `dbm_pagfno'
./pam_af.c:258: warning: implicit declaration of function `dbm_close'
./pam_af.c:258: warning: nested extern declaration of `dbm_close'
./pam_af.c:263: error: `key' undeclared (first use in this function)
./pam_af.c:267: error: `data' undeclared (first use in this function)
./pam_af.c:267: warning: implicit declaration of function `dbm_fetch'
./pam_af.c:267: warning: nested extern declaration of `dbm_fetch'
./pam_af.c:278: warning: nested extern declaration of `dbm_close'
./pam_af.c:294: warning: nested extern declaration of `dbm_close'
./pam_af.c:339: warning: implicit declaration of function `dbm_store'
./pam_af.c:339: warning: nested extern declaration of `dbm_store'
./pam_af.c:339: error: `DBM_REPLACE' undeclared (first use in this function)
./pam_af.c:343: warning: nested extern declaration of `dbm_close'
./pam_af.c: In function `pam_sm_setcred':
./pam_af.c:358: error: `DBM' undeclared (first use in this function)
./pam_af.c:358: error: `stdbp' undeclared (first use in this function)
./pam_af.c:359: error: `datum' undeclared (first use in this function)
./pam_af.c:359: error: syntax error before "key"
./pam_af.c:386: warning: nested extern declaration of `dbm_open'
./pam_af.c:406: warning: nested extern declaration of `dbm_pagfno'
./pam_af.c:409: warning: nested extern declaration of `dbm_close'
./pam_af.c:419: error: `data' undeclared (first use in this function)
./pam_af.c:421: error: `key' undeclared (first use in this function)
./pam_af.c:424: warning: nested extern declaration of `dbm_store'
./pam_af.c:424: error: `DBM_REPLACE' undeclared (first use in this function)
./pam_af.c:429: warning: nested extern declaration of `dbm_close'
./pam_af.c: At top level:
./pam_af.c:435: error: syntax error before string constant
./pam_af.c:435: warning: type defaults to `int' in declaration of
`PAM_MODULE_ENTRY'
./pam_af.c:435: warning: data definition has no type or storage class
make[1]: *** [pam_af.o] Error 1
make[1]: Leaving directory `/chroot/home/benjamin/pam_af-1.0alpha'
make[1]: Entering directory `/chroot/home/benjamin/pam_af-1.0alpha'
cc -I./common/ -DPIC -O2 -Wall -Werror -Wno-format-y2k -Wreturn-type
- -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
- -Wchar-subscripts -Winline -Wnested-externs -fPIC -D_GNU_SOURCE
- -D_HAVE_PATHS_H_ -D_HAVE_ERR_H_ -D_HAVE_FLOCK_ -D_HAVE_SYS_FILE_H_
- -D_USE_MODULE_ENTRY_ -c ./pam_af_tool/pam_af_tool.c -o
pam_af_tool/pam_af_tool.o
./pam_af_tool/pam_af_tool.c:53:18: ndbm.h: No such file or directory
./pam_af_tool/pam_af_tool.c:91: error: syntax error before '*' token
./pam_af_tool/pam_af_tool.c:91: warning: type defaults to `int' in
declaration of `stdbp'
./pam_af_tool/pam_af_tool.c:91: warning: data definition has no type or
storage class
./pam_af_tool/pam_af_tool.c:92: error: syntax error before '*' token
./pam_af_tool/pam_af_tool.c:92: warning: type defaults to `int' in
declaration of `cfgdbp'
./pam_af_tool/pam_af_tool.c:92: warning: data definition has no type or
storage class
./pam_af_tool/pam_af_tool.c: In function `cleanup':
./pam_af_tool/pam_af_tool.c:186: warning: implicit declaration of
function `dbm_close'
./pam_af_tool/pam_af_tool.c:186: warning: nested extern declaration of
`dbm_close'
./pam_af_tool/pam_af_tool.c: In function `handle_ruleadd':
./pam_af_tool/pam_af_tool.c:199: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:199: error: (Each undeclared identifier is
reported only once
./pam_af_tool/pam_af_tool.c:199: error: for each function it appears in.)
./pam_af_tool/pam_af_tool.c:199: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:269: error: `DBM_INSERT' undeclared (first
use in this function)
./pam_af_tool/pam_af_tool.c:269: error: `DBM_REPLACE' undeclared (first
use in this function)
./pam_af_tool/pam_af_tool.c:276: warning: implicit declaration of
function `dbm_open'
./pam_af_tool/pam_af_tool.c:276: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:276: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:284: warning: implicit declaration of
function `dbm_pagfno'
./pam_af_tool/pam_af_tool.c:284: warning: nested extern declaration of
`dbm_pagfno'
./pam_af_tool/pam_af_tool.c:320: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:322: error: `data' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:325: warning: implicit declaration of
function `dbm_store'
./pam_af_tool/pam_af_tool.c:325: warning: nested extern declaration of
`dbm_store'
./pam_af_tool/pam_af_tool.c: In function `handle_rulemod':
./pam_af_tool/pam_af_tool.c:354: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:354: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:430: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:430: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:438: warning: nested extern declaration of
`dbm_pagfno'
./pam_af_tool/pam_af_tool.c:474: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:482: error: `data' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:482: warning: implicit declaration of
function `dbm_fetch'
./pam_af_tool/pam_af_tool.c:482: warning: nested extern declaration of
`dbm_fetch'
./pam_af_tool/pam_af_tool.c:518: warning: nested extern declaration of
`dbm_store'
./pam_af_tool/pam_af_tool.c:518: error: `DBM_REPLACE' undeclared (first
use in this function)
./pam_af_tool/pam_af_tool.c: In function `handle_ruledel':
./pam_af_tool/pam_af_tool.c:542: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:542: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:580: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:580: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:588: warning: nested extern declaration of
`dbm_pagfno'
./pam_af_tool/pam_af_tool.c:622: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:630: error: `data' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:630: warning: nested extern declaration of
`dbm_fetch'
./pam_af_tool/pam_af_tool.c:646: warning: implicit declaration of
function `dbm_delete'
./pam_af_tool/pam_af_tool.c:646: warning: nested extern declaration of
`dbm_delete'
./pam_af_tool/pam_af_tool.c: In function `handle_rulelist':
./pam_af_tool/pam_af_tool.c:667: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:667: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:686: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:686: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:694: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:694: warning: implicit declaration of
function `dbm_firstkey'
./pam_af_tool/pam_af_tool.c:694: warning: nested extern declaration of
`dbm_firstkey'
./pam_af_tool/pam_af_tool.c:694: warning: implicit declaration of
function `dbm_nextkey'
./pam_af_tool/pam_af_tool.c:694: warning: nested extern declaration of
`dbm_nextkey'
./pam_af_tool/pam_af_tool.c:701: error: `data' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:701: warning: nested extern declaration of
`dbm_fetch'
./pam_af_tool/pam_af_tool.c: In function `handle_ruleflush':
./pam_af_tool/pam_af_tool.c:746: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:746: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:772: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:772: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:780: warning: nested extern declaration of
`dbm_pagfno'
./pam_af_tool/pam_af_tool.c:787: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:787: warning: nested extern declaration of
`dbm_firstkey'
./pam_af_tool/pam_af_tool.c:788: warning: nested extern declaration of
`dbm_delete'
./pam_af_tool/pam_af_tool.c: In function `handle_statdel':
./pam_af_tool/pam_af_tool.c:805: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:805: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:840: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:840: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:848: warning: nested extern declaration of
`dbm_pagfno'
./pam_af_tool/pam_af_tool.c:854: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:857: warning: nested extern declaration of
`dbm_delete'
./pam_af_tool/pam_af_tool.c: In function `handle_statlist':
./pam_af_tool/pam_af_tool.c:877: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:877: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:895: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:895: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:903: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:903: warning: nested extern declaration of
`dbm_firstkey'
./pam_af_tool/pam_af_tool.c:903: warning: nested extern declaration of
`dbm_nextkey'
./pam_af_tool/pam_af_tool.c:904: error: `data' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:904: warning: nested extern declaration of
`dbm_fetch'
./pam_af_tool/pam_af_tool.c: In function `handle_statflush':
./pam_af_tool/pam_af_tool.c:934: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:934: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:960: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:960: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:968: warning: nested extern declaration of
`dbm_pagfno'
./pam_af_tool/pam_af_tool.c:975: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:975: warning: nested extern declaration of
`dbm_firstkey'
./pam_af_tool/pam_af_tool.c:976: warning: nested extern declaration of
`dbm_delete'
./pam_af_tool/pam_af_tool.c: In function `handle_lock':
./pam_af_tool/pam_af_tool.c:995: error: `datum' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:995: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:1033: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:1033: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:1049: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:1049: warning: nested extern declaration of
`dbm_firstkey'
./pam_af_tool/pam_af_tool.c:1049: warning: nested extern declaration of
`dbm_nextkey'
./pam_af_tool/pam_af_tool.c:1065: warning: nested extern declaration of
`dbm_close'
./pam_af_tool/pam_af_tool.c: In function `handle_unlock':
./pam_af_tool/pam_af_tool.c:1089: error: `datum' undeclared (first use
in this function)
./pam_af_tool/pam_af_tool.c:1089: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:1127: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:1127: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:1143: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:1143: warning: nested extern declaration of
`dbm_firstkey'
./pam_af_tool/pam_af_tool.c:1143: warning: nested extern declaration of
`dbm_nextkey'
./pam_af_tool/pam_af_tool.c:1159: warning: nested extern declaration of
`dbm_close'
./pam_af_tool/pam_af_tool.c: In function `lock_host':
./pam_af_tool/pam_af_tool.c:1186: error: `datum' undeclared (first use
in this function)
./pam_af_tool/pam_af_tool.c:1186: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:1214: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:1214: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:1222: warning: nested extern declaration of
`dbm_pagfno'
./pam_af_tool/pam_af_tool.c:1225: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:1227: error: `data' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:1227: warning: nested extern declaration of
`dbm_fetch'
./pam_af_tool/pam_af_tool.c:1252: warning: nested extern declaration of
`dbm_store'
./pam_af_tool/pam_af_tool.c:1252: error: `DBM_REPLACE' undeclared (first
use in this function)
./pam_af_tool/pam_af_tool.c:1255: warning: nested extern declaration of
`dbm_close'
./pam_af_tool/pam_af_tool.c:1260: warning: nested extern declaration of
`dbm_close'
./pam_af_tool/pam_af_tool.c: In function `unlock_host':
./pam_af_tool/pam_af_tool.c:1275: error: `datum' undeclared (first use
in this function)
./pam_af_tool/pam_af_tool.c:1275: error: syntax error before "key"
./pam_af_tool/pam_af_tool.c:1303: warning: nested extern declaration of
`dbm_open'
./pam_af_tool/pam_af_tool.c:1303: warning: assignment makes pointer from
integer without a cast
./pam_af_tool/pam_af_tool.c:1311: warning: nested extern declaration of
`dbm_pagfno'
./pam_af_tool/pam_af_tool.c:1314: error: `key' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:1316: error: `data' undeclared (first use in
this function)
./pam_af_tool/pam_af_tool.c:1316: warning: nested extern declaration of
`dbm_fetch'
./pam_af_tool/pam_af_tool.c:1341: warning: nested extern declaration of
`dbm_store'
./pam_af_tool/pam_af_tool.c:1341: error: `DBM_REPLACE' undeclared (first
use in this function)
./pam_af_tool/pam_af_tool.c:1344: warning: nested extern declaration of
`dbm_close'
./pam_af_tool/pam_af_tool.c:1349: warning: nested extern declaration of
`dbm_close'
make[1]: *** [pam_af_tool/pam_af_tool.o] Error 1
make[1]: Leaving directory `/chroot/home/benjamin/pam_af-1.0alpha'
make: *** [all] Error 2

I suspect that I'm probably missing a dependency, but none are mentioned
in the docs and I haven't got time to figure it out at the moment... Ho
hum! :)

Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIVAwUBQ17Fv+gNmph0Y1E2AQKglA/+NjENSS6EClLnV3f2lMxepmC2RKjrY0Cf
YKCfMxynEg/uGjiL9iZoCN4SGL4dkYyaLCbTZoPte4rJyMwWzrOZ5edFD3Y88Egr
/ieb+yN4/b6ACesCjWEQZjhXlILttAUEqUUSyGosz8DOx0wZ7ZYfBD/giVjPVszW
ZpwwyfnuzuBnG+owjNizg+1pnc1QGv0LDHrUz1L1jvIdcr9+fZe3nf2Zh4uVZ8Zp
kee3/8e3sksCTLCY8ogepIr0fPnDXVCU+JPm0pR8T7qDxfO7qIKZSMo9hfRT+E6C
fD+o9ZYbv1KrJfpQYK1Y47nUgo6jJ9hGhVscLKYWcBUQtMG8z9feVqeoE/G8rEv5
7TXp8FWOO7FrmusdYVgfd7zzTZJCvCCumvWntMpmV+eCrXUmiUahYol5Ls1HqJ/D
CnB38Xf3K9Q8Cq6QQb4qI9487BrTPWPJisF4aBTMGP7nUoSdwfu9hotNdpp48xua
S4ygfOtPtXOqKTaRt6o8b4ZU1qswmt6QdyGX71I+Kv1/WoHgShGMfeO1bMv6Y2GV
bMQGWt7ZAlAyXijY6GCEd2jhUphcmoHpaNSJxFtdDIadri23HJHpKfiKwf+DctYm
DF8zMcJewi7hikXPtxwerztqTiwDWkTv3+j/rpRXG5QAl2TndAuCQ1L76hje8Rjc
WcZzYZFjS8s=
=ij5Q
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]