TCP/IP笔记
基础
| col1 | col2 | |
|---|---|---|
| 应用层 | Telnet、FTP、HTTP | |
| 运输层 | TCP和UDP | 端口号:确定交给哪个进程。 |
| 网络层 | IP、ICMP、IGMP | IP地址:确定交给哪个电脑。 |
| 链路层 | 设备驱动及接口卡 |
的
| TCP应用 | UDP应用 |
|---|---|
| 的 | |
DPI深度包检测(deep packet inspection)
| col1 | col2 | 简写 | 十六进制字母 | |||
|---|---|---|---|---|---|---|
| 1 bit | 比特位 | 1位长 | 小写的b | |||
| 1 Byte | 字节 | 1字节长 | 8位长 | 大写的B | 6F 0110 1111 | |
| WORD | 字 | 2字节长 | 16位长 | 6F4C 0110 1111 0100 1100 | ||
| DWORD | 双字 | 4字节长 | 32位长 | 6F4C 8D2A | ||
| char | 字符型变量 | 1个字节 | ||||
| ASCII字符 | \x41 表示A,4*16+1=65的ASCII码 | |||||
| Unicode字符 | 取决于 编码方式 |
|||||
| UTF-8编码 情况下 |
占1到 4个字节 |
|||||
| UTF-16编码 情况下 |
大部分 2个字节 |
|||||
| UTF-32编码 情况下 |
固定 4个字节 |
⭐运输层,使用端口号区分不同的应用进程。
网络传输中的三张表,MAC地址表、ARP缓存表以及路由表
MAC表:记录着局域网主机MAC地址与交换机接口的对应关系的表。交换机根据MAC表转发数据帧。
ARP缓存表:每台主机中都有一张ARP表,它记录着主机的IP地址和MAC地址的对应关系。将IP地址解析为MAC地址。
路由表:路由器中也有一张表,记录着到不同网段的信息。负责不同网络之间的通信。
netsh实现出口IP更换
管理员模式
Run cmd.exe as Administrator.
查看网卡,环路第一个
netsh int ip sh int and press "Enter".
Identify your loopback Idx (first column).
添加
netsh int ip add addr
In my case, with IDX=1 I exec:
netsh int ip add addr 1 12.12.12.12/32 st=ac sk=tr
删除
netsh int ip delete addr
验证:tracert -d 146.112.61.106
只有一跳就对了。
st=ac stands for store = active. This means the IP address you are adding to the loopback adapter will automatically disappear upon the next boot of the system. If you need to keep the changes, then change the argument to st=persistent.
sk=tr stands for skipassource = true. The man page reads: “skipassource: Do not use the address as source address for any outgoing packet unless explicitly specified. The default value is false.”
IP重定向
API HOOK(区别Windows)和LSP来做的,现在的程序或者游戏好多都有保护,所以以前的方法不可行了。
消息钩子****windows hook:是截获程序中的消息或事件的。
API钩子:是拦截目标程序中调用的函数,替换或者修改调用函数的功能。
LSP Layered Service Provider:要使我们上一步实现的转发协议生效,还必须将上一步生成的DLL安装到用户的系统上。只有安装了LSP,应用程序在调用ws2_32.dll中的函数时就会执行到我们的LSP的DLL中。
wfp (windows filter platform)开发TCP重定向:

浙公网安备 33010602011771号