获取网站Web服务器类型的办法
创始人
2024-08-02 08:21:17
0

获取网站Web服务器类型的办法如下:

有些同学老问怎么判断Web服务器,问这个扫描器那个扫描器顿时月经来潮。如nmap nc nikto等好多可以的….要那么多扫描器干嘛 NMAP一个就够了!方法N多,举几个例子吧!
 

  1. nmap  
  2.    
  3. pentest@yinyin:~$ nmap -sV -p 80 www.xxoo.com  
  4.    
  5. Starting Nmap 5.00 ( http://nmap.org ) at 2010-05-24 19:49 CST  
  6. Interesting ports on 203.xxx.xxx.1×1:  
  7. PORT STATE SERVICE VERSION  
  8. 80/tcp open http nginx web server 0.8.16  
  9.    
  10. Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .  
  11. Nmap done: 1 IP address (1 host up) scanned in 6.97 seconds  
  12. ———————————————————————————————————-  
  13.    
  14. nc  
  15.    
  16. pentest@yinyin:~$ nc -vv www.xxoo.com 80  
  17. Connection to www.xxoo.info 80 port [tcp/www] succeeded!  
  18. get http /1.1  
  19. HTTP/1.1 400 Bad Request  
  20. Date: Mon, 24 May 2010 11:54:35 GMT  
  21. Server: Apache  
  22. Connection: close  
  23. Content-Type: text/html; charset=iso-8859-1……..省略  
  24. ———————————————————————————————————-  
  25.    
  26. Curl 

lCurl是一款用于在网络上传输数据的工具,支持HTTP, HTTPS, FTP, FTPS, TFTP, DICT,TELNET,LDAP等协议。通过curl你既可以将服务器的数据下载下来,也可以将本地的数据上传到服务器。curl的选项很多,大家可以 参考curl 官方说明!
 

  1. pentest@yinyin:~$ curl –head http://www.artist-tc.com/  
  2. HTTP/1.1 200 OK  
  3. Server: nginx/0.8.16  
  4. Date: Mon, 24 May 2010 12:00:55 GMT  
  5. Content-Type: text/html  
  6. Connection: keep-alive  
  7. Keep-Alive: timeout=20 
  8. Vary: Accept-Encoding  
  9. ———————————————————————————————————- 

提供个可批量扫描的批处理!胡乱写的 将就下吧!
 

  1. echo FOR /F ^%%a IN (1.txt) DO nmap -sV -PN -p 80 ^%%a -r > scan.bat  
  2. cmd.exe < scan.bat 
  3. del /q /f scan.bat  
  4. pause 

把需要扫描的网址 IP IP段写进1.txt就可以了!需要安装nmap 不保存以及过滤结果 自行修改吧!
 

在来个curl扫描脚本!首先创建一个site.txt文件,里面输入相应的网站。
 

  1. pentest@ubuntu:~$ head site.txt  
  2. g.cn  
  3. baidu.com  
  4. qq.com  
  5. www.xxoo.com 

之后结合下面的curl.sh脚本,就可以获知site.txt中网站的服务器类型了。
 

  1. #!/bin/sh  
  2. IIS=0 
  3. nginx=0 
  4. apache=0 
  5. other=0 
  6. if [ ! -f site.txt ]; then  
  7. echo “ERROR:site.txt NOT exists!”  
  8. exit 1  
  9. fi  
  10.    
  11. total=`wc -l site.txt|awk ‘{print $1}’`  
  12. for website in `cat site.txt`  
  13. do  
  14. server=`curl -Is –connect-timeout 15 $website|awk -F”:” ‘/^Server:/{print $2}’`  
  15. echo -e $website”:” $server  
  16. if echo $server|grep -i “IIS”>/dev/null  
  17. then IIS=`expr $IIS + 1`  
  18. elif echo $server|grep -i “Apache”>/dev/null  
  19. then Apache=`expr $Apache + 1`  
  20. elif echo $server|grep -i “nginx”>/dev/null  
  21. then nginx=`expr $nginx + 1`  
  22. else other=`expr $other + 1`  
  23. fi  
  24. done  
  25. echo “——————————————–”  
  26. echo -e “Total\tApache\tIIS\tnginx\tother”  
  27. echo -e “$total\t$Apache\t$IIS\t$nginx\t$other”  
  28. echo -e “100%\t”`echo “scale=5;$Apache/$total*100″|bc|cut -c1-5`”%\t”`echo “scale=5;$IIS/$total*100″|bc|cut -c1-5`”%\t”`echo “scale=5;$nginx/$total*100″|bc|cut -c1-5`”%\t”`echo “scale=5;$other/$total*100″|bc|cut -c1-5`”%\t”  
  29. echo “——————————————–”  
  30. exit 0 

输出结果:
 

  1. pentest@ubuntu:~$ ./curl.sh  
  2. -e g.cn: gws  
  3. -e baidu.com: Apache  
  4. -e qq.com: nginx/0.6.39  
  5. -e www.artist-tc.com: nginx/0.8.16  
  6.  
  7.  
  8. ——————————————–  
  9. -e Total Apache IIS nginx other  
  10. -e 4 1 0 2 1  
  11. -e 100% 25.00% 0% 50.00% 25.00%  
  12. ——————————————– 

Web服务器类型是怎么获取的?我想大家已经可以解答这个问题了吧。

【编辑推荐】

  1. WEB安全防护解决方案
  2. 加固服务器防网络被挂马
  3. 浅析新浪微博Web蠕虫事件
  4. “应用”是王道 锦囊妙计谋安全之驻守WEB安全
  5. Websense稳坐Gartner Web安全网关魔力象限领导者地位

相关内容

热门资讯

PHP新手之PHP入门 PHP是一种易于学习和使用的服务器端脚本语言。只需要很少的编程知识你就能使用PHP建立一个真正交互的...
网络中立的未来 网络中立性是什... 《牛津词典》中对“网络中立”的解释是“电信运营商应秉持的一种原则,即不考虑来源地提供所有内容和应用的...
各种千兆交换机的数据接口类型详... 千兆交换机有很多值得学习的地方,这里我们主要介绍各种千兆交换机的数据接口类型,作为局域网的主要连接设...
粉嫩如何诠释霸道 东芝M805... “霸道粉”是个什么玩意东芝M805拿过来的时候,笔者扑哧笑了,不是笑这款笔记本,而是笑这款产品的颜色...
什么是大数据安全 什么是大数据... 在《为什么需要大数据安全分析》一文中,我们已经阐述了一个重要观点,即:安全要素信息呈现出大数据的特征...
全面诠释网络负载均衡 负载均衡的出现大大缓解了服务器的压力,更是有效的利用了资源,提高了效率。那么我们现在来说一下网络负载...
如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
30分钟搞定iOS自定义相机 最近公司的项目中用到了相机,由于不用系统的相机,UI给的相机切图,必须自定义才可以。就花时间简单研究...
P2P的自白|我不生产内容,我... 现在一提起P2P,人们就会联想到正在被有关部门“围剿”的互联网理财服务。×租宝事件使得劳...