Jump to content
Silviu

[PHP] Radmin IP Range scanner

Recommended Posts

Posted

Aveti aici un script care scaneaza in functie de range-ul de ip-uri setat de voi, dar si de porturi. Puteti seta porturile cu virgula intre ele daca vreti sa scaneze acelasi ip in functie de mai multe porturi. Multumesc lui totti93 pentru ajutorul care mi l-a dat la copierea valorilor unei variabile (daca faceam copie variabilei care era in while se pastra decat ultima valoare a acesteia). Ip-urile bune le va afisa si le va si salva in bune.txt . Enjoy!


<html>

<title>Radmin Scanner | Silvian0 @ RSTCENTER </title>
<STYLE type=text/css>
BODY {
SCROLLBAR-FACE-COLOR: #000000; FONT-SIZE: 12px; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #000000; FONT-FAMILY: verdana; SCROLLBAR-DARKSHADOW-COLOR: #000000
}
INPUT {
BORDER-TOP-WIDTH: 1px; FONT-WEIGHT: bold; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 10px; BORDER-LEFT-COLOR: #008000; BACKGROUND: #004000; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #008000; COLOR: #00ff00; BORDER-TOP-COLOR: #008000; FONT-FAMILY: verdana; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #008000
}
TEXTAREA {
BORDER-TOP-WIDTH: 1px; FONT-WEIGHT: bold; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 10px; BORDER-LEFT-COLOR: #008000; BACKGROUND: #004000; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #008000; COLOR: #00ff00; BORDER-TOP-COLOR: #008000; FONT-FAMILY: verdana; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #008000
}
table{
BORDER-BOTTOM: #000000 1px DASHED;
BORDER-TOP: #000000 1px DASHED;
BORDER-LEFT: #000000 1px DASHED;
BORDER-RIGHT: #000000 1px DASHED;
}


A:link {
TEXT-DECORATION: none
}
A:visited {
TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
COLOR: #00ff00; TEXT-DECORATION: none
}
B.h6 {
FONT-WEIGHT: bold
}
B.h7 {
FONT-WEIGHT: bold; FONT-STYLE: italic
}

</STYLE>
<BODY dir=ltr text=#000000 vLink=#000000 aLink=#000000 link=#000000
bgColor=#CCCCCC >


<?
##genereaza range-ul de ipuri
#declarare date
$from = "x.x.x.x"; //ip de start
$to = "x.x.x.x"; //ip de final
$listaporturi="4899"; //poti seta porturile cu , intre ele, de ex: 4899,443,22,21
// generate ip addrs
$arry1 = explode(".",$from);
$arry2 = explode(".",$to);
$a1 = $arry1[0]; $b1 = $arry1[1]; $c1 = $arry1[2]; $d1 = $arry1[3];
$a2 = $arry2[0]; $b2 = $arry2[1]; $c2 = $arry2[2]; $d2 = $arry2[3];
while( $d2 >= $d1 || $c2 > $c1 || $b2 > $b1 || $a2 > $a1){
if($d1 > 255){
$d1 = 1;
$c1 ++;
}
if($c1 > 255){
$c1 = 1;
$b1 ++;
}
if($b1 > 255){
$b1 = 1;
$a1 ++;
}
$p='.';
$plm=',';
$ipuri= "$a1$p$b1$p$c1$p$d1$plm";
$d1 ++;
$ip.= $ipuri;
}
$ips = $ip;
$cate=strlen($ips);
echo "Am de scanat $cate ipuri </br>";
sleep(3);
###termina de generat range-ul
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$time_start = getmicrotime();
echo "<br></br>";
$ipuri="$ips";
$ports="$listaporturi"; //Portul default Radmin
if (isset($ip)){
echo "Scanning.....";
echo "
";
foreach(explode(",","$ports") as $port)
{
foreach(explode(",","$ipuri") as $ip)
{
if ( is_numeric($port) ) {
$fp = @fsockopen($ip,$port,$errno,$errstr,5);
if(!$fp)
{
#echo "</br>Scanare IP: $ip : $port --><font color=\"white\"> Inchis</font> ";
#echo "";

}
else
{
$fp = fopen('bune.txt', 'w');
fwrite($fp, "$ip");
fclose($fp);
echo "</br>Scanare IP: $ip : $port --><font color=\"red\"> Deschis</font>";
echo "";
@fclose($fp);

}
flush();

}
}
}
}

$time_end = getmicrotime();
$time = number_format(($time_end - $time_start),6);
echo "-----------------------------------------------------------------------------";
echo "
";
echo "</br>Procesat in $time secunde";

echo '<center></br></br>Radmin Scanner v1.0 - Silvian0 @ <a href="http://rstcenter.com">RSTCenter.com</a></center>';
?>
</body>
</html>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...