怎么使用ntsd -c q结束进程或进行其他操作

作者&投稿:仲孙羽 (若有异议请与网页底部的电邮联系)
操作系统与编程语言的关系?~

编程语言是操作, 操作系统是平台
操作系统会识别和接受编程语言发来的信息, 当然, 中间要经过 汇编语言,机器语言。
例如编程语言 发过来的信息是 1*1

不同的操作系统可能会识别成不同的信息 如windows 识别成1+1, linux 识别成1-1(随便举的例子,实际不是这样的)
所以C 在windows和linux下,功能会有些许差别。


命令格式:ntsd -c q -p pid
命令范例: ntsd -c q -p 4 (结束System进程。当然,System进程是杀不掉的)
范例详解:System的pid为4,但是如何获取进程的pid呢?在CMD下输入TASKLIST就可以获取当前任务管理器所有进程的PID。或者打开任务管理器,在菜单栏,选择“查看”—“选择列”,在打开的选择项窗口中将“PID(进程标识符)”项选择钩上,这样任务管理器的进程中就会多出PID一项了。(PID的分配并不固定,是在进程启动是由系统随机分配的,所以进程每次启动的进程一般都不会一样。)
可使用以下批处理:
=================================================
rem 复制以下内容到记事本,另存为pid.bat
@echo off
mode con cols=30 lines=5
color 1e
echo.
set /p t=请输入进程名:
tasklist /fo csv>2.txt
find "%t%" 2.txt>1.txt
for /f "delims=, tokens=2" %%i in (1.txt) do set a=%%i
ntsd -c q -p %a%
echo PID NAME
echo ============
echo %a% %T%
del 1.txt
del 2.txt
pause >nul
exit
=================================================

利用进程名结束进程

命令格式:ntsd -c q -pn ***.exe (***.exe 为进程名,exe不能省)
命令范例:ntsd -c q -pn explorer.exe
另外的能结束进程的DOS命令还有taskkill和tskill命令:
命令格式: taskkill /pid 1234 /f ( 也可以达到同样的效果。)
[编辑本段]Ntsd详解
有一些高等级的进程,tskill和taskkill或许无法结束,那么我们还有一个更强大的工具,那就是系统debug级的ntsd.准确的说,ntsd是一个系统调试工具,只提供给系统开发级的管理员使用,但是对我们杀掉进程还是很爽的.基本上除了WINDOWS系统自己的管理进程,ntsd都可以杀掉。NTSD 调试程序在启动时要求用户指定一个要连接的进程。使用 TLIST 或 PVIEWER,您可以获得某个现有进程的进程 ID,然后键入 NTSD -p pid 来调试这个进程。NTSD 命令行使用如下的句法:
NTSD [options] imagefile
其中,imagefile 是要调试的映像名称。
用法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 ]
[-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 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 ---
选项option:
-2打开一个用于调试字符模式的应用程序的新窗口
-d将输出重定向到调试终端-g 使执行自动通过第一个断点
-G使 NTSD 在子程序终止时立即退出o启用多个进程的调试,默认值为由调试程序衍生的一个进程
-p指定调试由进程 ID 标识的进程
-v产生详细的输出。
例如,假设 inetinfo.exe 的进程 ID 为 104。键入命令“NTSD -p 104”将 NTSD 调试程序连接到 inetinfo 进程 (IIS)。也可使用 NTSD 启动一个新进程来进行调试。例如,NTSD notepad.exe 将启动一个新的 notepad.exe 进程,并与它建立连接。一旦连接到某个进程,您就可以用各种命令来查看堆栈、设置断点、转储内存,等等。
命令含义~显示所有线程的一个列表KB 显示当前线程的堆栈轨迹~*KB显示所有线程的堆栈轨迹R显示当前
帧的寄存器输出U反汇编代码并显示过程名和偏移量D[type][< range>]转储内存BP设置断点BC[]清除一个或多个断点BD[]禁用一个或多个断点BE[< bp>]启用一个或多个断点BL[]列出一个或多个断点。
个人意见,有一个非常重要的参数就是-v参数,我们可以通过它发现一个进程下面挂接了哪些连接库文件。有很多病毒,木马,或者恶意软件,都喜欢把自己做成动态库,然后注册到系统正常程序的加载库列表中,达到隐藏自己的目的.
首先我们需要设置一下ntsd的输出重定向,最好是重定向到一个文本文件,方便我们分析研究.
c:\>set _NT_DEBUG_LOG_FILE_APPEND=c:\pdw.txt
注意,虽然输出重定向了,但是我们的输出依然会继续显示在屏幕上,而且会进入到debug模式,我们使用-c q参数,就可以避免这个问题.
c:\>ntsd -c q -v notepad.exe
现在我们的pdw.txt文件中,就可以看见notepad.exe文件的调试信息.
可以知道,ntsd的软件终止能力是很好很强大的,一些taskkill都无法终止的软件(如Student.exe这一类或木马)可以用ntsd轻易终止
但是它仍有缺点,因为技术在不断更新,在对付最新的有很强防护的病毒等程序时
,仍建议使用IceSword等专业工具。可以试一下ntsd拿360,IceSword,nod32等杀软程序毫无办法。


静乐县13367777683: 如何用DOS命令结束一个进程 -
於昨格列: 我们用:ntsd -c q -p PID 就可把来路不明的进程杀掉,-c是执 行调试命令,q是退出,-p是指用pid来处理,PID就是任务管理器里的PID (进程ID)啊.只要你在一般的状态下,进入命令行下,“ntsd -c q -p 进程ID”就可终止进程了.例如,我的机器里有一个进程“ mssearch.exe”,在任务管理器里pid是948,该进程在任务管理器里终 止不了,在命令行下输入“ntsd -c q -p 948”,或单击"开始--运行",再 输入命令也可以.这样就把本来杀不了的进程,给干掉了,不过可不要 乱杀进程啊,以免给系统带来莫名其妙的问题.

静乐县13367777683: 怎么使用ntsd- c q结束进程或进行其他操作 -
於昨格列: 命令格式:ntsd -c q -p pid 命令范例: ntsd -c q -p 4 (结束System进程.当然,System进程是杀不掉的) 范例详解:System的pid为4,但是如何获取进程的pid呢?在CMD下输入TASKLIST就可以获取当前任务管理器所有进程的PID.或者打开...

静乐县13367777683: 怎么用 ntsd关掉所有进程 -
於昨格列: c:>ntsd -c q -p PID只有System、SMSS.EXE和CSRSS.EXE不能杀.前两个是纯内核态的,最后那个是Win32子系统,ntsd本身需要它.ntsd从2000开始就是系统自带的用户态调试工具.被调试器附着(attach)的进程会随调试器一起退出,...

静乐县13367777683: 如何强制用命令结束进程? -
於昨格列: 可以打开系统运行对话框,在其中运行“cmd”命令,在命令提示符状态下输入“ntsd -c q -p PID”命令,就可以强行将指定PID的病毒进程杀死了.例如,发现某个病毒进程的PID为“444”,那么可以执行“ntsd -c q -p 444”命令,来结束这个进程!,其他的操作以此类推!!!

静乐县13367777683: Ntsd的详细用法 -
於昨格列: 引用:强制结束进程的命令行Windows操作系统中只有System、SMSS.EXE和CSRSS.EXE不能杀.前两个是纯内核态的,最后那个是Win32子系统,ntsd本身需要它.ntsd从2000开始就是系统自带的用户态调试工具.被调试器附着(attach...

静乐县13367777683: 已知进程ID,怎么结束进程
於昨格列: 在CMD下输入 ntsd -c q -p pid //pid就是需要结束的进程的ID 前面几个是一些参数

静乐县13367777683: 如何强行结束进程? -
於昨格列: 2000/XP下点 开始---运行---CMD 在命令符里面输入ntsd -c q -p PID编号 就是进程后面跟的数字 XP默认是不显示的 你打开任务管理器 --查看--选择列--PID前面打个勾

静乐县13367777683: 怎样用命令提示符打开或关闭进程? -
於昨格列: 结束进程:taskkill /f /im [进程映像名] 如:taskkill /f /im explorer.exe 运行程序:start [要运行程序的路径] 如:Start c:\windows\system32\cmd.exe 但如果要运行的程序不在当前盘内,就要用cd /d 命令转到程序目录 再运行程序

静乐县13367777683: 如何结束电脑进程 -
於昨格列: 1、按住Ctrl+Alt+Delete键,调出任务管理器,单击进程标签,右击某进程,选择结束进程.2、按住Win+R键,出现运行菜单,输入Taskkill /P 进程ID /F,回车即结束进程.3、按住Win+R键,出现运行菜单,输入NTSD -C Q -P 进程ID,回车即...

静乐县13367777683: 如何关闭进程 -
於昨格列: 任务管理器中,直接点进程右键选结束!或命令符下用 其实用Windows自带的工具就能杀大部分进程:c:\>ntsd -c q -p PID只有System、SMSS.EXE和CSRSS.EXE不能杀.前两个是纯内核态的,最后那个是Win32子系统,ntsd本身需要它....

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网