ASP.NET极限扫描者1.0


2007-08-09 21:32:16
 标签: .net 扫描    [ 推送到技术圈]

没什么好说的了吧!
之前写了个 JSP的 现在找个ASPX的实现了!
还给自己一个心愿~~

说起来也真头疼ASPX跟 JSP/SERVLET的生命周期 不一样~
ASPX页面的对象浏览完了自动会销毁...
而JSP/SERLVET的是通过容器反射调用对象的service方法~
所以页面的成员属性不会释放!ASPX则不同了!
所以没办法只能使用类里面的静态成员靠!
先看看下面图片吧!
***********************
 
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Net.Sockets" %>

<%
  
    String action=Request.QueryString["Action"];
    if (action!=null && !"".Equals(action)) {
        if("AddToScan".Equals(action))
        {
            string host = Request.QueryString["host"];//取得主机名字
            string port = Request.QueryString["port"];//取得开始port
            string endPort = Request.QueryString["endPort"];//取得结束port
            string thread = Request.QueryString["thread"];//取得线程
            JobConsole jc = new JobConsole();
            jc.host = host;
            jc.port = Convert.ToInt32(port);
            jc.startPort = jc.port;
            jc.endPort = Convert.ToInt32(endPort);
            jc.threadCount = Convert.ToInt32(thread);
            threadScheduler.Add(jc);
            jc.start();
            jc = null;
        }else if ("del".Equals(action))
        {
            string id = Request.QueryString["id"];
            if (id != null)
            {
                int num = Convert.ToInt32(id);
                JobConsole jc = (JobConsole)threadScheduler[num];
                jc.state = 2;//更改状态为stop
                threadScheduler.RemoveAt(num);//移除集合里面的对象
                jc.subThreadsPool.Clear();//清楚线程池里面的所有线程
                jc = null;
            }
        }
        else if ("Run".Equals(action))
        {
            string id = Request.QueryString["id"];
            if(id!=null)
            {
                int num = Convert.ToInt32(id);
                JobConsole jc = (JobConsole)threadScheduler[num];
                jc.state = 0;//running 状态
                jc.port = jc.startPort;
                jc.start();//重新开始
                jc = null;
            }
        }
        else if ("Pause".Equals(action))
        {
            string id = Request.QueryString["id"];
            if (id != null)
            {
                int num = Convert.ToInt32(id);
                JobConsole jc = (JobConsole)threadScheduler[num];
                jc.state = 1;//pause 状态
                jc = null;
            }
        }else if ("Continue".Equals(action))
        {
            string id = Request.QueryString["id"];
            if (id != null)
            {
                int num = Convert.ToInt32(id);
                JobConsole jc = (JobConsole)threadScheduler[num];
                jc.state = 0;//running 状态
                jc = null;
            }
        }else
        {
      Response.Write("");
      int count=threadScheduler.Count;
      for(int i=0;i                threadScheduler.TrimToSize();
       JobConsole jc=(JobConsole)threadScheduler[i];
       String scanState="";
       String operate="";
                if(jc!=null)
                {
           switch(jc.state){
            case 0:scanState="running";operate="";break;
            case 1:scanState="pause";operate="";break;
            case 2:scanState="stop";operate="";break;
           }
          
           Response.Write("
");
           Response.Write("");
           Response.Write("");
           jc=null;
                }
      }
            Response.Write("
JOBTHREADSTATEHOSTSCANNING...END PORTSUCC MSGERR MSGACTION
"+i+""+jc.threadCount+""+scanState+""+jc.host+""+(jc.port-1)+""+jc.endPort+""+jc.succMsg+""+jc.errMsg+""+operate+"
");
     }
        GC.Collect();
        Response.End();
        return;
    }
%>


ISTO Extreme .NETScanning 1.0






Scheduler Pool:




HOST:
START PORT:
END PORT:
THREAD:



  - = Information Security Technology Organization = - 

-= I.S.T.O =-