Aide code php

gastonti -  
 gastonti -
Bonjour,

svp qui peut m'aider a trouver un code php qui fait le scan sur un plage d'adresse.
svp j'ai besoin de ce code pour mon pfe.
merci d'avance

1 réponse

  1. Zethar
     
    Bonjour,

    <?php
    echo "<HTML><BODY>";
    
    $exclude_list = array ("10.36.208.2", "10.36.208.3", "10.36.208.4");
    echo '<table border=1 style="font-size: 10pt">';
    echo '<tr><td>ip</td><td>nom</td><td>état</td></tr>';
    for ($RESEAU = 208; $RESEAU <= 210; $RESEAU=$RESEAU+1)
    {
        for ($IP = 2; $IP < 255; $IP = $IP+1)
        {
            if (!in_array("10.36.".$RESEAU.".".$IP, $exclude_list))
            {
                echo "<tr>";
                echo "<td>10.36.$RESEAU.$IP</td>";
                echo "<td>";
                system('nslookup 10.36.'.$RESEAU.'.'.$IP.'|grep name|sed "s/.*name = //g"|sed "s/.tlt.*//g"');
                echo " </td>";
                echo "<td>";
                system('if [ 'nmap -T4 -p22,23 10.36.'.$RESEAU.'.'.$IP.' | grep "Interesting ports on" | wc -l' -eq 1 ]; then echo "<span style="background-color:#00ff00">Ping ok</span>"; else echo "<span style="background-color:#ff0000">Server seems down !!</span>"; fi');
                echo "</td>";
                echo "</tr>";
            }
        }
    }
    echo "</table>";
    
    echo "</BODY></HTML>";
    ?>


    J'ai mis 3seconde et demis a trouver sa sur internet en tapant:code php qui fait le scan sur un plage d'adresse

    As-tu cherche ne serais-ce que une minute?

    Amicalement
    0
    1. gastonti
       
      merci pour votre effort et conseil! mais ça marche sur Linux,et c pas c que j cherche
      0