资源简介
linux 下 tcp报文 劫持工具 hunt 1.5 的源码包 ,希望大家下载

代码片段和文件信息
/*
*
* This is free software. You can redistribute it and/or modify under
* the terms of the GNU General Public License version 2.
*
* Copyright (C) 1998 by kra
*
*/
#include “hunt.h“
#include
#include
#include
#include
#include
struct list l_add_policy = LIST_INIT(struct add_policy_info next);
int conn_add_match(unsigned int src_addr unsigned int dst_addr
unsigned short src_port unsigned short dst_port)
{
struct list_iterator li;
struct add_policy_info *api;
int retval = 0;
list_lock(&l_add_policy);
list_iter_set(&li &l_add_policy);
while ((api = list_iter_get(&li))) {
if ((src_addr & api->src_mask) == api->src_addr &&
(dst_addr & api->dst_mask) == api->dst_addr &&
port_match(src_port api->src_ports) &&
port_match(dst_port api->dst_ports)) {
retval = 1;
break;
}
if ((src_addr & api->src_mask) == api->dst_addr &&
(dst_addr & api->dst_mask) == api->src_addr &&
port_match(src_port api->dst_ports) &&
port_match(dst_port api->src_ports)) {
retval = 1;
break;
}
}
list_iter_end(&li);
list_unlock(&l_add_policy);
return retval;
}
int conn_add_policy(struct iphdr *iph struct tcphdr *tcph)
{
return conn_add_match(iph->saddr iph->daddr tcph->source tcph->dest);
}
void add_telnet_rlogin_policy(void)
{
struct add_policy_info *api;
api = malloc(sizeof(struct add_policy_info));
assert(api);
memset(api 0 sizeof(sizeof(struct add_policy_info)));
api->src_addr = 0;
api->src_mask = 0;
api->dst_addr = 0;
api->dst_mask = 0;
api->src_ports[0] = 0;
api->dst_ports[0] = htons(23);
api->dst_ports[1] = htons(513);
api->dst_ports[2] = 0;
list_push(&l_add_policy api);
};
static void addpolicy_item_print(int i struct add_policy_info *api)
{
char buf_src_ports[BUFSIZE] buf_dst_ports[BUFSIZE];
char host_buf[BUFSIZE];
sprintf_db_ports(api->src_ports buf_src_ports sizeof(buf_src_ports) 1);
sprintf_db_ports(api->dst_ports buf_dst_ports sizeof(buf_dst_ports) 1);
sprintf(host_buf “%s/%d [%s]“ host_lookup(api->src_addr hl_mode)
count_mask(api->src_mask) buf_src_ports);
printf(“%2d) %-32s <--> %s/%d [%s]\n“ i
host_buf
host_lookup(api->dst_addr hl_mode) count_mask(api->dst_mask)
buf_dst_ports);
}
void addpolicy_list_items(void)
{
struct list_iterator li;
struct add_policy_info *api;
int i = 0;
list_iter_set(&li &l_add_policy);
while ((api = list_iter_get(&li))) {
addpolicy_item_print(i++ api);
if (i % lines_o == 0)
lines_o_press_key();
}
list_iter_end(&li);
}
void addpolicy_add_item(void)
{
struct add_policy_info *api;
unsigned int src_ip dst_ip;
unsigned int src_mask dst_mask;
int src_ports[MAX_PORTS + 1] dst_ports[MAX_PORTS + 1];
int nr;
if (menu_choose_host_mask_ports_dfl(“src ip addr/mask ports“ &src_ip
&src_mask src_ports 0 0 NULL) < 0)
return;
if (menu_choose_host_mask_ports_dfl(“dst ip addr/mask p
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5067 1999-02-13 20:23 hunt-1.5\addpolicy.c
文件 7165 1999-06-13 22:53 hunt-1.5\arphijack.c
文件 39877 2000-05-26 19:29 hunt-1.5\arpspoof.c
目录 0 2018-08-30 09:24 hunt-1.5\c\
文件 5860 1998-09-20 18:33 hunt-1.5\c\array.c
文件 1212 1998-09-20 18:33 hunt-1.5\c\array.h
文件 10599 2000-02-16 17:26 hunt-1.5\c\hash.c
文件 1588 1998-09-20 18:33 hunt-1.5\c\hash.h
文件 11531 2000-05-26 20:55 hunt-1.5\c\list.c
文件 2532 1998-12-03 04:01 hunt-1.5\c\list.h
文件 482 1998-09-11 18:46 hunt-1.5\c\Makefile
文件 503 1998-09-10 01:47 hunt-1.5\c\spinlock.h
文件 3375 2000-05-30 21:04 hunt-1.5\CHANGES
文件 17983 1998-10-25 21:14 hunt-1.5\COPYING
文件 7857 1998-11-10 05:15 hunt-1.5\hijack.c
文件 8931 1999-06-03 18:10 hunt-1.5\hostup.c
文件 24970 2000-05-26 21:56 hunt-1.5\hunt.c
文件 17706 2000-05-30 20:54 hunt-1.5\hunt.h
文件 313 1999-06-18 21:25 hunt-1.5\INSTALL
文件 6249 1999-02-22 03:21 hunt-1.5\macdisc.c
文件 12173 2000-05-26 22:06 hunt-1.5\main.c
文件 859 1999-09-02 16:33 hunt-1.5\Makefile
目录 0 2018-08-30 09:24 hunt-1.5\man\
文件 26877 1999-10-04 17:56 hunt-1.5\man\hunt.1
文件 12493 1999-06-07 00:04 hunt-1.5\menu.c
文件 7673 1999-06-08 20:18 hunt-1.5\net.c
文件 6187 2000-05-30 20:55 hunt-1.5\options.c
文件 10771 1999-11-12 18:09 hunt-1.5\pktrelay.c
文件 26938 2000-05-30 21:10 hunt-1.5\README
文件 11141 2000-05-30 20:16 hunt-1.5\README.tp
文件 11986 1999-02-14 20:59 hunt-1.5\resolv.c
............此处省略14个文件信息
相关资源
- Omron ETN21模块进行modbustcp通讯
- 组态王中S7-300TCP驱动
- 基于Apache Mina实现的TCP长连接和短连接
- CVI下的TCP服务器和客户端
- 代码客:G-TcpServer(IOCP) 1.0 正式版及
- TCP 发包工具(windows)
- VxWorks TCPIP协议栈
- socket小工具(可方便建立TCP UDP的soc
- vc 编写的基于TCP协议的客户/服务器
- 基于CSocket的多人聊天室
- 采用WINSOCK2 编写的TCP/UDP通信程序
- Modbus TCP Client
- 易语言 TCP使用HTTP、SOCKES5代理IP。
- 西门子S7-1200 MODBUS-TCP通讯编程
- 200SMART Modbus-TCP通信程序演示-轮询(多
- TCP_UDP对结构体加密数据传输
- 基于PIC的TCP/IP网络协议和zigbee无线传
- 欧姆龙PLC tcp通信工具
- 欧姆龙以太网通讯TCP/UDP及欧姆龙PLC程
- 流媒体相关协议标准RTP/RTSP/RTCP PDF文档
- 航海模拟器中DCPA TCPA的算法
- TCPMP 支持ce6.0的播放器
- TCP/IP协议详解3卷全_高清_带书签
- stm32103c8t6ESP8266串口转WIFI模块TCP服务器
- DOS下的TCP-IP协议库文件原代码.rar
- 《TCP/IP详解卷2:实现》pdf
- 《TCP/IP:协议分析与应用编程》课后
- Modbus—TCP协议
- 计算机网络socket编程实验
- FANUC机器人Socket Message通讯设置及使用
评论
共有 条评论