如何以编程方式检查远程主机的操作系统? [英] How to check programmatically the OS of remote host?

查看:58
本文介绍了如何以编程方式检查远程主机的操作系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检查远程主机是 Windows 还是 Unix/Linux.我不能假设它配置了网络服务器.我所能做的就是尝试连接到多个 TCP 或 UDP 服务.

I need to check if remote host is Windows or Unix/Linux. I can't assume that it has web server configured. All I can do is to try to connect to several TCP or UDP services.

哪些 TCP 服务(TCP 端口号)通常会在 Windows 上打开,而不会在 Unix/Linux 上打开,反之亦然?

Which TCP services (TCP port numbers) usually will be opened on Windows and not on Unix/Linux and vise versa?

另一种方法是尝试通过 ssh 连接到它,如果失败,则假定它是 Windows 主机.问题是,我需要这个来选择远程访问方法 ssh 或 Windows 友好的东西,比如 psexec.

The other way is to try to ssh to it, and if it fails assume that it Windows host. The problem is, that I need this in order to choose the remote access method ssh or something Windows friendly like psexec.

推荐答案

您可以阅读 nmap 的输出检测远程主机正在运行的操作系统.它有一个专门用于此的整个模块.这是使用指南.

You can read the output of nmap to detect which OS a remote host is running. It has a whole module dedicated to this. Here is a guide to using it.

这篇关于如何以编程方式检查远程主机的操作系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆