如何假装“我在校园”

给大学生整这么多乱七八糟毫无意义的 App 有个鸡毛的用。

学校上学期开始用了“我在校园”这个微信小程序来让我们每天签到。本来已经被各种“学在 XX”“i XX”之类的 App 恶心到了,结果现在又来个每天签到,恶心他妈都要哭了。

作为学修电脑计算机的,肯定对学校这种行为十分不爽,于是盘算着怎么能反着给学校恶心回去。下面针对这个小程序的两种签到给出解决方案,手头只有 Android 设备,所以 iOS 先管不着了。

PS:本来是想看能不能通过抓包,然后重新实现签到过程以全自动完成。不过因为是微信小程序,并不好弄(或者是根本不行),所以就只能退而求其次,见招拆招了。

定位签到

这个是最简单的,只需要模拟定位即可。这里推荐 Fake Location 这个应用,成功率 100%——当然需要你的手机已经 Root 过。软件的使用十分简单,在此不做过多阐述。

蓝牙签到

(PS:这个方法需要有除了自己的手机之外其他的带有蓝牙功能的手机或电脑)

这学期学校又新增了蓝牙签到,恶心他奶奶都得哭了。不过问题也不大,这里记录一下折腾的全过程。

最开始我以为的的签到全过程是这样的:

手机搜索蓝牙设备→建立连接→蓝牙设备返回某个值→手机将这个值发回服务器→签到成功

如果猜想没错的话,在手机设置的蓝牙搜索里应该是能发现奇怪的设备的,然而并没有。然后我抓包看了下,也没有找到有发送什么东西给服务器的记录。

抓包过程有个小插曲,之前一直用的 Fiddler 代理的方式,结果这次突然抓不到了,转而使用抓包 App。我这里用的是 HttpCanary,大概是用过的手机上最方便好用的抓包工具了。

本以为搞不定了,突然想起来之前拿到的这个小程序一部分主要源代码,于是去搜了下,找到了一个叫 iBeacon 的东西,虽然不是很清楚具体是什么,但既然在搜索蓝牙部分,那就是它没错了。去维基查了一下,简介如下:

iBeacon is a protocol developed by Apple and introduced at the Apple Worldwide Developers Conference in 2013. Various vendors have since made iBeacon-compatible hardware transmitters – typically called beacons – a class of Bluetooth low energy (BLE) devices that broadcast their identifier to nearby portable electronicdevices. The technology enables smartphones, tablets and other devices to perform actions when in close proximity to an iBeacon.

iBeacon is based on Bluetooth low energy proximity sensing by transmitting a universally unique identifier picked up by a compatible app or operating system. The identifier and several bytes sent with it can be used to determine the device's physical location, track customers, or trigger a location-based action on the device such as a check-in on social media or a push notification.

iBeacon can also be used with an application as an indoor positioning system, which helps smartphones determine their approximate location or context. With the help of an iBeacon, a smartphone's software can approximately find its relative location to an iBeacon in a store. Brick and mortar retail stores use the beacons for mobile commerce, offering customers special deals through mobile marketing, and can enable mobile payments through point of sale systems.

Another application is distributing messages at a specific Point of Interest, for example a store, a bus stop, a room or a more specific location like a piece of furniture or a vending machine. This is similar to previously used geopush technology based on GPS, but with a much reduced impact on battery life and better precision.

iBeacon differs from some other location-based technologies as the broadcasting device (beacon) is only a 1-way transmitter to the receiving smartphone or receiving device, and necessitates a specific app installed on the device to interact with the beacons. This ensures that only the installed app (not the iBeacon transmitter) can track users, potentially against their will, as they passively walk around the transmitters.

iBeacon compatible transmitters come in a variety of form factors, including small coin cell devices, USB sticks, and generic Bluetooth 4.0 capable USB dongles.

https://en.wikipedia.org/wiki/IBeacon

就像名字一样,大概是个类似信标作用的东西,主要用于室内定位啥的。这样的话,学校的蓝牙设备应该也是这个类型的了。据此推测,实际的签到过程应该类似这样:

手机搜索 iBeacon 设备→搜索到指定 UUID 的 iBeacon 设备→小程序认为签到成功→向服务器发送相关信息→签到成功

搞清楚了这个,新的问题又来了:iBeacon 需要一个 UUID,那签到设备的 UUID 是怎么获得的呢?

又去抓了次包,发现了一些有用的东西。

小程序会请求 https://student.wozaixiaoyuan.com/sign/getSignData.json 来获取签到所需的信息。这里我们无需关心请求参数,只需要关注返回值。

返回值为 JSON,我们用到的参数有两个(其实只有一个),devicesuuids。这两个参数差不多是一样的,唯一的区别是 devicesuuids 多了一个10001,这个数字是 iBeacon 需要的一个信息。而下划线前面的部分就是 iBeacon 的 UUID。

有了建立 iBeacon 所需的信息,接下来我们需要做的就是自己伪造一个 iBeacon。在手机上安装 Beacon Simulator(Google Play 可以下载)或其他类似 iBeacon 模拟应用,然后在 SIMULATOR 这里点右下角的加号,选择 iBeacon。UUID 填写刚才抓包得到的值,Major 和 Minor 填抓包中 devices 下划线后面的数字(这里我就填刚才的 10001),Tx Power 的话按照软件的提示,应该是距离 iBeacon 设备 1m 距离的 RSSI(信号强度),这个似乎需要自己去摸索,我这里填的是 -69,至于随便填写别的值有没有什么影响就不太清楚了。下面的 Broadcast settings 和最上面的名字根据需要随意设置就好。

点击右上角的对勾保存。返回主界面,打开手机蓝牙,然后点击刚才新建的 iBeacon 旁边的开关。这样就能让站在你旁边的小伙伴签到了。(什么?想知道自己怎么签?当然是小伙伴签完到之后你扫他的二维码啊)

还想说两句

真的感觉自己上大学不是学习来了,而是加群和下各种 App 来的。之前团中央也发过文件要求不能用 App 绑架学生,但是感觉没什么用啊。这样的信息化智能教育,还不如不要。

评论

  1. 233君
    3年前
    2021-4-28 14:27:37

    不知道楼主还需不需要了,我在校园可以抓token 值,然后我抄大佬作业用 Python已经可以做到自动日检日报了,但是蓝牙打卡我应该是抓到地址了,但是每次都有问题。

    • mayuu酱重症患者
      233君
      1年前
      2022-12-07 11:38:40

      时隔一年半多,挖下;

      目前我仍需要自动化打卡“我在校园”的新方法,这学期我刚大二,近段时间我们学校突然将一直使用的“今日校园”签到方式改为“我在校园”签到,我就哭惹😭
      (小声:主要在大一刚入学时候将“今日校园”的token 抓好,用python 代码放在服务器跑,跑了一年多了,又突然改签到方式了。。。)

      才翻到这篇博文,继而看到老哥你在去年4月份发的评论,不知老哥还能收到我这条留言么??如果日后看到的话,麻烦老哥回复下解决“我在校园”打卡的新方法呗,如果之前有公开签到代码在github 上的话,麻烦指路下源码仓库地址呗,求带带😖

  2. feelyou
    4年前
    2020-1-13 22:09:04

    :rolleyes: 今天下班忘了打卡,,自动化打卡已经想了很久了,哈哈哈。真的没办法找小程序里的接口吗?

    • Robotxm
      博主
      feelyou
      4年前
      2020-1-14 0:16:54

      能是能,但这些接口都依赖于微信登录,这个就比较麻烦了

  3. 5年前
    2019-5-27 18:29:23

    这还要假装。

    • Robotxm
      博主
      repostone
      5年前
      2019-5-29 23:38:59

      有时候不在学校的时候救急用咯

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇