A sample and extended code snippnet for copying data between kernel and userland. please refer to 3.1.5 Accessing User Memory(https://web.stanford.edu/~ouster/cgi-bin/cs140-spring18/pintos/pintos_3.html#SEC39) for more details.
#!/bin/bash | |
# Print the biggest computing chunk | |
smax () | |
{ | |
max_node="N/A"; | |
max_cores=0; | |
for node in `sinfo --Node $*| awk 'BEGIN {FS=" "} {if(NR > 1) print $1}' | uniq`; | |
do | |
idle=`sinfo -o%C --nodes $node | awk 'BEGIN {FS="/"} {if(NR == 2) print $2}'`; | |
if [ $idle -gt $max_cores ]; then |
diff --git a/Makefile b/Makefile | |
index 5ac4ad6..4055a78 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -6,7 +6,7 @@ | |
# 2/13/16 | |
# *********************************************************************** | |
SAMTOOLS=./diffsplice/src/parse_bam/samtools-0.1.18/ | |
-BOOST=./boost_1_60_0/ | |
+BOOST=/usr/include/boost |
gimmie: helper.c | |
gcc helper.c -o gimmie -s | |
rm gimmie.gz | |
gzip --best --keep gimmie | |
python mover.py > move.sh |
This is a write-up for the task 0av
from zer0pts CTF 2022.
The problem provides a connection to a VM instance. There, you can find the flag file flag.txt
under directory /playground
. The flag file has all the permissions that you need, so you can just cat flag.txt
to get the flag.
Of course not. In the background, there is an antivirus process called 0av
running in root permissions, inspecting any file open attempts.
This is a write-up for the pwning task ARVM from Codegate2022 Preliminaries.
This problem is basically an ARM32 emulator built on ARM32. In this program, we are allowed to run about 4000 bytes of shellcode. However, it wouldn't even be a challenge if that was all. The program analyzes the shellcode and emulates its behavior to verify it against some criteria.
To analyze the program, the program state is managed with the following structure.
This is a write-up for the web? and pwning task SW Expert Academy from SSTF 2021
In this problem we are given a website that presents an algorithm problem. In short, its about calculating a chance of winning in a dice game, where two 6-faced dices are given. For example, when a dice with faces 3, 4, 3, 4, 3, 4
and the other dice with 1, 1, 1, 1, 8, 9
are given, the program should print out 2/3
which is the chance of the first dice winning.
Actually, this is not really a coding challenge, as there are only three fixed test cases which are given as examples. The three test cases are given below.
This is the Write-Up from the CTF codegate 2020 teaser.
The problem is basically a brainfuck emulator, compromised of a python script main.py
and a shared object runtime.so
. These scripts use the llvmlite
to introduce JIT into it.
according to the dockerfile, the flag is located at /home/user/flag
, so we need to pwn the babyllvm to get a shell.
This is a write-up for the challenge eyes of a panther from Oh My Hack International CTF 2021.
We are only provided with a objdump
-flavored disassembly. The disassembly is attached for you to take a look at. It is a bit modified so there are no disassemblies that spans over two lines.
#!/usr/bin/python3 | |
import re | |
import sys | |
import docker | |
ID_PATTERN = re.compile("[0-9a-f]{12}") | |
DOCKER_CONTAINERS = docker.from_env().containers | |
def get_ppid(pid: int) -> int: |