PowerShell: Remembered Wireless Networks and it’s passwords


Hackers can run a script on your computer by any available methods (Malware, downloaded program, java script) to get your wireless password easily. That’s why you should not download any executable program from unknown and unreliable websites or a USB disk from parking lot. Once they have the wireless password, they can connect to the wireless network from parking lot or closed location around the property and get into the network.

This PowerShell script demonstrates how to grab the remembered wireless network names and it’s password in clear text on the running computer.

P.S. It is pretty dump to leave the output of the script on your computer for others to read.

<#

    Script to get all remembered wireless networks and their
passwords on the running computer.

    This script display the wireless network name and its
password and also saves it in wireless-passwords.csv
file

#>
$wprofiles = @()

(((netsh wlan show profiles) | out-string ).split(“`r`n”)).ForEach({
if ($_ -like “*All user profile*”)
{
$profiletextline = $_.Split(“:”)
$wprofiles += $profiletextline[1].trim()
}
})
“WirelessName`tPassword” | Out-File -FilePath .\Wireless-passwords.csv
$wprofiles.foreach({
$profilename = $_
(((netsh wlan show profile $profilename key=clear) | Out-String).Split(“`r`n”)).ForEach({
if ($_ -like “*Key content*”)
{
$passwordline = ($_.Split(“:”))[1].trim()
“$profilename`t$passwordline” | Out-File -FilePath .\Wireless-passwords.csv -Append
“$profilename = $passwordline”
}
})

})
# End of the Script

Advertisements

Firefox Error code: NS_ERROR_NET_INADEQUATE_SECURITY


If you get this error (NS_ERROR_NET_INADEQUATE_SECURITY) when visting HTTPS site on Firefox, that means the web server has something wrong with SSL certificate (old ciphers, lower TLS version).

Here is how to fix your Firefox to access that page:

  1. Open Firefox and type about:config in the address bar
  2. Click on I accept the risk button
  3. Type http2 in search box
  4. Find network.http.spdy.enabled.http2 and double click to make it false (to disable http2).

Screen Shot 2018-10-21 at 10.08.40 PM

That’s all. You may need to close Firefox and reopen it.

Hope it helped you. 🙂

 

Exchange: Filter Distribution Groups by Alias with a Variable


If you ever search a mailbox or distribution group in Exchange using this command:

 

    $vAlias = “Sales”

    Get-DistributionGroup -Filter { Alias -eq $vAlias }

Aaaannnddd, It doesn’t work. But This works:

 

    Get-DistributionGroup -Filter { Alias -eq “Sales” }

 

Man, that’s frustrating. But there is a solution. Set the filter query like this:

    $vAlias = “Sales”

    Get-DistributionGroup -Filter “Alias -eq ‘$vAlias'”

Tadaaaa! It is freaking works now.

On-Prem Exchange: Conference Rooms are not processing Meeting Requests from Exchange Online


Say your conference room mailboxes are not processing meeting requests from Office 365 or from partner organization, and you want to process those meeting requests too, you come to right place.

Two ways you can accomplish that:

 

One of Two: On the Exchange Connector that receives emails from Office 365 or from different mail servers, Enable Externally secured (for example, with IPsec) in Security Tab of the connector properties.

 

Two of the Two: If you don’t like the above idea, you can enable ProcessExternalMeetingMessages setting on your conference room calendar processing settings. Whip out an Exchange Shell, the type this for every conference room.

 

Set-CalendarProcessing -Identity <Conference Room Name or Email Address> -ProcessExternalMeetingMessages:$true

Firefox : NS_ERROR_NET_INADEQUATE_SECURITY


In my case, I see Exchange 2016 OWA or ECP site will not open in Firefox or Chrome or Edge browsers. In Firefox I was getting this error:

NS_ERROR_NET_INADEQUATE_SECURITY

 

The solution for Firefox:

Open Firefox, type about:config in address bar. Search for http2, find and disable Network.http.spdy.enabled.http2. Close and reopen Firefox.

http2firefoxsetting

 

Solution, If you have access to the server:

Download and run IIS Crypto tool on the Windows Server. Click on “Best Practices” button, which chooses the protocols and chiphers as below. Reboot your server.

iiscrypto

 

Exchange: Distribution Group is rejecting emails from external email address


You set the distribution group to receive emails only from specific senders in the delivery management section of the DL properties. Now an email from external source sent to this DL and it fails with the NDR with the following error message:

#550 5.7.1 RESOLVER.RST.NotAuthorized; not authorized ##

DL-Properteis

Error message says it can not resolve the external email address. The solution is very simple.

Create an Exchange mail contact for the external email address that sends emails to the distribution group.

And, add the Exchange contact to the allowed senders list in delivery management section. That’s all.

Windows: How to change the network from Public to Private?


On my Windows 10, I found the network is set to Public network. That means you can’t share anything to/from other computers. When you connect to a new network, Windows gives you an option to share files with another computer on the network. If you check that box, the network is flagged as Private. If you missed it, the network is flagged as Public. It looks like this:

PublicNetwork

I tried to change that network back to the Private network. For some reason, Windows 10 didn’t give me any to option to change the network type anywhere in GUI settings.

But I found how to do it in PowerShell. If you want to change the network type, open the PowerShell with Administrative Privileges (Right click on PowerShell, Run as Administrator) and run these commands:

Run this command and note down “InterfaceAlias” of the network you want to change.

Get-NetConnectionProfile

Store the Network connection profile of the network to a variable (enter the interface alias you noted down from the previous command) :

$netprofile = Get-NetConnectionProfile -InterfaceAlias <Interface Alias name>

Change the Network Category to “Private” or “Public” in the object stored in $netprofile:

$netprofile.NetworkCategory = "Private"

Set the network profile with the modified object:

Set-NetConnectionProfile -InputObject $netprofile

You can close the PowerShell now. Check your network, it should be changed now.

PrivateNetwork