Skip to content

Instantly share code, notes, and snippets.

View apogiatzis's full-sized avatar
:electron:
Stay awhile and listen.

APogiatzis apogiatzis

:electron:
Stay awhile and listen.
View GitHub Profile
@apogiatzis
apogiatzis / common_modulus.py
Created November 13, 2018 04:25
RSA Common modulus attack
import argparse
from fractions import gcd
parser = argparse.ArgumentParser(description='RSA Common modulus attack')
required_named = parser.add_argument_group('required named arguments')
required_named.add_argument('-n', '--modulus', help='Common modulus', type=long, required=True)
required_named.add_argument('-e1', '--e1', help='First exponent', type=long, required=True)
required_named.add_argument('-e2', '--e2', help='Second exponent', type=long, required=True)
required_named.add_argument('-ct1', '--ct1', help='First ciphertext', type=long, required=True)
@apogiatzis
apogiatzis / checksec.py
Created August 11, 2019 12:17
Windows checksec equivalent
import lief
from sys import argv
import colorama
def _color_print(name):
colorama.init(autoreset=True)
def color_print(func):
def wrapper(*args, **kwargs):
ret = func(*args, **kwargs)
if ret != False:
{
"flags": [
{
"genre": "`constructor.constructor(\"alert('xss')\")()`",
"name": {},
"point": "{{1+1}}",
"flag": "`constructor.constructor(\"alert('xss')\")()`"
}
],
"name": "aaaa",
@apogiatzis
apogiatzis / keybase.md
Created June 19, 2020 14:31
Keybase Verification

Keybase proof

I hereby claim:

  • I am apogiatzis on github.
  • I am apogiatzis (https://keybase.io/apogiatzis) on keybase.
  • I have a public key whose fingerprint is 6A7F 78A5 4B8F B614 5FCB D3C2 7F4F 701F 9575 6888

To claim this, I am signing this object:

bde14596c16536af673ce451f25b2a94
@apogiatzis
apogiatzis / Token.sol
Last active November 4, 2020 01:39
C1: Smart Contract Development
pragma solidity ^0.5.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20Detailed.sol";
contract Token is ERC20, ERC20Detailed {
constructor () public ERC20Detailed("<StudentID> Token", "LABT", 18) {
_mint(msg.sender, 1000000 * (10 ** uint256(decimals())));
}
@apogiatzis
apogiatzis / Dice.sol
Last active April 7, 2024 01:02
Dice rolling game smart contract skeleton
pragma solidity ^0.5.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/IERC20.sol";
contract Dice {
IERC20 public nativeGameToken;
mapping(address => UserBet) private userBets;
struct UserBet {
@apogiatzis
apogiatzis / deploy.yml
Last active October 28, 2021 15:52
Github Workflow for Medium post
name: Challenge Deployment
on: push
jobs:
cancel:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
@apogiatzis
apogiatzis / Orderbook.sol
Created December 2, 2020 03:06
Orderbook template contract for Blockchain for Fintect course
pragma solidity ^0.5.2;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20.sol";
contract Orderbook {
using SafeMath for uint256;
struct Order {
uint256 Amount;
@apogiatzis
apogiatzis / config.json
Created June 19, 2021 09:19
Curl Fluence service config
{
"name": "curl",
"mountedBinaries":
{
"curl": "/usr/bin/curl"
}
}