当前位置: 首页 > 图文教程 > 网络编程 > ASP > 一个用c#写的扫描asp源码漏洞的应用程序(续)

ASP
remote script文档(转载自微软)(八)
不能ASP图像组件来生成图像的ASP计数器程序(二)
不能ASP图像组件来生成图像的ASP计数器程序(三)
用ASP发送邮件
用ASP进行网络打印功能
用ASP实现号码转换
如何用ASP创建日志文件
二十八条改善 ASP 性能和外观的技巧(1-7)
二十八条改善 ASP 性能和外观的技巧(8-14)
二十八条改善 ASP 性能和外观的技巧(15-21)
二十八条改善 ASP 性能和外观的技巧(22-28)
asp实现在web中显示电子表格数据(一)显示数据表格的应用
asp实现在web中显示电子表格数据(二)生成HTML表格
asp实现在web中显示电子表格数据(三)创建数据表列表和名字范围
asp实现在web中显示电子表格数据(四)创建文件选择列表
Carello Web 使 ASP 源码暴露 (APP,缺陷)
MS IIS虚拟主机ASP源码泄露 (MS,缺陷)
虚拟web目录容易泄露ASP源代码 (MS,缺陷)
MS IIS server的ASP安全缺陷 (MS,缺陷)
用WinSock设计Chat程序(转)

ASP 中的 一个用c#写的扫描asp源码漏洞的应用程序(续)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 67 ::
收藏到网摘: n/a

  //主要方法
        protected void btnGo_Click (object sender, System.EventArgs e)
        {

            //解析url
            string strServer = this.txtServer.Text ;
            string strUrl   = this.txtFileName.Text ;
            char [] point = {'.'} ;   //定义分割符为"."
            char[] line = {'/'} ;     //定义分割符为"."
            string [] arrString = strUrl.Split(line) ;

            //求asp文件全名
            string strFileName = arrString[arrString.Length - 1] ;
            //求从根目录下的路径
            string strPath = strUrl.Substring( 0 ,
                             strUrl.Length - strFileName.Length) ;

            //解析文件全名
            arrString = strFileName.Split(point) ;
            //求文件扩展名
            string strLast = arrString[arrString.Length - 1] ;
            //求文件名
            string strFirst = strFileName.Substring( 0 ,
                              strFileName.Length - strLast.Length - 1) ;
            


            //使按钮、输入框等失效
            this.txtServer.ReadOnly = true ;
            this.txtFileName.ReadOnly = true ;
            this.btnClear.Enabled = false ;
            this.btnGo.Enabled = false ;


            if (this.txtServer.Text == "http://" || this.txtFileName.Text == ""
                || this.txtServer.Text.Trim()== "" ||
                this.txtServer.Text.Substring(0,7) != "http://")
            {
                MessageBox.Show("请输入正确的主机名和文件名!") ;
                this.txtServer.Focus() ;
            }
            else
       &