일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- IS함수
- 자료개방포털
- lob 7번
- pythoncli
- argv
- lob 10번
- pyinstaller
- argc
- 빅데이터
- 포너블
- kostat
- lob
- 마크업 언어
- 서니나타스
- pythonexe
- mode함수
- 써니나타스
- anxi0
- kosis
- R언어
- troll to
- lob 9번
- 결측치
- 써니나타스 1번
- orge to troll
- 범용레지스터 #레지스터 #어셈블리 #ASM #리버싱 #어셈블리어 #EAX #ESP
- 데이터형
- wolfman to darkelf
- ultra argv hunter
- 쉘코드
- Today
- Total
목록HACKING/[SYSTEM HACKING] PROTOSTAR (8)
ANX1-Z3R0의 불안극복(不安克服)

echo 0 | sudo tee /proc/sys/kernel/randomize_va_space #include #include #include #include void getpath() { char buffer[64]; unsigned int ret; printf("input path please: "); fflush(stdout); gets(buffer); ret = __builtin_return_address(0); if((ret & 0xbf000000) == 0xbf000000) { printf("bzzzt (%p)\n", ret); _exit(1); } printf("got path %s\n", buffer); } int main(int argc, char **argv) { getpath(); ..

가장 푸는 데 시간이 오래 걸렸던 구간. core 파일과 씨름을 했다. 결국 알아낸 방법: peda로 process attach해서 실시간으로 스택을 읽어내는 거 그리고..... ASLR 끄는 거!!!! 메모리 보호 기법인 ASLR 때문에 삽질 겁나했다. 꼭 끄고 시작하자. (vmware 다시 켤때마다 해야하므로 주의하자.) echo 0 | sudo tee /proc/sys/kernel/randomize_va_space 이런거 왜 하냐고? 우리가 이렇게 비교적 초반에 배우는 지식이 쉽게 뚫릴리가 없잖냐, 이미 운영체제들은 다 대책이 있는거지. 하지만! 우리는 아직 배우는 입장이므로, 이런 옵션들을 꺼줄 필요가 있다. #include #include #include #include int main(int ..

#include #include #include #include void win() { printf("code flow successfully changed\n"); } int main(int argc, char **argv) { char buffer[64]; gets(buffer); } 짧고 굵은 코드다. gets로 받는 buffer만으로 win에 접근 하면 된다. 일단 간단한 win주소 알아놓기를 해놓자. 오케이 알겠고 (\xf4\x83\x04\x08) offset값을 알아내보자. 여지껏 sfp라는 명목으로 대애충~ 4byte쯤 offset을 계산했었는데, 이것은 충분히 수정 가능한 영역이므로, 일일히 다 세고 있으면 비효율 적이다. gdb-peda에는 이것을 해소해 줄만한 기능이 있는데, 그것을 한..

#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(); } } 슬슬 해괴한 코드들이 나오고 있다. 내가 overflow시킨 값으로 뛰고, 그걸 win으로 맞춰줘야 하는 것 같다. 어렵게 생각할 필요없다. gets에 값을 넣는 방법과 win의 주소만 알면 된다. araboja. [gets 함수..

#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 again, you got ..

#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); } } modified를 0x61626364로 변조하는 문제이다..

[ stack0 ] #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"); } } modified 영역을 변조하라는 듯 하다. stack입장에서 modified가 먼저 선언되어 위에 buffer가 쌓이므로, buffer를 길게 늘어뜨리면 modified 영역을 침범할 수 있게 된다. buffer를 딱 65개만큼만 넣어보자. gdb로 프로그램을 ..

아래 주소로 들어가서 매뉴얼을 본다. 그리고 오른쪽의 문제들을 클릭하면서 소스코드를 본다. https://old.liveoverflow.com/binary_hacking/protostar/index.html Protostar - LiveOverflow This video introduces http://exploit-exercises.com, how to connect to the VM with ssh and explains what setuid binaries are. old.liveoverflow.com 다음 파일을 다운받고 압축풀기 한다. wget https://blog.kakaocdn.net/dna/b4YcBk/btqGg6ezhjE/AAAAAAAAAAAAAAAAAAAAAFP15kzs2PRbYZe2GlIvVqCrVBVodXjuW3MVmZCCn6Uy/tfile.tar?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&expires=1756652399&allow_ip=&allow_referer=&signature=WdrRWosSD8EnmvmH9vZ18JWjzsg%3D tar ..