Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check dns packet (test part) #18

Closed
lix5027 opened this issue Feb 3, 2015 · 7 comments
Closed

check dns packet (test part) #18

lix5027 opened this issue Feb 3, 2015 · 7 comments
Labels

Comments

@lix5027
Copy link

lix5027 commented Feb 3, 2015

check dns packet函数貌似下面这句有点问题
test = (ip_len == '\x00\x04' and answer_class == '\x00\x01' and
answer_type == '\x00\x01')

比如我nslookup tv.sohu.com 211.167.230.100
时候会得到2行ipv6地址,1行ipv4地址(118.244.253.88)

但是用到tcpdns.py代理中,check函数会把这行ipv4地址test不通过,导致转发给客户的时候丢失了ipv4地址.

请帮忙看一下test函数是否有问题,谢谢!

@henices
Copy link
Owner

henices commented Feb 3, 2015

能否用wireshark抓个包,放上来看看。另外使用的是TCP的DNS报文转发,还是UDP的DNS报文转发?

@lix5027
Copy link
Author

lix5027 commented Feb 3, 2015

是UDP,稍等我去尝试下抓包

@henices
Copy link
Owner

henices commented Feb 3, 2015

我这里抓包看了下,估计是有问题。

@henices henices added the Bug label Feb 3, 2015
@lix5027
Copy link
Author

lix5027 commented Feb 3, 2015

好像无法上传cap文件? 查询时候会有一条type A 和一条tpyeAAA AAA里面有ipv6信息,这个没问题
typeA 里包含了ipv4的反馈地址, dns用 211.167.230.100 的type A包就会被check函数过滤掉
用dns114.114.114.114 到是没问题.

不知道是哪里出错了
dns packet

henices added a commit that referenced this issue Feb 3, 2015
@henices
Copy link
Owner

henices commented Feb 3, 2015

commit 3d75ead , 测试一下

@lix5027
Copy link
Author

lix5027 commented Feb 3, 2015

测试通过,OK了,老大真乃神速!赞!

@henices
Copy link
Owner

henices commented Feb 3, 2015

没有判断ipv6地址的情况,现在加了判断。

@henices henices closed this as completed Feb 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants