In mid-May, LUG held a white hat competition, conducting white hat vulnerability testing on campus websites, and awarded prizes based on the vulnerabilities found. The event went relatively smoothly, and hundreds of vulnerabilities in the campus network system were found within a few days. However, for some unknown reason, it attracted hackers.

In the early morning of May 31, the alarms from the monitoring system broke the tranquility of the late night. Dozens of LUG servers unexpectedly failed one after another, and the shocking event of LUG servers being hacked began. From the email sent by server administrator gyf to the Network Information Center for the second time on June 1, one can vaguely feel the tense atmosphere of that year.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
按照事件第一次发生时间排序:

【blog.ustc.edu.cn、freeshell.ustc.edu.cn】202.141.{160,176}.99(网络信息中心虚拟机)
31日 01:43,具体详情见上一封邮件(服务器失联),至今未修复。

【mirrors.ustc.edu.cn】202.38.95.110/25,202.141.{160,176}.110(网络信息中心实体机)
31日 01:51,黑客登陆后执行了 sudo /bin/sh;(P.S. 黑客登陆IP来自128.199.203.28(DigitalOcean),但该IP已被注销)
31日 01:58,系统崩溃, 由于我们设置了内核崩溃后60秒重启,因此该机器重启
31日 02:01,黑客再次登录
1日 19:42,管理员在排查问题时卸载了tun内核模块,随后,所有vlan配置消失。服务器失联。
1日 20:03,我和崔灏进入网络信息中心机房,物理接触服务器
1日 20:30,该服务器所有网络服务恢复正常

【lug.ustc.edu.cn】202.141.162.123(西区图书馆实体机)
31日11:54,服务器失联,无法ping通
31日13:47,我进入西区图书馆机房,发现服务器花屏,故障原因未知
31日14:07,强制重启服务器后,服务恢复
1日 19:58,服务器再次失联,至今未修复

【gitlab.lug.ustc.edu.cn】202.141.{162,176},93、202.38.93.93(东区图书馆机房虚拟机)
1日中午,接到用户反馈部分git仓库故障。
登录服务器发现btrfs文件系统损坏。
尝试通过vSphere Data Protection恢复失败,正在查找原因。。。

【vpn.lug.ustc.edu.cn】202.141.{160,176}.95(网络信息中心虚拟机)
1日20:35,该服务器失联
随后,我们通过vCenter查看,发现该机器正在循环重启。现象与blog服务器极为类似。
且该服务器故障前半小时的auth.log被删除,我们从硬盘中恢复出了部分入侵前后的日志。
服务至今未恢复。

我们正在全力抢修服务器,但由于事情发生得非常集中,服务全部恢复可能需要较长时间。

It was later found out that the server was remotely logged in using my account. In mid-May, the hacker invaded my laptop with a virus spread through a USB drive, implanted a keyboard logger, and remotely controlled my browser to visit some web pages related to network intrusion through unknown means. Since my personal account has no access record and the Bitcoin wallet was not stolen, it is very likely that this was an Advanced Persistent Threat (APT) targeting LUG rather than me personally. In the following half month, the hacker did not make any rash moves, presumably collecting information about the LUG server through various channels. On the night of May 30, the hacker logged into a large number of servers with the server password stolen by the keyboard logger and inserted malicious kernel modules. The hacker also invaded the LDAP database, tampered with the password of an old member who had already left the school, and logged into the most strictly defended mirrors server. The hacker also stole the private key of a VPN user, accessed the server’s internal network, and further invaded servers that were not allowed to be accessed from outside the school.

What this malicious kernel module does seems simple, it randomly modifies a byte on the hard disk every time a file operation is performed. This seemingly prank-like kernel module makes the server run normally when it is just invaded, but when key data is destroyed, system anomalies are discovered, and by this time a large amount of user data and system files have been destroyed. When the administrator tries to scan and repair these damaged files, a large number of file operations are generated, causing more files to be damaged, and they can never be repaired. Even when we NFS mount the backup server to copy backup data, the copied backup is also wrong, which is puzzling to us (fortunately, the backup server is NFS read-only mounted, otherwise the backup itself may also be damaged).

The interruption of the open-source software mirror (mirrors) service with over ten million daily visits, the interruption of the VPN service relied on by thousands of users in the school, the damage to the files in the freeshell virtual machine, the inability to access the blog, and even the LUG homepage cannot be opened, inquiry emails flew in like snowflakes, but the email server also hung up. This hacking incident even alarmed several Linux distributions and upstreams of open-source software. They all expressed that it was unheard of for open-source software mirrors to be hacked. The Freeshell service was terminated due to lack of backup, and the VPN service was no longer publicly run because it acted as an accomplice. This incident exposed many problems with the basic infrastructure of the LUG server, such as the public VPN service and the server using the same internal network, no two-step verification for password login, no alarm and defense for the dangerous operation of inserting kernel modules, and the account of the departed administrator was not disabled. Of course, the fundamental reason was that my laptop was hacked. Afterwards, LUG and teacher James treated me leniently and did not pursue my responsibility. I still feel very guilty to this day.

Comments

2015-06-19