Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🏭
Available for proposals.

dax gdassori

👨‍🏭
Available for proposals.
View GitHub Profile
@gdassori
gdassori / bitcoin_centralizzato.md
Last active May 13, 2022 10:24
Il mining di Bitcoin è centralizzato.
View bitcoin_centralizzato.md

Ci sono poche aziende a controllare tutto il mining di Bitcoin, come si può vedere in questo link?

Quelle di cui si parla in questo link sono le mining pool, semplici servers a cui i miners si collegano per fare il loro lavoro. Le mining pool sono una forza del bene all'interno della teoria dei giochi della blockchain, perché permettono a migliaia di miners in tutto il mondo di coordinarsi e consociarsi nell'hashing.

Se una mining pool "si comporta male", ovvero centralizza troppo potere (potresti voler approfondire il 51% attack), oppure se inizia a segnalare blocchi non validi (potresti voler approfondire SegWit2X), questa viene emarginata (potresti voler approfondire il movimento NO2X), e i miners si spostano su altre mining pool, o nascono nuove mining pool.

I miners sono migliaia in tutto il mondo, sotto griglie energetiche diverse, con hardware di loro proprietà, e sono loro che hanno fatto l'investimento effettivo. Le mining pool non hanno niente

@gdassori
gdassori / CVE-2018-17144.py
Created May 27, 2021 10:46
Exploiting CVE 2018-17144 on Bitcoin Testnet
View CVE-2018-17144.py
# Exploiting CVE 2018-17144 on Bitcoin Testnet
# Guido Dassori, twitter.com/khs9ne
# https://bitcoindev.network/looking-back-on-exploiting-cve-2018-17144/
import typing
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
import requests
View o365_ip.py
#!/bin/env python3
import os
import sys
import json
import uuid
import argparse
import logging
import coloredlogs
import requests
@gdassori
gdassori / pubnub_e2e_chat.py
Last active April 5, 2020 22:19
pubnub_e2e_chat
View pubnub_e2e_chat.py
# "I don't trust e2e chats, I don't know what's under the hood on signal, actually"
#
# "Ok, gimme 10 minutes, let me setup a e2e chat script. We'll use a free service on the
# other side of the world, transferring meaningless base64 AES encrypted payloads over the net"
#
# "Ah, cool".
#
# Very buggy - Don't expect fixes
#
# Signup for api keys at https://pubnub.com
@gdassori
gdassori / dump_ncov_reports.sh
Last active February 1, 2020 15:07
Dump 2019-nCoV Coronavirus Raw Reports
View dump_ncov_reports.sh
#!/bin/bash
DIRECTORY="/home/guido/ncov"
TODAY=date +%Y%m%d
NOW=$TODAY`date +%H%M`
mkdir -p $DIRECTORY/data/CDC/$TODAY
mkdir -p $DIRECTORY/data/DXY/$TODAY
mkdir -p $DIRECTORY/data/ECDC/$TODAY
mkdir -p $DIRECTORY/data/JHU-CSSE/$TODAY
@gdassori
gdassori / entry_point.py
Last active November 23, 2019 08:40
Server Websocket Barbino
View entry_point.py
from aiohttp import web
from core.src.world.builder import websocket_channels_service
from core.src.world.services.websocket_router import sio, loop, app
from etc import settings
if __name__ == '__main__':
websocket_channels_service \
.set_socketio_instance(sio) \
.set_event_loop(loop)
@gdassori
gdassori / run_together.py
Created July 30, 2019 16:03
python: run_together
View run_together.py
def run_together(*tasks) -> Tuple:
from multiprocessing.pool import ThreadPool
pool = ThreadPool(len(tasks) if len(tasks) < 8 else 8)
results = []
for task in tasks:
if len(task) > 3:
raise ValueError('Syntax Error')
if len(task) > 1:
a = task[1] if isinstance(task[1], tuple) else (task[1],)
else:
@gdassori
gdassori / block.py
Created April 9, 2019 12:46
layerthree's block deserializer \ serializer
View block.py
import binascii
from layerthree import ioc
from layerthree.utils import deserialize_header, header_to_hash, get_merkle_tree
class Block:
TYPE = 1
def __init__(self, blockhash: str):
self.blockhash = blockhash
@gdassori
gdassori / proof_of_existence.py
Last active December 25, 2021 12:42
Easy proof of existence with Bitcoin.
View proof_of_existence.py
#!/usr/bin/env python3
# Proof of existence \ Blockchain Graffiti
import hashlib
import bitcoin # http://github.com/conio/pybitcointools <- this is this dependency
key = hashlib.sha256(b'Change me! I am your private key').digest() # Set your private key
address = bitcoin.privtoaddr(key)
print('\nDeposit Bitcoin here:\n%s\n' % address)
@gdassori
gdassori / blockchain_dns
Last active October 14, 2018 13:52
Verify the Bitcoin Blockchain with DNS queries using Public DNS around the world.
View blockchain_dns
import requests # requests
import bitcoin # pybitcointools
from dns import resolver # dnspython
def get_resolvers():
dns = "https://public-dns.info/nameservers.txt"
lista_dns = requests.get(dns).content.decode()
resolvers = []