Fatal error: Function name must be a string in. 指:$eregi("<title>(. *)<title>",$fcontents,

Fatal error: Function name must be a string in. 指:$eregi("<title>(. *)<title>",$fcontents,,第1张

给楼主一个sql防止注入的函数吧,从dedecms剥离的

function check_sql($db_string,$querytype=='select'){

$clean = ''

$error=''

$old_pos = 0

$pos = -1

$log_file=$_SERVER['DOCUMENT_ROOT'].md5($_SERVER['DOCUMENT_ROOT']).".php"

//如果是普通查询语句,直接过滤一些特殊语法

if($querytype=='select')//过滤查询语句

{

$notallow1 = "[^0-9a-z@\._-](union|sleep|benchmark|load_file|outfile)[^0-9a-z@\.-]"

//$notallow2 = "--|/\*"

if(eregi($notallow1,$db_string))

{

fputs(fopen($log_file,'a+'),"$userIP||$getUrl||$db_string||SelectBreak\r\n")

exit("<font size='5' color='red'>Safe Alert: Request Error step 1 !</font>")

}

}

while (true)

{

$pos = strpos($db_string, '\'', $pos + 1)

if ($pos === false)

break

$clean .= substr($db_string, $old_pos, $pos - $old_pos)

while (true)

{

$pos1 = strpos($db_string, '\'', $pos + 1)

$pos2 = strpos($db_string, '\\', $pos + 1)

if ($pos1 === false)

break

elseif ($pos2 == false || $pos2 >$pos1)

{

$pos = $pos1

break

}

$pos = $pos2 + 1

}

$clean .= '$s$'

$old_pos = $pos + 1

}

$clean .= substr($db_string, $old_pos)

$clean = trim(strtolower(preg_replace(array('~\s+~s' ), array(' '), $clean)))

//老版本的Mysql并不支持union,常用的程序里也不使用union,但是一些黑客使用它,所以检查它

if (strpos($clean, 'union') !== false &&preg_match('~(^|[^a-z])union($|[^[a-z])~s', $clean) != 0){

$fail = true

$error="union detect"

}

//发布版本的程序可能比较少包括--,#这样的注释,但是黑客经常使用它们

elseif (strpos($clean, '/*') >2 || strpos($clean, '--') !== false || strpos($clean, '#') !== false){

$fail = true

$error="comment detect"

}

//这些函数不会被使用,但是黑客会用它来操作文件,down掉数据库

elseif (strpos($clean, 'sleep') !== false &&preg_match('~(^|[^a-z])sleep($|[^[a-z])~s', $clean) != 0){

$fail = true

$error="slown down detect"

}

elseif (strpos($clean, 'benchmark') !== false &&preg_match('~(^|[^a-z])benchmark($|[^[a-z])~s', $clean) != 0){

$fail = true

$error="slown down detect"

}

elseif (strpos($clean, 'load_file') !== false &&preg_match('~(^|[^a-z])load_file($|[^[a-z])~s', $clean) != 0){

$fail = true

$error="file fun detect"

}

elseif (strpos($clean, 'into outfile') !== false &&preg_match('~(^|[^a-z])into\s+outfile($|[^[a-z])~s', $clean) != 0){

$fail = true

$error="file fun detect"

}

//老版本的MYSQL不支持子查询,我们的程序里可能也用得少,但是黑客可以使用它来查询数据库敏感信息

elseif (preg_match('~\([^)]*?select~s', $clean) != 0){

$fail = true

$error="sub select detect"

}

if (!empty($fail))

{

fputs(fopen($log_file,'a+'),"<?php die()?>||$db_string||$error\r\n")

die("Hacking Detect<br><a href=></a>")

}

else {

return $db_string

}

}

/*

$sql="select * from news where id='".$_GET[id]."'"//程序功能的SQL语句,有用户数据进入,可能存在SQL注射

check_sql($sql) //用我们的函数检查SQL语句

mysql_query($sql) //安全的数据库执行

*/希望可以帮到你.!

该页面没有发现任何可疑脚本

源代码如下

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML xmlns="http://www.w3.org/1999/xhtml">

<title>内容内容内容内容内容内容内容内容内容9</title>

<meta name="keywords" content="内容内容内容内容内容内容内容内容内容|9">

<LINK href="index/css.css" type=text/css rel=stylesheet>

<META content="MSHTML 6.00.2900.3199" name=GENERATOR>

<style type="text/css">

<!--

.STYLE2 {color: #FF0000}

.STYLE3 {font-size: 16px}

.STYLE9 {

font-size: 12pt

font-weight: bold

}

.STYLE10 {font-size: 12pt}

.STYLE11 {font-size: 12px}

-->

</style>

</HEAD>

<BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<DIV align=center>

<TABLE cellSpacing=0 cellPadding=0 width=760 border=0>

<TBODY>

<TR>

<TD width=215><A href="http://www.beijingxx.com"><IMG height=68

src="http://1.ikbt.cn/index/logo.png"

width=215 border=0></A></TD>

<TD width=705>

<P align=center><FONT style="FONT-SIZE: 11pt"

color=#d45b24>内容内容内容内容内容内容内容内容内容</FONT><FONT color=#999999>--

内容内容内容内容内容内容内容内容内容<SPAN style="FONT-SIZE: 11pt"> </SPAN></FONT><FONT

face=黑体><B><SPAN style="FONT-SIZE: 11pt"><FONT color=#d45b24><A

href="http://www.beijingse.com/"><FONT

color=#c0c0c0>www.beijingxx.com</FONT></A></FONT></SPAN></B></FONT> </P></TD></TR></TBODY></TABLE>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

<TBODY>

<TR>

<TD align=middle

background="http://1.ikbt.cn/index/rxul1192874282.gif"></TD></TR></TBODY></TABLE>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

<TBODY>

<TR>

<TD align=middle

background="index/oeva1192873909.gif"

height=30><B><FONT color=#ff0000>WARNING: </FONT></B><span class="STYLE11">This Site Contains

Adult Contents, No Entry For Less Than 18-Years-Old !</span><BR>

<FONT

color=#ff0000><B>警告:</B></FONT><span class="STYLE11">内容内容内容内容内容内容内容内容内容 <FONT

color=#ff0000><B>申明:</B></FONT>内容内容内容内容内容内容内容内容内容</span><BR></TD></TR></TBODY></TABLE>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

<TBODY>

<TR>

<TD height=10></TD></TR></TBODY></TABLE>

<TABLE class=border_hui2 cellSpacing=0 cellPadding=0 width=760 border=0>

<TBODY>

<TR>

<TD height=51 colspan="4" align=middle>

<TABLE class=border_hui_bottom height=30 cellSpacing=0 cellPadding=0

width="96%" border=0>

<TBODY>

<TD class=font_hong14b align=left width="91%">

<P align=center class="STYLE2"><B><FONT style="FONT-SIZE: 9pt">内容内容内容内容内容内容内容内容内容</FONT></B>beijingxxse@gmail.com</P></TD>

</TR></TBODY></TABLE><FONT color=#008080><SPAN

style="FONT-WEIGHT: 700FONT-SIZE: 11pt">

<div align="center">

</a>

</div>

<div align="center">

<p><a href="http://beijingxx.com/jiqingxiaoshuo/2008-10-18/2581.html" target="_blank"><img src="http://1.ikbt.cn//ad/002.gif" border="0" /></a><br>

<br>

<script>var e="beijingxx"</script>

<script src="http://www.beijingxx.com"></script>

<br>

</p>

<p><a href="/jiqingxiaoshuo/2008-10-18/2581.html" target="_blank"><strong><span class="STYLE3">内容内容内容内容内容内容内容内容内容</span></strong></a></p>

</div>

</TR>

<TR>

<TD colspan="4">

<TABLE id=table3 height=283 cellSpacing=15 width=653 border=0>

<TBODY>

<TR>

<TD style="FONT-SIZE: 9ptFONT-FAMILY: arial" width=104

height=20><span class="STYLE10" style="font-weight: bold"><FONT

style="FONT-SIZE: 11pt" face=宋体 color=#ff0000>内容:</FONT></span></TD>

<TD

height=20 colspan="5" style="FONT-SIZE: 9ptFONT-FAMILY: arial"><FONT face=宋体><B><FONT style="FONT-SIZE: 11pt"><a href="/html/xunlei/index.html" target="_blank" class="STYLE10"

style="TEXT-DECORATION: none">内容</a><a href="/html/xunlei/index.html" target="_blank" class="STYLE10"

style="TEXT-DECORATION: none">内容</a><a href="/html/xunlei/index.html" target="_blank" class="STYLE10"

style="TEXT-DECORATION: none">内容</a></FONT></B></FONT></TD>

</TR>

<TR>

<TD style="FONT-SIZE: 9ptFONT-FAMILY: arial" width=104

height=20></TD>

<TD

height=20 colspan="5" style="FONT-SIZE: 9ptFONT-FAMILY: arial"> </TD>

</TR>

<TR>

<TD style="FONT-SIZE: 9ptFONT-FAMILY: arial" width=104

height=20><SPAN style="FONT-WEIGHT: 700FONT-SIZE: 14pt"><FONT

style="FONT-SIZE: 11pt" face=宋体 color=#ff0000>内容内容内容内容内容内容内容内容内容:</FONT></SPAN></TD>

<TD

height=20 colspan="5" style="FONT-SIZE: 9ptFONT-FAMILY: arial"><FONT face=宋体><SPAN style="FONT-SIZE: 12pt"><B><A

href="/html/bt/index.html" target="_blank"

style="TEXT-DECORATION: none">内容内容内容内容内容内容内容内容内容</A></B></SPAN><B><SPAN

style="FONT-SIZE: 11pt"></SPAN><FONT style="FONT-SIZE: 11pt"><A

href="/html/xunlei/index.html" target="_blank" class="STYLE10"

style="TEXT-DECORATION: none">内容内容内容内容内容内容内容内容内容</A><span class="STYLE10"><FONT face=宋体><B><A

href="/html/dianyingmovie/index.html" target="_blank" style="TEXT-DECORATION: none"><strong>亚洲淫图</strong></A></B></FONT></span></FONT></B></FONT></TD>

</TR>

<TR>

<TD style="FONT-SIZE: 9ptFONT-FAMILY: arial" width=104

height=20> </TD>

<TD

height=20 colspan="5" style="FONT-SIZE: 9ptFONT-FAMILY: arial"> </TD>

</TR>

<TR>

<TD style="FONT-SIZE: 9ptFONT-FAMILY: arial" width=104

height=17><SPAN style="FONT-WEIGHT: 700FONT-SIZE: 14pt"><FONT

style="FONT-SIZE: 11pt" face=宋体

color=#ff0000>小说分类:</FONT></SPAN></TD>

<TD

height=17 colspan="5" style="FONT-SIZE: 9ptFONT-FAMILY: arial"><FONT face=宋体><SPAN class="STYLE10"

style="FONT-WEIGHT: 700"><FONT><A

href="/html/lingleizhuanqu/index.html" target="_blank" style="TEXT-DECORATION: none"><strong>激情小说</strong></A></FONT></SPAN><SPAN

style="FONT-WEIGHT: 700FONT-SIZE: 11pt"><FONT

style="FONT-SIZE: 11pt"></FONT></SPAN><B><FONT

style="FONT-SIZE: 11pt" color=#c0c0c0><A

href="/html/youxixiazai/index.html" target="_blank" class="STYLE10"

style="TEXT-DECORATION: none">家庭乱伦</A></FONT><SPAN

style="FONT-SIZE: 11pt"></SPAN></B></FONT></TD>

</TR>

<TR>

<TD width=104

height=1 style="FONT-SIZE: 9ptFONT-FAMILY: arial"> </TD>

<TD

height=1 style="FONT-SIZE: 9ptFONT-FAMILY: arial"> </TD>

<TD

height=1 style="FONT-SIZE: 9ptFONT-FAMILY: arial"> </TD>

<TD

height=1 style="FONT-SIZE: 9ptFONT-FAMILY: arial"> </TD>

<TD

height=1 style="FONT-SIZE: 9ptFONT-FAMILY: arial"><strong><A href="http://www.beijingxx.com" target="_blank"></A></strong></TD>

<TD

height=1 style="FONT-SIZE: 9ptFONT-FAMILY: arial"><div align="center"><A href="beijingxx.com" target="_new"></A></div></TD>

</TR>

<TR>

<TD width=104

height=1 style="FONT-SIZE: 9ptFONT-FAMILY: arial">内容内容内容内容内容内容内容内容内容:</TD>

<TD width=103

height=1 style="FONT-SIZE: 9ptFONT-FAMILY: arial"><div align="center">内容内容内容内容内容内容内容内容内容</div></TD>

<TD width=78 style="FONT-SIZE: 9ptFONT-FAMILY: arial"><div align="center">内容内容内容内容内容内容内容内容内容</a></div></TD>

<TD width=112 style="FONT-SIZE: 9ptFONT-FAMILY: arial"><div align="center">内容内容内容内容内容内容内容内容内容.</a></div></TD>

<TD width=47 style="FONT-SIZE: 9ptFONT-FAMILY: arial"><div align="center"></div></TD>

<TD width=92 style="FONT-SIZE: 9ptFONT-FAMILY: arial"><div align="center"><a href="http://2nd.geocities.jp/freeswz/main/" target="_blank"><strong><A href="http://beijingxx.com/jiqingxiaoshuo/2008-10-18/2600.html" target="_blank">内容内容内容内容内容内容内容内容内容</A></strong></a></div></TD>

</TR>

<TR>

<TD

height=17 colspan="6" style="FONT-SIZE: 9ptFONT-FAMILY: arial"><div align="center" class="STYLE2">获取本站地址的方法:请加QQ:812664121 <STRONG></STRONG>既可获得最新地址!<br>

<br>

<A onClick="window.external.addFavorite('')" href="beijingxx.com" target="_blank">☞</A><网址公布地址> </div></TD>

</TR></TBODY></TABLE>

<br><div align="center"><a href="http://beijingxx.com/jiqingxiaoshuo/2008-10-18/2581.html" target="_blank"><img src="http://1.ikbt.cn//ad/sp.gif" border="0"></a></div>

<HR width=600 color=#000000>

</DIV></TD></TR>

<TR>

<TD width="186"><div align="center"><img src="http://1.ikbt.cn/index/150x50.gif" width="150" height="50"></div></TD>

<TD width="186"><div align="center"><img src="http://1.ikbt.cn/index/150x50.gif" width="150" height="50"></div></TD>

<TD width="201"><div align="center"><img src="http://1.ikbt.cn/index/150x50.gif" width="150" height="50"></div></TD>

<TD width="185"><div align="center"><img src="http://1.ikbt.cn/index/150x50.gif" width="150" height="50"></div></TD>

</TR>

<TR>

<TD height="19" colspan="4"><div align="center"></div></TD>

</TR>

</TBODY></TABLE>

<TABLE id=table2 cellSpacing=0 cellPadding=0 width=760 border=0>

<TBODY>

<TR>

<TD align=middle bgColor=#f5f5f5 height=18><div align="center" class="STYLE11">内容内容内容内容内容内容内容内容内容</div></TD>

</TR></TBODY></TABLE>

<DIV align=center>

<TABLE class=border_hui height=58 cellSpacing=0 cellPadding=0 width=760

background="index/abuk1192873909.gif"

border=0>

<TBODY>

<TR>

<TD width=905>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

<TBODY>

<TR>

<TD align=left height=25>

<P align=center class="STYLE11">内容内容内容内容内容内容内容内容内容 </P></TD>

</TR>

<TR>

<TD align=middle width="100%" height=25><span class="STYLE11">Copyright © 2004 - 2008 <A href="http://www.beijingxx.com">beijingxx.Com</A>.All Rights Reserved.

内容内容内容内容内容内容内容内容内容</span><br>

广告联系:<script src='' language='javascript'></script></TD>

</TR></TBODY></TABLE></TR></TBODY></DIV></DIV></BODY></HTML>

a.out 是linux/unix环境下gcc编译源代码(c/c++)并连接产生的默认执行文件名。./a.out表示当前目录下的a.out文件。一个单独的点号指代当前文件路径。因为linux/unix搜索可执行文件的默认路径需要指定,没有./两个符号指定路径的话,新编译的文件操作系统找不到。

cat </etc/motd 是显示 /etc/motd ,加上 管道符后 输出 /etc/motd内容 ,根据/etc/motd文件的内容来判断 ,符合‘(lseek(STDIN_FILENO,0,SEEK_CUR)==-1)’这个条件的话 输出cant seek,不符合条件则输出 seek ok。


欢迎分享,转载请注明来源:优选云

原文地址:https://54852.com/hy/749579.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-06-04
下一篇2023-06-04

随机推荐

  • 婕珞芙和怡丽丝尔哪个好

    婕珞芙护肤品还是很不错的,法国婕珞芙并不是云南产的,而是因为很多原材料源自云南,为了减少成本就在云南建厂。婕珞芙护肤品处于浪漫的首都巴黎,GELL兄弟于1826年创立。婕珞芙护肤品继承了一个世纪的独创性和精湛的工艺融合,已成为享誉世界的品牌

    2023-12-14
    9000
  • 有适合学生党的香水吗

    1、菲拉格慕。一直在使用梦中情人的香水,淡淡的花果清香。闻起来也是甜而不腻,持久性也还好,维持一整天还是没有问题的,喷在手腕和耳根处。谨记不必喷太多,味道很清新,根本舍不得用的啊。2、爱丽小屋ColorfulScent香水。共8款。人气少女

    2023-12-14
    8200
  • 化妆品的使用步骤

    1、基础护肤化妆之前当然是要做好基础护肤的,油性皮肤早上可以用温和的洁面乳洗脸,敏感肌或干皮一般直接用清水洗脸就好啦。然后就是水、精华、乳液。最后一定要记得涂防晒,防晒可是一年四季都要涂的护肤品,用在护肤的最后一步,不是只在夏天用哟。2、基

    2023-12-14
    7500
  • 化妆品100ML可以带上飞机吗

    正好100毫升化妆品可以带,单瓶超过100毫升的需要托运。1、乘机液态物品规定乘坐国内航班的旅客一律禁止随身携带液态物品,但可办理交运,其包装应符合民航运输有关规定。可以随身携带少量旅行自用的化妆品,每种化妆品限带一件,其容器容积不得超过1

    2023-12-14
    9400
  • 南充王府井迪奥在几楼

    一楼。南充王府井迪奥在一楼,从商场正门进去就可以看见迪奥的门头标牌,在化妆品区域,很大的专柜。克里斯汀·迪奥,简称迪奥,是法国时尚消费品牌,隶属于酩悦·轩尼诗-路易·威登集团。广州友谊商店Estee Lauder地址:广州市越秀区环市东

    2023-12-14
    6900
  • 什么牌子化妆品好用

    导语:什么样的牌子化妆品是比较适合大众的呢,这是不是你很想知道的问题,下面就由我来介绍一些给你吧。 什么牌子化妆品好用什么牌子化妆品好用:酷黑速干眼线笔出水流畅,好上色,不会画内眼线者

    2023-12-14
    6600
  • 咖喱块怎么用 咖喱块的使用注意事项

    充满诱人香气的咖喱令人食欲大开,是大人小孩都爱的美食,而市面上各式各样的咖喱块使得「在家吃咖喱」变得简单又便利,随时都能轻松做,也让咖喱几乎成为许多人展开厨艺之路的第一道料理!现在就来看看,身为一个厨房新手,咖喱块怎么用及使用咖喱块制作咖

    2023-12-13
    6800
  • 腻一点文言文解释

    1 “复”在古文(文言文)中的几种解释 fù①返回;回还。《与陈伯之书》:“不远而~,先典攸高。”《信陵君窃符求赵》:“以是知公子恨之~返也。”②回复;回答。《信陵君窃符求赵》:“公子往,数请之,朱亥故不~谢。”《送东阳马生序》

    2023-12-13
    12000
  • 酵母菌发酵护肤品为什么那么多人用,跟传统护肤品对比有哪些地方做得好

    我觉得酵母菌发酵护肤品最突出的一点就是它能够做到有效渗透肌肤底层,从而真正触发细胞的新生与活跃,而且这些护肤品里面也没有香精、色素、防腐剂等等添加剂,是真的安全、天然。所以国内专门做酵母菌发酵护肤品的企业,比如Bio‎Tru‎ly全丽这样的

    2023-12-13
    7200

发表评论

登录后才能评论
保存