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!
rootfs name (such as /tmp/mysandbox) to the file inside the sandbox (/tmp/mysandbox/my_file.txt. The application does path normalization to make directory traversal not trivially possible. However, they did not consider that directory traversal could be done within a symbolic link. Hence, the file to access is concatenated with the path from the symbolic link, giving us access to the host file system. openat is similar to open except it has the additional parameter dirfd with it. According to the man page: "If pathname is absolute, then dirfd is ignored." Since the sandbox will pass in the FD and the path, the sandbox can be trivially escaped using an absolute path in the openat syscall. openat call, how do we get code execution? To do this, the authors decided to modify the running sandbox process via /proc/mem, which is a virtual file for the processes memory. To do this, they alter LibC with a large NOP sled and some executable code to spawn a shell. With this, there is code execution in the context of the sandbox! The flag is rwctf{s0-many-vu1n_but-only-few-exploitable}, which makes sense from the bug described above. openat syscall and the lack of validation done on the symbolic link handling. Great write up for a very interesting bug!
document.addAnnot({page:0, type: "Ink", point: [1,1,1,1],popupOpen : " ",gestures : arrayOfArrayOfCoordinates});
atoi. However, there is validation to make sure that value is not bigger than 0x55555. All seems good, right? strings and IDA, they noticed that the server communication is done over XMPP via a library called Gloox. SSL_write function with Frida. The output of this contains many XMPP messages and other network traffic. Even though this was helpful, she still had issues reversing it. So, her co-worker Ned noticed that very old versions of the Android application had symbols, which made it easier to reverse. libssb_sdk.so did a fair amount of other traffic. They decided to focus on this functionality for a little bit. dyna_para_table_t. The implementation looked prone to type confusion bugs because of dynamic typing. For instance, the length specifies whether the data is an array or just the length. If the value is NOT 0, then it is assumed to be an array. Any time there is dynamic typing like this, the developers are asking for trouble!\0) being in the string, the string could be next to adjacent memory. When this would be interpreted, all the data after the copy would be considered part of the string, until a null byte was found. By using this technique on a Zoom user name, pointers could be returned from the user, resulting in a information disclosure. .bashrc file loads the title every time you press enter. perl -e 'while(1){print "\e]0;pwn\a"};'. This constantly set the name of the title, which caused the computer to crash. They reproduced this on browsers, terminals and many other things. Apparently, setting the title of a terminal can lead to a DoS!ESC [ 200 ~ appended to it and the ending has ESC [ 201 ~ added to the end. To bypass this feature, the author starts their copied text with ESC [ 201 ~. Now, when the actual escape occurs, we will end the escape to run our own code. Neat!sscanf without validating that the size of the buffer is big enough. This allows for stack smashing to run a ROP chain to pop a shell. /tmp directory, the script killwatchdog.sh can be overwritten. Then, upon rebooting the device, the script gets executed, escalating the privileges of the user. index.php had an interesting file inclusion protection. This protection script contains "..", then the application would not parse it. This was done via the call stristr for the literal text "..". stristr tries to find a substring within a string but without dealing with case. .%00. would bypass the validation but since the '%00' was removed, the path would resolve properly. .com actually is not the highest part of it. The highest TLD is a period, but it normally left out. https://jub0bs.com./posts/2021-01-29-great-samesite-confusion/ has an extra period after the .com.. The second bypass was using a directory traversal in the URL to break the path parsing. logout_db_session() is invoked. The function iterates over all available sessions then decodes it with the session_decode function. This will decode the serialized session data AND put it into the super global $_SESSION. This second side affect is a big deal. session_decode function, the logging out user logged in as every user for a very small time window. Additionally, the LAST user is never unloaded, meaning that the session remains populated with the last user. An attacker can do this, clear the session and try again until the last user is an administrator. session_decode to see if a similar issue exists. Good find!pwt.js, the function displayCreative will execute to display the ad. This is done by calling document.write directly to write the ad int the page of Urban Dictionary. Since the document.write does not escape the single quote, the string can be escaped, leading to JavaScript execution. SessionCreate is called with the mobile phone number of a user. SessionVerify with the session token and the verification code. Now, the session token of the user becomes valid and they can login as normal.SessionCreate, the same session token is returned now matter how many times this is called. Although this sounds like a reasonable feature for storage reasons, this has catastrophic consequences. SessionCreate with the users phone number. Then, wait for the legitimate user to validate the SMS message. Once the user has validated the SMS message, the session token is valid. Since the session token was the same between the two users, the attacker now has unrestricted access to the users account. SessionCreate and each call should generate an SMS code. Since the code is different between two calls, this attack no longer works. Overall, I really enjoyed the vulnerability since it requires a deep knowledge of how the system works.