Disabling UAC in Windows 11 using the registry

  1. Press Windows Key + R to open the Run dialog.
  2. Type regedit and press Enter.
  3. Navigate to the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  1. In the right-hand pane, find the value named EnableLUA.
  2. Double-click on EnableLUA.
  3. Change the Value data from 1 to 0.
  4. Click OK to save the changes.
  5. Restart your computer for the changes to take effect.

Hide a User from the Windows Login Screen

Getting the exact username

  1. Press Windows Key + R to open the Run dialog.
  2. Type netplwiz and press Enter.
  3. The User Accounts window will list all user accounts on your Windows machine. The usernames are displayed in the “User name” column.

Using the Registry Editor

  1. Open the Registry Editor:

    • Press the Windows key + R.
    • Type “regedit” and press Enter.
  2. Navigate to the Winlogon Key:

    • Go to this path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  3. Create SpecialAccounts and UserList Keys:

    • Right-click on “Winlogon” and select New -> Key. Name it SpecialAccounts.
    • Right-click on “SpecialAccounts” and select New -> Key. Name it UserList.
  4. Create a DWORD Value:

    • Right-click within the “UserList” key.
    • Select New -> DWORD (32-bit) Value.
    • Name the DWORD the exact username of the account you want to hide.
    • Double-click the new DWORD and set its value data to 0.
  5. Restart: Close the Registry Editor and restart your computer.

Deploy applications in Run as Administrator mode in Windows using Visual Studio and Inno Setup

Add the following line in your [Setup] section. This is the primary way to indicate that your installer requires administrative rights.

[Setup]
...
PrivilegesRequired=admin
...

Consider embedding an appropriate manifest into your application’s executable to have it automatically request elevation when executed outside the installer. This can provide a more seamless experience for the user.

1. Create the Manifest File:

  • Right-click on your project in the Solution Explorer and select Add -> New Item….
  • Choose Application Manifest File (it might be under the General category).
  • The default name is typically app.manifest. Keep this name or adjust it if necessary.

2. Modify the Manifest:

  • Open the newly created app.manifest file. The default content will be similar to this:

<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v1">
        </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
  • Inside the <requestedPrivileges> element, add the following line:
<requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />

3. Embed the Manifest:

The manifest is now created, but you need to tell Visual Studio to embed it into your executable:

  • Right-click on your project and select Properties.
  • Go to the Application tab.
  • Under Manifest, select Embed manifest with default settings.

Build the Project:

Rebuild your project. The generated executable will now have the UAC manifest embedded, causing your application to request administrative privileges when run.

Install Redis on Windows using WSL

Turn on Windows Subsystem for Linux

Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Launch Microsoft Windows Store and then search for Ubuntu, or your preferred distribution of Linux, and download the latest version.

Install Redis server

sudo apt-add-repository ppa:redislabs/redis
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install redis-server

Restart the Redis server

sudo service redis-server restart

Verify if your Redis server is running

 $ redis-cli
 127.0.0.1:6379> set user:1 "Jane"
 127.0.0.1:6379> get user:1
"Jane"

Stop the Redis Server

sudo service redis-server stop

References
https://developer.redis.com/create/windows/
https://redis.io/docs/install/install-redis/install-redis-on-windows/

Disable wermgr.exe on Windows

Using Services

  1. Press Win + R to open the Run dialog.
  2. Type services.msc and press Enter.
  3. Scroll down and locate the Windows Error Reporting Service.
  4. Right-click on it and choose Properties.
  5. In the Startup type dropdown, select Disabled.
  6. Click Apply and then OK.

Using Registry Editor

  1. Press Win + R to open the Run dialog.
  2. Type regedit and press Enter.
  3. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting.
  4. Create a new DWORD value named Disabled and set its value to 1.

 

Shutdown or Restart Windows Automatically

In Windows, you can use the shutdown command to shutdown or restart your computer automatically. This can be useful for a variety of purposes, such as:

  • Scheduling a shutdown or restart at a specific time.
  • Shutting down or restarting your computer after a long period of inactivity.
  • Shutting down or restarting your computer after a software update has been installed.

To shutdown or restart your computer automatically, you can use the following commands:

Shutdown:

shutdown /s /f

This command will shutdown your computer immediately. The /s switch tells Windows to shutdown, and the /f switch tells Windows to force all running applications to close.

Restart:

shutdown /r /f

This command will restart your computer immediately. The /r switch tells Windows to restart, and the /f switch tells Windows to force all running applications to close.

You can also use the /t switch to specify a delay before the shutdown or restart occurs. For example, the following command will shutdown your computer in 15 minutes:

shutdown /s /t 900

The /t switch takes a number of seconds as its argument. So, in this example, the shutdown will occur after 900 seconds, which is equal to 15 minutes.

To use the shutdown command, you need to open a command prompt with administrator privileges. You can do this by pressing Windows+R and typing cmd. Then, press Ctrl+Shift+Enter to open the command prompt as administrator.

Once you have opened the command prompt, you can type the shutdown command and press Enter. Your computer will then shutdown or restart automatically, depending on the command you used.

Here are some additional examples of how to use the shutdown command:

  • To shutdown your computer at 10:00 PM tonight, you would use the following command:
shutdown /s /t 14400
  • To restart your computer after 30 minutes of inactivity, you would use the following command:
shutdown /r /t 1800 /f
  • To shutdown your computer after a software update has been installed, you would use the following command:
shutdown /s /t 0 /c "Software update has been installed"

The /c switch allows you to specify a message that will be displayed before the shutdown or restart occurs.

Reset File and Folder Permissions to Default in Windows

File and folder permissions in Windows control who has access to files and folders, and what they can do with them. By default, Windows assigns permissions to files and folders based on the user’s account type. For example, users who are members of the Administrators group have full control over all files and folders on the system.

However, it is possible for users to change the permissions for files and folders. This can be done accidentally, or it can be done maliciously. If you find that you have lost access to a file or folder, or if you are concerned that someone else has changed the permissions for a file or folder, you can reset the permissions to their default values.

How to Reset File and Folder Permissions to Default in Windows

To reset file and folder permissions to default in Windows, you can use the icacls command. The icacls command is a command-line tool that allows you to view, modify, and reset file system permissions.

The following command will reset the file and folder permissions for the d:\docs directory and all of its subdirectories to the default inherited permissions:

icacls d:\docs /reset /t /c

What does the command do?

The icacls command has a number of switches that allow you to specify what you want to do with the permissions. The following are the switches that are used in the command above:

  • /reset: This switch tells the command to reset the permissions to the default inherited permissions.
  • /t: This switch tells the command to apply the change to all files and folders in the specified directory and its subdirectories.
  • /c: This switch tells the command to continue even if there are errors.

Improve Network Speed in Windows by Increasing IRPStackSize

The I/O Request Packet Stack Size (IRPStackSize) is a registry setting that can affect network performance. A larger IRPStackSize value can improve network performance by allowing the computer to handle more data simultaneously.

To increase the IRPStackSize value, you need to edit the Windows registry. Here are the steps:

  1. Open the Registry Editor.
  2. Navigate to the following key:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
  1. Right-click the Parameters folder (or right-click an open area in the right-hand windowpane) and select New | DWORD (32-bit) Value from the context menu.
  2. Give the new key entry the name IRPStackSize.
  3. Double-click the new IRPStackSize key you just made and change the value base to Decimal and change the Data value to 32.
  4. Click OK to save your changes.

After you have made these changes, you need to restart your computer for them to take effect.

Note: The IRPStackSize value is a system-wide setting, so it will affect all network connections on your computer.

How much can I expect to improve my network speed?

The amount of improvement you see in your network speed will depend on a number of factors, including your hardware, your network configuration, and the type of traffic you are using. In general, you can expect to see a small improvement in your network speed after increasing the IRPStackSize value.

Install Kali Linux in the Windows using WSL

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Once rebooted, open the Windows App store and search for the “Kali Linux” application, or alternatively click here to go there directly. Install the app and enjoy Kali!

Install Kali Linux Metapackages

sudo apt update
sudo apt full-upgrade -y
sudo apt install -y kali-linux-default

Install Win-KeX

Win-KeX provides a Kali Desktop Experience for Windows Subsystem for Linux (WSL 2)

sudo apt update
sudo apt install -y kali-win-kex

To start Win-KeX in Window mode with sound support, run

kex --win -s

To start Win-KeX in Enhanced Session Mode with sound support and arm workaround, run

kex --esm --ip -s

To start Win-KeX in Seamless mode with sound support, run

kex --sl -s

Optional Steps

If you have the space, why not install “Kali with the lot”?

sudo apt install -y kali-linux-large

References
https://www.kali.org/blog/kali-linux-in-the-windows-app-store/
https://www.kali.org/docs/general-use/metapackages/
https://www.kali.org/docs/wsl/win-kex/