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!
balanceOf on the EulerStrategy.sol is used to determine the current value held by the EulerStrategy. This result is then used to calculate the price per share of the user's withdrawing position.balanceOf calls EUSDC.balanceOfUnderlying() underneath it. The problem with this is that the actual value being returned may be manipulated. Although the contract believes this will be an atomic call (no other paths ran), this is NOT the case.totalAssets is updated prior to the call but the totalBalances is NOT updated yet. This results in computeExchangeRate() being higher than the actual value. An attacker could use this to change the price and obtain more money than anticipated. computeExchangeRate. Since the price per share is higher, an attacker can redeem more USDC than they should be able to.path is parsed as well. However, this parsing is done slightly differently from a byte array.abi.encodePacked(WBTC, poolFee, WETH, DAI)
abi.encodePacked(WBTC, poolFee, fake, poolFee, WETH). path variable is a commonly used pattern for swaps. So, this is something to watch out for and something I've looked for in the past.callAgreement is to use a placeholder ctx so that Solidity can read it directly from the argument ctx that should be there. deleteAnyFlowBad. callAgreement. This creates the ctx and puts a stamp on it.createFlow to verify that the calling host contract is authorized to do so.authorizeTokenAccess to hand over the ctx and deserialize the original call.deleteAnyFlowBad. After everything is merged into a single byte array. The expected empty ctx can contain spoofed data, causing a MAJOR problem to occur. Since the abi decoder ignores the legit ctx, we have now tricked the code into parsing the wrong ctx. calldata can be crafted to impersonate other users. This can be used to create IDA indexes on behalf of other users to steal tokens in their possession.struct anon_vma in the memory management (MM) subsystem of the Linux kernel. folio->mapping can get a dangling reference to a anon_vma object. By calling madvise(..., MADV_PAGEOUT), the access on anon_vma can be repeated in the free state. down_read_trylock() would corrupt the memory at a chosen address after some primitive hunting.anon_vma belongs to its own kmalloc cache, it's not simple to free and reclaim. The author points to a known technique to free all of the objects in the slab page, flush the percpu freelist and cause the virtual memory to get sent back to the regular allocator. With a spray, we can control this.copy_user since the data is controllable and there is a length value in a consistent register (RCX) that we can overwrite. uname requests. This is because copy_to_user is throughout.prctl to create a stack overflow where none existed in the past. {% for e in users|dictsort:sort % to iterate through all of the usernames in a filtered way. dictsort uses the built in function sorted with a custom function to decide the order. The sort attempts to exclude all sensitive values in the object (__ by convention). _proper_resolver to remove list and function invocation. Overall, amazing post on a crazy side channel!puhttpsniff caught their eye. Using the curl --user-agent "a\";/sbin/reboot;\"" http://192.168.1.1. This was on the LAN side. /etc/shadow has a hardcoded password that was easily cracked via John the Ripper. Now, the telnet port can be used to connect. Additionally, the telnet prompt had hardcoded commands but had a special bad door sh to escape this. sh command to escape the shell.HTTP_X_FORWARDED can be used to control the IP. Since the IP is used by authentication purposes, this is a complete authentication bypass.poller_id parameter for the bad sync proc_open. This creates a fairly trivial command injection vulnerability that can be used to get code execution. cacti_escapeshellarg was used on the variable in two separate places to prevent a regression from occurring. ${T(java.lang.Runtime)}. This is a SpEL shorthand for referencing a Java class by name. However, the Akamai WAF blocked this request, even though they knew it was vulnerable. Now, we must learn why this was blocked by the WAF and how to work around it, which took over 500 requests to do.1${2.class} will output java.lang.Integer. To create an arbitrary class, the author tried 1${2.class.forName("java.lang.String")} which was rejected based upon the function forName..exec() is why. Reading the Java documentation (which is usually amazing), gave them the function toString() to get a non-static reference to a character. With this, they could use a toString() on an integer to return the proper character in a string they needed. Progress!java.lang.Runtime.exec. They used a known technique as follows:
Class.forName function to get an arbitrary package.java.lang.Runtime to pass to the function.getRuntime function.exec with our string.uname -a response could be seen! The bug had been exploited and the WAF bypassed. To me, the interesting part of the article isn't the bypass itself but the thoughts around bypassing the WAF and problem solving. flashrom!flashrom and a Raspberry Pi, the image can be completely dumped. They even have the commands they ran!call command can be used to call any code at any location.exec("cookie_user -c ".$_COOKIE['CookieID'])); is ran. This is used to execute PHP code dynamically. Since the string CookieID is controlled by us, this can be used inject our own code into the program.