Jump to content

WIndows CMD Detect Connected WIFI Command


Recommended Posts

Hey there,

I'm quite new to using the rubber ducky and just wanted to ask a general question relating to a command that detects the connected wifi on a windows machine. For example, the code below:

REM Windows Wifi Grabber

DELAY 2000

GUI r

DELAY 200

STRING cmd

ENTER

DELAY 200

STRING netsh wlan show profile name=RANDOMESSID key=clear

ENTER

Simply opens up cmd and types that command in. My question is if there is a cmd command that can replace "RANDOMESSID" with a command that automatically replaces that section with the connected wifi ESSID on the machine.

Thanks!

Link to post
Share on other sites

Darren has it in his code , however netsh wlan sh net mode=bssid should do the same thing I think. 

Just take SSID 1 and store it as a variable to be later used, or select string if you want to directly grab the text from the output

Something like 

$ConnectedSSID= netsh wlan sh net mode=bssid
$Output= $ConnectedSSID| Select-String -Pattern 'SSID 1 :'
$Output -replace 'SSID 1 :'

or look at using a regex.

By the way I'm using Powershell above as Darren does in his script, is there a reason why you are sticking to Command only?

Edited by zoro25
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...