2

国外网友反向工程破解小米空气净化器延长滤芯使用时间

 1 year ago
source link: https://www.techug.com/post/xiaomi-air-purifier-reverse-engineering/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

国外网友反向工程破解小米空气净化器延长滤芯使用时间

2



image-2.png

小米的产品物美价廉,在国外也有很多米粉使用。最近有一位外国网友研究小米空气净化器,通过反向工程,发现了小米空气净化器和空气滤芯之间通讯的秘密。

大家知道,空气滤芯,跟净水器的滤芯一样,使用一段时间后需要更换成新的,才能保证过滤的质量。通常机器上会显示还剩下百分之几的可用度。当这个可用度接近 0 时,意味着你需要购买新的把旧的滤芯换下来。但这位国外网友发现,小米空气净化器和其使用的滤芯之间的通讯是通过NFC的 UUID 确认的,他在净化器的反向工程获得的代码里发现了这个秘密:

import sys
import hashlib

# Usage: pwd.py 04A03CAA1E7080
def getpwd(uid):
    uid = bytearray.fromhex(uid)
    h = bytearray.fromhex(hashlib.sha1(uid).hexdigest())
    pwd = ""
    pwd += "%02X" % h[h[0] % 20]
    pwd += "%02X" % h[(h[0]+5) % 20]
    pwd += "%02X" % h[(h[0]+13) % 20]
    pwd += "%02X" % h[(h[0]+17) % 20]
    return pwd

assert getpwd("04A03CAA1E7080") == "CD91AFCC"
assert getpwd("04112233445566") == "EC9805C8"
print("PWD:", getpwd(sys.argv[1]))

你可以在GitHub上找到这个 反向工程

通过观察这段反向代码,对大多数人来说也许更像是段随机字符,但却是问题的关键,净化器和滤芯之间通过一个密码进行确认。 它使用的 NFC 的类型是 NTAG213 (by NXP),密码的产生过程并不清楚。NFC 的 UUID 对于每个滤芯来说都是唯一的。如果使用上面的密码(CD91AFCC),配合一个具有一个 04A03CAA1E7080 UUID NFC 卡,我们就模拟出了一个新的滤芯设备,骗过净化器。

你可以参考网友放在Github上的这些 滤芯信息 破解。

净化器跟伪造的NFC通讯后,会认定这是一个新的滤芯,这样就能延长过期的滤芯的使用时间。

程序员编程中…

参考:This is how they do it!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK