制作自己专属的抓包工具

【WinPcap】自制抓包+分析+ARP攻击(三) 【WinPcap】自制抓包+分析+ARP攻击 扫描网内主机       继续接着昨天的来,今天就能搞定。           先来看一下对网内活动主机的扫描。我的大体思路是:对网段内所有IP发送ARP包,根据收到的响应来判断是否有活动主机,并作记录。这一点其实不难,仔细认真地遍历网段内主机IP,用一个线程额外接受ARPreply响应包,并做解析就可以了。我觉得难就难在网关的确定,子网掩码 阅读详情

Wireshark是一个强大的抓包分析工具,制作自己的抓包工具可以基于Wireshark的插件机制做二次开发,也可以基于WinPcap的开发包来开发,WinPcap本质上是基于NDIS驱动程序接口规范开发的(NDIS是Network Driver Interface Specification的简写)。

这里记录的是基于C/C++和WpdPack二次开发包的方法。供大家参考。

由于驱动需要签名才能使用, 签名费用昂贵,个人开发者可以使用开源的签名驱动,比如基于NDIS的驱动有OpenVPN开源的可以使用,也有Wireguard开源的WinTun驱动可以使用。

下面我会贴出具体的实现源码

Linux下的开发包下载地址

Home | TCPDUMP & LIBPCAPicon-default.png?t=M276https://www.tcpdump.org/https://www.tcpdump.org/release/libpcap-1.10.1.tar.gzicon-default.png?t=M276https://www.tcpdump.org/release/libpcap-1.10.1.tar.gz

windows下的开发包下载地址:

https://www.winpcap.org/install/bin/WpdPack_4_1_2.ziphttps://www.winpcap.org/install/bin/WpdPack_4_1_2.zip WinPcap · Developer Resourceshttps://www.winpcap.org/devel.htm


#include "pcap.h"

#include <string.h>
#include <Windows.h>
#include <winsock.h>
#include <process.h>



#pragma comment(lib, "wpcap.lib")
#pragma comment(lib, "Ws2_32.lib")

#define LINE_LEN 16
#define MAX_ADDR_LEN 32

char macaddr[128] = { 0 };
int  total_send = 0;
int  total_recv = 0;
#define  RECV_DIR  1
#define  SEND_DIR  2

int  flowSecondRecv[2] = { 0 };
int  flowSecondSend[2] = { 0 };

int  flowMinuteRecv[61] = { 0 };
int  flowMinuteSend[61] = { 0 };

int  flowHourRecv[25] = { 0 };
int  flowHourSend[25] = { 0 };

int  flowDayRecv[32] = { 0 };
int  flowDaySend[32] = { 0 };

//存放上60分钟的数据
int  _flowMinuteRecv[61] = { 0 };
int  _flowMinuteSend[61] = { 0 };
//存放上24小时的数据
int  _flowHourRecv[25] = { 0 };
int  _flowHourSend[25] = { 0 };
//存放上30天的数据
int  _flowDayRecv[32] = { 0 };
int  _flowDaySend[32] = { 0 };


void dumpData()
{
	
}

void updateData(int dir, int len )
{
	time_t local_tv_sec = time(0);
	struct tm* ltime = localtime(&local_tv_sec);
	
	if (dir == RECV_DIR) {
		if (flowSecondRecv[0] == local_tv_sec) {
			flowSecondRecv[1] += len;//单位字节
		}
		else {
			flowSecondRecv[0] = local_tv_sec;
			flowSecondRecv[1] = len;//单位字节
		}

		if (flowMinuteRecv[0] == ltime->tm_hour) {
			flowMinuteRecv[ltime->tm_min + 1] += len;//单位字节
		}
		else {
			memcpy(_flowMinuteRecv, flowMinuteRecv, sizeof(flowMinuteRecv));
			memset(flowMinuteRecv, 0, sizeof(flowMinuteRecv));

			flowMinuteRecv[0] = ltime->tm_hour;
			flowMinuteRecv[ltime->tm_min + 1] = len;//单位字节
		}

		if (flowHourRecv[0] == ltime->tm_mday)
		{
			flowHourRecv[ltime->tm_hour] += len;//单位字节
		}
		else {
			memcpy(_flowHourRecv, flowHourRecv, sizeof(flowHourRecv));
			memset(flowHourRecv, 0, sizeof(flowHourRecv));

			flowHourRecv[0] = ltime->tm_mday;
			flowHourRecv[ltime->tm_hour +1] = len;//单位字节
		}

		if (flowDayRecv[0] == ltime->tm_mon) {
			flowDayRecv[ltime->tm_mday] += len;
		}
		else {
			memcpy(_flowDayRecv, flowDayRecv, sizeof(flowDayRecv));
			memset(flowDayRecv, 0, sizeof(flowDayRecv));

			flowDayRecv[0] = ltime->tm_mon;
			flowDayRecv[ltime->tm_mday] = len;
		}

	}


	if (dir == SEND_DIR) {
		if (flowSecondSend[0] == local_tv_sec) {
			flowSecondSend[1] += len;
		}
		else {
			flowSecondSend[0] = local_tv_sec;
			flowSecondSend[1] = len;
		}

		if (flowMinuteSend[0] == ltime->tm_hour) {
			flowMinuteSend[ltime->tm_min + 1] += len;
		}
		else {
			memcpy(_flowMinuteSend, flowMinuteSend, sizeof(flowMinuteSend));
			memset(flowMinuteSend, 0, sizeof(flowMinuteSend));

			flowMinuteSend[0] = ltime->tm_hour;
			flowMinuteSend[ltime->tm_min + 1] = len;
		}

		if (flowHourSend[0] == ltime->tm_mday)
		{
			flowHourSend[ltime->tm_hour] += len;
		}
		else {
			memcpy(_flowHourSend, flowHourSend, sizeof(flowHourSend));
			memset(flowHourSend, 0, sizeof(flowHourSend));

			flowHourSend[0] = ltime->tm_mday;
			flowHourSend[ltime->tm_hour + 1] = len;
		}

		if (flowDaySend[0] == ltime->tm_mon) {
			flowDaySend[ltime->tm_mday] += len;
		}
		else {
			memcpy(_flowDaySend, flowDaySend, sizeof(flowDaySend));
			memset(flowDaySend, 0, sizeof(flowDaySend));

			flowDaySend[0] = ltime->tm_mon;
			flowDaySend[ltime->tm_mday] = len;
		}

	}

}



FILE *file = 0;

// 以太网协议格式的定义
typedef struct ether_header {
	u_char ether_dhost[6];		// 目标MAC地址
	u_char ether_shost[6];		// 源MAC地址
	u_short ether_type;			// 以太网类型
}ether_header;

// 用户保存4字节的IP地址
typedef struct ip_address {
	u_char byte1;
	u_char byte2;
	u_char byte3;
	u_char byte4;
}ip_address;

// 用于保存IPV4的首部
typedef struct ip_header {
	u_char version_hlen;		// 首部长度 版本
	u_char tos;					// 服务质量
	u_short tlen;				// 总长度
	u_short identification;		// 身份识别
	u_short flags_offset;		// 标识 分组偏移
	u_char ttl;					// 生命周期
	u_char proto;				// 协议类型
	u_short checksum;			// 包头测验码
	u_int saddr;				// 源IP地址
	u_int daddr;				// 目的IP地址
}ip_header;

// 用于保存TCP首部
typedef struct tcp_header {
	u_short sport;
	u_short dport;
	u_int sequence;				// 序列码
	u_int ack;					// 回复码
	u_char hdrLen;				// 首部长度保留字
	u_char flags;				// 标志
	u_short windows;			// 窗口大小
	u_short checksum;			// 校验和
	u_short urgent_pointer;		// 紧急指针
}tcp_header;

// 用于保存UDP的首部
typedef struct udp_header {
	u_short sport;				// 源端口
	u_short dport;				// 目标端口
	u_short datalen;			// UDP数据长度
	u_short checksum;			// 校验和
}udp_header;

// 用于保存ICMP的首部
typedef struct icmp_header {
	u_char type;				// ICMP类型
	u_char code;				// 代码
	u_short checksum;			// 校验和
	u_short identification;		// 标识
	u_short sequence;			// 序列号
	u_long timestamp;			// 时间戳
}icmp_header;

// 用于保存ARP的首部
typedef struct arp_header {
	u_short hardware_type;					// 格式化的硬件地址
	u_short protocol_type;					// 协议地址格式
	u_char hardware_length;					// 硬件地址长度
	u_char protocol_length;					// 协议地址长度
	u_short operation_code;					// 操作码
	u_char source_ethernet_address[6];		// 发送者硬件地址
	u_char source_ip_address[4];			// 发送者协议地址
	u_char destination_ethernet_address[6];	// 目的方硬件地址
	u_char destination_ip_address[4];		// 目的方协议地址
}arp_header;

// TCP协议处理
//u_short sport;
//u_short dport;
//u_int sequence;			// 序列码
//u_int ack;				// 回复码
//u_char hdrLen;			// 首部长度保留字
//u_char flags;				// 标志
//u_short windows;			// 窗口大小
//u_short checksum;			// 校验和
//u_short urgent_pointer;	// 紧急指针
void tcp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content)
{
	tcp_header *tcp_protocol;

	tcp_protocol = (tcp_header*)(pkt_content + 14 + 20);

	printf("===================TCP Protocol=================\n");

	printf("Source Port: %i\n", ntohs(tcp_protocol->sport));
	printf("Destination Port: %i\n", ntohs(tcp_protocol->dport));
	printf("Sequence number: %d\n", ntohl(tcp_protocol->sequence));
	printf("Acknowledgment number: %d\n", ntohl(tcp_protocol->ack));
	printf("Header Length: %d\n", (tcp_protocol->hdrLen >> 4) * 4);
	printf("Flags: 0x%.3x ", tcp_protocol->flags);
	if (tcp_protocol->flags & 0x08) printf("(PSH)");
	if (tcp_protocol->flags & 0x10) printf("(ACK)");
	if (tcp_protocol->flags & 0x02) printf("(SYN)");
	if (tcp_protocol->flags & 0x20) printf("(URG)");
	if (tcp_protocol->flags & 0x01) printf("(FIN)");
	if (tcp_protocol->flags & 0x04) printf("(RST)");
	printf("\n");
	printf("Windows Size: %i\n", ntohs(tcp_protocol->windows));
	printf("Checksum: 0x%.4x\n", ntohs(tcp_protocol->checksum));
	printf("Urgent Pointer: %i\n", ntohs(tcp_protocol->urgent_pointer));
}

// UDP协议处理
//u_short sport;			// 源端口
//u_short dport;			// 目标端口
//u_short datalen;			// UDP数据长度
//u_short checksum;			// 校验和
void udp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content)
{
	udp_header *udp_protocol;

	udp_protocol = (udp_header*)(pkt_content + 14 + 20);

	printf("===================UDP Protocol=================\n");
	printf("Source Port: %i\n", ntohs(udp_protocol->sport));
	printf("Destination Port: %i\n", ntohs(udp_protocol->dport));
	printf("Datalen: %i\n", ntohs(udp_protocol->datalen));
	printf("Checksum: 0x%.4x\n", ntohs(udp_protocol->checksum));
}

// ICMP协议处理
//u_char type;				// ICMP类型
//u_char code;				// 代码
//u_short checksum;			// 校验和
//u_short identification;	// 标识
//u_short sequence;			// 序列号
//u_long timestamp;			// 时间戳
void icmp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content)
{
	icmp_header *icmp_protocol;

	icmp_protocol = (icmp_header*)(pkt_content + 14 + 20);

	printf("==================ICMP Protocol=================\n");
	printf("Type: %d ", icmp_protocol->type);
	switch (icmp_protocol->type)
	{
	case 8:
		printf("(request)\n");
		break;
	case 0:
		printf("(reply)\n");
		break;
	default:
		printf("\n");
		break;
	}
	printf("Code: %d\n", icmp_protocol->code);
	printf("CheckSum: 0x%.4x\n", ntohs(icmp_protocol->checksum));
	printf("Identification: 0x%.4x\n", ntohs(icmp_protocol->identification));
	printf("Sequence: 0x%.4x\n", ntohs(icmp_protocol->sequence));
}

// ARP协议处理
//u_short hardware_type;					// 格式化的硬件地址
//u_short protocol_type;					// 协议地址格式
//u_char hardware_length;					// 硬件地址长度
//u_char protocol_length;					// 协议地址长度
//u_short operation_code;					// 操作码
//u_char source_ethernet_address[6];		// 发送者硬件地址
//u_char source_ip_address[4];				// 发送者协议地址
//u_char destination_ethernet_address[6];	// 目的方硬件地址
//u_char destination_ip_address[4];			// 目的方协议地址
void arp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content)
{
	arp_header *arp_protocol;

	arp_protocol = (arp_header*)(pkt_content + 14);

	printf("==================ARP Protocol==================\n");
	printf("Hardware Type: ");
	switch (ntohs(arp_protocol->hardware_type))
	{
	case 1:
		printf("Ethernet");
		break;
	default:
		break;
	}
	printf(" (%d)\n", ntohs(arp_protocol->hardware_type));
	printf("Protocol Type: \n");
	switch (ntohs(arp_protocol->protocol_type))
	{
	case 0x0800:
		printf("%s", "IP");
		break;
	case 0x0806:
		printf("%s", "ARP");
		break;
	case 0x0835:
		printf("%s", "RARP");
		break;
	default:
		printf("%s", "Unknown Protocol");
		break;
	}
	printf(" (0x%04x)\n", ntohs(arp_protocol->protocol_type));
	printf("Hardware Length: %d\n", arp_protocol->hardware_length);
	printf("Protocol Length: %d\n", arp_protocol->protocol_length);
	printf("Operation Code: ");
	switch (ntohs(arp_protocol->operation_code))
	{
	case 1:
		printf("request");
		break;
	case 2:
		printf("reply");
		break;
	default:
		break;
	}
	printf(" (%i)\n", ntohs(arp_protocol->operation_code));
}

// IP协议处理
//u_char version_hlen;		// 首部长度 版本
//u_char tos;				// 服务质量
//u_short tlen;				// 总长度
//u_short identification;	// 身份识别
//u_short flags_offset;		// 标识 分组偏移
//u_char ttl;				// 生命周期
//u_char proto;				// 协议类型
//u_short checksum;			// 包头测验码
//u_int saddr;				// 源IP地址
//u_int daddr;				// 目的IP地址
void ip_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content, int direction, bpf_u_int32 len)
{
	ip_header *ip_protocol;
	struct sockaddr_in source, dest;
	char sourceIP[MAX_ADDR_LEN], destIP[MAX_ADDR_LEN];

	ip_protocol = (ip_header*)(pkt_content + 14);
	source.sin_addr.s_addr = ip_protocol->saddr;
	dest.sin_addr.s_addr = ip_protocol->daddr;
	strncpy(sourceIP, inet_ntoa(source.sin_addr), MAX_ADDR_LEN);
	strncpy(destIP, inet_ntoa(dest.sin_addr), MAX_ADDR_LEN);

	/*
	printf("===================IP Protocol==================\n");
	printf("Version: %d\n", ip_protocol->version_hlen >> 4);
	printf("Header Length: %d bytes\n", (ip_protocol->version_hlen & 0x0f) * 4);
	printf("Tos: %d\n", ip_protocol->tos);
	printf("Total Length: %d\n", ntohs(ip_protocol->tlen));
	printf("Identification: 0x%.4x (%i)\n", ntohs(ip_protocol->identification), ntohs(ip_protocol->identification));
	printf("Flags: %d\n", ntohs(ip_protocol->flags_offset) >> 13);
	printf("---Reserved bit: %d\n", (ntohs(ip_protocol->flags_offset) & 0x8000) >> 15);
	printf("---Don't fragment: %d\n", (ntohs(ip_protocol->flags_offset) & 0x4000) >> 14);
	printf("---More fragment: %d\n", (ntohs(ip_protocol->flags_offset) & 0x2000) >> 13);
	printf("Fragment offset: %d\n", ntohs(ip_protocol->flags_offset) & 0x1fff);
	printf("Time to live: %d\n", ip_protocol->ttl);
	printf("Protocol Type: ");*/
	switch (ip_protocol->proto)
	{
	case 1:
		printf("ICMP");
		break;
	case 6:
		printf("TCP:");
		updateData(direction, len);

		break;
	case 17:
		printf("UDP");
		break;
	default:
		break;
	}
	printf(" (%d)\n", ip_protocol->proto);
	//printf("Header checkSum: 0x%.4x\n", ntohs(ip_protocol->checksum));
	printf("Source: %s\n", sourceIP);
	printf("Destin: %s\n", destIP);
	/*
	if (ip_protocol->proto == htons(0x0600))
		tcp_protocol_packet_handle(arg, pkt_header, pkt_content);
	else if (ip_protocol->proto == htons(0x1100))
		udp_protocol_packet_handle(arg, pkt_header, pkt_content);
	else if (ip_protocol->proto == htons(0x0100))
		icmp_protocol_packet_handle(arg, pkt_header, pkt_content);
	*/
}

// Ethernet协议处理
void ethernet_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content, bpf_u_int32 len)
{
	ether_header *ethernet_protocol;//以太网协议
	u_short ethernet_type;			//以太网类型
	u_char *mac_string;				//以太网地址
	char src[128] = { 0 };
	char dst[128] = { 0 };

	int direction = 0;
									//获取以太网数据内容
	ethernet_protocol = (ether_header*)pkt_content;
	ethernet_type = ntohs(ethernet_protocol->ether_type);

	printf("==============Ethernet Protocol=================\n");

	//以太网目标地址
	mac_string = ethernet_protocol->ether_dhost;

	printf("Dest Mac Address: %02X-%02X-%02X-%02X-%02X-%02X\n",
		*mac_string,
		*(mac_string + 1),
		*(mac_string + 2),
		*(mac_string + 3),
		*(mac_string + 4),
		*(mac_string + 5));

	sprintf(dst, "%02X-%02X-%02X-%02X-%02X-%02X", *mac_string,
		*(mac_string + 1),
		*(mac_string + 2),
		*(mac_string + 3),
		*(mac_string + 4),
		*(mac_string + 5));

	//以太网源地址
	mac_string = ethernet_protocol->ether_shost;

	printf("Source Mac Address: %02X-%02X-%02X-%02X-%02X-%02X\n",
		*mac_string,
		*(mac_string + 1),
		*(mac_string + 2),
		*(mac_string + 3),
		*(mac_string + 4),
		*(mac_string + 5));

	sprintf(src, "%02X-%02X-%02X-%02X-%02X-%02X", *mac_string,
		*(mac_string + 1),
		*(mac_string + 2),
		*(mac_string + 3),
		*(mac_string + 4),
		*(mac_string + 5));

	//判断数据方向
	if (strcmp(dst, macaddr) == 0) {
		direction = RECV_DIR;
	}
	if (strcmp(src, macaddr) == 0) {
		direction = SEND_DIR;
	}

	printf("Ethernet type: ");
	switch (ethernet_type)
	{
	case 0x0800:
		printf("%s", "IP");
		break;
	case 0x0806:
		printf("%s", "ARP");
		break;
	case 0x0835:
		printf("%s", "RARP");
		break;
	default:
		printf("%s", "Unknown Protocol");
		break;
	}
	printf(" (0x%04x)\n", ethernet_type);

	switch (ethernet_type)
	{
	case 0x0800:
		ip_protocol_packet_handle(arg, pkt_header, pkt_content, direction, len);
		break;
	case 0x0806:
		//arp_protocol_packet_handle(arg, pkt_header, pkt_content);
		break;
	case 0x0835:
		//printf("==============RARP Protocol=================\n");
		//printf("RARP\n");
		break;
	default:
		//printf("==============Unknown Protocol==============\n");
		//printf("Unknown Protocol\n");
		break;
	}
}



int main(int argc, char** argv)
{
	pcap_if_t *alldevs;	//适配器列表,它是一个链表的数据结构
	pcap_if_t *d;		//保存某个适配器
	pcap_t *fp;
	int res;
	struct pcap_pkthdr *header;
	const u_char *pkt_data;
	time_t local_tv_sec;
	struct tm *ltime;
	char timestr[16];

	int count = 1;
	int i = 0, inum;
	char errbuf[PCAP_ERRBUF_SIZE];

	if (argc < 2) return -1;

	strcpy_s(macaddr, argv[1]);


	printf("===============Adapter List===============\n");

	//获取本地设备列表
	if (pcap_findalldevs(&alldevs, errbuf) == -1)
	{
		fprintf(stderr, "Error in pcap_findalldevs: %s\n", errbuf);
		exit(1);
	}

	//输出列表
	for (d = alldevs; d != NULL; d = d->next)
	{
		printf("%d. %s", ++i, d->name);
		if (d->description)
			printf(" (%s)\n", d->description);
		else
			printf(" (No description available)\n");
	}

	if (i == 0)
	{
		printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
		return -1;
	}

	//获取选择编号
	while (1)
	{
		printf("\nEnter the interface number (1-%d): ", i);
		scanf("%d", &inum);

		if (inum > 0 && inum <= i)
			break;
	}

	//跳到用户选择的适配器
	for (d = alldevs, i = 0; i < inum - 1; ++i, d = d->next);

	//打开适配器
	if ((fp = pcap_open_live(d->name, 65536, 1, 1000, errbuf)) == NULL)
	{
		fprintf(stderr, "\nError openning adapter: %s\n", errbuf);
		pcap_freealldevs(alldevs);
		return -1;
	}

	//检查链路层的类型
	if (pcap_datalink(fp) != DLT_EN10MB)
	{
		fprintf(stderr, "This program only run on Ethernet networks\n");
		pcap_close(fp);
		pcap_freealldevs(alldevs);
		return -1;
	}

	printf("The program is working......\n");
	//printf("The capture file is saving as 'data.txt'\n");
	printf("You can input 'ctrl + C' to stop the program\n");

	//if ((file = freopen("data.txt", "w", stdout)) == 0)
	//	printf("Cannot open the file.\n");

	while ((res = pcap_next_ex(fp, &header, &pkt_data)) >= 0)
	{
		//超时
		if (res == 0)
			continue;

		//将时间戳转化为可识别格式
		local_tv_sec = header->ts.tv_sec;
		ltime = localtime(&local_tv_sec);
		strftime(timestr, sizeof(timestr), "%H:%M:%S", ltime);

		//输出编号、时间戳和包长度
		printf("==============================================================================\n");
		printf("No.%d\ttime: %s\tlen: %ld\n", count++, timestr, header->len);
		printf("==============================================================================\n");

		/*
		char temp[LINE_LEN + 1];
		//输出包
		for (i = 0; i < header->caplen; ++i)
		{
			printf("%.2x ", pkt_data[i]);
			if (isgraph(pkt_data[i]) || pkt_data[i] == ' ')
				temp[i % LINE_LEN] = pkt_data[i];
			else
				temp[i % LINE_LEN] = '.';

			if (i % LINE_LEN == 15)
			{
				temp[16] = '\0';
				printf("        ");
				printf("%s", temp);
				printf("\n");
				memset(temp, 0, LINE_LEN);
			}
		}*/
		printf("\n");

		//分析数据包
		ethernet_protocol_packet_handle(NULL, header, pkt_data, header->len);
	}

	if (res == -1)
	{
		printf("Error reading the packets: %s\n", pcap_geterr(fp));
		pcap_close(fp);
		pcap_freealldevs(alldevs);
		fclose(stdin);
		if (file)
			fclose(file);
		return -1;
	}

	//释放
	pcap_close(fp);
	pcap_freealldevs(alldevs);
	fclose(stdin);
	if (file)
		fclose(file);

	return 0;
}

代码里能获取IP头, TCP/UDP头, 数据包的内容,可以做任何自己想做的事情。

自制网络工具集合(抓包,扫描主机,扫描端口,获取本机信息,dos攻击) 网络工具集1.shark抓包工具(1).数据包格式(2).系统协议的类型(3).原始套接字 1.shark抓包工具 (1).数据包格式 (2).系统协议的类型 (3).原始套接字 抓包工具 获取链路层的数据包,手动层层解析,对链路层,网络层,传输层的报头格式有更加深入的理解。 首先从网络层抓取的包都是这个样子的 ... 阅读详情

相关推荐

游戏抓包工具制作(三)——添加简单界面与功能扩展

在之前的文章中,我们搭建了一个基础的代理脚本,使得客户端能够通过它登录游戏。然而,这个脚本过于简洁,且在运行过程中缺乏交互性。为了满足未来可能出现的更多需求,比如随时随地进行操作,之前的脚本显然无法胜任。因此,我们需要对它进行功能拓展,为其设计一个用户界面。

2501_91395274的博客 1251

这么简单的抓包神器?15块钱?两块钱就搞定!

0x01 前 今天带各位来了解一下淘宝上卖15+的一个抓包神器,我们剖析一下这个工具。 这个工具的名称叫LAN Tap,是hack5的一个非常简单的开源硬件。别看他叫做神器,其实比之前我们做的BadUSB还要便宜一些。 最近也有很多小伙伴想看USB killer,这个东西是比较危险,怕你们拿去乱用,就一直没有做,电路也是早已画好。 0x02 中 所以,我们现在开始我们的“抓包神器”: 可以看到,在hack5上已经卖光了。不过,我们自己用的话,肯定是越小越好。所以我...

Moxin1044的博客 1765

证书的详细探究,以及抓包工具为什么要导入自己的证书

文章目录证书的详细探究,以及抓包工具为什么要导入自己的证书1.为什么要用证书?2.什么是证书3.抓包软件为什么要导入证书 证书的详细探究,以及抓包工具为什么要导入自己的证书 1.为什么要用证书? 知道什么是证书之前需要了解下 “非对称加密” 对称加密:客户端和服务器用一个秘钥加密和解密,效率高 非对称加密:将公钥公布于众,客户端拿公钥加密,服务器拿自己的私钥解密,这样即使数据被截获,别人也解密不出明文内容,效率低。 ​ 非对称加密有两个秘钥,公钥和私钥,而这两个秘钥只要用一个加密,另一个就能解

em..... 5045

自己动手写网络抓包工具

看了太多的“自己动手”,这次咱也“自己动手”一下,写个简单的网络抓包工具吧。要写出像tcpdump和wireshark(ethereal)这样的大牛程序来,咱也没那能耐,呵呵。所以这个工具只能抓取本地IP数据报,同时它还使用了BPF,目的是了解如何进行简单有效的网络抓包。当打开一个标准SOCKET套接口时,我们比较熟悉的协议往往是用AF_INET来建立基于TCP(SOCK_STREAM)或UDP(

wangxg_7520的专栏 1万+

自制个性化的网络数据捕获工具——硬件开发

通过选择合适的硬件平台、正确连接硬件并进行软件开发,我们可以制作出个性化的网络数据抓包工具。在本文中,我们使用树莓派作为硬件平台,并使用Python编程语言和Scapy库进行软件开发。当然,这只是一个简单的示例,你可以根据自己的需求和兴趣进一步扩展和改进这个抓包工具。请注意,在实际的网络环境中,使用抓包工具需要遵守法律和道德规范。确保你有合法的权限和目的,并且使用抓包工具的过程中不会侵犯他人的隐私或者网络安全。希望这篇文章能够帮助你制作自己的个性化抓包工具。祝你好运!

DrezGcp的博客 757

15个免费好用的抓包工具

1. Hping Hping是最受欢迎和免费的抓包工具之一。它允许你修改和发送自定义的ICMP,UDP,TCP和原始IP数据包。此工具由网络管理员用于防火墙和网络的安全审计和测试。 HPing可用于各种平台,包括Windows,MacOs X,Linux,FreeBSD,NetBSD,OpenBSD和Solaris。 下载Hping: http://www.hping.org/ 2. Os...

日常笔记/总结/系列知识梳理 13万+

开源硬件USB抓包及协议分析工具分享

USB抓包工具属于小众产品,开源的就更少了!! USB抓包工具分为纯软件的和硬件的两种,纯软件usb抓包工具需要在系统能正确枚举usb设备的前提下才能让内核的钩子函数捕抓到数据,而后者在usb不正常时也能捕捉到链路数据(令牌包等),属于更底层的抓包方式。 一、我用过的并且好用的纯软件USB抓包工具有: 1.USBlyzer(能很方便的帮你分析出HID报告描述符等等) 2.Bus Hound...

mkelehk的专栏 4万+

Altium Designer 21 DRC检查:从新手到高手,这10个常见错误你踩过几个?

本文详细解析Altium Designer 21 DRC检查中的10个高频错误,包括间距违规、线宽违规、未连接网络等常见问题,并提供精准修复方案和实战技巧。通过分层诊断、智能规则设置和三维排查等方法,帮助工程师从新手进阶为高手,提升PCB设计效率和质量。

weixin_26873711的博客 221

使用CC2652RB-Launchpads制作zigbee抓包工具

1.前言 开发 zigbee、ble这类无线通信,一般都需要一个辅助的抓包工具帮助我们分析协议,查找问题。 ubiqua 作为第三方抓包工具的翘楚,在易用性方面一骑绝尘;但是 它是个收费软件,而且巨贵,一个月 65美刀…… 下面介绍一下TI提供的SmartRF 数据包监听器,免费,易用: PACKET-SNIFFER官方已不再维护更新,所以推荐使用官方的SmartRF Packet Sniffer 2 2.TI-SmartRF PACKET-SNIFFER-2 1 简介 SmartRF 数据包监听器 2

荻夜的博客 1607

详解电路设计中的RC电路

​ 一、什么是RC电路 RC电路是指由电阻R和电容C组成的电路,它是脉冲产生和整形电路中常用到 的电路。 常见的RC充、放电电路、RC积分电路合RC微分电路接下来详细讲解。 二、RC充、放电电路 RC充、放电电路如下图所示,下面通过充电和放电两个过程来分析此电路。 ​RC充、放电电路图 (1)RC充电电路 RC充电电路图如下图(a)所示 RC充电电路图及充电曲线图 ​由上图分析: 将上图a中开关S置于“1”处,电源E开始通过电阻R对电容C充电,由于刚开始充电时电容两端没有..

IT xiaobai 4万+

给MATLAB安装runtime插件

输入你刚刚下载压缩包的位置(小白提示:在 此电脑 中找到压缩包位置,右键属性复制位置)(!设置好以后然后填写下面输出exe文件的信息,包括文件的名字、作者、Email、公司、概述、描述,下面还可以选择额外的安装选项,exe文件运行需要的其他文件(图像、子程序等)、提供给用户的文件(readme.txt等)(很多方法是官网下载,但在官网下载还是会版本不对应,所以直接在你所用的MATLAB里搜索安装链接最靠谱)(!5.可以打包程序了(你发送文件的人电脑里没有MATLAB也可以查看运行你的程序了)

Pei_hua100的专栏 1万+

2025抓包工具Reqable手机抓包HTTPS亲测简单好用

 自安卓7.0高版本系统不在信任用户证书,https抓包方式市面查找方法太过复杂手机要root等,前置条件要求太高太复杂,看的头痛,今天一台电脑按步骤操作完即可抓包https,给大家搞定抓包https问题。支持直接编辑修改请求参数方便我们进行调试!!!

weixin_44556848的博客 1万+

算法-基于MACD的Adaboost股价涨跌预测模型

MACD是一个指标,具体用法是MACD>0看涨,反之看跌,果真是这样的吗?由于所有的技术指标都基于对历史数据的统计,指标的滞后性也就难免,有时候MACD明明大于0,股价仍然跌,有时候macd小于0,股价仍然涨。 本文基于Adaboost算法提出了一种基于macd的线性阀值分类器作为若分类器,通过在限定的解空间内寻找使得错误率最小的阀值和偏置,这样做避免了训练若分类器的复杂性,经验证,这种方法有效。

mtaxot的博客 8022

Android 联网监控抓包工具的制作(tcpdump的使用)

最近做一个Android联网抓包的工具自己在网上搜索了好久发现还是没有头绪于是考虑在linux层上下功夫于是采用linux的tcpdump来实现了抓包的功能用简单的话来定义tcpdump,就是:dump the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具。  作为互联网上经典的的系统管理员必备工具,tcpdump以其强大的功能,灵活的截取策略,成为每个高级的系统管理员分析网络,排查问题等所必备的东东之一。对于tcpdump详细的可以参考http://bai

Zy的技术心得 3万+

银行监管报送系统介绍(十五):金融审计平台

金审平台主要包括基础、财务、结算、信贷和中间业务五大板块,主要服务于审计署对中国银行的各项审计任务,同时也可为行内审计、稽核检查、数据分析、总分行提供基础数据服务,为实现基础数据共享提供了有力的数据保障。2019年1月某全国性股份制商业银行收到审计署2019-23号文,文中指出为进一步提高审计数据质量,审计署审计组派员前往9家重点商业银行,就完善标准化数据的相关情况与各银行有关部门进行讨论协商。关于数据报送频率及报送内容:数据从2019年4月开始,按月报送,即于每月25日之前报送上月数据;

银行信息系统应用架构详解 2052

Python爬虫:实时交通流量数据爬取与路况分析

随着城市化进程的不断推进,交通流量的管理与预测已成为智能交通系统的重要研究方向。交通流量数据不仅为城市交通管理提供了科学依据,还为驾驶员提供了实时路况信息,帮助其做出更加合理的出行决策。通过爬虫技术,我们可以实时获取城市的交通流量数据,从而分析路况,优化交通管理。在这篇博客中,我们将介绍如何使用Python编写一个爬虫来爬取实时交通流量数据,分析道路的交通状况。我们将使用最新的技术工具来构建爬虫,包括。

2201_76125261的博客 1267

linux 抓包工具_常用的抓包工具包含电脑端及手机端

浏览器抓包工具浏览器自带F12功能,日常可能够用,但有些功能可能满足不了。HttpwatchIE下强大的网页数据分析工具FlidderFiddler是位于客户端和服务器端的HTTP代理,也是目前最常用的http抓包工具之一 。 它能够记录客户端和服务器之间的所有HTTP请求,可以针对特定的HTTP请求,分析请求数据、设置断点、调试web应用、修改请求的数据,甚至可以修改服务器返回的数据,功能非常强...

weixin_39901558的博客 1281

Unreal5从入门到精通之如何解决在VR项目在头显中卡顿的问题

以前我们使用Unity开发VR,Unity提供了非常便利的插件和工具来做VR。但是由于Unity的渲染效果不如Unreal,现在我们改用Unreal来做VR了,所有的VR相关的配置和操作都要重新学习。今天就来总结一下,我在开发VR过程中碰到的所有问题。好了,以上就是我目前做VR时碰到的一些问题,希望对你有所帮助。

TxNet 2480

https抓包与防抓包

抓包工具 Charles Fiddler Charles使用 下载 PC端安装Charles根证书 help–>SSLProxying–>Install Charles Root Ceriticate 安装Charles根证书到手机 help–>SSLProxying–>Install Charles Root Ceriticate on a Mobile Devic...

吓成一坨兔子 1万+

libVLC 视频抓图

libVLC 中通过libvlc_video_take_snapshot核心接口来截图。以下是VLC播放器中使用的截图界面,我们仿照这个做一个界面。首先,你需要初始化 libVLC 实例和媒体播放器对象。1. 初始化 libVLC 和媒体播放器。菜单添加action,并响应槽函数。生成目录下snap.png。

希望能帮助大家,希望大家多多支持,你们的支持是我前进的动力。 1938

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

网络安全入门必选:十款免费的抓包工具有哪些?

下面给大家推荐几款好用的免费的抓包工具软件,有需要的小伙伴们来了解一下。

wananxuexihu的博客 1万+

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

【网络安全必看】十款免费的抓包工具有哪些?

网络安全入门之:十款免费的抓包工具有哪些?

2301_77472496的博客 2614

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

常用的几款抓包工具,你确定用过

其实抓包工具并没有什么很难的工具,只要你知道你要用抓包是干嘛的,就知道该怎么用了!一般对于测试而言,并不需要我们去做断点或者是调试代码什么的,只需要用一些抓包工具抓取发送给服务器的请求,观察下它的请求时间还有发送内容等等,有时候,可能还会用到这个去观察某个页面下载组件消耗时间太长,找出原因,要开发做性能调优。那么下面就给大家推荐几款抓包工具,好好学习下,下次面试也可以拿来装一下了!

秋̶᭄ꦿ攻城狮࿆ྂ 2198

抓包工具 fiddler

HTTP代理 所谓的http代理其实就是代理客户机的http访问,主要代理浏览器访问页面 代理服务器是介于浏览器和web服务器之间的一台服务器,有了它之后浏览器不是直接到web服务器去取回网页而是向代理服务器发出请求,Request信号会先送到代理服务器,由代理服务器来取回浏览器所需要的信息并传送给你的浏览器 利用socket开发一个简易版HTTP代理服务器 import socket impo...

xiaogeldx的博客 1051
上一篇: 错误解决:process_begin: CreateProcess 系统找不到指定的文件
下一篇: DesktopUI与ZeroTierOne的数据交互机制分析
langeldep
博客等级 码龄17年 1370粉丝 186原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

langeldep

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值