Use the adb shell to simulate the manual operation of the mobile phone to enter the verification code, and violently crack the problem of unbinding the mobile phone of West Wind and Westward Journey

1. Problem: The mobile phone number bound to Xifeng Westward Journey is no longer in use, and the verification code needs to be entered to unbind the mobile phone

2. Solution: The verification code of Western Journey to the West is 4 digits, and you can use 1000~9999 to input for brute force cracking.

3. Use tools:

1. adb

Run adb shell to enter the terminal interface of the mobile phone, type windows cmd and linux terminal

Use the getevents command to capture the operation events of the mobile phone, and we can get the corresponding instructions by clicking on the mobile phone interface

Use sentevents to send commands to simulate clicks, enter verification codes, and other operations.

The instructions obtained by getevents are in hexadecimal, and need to be converted to decimal in sendevents

2. ubuntu system

4. Steps

1. 安装adb, sudo apt-get install android-tools-adb

2. Turn on the usb debugging function on the mobile phone (you can search Baidu for the steps to enable USB debugging of mobile phones of various brands)

3. Use adb devices to check whether it is connected to the mobile phone (the mobile phone will pop up a prompt whether to authorize the computer to operate)

4. Write scripts for brute force

#!/bin/bash
echo "po jie start"
i=7532
while ((i < 10000))
do
echo "exec the ${i} time to pojie"
#1. 点击验证码的输入框
adb shell sendevent /dev/input/event1 3 57 26854
adb shell sendevent /dev/input/event1 1 330 1
adb shell sendevent /dev/input/event1 3 50 3
adb shell sendevent /dev/input/event1 3 53 169
adb shell sendevent /dev/input/event1 3 54 360
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 57 4294967295
adb shell sendevent /dev/input/event1 1 330 0
adb shell sendevent /dev/input/event1 0 0 0

#2. Enter verification code
#Move the cursor to the end
#adb shell input keyevent 123
#Backspace
adb shell input keyevent 112
adb shell input keyevent 112
adb shell input keyevent 112
adb shell input keyevent 112 adb
shell input text "${i}"
((i++))

#3. 点击确认
adb shell sendevent /dev/input/event1 3 57 26854
adb shell sendevent /dev/input/event1 1 330 1
adb shell sendevent /dev/input/event1 3 50 3
#adb shell sendevent /dev/input/event1 3 53 308
#adb shell sendevent /dev/input/event1 3 54 731
adb shell sendevent /dev/input/event1 3 53 304
adb shell sendevent /dev/input/event1 3 54 1219
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 57 4294967295
adb shell sendevent /dev/input/event1 1 330 0
adb shell sendevent /dev/input/event1 0 0 0

#4. 点击确定进行验证
adb shell sendevent /dev/input/event1 3 57 26854
adb shell sendevent /dev/input/event1 1 330 1
adb shell sendevent /dev/input/event1 3 50 3
adb shell sendevent /dev/input/event1 3 53 140
adb shell sendevent /dev/input/event1 3 54 479
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 57 4294967295
adb shell sendevent /dev/input/event1 1 330 0
adb shell sendevent /dev/input/event1 0 0 0

#5. Verification error Click OK to re-enter
sleep 1
adb shell sendevent /dev/input/event1 3 57 26854
adb shell sendevent /dev/input/event1 1 330 1
adb shell sendevent /dev/input/event1 3 50 3
adb shell sendevent /dev/input/event1 3 53 555
adb shell sendevent /dev/input/event1 3 54 888
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 57 4294967295
adb shell send event /dev /input/event1 1 330 0
adb shell sendevent /dev/input/event1 0 0 0
done
echo "pojie end"

Guess you like

Origin blog.csdn.net/qq_39298227/article/details/92834585