#!/bin/bash echo echo "-------------------------------" echo " fritz" echo "--[ free news-server seeker ]--" echo "-------------------------------" echo if [ ! $# = 1 ] ; then echo " Usage: $1 " echo else if [ ! -r /var/run/ppp* ]; then echo "Non e' stato rilevato nessun accesso ad internet" echo "Se si e' connessi direttamente alla rete, commentare le" echo "righe 12, 13, 14, 15, 16 e la sestultima di questo script" else echo I server che permettono solo di leggere le news saranno scritti echo nel file server_only_to_read_from.txt, mentre quelli che permettono echo anche il posting verranno scritti nel file server_to_post.txt echo if [ -e list ] ; then rm list; fi cat > nc_pipe-file << 'EOFEOF' group alt.hackers.cough.cough.cough quit EOFEOF nc $1 119 < nc_pipe-file | tee -a tmp1 PRIMO=`head -2 tmp1 | tail -1 | cut -d\ -f3` ULTIMO=`head -2 tmp1 | tail -1 | cut -d\ -f4` echo Scarico le Path dei messaggi dal $PRIMO al $ULTIMO echo "group alt.hackers.cough.cough.cough" > nc_pipe-file echo xhdr path $PRIMO-$ULTIMO >> nc_pipe-file echo quit >> nc_pipe-file nc $1 119 < nc_pipe-file | tee -a list if [ -e tmp_file ] ; then rm tmp_file; fi for num in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ; do cat list | cut -d\ -f2 | grep -v Path | cut -d\! -f$num >> tmp_file done #cat tmp_file | cut -d\ -f2,3,4,5,6,7,8,9,10 | sort | uniq \ #| cut -d\! -f2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 \ #| grep -v not-for-mail | grep -v POSTED | grep -v \/ \ #| grep -v MISMATCH | grep [.] > server_list cat tmp_file | sort | uniq | grep -v not-for-mail | grep -v POSTED | grep -v \/ \ | grep -v MISMATCH | grep [.] > server_list rm tmp_file echo echo Lista di server scaricata in ./server_list echo echo Inizio dei test... echo for news_server in `cat server_list` ; do echo -e "\n--------------------------" >> tmp_1 echo -n "$news_server -->">> tmp_1 echo quit | nc -w2 $news_server 119 >> tmp_1 done cat tmp_1 > server_result.txt if [ -e tmp_1 ] ; then rm tmp_1; fi grep --ignore-case 200.*posting.ok server_result.txt | cut -d\ -f1 > server_to_post.txt grep --ignore-case 200.*posting.allowed server_result.txt | cut -d\ -f1 >> server_to_post.txt grep --ignore-case 201.*no.posting server_result.txt | cut -d\ -f1 > server_only_to_read_from.txt echo Scan completato. echo echo " --[ fritz ]--" echo " Club SpiPPoLaTorI" echo " www.spippolatori.com" echo fi fi echo echo " --[ fritz ]--" echo " Club SpiPPoLaTorI" echo " www.spippolatori.com" echo