从Github被干扰想到DNS安全

246 views
Skip to first unread message

AleiPhoenix (A.K.A Areverie)

unread,
Jan 21, 2013, 6:17:20 AM1/21/13
to sh...@googlegroups.com
Hi, all

大家知道近几天人类伟大的发明Github被邪恶的GFW给认证了,不同地区出现的情况不太一样

月光博客上的说法普遍比较认同,github本身成关键字

https仍然可以访问(但是DNS污染还能上只是因为缓存还没过期?)

魔都电信这里除了关键字外还受到不同程度的DNS污染干扰

获得是59.24.3.173 这个IP

即使使用自己在墙外搭建的DNS仍然不能幸免遇难


因此想到了DNS的安全问题,有大大能解释一下DNS污染以及如何预防吗?

网上找到了几个所谓防污染的工具,要么不公布源代码要么不公布识别方式...

而另外DNSSec这个规范貌似也还不成熟



暂时某只能让DNS请求都走openvpn通道了...

--
Silence is golden.

twitter: @areverie
wikipedia: AleiPhoenix
blog: weblog.areverie.org
wiki: wiki.areverie.org

Jiajun Wang

unread,
Jan 21, 2013, 8:21:43 AM1/21/13
to shlug
可以试试 dnscrypt-proxy。

> --
> -- You received this message because you are subscribed to the Google Groups
> Shanghai Linux User Group group. To post to this group, send email to
> sh...@googlegroups.com. To unsubscribe from this group, send email to
> shlug+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/shlug?hl=zh-CN
>
>

--
Regards,
Wang Jiajun

Jiajun Wang

unread,
Jan 21, 2013, 8:43:09 AM1/21/13
to shlug
在 2013年1月21日下午7:17,AleiPhoenix (A.K.A Areverie) <aleip...@gmail.com> 写道:
> 因此想到了DNS的安全问题,有大大能解释一下DNS污染以及如何预防吗?

简单地说,由于 DNS 一般使用 UDP
协议[1],只要在某个节点发现你查询某某网站,然后造一个假的回应包并在真正的包返回之前给你就行了,然后假的包里面只要把实际的 IP
改成另外一个 IP 就行。

给你看个 wireshark 抓包应该清晰易懂。图在附件中。
运行的命令是 $ dig @8.8.8.8 twitter.com
可以看到实际上有两个返回,第一个返回的 ip 是 59.24.3.173
第二个返回了 3 个 ip。(这个是对的)
这个就是 dns 污染。

上封邮件说的 dnscrypt-proxy 就是防止 dns 污染的。

[1] http://tools.ietf.org/html/rfc1035
--
Regards,
Wang Jiajun

wireshark-dns.png

机械唯物主义 : linjunhalida

unread,
Jan 21, 2013, 8:53:40 AM1/21/13
to shlug
原来是这样! 学到了!

2013/1/21 Jiajun Wang <ames...@gmail.com>:

> --
> -- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
>
>

--
GuruDigger- We help internet products find technical partners who
share the same dream!

- http://gurudigger.com

Shell Xu

unread,
Jan 21, 2013, 9:13:39 AM1/21/13
to sh...@googlegroups.com
1. 屏蔽掉假的包,伪装的包都有特征的。
2. 使用tcp协议来获取内容。
3. tcp协议走代理。

在 2013年1月21日下午7:17,AleiPhoenix (A.K.A Areverie) <aleip...@gmail.com>写道:

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
 
 



--
无能者无所求,饱食而遨游,泛若不系之舟
blog: http://shell909090.com/blog/
twitter: http://twitter.com/shell909090

Meteor

unread,
Jan 21, 2013, 9:20:04 AM1/21/13
to sh...@googlegroups.com
目前正在使用。
不过目前好像就OpenDNS支持。
万一OpenDNS也被墙了,那就麻烦了。
难道政府逼着我们自己搭DNS服务器?崩溃。
附带学习笔记:

在 2013年1月21日星期一UTC+8下午9时21分43秒,Jiajun Wang写道:

AleiPhoenix (A.K.A Areverie)

unread,
Jan 21, 2013, 9:30:08 AM1/21/13
to sh...@googlegroups.com

谢谢Jiajun Wang的科普

前面在回来的路上想到有换非53端口(治标不治本)、走TCP,TCP加密;dnscrypt貌似都支持,回头折腾一下


2013/1/21 Shell Xu <shell...@gmail.com>

1. 屏蔽掉假的包,伪装的包都有特征的。
2. 使用tcp协议来获取内容。
3. tcp协议走代理。

shell说的伪装包的特征比较有兴趣,有什么思路吗?


2013/1/21 Meteor <liuxi...@gmail.com>
目前正在使用。
不过目前好像就OpenDNS支持。
万一OpenDNS也被墙了,那就麻烦了。
难道政府逼着我们自己搭DNS服务器?崩溃。
附带学习笔记:

感谢提供

Shell Xu

unread,
Jan 21, 2013, 9:33:34 AM1/21/13
to sh...@googlegroups.com
IP结果必然是
8.7.198.45
37.61.54.158
46.82.174.68
59.24.3.173
78.16.49.15
93.46.8.89
159.106.121.75
203.98.7.65
243.185.187.39
或者没有answer。

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
 
 



--

AleiPhoenix (A.K.A Areverie)

unread,
Jan 21, 2013, 9:40:02 AM1/21/13
to sh...@googlegroups.com
这些是长期以来收集GFW污染结果的列表吗=  =


2013/1/21 Shell Xu <shell...@gmail.com>

Shell Xu

unread,
Jan 21, 2013, 9:41:04 AM1/21/13
to sh...@googlegroups.com
对。

AleiPhoenix (A.K.A Areverie)

unread,
Jan 21, 2013, 9:43:46 AM1/21/13
to sh...@googlegroups.com
嗯,明白了

看样子还得靠加密的链路来保障才算信得过。。


2013/1/21 Shell Xu <shell...@gmail.com>

Dennis

unread,
Jan 21, 2013, 9:49:21 AM1/21/13
to sh...@googlegroups.com

想下载安装dnscrypt-proxy解决dns污染问题, 但是这个项目托管在了github,而github又已经被污染了。。。肿么办?

zodiac lee

unread,
Jan 21, 2013, 9:19:12 AM1/21/13
to sh...@googlegroups.com
我现在的解决方法是直接在hosts文件中添加ip,似乎挺好用的.不知道有没有不妥的地方.

机械唯物主义 : linjunhalida

unread,
Jan 21, 2013, 10:34:12 AM1/21/13
to shlug
2013/1/21 Dennis <ocean...@gmail.com>:
> 想下载安装dnscrypt-proxy解决dns污染问题, 但是这个项目托管在了github,而github又已经被污染了。。。肿么办?


这个网站下载客户端? http://dnscrypt.org/

Armnotstrong

unread,
Jan 21, 2013, 12:43:21 PM1/21/13
to sh...@googlegroups.com, sh...@googlegroups.com


ip地址可能变化

AleiPhoenix (A.K.A Areverie)

unread,
Jan 21, 2013, 6:24:15 PM1/21/13
to sh...@googlegroups.com
架梯子即可...

改hosts也没问题啊,一次性工作


2013/1/22 Armnotstrong <zhaox...@gmail.com>

Meteor

unread,
Jan 21, 2013, 8:57:13 PM1/21/13
to sh...@googlegroups.com
那10个IP地址好像以前是污染Twitter的. 现在开始污染GitHub了. 真没创意.
https://bluesky2fly.wordpress.com/2011/05/21/ip-by-gfw/
现在最SB的做法是把这几个IP地址全都iptables drop掉?

在 2013年1月21日星期一UTC+8下午10时33分34秒,shell909090写道:

Shell Xu

unread,
Jan 21, 2013, 9:28:34 PM1/21/13
to sh...@googlegroups.com
不是,整个dns污染系统都用这10个IP。
这些IP选择上是有局限的,总不能指向一个在用的机器吧。污染后可以想见,大量的DNS错误结果会导致这个IP获得大量80/443连接尝试。这会要了那个机器的命。
drop地址没用,因为你获得一个假的地址,然后drop地址,难道你的dns结果是对的么?dns回包的src写的可是你的目标ip,否则你的udp socket也会丢弃的。
因此,要做的事情其实是丢弃掉查询结果为以下的dns包。这样就OK了。

wd

unread,
Jan 21, 2013, 10:57:33 PM1/21/13
to sh...@googlegroups.com

2013/1/22 Shell Xu <shell...@gmail.com>
因此,要做的事情其实是丢弃掉查询结果为以下的dns包。这样就OK了。


这个怎么做?使用 iptables 么?有现成可用的命令没?

公司把 udp 53 的端口也封掉,我目前是用 pdnsd 通过 tcp 访问 8.8.8.8 的方式来做的,但是有时候会访问不通,很郁闷。

tlze

unread,
Jan 22, 2013, 10:37:45 PM1/22/13
to sh...@googlegroups.com
"Openwrt的翻墙解决方案:
不用VPN就能避免DNS污染,同时还能使用本地CDN"

这个链接,应该可以移值到linux
http://code.google.com/p/openwrt-gfw/

kernel

unread,
Jan 22, 2013, 11:00:02 PM1/22/13
to sh...@googlegroups.com
我现在是把本机的53端口的包重定向要vps的非知名端口,然后在vps的非知名端口上开一个dns server,然后解析完了扔回来

ms现在gfw没有对每个端口都进行dns污染,所以没有问题

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN





--
Easy things should be easy, hard things should at least be possible.
Powered by Gentoo Linux

Xidorn Quan

unread,
Jan 22, 2013, 11:46:04 PM1/22/13
to sh...@googlegroups.com
如果你受得了这个延迟的话

--
Xidorn Quan
GnuPG fingerprint: 6F1E DF9A D250 7505 63E2 345E 7570 8D3F 7C9A 1209

Dennis

unread,
Jan 23, 2013, 10:03:25 PM1/23/13
to sh...@googlegroups.com

通过dnscrypt 解决dns 污染,是比较好的一个方式。如果担心本地视频网站等会慢,则使用unbound+dnscrypt 这个组合,让部分域名走本地dns ,部分境外网站域名走dnscrypt.

Timothy Ye

unread,
Jan 23, 2013, 11:49:54 PM1/23/13
to sh...@googlegroups.com
今天微博上最新的消息,Github又恢复访问了,DNS污染已经不在……


2013/1/24 Dennis <ocean...@gmail.com>

Dennis

unread,
Jan 24, 2013, 12:00:58 AM1/24/13
to sh...@googlegroups.com

大家说我们有生之年,能等到完全没有dns干扰/gfw的那一天么?我对此不报太大信心啊。

david pu

unread,
Jan 24, 2013, 1:49:46 AM1/24/13
to sh...@googlegroups.com
Ubuntu 12.04开始就用dnsmasq作为本地reslover,所以这个方案搞在Ubuntu上就是现成的,不过里面提到的这条是否是真实有效的?

使用提供DNS服务的国外IP地址作为DNS服务器查询被污染的域名,GFW会返回解析出的错误IP地址,但是正确的IP地址也会在随后被返回。

自己常年走公司vpn,没有验证过,因为这个方案都建立在上面这条上,如果GFW就没有给你回正确的,搞这么一通也没啥用了。。
On Wed, Jan 23, 2013 at 11:37 AM, tlze <why...@gmail.com> wrote:
--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN





--
 ()   ASCII Ribbon Campaign
 /\   Keep it simple!

Wales Wang

unread,
Jan 24, 2013, 2:20:24 AM1/24/13
to sh...@googlegroups.com, sh...@googlegroups.com
其实搞GFW的技术人员离我们不远。
提醒一下历史:纳粹的门格尔医生的经历

提醒他们是否死的早,是否能逃出

现在的存储技术太大了去,谁做的留了纪录,数百年都会被保存了

Wales Wang

Wizard

unread,
Jan 25, 2013, 2:34:19 AM1/25/13
to sh...@googlegroups.com
2013/1/22 wd <w...@wdicc.com>:
你用iptable实验成了么?

>
> --
> -- You received this message because you are subscribed to the Google Groups
> Shanghai Linux User Group group. To post to this group, send email to
> sh...@googlegroups.com. To unsubscribe from this group, send email to
> shlug+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/shlug?hl=zh-CN
>
>



--
Wizard

tlze

unread,
Jan 25, 2013, 6:55:39 AM1/25/13
to sh...@googlegroups.com
需要iptable内核模块:xt_u32、xt_string
g.firewall

Wales Wang

unread,
Jan 25, 2013, 8:26:56 AM1/25/13
to sh...@googlegroups.com, sh...@googlegroups.com
难说!
再过5-10年,等我们70年龄段的人到位置。
会认识除了黄色和谣言诽谤,其他封不封作用不大。总是该变慢慢改变。

我说若造反,你家的房贷照样要交,公司停工可能不发工资了。你会去么?
青年无产者和中年有家有窝的极大不同。


Wales Wang

在 2013-1-24,下午1:00,Dennis <ocean...@gmail.com> 写道:

Cheng

unread,
Jan 25, 2013, 12:11:54 PM1/25/13
to shlug
政治趋向的讨论请到此为止了。


2013/1/25 Wales Wang <worm...@yahoo.com>

Wales Wang

unread,
Jan 25, 2013, 12:46:57 PM1/25/13
to sh...@googlegroups.com, shlug
改学历史:纳粹 门格尔医生。
也是个牛人,可惜了...

Wales Wang

fitz pisai

unread,
Jan 26, 2013, 11:38:45 AM1/26/13
to sh...@googlegroups.com
今天疑似上升到针对github的中间人攻击了?

2013/1/26 Wales Wang <worm...@yahoo.com>

ghosTM55

unread,
Jan 26, 2013, 12:25:19 PM1/26/13
to shlug

2013/1/27 fitz pisai <fitz.fal...@gmail.com>
今天疑似上升到针对github的中间人攻击了?

是的,不过后来又好了

--
Thomas
Shanghai Linux User Group
GitCafe - Share a cup of open source

http://ghosTunix.org
Twitter: @ghosTM55
Reply all
Reply to author
Forward
0 new messages