Nmap bittorrent-discovery NSE Script
This page contains detailed information about how to use the bittorrent-discovery NSE script. For list of all NSE scripts, visit the Nmap NSE Library.
Script Overview
Script source code: https://github.com/nmap/nmap/tree/master/scripts/bittorrent-discovery.nse
Script categories: discovery, safe
Target service / protocol: -
Target network port(s): -
List of CVEs: -
Script Description
The bittorrent-discovery.nse script 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.
Bittorrent-discovery NSE Script Arguments
This is a full list of arguments supported by the bittorrent-discovery.nse script:
bittorrent-discovery.include-nodesBoolean selecting whether to show only nodes
bittorrent-discovery.magnetA string containing the magnet link of the torrent
bittorrent-discovery.timeoutDesired (not actual) timeout for the DHT discovery (default = 30s)
bittorrent-discovery.torrentA string containing the filename of the torrent file
max-newtargetsSets the number of the maximum allowed new targets. If set to 0 or less then there is no limit. The default value is 0.
newtargetsIf specified, lets NSE scripts add new targets.
- - -
To use these script arguments, add them to the Nmap command line using the --script-args arg1=value,[arg2=value,..]
syntax. For example:
nmap --script=bittorrent-discovery --script-args bittorrent-discovery.include-nodes=value,bittorrent-discovery.magnet=value <target>
Bittorrent-discovery NSE Script Example Usage
Here's an example of how to use the bittorrent-discovery.nse script:
nmap --script bittorrent-discovery --script-args newtargets,bittorrent-discovery.torrent=<torrent_file>
Bittorrent-discovery NSE Script Example Output
Here's a sample output from the bittorrent-discovery.nse script:
| bittorrent-discovery:
| Peers:
| 97.88.178.168
| 89.100.184.36
| 86.185.55.212
| Total of 3 peers discovered
| Nodes:
| 68.103.0.189
| 67.164.32.71
| 24.121.13.69
| 207.112.100.224
| Total of 4 nodes discovered
|_ Use the newtargets script-arg to add the results as targets
Bittorrent-discovery NSE Script Example XML Output
There is no sample XML output for this module. However, by providing the -oX <file>
option, Nmap will produce a XML output and save it in the file.xml
file.
Author
- Gorjan Petrovski
References
- https://nmap.org/nsedoc/scripts/bittorrent-discovery.html
- https://github.com/nmap/nmap/tree/master/scripts/bittorrent-discovery.nse
See Also
Visit Nmap NSE Library for more scripts.
Version
This page has been created based on Nmap version 7.92.