People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
struct sock *sk;
struct vsock_sock *vsk;
const struct vsock_transport *transport;
/* ... */
sk = sock->sk;
vsk = vsock_sk(sk);
transport = vsk->transport;
lock_sock(sk);
transport variable is dereferenced from vsk then the lock occurs on this. If the value of transport were to change prior to the lock, then we have a race condition!transport transport struct. The transport constructor can be called, which frees the object and creates a UAF. This UAF is a 4 byte user controlled write at offset 40. Does not seem that deadly but itself!/dev/kmsg which leaks kernel memory. So, now, we know if the race was won and have a memory leak!msg_msg struct in order to map to kernel data to be read. This required some crazy feng shui for this code to not crash however. All of the necessary pointers are not acquired!sk_buff. First, hit the arbitrary free on the sk_buff kernel address. Then, when a user controlled object slips into there a function pointer is overwritten! ShellExecute; on Linux, this is done with xdg-open. If these do not sanitize the input, code execution may result. openURL for the native OS in order to open up the proper data. However, because the URLs were not sanitized at all, this left open the possibility for exploitation. How would one go about this? sftp (secure ftp) URI, an attacker could embed a proxy telnet command which would run on the users machine when clicked on. Additionally, using SMB to load arbitrary jar files could also work. On the Telegram Desktop client, a similar issue as the one above was found that allowed for the same exploitation path. jar (compiled Java code) is loaded on Windows, this leads to RCE. By specifying a remote file (with two leading slashes - \\) or a file URI path, this runs user code. On Linux, the lack of an auto mount feature makes this not possible for remote exploitation. winscp URL, it will pop a shell! WinSCP decided that this was a security issue and fixed it. /auth/check API. A parameter is taken in directly without any type check. So, by adding an array or other options, NoSQL conditionals and things can be used. This is a blind injection, as no data is directly returned. $func can be used to return data, such as a var_dump. /auth/resetpassword and /auth/newpassword APIs. By using the var_dump from the previous step, we can dump all data from this table. Because this contains active password reset tokens, this is game over. --privileged flag to allow extra permissions. For the purposes of this article, this causes device files (/dev) be be shared between the host and the guest. /dev directory had the permissions set to rw as the guest user. This means that any user (including the Docker user) could edit these file systems. debugfs utility, we can commit changes to the underlying disk. Being able to write to disk is a HUGE deal, as we could overwrite all files on the OS, such as /etc/passwd.posix_fadvise to tell the kernel to discard the cache. Now, when the /etc/passwd was read again, it would be the proper one!sdcard is a special Content Provider that is accessible by any application at any time. It is used by ALL applications and considered an insecure place to put data. The content:// URI is a way to access the content provider data via a URL. This is supported within the chrome browser even!/sdcard/Android. With devices NOT running scoped storage per app, this is a serious vulnerability. /sdcard directory. By using the Chrome vulnerability, an attacker can steal the Pre Shared Key (PSK) for TLS 1.3 and steal the Master Secret on TLS 1.2. By stealing these secrets, WhatsApp can be MitM'ed even when the application believes it is being done securely. content URI. Another application could have done this in order to snoop on the E2E traffic. With a MitM position (assumed throughout this article) and the TLS secrets leaked, the next step is to get code execution. data directory. So, simply overwriting one of these libraries (such as SoLoader) is sufficient. With control over a library, this is game over. OutOfMemoryError within the first few days of a release, the entire application heap is sent to a WhatsApp server for debugging. Guess what is in this heap!? Noise keys!sdcard directories make this vulnerability much less impactful. So, good job Android!upload.cgi. So, upon fixing this, everything appeared to be okay...PsIsCurrentThreadInServerSilo will essentially always return TRUE. This appears to be something done in the testing phase that was never fixed. chroot can change the root directory for a user. In Windows land, a similar concept can be used to isolate an object manager namespace for users.