阅读:4245回复:32
考研失败!!!课题不想做了,大伙进来拿分!!
今年考研失败......
指天发誓明年一定要考上...... 我现在就想开始复习,所以基于NDIS的网络数据分析系统的毕业设计课题不想做了,打算直接用现成的winpcap编译*.vxd,*.sys,*.dll用vc++6.0开发这个课题:(环境设定为)win98se版,两台机器总线型对连,一台机器设为检测机,安装检测程序,另一台机器不不断的向检测机发送数据,要求检测程序能显示出(1)数据包源IP地址,(2)目的IP地址,以及(3)数据包大小,(4)数据包类型(UDP,TCP,IP......),(5)一个动态的统计框(显示当前时刻的各种类型包的个数),(6)提供一个功能统计某一源IP的数据流量(?k/s),估计是否属于恶意数据流攻击.......等等. 由于我这半年都不会再来了(拼命复习),所以决定将自己所有的分(大概1000)全送给大家! 不过前提是我的毕业设计能顺利完成!我的意见是集合大家的思路在短期内(5.20前)做一个比较牛(功能比较完善)的检测程序.所以请看到帖子后相互转告,越快越好...... 大伙只要做了回复的都会有分(1-?分) 如果能给出好的建议和有价值的课题功能补充(10-?) 给出较为详细的程序设计思路(程序如何构造,流程图.记得前提是直接用现成的winpcap编译*.vxd,*.sys,*.dll而且是在win98se下!因为如果再回头自己来写vxd,wdm就很烦人了......)(50-?)注:可多次给分. 给出课题相关的符合要求的源代码(我觉得我这么做很衰很卑鄙无耻......不过我真的不想再在这个上面用时间,看自己的同学都出国,上研,自己却不得不背水一战......家中还有愁白头的父亲......)就求大家这么一次了......(100-?)注:可多次给分. 大家等我明年的好消息......到时候再来散分...... |
|
最新喜欢:![]() |
沙发#
发布于:2002-04-29 12:21
支持,关注!
|
|
板凳#
发布于:2002-04-29 13:00
应该工作一段再考,很多研究生在混日子
|
|
|
地板#
发布于:2002-04-29 13:19
哥们,我和你一届,我找工作了。先积累点经验,再出国深造,可能更好。何必一棵树上吊死?
祝你好运。 |
|
地下室#
发布于:2002-04-29 15:54
你要做的这个东西不防叫做“网络观察员”,和防火墙有点类似,但不需要防火墙的包阻断功能,你可以到网上搜有关防火墙的设计,实现的内容。
另奉劝一句,不必急于考研 |
|
5楼#
发布于:2002-04-29 16:31
其实你用DDK下的PASSTHRU就可以实现的啦!不过你的时间实在太紧了!通过拦截其中的收发函数,然后得到其中的数据包内容进行分析就可以啦!
|
|
6楼#
发布于:2002-04-29 16:32
其实你用DDK下的PASSTHRU就可以实现的啦!不过你的时间实在太紧了!通过拦截其中的收发函数,然后得到其中的数据包内容进行分析就可以啦!或者用PACKET这个例子也可以,不过都是NT或2K下的!
|
|
7楼#
发布于:2002-04-29 17:49
下面的程序可以打印包,其他的你自己努力吧。其实都是照着winpcap的源码改的,自己看看文挡很容易实现的,根本不用在这问。
int CapAllPacket(FilterMode) { // define a pointer to a ADAPTER structure LPADAPTER lpAdapter = 0; int i,npacks,Snaplen; DWORD dwErrorCode; DWORD dwVersion; DWORD dwWindowsMajorVersion; //unicode strings (winnt) WCHAR AdapterName[512]; // string that contains a list of the network adapters WCHAR *temp,*temp1; //ascii strings (win95) char AdapterNamea[512]; // string that contains a list of the network adapters char *tempa,*temp1a; int AdapterNum=0,Open; ULONG AdapterLength; char buffer[256000]; // buffer to hold the data coming from the driver struct bpf_stat stat; char MessageBuffer[10000]; //save the packet without MAC header // char SendBuffer[10000]; //save the echo packet without MAC header u_int IP_Packet_Size; // define a pointer to a PACKET structure LPPACKET lpPacket; AdapterNamea[0]=0; if(AdapterNamea[0]==0){ // obtain the name of the adapters installed on this machine AdapterLength=1024; printf(\"\\nAdapters installed:\\n\"); i=0; // the data returned by PacketGetAdapterNames is different in Win95 and in WinNT. // We have to check the os on which we are running dwVersion=GetVersion(); dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); if (!(dwVersion >= 0x80000000 && dwWindowsMajorVersion >= 4)) { // Windows NT PacketGetAdapterNames(AdapterName,&AdapterLength); temp=AdapterName; temp1=AdapterName; while ((*temp!=\'\\0\')||(*(temp-1)!=\'\\0\')) { if (*temp==\'\\0\') { memcpy(AdapterList,temp1,(temp-temp1)*2); temp1=temp+1; i++; } temp++; } AdapterNum=i; for (i=0;i<AdapterNum;i++) wprintf(L\"\\n%d- %s\\n\",i+1,AdapterList); printf(\"\\n\"); } else //windows 95 { PacketGetAdapterNames(AdapterNamea,&AdapterLength); tempa=AdapterNamea; temp1a=AdapterNamea; while ((*tempa!=\'\\0\')||(*(tempa-1)!=\'\\0\')) { if (*tempa==\'\\0\') { memcpy(AdapterList,temp1a,tempa-temp1a); temp1a=tempa+1; i++; } tempa++; } AdapterNum=i; for (i=0;i<AdapterNum;i++) printf(\"\\n%d- %s\\n\",i+1,AdapterList); printf(\"\\n\"); } do { printf(\"Select the number of the adapter to open : \");scanf(\"%d\",&Open); if (Open>AdapterNum) printf(\"\\nThe number must be smaller than %d\",AdapterNum); } while (Open>AdapterNum); lpAdapter = PacketOpenAdapter(AdapterList[Open-1]); if (!lpAdapter || (lpAdapter->hFile == INVALID_HANDLE_VALUE)) { dwErrorCode=GetLastError(); printf(\"Unable to open the driver, Error Code : %lx\\n\",dwErrorCode); return(-1); } } else{ lpAdapter = PacketOpenAdapter(AdapterNamea); if (!lpAdapter || (lpAdapter->hFile == INVALID_HANDLE_VALUE)) { dwErrorCode=GetLastError(); printf(\"Unable to open the driver, Error Code : %lx\\n\",dwErrorCode); return(-1); } } // set the network adapter mode PacketSetHwFilter(lpAdapter,FilterMode); // set a 512K buffer in the driver PacketSetBuff(lpAdapter,512000); // set a 1 second read timeout PacketSetReadTimeout(lpAdapter,1000); //allocate and initialize a packet structure that will be used to //receive the packets. if((lpPacket = PacketAllocatePacket())==NULL){ printf(\"\\nError:failed to allocate the LPPACKET structure.\"); return (-1); } PacketInitPacket(lpPacket,(char*)buffer,256000); //main capture loop while(!kbhit()) { // capture the packets if(PacketReceivePacket(lpAdapter,lpPacket,TRUE)==FALSE){ printf(\"Error: PacketReceivePacket failed\"); return (-1); } MinReadPackets(lpPacket, MessageBuffer, IP_Packet_Size); // PrintPackets(lpPacket); } //print the capture statistics PacketGetStats(lpAdapter,&stat); printf(\"\\n\\n%d packets received.\\n%d Packets lost\\n\",stat.bs_recv,stat.bs_drop); PacketFreePacket(lpPacket); // close the adapter and exit PacketCloseAdapter(lpAdapter); return(0); } void ReadPackets(LPPACKET lpPacket,char *BufferPtr,u_int IP_Packet_Size) { ULONG i, j, ulen, ulBytesReceived; char *pChar, *base; char *buf; char iprotocol; u_int Off_IPHeader, off=0; u_int tlen, //IP_Packet_Size, tlen1; struct bpf_hdr *hdr; // char MessageBuffer[10000]; //save the packet without MAC header ulBytesReceived = lpPacket->ulBytesReceived; buf = lpPacket->Buffer; //the pointer of the data off=0; //data offset while(off<ulBytesReceived){ // had data? //if(kbhit())return; hdr=(struct bpf_hdr *)(buf+off); //data pointer tlen1=hdr->bh_datalen; //original length of packet tlen=hdr->bh_caplen; //length of captured portion // printf(\"Received a Packet length : %ld\\n\",tlen1); off+=hdr->bh_hdrlen; //without bpf header Off_IPHeader=off; Off_IPHeader +=MAC_header_offset; //without MAC header offset IP_Packet_Size=tlen1-MAC_header_offset;//IP packet without //MAC header offset //MessageBuffer=BufferPtr; ZeroMemory(BufferPtr, 10000); memcpy(BufferPtr,(buf+Off_IPHeader),IP_Packet_Size); IP_Packet_Size=ntohs((WORD)(*(WORD *)(BufferPtr+2))); PrintUdpPacket(BufferPtr,IP_Packet_Size); off=Packet_WORDALIGN(off+tlen); // return (IP_Packet_Size); } } |
|
|
8楼#
发布于:2002-04-29 17:57
98下的网络视察功能以前讨论了很多,你要做的真的没有什么难度,
看看以前的就知道了! 对了,现在考研真的那么不得了吗? 我大三,想知道是不是不考研就完了!! |
|
|
9楼#
发布于:2002-04-29 21:39
先谢谢大家的回答。我参考你们的意见来做。我手头上有winpcap的例子。而且可以编译出相应的几个重要文件。可关键是我现在对整个程序的架构不清楚。(需要解决ring0和ring3切换的问题么?)
是用mfc还是用win32 app? |
|
10楼#
发布于:2002-04-29 21:44
就是一个win32 app,
__________________________________________________________ 下载xp DDK,艰苦灌水中。 |
|
|
11楼#
发布于:2002-04-29 21:49
记得把driver先安装上。然后把dll,家到工程里。
__________________________________________________________ 下载xp DDK,艰苦灌水中。 [编辑 - 4/29/02 作者: moqingsong] |
|
|
12楼#
发布于:2002-05-02 09:10
然后呢?有现成的函数接口么?
|
|
13楼#
发布于:2002-05-02 09:13
就是libpcap啦!
|
|
|
14楼#
发布于:2002-05-02 11:51
那这个接口如何使用呢?
|
|
15楼#
发布于:2002-05-02 13:28
我也今年考的很烂,但是我跟你的想法就不同!哈哈
我觉得先工作段时间也是很好的,我目前在大学教书,然后找活干!同时准备再考。其实也不是非得考不可的! |
|
16楼#
发布于:2002-05-02 14:01
winpcap里没有help么?
|
|
|
17楼#
发布于:2002-05-02 16:23
我手头的这个没有:(
如果你有可以给我发一个么?:) kissyourface@netease.com |
|
18楼#
发布于:2002-05-02 16:30
去这里看吧http://winpcap.polito.it/docs/default.htm
祝你顺利。 |
|
|
19楼#
发布于:2002-05-02 16:35
thank you
|
|
|
上一页
下一页