Hi,
ich würde gerne in telnet n kleinen Portscanner schreiben. Das ganze soll mit telnet funktioniern. Wie kann ich mit telnet überprüfen, ob eine Verbindung hergestellt werden kann (ohne diese auch tatsächlich herzustellen)?
Und noch 'ne Frage:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47:
| #!/usr/bin/perl
$part1=0; $part2=0; $part3=0; $part4=0; $ipaddy=""; $port=0; $iplist=""; $outfile="";
print "Enter port to look for: "; $port=<STDIN>; $iplist="Found IPs reachable at port $port:\n"; print "Looking for IPs reachable at port $port...";
while ($part1<=255) { $ipaddy="$part1.$part2.$part3.$part4"; exec "telnet $ipaddy $port"; if($?==0) { $iplist="$iplist$ipaddy\n"; } $part4=$part4+1; if($part4==256) { $part4=0; $part3=$part3+1; } if($part3==256) { $part3=0; $part2=$part2+1; } if($part2==256) { $part2=0; $part1=$part1+1; } if($ipaddy=="255.255.255.255") { print "Finished!\n"; } }
print "$iplist"; |
So, das ist mein bisheriger code. Jetzt führ er einen telnet-zugriff aus und beendet dann das Programm... Warum!?
Danke, NetZwerg
//EDIT: Das ganze ist eigentlich kein portscanner, sondern mehr ein IP scanner. Ich wollte computer mit offenen telnetports finden ,vlt gibts ja nochmal sowas wie towel.blinkenlights.nl

ich glaube statt exec "blaa" muss ich system("blaa") nehmen, ich probiers mal.
Billy Wilder, amer. Filmregisseur