免费获取|
论文天下网
  • 论文天下网 |
  • 原创毕业论文 |
  • 论文范文 |
  • 论文下载 |
  • 计算机论文 |
  • 论文降重 |
  • 毕业论文 |
  • 外文翻译 |
  • 免费论文 |
  • 开题报告 |
  • 心得体会 |

当前位置:论文天下网 -> 免费论文 -> 计算机论文

免费基于Aglet的入侵检测系统的实现(六)

ception exc){
//当没有驱动程序时,应用程序无法继续运行,故退出程序
System.out.println("没有发现驱动程序:"+Driver);
exc.printStackTrace();System.exit(1);
}
try{
//建立与指定数据库的连接
Connection Connection=DriverManager.getConnection(source);
SQLWarning warn = Connection.getWarnings();
while(warn!=null){
System.out.println(warn.getMessage());
warn=warn.getNextWarning();
}
//创建一个用于执行预编译SQL的语句对象:查询记录的cid
String sql="select ip=dbo.inet_ntoa(ip_src) from iphdr,event,signature where iphdr.cid=event.cid and signature=signature.sig_id and sig_name='SCAN Proxy (8080) attempt'";
PreparedStatement pStm=Connection.prepareStatement(sql);
//发送和执行预编译的SQL语句,获得查询结果集
ResultSet result=pStm.executeQuery();
//"i"用于记录读出数据库多少个记录,"j"在输出记录时用于循环
int i=0,j=0;
//使用迭代模式访问查询结果集,计算有多少条数据
while(result.next()){
i++;                        
}
//关闭查询结果集合
result.close();
//关闭SQL语句
pStm.close();
System.out.println("i="+i);
i=i-1;
//建立"i"个单元的数组
ip=new String[i+1];
//再读数据库
//创建执行简单SQL语句的SQL语句对象
Statement stm=Connection.createStatement(); 
//查询记录的IP地址,发送和执行简单SQL语句,获得查询结果集
sql="select ip=dbo.inet_ntoa(ip_src) from iphdr,event,signature where iphdr.cid=event.cid and signature=signature.sig_id and sig_name='SCAN Proxy (8080) attempt'";
result=stm.executeQuery(sql);
//使用迭代模式访问查询结果集,把数据用数组接受下来
while(result.next()){
ip[j]=result.getString("ip");
j++;                         
}
//输出数组
for(j=0;j<=i;j++){
int k=j+1;
System.out.println("第"+k+"个IP地址:"+ip[j]+"\t");
}
//关闭查询结果集合
result.close();
//关闭SQL语句
stm.close();
//关闭数据库连接
Connection.close();
}catch(SQLException exc){
System.out.println("在执行数据库访问时发生了错误!");
exc.printStackTrace();
}
}
//建立单项链表,添加头和尾,并把第一个ip地址插入进去。
private void addhead()
{
temp=new node();
head=temp;
temp=new node();
temp.IpSo="end";
end=temp;
head.next=end;
temp=new node();
temp.IpSo=ip[0];
temp.Times=1;
temp.next=head.next;
head.next=temp;
}
//在链表尾添加节点,并把数据写道刚建立的节点中
private void addnode()
{
int i;
if(_theRemote==0)i=1;
else i=0;
while(i<ip.length)
{
search=head.next;
boolean t=false;
temp=new node();
pre=temp;
while(!t&&(search.next!=null))
{
if(ip[i].equals(search.IpSo))
{
t=true;
break;
}
pre.next=search;
search=search.next;
}
if(t){
search.Times=search.Times+1;
}
else
{
search=pre.next;
temp=new node();
temp.IpSo=ip[i];
temp.Times=1;
temp.next=search.next;
search.next=temp;
}
i++;
}
}
 //遍历链表,把链表的节点值输出
private void print()
{
search=head.next;
while(search!=null)
{
if(search.Times>10)
{
System.out.println(search.IpSo+":"+search.Times+"次");
}
search=search.next;
}  
}
//数据分析处理
private void addrule()
{
String IP="可疑地址:";
System.out.println("检查分析数据中(是否有攻击数据)………………");
search=head.next;
JFrame frame=new JFrame("基于AGLET平台的分布式入侵检测系统");
frame.setLocation(new Point(341,256));

首页 上一页 3 4 5 6 7 8 下一页 尾页 6/8/8

相关论文
上一篇:免费个人入侵检测系统的实现 下一篇:免费基于IPv6的下一代校园网设计
推荐论文 本专业最新论文
Tags:免费 基于 Aglet 入侵 检测系统 实现 【返回顶部】

相关栏目

自动化相关
计算机论文
工程管理论文
法律论文
医学论文
人力资源
电子专业
电气工程
英语论文
行政管理
电子商务
社科文学
教育论文
物流专业
金融专业
财务管理
会计专业
化学化工材料科学
电子通信
环境科学
经济类
机械模具类
报告,总结,申请书
其他专业论文


关于我们 | 联系方式 | 论文说明 | 网站地图 | 免费获取 | 钻石会员 | 原创毕业论文

 

论文天下网提供论文检测,论文降重,论文范文,论文排版,网站永久域名WWW.GEPUW.NET

本站部分文章来自网友投稿上传,如发现侵犯了您的版权,请联系指出,本站及时确认并删除  E-mail: 893628136@qq.com

Copyright@ 2009-2022 GEPUW.NET 论文天下网 版权所有