1. 程式人生 > 其它 >Android裝置資訊生成規則

Android裝置資訊生成規則

技術標籤:Android

Androd裝置資訊生成規則

濫用裝置資訊惡意註冊

當我們在開發某款APP時,為了防止使用者惡意註冊通常會通過IP,手機唯一編碼進行過濾重複惡意註冊。

通常最簡單的方法我們是識別其IMEI碼進行防止過濾,但是隨著人們的逆向技術增長,很多逆向技術人員通過各類技術(如xposed,frida,重打包)將IMEI進行修改。

裝置資訊規則

但由於IMEI是由固定的規則組成的,如果咋們註冊時校驗它的IMEI生成規則,可以有效的過濾一部分沒有進行生成規則所產生的IMEI使用者。

但由於IMEI生成規則目前網上程式碼繁多,也沒有辦法很好的避免,因此我們需要更多的資訊進行匹配。

如IMEI,IMSI,藍芽MAC地址,WIFI網絡卡地址,ICCID,CPU資訊等。

增強惡意註冊防護方法

因為我們知道,IMEI是包含有手機型號的,那麼同樣的,我們在獲取使用者IMEI碼同時,可以將它手機的其它裝置屬性進行獲取,在進行比對。

例如使用者的IMEI碼是小米2手機,那麼它的CPU資訊則肯定是小米2的,他的網絡卡標識肯定是小米廠商的等等,通過多種資訊進行核對來有效增加使用者的偽造難度。

最後

提供一個免費的生成虛擬手機裝置資訊的介面,這裡是根據真實手機的各類屬性去隨機生成它的IMEI,mac等資訊,僅做技術參考。

介面地址:http://z-yd.cn/android/device.php?token=666666

返回資料:

{
  "code": 200,
  "data": {
    "vbattery": {
      "level": 32,
      "health": 0,
      "status": 0,
      "plugged": 32,
      "voltage": 0,
      "temperature": 0
    },
    "vbluetooth": {
      "mac"
: "f4:70:ab:81:96:3b", "name": "wcble", "state": 12, "enabled": true, "scan_mode": 23 }, "vhardware": { "cpu_ft": "vivo\/PD1610\/PD1610:7.1.1\/NMF26F\/compil03051844:user\/release-keys", "cpu_hw": "PD1610", "cpu_pfbd": "qcom", "cpu_core_num": 4, "cpu_max_freq": 1593600, "cpu_min_freq": 307200 }, "vlocation": { "latitude": 0, "cellinfos": [ ], "longtitude": 0 }, "vnetwork": { "ip": "192.168.0.218", "mac": "f4:70:ab:81:96:5d", "dns1": "180.168.255.118", "dns2": "202.96.209.5", "ssid": "\"UWDZGvFMKFSQY\"", "bssid": "0B:7C:E2:3D:2B:4B", "gateway": "192.168.0.1", "net_hostname": "android-54a5981b6c73a8c2", "network_type": 1, "network_type_name": "wifi" }, "vscreen": { "dpi": 640, "x_px": 2560, "y_px": 1440, "x_dpi": 537.882, "y_dpi": 537.388, "scaled": 4, "density": 4 }, "vsim": { "tel": "\u4e0d\u53ef\u7528", "imei": "864692036396165", "imsi": "", "meid": "", "iccid": "", "country": "", "empty_sim": true, "network_type": 0, "operator_name": "", "operator_numeric": "" }, "vsystem": { "id": "NMF26F", "aaid": "7cc81b8-45b6-d6d4-ea77-ffc9c8fb4d2b", "host": "compiler01104", "tags": "release-keys", "type": "user", "user": "compiler", "brand": "vivo", "model": "vivo Xplay6", "radio": "unknown", "serial": "967ff10a", "cpu_abi": "arm64-v8a", "display": "NMF26F release-key", "product": "PD1610", "rom_sig": "aosp-user 501650752", "cpu_abi2": "", "openudid": "2dcf4068642e83fc", "buildtime": -120245848, "android_id": "54a5981b6c73a8c2", "bootloader": "unknown", "http_agent": "Linux; U; Android 7.1.1; zh_CN; vivo Xplay6; Build\/NMF26F;", "kernel_sig": "Linux 3.10.73-anhlbw6f-00002-rboaxahi armv8llocaldomain localhost #5 SMP PREEMPT Thu Jul 23 03:23:36 CST 1964", "user_agent": "Linux; U; Android 7.1.1; zh_CN; vivo Xplay6; Build\/NMF26F;", "rom_md5hash": "ca138eeb5b542ba77a721a4312a7ab31", "manufacturer": "vivo", "total_memory": 5972922183, "volume_count": 0, "radio_version": "996FAAAANAZM-1.119120.1.121334.3", "rom_type_name": "nougat", "sd_total_size": 2054388567, "rom_total_size": 29187257023, "rom_description": "aosp_nougat 7.1.1 NMF26F user.508864129.374402 release-keys", "rom_fingerprint": "vivo\/PD1610\/PD1610:7.1.1\/NMF26F1592322275:user\/release-keys", "rom_incremental": "user.508864129.374402", "version_release": "7.1.1", "version_sdk_int": 25, "version_codename": "REL", "rom_build_description": "aosp_nougat-user 7.1.1 NMF26F user.508864129.374402 release-keys" }, "createTime": "2021-01-10T21:03:30.823+0000" } }