Saturday, March 3, 2018

PowerShell Constrained Language

PowerShell Constrained Language is a language mode of PowerShell designed to restrict access to sensitive language elements that can be used to invoke arbitrary Windows APIs.

To view current parameter level, use the command:

$ExecutionContext.SessionState.LanguageMode

image

To set Constrained Language, use the command:

$ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage"

image

To set the parameter for future sessions, use the following command within an elevated prompt:

[Environment]::SetEnvironmentVariable('__PSLockdownPolicy', '4', 'Machine')

image

https://blogs.msdn.microsoft.com/powershell/2017/11/02/powershell-constrained-language-mode/

https://itfordummies.net/2015/06/01/powershell-constrained-mode/

https://adsecurity.org/?p=2921

Pi-hole

Pi-hole is an application for Linux that is a DNS black hole.  It can be used to block Internet advertisements on a network level.

https://pi-hole.net/

https://github.com/pi-hole/pi-hole/

Strict Site Isolation with Google Chrome

Starting with version 63, Chrome has a new security feature named Strict Site Isolation.  Below is an explanation of this feature:

Google’s site isolation feature improves security for Chrome browser users. When you enable site isolation, content for each open website in the Chrome browser is always rendered in a dedicated process, isolated from other sites. This creates an additional security boundary between websites.

To enable this option, use the URL chrome://flags/#enable-site-per-process and click the enable button.

image

To use a command-line shortcut, use the switch "--site-per-process".

image

CompactGUI

CompactGUI is a visual interface for the Windows 10 Compact function.

https://github.com/ImminentFate/CompactGUI

https://www.howtogeek.com/342016/how-to-shrink-your-pc-game-files-with-compactgui-and-save-drive-space/

How to uninstall a driver within Windows using pnputil

Windows has an utility named pnputil to list or uninstall installed drivers.  To create a list of current drivers, use the following command within an elevated command prompt.

pnputil.exe –e > c:\temp\driverexport.txt

image

image

To remove an existing driver, use the following command.

pnputil.exe –d oem_number.inf

image

If an error is returned, add a –f switch.

pnputil.exe –f –d oem_number.inf

In addition to finding the OEM number value within the .TXT file, the same value can be found via Device Manager –> Properties –> Details tab –> INF Name drop-down value.

image

Malware Museum

The Malware Museum is a collection of malware programs from the 1980’s and 1990’s.

https://archive.org/details/malwaremuseum

Automatic backup path for Microsoft Edge bookmarks

Starting with Windows 10 version 1709, a backup is made of Microsoft Edge bookmarks or favorites on a regular basis.  The path to this backup is:

%UserProfile%\MicrosoftEdgeBackups\backups

The file format is a .HTML file.

image

How to disable Apple Music within iOS

To disable Apple Music within the Music app within iOS, access Settings –> Music and disable the “Show Apple Music” option.

image

Friday, February 9, 2018

Windows command line tricks

The command “title” can add some text to the command prompt.  For example, “title ADMIN” adds ADMIN to the text of the window.

image

To add a command line shortcut that remains visible, add a /k switch.  For example, “cmd.exe /k ipconfig.exe” will display information and remain on the screen.

image

image

The F7 key displays a list of previous commands.

image

The command “start.” will launch Windows Explorer at the current path.

image

Data can be piped to the clipboard by using “| clip”.  For example, “ipconfig | clip” will copy data to the Windows Clipboard.

image

To view all available Control Panel and Management Console shortcuts, use the command “dir *.cpl & dir *.msc” under Windows\System32.

image

Additional shortcuts can be found using the command “dir SystemProperties*”.

image

Chrome Connectivity Diagnostics

Chrome Connectivity Diagnostics is an extension that performs several network-based tests.  The tool tests a computer's network connection for common issues, port blocking, and network latency by establishing connections to network and Internet services via UDP, TCP, HTTP and HTTPS.

https://chrome.google.com/webstore/detail/chrome-connectivity-diagn/eemlkeanncmjljgehlbplemhmdmalhdc

image