Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get the account and password of the currently used wireless network
#1
I want to get the account and password of the currently used wireless network, and then save it to a variable in the QM code.

I found the VBS code, After running the VBS code, a txt file will be generated with the password of the wireless network. but I don't know how to save it to the variables of the QM code. I hope someone can provide some suggestions, or a simpler implementation method. Thanks in advance. Smile

Code:
Copy      Help
'//////////////////////////////////////////////
'//            ε013 V 2.0 (Classic)
'//          Jordan Dalcq - 0v3rl0w
'/////////////////////////////////////////////

Function GetOutput(command)
 Set Shell = Wscript.CreateObject("WScript.Shell")
 Set cmd = Shell.Exec("cmd /c  " & command)
 strOut = ""

 Do While Not cmd.StdOut.AtEndOfStream
   strOut = strOut & cmd.StdOut.ReadLine() & "\n"
 Loop
 GetOutput=strOut
End Function

Function saveIt(wifi, passwd)
 wifi = Replace(Replace(wifi, ">", "-"), "<", "-")
 Set objFSO=CreateObject("Scripting.FileSystemObject")
 Set objFile=objFSO.CreateTextFile(wifi & ".txt")
 objFile.Write(passwd)
 objFile.Close
End Function

strText=Split(GetOutput("netsh wlan show profile"), "\n")

i = 0

For Each x in strText
    If i > 8 And i < Ubound(strText)-1 Then
        Name = Split(x, ": ")(1)
        str=Split(GetOutput("netsh wlan show profile """ & Name & """ key=clear"), "\n")(32)
        passwd = Split(str, ": ")
        If Ubound(passwd) Then
            saveIt Name, passwd(1)
        End If
    End If
    i = i + 1
Next
#2
this should do it for ya

Function GetSSIDandPassword
Code:
Copy      Help
str wlpassword wlname cl="cmd.exe /C NETSH WLAN SHOW INTERFACE | findstr /r ''^....SSID''"
RunConsole2 cl wlname
wlname.trim
wlname.replacerx("SSID                   :" "")
out wlname
cl=F"cmd.exe /C netsh wlan show profile name={wlname} key=clear | findstr Key"
RunConsole2 cl wlpassword
wlpassword.trim
wlpassword.replacerx("Key Content            :" "")
out wlpassword
#3
Did not get the password after running

I am using the Chinese version of the system windows7

Can it run on all languages?   Huh


Attached Files Image(s)
   
#4
test output then show here then can sort it


run this

Function Get_SSIDandPassword
Code:
Copy      Help
str wlpassword wlname cl="cmd.exe /C NETSH WLAN SHOW INTERFACE | findstr /r ''^....SSID''"
RunConsole2 cl wlname
wlname.trim
wlname.replacerx("SSID                   :" "")
out wlname
cl=F"cmd.exe /C netsh wlan show profile name={wlname} key=clear | findstr Key"
RunConsole2 cl wlpassword
wlpassword.trim
;wlpassword.replacerx("Key Content            :" "")
out wlpassword

and see what output is  for wlpassword
#5
try this change code a little to find whatever is after the :

Function Get_SSIDandPassword
Code:
Copy      Help
str wlpassword wlname cl="cmd.exe /C NETSH WLAN SHOW INTERFACE | findstr /r ''^....SSID''"
RunConsole2 cl wlname
wlname.trim
findrx(wlname "^.+\:(.+)$" 0 1 _s 1)
_s.trim
wlname=_s
out wlname
cl=F"cmd.exe /C netsh wlan show profile name={wlname} key=clear | findstr Key"
RunConsole2 cl wlpassword
wlpassword.trim
findrx(wlpassword "^.+\:(.+)$" 0 1 _s 1)
_s.trim
wlpassword=_s
out wlpassword
#6
Still not getting the password
#7
error again or empty text?
let me know which

if empty text need to run function as admin probably
#8
No error, it is empty text, I generate exe file, run with administrator, also empty
#9
do this 

select function name from list on left in qm window

press ctrl+p
 then select the following options


   

click ok

also run command prompt as admin and use this code

netsh wlan show profile name=YourWifiName key=clear

change YourWifiName to your SSID Name then paste into cmd window and look under security settings for wifi password
#10
Here are the demo steps and cmd content


Attached Files Image(s)
   

.zip   cmd content.zip (Size: 689 bytes / Downloads: 262)
#11
also run command prompt as admin and use this code

netsh wlan show profile name=YourWifiName key=clear

change YourWifiName to your SSID Name then paste into cmd window and look under security settings for wifi password



maybe this cant test

Function Get_SSIDandPassword
Code:
Copy      Help
str wlpassword wlname cl="cmd.exe /C NETSH WLAN SHOW INTERFACE | findstr /r ''^....SSID''"
RunConsole2 cl wlname
wlname.trim
findrx(wlname "^.+\:(.+)$" 0 1 _s 1)
_s.trim
wlname=_s
out wlname
cl=F"cmd.exe /C netsh wlan show profile name=''{wlname}'' key=clear | findstr 关键内容"
RunConsole2 cl wlpassword
;out wlpassword;; uncomment this line if findrx line below errors or text is empty to see what ouput is
wlpassword.trim
findrx(wlpassword "^.+\:(.+)$" 0 1 _s 1)
_s.trim
wlpassword=_s
out wlpassword
#12
Running the code is successful, Heart is it OK on the English operating system?


Forum Jump:


Users browsing this thread: 1 Guest(s)