분류 전체보기
-
heap1 풀이System hacking training/Protostar 2018. 12. 21. 11:57
[heap1.c] #include #include #include #include #include struct internet { int priority; char *name; }; void winner() { printf("and we have a winner @ %d\n", time(NULL)); } int main(int argc, char **argv) { struct internet *i1, *i2, *i3; i1 = malloc(sizeof(struct internet)); i1->priority = 1; i1->name = malloc(8); i2 = malloc(sizeof(struct internet)); i2->priority = 2; i2->name = malloc(8); strcpy..
-
heap0 풀이System hacking training/Protostar 2018. 12. 21. 10:23
[heap0.c] #include #include #include #include #include struct data { char name[64];};struct fp { int (*fp)();};void winner(){ printf("level passed\n");}void nowinner(){ printf("level has not been passed\n");}int main(int argc, char **argv){ struct data *d; struct fp *f; d = malloc(sizeof(struct data)); f = malloc(sizeof(struct fp)); f->fp = nowinner; printf("data is at %p, fp is at %p\n", d, f);..
-
What is heap - part 2System hacking training/Knowledge 2018. 12. 21. 08:22
What is heap part 2! Ref : https://www.youtube.com/watch?v=GiOKJJEXBiU 오늘도 koreangang의 영상을 보고 정리한 글을 공유하려 합니다. 영상이 매우 짜임새있고, 이해하기 쉬워서 heap을 공부하시는 분들이라면 꼭 봤으면 좋겠네요..ㅎㅎ 지난번에는 heap의 구조에 대해 알아봤다면 오늘은 dlmalloc이 메모리를 어떻게 관리하는지에 대해 알아보겠습니다. dlmalloc의 알고리즘 dlmalloc의 할당하고, 해제하는 메커니즘은 크게 두가지로 나눌 수 있는데 boundary tag와 binning이 이에 해당합니다. - chunk의 크기 정보가 chunk의 앞뒤에 저장(boundary tag) - 재사용 가능한 chunk를 크기 단위로 관리(b..
-
What is heap - part1System hacking training/Knowledge 2018. 12. 12. 09:57
What is heap part 1 CTF문제를 풀이함에 있어 전혀 손도 못대는 영역이 heap영역에 대한 취약점을 다룬 문제들이였는데 Koreangang에서 아주 좋은 강의가 올라와서 heap을 처음으로 공부를 해봤습니다. 영상에서도 설명이 되었지만 how2heap을 통해 공부를 시작하려고 하지만 어디서부터 어떻게 시작해야되는지 모르시는 분들에게 정말 필요한 영상인것 같습니다 :) Heap Concept Tutorial#1(for heap exploit) https://www.youtube.com/watch?v=l0GVitgBPf0 이번 글에서는 해당 영상을 토대로 공부를 하면서 정리를 한 것을 포스팅하겠습니다. 제 정리가 보기 불편하고 어렵다면 위의 링크에서 영상을 보고 오시는 것을 추천드립니다. h..
-
-
CCIT projectfkillrra ?/schedule 2018. 11. 22. 08:29
[11/22] 오늘 삽질 결과꼭 AP 모드를 지원하는 어댑터로 해야한다.captive portal : HTTP redirect, ICMP redirect, Redirect by DNS 로 구현가능하다.dport 80으로 잡는건 naver, facebook등에서 redirect가 안되더라.test.gilgil.net은 되더라 ㅋap 모드 지원하는 어댑터는 라즈베리파이에 내장되어있어서 up link, down link를 둘다 무선으로 가능했다. (wlan0로 ap를 생성하고, iptables로 트래픽을 무선 어댑터로 보대는 식)내가 가지고 있는 무선 어댑터 하나가 죽었다.호스트에서는 인식이 되는데, vm, rasberry pi에 연결을 하면 전원불빛이 없어진다...그리고 내가 가지고 있는 어댑터는 ap 모드..
-
iptables (redirect captive portal)tmp/doc 2018. 11. 22. 06:32
iptables --table nat --append POSTROUTING --out-interface ens33 -j MASQUERADEiptables --append FORWARD --in-interface at0 -j ACCEPTiptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.12:80iptables -t nat -A POSTROUTING -j MASQUERADE
-
RITSEC CTF 2018 ezpwn write upCTF Write-Up 2018. 11. 19. 18:47
라즈베리파이 Mate ubuntu 가 apt upgrade를 하던 중 너무 오래걸려서 할게 없었는데 마침 CTF를 하고 있었네요..ㅎㅎ 쉬는 시간에 한 문제 풀었습니다! 210 Solves라 쉬운 문제였습니다. 문제는 바이너리 던져주고, remote exploit을 해야하는(?) 그런 문제 유형이였습니다. 먼저 정적분석을 위해 binary를 열어보니 다음과 같이 unsigned int v6의 값이 1이 된다면 if문의 조건을 충족하여 flag를 열어주는 것을 볼 수 있습니다. 취약점이 쉽게 눈에 들어오는데요. gets()의 사용으로 인해서 v4의 변수에 argv값을 NULL byte가 오기 전까지 모두 값복사를 하기 때문에 bof가 터집니다. 이제 이에 맞게 payload를 작성하면 됩니다. CTF에 나..