This study focuses on the strategies used by the "xz backdoor", an extremely
complex piece of malware that contains its own x64 disassembler inside of it
to find critical locations in your code and hijacks it by swapping out your
code with its own as it runs. Because this a machine-code based attack,
all code written in any program language can be attacked and is vulnerable.
Instead of targeting sshd directly, the xz
backdoor injects itself in the parent systemd process then hijacks the
GNU Dynamic Linker (ld), before sshd is even started or libcrypto.so is
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <signal.h> | |
#include <string.h> | |
volatile int running = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://ixday.github.io/post/golang-cancel-copy/ | |
import ( | |
"io" | |
"context" | |
) | |
// here is some syntaxic sugar inspired by the Tomas Senart's video, | |
// it allows me to inline the Reader interface | |
type readerFunc func(p []byte) (n int, err error) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"errors" | |
"math" | |
"time" | |
"log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
fsid="$1" | |
cephadm rm-cluster --fsid $fsid --force | |
source /etc/os-release | |
sudo systemctl stop tripleo_\* | |
sudo systemctl stop ceph\* | |
sudo pcs cluster destroy | |
if [ $VERSION_ID == "7" ]; then | |
sudo docker ps -a -q | xargs docker rm -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Debug Kernel", | |
"type": "cppdbg", | |
"request": "launch", | |
"program": "${workspaceRoot}/kernel/bin/kernel.elf", | |
"args": [], | |
"stopAtEntry": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# INSIDE WSL, install gdb (one-time instruction) | |
sudo apt install gdb | |
# Add the following to your kernel Makefile CFLAGS, so that gcc will generate | |
# debug symbols that the debugger can use | |
# Note: The thing being added is -g, so as of lesson 12 it should look like this. | |
# Delete all the contents of the lib folder to force a recompile | |
CFLAGS = -ffreestanding -fshort-wchar -g | |
# Add the following to your qemu invocation and start QEmu: |
The documentation recommends you do this using virsh net update
, but you'll need to read it very carefully to figure out exactly how -- because they provide you with only a
single example to work with.
Only the following virtual network components can be changed using net-update:
ip-dhcp-host
ip-dhcp-range (add/delete only, no modify)
forward-interface (add/delete only)
NewerOlder