資源簡介
1.端口掃描 portScan:
端口掃描程序,包括ping掃描,syn掃描,fin掃描等方式,可以參考。
2.ICMP發現活動主機&TCP(SYN FIN ACK)掃描&UDP掃描:
ICMP發現活動主機 TCP(SYN FIN ACK)端口掃描 UDP端口掃描 vs2008 Winpcap開發。
3.端口掃描器程序:
端口掃描器程序,實現了: TCP Connect掃描 TCP SYN掃描 TCP FIN掃描 TCP ACK掃描 TCP NULL掃描 TCP XMAS掃描 UDP掃描。
4.端口掃描器:
1.采用多線程技術能夠對指定的網絡主機與端口在同一時間并發進行掃描 2.采用connect掃描、半開掃描、FIN掃描三種手段實現掃描 3.結合掃描結果與/etc/services文件將網絡中開啟的主機及主機開啟的服務在屏幕上顯示出來 4.判斷主機OS功能 5.識別服務器功能。
5.端口掃描程序源碼:
該源碼為《計算機網絡高級軟件編程技術》第17章的源碼,用TCP,UDP,ACK,FIN,ARP,ICMP等幾種方法實現了IP掃描、端口掃描。
端口掃描程序,包括ping掃描,syn掃描,fin掃描等方式,可以參考。
2.ICMP發現活動主機&TCP(SYN FIN ACK)掃描&UDP掃描:
ICMP發現活動主機 TCP(SYN FIN ACK)端口掃描 UDP端口掃描 vs2008 Winpcap開發。
3.端口掃描器程序:
端口掃描器程序,實現了: TCP Connect掃描 TCP SYN掃描 TCP FIN掃描 TCP ACK掃描 TCP NULL掃描 TCP XMAS掃描 UDP掃描。
4.端口掃描器:
1.采用多線程技術能夠對指定的網絡主機與端口在同一時間并發進行掃描 2.采用connect掃描、半開掃描、FIN掃描三種手段實現掃描 3.結合掃描結果與/etc/services文件將網絡中開啟的主機及主機開啟的服務在屏幕上顯示出來 4.判斷主機OS功能 5.識別服務器功能。
5.端口掃描程序源碼:
該源碼為《計算機網絡高級軟件編程技術》第17章的源碼,用TCP,UDP,ACK,FIN,ARP,ICMP等幾種方法實現了IP掃描、端口掃描。
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
//#include?
#include?
#include?
#include?“nids.h“
#define?int_ntoa(x) inet_ntoa(*((struct?in_addr?*)&x))
char?ip[32];
int?minport;
int?maxport;
struct?sockaddr_in?target;
struct?sockaddr_in?myaddr;
struct?sockaddr_in?target2;
struct?sockaddr_in?myaddr2;
int?sockfd?;
int?sockfd2?;
int?flag=0;
pthread_t?pth?;
pthread_t?pth2?;
pthread_t?pth3?;
pthread_t?pth4?;
int?panduan[65536];
char?*adres?(struct?tuple4?addr)
{
??static?char?buf[256];
??strcpy?(buf?int_ntoa?(addr.saddr));
??sprintf?(buf?+?strlen?(buf)?“%i“?addr.source);
??strcat?(buf?int_ntoa?(addr.daddr));
??sprintf?(buf?+?strlen?(buf)?“%i“?addr.dest);
??return?buf;
}
//定義TCP偽報頭
typedef?struct?psd_hdr
{
unsigned?long?saddr;?//源地址
unsigned?long?daddr;?//目的地址
char?mbz;?char?ptcl;?//協議類型
unsigned?short?tcpl;?//TCP長度
}PSD_HEADER;
//定義TCP報頭
typedef?struct?_tcpheadr
{
unsigned?short?th_sport;?//16位源端口
unsigned?short?th_dport;?//16位目的端口
unsigned?int?th_seq;?//32位序列號
unsigned?int?th_ack;?//32位確認號
unsigned?char?th_lenres;?//4位首部長度/4位保留字
unsigned?char?th_flag;?//6位標志位
unsigned?short?th_win;?//16位窗口大小
unsigned?short?th_sum;?//16位校驗和
unsigned?short?th_urp;?//16位緊急數據偏移量
}?TCP_HEADER;
//定義IP報頭
typedef?struct?_ipheadr
{
unsigned?char?h_lenver?;?//長度加版本號
unsigned?char?tos;
unsigned?short?total_len;
unsigned?short?ident;
unsigned?short?frag_and_flags;
unsigned?char?ttl;
unsigned?char?proto;
unsigned?short?checksum;
unsigned?int?sourceIP;
unsigned?int?destIP;
}?IP_HEADER;
//checksum
unsigned?short?checksum(unsigned?short?*addrint?len){
int?nleft=len;
???int?sum=0;
???unsigned?short?*?w=addr;
???unsigned?short?answer=0;
???while?(nleft>1)
???{
?????sum+=*w++;
?????nleft-=2;
???}
???if?(nleft==1)
???{
?????*(unsigned?char?*)(&answer)=*(unsigned?char?*)w;
?????sum+=answer;
???}
???sum=(sum>>16)+(sum?&?0xffff);
???sum+=(sum>>16);
???answer=~sum;
???return(answer);
}
void?TCP_Send(int?portunsigned?char?flag){
//設置目標端口
target.sin_port?=?htons(port)?;
//構造包
char?buffer[1024]?;
memset(buffer01024)?;
struct?_tcpheadr?tcpHeader?;
struct?psd_hdr?psdHeader?;
//填充TCP
//目的端口
tcpHeader.th_dport?=?htons(port)?;
//源端口
tcpHeader.th_sport?=?htons(60000)?;
//序列號??
tcpHeader.th_seq?=?htonl(0x1245678);
//確認號
tcpHeader.th_ack?=?0;
//(4位首部長度/4位保留字)
tcpHeader.th_lenres?=?(sizeof(tcpHeader)?/?4?<4?|?0);
//SYN標志
tcpHeader.th_flag?=?flag?;//SYN
//滑動窗口
tcpHeader.th_win?=?htons(16384)?;
//16位緊急數據偏移量
tcpHeader.th_urp?=?0;
//16位校驗和
tcpHeader.th_sum?=?0;
//psdheader
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-12-21?17:06??5種不同的端口掃描器程序\
?????文件????16458884??2019-12-18?22:41??5種不同的端口掃描器程序\ICMP%26PortScan.rar
?????文件???????14329??2019-12-18?22:40??5種不同的端口掃描器程序\portscan2.0.c
?????文件??????450006??2019-12-18?22:40??5種不同的端口掃描器程序\第17章?綜合掃描程序.rar
?????文件??????363724??2019-12-18?22:41??5種不同的端口掃描器程序\端口掃描.zip
?????文件?????5320987??2019-12-18?22:41??5種不同的端口掃描器程序\端口掃描器程序.rar
評論
共有 條評論