Skip to content

Instantly share code, notes, and snippets.

@az0mb13
az0mb13 / test.md
Last active February 12, 2022 06:11

Lorem ipsum

sesstoken.png

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract EtherGame {
uint public targetAmount = 7 ether;
address public winner;
function deposit() public payable {
require(msg.value == 1 ether, "You can only send 1 Ether");
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract Attack {
EtherGame etherGame;
constructor(EtherGame _etherGame) {
etherGame = EtherGame(_etherGame);
}
pragma solidity ^0.4.24;
contract Proxy {
address owner;
constructor() public {
owner = msg.sender;
}
function forward(address callee, bytes _data) public {
@az0mb13
az0mb13 / flameshadow.sh
Created September 5, 2022 14:42
Flameshot hack for rounded corners and shadows
#!/bin/bash
flameshot gui --raw >> /home/zombie/Pictures/flameshot/screenshot.png
convert /home/zombie/Pictures/flameshot/screenshot.png \( +clone -alpha extract -draw 'fill black polygon 0,0 0,5 5,0 fill white circle 5,5 5,0' \( +clone -flip \) -compose Multiply -composite \( +clone -flop \) -compose Multiply -composite \) -alpha off -compose CopyOpacity -composite /home/zombie/Pictures/flameshot/screenshot.png
convert /home/zombie/Pictures/flameshot/screenshot.png \( +clone -background black -shadow 75x10+0+0 \) +swap -bordercolor none -border 10 -background none -layers merge +repage /home/zombie/Pictures/flameshot/shadow.png
xclip -selection clipboard -t image/png -i /home/zombie/Pictures/flameshot/shadow.png
rm /home/zombie/Pictures/flameshot/screenshot.png /home/zombie/Pictures/flameshot/shadow.png
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.10;
import "forge-std/Test.sol";
import "./interface.sol";
interface parity {
function isOwner(address _addr) external view returns (bool);
function kill(address _to) external;
contract UnstoppableLender is ReentrancyGuard {
...
function depositTokens(uint256 amount) external nonReentrant {
require(amount > 0, "Must deposit at least one token");
// Transfer token from sender. Sender must have first approved them.
damnValuableToken.transferFrom(msg.sender, address(this), amount);
poolBalance = poolBalance + amount;
}
it('Exploit', async function () {
await this.token.connect(attacker).transfer(this.pool.address, 1);
});
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract NaiveReceiverLenderPool is ReentrancyGuard {
using Address for address;
uint256 private constant FIXED_FEE = 1 ether; // not the cheapest flash loan
contract FlashLoanReceiver {
...
function receiveEther(uint256 fee) public payable {
require(msg.sender == pool, "Sender must be pool");
uint256 amountToBeRepaid = msg.value + fee;
require(address(this).balance >= amountToBeRepaid, "Cannot borrow that much");