IP Blacklist #4940
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: IP Blacklist | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */6 * * *' | |
jobs: | |
fetch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Fetch | |
run: | | |
chmod +x ./cidr-merger | |
gzip -d all_blacklist_append.txt.gz && mv all_blacklist_append.txt all_blacklist_append.tmp | |
echo "">abuseipdb_blacklist_ip_score_100.tmp | |
echo "">abuseipdb_blacklist_ip_score_75.tmp | |
curl -G https://api.abuseipdb.com/api/v2/blacklist -d ipVersion=6 -d confidenceMinimum=100 -d limit=9999999 -d plaintext -H "Key: ${{ secrets.ABUSEIPDB_TOKEN }}" -H "Accept: text/plain" >> abuseipdb_blacklist_ip_score_100.tmp || true | |
curl -G https://api.abuseipdb.com/api/v2/blacklist -d ipVersion=6 -d confidenceMinimum=75 -d limit=9999999 -d plaintext -H "Key: ${{ secrets.ABUSEIPDB_TOKEN }}" -H "Accept: text/plain" >> abuseipdb_blacklist_ip_score_75.tmp || true | |
echo "">>abuseipdb_blacklist_ip_score_100.tmp | |
echo "">>abuseipdb_blacklist_ip_score_75.tmp | |
curl -G https://api.abuseipdb.com/api/v2/blacklist -d ipVersion=4 -d confidenceMinimum=100 -d limit=9999999 -d plaintext -H "Key: ${{ secrets.ABUSEIPDB_TOKEN }}" -H "Accept: text/plain" >> abuseipdb_blacklist_ip_score_100.tmp || true | |
curl -G https://api.abuseipdb.com/api/v2/blacklist -d ipVersion=4 -d confidenceMinimum=75 -d limit=9999999 -d plaintext -H "Key: ${{ secrets.ABUSEIPDB_TOKEN }}" -H "Accept: text/plain" >> abuseipdb_blacklist_ip_score_75.tmp || true | |
./cidr-merger -o abuseipdb_blacklist_ip_score_75.txt abuseipdb_blacklist_ip_score_75.tmp | |
./cidr-merger -o abuseipdb_blacklist_ip_score_100.txt abuseipdb_blacklist_ip_score_100.tmp | |
curl http://antivirus.neu.edu.cn/ssh/lists/neu.txt -H "Accept: text/plain"|grep -v "127.0.0.1"|grep -v "#"| awk -F" " '{print $2}'|./cidr-merger -o neucert_blacklist_ip.txt || true | |
curl https://blackip.ustc.edu.cn/list.php?txt -H "Accept: text/plain"|grep -v "127.0.0.1"|./cidr-merger -o ustc_blacklist_ip.txt || true | |
./cidr-merger -o all_blacklist_append.txt *.txt all_blacklist_append.tmp | |
gzip all_blacklist_append.txt | |
rm -f *.tmp | |
- name: Commit | |
run: | | |
git config --global user.email [email protected] | |
git config --global user.name Action | |
git add . | |
git commit -m "Update IP." -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |