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!
compasX, the authors decided to open up the client in a disassembler. While learning all about the system, they noticed that srand(time()) was being used to generate AES key material. Can this be exploited?srand(time()). Then, it gets 16 bytes via rand(). They then compare the bytes of the real key to the one they generated to see if it matches. If this is the case, then we can prove that this key was generated insecurely. And, unsuprisingly, they got a hit. memcpy on Generic Segmentation Offload (GSO) used in NAT emulation. After analyzes various code paths and using a SMT solvers, they discovered that they could control a fair amount of information from this memcpy. Good attack surface to start!dewdrop uses a technique known as Port Knocking for communication. Instead of having a listening port, which is easily spotable by many netstat and other commands, it is a libpcap that looks for magic packets. /dev/null, signal handlers are removed, cores files are disabled... To make reversing harder, strings are XOR obfuscated, with an off the shelf tool, making them easy to decode. %23 to #, a completely diffrent cache key may be implemented than the actual request made. If the backend normalizes ../ then XSS or Open Directs may even be possible to change the page in action. Content-Type header was vulnerable when using an invalid value. By sending an invalid Content-Type header, the request would not work properly, causing a DoS to the other users.x-http-method-override by default, setting this header to a different method would cause issues. Even though a 405 error message for POST would not be cached, HEAD and PURGE would get cached, causing some major issues. This technique worked on targets besides Gitlab as well.Rack middleware. The header x-forwarded-scheme changes the scheme of the request with this. By sending http as the value, a 301 redirect would occur to the same location. If this was cached by the CDN, a redirect loop would occur, denying access to the file. This was exploited on HackerOne and Shopify.X-forwarded-host additionally caused some issues. Using this, a 301 redirect could be performed on the result of JavaScript files, with this then being cached. Since the JavaScript was being loaded into the page of the user, this turned into a very serious XSS vulnerability. size. If two size paraemters were passed in, both were included as the cache key, but the server only used the last one. This led to another DoS. size. If two size paraemters were passed in, both were included as the cache key, but the server only used the last one. This led to another DoS. Age, X-Cache and several other headers can be useful for learning how the caching for the system works. Cognito AWS service. To start with, the author simply ran get-user directly at AWS. To their surprise, this returned information, including internal statistics, about the user. Besides, reading, the attributes can be written to as well. sub), according to the specification. If another changable ID is used for the sub, then the assuming of the role from a third party may cause permission problems. sub claim for authenticating users. Secondy, ensure that the Cognito attributes are looked down properly once the token is returned. Third, verify the email on the login flow for Cognito. inp_join_group needs to create a new membership entry, it briefly releases the sockets lock. Since this pointer is passed into a local variable, when the lock gets drop, a concurrent call to this function could make the pointer in the local variable invalid. accountsservice, then spent the next two weeks trying to figure out how my own exploit worked. It seemed like magic, even to him! The original bug was accidentally discovered while writing an exploit for another vulnerability. static variable (shared between threads) that is allocated once. In the function user_get_fallback_value, a pointer to this static variable is returned. However, in some code paths, this variable can be freed. Since this variable is only crated the one time, this results in a double free vulnerability on the string, which can be triggered an infinite amount of times. user_new functionality. However, this only worked if the address from a valid UTF-8 string. 0x20 sized memory allocation or get it to consolidate into a larger chunk. After hitting several deadends (such as rewriting bus names), with no good targets in the 0x20 size, the author ran into some magic once they stepped away from their seat! SetEmail or any call is made to Polkit, a struct called CheckAuthData is used. This struct has a function pointer that determines what call to make during a callback. This struct is also 0x20 in size. 0x20 sized chunk, it MAY be the CheckAuthData struct getting freed. Then, another request, such as SetPassword, would be made, creating the CheckAuthData in this chunks place. When the original requests uses the callback (and it's authorized to), it will be on the wrong callback, resulting in SetPassword being called instead. Wow, that is wild!