- Rongsen.Com.Cn 版权所有 2008-2010 京ICP备08007000号 京公海网安备11010802026356号 朝阳网安编号:110105199号
- 北京黑客防线网安工作室-黑客防线网安服务器维护基地为您提供专业的服务器维护,企业网站维护,网站维护服务
- (建议采用1024×768分辨率,以达到最佳视觉效果) Powered by 黑客防线网安 ©2009-2010 www.rongsen.com.cn
 
  
    
| 作者:黑客防线网安SQL维护基地 来源:黑客防线网安SQL维护基地 浏览次数:0 | 
二.外部网络安全性分析
1.数据库服务的探测
为了安全,可以让mysql服务运行在内网,但是如果你的机器有外网的接口,mysql也会自动被绑定在外网上面,暴露在internet中,而且系统会在TCP的3306端口监听,非常容易被端口扫描工具发现,不能保证数据安全。如果默认,mssql则会打开TCP的1433端口监听。虽然mssql可以人为的改变监听端口,但是通过微软未公开的1434端口的UDP探测可以很容易知道SQL Server使用的什么TCP/IP端口了。往UDP1434端口
发送一个1个字节的内容为02的数据包,被探测的系统则会返回安装的mssql服务信息,这些信息包括:主机名称、实例名称、版本、管道名称以及使用的端口等。这个端口是微软自己使用,而且不象默认的1433端口那样可以改变,1434是不能改变的。一个典型的返回的信息如下:
ServerName;Sky;InstanceName;sky;IsClustered;No;Version;8.00.194;tcp;3341;np;\\sky\pipe\MSSQL$XHT310\sql\query; 可以发现mssql的tcp端口改成了3341,为攻击者打开了方便之门!只要会一点socket编程知识,很容易就可以写出扫描mssql服务的程序,而且,由于利用了udp端口,一般的过滤是很难防范的。 补天的awen写了个探测程序,用的是c#语言,代码如下:
 using System; 
  using System.Net.Sockets; 
  using System.Net; 
  using System.Text; 
  using System.Threading; 
  namespace ConsoleApplication3 
  { 
  class Class1 
  { 
  //创建一个UDPCLIENT实例 
  private static UdpClient m_Client; 
  //LISTEN用来获取返回的信息 
  public static string Listen(string hostip) 
  { 
  string HostIP = hostip; 
  IPAddress thisIP = IPAddress.Parse(HostIP); 
  IPEndPoint host = new IPEndPoint(thisIP,1434); 
  byte [] data = m_Client.Receive(ref host); 
  Encoding ASCII = Encoding.ASCII; 
  String strData = ASCII.GetString(data); 
  return strData; 
  } 
  //SEND 
  public static void Send(string hostip) 
  { 
  string HostIP = hostip; 
  byte [] buffer = {02}; 
  //02为要发送的数据,只有02、03、04有回应 
  int ecode = m_Client.Send(buffer,1,HostIP,1434); 
  //ecode用来返回是否成功发送 
  if(ecode <= 0) 
  { 
  Console.WriteLine("发送时出错:" + ecode); 
  } 
  } 
  //对返回的信息的简单的处理 
  public static void OutputInfo(string strdata) 
  { 
  string str = strdata; 
  //str.le 
  char [] that = {‘;‘,‘;‘}; 
  string [] strofthis =str.Split(that); 
  //int i= 0 
  for(int i=0;i{ 
  Console.Write(strofthis); 
  Console.Write(‘ 
  ‘); 
  } 
  } 
  //输入IP 
  public static string InputHostIP() 
  { 
  Console.Write("enter the ip you want to scan: 
  "); 
  string hostip =Console.ReadLine(); 
  Console.Write(‘ 
  ‘); 
  return hostip; 
  } 
  //EXIT 
  public static void Exit() 
  { 
  Console.WriteLine("if you want to exit ,just input 1 
  "); 
  int a = Console.Read(); 
  if(a!= 1) 
  { 
  Console.WriteLine("if you want to exit ,just input 1 
  "); 
  Console.Read(); 
  } 
  else 
  { 
  } 
  } 
  [STAThread] 
  static void Main(string[] args) 
  { 
  string HostIP; 
  HostIP = InputHostIP(); 
  Console.WriteLine("Begin to send udp to the host"); 
  m_Client = new UdpClient(); 
  Send(HostIP); 
  string strData=Listen(HostIP); 
  OutputInfo(strData); 
  Exit(); 
  } 
  } 
  } 
| 我要申请本站:N点 | 黑客防线官网 | | 
| 专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479 |