- [ 워게임/pwnable.kr ][Toddler's Bottle] bof2025-05-27 06:10:52DescriptionNana told me that buffer overflow is one of the most common software vulnerability.Is that true?ssh bof@pwnable.kr -p2222 (pw: guest)Solution bof는 gets함수에서 이루어지고 32바이트를 더미로 채운 후 SFP와 RET 부분도 채우면 key의 주소가 나온다. 32바이트 이상 입력하니 stack smashing이 된다.메모리 보호기법이 걸려있는 듯 하다. DEP, Canary, PIE 보호기법이 걸려있다.overflowme가 32byte였기에 32+8 로 40byte를 더미로 채우고 0xcafebabe를 넣으면 되는 줄 알았는데 gdb로 열어보니 달랐다. 일단, 0x2c를 ..
- [ 워게임/pwnable.kr ][Toddler's Bottle] collision2025-05-27 06:02:36DescriptionDaddy told me about cool MD5 hash collision today.I wanna do something like that too!ssh col@pwnable.kr -p2222 (pw:guest)Solution이 문제는 입력값이 아닌 인자를 계산해서 hashcode 값과 비교하는 문제이다.int res = 0;char str[20] = "";for (int i=0; i인자 문자열은 20 byte 이고 앞에서부터 4 byte씩 더한다.문자열을 (int)로 변환하면 ASCII Code가 된다.또한, 리틀엔디안 c언어로 재구성해서 테스트 해보았을 때 리틀엔디안 방식으로 계산된다.예를 들어, "ABCD"가 입력했을 때, (int *)로 변환한다면 0x67666564 가 ..
- [ 워게임/pwnable.kr ][Toddler's Bottle] fd2025-05-27 04:42:39Descriptiontry to play the wargame your self but if you are ABSOLUTE beginner, follow this tutorial link: https://youtu.be/971eZhMHQQwssh fd@pwnable.kr -p2222 (pw:guest)ssh로 접속하면 fd 바이너리, fd 소스코드, flag가 있다.fd 소스코드를 확인해보면 main 인자가 1개 이상이어야 하고, 그 인자가 0x1234의 값과 같아야 파일 디스크립터 값이 0(stdin)이되어 입력받을 수 있다.0x1234를 10진수로 바꾼 4660을 인자로 넘겨주면 된다.그리고 strcmp로 입력받은 문자열이 "LETMEWIN" 과 비교하여 같으면 flag를 출력하기 떄문에 LETMEW..
- [ 해킹/Pwnable ]32bit 쉘코드 C에서 실행2025-05-27 04:39:19EnvironmentVMware Workstation Pro, Ubuntu24.04-> powershell sshCode#include int main() { const char shellcode[] = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80"; int (*ret)(); ret = (int (*)()) shellcode; (int)(*ret)(); return 0;}Compilegcc -m32 -fno-pic -fno-stack-protector -mpreferred-stack-boundary=2 -no-pie -z execstack -o shell sh..
- [ 언어/Python ]ROL, ROR Python 구현2025-05-27 04:19:13ROL(Rotate Left)왼쪽으로 단순 shift 연산 하는 것이 아닌 회전하는 방식으로 연산함연산자연산SHL10000000 -> 00000000ROL10000000 -> 00000001def rol(x, n): shiftBit = x >> n carryBit = x ROR(Rotate Right)오른쪽으로 단순 shift 연산 하는 것이 아닌 회전하는 방식으로 연산함연산자연산SHR00000001 -> 00000000ROR00000001 -> 10000000def ror(x, n): shiftBit = x > (8 - n) return shfitBit | carryBit
- [ 해킹/Mobile ]Android Studio Frida 설치2025-04-30 19:02:07nox와 wsl의 충돌로 시작하는 Android Studio에 frida 연결하기Android Studio adb안드로이드 스튜디오 설치 후Setting - Languages & Frameworks - Andriod SDK SDK Tools탭에서 Android SDK Command-lin Tools (latest) 체크하고 OK를 눌러주면 설치된다. SDK 폴더 경로 안에 있는 platform-tools 에 adb.exe가 있다.%SDK Location%\platform-tools 를 환경변수에 추가해준다.환경변수가 잘 적용되었는지 확인한다.adb version rootAVDhttps://github.com/newbit1/rootAVD시스템 이미지에서 아래 조건을 만족하는 이미지 선택:"Google AP..