‘壹’ 用什么工具检测php网站是否存在注入漏洞
PHP的安全性现在是越来越好了PHP6。0版本都把存在的SQL漏洞都解决了
但是为了安全起见还是应该做安全检测
检测方法:SQL 注入法 、脚本代码、参数传递等方法 具体情况参看PHP官方网站 安全篇章
‘贰’ 服务器装什么软件 phpcms注入漏洞
本文利用了PHPCMS V9的两个漏洞,一个是读取任意文件漏洞,另一个是模版运行php脚本漏洞。使用到的工具:Navicat for Mysql/IE浏览器(建议使用代理)/湛蓝v9代码包(包含文中使用到的所有文件、代码和木马)
1、放置data.txt以备在目标站点读取并在目标站点生成PHP木马脚本使用。
例如将data.txt放置在yun..com/j0192/data.txt
2、通过v9漏洞获取配置信息(请参阅:phpcms V9最新读取站点任意文件漏洞http://skyhome.cn/phpcms/176.html)。
/index.php?m=search&c=index&a=public_get_suggest_keyword&url=asdf&q=../../phpsso_server/caches/configs/database.php
3、通过v9系统漏洞获取到的数据库信息远程登陆目标站点数据库,在v9_admin和v9_sso_admin表中添加账号
username字段:admn
password字段:
encrypt 字段:bGV22e
issuper 字段: 1
4、通过数据库添加管理员账号后使用以下用户名密码在后台登陆,然后修改当前用户密码。
用户名:admn
密码:123456
5、ctrl+a复制write.php全部内容粘贴进v9默认模版下的footer.html保存,然后点击footer.html的可视化运行该模版中的脚本,到此时就完成在目标站点生成木马脚本。
6、打开ifeng.com/caches/caches_template/default/wap/data.class.php
用户名:admin
密码:admin
7、隐藏新增加的管理员。
通过木马脚本上传替换/phpcms/moles/admin/admin_manage.php(默认匹配%admn%),然后登陆目标站点后台查看管理员列表是否还有用户名为admn的超级管理员,如果没有则表明我们完成了新加管理员的隐藏。
8、隐藏新增加的关联链接
通过木马脚本上传替换/phpcms/moles/admin/keylink.php((默认匹配%skyhome%))
9、将目标网站的漏洞修复,以防其他黑客入侵。
通过木马脚本上传替换/phpcms/moles/search/index.php
防黑参考:
1、关闭数据库远程访问。
2、静态文件及附件等文件目录禁止执行权限。
3、脚本文件目录禁止写权限。
4、系统后台等重要目录限制IP访问。
5、及时关注开源系统官方补丁升级和乌云、sebug等漏洞发布平台,修复系统漏洞。
‘叁’ PHP MYSQL网站注入扫描工具如何使用
先明白注入类型! 一般是比如网站.PHP?id=5 and 1=1 正常 1=2错误 就表明有漏洞 然后在把 网站.PHP?id=5 复制到工具里,使查字段,然后找到注入字段 插入相应的PHP注入代码就可以了如 database(),user() load_file 这些,网上一大把
‘肆’ 入侵注入点扫描
试试这两种方法:
第一种:
squery=lcase(Request.ServerVariables("QUERY_STRING"))
sURL=lcase(Request.ServerVariables("HTTP_HOST"))
SQL_injdata =":|;|>|<|--|sp_|xp_|\|dir|cmd|^|(|)|+|$|'||format|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
For SQL_Data=0 To Ubound(SQL_inj)
if instr(squery&sURL,Sql_Inj(Sql_DATA))>0 Then
Response.Write "SQL通用防注入系统"
Response.end
end if
next
第二种:
SQL_injdata =":|;|>|<|--|sp_|xp_|\|dir|cmd|^|(|)|+|$|'||format|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.QueryString<>"" Then
For Each SQL_Get In Request.QueryString
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))>0 Then
Response.Write "SQL通用防注入系统"
Response.end
end if
next
Next
End If
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))>0 Then
Response.Write "SQL通用防注入系统"
Response.end
end if
next
next
end if
第三种
<%
'--------定义部份------------------
Dim Str_Post,Str_Get,Str_In,Str_Inf,Str_Xh,Str_db,Str_dbstr
'自定义需要过滤的字串,用 "■"分离
Str_In = "'■;■and■exec■insert■select■delete■update■count■*■%■chr■mid■master■truncate■char■declare"
'----------------------------------
%>
<%
Str_Inf = split(Str_In,"■")
'--------POST部份------------------
If Request.Form<>"" Then
For Each Str_Post In Request.Form
For Str_Xh=0 To Ubound(Str_Inf)
If Instr(LCase(Request.Form(Str_Post)),Str_Inf(Str_Xh))<>0 Then
'--------写入数据库----------头-----
Str_dbstr="DBQ="+server.mappath("SqlIn.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Set Str_db=Server.CreateObject("ADODB.CONNECTION")
Str_db.open Str_dbstr
Str_db.Execute("insert into SqlIn(Sqlin_IP,SqlIn_Web,SqlIn_FS,SqlIn_CS,SqlIn_SJ) values('"&Request.ServerVariables("REMOTE_ADDR")&"','"&Request.ServerVariables("URL")&"','POST','"&Str_Post&"','"&replace(Request.Form(Str_Post),"'","''")&"')")
Str_db.close
Set Str_db = Nothing
'--------写入数据库----------尾-----
Response.Write "<Script Language=JavaScript>alert('请不要在参数中包含非法字符尝试注入!');</Script>"
Response.Write "非法操作!系统做了如下记录:<br>"
Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br>"
Response.Write "操作时间:"&Now&"<br>"
Response.Write "操作页面:"&Request.ServerVariables("URL")&"<br>"
Response.Write "提交方式:POST<br>"
Response.Write "提交参数:"&Str_Post&"<br>"
Response.Write "提交数据:"&Request.Form(Str_Post)
Response.End
End If
Next
Next
End If
'----------------------------------
'--------GET部份-------------------
If Request.QueryString<>"" Then
For Each Str_Get In Request.QueryString
For Str_Xh=0 To Ubound(Str_Inf)
If Instr(LCase(Request.QueryString(Str_Get)),Str_Inf(Str_Xh))<>0 Then
'--------写入数据库----------头-----
Str_dbstr="DBQ="+server.mappath("SqlIn.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Set Str_db=Server.CreateObject("ADODB.CONNECTION")
Str_db.open Str_dbstr
Str_db.Execute("insert into SqlIn(Sqlin_IP,SqlIn_Web,SqlIn_FS,SqlIn_CS,SqlIn_SJ) values('"&Request.ServerVariables("REMOTE_ADDR")&"','"&Request.ServerVariables("URL")&"','GET','"&Str_Get&"','"&replace(Request.QueryString(Str_Get),"'","''")&"')")
Str_db.close
Set Str_db = Nothing
'--------写入数据库----------尾-----
Response.Write "<Script Language=JavaScript>alert('请不要在参数中包含非法字符尝试注入!);</Script>"
Response.Write "非法操作!系统做了如下记录:<br>"
Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br>"
Response.Write "操作时间:"&Now&"<br>"
Response.Write "操作页面:"&Request.ServerVariables("URL")&"<br>"
Response.Write "提交方式:GET<br>"
Response.Write "提交参数:"&Str_Get&"<br>"
Response.Write "提交数据:"&Request.QueryString(Str_Get)
Response.End
End If
Next
Next
End If
%>
第3中方法需要你自己建个数据库表
试试看吧
‘伍’ php命令行工具检测php文件语法格式是否正确的方法是
使用PHP命令行,如果你是Windows下,需要先设置环境变量
1.右键我的电脑->属性->高级设置
2.点高级->环境变量
‘陆’ PHP的注入点用什么工具能扫描
您可以在华夏黑客联盟下载一个叫“
PHP网站注入扫描工具”的软件,那个就可以扫描PHP的注入点,我都下了,还蛮好用
‘柒’ 基于PHP的网站,SQL注入工具有哪些
navicat 很好用的