Tips & Tricks

feissmaik
Entwickler Team
Beiträge: 2576
Registriert: So 17. Apr 2011, 11:39
Been thanked: 1 time
Kontaktdaten:

Tips & Tricks

Beitrag von feissmaik »

Allgemeine Tips & Tricks für OScam


==================================================================================================

Zum schnellen kontrollieren ob eure OScam-Server (Peers) Port 80 geöffnet haben und somit evtl. "unsicher" sein könnten, kann man folgenden Befehl in der Konsole benutzen

Vorraussetzungen:
apt-get install nmap


Befehl:
(alles in einer Zeile)

Code: Alles auswählen

cd /var/etc; cat oscam.server | grep device | awk '{print $3}' > ip.txt && sed -i 's/,/ /g' ip.txt && cat ip.txt | awk '{print $1}' > ipnew.txt && nmap -iL ipnew.txt -p T:80 > result.txt && rm ip*.txt && cat result.txt
(als etwas konfortableres Script)
Spoiler
Show

Code: Alles auswählen

#!/bin/bash
tcpPorts="21-25,80,139,443,8080"
udpPorts="53,111,137"
SKIPdevice="127.0.0.1,/dev/ttyUSB0"

cd /var/etc

cat oscam.server | grep device | awk '{print $3}' > /tmp/ip.txt
sed -i 's/,/ /g' /tmp/ip.txt
IPs=$(cat /tmp/ip.txt | awk '{print $1}')
SKIPdevice=$(echo $SKIPdevice | sed 's/,/ /g')
for I in $IPs; do
	for S in $SKIPdevice; do
		[ "$I" != "$S" ] && echo "$I" >> /tmp/ipnew.txt
	done
done
[ ! -z "$udpPorts" ] && PORTS="U:$udpPorts"
if [ ! -z "$tcpPorts" -a ! -z "$udpPorts" ]; then
	PORTS+=",T:$tcpPorts"
elif [ ! -z "$tcpPorts" -a -z "$udpPorts" ]; then  
	PORTS="T:$tcpPorts"
fi
nmap -iL /tmp/ipnew.txt -p $PORTS > /tmp/result.txt
cat /tmp/result.txt
rm -f /tmp/ip*.txt
rm -f /tmp/result.txt

exit 0
Resultat:

Code: Alles auswählen

Interesting ports on xxx-xxx-xxx-xxx-dynip.superkabel.de (xxx.xxx.xxx.xxx):
PORT   STATE SERVICE
80/tcp open  http

Interesting ports on test (127.0.0.1):
PORT   STATE SERVICE
80/tcp open  http

Nmap done: 4 IP addresses (2 hosts up) scanned in 1.79 seconds


==================================================================================================

Wenn ihr noch mehr TIps & Tricks habt, bitte hier posten - Danke :)
Du musst nicht kämpfen um zu siegen

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 4 Gäste