Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -ne 3 ] # si le nombre de paramètres n'est pas 3
- then # affiche l'usage
- echo -n "\n"
- echo "Ce script scanne les flux multicast RTP et renvoi ses resultats dans un fichier"
- echo "en utilisant mcfirst,dumprtp et dvbsnoop "
- echo -n "\n"
- echo "Usage: $0 <ip> <port> <fichier de destination>"
- echo -n "\n"
- exit 1
- fi
- IP=$1
- PORT=$2
- F_DEST=$3
- #IP="233.136.0."
- #PORT="7500"
- for i in {1..254}
- do
- echo "test de ${IP}${i}"
- NB_LINE=`mcfirst ${IP}${i} ${PORT} -t 2|wc -l`
- echo "$NB_LINE lignes trouvées"
- if [ $NB_LINE -ne 2 ]
- then
- echo "test de cryptage de ${IP}${i}"
- NB_NONCRYPT=`dumprtp ${IP}${i} ${PORT}|dvbsnoop -s ts -N 10 -ph 0 -crc -if - |grep 'transport_scrambling_control: 0'|wc -l`
- echo $NB_NONCRYPT
- if [ $NB_NONCRYPT -ne 10 ]
- then
- echo "dommage, crypté"
- echo "================================"
- else
- echo "en clair !"
- echo "écriture de ${IP}${i} dans la liste des chaines"
- echo "rtp://@${IP}${i}:${PORT}" >> ${F_DEST}
- echo "================================"
- fi
- else
- echo "pas assez de lignes, rien a faire"
- echo "================================="
- fi
- sleep 3
- done
Add Comment
Please, Sign In to add comment