• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • 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
KuppingerCole Reviews AlgoSec in Executive Report

Leading analyst firm, KuppingerCole reviews AlgoSec's Security Policy Management Solution, and the security challenges faced by companies today in their Executive View report.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

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