Questions tagged [nmap]

Questions relating to Nmap, a free and open-source utility for network exploration or security auditing.

Nmap is a free and open-source port scanner, operating system fingerprinter, and service fingerprinter, fully extensible via the Lua-based Nmap Scripting Engine (NSE).

Here are some resources for answering Nmap questions:

719 questions
2
votes
2 answers

How to retrieve MAC addresses from nearby hosts, in python?

I note that with python-nmap, I can do this: $ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import nmap >>> n = nmap.PortScanner() >>>…
mikepurvis
  • 1,568
  • 2
  • 19
  • 28
2
votes
2 answers

What's the best way to nmap thousands of subnets in parallel from a script?

To inventory a port in part of a Class-A network, I scan that as a few thousand Class-C networks using nmap. I use parallel to run 32 subnet scan jobs at once. A minimized version of the script: while read subnet; do echo nmap -Pn -p"$tcpport"…
user3126740
  • 121
  • 1
  • 1
  • 8
2
votes
1 answer

Ruby system arguments

I'm trying to use system to run nmap from a ruby program. I want to escape some of the arguments to prevent shell injection so I'm using the following form: system('nmap', '-sn', hostname) This works fine, however I want to use the -oX - option to…
Slicedpan
  • 4,995
  • 2
  • 18
  • 33
2
votes
4 answers

Call python-nmap PortScanner(), nmap not found

In my virtualenv I installed python-nmap and nmap is installed (OS X). But if I call mmap like (virtualenv activated...): import sys sys.path.append('/usr/local/bin') import nmap nm = nmap.PortScanner() I get the following error: Raise…
user2883656
  • 93
  • 2
  • 9
2
votes
1 answer

Nmap frozen on NSE Timing phase

I ran this script in Terminal: nmap -p 80 --script http-joomla-brute --script-args 'passdb=/Users/abc/Documents/passwords.txt,http-joomla-brute.threads=5,brute.firstonly=true, unpwdb.timelimit=0' my.website.here. It displays this: Starting Nmap…
Ivan Vegner
  • 1,707
  • 4
  • 14
  • 23
2
votes
1 answer

What is the best way to invoke Nmap in C/C++?

I am developing protocol fuzzing software in C/C++. I need a way to monitor the status of the fuzzing target (like ports, services). Is Nmap a good choice? If yes, then how to invoke Nmap in C/C++, is there an API? Thx.
hsluoyz
  • 2,739
  • 5
  • 35
  • 59
2
votes
3 answers

Nmap output format ip:port

I need load ip list from file, scan it, and create output format such as ip:port. I tried this: nmap -iL mylistwithip.txt -p 80,21 -oG -PS 80,21 | awk '/open/{print $2}' >` output.txt but it gives me only "open" and that's all. While I need only…
user3287134
  • 37
  • 1
  • 6
2
votes
3 answers

Bash Script Block All Apple Devices

I am trying to create a shell script to block all apple devices on my network. I am using nmap for os detection. What I have so far is this: while (true) do nmap -O -T4 -p 22,80 -v 172.20.0.0/24 | grep -B9 'OS details: Apple' | \ grep…
735Tesla
  • 3,162
  • 4
  • 34
  • 57
2
votes
3 answers

Filtering nmap outputs using grep, awk, or sed

I using NMAP, I ran a scan on a large network to see open ports. The output file is 2MB, but I want to filter out all of the IP addresses with ALL closed ports. Nmap scan report for 10.x.x.x Host is up (0.048s latency). Not shown: 998 closed…
user3037023
  • 21
  • 1
  • 3
2
votes
3 answers

Regexp on nmap services file

I need to filter with sed only the ports from /usr/share/nmap/nmap-services tcpmux 1/tcp 0.001995 # TCP Port Service Multiplexer [rfc-1078] compressnet 2/tcp 0.000013 # Management Utility compressnet 3/tcp 0.001242 …
asdf
  • 685
  • 7
  • 23
2
votes
5 answers

nmap and svnlib_client not working together

I installed nmap on Debian 6 squeeze, 64 bit. When I run nmap it says: nmap: error while loading shared libraries: libsvn_client-1.so.0: cannot open shared object >file: No such file or directory so I googled it and found a solution which was. ln…
MassDefect_
  • 1,821
  • 3
  • 20
  • 24
2
votes
1 answer

Python Nmap Path Error

Python imports NMap fine but when I do a basic variable assignment it returns an error: Traceback (most recent call last): File "", line 1, in nm = nmap.PortScanner() File "C:\Python32\lib\site-packages\nmap\nmap.py",…
Kryptos
  • 391
  • 4
  • 10
2
votes
2 answers

nmap shows less ports open when it runs against ip other than localhost

I have a vm in vmware workstation, it's bridged network and DHCP. The IP assigned by DHCP server is 10.21.245.22. Here is my /etc/hosts looks like: 127.0.0.1 hadoop-namenode-01 localhost I am running command A and B on the box…
Shengjie
  • 12,336
  • 29
  • 98
  • 139
2
votes
1 answer

Draining the ncat pipe

Suppose I want a chargen like server, so I invoke while sleep 1; do date; done | ncat -kl 12345 If no one is reading the pipe, then the first client to connect to the socket will immediately get a bunch of output all at once. To prevent that, I…
William Pursell
  • 204,365
  • 48
  • 270
  • 300
1
vote
1 answer

ncat ssl-connection with username/password authentication?

Can someone show me with ncat, how to connect to a https URL where the server requires a username+password? Without user+password I can connect with just ncat --ssl host port but how do I specify logon-credentials, when required?
Rop
  • 3,359
  • 3
  • 38
  • 59