Skip to content

Instantly share code, notes, and snippets.

# # # # # # # # # # # # # # # # # # # # # # # # # #
# Demonstration of CBC Bit Flipping Attack #
# Author: Panos Sakkos <[email protected]> #
# Date: October 2017 #
# License: MIT #
# # # # # # # # # # # # # # # # # # # # # # # # # #
require 'openssl'
class UnauthenticatedEncryption

Setup

Install virtualenv

sudo apt install virtualenv

Install virtualenvwrapper

  • Panoramix is probably the most well-known one thanks to etherscan.io integrating it. It'll return "python-like" code that is actually quite nice to read. Unfortunately it often ends up having "timeouts" causing the decompiled code to just abruptly stop.
  • Dedaub's Decompiler is my personal favorite. When it produces something, it does produce "solidity-like" code that is well readable. But sometimes it just fails to yield anything at all. And even when it does work it struggles whenever memory handling gets involved, requiring some educated guessing.
  • ethervm.io's Decompiler is another online service which similar to Panoramix always delivers a result, but it also has the tendency to skip big parts of the code due to "could not resolve jump destination" errors and the like.
  • Heimdall does not have an online s
const
// Begining APDU command. "Payment System Environment (PSE)" 2pay.sys.ddf01
// The card should response with Application Identifier (AID)
PPSE = '00 a4 04 00 0e 32 50 41 59 2e 53 59 53 2e 44 44 46 30 31 00';
// Application Identifier (AID) start command prefix
// Possible AID's:
// A0000000031010 Visa International
// A0000000032020 Visa International
// A0000000041010 Mastercard International
@markus851
markus851 / clean.sh
Created July 16, 2022 01:50 — forked from gwpl/clean.sh
`openssl pkeyutl` how to: -sign -verify -encrypt -decrypt , using openssh keys snippets/examples
rm -v pub.pkcs8 test.sign test.txt.decrypted test.txt.encrypted
@markus851
markus851 / fuse.txt
Created July 16, 2022 01:49 — forked from kategray/fuse.txt
NXP J2A040 Fusing
# Information in this script was obtained from public sources, and not under NDA with NXP.
# GPShell style APDU commands, but you should be able to adapt it to anything that can send raw APDU's to the card
# Our TK Key
00A4040010C238E449F725B1510EAA699550CABA16
# Reset card to factory defaults - THIS WILL WIPE OUT ALL APPLETS INSTALLED
00F00000
# Set the Card to use T=1 transmission mode
@markus851
markus851 / BaseToken.sol
Created January 20, 2022 20:59 — forked from anonymous-research-group/BaseToken.sol
BaseToken is the ERC-20 token upon which the Ethereum Social Engineering attacks A1-A7 are implemented
pragma solidity ^0.5.16;
import "../openzeppelin-contracts/GSN/Context.sol";
import "../openzeppelin-contracts/token/ERC20/ERC20.sol";
import "../openzeppelin-contracts/token/ERC20/ERC20Detailed.sol";
import "../openzeppelin-contracts/math/SafeMath.sol";
contract BaseToken is Context, ERC20, ERC20Detailed {
@markus851
markus851 / A1.sol
Created January 20, 2022 20:59 — forked from anonymous-research-group/A1.sol
Ethereum social engineering attack A1
pragma solidity ^0.5.11;
import "../openzeppelin-contracts/GSN/Context.sol";
import "../openzeppelin-contracts/token/ERC20/ERC20.sol";
import "../openzeppelin-contracts/token/ERC20/ERC20Detailed.sol";
import "../openzeppelin-contracts/math/SafeMath.sol";
import "../openzeppelin-contracts/ownership/Ownable.sol";
contract BaseToken is
@markus851
markus851 / A2.sol
Created January 20, 2022 20:59 — forked from anonymous-research-group/A2.sol
Ethereum Social Engineering attack A2
pragma solidity ^0.5.11;
import "../openzeppelin-contracts/GSN/Context.sol";
import "../openzeppelin-contracts/token/ERC20/ERC20.sol";
import "../openzeppelin-contracts/token/ERC20/ERC20Detailed.sol";
import "../openzeppelin-contracts/math/SafeMath.sol";
contract NonPayable {
@markus851
markus851 / A3.sol
Created January 20, 2022 20:59 — forked from anonymous-research-group/A3.sol
Ethereum Social Engineering attack A3
pragma solidity ^0.5.11;
import "../openzeppelin-contracts/GSN/Context.sol";
import "../openzeppelin-contracts/token/ERC20/ERC20.sol";
import "../openzeppelin-contracts/token/ERC20/ERC20Detailed.sol";
import "../openzeppelin-contracts/math/SafeMath.sol";
contract BaseToken is Context, ERC20, ERC20Detailed {