Solved

nmap scanner?

Posted on 2016-10-15
7
107 Views
Last Modified: 2016-11-13
nmap scanner?who knows how to scan port 3333-3392 not all open ports but only those who have RDP ?
thank you...
0
Comment
Question by:john lambert
  • 4
  • 2
7 Comments
 
LVL 33

Expert Comment

by:ste5an
ID: 41845154
Use nmap -p 3333-3392 on the command line.
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 41845155
something like this

nmap -PY3333-3392 a.b.d.d/mask | grep RDP
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 41883428
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:john lambert
ID: 41884496
something for windows ?
0
 
LVL 26

Accepted Solution

by:
skullnobrains earned 500 total points
ID: 41884500
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
 

Author Closing Comment

by:john lambert
ID: 41884505
thank you........
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 41885428
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the biggest threats facing all high-value targets are APT's.  These threats include sophisticated tactics that "often starts with mapping human organization and collecting intelligence on employees, who are nowadays a weaker link than network…
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question