Showing posts with the label not security

How To Replace CMD With Windows Terminal In The Winkey + X Shortcut Menu

I want to upgrade from CMD to Microsoft's fancy & shiny Windows Terminal. However, the Windows Key+X then C shortcut I use to open a shell (or Windows Key + X then A for Powershell by default) doesn’t support opening Windows Terminal. Here’s how I patched that keyboard shortcut to open Windows Terminal. Disclaimer: This is my own patchy fix found for fun at 4am after a night of hacking. Proceed at your own risk. How To Replace CMD With Windows Terminal In The Winkey + X Menu Shortcut Option 1: Via Powershell Ensure the Winkey+X C shortcut opens cmd (and not powershell) by going to Settings > Personalization > Taskbar. Set “Replace Command Prompt with PowerShell …” to Off Open Powershell. I use Winkey + R, then type “powershell” and enter. Copy and paste the following code snippet into the powershell window # modify Winkey + X, C $shortcut = (New-Object -ComObject 'WScript.Shell').CreateShortCut("C:\Users\$env:UserName\AppData\Local\Microsoft\Windows\WinX\

Python2 to Python3 Hex/Str/Byte Conversion Cheatsheet For Hackers

If you too have been personally victimized by Python3’s 'str' object has no attribute 'decode' exception or other string/bytes-related exceptions, I feel your agony. Trauma from such errors have stopped me from using Python3 for code handling buffers, like POCs for vulnerabilities or CTF exploits. Here’s a reference guide on how to convert between Python3’s hexstr/str/bytes/bytearray. Python3 Buffer Type Review str An immutable unicode string Created statically using quotes.  Example: mystr = “don’t forget your daily calcium” hexstring A str consisting of hexadecimal numbers (0-9, a-f).  Primarily used to convert binary data to a printable format.  Created like str, but contains only hexadecimal numbers Example: “calc” is “63616c63” bytes An immutable array of one-byte elements Created statically by putting the letter “b” before quotes Example: mybytes = b“bring all the boys to the yard” bytearray  A mutable list of one-byte elements Created through the bytearray c

Bash LS Coloring Internals: How Does `ls` Know Which Colors To Use?

Many of us take for granted ls 's convenient display, and probably didn't ever stop to consider how it even knows which colors to use for which files. This very question sparked my curiosity and lead me to researching the internals of this mechanism. While ls is open source and you can read its code to understand the underlying logic, I decided not to do so as I wanted to take a black box approach. tl;dr at end of post How Does ls  Identify File Types? Do File Contents Matter? I engineered two simple test to check if ls takes into account a file's content when it chooses its color: I created empty files each with a different extension and ran ls to see which colors it selected for the files I exchanged the contents of an image and executable and ran ls to see which colors it selected for the files The first experiment showed that ls uses the filename's extension to select a color when the file is empty. Experiment #1: ls colors empty files

Garbage CAN!

I often take breaks from vulnerability hunting, and occasionally I find myself doing some really random things. For example, I stumbled across this poster and decided to make a version of my own. I wanted to make one that is slightly more offensive so that it can be gifted to a good friend. Here is the final result: GARBAGE CAN I used this image by PTNorbert with its free commercial license