资源简介
nessus源码分析
代码片段和文件信息
/* Nessus Attack scripting Language
*
* Copyright (C) 2002 - 2003 Michel Arboi and Renaud Deraison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not write to the Free Software
* Foundation Inc. 675 Mass Ave Cambridge MA 02139 USA.
*
* In addition as a special exception Renaud Deraison and Michel Arboi
* give permission to link the code of this program with any
* version of the OpenSSL library which is distributed under a
* license identical to that listed in the included COPYING.OpenSSL
* file and distribute linked combinations including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* this file you may extend this exception to your version of the
* file but you are not obligated to do so. If you do not wish to
* do so delete this exception statement from your version.
*/
#include
#include
#include “capture_packet.h“
#include “nasl_raw.h“
extern int islocalhost(struct in_addr *);
/*
* Set up the pcap filter and select the correct interface.
*
* The filter will be changed only if this is necessary
*
*/
int init_capture_device(struct in_addr src struct in_addr dst char * filter)
{
int ret = -1;
char * interface = NULL;
char * a_dst *a_src;
char errbuf[PCAP_ERRBUF_SIZE];
int free_filter = 0;
a_src = estrdup(inet_ntoa(src));
a_dst = estrdup(inet_ntoa(dst));
if((filter == NULL) || (filter[0]==‘\0‘) || (filter[0]==‘0‘))
{
filter = emalloc(256);
free_filter = 1;
if(islocalhost(&src) == 0)
snprintf(filter 256 “ip and (src host %s and dst host %s)“
a_src a_dst);
}
else {
if(islocalhost(&src) == 0)filter = estrdup(filter);
else filter = emalloc(1);
free_filter = 1;
}
efree(&a_dst);
efree(&a_src);
if((interface = routethrough(&src &dst))||
(interface = pcap_lookupdev(errbuf)))
ret = bpf_open_live(interface filter);
if(free_filter != 0)efree(&filter);
return ret;
}
struct ip * capture_next_packet(int bpf int timeout int * sz)
{
int len;
int dl_len;
char * packet = NULL;
char * ret = NULL;
struct timeval past now then;
struct timezone tz;
if(bpf < 0)
return NULL;
dl_len = get_datalink_size(bpf_datalink(bpf));
bzero(&past sizeof(past));
bzero(&now sizeof(now));
gettimeofday(&then &tz);
for(;;)
{
bcopy(&then &past sizeof(then));
packet = (char*)bpf_next(bpf &len);
if(packet != NULL)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3267 2003-06-06 05:16 libnasl\include\config.h.in
文件 5246 2003-05-22 00:25 libnasl\include\includes.h
文件 575 2003-11-25 03:49 libnasl\include\nasl.h
文件 2110 1999-06-12 21:03 libnasl\include\nasl_icmp.h
文件 1089 2003-02-18 07:39 libnasl\include\nasl_ip.h
文件 308 1999-06-12 21:03 libnasl\include\nasl_raw.h
文件 1179 2001-10-16 01:58 libnasl\include\nasl_tcp.h
文件 569 2001-10-16 01:58 libnasl\include\nasl_udp.h
目录 0 2004-03-08 12:52 libnasl\include
文件 3073 2003-11-21 16:45 libnasl\nasl\Makefile
文件 3597 2003-07-18 02:05 libnasl\nasl\capture_packet.c
文件 1572 2003-01-18 23:54 libnasl\nasl\capture_packet.h
文件 41346 2004-01-20 05:38 libnasl\nasl\exec.c
文件 1590 2003-02-23 04:16 libnasl\nasl\exec.h
文件 4298 2003-04-02 19:54 libnasl\nasl\hmacmd5.c
文件 2377 2004-01-20 05:38 libnasl\nasl\hmacmd5.h
文件 3139 2003-01-07 09:39 libnasl\nasl\lfind.c
文件 8053 2003-04-02 19:54 libnasl\nasl\md5.c
文件 870 2003-04-02 18:46 libnasl\nasl\md5.h
文件 6030 2003-07-18 02:05 libnasl\nasl\nasl.c
文件 12255 2004-01-20 05:38 libnasl\nasl\nasl_crypto.c
文件 847 2003-04-02 18:46 libnasl\nasl\nasl_crypto.h
文件 3005 2003-03-24 07:49 libnasl\nasl\nasl_debug.c
文件 1566 2003-02-23 02:20 libnasl\nasl\nasl_debug.h
文件 9268 2004-01-20 05:38 libnasl\nasl\nasl_func.c
文件 1896 2003-07-18 02:05 libnasl\nasl\nasl_func.h
文件 1649 2003-01-18 23:54 libnasl\nasl\nasl_global_ctxt.h
文件 24144 2004-01-20 05:38 libnasl\nasl\nasl_grammar.y
文件 6075 2003-07-18 02:05 libnasl\nasl\nasl_host.c
文件 1868 2003-01-18 23:54 libnasl\nasl\nasl_host.h
............此处省略407个文件信息
相关资源
- erlang程序设计源码入门级
- 基于Win10和VS2013-VS2019的比特币源码(
- MIT Xv6 操作系统源码详解最新版 rev1
- 投票系统源码+论文+开题报告
- 豆瓣FM源码
- 中科院课程 高性能并行计算课件,程
- 简易抽奖软件含源码
- 宜立方商城源码
- pygame实现的弹珠游戏源码
- 商城源码商城源码商城源码
- NeHe opengl教程48课全中文pdf,英文pdf,
- 串口调试助手VC源码
- 饿了么源码
- 计算机图形学 OpenGL实验源码+实验文档
- .net商品销售管理系统完整源码(进销
- sobel算子verilog源码
- glfw-3.2.1源码(需要自行编译)
- OV7670摄像头循迹 程序源码
- 小区水电收费管理系统源码
- PB漂亮的界面美化源码-kodigo
- 计算机图形学的设计作业。。OpenGl源
- 微擎万能门店小程序源码7.3.4版前后端
- 2018年板球控制系统摄像头部分源码
- flex3做的网页在线试衣间项目源码
- 云台控制系统源码
- DWM1000 测距源码 定位基础
- 2017年人脸检测、人脸对齐、人脸识别
- 英文视频网源码一键采集
- unity3d 赛车DEMO
- 数学建模资源合集论文+源码+注释
评论
共有 条评论