Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 130
  • Last Modified:

nmap scanner?

nmap scanner?who knows how to scan port 3333-3392 not all open ports but only those who have RDP ?
thank you...
0
john lambert
Asked:
john lambert
  • 4
  • 2
1 Solution
 
ste5anSenior DeveloperCommented:
Use nmap -p 3333-3392 on the command line.
0
 
skullnobrainsCommented:
something like this

nmap -PY3333-3392 a.b.d.d/mask | grep RDP
0
 
skullnobrainsCommented:
requires to loop over nmap results and attempt a connection with a software that understands rdp

something like this scans ports properly on my own host.
i feel lazy grabbing the hostname with sed but it is rather trivial

nmap -p 3333-3392 localhost | sed -n 's:^\([0-9][0-9]*\).*:\1:p' | xargs -n 1 -I% sh -c 'xfreerdp -u tst -p tst --authonly localhost:% >/dev/null 2>/dev/null && echo "RDP listening on localhost:%" '
RDP listening on localhost:3389

Open in new window

0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
john lambertAuthor Commented:
something for windows ?
0
 
skullnobrainsCommented:
since you stated yourself that you already had figured the answer out, i'm wondering why you would ask.

you would need to code the equivalent in whatever language you are comfortable with. powershell has a few tools but parsing nmap's output seems complicated. you probably need to install either sed only and work it out in powershell, or rather script it in vb, perl, or even install cygwin or bash4unix ( or a similar shell ) and use the above code.

note that even the above code does not handle multiple hosts as-is. you'd need a second sed instruction
1
 
john lambertAuthor Commented:
thank you........
0
 
skullnobrainsCommented:
feel free to post the final script for windows. i'm pretty sure it can be useful to others. if you manage something that works without installing extra tools, all the better.
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now