function displayAccessDomain() { $visitWebSite = ''; $visitWebSiteList = ''; $urlList = ''; $nOK = ''; handlePower('显示访问域名'); $GLOBALS['conn='] = OpenConn(); $nOK = 0; $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'websitestat'); while ($rs = $GLOBALS['conn']->fetch_array($rsObj)) { $visitWebSite = lCase(getWebSite($rs['visiturl'])); //call echo("visitWebSite",visitWebSite) if (inStr(vbCrlf() . $visitWebSiteList . vbCrlf(), vbCrlf() . $visitWebSite . vbCrlf()) == false) { if ($visitWebSite != lCase(getWebSite(webDoMain()))) { $visitWebSiteList = $visitWebSiteList . $visitWebSite . vbCrlf(); $nOK = $nOK + 1; $urlList = $urlList . $nOK . '、<a href=\'' . $rs['visiturl'] . '\' target=\'_blank\'>' . $rs['visiturl'] . '</a><br>'; } } } aspEcho('显示访问域名', '操作完成 <a href=\'javascript:history.go(-1)\'>点击返回</a>'); rwEnd($visitWebSiteList . '<br><hr><br>' . $urlList); }
function handleDifferenceWebSiteList($httpurl, $urllist) { $website = ''; $splstr = ''; $url = ''; $c = ''; $urlWebsite = ''; $websiteList = ''; $website = lCase(getWebSite($httpurl)); $splstr = aspSplit($urllist, vbCrlf()); foreach ($splstr as $key => $url) { $urlWebsite = lCase(getWebSite($url)); if ($urlWebsite != '' && $website != $urlWebsite && inStr(vbCrlf() . $websiteList . vbCrlf(), vbCrlf() . $urlWebsite . vbCrlf()) == false) { $websiteList = $websiteList . $urlWebsite . vbCrlf(); } } $handleDifferenceWebSiteList = $websiteList; return @$handleDifferenceWebSiteList; }
function addToOrAddHttpUrl($httpurl, $url, $action) { $s = ''; $action = '|' . $action . '|'; if (inStr($action, '|替换|') > 0) { $s = getWebSite($url); if ($s != '') { $url = replace($url, $s, ''); } } if (inStr($url, $httpurl) == false) { if (right($httpurl, 1) == '/' && (left($url, 1) == '/' || left($url, 1) == '\\')) { $url = mid($url, 2, -1); } $url = $httpurl . $url; } $addToOrAddHttpUrl = $url; return @$addToOrAddHttpUrl; }
function handleCutDivCode($dirPath, $DivStr) { $content = ''; $startStr = ''; $endStr = ''; $splStr = ''; $ImageFile = ''; $ToImageFile = ''; $fileName = ''; $isHandle = ''; $startStr = 'url\\('; $endStr = '\\)'; $content = GetArray($DivStr, $startStr, $endStr, false, false); $splStr = aspSplit($content, '$Array$'); foreach ($splStr as $key => $ImageFile) { if ($ImageFile != '' && inStr($ImageFile, '.') > 0 && inStr($ImageFile, '{$#') == false) { //判断是否有域名 20150202 if (getWebSite($ImageFile) == '') { $fileName = replace(replace(replace($ImageFile, '"', ''), '\'', ''), '\\', '/'); if (inStr($fileName, '/') > 0) { $fileName = mid($fileName, inStrRev($fileName, '/') + 1, -1); } $DivStr = replace($DivStr, $ImageFile, $dirPath . $ImageFile); } } } //图片处理 //Content = GetIMG(DivStr) & vbCrlf & GetHtmlBackGroundImgList(DivStr) '再加个Html背景图片 $content = getImgJsUrl($DivStr, '不重复') . vbCrlf() . getHtmlBackGroundImgList($DivStr); //再加个Html背景图片 加强版20150126 $splStr = aspSplit($content, vbCrlf()); foreach ($splStr as $key => $ImageFile) { if ($ImageFile != '') { //当链接地址当前为HTTP:时则不处理20150313 $isHandle = false; if (left($ImageFile, 1) == '\\') { //等处理20150817 } else { if (inStr($ImageFile, '.') > 0 && left($ImageFile, 5) != 'HTTP:' && inStr($ImageFile, '{$#') == false) { $isHandle = true; } } if ($isHandle == true) { $ToImageFile = $dirPath . removeFileDir($ImageFile); //移除文件路径目录 //html中图片路径替换 $DivStr = replace($DivStr, '"' . $ImageFile . '"', '"' . $ToImageFile . '"'); $DivStr = replace($DivStr, '\'' . $ImageFile . '\'', '"' . $ToImageFile . '"'); $DivStr = replace($DivStr, '=' . $ImageFile . ' ', '"' . $ToImageFile . '"'); $DivStr = replace($DivStr, '=' . $ImageFile . '>', '"' . $ToImageFile . '"'); } } } $handleCutDivCode = $DivStr; return @$handleCutDivCode; }
function scanUrl($httpUrl, $toTitle, $codeset) { $splStr = ''; $i = ''; $s = ''; $content = ''; $PubAHrefList = ''; $PubATitleList = ''; $splUrl = ''; $spltitle = ''; $title = ''; $url = ''; $htmlDir = ''; $htmlFilePath = ''; $nOK = ''; $dataArray = ''; $webState = ''; $u = ''; $iniDir = ''; $iniFilePath = ''; $websize = ''; $nSetTime = ''; $startTime = ''; $openSpeed = ''; $isLocal = ''; $isThrough = ''; $htmlDir = '/../网站UrlScan/' . setFileName(getWebSite($httpUrl)); CreateDirFolder($htmlDir); $htmlFilePath = $htmlDir . '/' . setFileName($httpUrl) . '.html'; $iniDir = $htmlDir . '/conifg'; CreateFolder($iniDir); $iniFilePath = $iniDir . '/' . setFileName($httpUrl) . '.txt'; //httpurl="http://maiside.net/" $webState = 0; $nSetTime = 1; $openSpeed = 0; if (CheckFile($htmlFilePath) == false) { $startTime = now(); aspEcho('codeset', $codeset); $dataArray = handleXmlGet($httpUrl, $codeset); $content = $dataArray[0]; $content = toGB2312Char($content); //给PHP用,转成gb2312字符 $webState = $dataArray[1]; $openSpeed = dateDiff('s', $startTime, now()); //content=gethttpurl(httpurl,codeset) //call createfile(htmlFilePath,content) WriteToFile($htmlFilePath, $content, $codeset); createFile($iniFilePath, $webState . vbCrlf() . $openSpeed); $nSetTime = 3; $isLocal = 0; } else { //content=getftext(htmlFilePath) $content = reaFile($htmlFilePath, $codeset); $content = toGB2312Char($content); //给PHP用,转成gb2312字符 $splStr = aspSplit(getFText($iniFilePath), vbCrlf()); $webState = CInt($splStr[0]); $openSpeed = CInt($splStr[0]); $isLocal = 1; } $websize = getFSize($htmlFilePath); if ($websize == '') { $websize = 0; } aspEcho('isLocal', $isLocal); $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where httpurl=\'' . $httpUrl . '\''); if (@mysql_num_rows($rsObj) == 0) { $rs = mysql_fetch_array($rsObj); connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(httpurl,title,charset) values(\'' . $httpUrl . '\',\'' . $toTitle . '\',\'' . $codeset . '\')'); } connexecute('update ' . $GLOBALS['db_PREFIX'] . 'weburlscan set webstate=' . $webState . ',websize=' . $websize . ',openspeed=' . $openSpeed . ',charset=\'' . $codeset . '\' where httpurl=\'' . $httpUrl . '\''); //strLen(content) 不用这个,不精准 $s = getContentAHref('', $content, $PubAHrefList, $PubATitleList); $s = handleScanUrlList($httpUrl, $s); //call echo("httpurl",httpurl) //call echo("s",s) //call echo("PubATitleList",PubATitleList) $nOK = 0; $splUrl = aspSplit($PubAHrefList, vbCrlf()); $spltitle = aspSplit($PubATitleList, vbCrlf()); for ($i = 1; $i <= uBound($splUrl); $i++) { $title = $spltitle[$i]; $url = $splUrl[$i]; //去掉#号后台的字符20160506 if (inStr($url, '#') > 0) { $url = mid($url, 1, inStr($url, '#') - 1); } if ($url == '') { if ($title != '') { aspEcho('网址为空', $title); } } else { $url = handleScanUrlList($httpUrl, $url); $url = handleWithWebSiteList($httpUrl, $url); if ($url != '') { $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where httpurl=\'' . $url . '\''); if (@mysql_num_rows($rsObj) == 0) { $rs = mysql_fetch_array($rsObj); $u = lCase($url); if (inStr($u, 'tools/downfile.asp') > 0 || inStr($u, '/url.asp?') > 0 || inStr($u, '/aspweb.asp?') > 0 || inStr($u, '/phpweb.php?') > 0 || $u == 'http://www.maiside.net/qq/' || inStr($u, 'mailto:') > 0 || inStr($u, 'tel:') > 0 || inStr($u, '.html?replytocom') > 0) { //.html?replytocom 王通网站 $isThrough = 0; } else { $isThrough = 1; //不用true 因为写入数据会有问题 } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(tohttpurl,totitle,httpurl,title,isthrough,charset) values(\'' . $httpUrl . '\',\'' . $toTitle . '\',\'' . $url . '\',\'' . left($title, 255) . '\',' . $isThrough . ',\'' . $codeset . '\')'); $nOK = $nOK + 1; aspEcho($i, $url); } else { aspEcho($title, $url); } } } } $scanUrl = $nSetTime; return @$scanUrl; }