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!
memcpy, this allows for the secret information to be recovered. strings on the memory dump, a pin appears to unlock the device! At this point, they can recover the key from the device to get the money. sanitize_title() governs how the title to slug transformation is done. When this is done, it converts all characters into ASCII, numbers, underscores and dashes. This sounds restricting but looking at the source code unearths some hidden functionality: the sanitization preserves URL-encoded octets, and, indeed, slugs can contain URL-encoded characters. What can a URL encoded string do for anything though? post.php, the slug will eventually be URL decoded. If the slug does contain any URL-encoded characters, it gets encoded once again. Here is where the problem occurs: utf8_uri_encode only encodes Unicode characters. Crazily enough, utf8_uri_encode('<script>alert(1)</script>', 200) will output <script>alert(1)</script>. So, the URL encoding does not work as expected on the way back!__truncate_post_slug(). The only time this gets called is when Wordpress is saving a post that has the same slug already. Since the post slug should be safe, but can now have arbitrary input, the character expectations have been violated. Pretty quickly the authors found an easy place that XSS was triggered on the page. 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!