function getImgUrlList($content) { $i = ''; $s = ''; $YuanStr = ''; $TempS = ''; $LalType = ''; $nLen = ''; $LalStr = ''; $c = ''; for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); if ($s == '<') { $YuanStr = mid($content, $i, -1); $TempS = lCase($YuanStr); $LalStr = mid($YuanStr, 1, inStr($YuanStr, '>')); $LalType = lCase(mid($TempS, 1, inStr($TempS, ' '))); if ($LalType == '<img ') { $c = $c . getLinkUrl($LalStr, 'src') . vbCrlf(); $i = $i + $nLen; } } doEvents(); } $getImgUrlList = $c; return @$getImgUrlList; }
function jsCodeConfusion($content) { $splStr = ''; $i = ''; $YesJs = ''; $YesWord = ''; $Sx = ''; $s = ''; $Wc = ''; $Zc = ''; $s1 = ''; $AspCode = ''; $SYHCount = ''; $UpWord = ''; $UpWordn = ''; $tempS = ''; $DimList = ''; $YesFunction = ''; //函数是否为真 $StartFunction = ''; //开始函数 目的是为了让function default 处理函数后面没有() 20150218 $StartFunction = false; //默认开始函数为假 //If nType="" Then nType = 0 $yesJs = false; //是ASP 默认为假 $YesFunction = false; //是函数 默认为假 $YesWord = false; //是单词 默认为假 $SYHCount = 0; //双引号默认为0 $splStr = aspSplit($content, vbCrlf()); //分割行 $wcType = ''; //输入文本类型,如 " 或 ' $isAddToSYH = ''; //是否累加双引号 $beforeStr = ''; $afterStr = ''; $endCode = ''; $nSYHCount = ''; //循环分行 foreach ($splStr as $key => $s) { //循环每个字符 for ($i = 1; $i <= len($s); $i++) { $Sx = mid($s, $i, 1); //Asp开始 if ($Sx == '<' && $Wc == '') { //输出文本必需为空 Wc为输出内容 如"<%" 排除 修改于20140412 if (mid($s, $i + 1, 6) == 'script') { $yesJs = true; //ASP为真 $i = $i + 1; //加1而不能加2,要不然<%function Test() 就截取不到 $Sx = mid($s, $i, 1); $AspCode = $AspCode . '<'; } //ASP结束 } else { if ($Sx == '<' && mid($s, $i + 1, 8) == '/script>' && $Wc == '') { //Wc为输出内容 $yesJs = false; //ASP为假 $i = $i + 1; //不能加2,只能加1,因为这里定义ASP为假,它会在下一次显示上面的 'ASP运行为假 $Sx = mid($s, $i, 8); $AspCode = $AspCode . '/script>'; } } if ($yesJs == true) { $beforeStr = right(replace(mid($s, 1, $i - 1), ' ', ''), 1); //上一个字符 $afterStr = left(replace(mid($s, $i + 1, -1), ' ', ''), 1); //下一个字符 $endCode = mid($s, $i + 1, -1); //当前字符往后面代码 一行 //输入文本 if ($sx == '"' || $sx == '\'' && $wcType == '' || $sx == $wcType || $wc != '') { $isAddToSYH = true; //这是一种简单的方法,等完善(20150914) if ($isAddToSYH == true && $beforeStr == '\\') { if (len($wc) >= 1) { if (isStrTransferred($wc) == true) { //为转义字符为真 //call echo(wc,isStrTransferred(wc)) $isAddToSYH = false; } } else { $isAddToSYH = false; } //call echo(wc,isAddToSYH) } if ($wc == '') { $wcType = $sx; } //双引号累加 if ($sx == $wcType && $isAddToSYH == true) { $nSYHCount = $nSYHCount + 1; } //排除上一个字符为\这个转义字符(20150914) //判断是否"在最后 if ($nSYHCount % 2 == 0 && $beforeStr != '\\') { if (mid($s, $i + 1, 1) != $wcType) { $wc = $wc . $sx; $AspCode = $AspCode . $wc; //行代码累加 //call echo("wc",wc) $nSYHCount = 0; $wc = ''; //清除 $wcType = ''; } else { $wc = $wc . $sx; } } else { $wc = $wc . $sx; } } else { if ($Sx == '\'') { //注释则退出 $AspCode = $AspCode . mid($s, $i, -1); break; //字母 } else { if (checkABC($Sx) == true || $Sx == '_' && $Zc != '' || $Zc != '') { $Zc = $Zc . $Sx; $s1 = lCase(mid($s . ' ', $i + 1, 1)); if (inStr('abcdefghijklmnopqrstuvwxyz0123456789', $s1) == 0 && ($s1 == '_' && $Zc != '')) { //最简单判断 $tempS = mid($s, $i + 1, -1); if (inStr('|function|sub|', '|' . lCase($Zc) . '|')) { //函数开始 if ($YesFunction == false && lCase($UpWord) != 'end') { $YesFunction = true; $DimList = getFunDimName($tempS); $StartFunction = true; } else { if ($YesFunction == true && lCase($UpWord) == 'end') { //获得上一个单词 $YesFunction = false; } } } else { if ($YesFunction == true && lCase($Zc) == 'var') { $DimList = $DimList . ',' . getVarName($tempS); } else { if ($YesFunction == true) { //排除函数后面每一个名称 if ($StartFunction == false) { $Zc = replaceDim2($DimList, $Zc); } $StartFunction = false; } } } $UpWord = $Zc; //记住当前单词 $AspCode = $AspCode . $Zc; $Zc = ''; } } else { $AspCode = $AspCode . $Sx; } } } } else { $AspCode = $AspCode . $Sx; } doEvents(); } $AspCode = aspRTrim($AspCode); //去除右边空格 $AspCode = $AspCode . vbCrlf(); //Asp换行 doEvents(); } $jsCodeConfusion = $AspCode; return @$jsCodeConfusion; }
function handleContentRepeatFunction($content, $sType) { $c = ''; $Funs = ''; $FunList = ''; $nOK = ''; $nErr = ''; $splxx = ''; $ErrFunList = ''; $sType = cStr($sType); $content = getScanFunctionNameList($content); //获得ASP函数名称列表 $nOK = 0; $nErr = 0; $splxx = aspSplit($content, vbCrlf()); foreach ($splxx as $key => $Funs) { if ($Funs != '') { if (inStr('|' . $FunList . '|', '|' . $Funs . '|') == 0) { $FunList = $FunList . $Funs . '|'; $nOK = $nOK + 1; } else { $ErrFunList = $ErrFunList . $Funs . vbCrlf(); $nErr = $nErr + 1; } } doEvents(); } $c = '找到函数共(' . uBound($splxx) + 1 . '),重复(' . $nErr . ')' . vbCrlf(); //函数列表 if ($sType == '1' || $sType == '3') { $c = $c . vbCrlf() . '函数列表' . vbCrlf() . $FunList; } //重复函数列表 if ($ErrFunList != '' && ($sType == '1' || $sType == '3')) { $c = $c . vbCrlf() . '重复函数列表' . vbCrlf() . $ErrFunList; } $handleContentRepeatFunction = $c; return @$handleContentRepeatFunction; }
function updateWebsiteStat() { $content = ''; $splStr = ''; $splxx = ''; $filePath = ''; $fileName = ''; $url = ''; $s = ''; $nCount = ''; handlePower('更新网站统计'); //管理权限处理 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'websitestat'); //删除全部统计记录 $content = getDirTxtList($GLOBALS['adminDir'] . '/data/stat/'); $splStr = aspSplit($content, vbCrlf()); $nCount = 1; foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && left($fileName, 1) != '#') { $nCount = $nCount + 1; aspEcho($nCount . '、filePath', $filePath); doEvents(); $content = getFText($filePath); $content = replace($content, chr(0), ''); whiteWebStat($content); } } $url = getUrlAddToParam(getThisUrl(), '?act=dispalyManageHandle', 'replace'); Rw(getMsg1('更新全部统计成功,正在进入' . @$_REQUEST['lableTitle'] . '列表...', $url)); writeSystemLog('', '更新网站统计'); //系统日志 }
function makeHtmlWebToXmlZip($newWebDir, $rootDir) { $xmlFileName = ''; $xmlSize = ''; $xmlFileName = setFileName(GetIP()) . '_update.xml'; //获得ip有可能为空:: 创建时会有问题 //newWebDir="\Templates2015\" //rootDir="\sharembweb\" $objXmlZIP = ''; $objXmlZIP = new xmlZIP(); $objXmlZIPcallRun(HandlePath($newWebDir), HandlePath($newWebDir . $rootDir), false, $xmlFileName); aspEcho(HandlePath($newWebDir), HandlePath($newWebDir . $rootDir)); $objXmlZIP = $GLOBALS['Nothing']; doEvents(); $xmlSize = getFSize($xmlFileName); $xmlSize = printSpaceValue($xmlSize); aspEcho('下载xml打包文件', '<a href=/tools/downfile.asp?act=download&downfile=' . xorEnc('/' . $xmlFileName, 31380) . ' title=\'点击下载\'>点击下载' . $xmlFileName . '(' . $xmlSize . ')</a>'); }
function testTwoDimensionalArray() { $splStr = ''; $i = ''; $splStr = handleSplitArray('9-g|2-b|3-a|1-中', '|', '-'); for ($i = 0; $i <= uBound($splStr); $i++) { aspEcho($splStr[$i][1], $splStr[$i][0]); doEvents(); } aspEcho('', 'Adc'); twoDimensionalArrayAsc($splStr); //二维数组正排序 for ($i = 0; $i <= uBound($splStr); $i++) { aspEcho($splStr[$i][1], $splStr[$i][0]); doEvents(); } aspEcho('', 'Desc'); twoDimensionalArrayDesc($splStr); //二维数组倒排序 for ($i = 0; $i <= uBound($splStr); $i++) { aspEcho($splStr[$i][1], $splStr[$i][0]); doEvents(); } }
function batchImportDirTXTData($webdataDir, $tableNameList) { $folderPath = ''; $tableName = ''; $splStr = ''; $content = ''; $splxx = ''; $filePath = ''; $fileName = ''; $handleTableNameList = ''; $splStr = aspSplit($tableNameList, vbCrlf()); foreach ($splStr as $key => $tableName) { if ($tableName != '') { if ($GLOBALS['db_PREFIX'] != '') { $tableName = mid($tableName, len($GLOBALS['db_PREFIX']) + 1, -1); } $tableName = aspTrim(lCase($tableName)); //判断表 不重复操作 if (inStr('|' . $handleTableNameList . '|', '|' . $tableName . '|') == false) { $handleTableNameList = $handleTableNameList . $tableName . '|'; $folderPath = HandlePath($webdataDir . '/' . $tableName); if (checkFolder($folderPath) == true) { connexecute('delete from ' . $GLOBALS['db_PREFIX'] . $tableName); //删除当前表全部数据 aspEcho('tableName', $tableName); $content = getDirAllFileList($folderPath, 'txt'); $splxx = aspSplit($content, vbCrlf()); foreach ($splxx as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho($tableName, $filePath); importTXTData(GetFText($filePath), $tableName, '添加'); doEvents(); } } } } } } }
function runScanWebUrl() { $nSetTime = ''; $setCharSet = ''; $httpUrl = ''; $url = ''; $selectWeb = ''; $nThis = ''; $nCount = ''; $startTime = ''; $setCharSet = 'gb2312'; //gb2312 //http://www.dfz9.com/ //http://www.maiside.net/ //http://sharembweb.com/ //http://www.ufoer.com/ $httpUrl = 'http://sharembweb.com/'; //selectWeb="ufoer" if ($selectWeb == 'ufoer') { $httpUrl = 'http://www.ufoer.com/'; $setCharSet = 'utf-8'; } $nThis = @$_REQUEST['nThis']; if ($nThis == '') { $nThis = 0; } else { $nThis = cint($nThis); } $GLOBALS['conn='] = OpenConn(); $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan'); $nCount = @$_REQUEST['nCount']; if ($nCount == '') { $nCount = @mysql_num_rows($rsObj); } if (@mysql_num_rows($rsObj) == 0) { connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(httpurl,title,isthrough,charset) values(\'' . $httpUrl . '\',\'home\',true,\'' . $setCharSet . '\')'); } //循环 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where isThrough=true'); if (@mysql_num_rows($rsxObj) != 0) { $rsx = mysql_fetch_array($rsxObj); $nThis = $nThis + 1; aspEcho($nThis, $rsx['httpurl']); doEvents(); $nSetTime = scanUrl($rsx['httpurl'], $rsx['title'], $rsx['charset']); //这样写是给转PHP时方便 connexecute('update ' . $GLOBALS['db_PREFIX'] . 'weburlscan set isthrough=false where id=' . $rsx['id'] . ''); $startTime = @$_REQUEST['startTime']; if ($startTime == '') { $startTime = now(); } VBRunTimer($startTime); $url = getUrlAddToParam(getThisUrl(), '?nThis=' . $nThis . '&nCount=' . $nCount . '&startTime=' . $startTime . '&N=' . getRnd(11), 'replace'); Rw(jsTiming($url, $nSetTime)); die; } aspEcho('操作完成', '<a href=\'?act=dispalyManageHandle&actionType=WebUrlScan&addsql=order by id desc&lableTitle=网址扫描\'>OK,共(' . $nThis . ')条</a>'); //输入报告 $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where webstate=404'); while ($rs = $GLOBALS['conn']->fetch_array($rsObj)) { aspEcho('<a href=\'' . $rs['httpurl'] . '\' target=\'_blank\'>' . $rs['httpurl'] . '</a>', '<a href=\'' . $rs['tohttpurl'] . '\' target=\'_blank\'>' . $rs['tohttpurl'] . '</a>'); } }