Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need a way to Identify a windows SBS server, I have a script that mounts a file share on a SBS server, I need the script to positivity identify the server before mounting. It doesn't need to be secure,

My setup is like this :

My machine is on 192.168.5.17, the server is on 192.168.0.3, Because were on different subnets I cannot simply check the arp table for the machines mac address.

running Nmap against the server reveals these open ports

Starting Nmap 6.00 ( http://nmap.org ) at 2012-08-01 09:01 BST
Nmap scan report for host.somewhere.local (192.168.0.3)
Host is up (0.12s latency).
Not shown: 979 closed ports
PORT      STATE SERVICE
21/tcp    open  ftp
80/tcp    open  http
119/tcp   open  nntp
135/tcp   open  msrpc
139/tcp   open  netbios-ssn
443/tcp   open  https
445/tcp   open  microsoft-ds
563/tcp   open  snews
1025/tcp  open  NFS-or-IIS
2002/tcp  open  globe
2301/tcp  open  compaqdiag
2381/tcp  open  compaq-https
2910/tcp  open  tdaccess
3389/tcp  open  ms-wbt-server
4443/tcp  open  pharos
6129/tcp  open  unknown
8192/tcp  open  sophos
8193/tcp  open  sophos
8194/tcp  open  sophos
9000/tcp  open  cslistener
10000/tcp open  snet-sensor-mgmt

Nmap done: 1 IP address (1 host up) scanned in 20.70 seconds

The Nmap results show

Nmap scan report for host.somewhere.local (192.168.0.3)

How did it reslove the name i've tried dig and host but cannot get the name from the IP

The machine runs https can I somwhow check the cert from a bash script? Or is their another way to check the host is actually who I expect it to be?

Thanks.

share|improve this question
add comment

1 Answer 1

Verifying the https-certificate is propably the best idea. IP, MAC and Names can be easyly spoofed.

Look at curl to check https. You need to provide it with the public CA-certificate, too. As far as I remember the default is that it will deny download if the server-certificate does not match the CA.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.