Giter Site home page Giter Site logo

dhtfck's Introduction

WTF is this?

This is my BitTorrent Distributed Hash Tables research project.

Where i can use it?

This tool has several main purposes:

  1. To be a custom Python BTDHT realization, which you can easily use in your application. You can play with DHT protocol, fuzz it, change DHT internal timing limits etc.
  2. Act as my Proof-Of-Concept of DHT amplification DDoS attack

Is BitTorrent protocol included?

No. This is just DHT.

Example?

Lookup for BitTorrent peers for 746385fe32b268d513d068f22c53c46d2eb34a5c hash in BitTorrent DHT:

import time
from btdht import DHT 

current_magnet = "746385fe32b268d513d068f22c53c46d2eb34a5c".decode("hex")

if __name__ == "__main__":

    # Start DHT Node on port 60000
    dht = DHT(host='0.0.0.0', port=60000)
    dht.start()
    
    # Boostrap it
    dht.bootstrap('router.bittorrent.com', 6881)
    
    # Find me peers for that torrent hashes
    dht.ht.add_hash(current_magnet)

    res = []  
    for count in xrange(5):
        print("DHT Nodes found: %d" % (dht.rt.count()))
        print("Bad DHT nodes found: %d" % (dht.rt.bad_count()))
        print("Total peers found: %d" % (dht.ht.count_all_peers()))
        
        # How many peers at this moment?
        peers = dht.ht.get_hash_peers(current_magnet)
        for peer in peers:
            res.append((peer))
            print("Found peer: %s:%d" % (peer))
        time.sleep(3)
    print("Total peers found: %d" % (len(res)))
    dht.stop()

dhtfck's People

Contributors

0x0d avatar beniz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.