[App-system] ELF x86 - Stack buffer overflow - C++ vtables
·
Wargame/Root me
1. intro 2. code 및 분석 2.1. code #include #include #include #include #include class formatter { public : virtual int RTTI( ) =0 ; virtual void displayName( ) =0 ; virtual void format( const char * ptr ) =0 ; }; class UpperFormatter: public formatter { public : virtual int RTTI( ) { return 1; }; virtual void displayName( ) { printf ("UpperFormatter"); } virtual void format( const char * ptr ) { co..
iofile_vtable_check
·
Wargame/Dreamhack
보호되어 있는 글입니다.
iofile_vtable
·
Wargame/Dreamhack
보호되어 있는 글입니다.
FSOP - _IO_flush_all_lockp ()
·
Tips & theory
원리 기본적인 내용은 앞선 FSOP 들과 동일하며, _IO_FILE 구조체가 아닌 vtable 구조체의 값을 사용하는 함수이다. 더보기 https://wyv3rn.tistory.com/110?category=949837 _IO_FILE Arbitrary Address Read 원리 여러개의 파일을 열지만 읽기 권한이 없는 경우, 예를 들어 관리자가 작성한 암호 파일과 유저가 작성한 파일을 열어 그 내용을 비교한다고 가정할 때 관리자 파일에 읽기 권한이 없는 경 wyv3rn.tistory.com https://wyv3rn.tistory.com/112?category=949837 _IO_FILE Arbitrary Address Write 원리 큰 틀은 _IO_FILE Arbitrary Address Read..
Bypass IO_validate_vtable
·
Wargame/Dreamhack
1. intro 2. code 및 분석 2.1 code // Name: bypass_valid_vtable // gcc -o bypass_valid_vtable bypass_valid_vtable.c -no-pie #include #include FILE *fp; void init() { setvbuf(stdin, 0, 2, 0); setvbuf(stdout, 0, 2, 0); } int main() { init(); fp = fopen("/dev/urandom", "r"); printf("stdout: %p\n", stdout); printf("Data: "); read(0, fp, 300); fclose(fp); } 2.2 분석 main 함수 내에서 /dev/urandom 파일을 읽기 권한으로 연 뒤..