Skip to content

Commit f7571ec

Browse files
committed
Merge branch 'master' of github.com:bobacadodl/ctfx-problems
2 parents d3cf937 + da392fd commit f7571ec

File tree

16 files changed

+65
-56
lines changed

16 files changed

+65
-56
lines changed
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM jaschac/debian-gcc:latest
2+
3+
RUN apt-get update
4+
RUN apt-get install -y socat
5+
RUN rm -rf /var/lib/apt/lists/*
6+
RUN gcc -o dat_boinary -m32 -fno-stack-protector dat_boinary.c
7+
RUN rm dat_boinary.c
8+
RUN socat tcp-listen:1337,fork,reuseaddr exec:”./dat_boinary"
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Deploy Instructions
2+
* cd into directory
3+
* `docker build -t ctfx/datboi .`
4+
* `docker run -p <host port>:1337 -d ctfx/datboi`

crypto/little_crypto_gambler-150/gamble_solution.py

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ def gcd(a, b):
1414
return a
1515
else:
1616
return gcd(b, a % b)
17-
def modinv(a, m):
18-
g, x, y = xgcd(a, m)
19-
if g != 1:
20-
raise Exception('modular inverse does not exist! g=%i'%g)
21-
else:
22-
return x % m
2317
def solve(s):
2418
nrand = len(s)
2519
t = []

forensics/iTrash-100/writeup.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Mount the file system, find gesture.key, and follow this article:
2+
3+
http://resources.infosecinstitute.com/android-forensics-cracking-the-pattern-lock-protection/

misc/cafebabe-150/writeup.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Split cafebabe.jpg into equally sized digit images. XOR digit images with known
2+
digit images; the darkest image out of all of them is what the unknown digit image is.
3+
4+
Extract the hex and run it as a java class file to get the flag.

misc/hows_the_cow-50/.python-version

-1
This file was deleted.

misc/hows_the_cow-50/flag.txt

-1
This file was deleted.

misc/hows_the_cow-50/prob.py

-44
This file was deleted.

misc/hows_the_cow-50/statement.txt

-1
This file was deleted.

misc/message-100/message.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
00011101010110111011111010110101010100101101011111100011000111000100010001001100110100001000011001110001111101101011110010010110110010111011000101111000011101000000111110011011000111111110101000001010011011000011001010000001110011101110101110111001001101011110111011001101100101111001111100001000010100001000000101111100111000110100001001111

misc/message-100/sol.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#this program decodes the full message, but due to precision errors,
2+
#the flag was changed to being the first 11 characters.
3+
4+
s = "00011101010110111011111010110101010100101101011111100011000111000100010001001100110100001000011001110001111101101011110010010110110010111011000101111000011101000000111110011011000111111110101000001010011011000011001010000001110011101110101110111001001101011110111011001101100101111001111100001000010100001000000101111100111000110100001001111"
5+
val = int(s,2)
6+
7+
print(val)
8+
9+
# Base 26 Weighted by frequency
10+
prob = [0.08167, 0.01492, 0.02782, 0.04253, 0.12702, 0.02228, 0.02015, 0.06094, 0.06966, 0.00153, 0.00772, 0.04025, 0.02406, 0.06749, 0.07507, 0.01929, 0.00095, 0.05987, 0.06327, 0.09056, 0.02758, 0.00978, 0.0236, 0.0015, 0.01974, 0.00074]
11+
12+
prefix = [0 for i in range(27)]
13+
prefix[0] = 0.0
14+
for i in range(1, 27):
15+
prefix[i] = prefix[i - 1] + prob[i - 1]
16+
17+
l = 80
18+
ans = ""
19+
delta = 2 ** len(s)
20+
for i in range(l):
21+
tmp = [round(x*delta) for x in prefix]
22+
it = 0
23+
while it < 26 and tmp[it] < val:
24+
it += 1
25+
it -= 1
26+
ans += chr(it + 97)
27+
val -= tmp[it]
28+
delta = tmp[it+1] - tmp[it]
29+
30+
print(ans)

misc/message-100/statement.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
Arithmetic coding is great for sending secret messages.
2-
3-
00011101010110111011111010110101010100101101011111100010000111111001000010100000011000010111101000001000011101010111000111000011011111011111101101100100001101110111111010101010011001100011101110010010101010000110100110001011100100110111010110100001101111111100100111000100100000001111000110011111100100010011001111010001000101100000100100011
1+
Arithmetic coding is great for sending secret messages.

web/harambehub-100/deploy/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM openjdk:latest
2+
3+
# Create app directory
4+
RUN mkdir -p /usr/src/app
5+
WORKDIR /usr/src/app
6+
7+
COPY . /usr/src/app
8+
9+
EXPOSE 8080
10+
CMD [ "java", "-jar", "harambehub.jar" ]

web/harambehub-100/deploy/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Deploy Instructions
2+
* cd into directory
3+
* `docker build -t ctfx/harambehub .`
4+
* `docker run -p <host port>:8080 -d ctfx/harambehub`

0 commit comments

Comments
 (0)