Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

rev/simple-asm #16

Merged
merged 2 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions rev-no-asm-required/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM --platform=linux/amd64 ubuntu@sha256:86ac87f73641c920fb42cc9612d4fb57b5626b56ea2a19b894d0673fd5b4f2e9 AS build

RUN apt-get update -y && apt-get install -y gcc wget unzip && rm -rf /var/lib/apt/lists/*

RUN wget -Oynetd.c https://raw.githubusercontent.com/johnsonjh/ynetd/master/ynetd.c \
&& gcc -o ynetd ynetd.c \
&& rm -f /tmp/ynetd.zip

COPY main.c .

RUN gcc -o chall main.c

FROM --platform=linux/amd64 ubuntu@sha256:86ac87f73641c920fb42cc9612d4fb57b5626b56ea2a19b894d0673fd5b4f2e9

RUN useradd -m -d /home/ctf -u 12345 ctf
WORKDIR /home/ctf

COPY --from=build chall chall
COPY --from=build ynetd ynetd

RUN chmod +x ./ynetd

COPY flag.txt .

RUN chown -R root:root /home/ctf

USER ctf
EXPOSE 9999
CMD ./ynetd -p 9999 ./chall
23 changes: 23 additions & 0 deletions rev-no-asm-required/chall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: No Assembly Required
categories:
- rev
value: 50
flag:
file: ./flag.txt
description: >-
That's right! This challenge works right out of the box!
No need to assemble anything, all totally preassembled.
hints:
- If it comes pre-assembled, all u can do is disassemble right?
- Heard of Ghidra?
files:
- src: /home/ctf/chall
dest: chall
container: nc
authors:
- Andrew
visible: true
deploy:
nc:
build: .
expose: 9999/tcp
1 change: 1 addition & 0 deletions rev-no-asm-required/flag.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
camp{FACT:CPUs_arE_pRe_A5SEmbLed_too..._0caec8a70f9a2}
31 changes: 31 additions & 0 deletions rev-no-asm-required/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <stdio.h>
#include <stdlib.h>

static int NO_ONE_WILL_EVER_FIND_THIS_mwahahahahaha = 0x6FED;

int main(int argv, char **argc) {
int lol = 0xf00d;

puts("Hey.");
sleep(1);
printf("Password? ");
int password = 0;
scanf("%d", &password);

int actual_password = lol | (NO_ONE_WILL_EVER_FIND_THIS_mwahahahahaha << 16);

if (actual_password == password) {
system("/bin/sh");
} else {
puts("Cool");
sleep(1);
puts("Yeah thats wrong!");
}

return 0;
}

//
// Hello people who solved this
// How does it feel to have shell haha
//
1 change: 1 addition & 0 deletions rev-no-asm-required/solve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ghidra
Loading