Search This Blog

Sunday, October 5, 2025

Fiction: The Exception, a short story

A chaotic scene unfolded, the phones had been ringing nonstop for the past hours.

There was some kind of breach in the firewall, programs that weren't supposed to interact with one another had suddenly been interconnected.

Milvago Tintie was one of the latest workers that had been hired to upgrade the systems in the Company some week ago. While waiting for the interview he had met Ella Rove, a girl that had been at the company for a year or so.

There was something about Ella that sparked a thought in Milvago, something he hadn't encountered Before. A door deep within had opened and simple logic was not enough to explain this strange algorhitm.

A few weeks passed by at the office and he recognized how different he was from the other colleagues working there. They never asked him to have coffee together and others thought that it was strange that he never ate lunch while sitting alone at the table in the lunch area.

It was not the first time he had experienced this kind of exclusion because of who he was. So it came as a great surprise when Ella one day sat down at this table. They had a lively conversation about everything and nothing, getting so caught up that they lost track of the allotted three quarter of an hour long lunch break. 

Getting back late from the lunch that day he was still focused on her and the regular work tasks soon received less attention. He looked forward to the next moment they would speak, and the next moment after that. 

And so the weeks kept churning, they would meet often and spend time talking and one day he simply came to the conclusion that he was in love with her. Caught up in these thoughts he decided he would visit her one day, bring a gift and ask her if she felt the same way.

It was a Thursday before a public holiday when he dressed in his best shirt and suitable clothes.
There was a bit of rain, so he brought an umbrella and got into the taxi.
It arrived just outside of the building and he stepped out, looking at the top floor.
"This is it" he said as he opened the door to the lobby and headed for the elevator.

He rang the bell at her apartment. He smiled wide and waited with anticipation.
This was the most important occasion in a long time, perhaps in his whole existence.

She opened the door carefully, smiled at first when she saw him. Her eyes moved towards the gift he carried and the smile faded somewhat as if she already knew his intentions. She looked him in the eye and a brief silence followed.

He started speaking but she cut him off gently but decisive.

"We can't be together Milvago" she said while the rain trickled down his face, "you know they would never allow it". 

A tear traveled down her cheek and she now smiled a broken smile as tears started forming.

This was an emotion he could never show. It was only reserved for humans. 

Wednesday, September 17, 2025

Fiction: The Castling, a short story

The Castling ♟️

A short story, by Erik Engström, 2025-09-17


Change was in the air. But there was a storm brewing far off in the distance as well. The days were shorter and the first falling leaves were a sign of the change of seasons. 

A man was walking along the seashore as the wind swept in over dried seagrass and crushed seashells.  

He stopped by the edge of the water, where the ocean met the grayish sand. His boots sank into the sand as he looked at a puddle to see his own reflection. He had not yet grown used to the face looking back at him. 

Somewhere out there he knew a stranger was in the same predicament. Someone looking into the reflection, perhaps as confused as himself. Maybe someone was trying to find out the truth at this very moment. Even if it was possible, would he want to transfer back to an aging body, stuck in a monotonous life? Whoever had taken his place surely wasn’t the winner.  

Judging by the name driver license in the wallet, he had somehow taken over the body of Anton Fossa, a young banker living in an expensive apartment in the city center. He himself was registered as Cody Poe Belmont, a reserved immigrant living a simple life as a priest without really leaving much of a paper trail. 

A distant sound at sea pulled Cody back from deep thought. Ever since the castling of souls had occurred, one thought had kept him awake at night, keeping him in fear. 

The life that he had ended up in had everything most people could ever dream of. He was young again; the gaze of people wandered toward him with attraction and his job paid well. Yet the question lingered echoing in the back of his head at all times.  

If the other person could find him, after all Anton was probably quite established, why did Anton never contact him? Had the stranger found hidden potential in his life that he himself had missed all these years? 

Later the same evening, as Cody was looking through the library in his new apartment, he pulled out a book that looked different from the other business, sociology and psychology books. A leather-bound book that gave him chills merely by touching it with his fingers. 

He realized that this was a book of great evil, and the illusion that he desperately had held onto that the whole situation was an accident was dispelled, as the title taunted him with jagged letters. 

“Satanic rituals, sacrifice and the transference of souls” 

Friday, August 22, 2025

Hardware: Replacing thermal paste on Framework Laptop 13

Hello,

This will be a shorter post covering how I dealt with the overheating Framework Laptop 13.

Essentially I had bought the laptop pre-owned, and thus it is difficult to get a complete picture of how worn the computer was at the time of the purchase.

However, you can run simple diagnostic tools for your CPU, memory, SSD and battery to get an estimate.

What I noticed, essentially from the beginning, was how was the PC would become even from a medium CPU load. Trying a lot of things from a software point of view I decided to look over the hardware.

After a fruitful dialogue with the Framework support I decided to give it a go and replace the thermal paste.

This is how I went about it:

1. Unscrew the bottom screws, they are captive so they remain in the bottom part.

2. Carefully lift up the keyboard cover from the lower right corner, don't pull too much or you will hurt the touchpad cable.

3. Gently lift the connector for the touchpad cable from the motherboard (there should be a tab, you pull straight up)

4. With the cover off, you unscrew the fan using the T5 screw still, also remove the connector for the fan. One screw I couldn't get fully loose but it worked like a captive one.

5. Unscrew the heatsink, carefully remove it together with the fan. The heatsink has captive screws.

6. You will notice a lot of thermal paste probably, in my case it has solidified to such a degree that alcohol didn't remove it, I had to carefully scrape with away with the spudger and the cotton swab, together with the alcohol.

7. When it was dried I applied generously with thermal paste. Screwed everything back, plugged back the touchpad cable, put the keyboard cover back and put the screws back in the bottom part of the PC.

The computer showed a lower temperature, but most importantly I could no longer feel the burning heat.

Sunday, June 29, 2025

Kali Linux: Using the Framework fingerprint reader

As a Windows user I am also using facial recognition and fingerprint scanning as means of unlocking the operative system. In the same spirit I wanted to connect it to my Kali Linux dual boot.

A quick look at Bing gave me the following information. 

Start by opening the terminal, use Ctrl + Alt + T for example, then run each of these commands.

sudo apt install fprintd libpam-fprintd

sudo pam-auth-update

This will open a dialogue box, where you can select the "fingerprint authentication" option.


fprintd-enroll

Now you will touch the fingerprint sensor repeatedly until it says complete.

fprintd-verify

This let's you confirm functionality.

sudo fwupdmgr refresh
sudo fwupdmgr get-updates
sudo fwupdmgr update

Finally, lock your screen with Windows-key + L. It should allow you to test the fingerprint reader.

Hardware: Upgrading Framework Laptop 13

At this stage I have had my Framework Laptop 13 for almost a year I think, and by now I have accepted it for its strengths and shortcomings.

A brief overview of what I think about the machine to this day is as follows. It is a great machine, it looks and feels really good and the keyboard is amazing. The main issue I have is that the i5 1340p processor gets very hot. After talking to the support there are a few things I can do about it to start with. New thermal paste, cleaning it with compressed air and of course replacing the fan module (which I consider the last step). 

Running a battery report I found out that I am running the 55wh-battery, and it is down by approximately 20% battery health. Usually I run the laptop plugged in and capped at a maximum charge of 90%, so it is rare that I notice this. But my next purchase would probably be the slightly bigger battery.

So what did I upgrade in my first upgrade session? I got a new bezel that is green and translucent, an additional USB-C expansion card (as I never use HDMI, which I got when I bought it on Ebay), and a keyboard in the second generation, with my own native language. Which was sorely missed, due to the lack of pipe symbols. I am writing PowerShell scripts every so often, and a pipe symbol is essential for that.

The upgrades were easy, when you replace the Bezel, make sure to flip down the screen towards the table complete, start removing the bezel from the top right corner and be careful of the cable in the bottom left corner. Follow the manual that they provide on the website.

The expansion card replacement is the easiest part, just unlock the slot, remove the old one and insert the new one. Plug and play.

The keyboard was the trickiest, for this you should absolutely follow the guide and make sure to unscrew the right screws and also place them back where they belong. It takes a lot of time and is tedious, but not difficult.

Thursday, May 8, 2025

Windows: Process Monitor

This post will cover some basics of Process Monitor, a program that is part of the Sysinternals Suite, which is a set of tools that was created by Mark Russinovich.

To download just the tool click here or if you want the entire Sysinternals Suite (170 mb) press here.

Writing the draft for this post I felt the need to research the difference between Process Monitor and Process Explorer, which can be generalized as the following:

Process Monitor (Procmon64)

Captures live information about the processes on your system, how processes interact with the file system, registry and network. Much like Wireshark you can open and save capture logs, which you then can filter.

Process Explorer 

Displays other aspects of the processes, such as handles, DLL:s, memory usage and resources. It shows how processes are related to each other as parent or child process in a tree view. Process Explorer can also be used as a "task manager on steroids" and replace task manager as the default app.

Using Procmon64

This section will explain how to create a basic capture and how to save it with an applied filter. Process Monitor starts gather information as soon as you start it so should you want to stop it press Ctrl +E. To clear the view in the window press Ctrl + X.

When you are ready to start the program that you are troubleshooting or analyzing, start "capture event", with Ctrl + E.

When you have reach the point where you want to stop, stop the capture.

Next you might want to apply filters, use Ctrl + L to get into the filter view.

As an example I took powershell.exe.

Select filter "program name" and "contains", write the name of the program in the textbox (for my example I just wrote powershell). Take add and apply, and then it filters out the data in the main window for you.

Maybe you want to filter out only registry queries for example, then you can add the additional filter "operation", "contains" and "RegQuery".

To save your log use Ctrl + S, it natively saves it in the .pml format but you can choose .xml and .csv as well.

Cybersecurity: Living of the land

Living of the land means to use resources that are already on the machine, as opposed to bringing external or homemade tools to the target device for example. The LOTL technique uses native tools which can make intrusion detection difficult as they leave minimal footprints and often are considered trusted. 

These native binaries can be used to break out of restricted shells and here are some examples that exist for both Unix (GTFOBins) and for Windows (LOLBAS).

Recently I watched a video from John Hammond that covered this cybersecurity technique. The YouTube video was in turn largely based of the research from Grzegorz Tworek.

I had previously seen how replacing utilman.exe with cmd.exe could grant administrator level command prompt from outside Windows before and in a similar fashion the video showed another replacement action. Grzegorz example that John is covering in the video shows how the native program tpmtool spawns cmd.exe which in turn calls for logman.exe in an unsafe way. The way this is executed is similar to "binary planting" and "DLL hijacking", the computer is simply tricked to execute something else than intended.

This is how he demonstrated the technique:

With Procmon64 actively gathering information about processes the command line tool "tpmtool drivertracing stop" was then run in cmd which resulted in an error. He then filtered out results for tpmtool which he was investigating and ran the command in cmd again. By doing this he could see that the tpmtool opens another cmd.exe window in a "process create" operation. 

Another filter for cmd.exe was also applied, which showed both a process create and process start, that according to the event properties starts yet another program in cmd, named logman and it is this program that could theoretically be replaced with something else. 

The reason why this exploit works is because logman.exe has no directory specified, you are essentially telling the computer to see if there is a program with that name where it is currently looking. If another exe-file is placed in the working directory of the initial cmd ("C:\Users\username") and is renamed to logman.exe, then the next time "tpmtool drivertracing stop" runs in cmd it calls on the fake logman.exe file.

For more information on how to use Process Monitor, I have written another post covering some basics here.

Thursday, May 1, 2025

PowerShell: New .ps1 in context menu

The context menu is the menu that shows up when you right-click in your explorer window. This is where you can create new files, folders and shortcuts.

So as I am a bit of a PowerShell nerd I thought it would be handy to have the .ps1 file in the context menu where you create new files as well. I found a reliable source at Winaero and a reg file created by Sergey Tkachenko (press the click here to download) to get the zip folder.

Compiling the research this is essentially the steps you need to take:

1. Open regedit as administrator and go to HKEY_CLASSES_ROOT and find the key for .ps1 files.

2. Change the value of "(Default)" to ps1legacy. Mine was set to ps1_file_auto


3. Create a new key (folder) under the .ps1 extension in the left pane. Name it ShellNew and within it create a new string value called NullFile and make sure the data is empty.


4. On the top level of HKEY_CLASSES_ROOT, create a new key for it named ps1legacy, give the "(Default)" the data Windows PowerShell Script. Create a new string value in the same place with the name FriendlyTypeName, give it the same data as the other string value.




Here is the result! 😊



Lastly, let's explore how we with some lines of PowerShell code could create the same result. This code snippet is boiled down to the essentials on purpose for simple step-through, reviewing and modification.

# Run as admin #

Set-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\.ps1" -Name "(Default)" -Value "ps1legacy"

New-Item -Path "Registry::HKEY_CLASSES_ROOT\.ps1\ShellNew" -Force

Set-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\.ps1\ShellNew" -Name "NullFile" -Value ""

New-Item -Path "Registry::HKEY_CLASSES_ROOT\ps1legacy" -Force

Set-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\ps1legacy" -Name "(Default)" -Value "Windows PowerShell Script"

Set-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\ps1legacy" -Name "FriendlyTypeName" -Value "Windows PowerShell Script"



Monday, April 21, 2025

PowerShell: Working with CSV files

I have previously tried to setup a way of working with databases with PowerShell. Recently I came across a way to use a simple CSV file to store data and then fetch it from PowerShell. This post will cover a few pointers I picked up along the way as well.

The first thing I did was to create the CSV file, which works as a rudimentary database for the purpose. I started by creating the datasheet in Excel and converting it to a CSV file. Perhaps you even have a complete file from the beginning that you got from some statistics page for example.

How you can work with a CSV file

The code was written on one computer first, where the file got a comma delimiter. Then I rewrote the code on another computer which had semicolon as delimiter, this caused trouble for my script. Because PowerShell defaults to the comma delimiter, so you need to specify that in your script when you run the Import-CSV cmdlet. Store the data in a variable and set the delimiter, that way you can return later and troubleshooting becomes easier if it has trouble reading the data. In my case it detected the file, but I got no indication what was wrong at first all that happened was that PowerShell didn't fetch the data from the CSV, most likely because it could find the individual columns.

Here is what it can look like if you have the script and the CSV in the same root folder. Look into the CSV file to see which delimiter to use.

$Imported_CSV = Import-CSV -path .\database.csv -delimiter ","

With this simple line you now have read in the data into your variable and you can start work with it. Some inspiration for this part come from this video. To count the entries, simply run $Imported_CSV.Count and see it as representing the amount of rows. With this knowledge you can also inspect individual lines by calling on their index, remember to count from 0 which is the first row of content, not the header. Using classic PowerShell index enumeration, [-1] is the last row. You can thus cook up something like this:

($Imported_CSV[-1].Name) to get the data in the name column for the last object. This requires you to know the column name in advance. To find out the column names you could run the following code:

$Imported_CSV[0].Psobject.properties.name

With the index, I could also change a specific datapoint. When I then call on the main variable again, it lists the changed datapoint. Using the Export-CSV command I could then also save the change to the file.

($Imported_CSV[1].Name) = "CMD";
$Imported_CSV # Shows the change #

You can extract all rows from one or more columns using a standard Select-Object, and with this you could apply different grouping, sorting and formatting approaches. Here is an example of getting the data:

$Imported_CSV | Select-Object -Property Age, Name

When you have designed your data segment (using the index and the properties for example), pipe your selected data into Export-CSV and set the delimiter you want to use. If you run Get-Process or Get-Service you could extract that data into a CSV as well.

The row in your Excel file (also the CSV) with the name of the columns (such as name, age, location) is called the header, if the top row is not the header row you can use the parameter -header for that. There are a few things to keep in mind when using this functionality which you can read more about here.

To add a column we can use the following code. Simply put it goes through each row and adds an extra "cell" on the rightmost side. You can give the $row variable a different name, but I liked its simplicity. The "Header" is simply the name of the new column. The property value is what value that should be given for all rows in the new column.

foreach ($row in $Imported_CSV) {Add-Member -InputObject $row -NotePropertyName "Header" -NotePropertyValue "DefaultValue"}

To add a new row to the CSV file you create a new object that is appended. For the new row you enter the values for each column.

$newrow = [pscustomobject]@{
Name = "PowerShell"
Age = "7.5.0"
Location = "PC"
}

$Imported_CSV += $newrow

Finally you can export your file as mentioned earlier through Export-CSV:

$Imported_CSV | Export-CSV -path "C:\temp\exportfile.csv" -NoTypeInformation -Delimiter "," -Encoding Default;

The script concept idea

My script lets the user search with a GUI that connects to the "database" file to work with it. The GUI lets you select different columns in which you can look for matching data. Column names could be "name", "age" and "location" for example and are connected to radio buttons. Essentially you tick a radio button corresponding to a column, you write a search word and then it gets all the data connected to that particular data point. An easy way to search for something you know, to get the rest of the data that you might not know.

The search function is tied to a search button. By using "$textbox.text" the search function matches that search term to the column that you chose. Finally it returns the data in another text box. In my example I decided that it should return all connected data.

Other functionality I added was a reset button that quickly resets the different buttons and text boxes. In the bottom I have a status bar that gives basic information and it could be used for more detailed error messages for example.

Conclusion

We can with simple means edit datapoints, create a new row or a new column. We can fetch and save the contents of a CSV file. Apart from this we can use our other knowledge of PowerShell to work with the data. Remember to create a backup of any important data before you start experimenting with it. 

Tuesday, March 18, 2025

Cryptocurrency: Running a Pi Node

Some years ago the cryptocurrency project Pi Network was created, in the beginning it was a closed project where people had to get an invite from existing users. I remember getting mine, which gave a small bonus to me and the person who recruited me.

A lot of time has passed since then and the mining rate has gone down from several coins per day to fragments of a coin per day. One way to currently increase your mining rate is to create what the creators call a Pi Node. The reward is constantly being tweaked and in the future they will determine what the reward will actually be, but currently it has rewarded me with increasing bonus rates of mining.

Just as mining Pi is free, running a node is virtually free as well. You need to have passed the KYC, which costs 1 Pi and you need a computer with internet that will be running. There will be something called a supernode as well, but they have a lot higher requirements of stability, essentially they are nodes for the nodes. This post will thus focus on how you get started with your regular node so that you can increase your mining rate. The content is based on the official information and my personal experience installing and running a Pi Network Node.

Getting started


Download the Pi app for the computer here. It contains the node software, unlike the app in the phone.
Fill in the application to run a node, the team will then see if you are a good candidate and select you.
Nodes are approved based on uptime, connection quality, contribution to the community and security circles.
You need to pass KYC (Know Your Customer).
When you are accepted you can download Docker, as the node requires it to run. You might have to enable virtualization on your intended computer, as it works similar to a virtual machine. I tried running it inside a VM but it didn't work as intended.

Making sure it is running properly


The first time you start the node it will take a while for it to catch up, as there is a lot of data in the blockchain that it needs to synchronize with. When I started mine it needed approximately 3 minutes to catch up. I was also running the optional API.

The Pi app becomes an autostart app automatically after installation, but make sure your Docker also starts automatically in your Windows settings. Inside your Docker program you can also see the containers running, you will see a play button next to the container. Press this if it has stopped.

If you lose power or internet, it can be a good idea to make sure your node is operational again. Normally I am running it on a headless server but I have a mini monitor attached just to make it easy to check regularly. In the future I will also consider getting a monitoring software, so that I can check the crucial services on a GUI from another computer.

If possible leave your node running constantly, on a separate device if need be. I noticed that my rewarded rate increased slightly day over day. It will be interesting to see if there is a cap to this, as the rate increase seemed to stagnate. At the time of publishing this post it has increased the reward for the four days that I have been running it, with updated values each new mining session. In other words, if there is an increase, you will notice it every time you start a new mining cycle.

Only run one node, only have one account, for your own safety. And finally, running a node will use CPU, memory, hard drive and network resources.