timwr / CVE-2016-5195

CVE-2016-5195 (dirtycow/dirtyc0w) proof of concept for Android
959 stars 395 forks source link

could not open /system/bin/run-as #39

Closed zdzicho0 closed 7 years ago

zdzicho0 commented 7 years ago

Code generating info:

    int f=open(argv[1],O_RDONLY);
    if (f == -1) {
        LOGV("could not open %s", argv[1]);
        return 0;
    }
    if (fstat(f,&st) == -1) {
        LOGV("could not open %s", argv[1]);
        return 0;
    }

Do You know what can be the reason ?

shell@m0:/system/bin $ ls -l run-as
-rwxr-x--- root     shell        9432 2014-01-25 09:03 run-as

Samsung Galaxy S3

timwr commented 7 years ago

Very strange. Perhaps you can try pull the latest and run make test. You will at least know whether your device is vulnerable.

zdzicho0 commented 7 years ago
sh-3.2# adb shell 'cat /data/local/tmp/test2'
yournotvulnerable
sh-3.2# adb shell 'cat /data/local/tmp/test2' | xxd
00000000: 796f 7572 6e6f 7476 756c 6e65 7261 626c  yournotvulnerabl
00000010: 650d 0a                                  e..
lili15480 commented 7 years ago

No way,Root has no command to execute

lili15480 commented 7 years ago

Damn SELinux

anthony24kb commented 7 years ago

Hello timwr. Could you provide a zip with the latest compiled binaries for all architectures? Thank you. Have a great christmas.