Script bittorrent-discovery

Script types: prerule
Categories: discovery, safe

Script Summary

Discovers bittorrent peers sharing a file based on a user-supplied torrent file or magnet link. Peers implement the Bittorrent protocol and share the torrent, whereas the nodes (only shown if the include-nodes NSE argument is given) implement the DHT protocol and are used to track the peers. The sets of peers and nodes are not the same, but they usually intersect.

If the newtargets script-arg is supplied it adds the discovered peers as targets.

Script Arguments


boolean selecting whether to show only nodes


desired (not actual) timeout for the DHT discovery (default = 30s)


a string containing the magnet link of the torrent


a string containing the filename of the torrent file

max-newtargets, newtargets

See the documentation for the target library., http.max-body-size, http.max-cache-size, http.max-pipeline, http.pipeline, http.truncated-ok, http.useragent

See the documentation for the http library.


See the documentation for the slaxml library.

smbdomain, smbhash, smbnoguest, smbpassword, smbtype, smbusername

See the documentation for the smbauth library.

Example Usage

nmap --script bittorrent-discovery --script-args newtargets,bittorrent-discovery.torrent=<torrent_file>

Script Output

| bittorrent-discovery:
|   Peers:
|     Total of 3 peers discovered
|   Nodes:
|     Total of 4 nodes discovered
|_  Use the newtargets script-arg to add the results as targets



  • Gorjan Petrovski

License: Same as Nmap--See