欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

jamf 弱密码 条件规则 Criteria 有大用 有大大用

#!/bin/bash
#
passwords=("1234" "0000" "1111"  "2222" "3333" "4444" "5555" "6666" "7777" "8888" "9999" "aaaa" "abcd"
"12345"  "00000" "11111"  "22222" "33333" "44444" "55555" "66666" "77777" "88888" "99999" "aaaaa" "abcde" "admin"
"123456"  "000000" "111111"  "222222" "333333" "444444" "555555" "666666" "777777" "888888" "999999" "aaaaaa" "abcdef"  "admin1"
"1234567"  "0000000" "1111111"  "2222222" "3333333" "4444444" "5555555" "6666666" "7777777" "8888888" "9999999" "aaaaaaa" "abcdefg"  "admin12"
"12345678"  "00000000" "11111111"  "22222222" "33333333" "44444444" "55555555" "66666666" "77777777" "88888888" "99999999" "aaaaaaaa" "abcdefgh"  "admin123"
"123456789"  "000000000" "111111111"  "222222222" "333333333" "444444444" "555555555" "666666666" "777777777" "888888888" "999999999" "aaaaaaaaa" "abcdefghi"  "admin1234"
"1990" "2000" "1989" "qwerty" "password" "love" "sunshine" "football" "abcabc" "123123" "1234567890"
"admin" "user" "guest" "qwerty" "monkey" "dragon" "zxyz" "abcd1234"  "5201314" "1314520" "passwd"
"guest" "letmein" "welcome" "asdfgh" "zxcvbn" "qazwsx" "azerty"
)


ALLUSERS=`dscl . list /Users | grep -v '_'  | grep -v 'daemon\|bbbb-admin\|nobody\|root'`
for p in "${passwords[@]}"; do
    for one_user in $ALLUSERS ; do
        dscl . -authonly $one_user  $p > /dev/null 2&>1
        if [ $? = 0 ];then
            echo   "<result>1</result>"
            exit;
        fi
    done
done
echo   "<result>0</result>"


普通分类: