'전체 글'에 해당되는 글 576건

pwnable.kr (uaf)

시스템 2019. 12. 11. 10:54

https://mandu-mandu.tistory.com/99

 

pwnable.kr [uaf] 풀이

uaf - 8 pt Mommy, what is Use After Free bug? ssh uaf@pwnable.kr -p2222 (pw:guest) uaf@ubuntu:~$ ls -l total 24 -rw-r----- 1 root uaf_pwn 22 Sep 25 2015 flag -r-xr-sr-x 1 root uaf_pwn 15463 Sep 25 2..

mandu-mandu.tistory.com

해당 블로그 내용을 참고하였습니다.

 

UAF User After Free 해당 취약점은 heap 영역에서 발생한다.

UAF는 메모리를 malloc 해주었다가 free 해주고 다시 malloc 한 경우를 말한다.

 

#include <fcntl.h>

#include <iostream> 

#include <cstring>

#include <cstdlib>

#include <unistd.h>

using namespace std;

 

class Human{

private:

    virtual void give_shell(){

        system("/bin/sh");

    }

protected:

    int age;

    string name;

public:

    virtual void introduce(){

        cout << "My name is " << name << endl;

        cout << "I am " << age << " years old" << endl;

    }

};

 

class Man: public Human{

public:

    Man(string name, int age){

        this->name = name;

        this->age = age;

        }

        virtual void introduce(){

        Human::introduce();

                cout << "I am a nice guy!" << endl;

        }

};

 

class Woman: public Human{

public:

        Woman(string name, int age){

                this->name = name;

                this->age = age;

        }

        virtual void introduce(){

                Human::introduce();

                cout << "I am a cute girl!" << endl;

        }

};

 

int main(int argc, char* argv[]){

    Human* m = new Man("Jack"25);

    Human* w = new Woman("Jill"21);

 

    size_t len;

    char* data;

    unsigned int op;

    while(1){

        cout << "1. use\n2. after\n3. free\n";

        cin >> op;

 

        switch(op){

            case 1:

                m->introduce();

                w->introduce();

                break;

            case 2:

                len = atoi(argv[1]);

                data = new char[len];

                read(open(argv[2], O_RDONLY), data, len);

                cout << "your data is allocated" << endl;

                break;

            case 3:

                delete m;

                delete w;

                break;

            default:

                break;

        }

    }

 

    return 0;    

}

 

case 1

1 입력 시 각 객체의 introduce() 함수가 호출

2 입력 시 char 객체를 생성

3 입력 시 m, w 객체가 free 가 된다.

 

초기화된 m, w 객체를 입력하여 free 해주고 다시 2를 입력하여 같은 크기로 새로운 객체를 생성해주면 free된 m, w 자리에 초기화 되면서 취약점이 발생한다. m, w객체의 introduce() 함수 주소가 담긴 주소를 알아내어 쉘을 획득하는 

give_shell() 함수 주소로 덮어 씌워주면 쉘을 획득할 수 있다...

 

\

free -> after -> after > use를 하고 ni 명령어로 차례대로 내려가면 give_shell 실행이 된다.

 

 

 

https://koyo.kr/post/pwnable-kr-uaf/

 

Pwnable KR - uaf

문제 8점 문제. Use After Free를 몰라서 또 찾아봐야했다. $ ls -l total 24 -rw-r----- 1 root uaf_pwn 22 Sep 25 2015 flag -r-xr-sr-x 1 root uaf_pwn 15463 Sep 25 2015 uaf -rw-r--r-- 1 root root 1431 Sep 25 2015 uaf.cpp uaf.cpp #include #include #include <cs< p=""> </cs<>

koyo.kr

 

'시스템' 카테고리의 다른 글

AFL Fuzzer  (0) 2022.10.22
퍼징으로 1-day 취약점 분석하기(GIMP)  (0) 2022.10.22
Exploiting Null Byte Buffer Overflow for a $40,000 Bounty  (0) 2019.12.26
Pwning VMWare, Part 1: RWCTF 2018 Station-Escape  (0) 2019.12.24
x64 Stack 개요  (0) 2019.12.11
블로그 이미지

wtdsoul

,

https://knight.sc/reverse%20engineering/2019/10/31/macos-catalina-privilege-escalation.html

 

CVE-2019-8805 - A macOS Catalina privilege escalation

With the release of macOS Catalina in October, Apple rolled out a set of interesting new features collectively called System Extensions. System Extensions are a set of user space frameworks encouraging developers who currently maintain and ship kernel exte

knight.sc

 

The Vulnerability

The privilege escalation vulnerability actually exists within endpointsecurityd and the SystemExtensions.framework it depends on. All of the communication above, between daemons, takes place using a low level system IPC mechanism called XPC. The SystemExtensions.framework provides a OSSystemExtensionPointListener class used by endpointsecurityd to listen for the XPC activation requests sysextd sends. When the endpointsecurityd daemon starts up it does the following:

 

 

Apple’s Patch

With the release of macOS 10.15.1, Apple has patched this vulnerability. If we disassemble and reconstruct the code for [OSSystemExtensionPointListener listener:shouldAcceptNewConnection:] we can see the changes that they applied:

 

 

 

'CVE' 카테고리의 다른 글

POODLE Attack  (0) 2020.08.09
CVE-2020-0796-RCE-POC  (0) 2020.07.14
CVE-2019-2890  (0) 2019.12.10
WhatsApp exploit poc  (0) 2019.11.21
Android Camera Apps  (0) 2019.11.21
블로그 이미지

wtdsoul

,

https://github.com/Metnew/telegram-links-nsworkspace-open

 

Metnew/telegram-links-nsworkspace-open

Telegram (v4.9.155353) was rendering file:// links + opening them via NSWorkspace.open -> code execution. - Metnew/telegram-links-nsworkspace-open

github.com

 

Summary

In Telegram for macOS v4.9.155353 (and below) URL parsing logic in Telegram for macOS platform allows running arbitrary executables and applications URI schemes via links injected into the website's preview.

 

 

블로그 이미지

wtdsoul

,