Skip to content

Commit 4baebfe

Browse files
author
Sajjad Arshad
committed
m0leCon 2020 Quals
1 parent 2ff3de5 commit 4baebfe

File tree

8 files changed

+88
-0
lines changed

8 files changed

+88
-0
lines changed

m0leCon/2020/Quals/babyk/babyk.c

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#include <linux/module.h>
2+
#include <linux/moduleparam.h>
3+
#include <linux/init.h>
4+
#include <linux/kernel.h>
5+
#include <linux/proc_fs.h>
6+
#include <asm/uaccess.h>
7+
#define BUFSIZE 100
8+
9+
static int leetness=20;
10+
module_param(leetness,int,0660);
11+
12+
static struct proc_dir_entry *ent;
13+
14+
static ssize_t babywrite(struct file *file, const char __user *ubuf, size_t count, loff_t *ppos)
15+
{
16+
int num, c, m;
17+
18+
char buf[BUFSIZE];
19+
20+
// if(*ppos > 0 || count > BUFSIZE)
21+
// return -EFAULT;
22+
23+
if(raw_copy_from_user(buf, ubuf, count))
24+
return -EFAULT;
25+
26+
num = sscanf(buf,"%d",&m);
27+
28+
if(num != 1)
29+
return -EFAULT;
30+
31+
leetness = m;
32+
33+
c = strlen(buf);
34+
printk("LEETNESS SCORE: %d", leetness);
35+
36+
*ppos = c;
37+
38+
return c;
39+
}
40+
41+
static ssize_t babyread(struct file *file, char __user *ubuf,size_t count, loff_t *ppos)
42+
{
43+
printk("READ NOT IMPLEMENTED YET");
44+
return 0;
45+
}
46+
47+
static struct file_operations myops =
48+
{
49+
.owner = THIS_MODULE,
50+
.read = babyread,
51+
.write = babywrite,
52+
};
53+
54+
static int baby_init(void)
55+
{
56+
ent=proc_create("babydev",0660,NULL,&myops);
57+
printk(KERN_ALERT "Baby initialized!");
58+
return 0;
59+
}
60+
61+
static void baby_cleanup(void)
62+
{
63+
proc_remove(ent);
64+
printk(KERN_WARNING "BYE!");
65+
}
66+
67+
module_init(baby_init);
68+
module_exit(baby_cleanup);

m0leCon/2020/Quals/babyk/bzImage

1.44 MB
Binary file not shown.
1.15 MB
Binary file not shown.

m0leCon/2020/Quals/babyk/start.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
random_string=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
4+
real_hash=$(echo -n $random_string | md5sum | cut -d" " -f1)
5+
6+
echo "MD5 for $random_string if you may! "
7+
read -t 15 computed_hash
8+
9+
if [ $? -ne 0 ] || [ $real_hash != $computed_hash ]; then
10+
echo "NOPE"
11+
exit 1
12+
else
13+
timeout --foreground 300 qemu-system-x86_64 \
14+
-m 64M \
15+
-kernel /home/pwn/bzImage \
16+
-nographic \
17+
-append "root=/dev/ram rw oops=panic panic=1 console=ttyS0 quiet nokaslr" \
18+
-initrd /home/pwn/initramfs.cpio \
19+
-monitor /dev/null
20+
fi
13 KB
Binary file not shown.

m0leCon/2020/Quals/fakev/fakev

13.4 KB
Binary file not shown.

m0leCon/2020/Quals/fakev/libc.so.6

1.94 MB
Binary file not shown.

m0leCon/2020/Quals/knife/knife

13.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)