python - 路由器不响应欺骗性 DNS 查询
问题描述
我正在编写一个带有 scapy 的 Python 脚本来欺骗 DNS 查询的地址。到目前为止,路由器没有回复欺骗性查询。
我已将 IP 和 MAC 地址设置为在脚本上匹配,并且非欺骗性 DNS 请求工作正常。
这是脚本。
from scapy.all import *
packet=sendp(Ether(src="B0:70:2D:CF:4D:8F")/IP(id=random.randint(0, 0xFFFF),dst="192.168.0.1",src="192.168.0.123")/UDP(dport=53,sport=11333)/DNS(id=random.randint(0, 0xFFFF),rd=1,qd=DNSQR(qname="www.duckduckgo.org")))
这是数据包捕获
Frame 323: 78 bytes on wire (624 bits), 78 bytes captured (624 bits) on interface wlp0s20f0u9, id 0
Ethernet II
Destination: <DNS Server>
Source: <Spoofed MAC Address>
Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.0.123, Dst: 192.168.0.1
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
Total Length: 64
Identification: 0xfd74 (64884)
Flags: 0x0000
Fragment offset: 0
Time to live: 64
Protocol: UDP (17)
Header checksum: 0xfb6b [correct]
[Header checksum status: Good]
[Calculated Checksum: 0xfb6b]
Source: 192.168.0.123
Destination: 192.168.0.1
User Datagram Protocol, Src Port: 11333, Dst Port: 53
Source Port: 11333
Destination Port: 53
Length: 44
Checksum: 0x89a7 [correct]
[Checksum Status: Good]
[Stream index: 20]
[Timestamps]
Domain Name System (query)
Transaction ID: 0x404c
Flags: 0x0100 Standard query
Questions: 1
Answer RRs: 0
Authority RRs: 0
Additional RRs: 0
Queries
Destination: 192.168.0.1
解决方案
推荐阅读
- python - Python 3中列表交集中的模式匹配
- java - Websocket 安全定义不起作用
- node.js - 如何以编程方式在 azure 中创建 Web App bot?
- javascript - json 数据在变量中并显示在表中
- angular - 无法在 Firebase 上托管我的 Angular 应用程序
- sql - Hive SQL - 获取重叠日期的最小和最大日期
- c# - 获取字符串数组的所有数据 c# (Unity)
- salt-stack - salt '*' win_wua.available 返回未知失败
- javascript - Angular / Typescript无法设置未定义的属性“数据”
- javascript - Nodejs Parse 获取包含对象 [Symbol(map)] 的响应