Skip to content

Instantly share code, notes, and snippets.

View Stfort52's full-sized avatar

Jaehoon Baek Stfort52

  • POSTECH, Lab of Computational Biology
  • South Korea
  • 22:39 (UTC +09:00)
View GitHub Profile
@Stfort52
Stfort52 / smax.sh
Created July 6, 2022 03:35
More on slurm
#!/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
@Stfort52
Stfort52 / SingleSplice.diff
Last active June 12, 2022 10:30
Regarding running SingleSpilce.
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
@Stfort52
Stfort52 / pintos-uk-copy.md
Last active October 30, 2023 11:46
inline assembly snippets for pintOS
@Stfort52
Stfort52 / Makefile
Last active May 10, 2022 08:12
Write-up for the task `readflag` from zer0pts CTF 2022
gimmie: helper.c
gcc helper.c -o gimmie -s
rm gimmie.gz
gzip --best --keep gimmie
python mover.py > move.sh
@Stfort52
Stfort52 / 0av.md
Last active November 22, 2022 01:47
Write-up for the task `0av` from zer0pts CTF 2022.

zer0pts 2022 0av

This is a write-up for the task 0av from zer0pts CTF 2022.

Analysis

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.

@Stfort52
Stfort52 / _ARVM.md
Created February 28, 2022 08:50
Write-up for pwning task ARVM from Codegate2022 Preliminaries

Codegate2022 Preliminaries ARVM

This is a write-up for the pwning task ARVM from Codegate2022 Preliminaries.

Analysis

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.

@Stfort52
Stfort52 / _SWExpertAcademy.md
Last active August 18, 2021 07:41
Write-up for the web/pwn task from Samsung Hacker's playground 2021

SSTF 2021 SW Expert Academy

This is a write-up for the web? and pwning task SW Expert Academy from SSTF 2021

Analysis

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.

@Stfort52
Stfort52 / Babyllvm.md
Last active August 11, 2021 16:43
Write-up for the pwning task babyllvm from codegate quals 2020

Codegate 2020 Teaser Babyllvm

This is the Write-Up from the CTF codegate 2020 teaser.

problem

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.

goal

according to the dockerfile, the flag is located at /home/user/flag, so we need to pwn the babyllvm to get a shell.

analysis

@Stfort52
Stfort52 / _EyesofaPanther.md
Last active August 30, 2021 05:24
Write-up for the challenge Eyes of a Panther from OMH CTF 2021

OMH International CTF 2021 Eyes of a Panther

This is a write-up for the challenge eyes of a panther from Oh My Hack International CTF 2021.

Problem

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.

@Stfort52
Stfort52 / which-container.py
Created August 10, 2021 12:13
Script to find out which container is running the process
#!/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: