Nmap bitcoin-getaddr NSE Script


This page contains detailed information about how to use the bitcoin-getaddr NSE script. For list of all NSE scripts, visit the Nmap NSE Library.

Select:
Overview
Error Messages

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/bitcoin-getaddr.nse
Script categories: discovery, safe
Target service / protocol: bitcoin, tcp
Target network port(s): 8333
List of CVEs: -

Script Description


The bitcoin-getaddr.nse script queries a Bitcoin server for a list of known Bitcoin nodes

Bitcoin-getaddr NSE Script Arguments


This is a full list of arguments supported by the bitcoin-getaddr.nse script:

max-newtargets

Sets the number of the maximum allowed new targets. If set to 0 or less then there is no limit. The default value is 0.

newtargets

If 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=bitcoin-getaddr --script-args max-newtargets=value,newtargets=value <target>

Bitcoin-getaddr NSE Script Example Usage


Here's an example of how to use the bitcoin-getaddr.nse script:

nmap -p 8333 --script bitcoin-getaddr <ip>

Bitcoin-getaddr NSE Script Example Output


Here's a sample output from the bitcoin-getaddr.nse script:

PORT     STATE SERVICE
8333/tcp open  unknown
| bitcoin-getaddr:
|   ip                    timestamp
|   10.10.10.10:8333      11/09/11 17:38:00
|   10.10.10.11:8333      11/09/11 17:42:39
|   10.10.10.12:8333      11/09/11 19:34:07
|   10.10.10.13:8333      11/09/11 17:37:45
|_  10.10.10.14:8333      11/09/11 17:37:12

Bitcoin-getaddr 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


  • Patrik Karlsson

References


See Also


Related NSE scripts to the bitcoin-getaddr.nse script:

Visit Nmap NSE Library for more scripts.

The bitcoin-getaddr.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.

Failed to connect to server


Here is a relevant code snippet related to the "Failed to connect to server" error message:

44:	
45:	  local bcoin = bitcoin.Helper:new(host, port, { timeout = 20000 })
46:	  local status = bcoin:connect()
47:	
48:	  if ( not(status) ) then
49:	    return fail("Failed to connect to server")
50:	  end
51:	
52:	  local status, ver = bcoin:exchVersion()
53:	  if ( not(status) ) then
54:	    return fail("Failed to extract version information: " .. ver)

Failed to extract version information:


Here is a relevant code snippet related to the "Failed to extract version information: " error message:

49:	    return fail("Failed to connect to server")
50:	  end
51:	
52:	  local status, ver = bcoin:exchVersion()
53:	  if ( not(status) ) then
54:	    return fail("Failed to extract version information: " .. ver)
55:	  end
56:	
57:	  local status, nodes = bcoin:getNodes()
58:	  if ( not(status) ) then
59:	    return fail("Failed to extract address information" .. nodes)

Failed to extract address information


Here is a relevant code snippet related to the "Failed to extract address information" error message:

54:	    return fail("Failed to extract version information: " .. ver)
55:	  end
56:	
57:	  local status, nodes = bcoin:getNodes()
58:	  if ( not(status) ) then
59:	    return fail("Failed to extract address information" .. nodes)
60:	  end
61:	  bcoin:close()
62:	
63:	  local response = tab.new(2)
64:	  tab.addrow(response, "ip", "timestamp")

Version


This page has been created based on Nmap version 7.92.

Go back to menu.