![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-12 19:38 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS学习入门 & 精彩文章 (教学室) » [Share] Eight Classic Cases of DOS Commands |
| Printable Version 5,042 / 29 |
| Floor1 maidu | Posted 2008-03-25 16:34 |
| 社区乞丐 Posts 40 Credits -66 | |
|
Classic Cases of DOS Commands
2007-08-13 11:45:46 DOS is gradually fading away. We habitually use Windows 98/Me/2000/XP every day. But do you understand DOS in Windows? Actually, in some cases, DOS is much more convenient and faster than Windows. After all, this is a classic work of the operating system. The following are eight classic cases summarized from the skills I explored in using DOS, hoping to inspire and help readers a little in using computers. Case 1: "FC" - File Comparison As we all know, when installing software, some traces are generally left in the registry more or less. Over time, there will be a large amount of garbage left, making our system gradually slow down until it crashes. Indeed, there are many useful tools to help us solve this problem. But if we want to know what exactly they leave in the registry and there is no suitable tool at hand, are we helpless? Wait, let's bring out the most convenient comparison tool under DOS - "FC" Format: FC <filename><filename></b> Usage: First, export the registry as a file such as "1.reg" before installing the software, and export another file such as "2.reg" after installing the software. Suppose both files are placed in the root directory of drive C. We enter the MS-DOS mode and type "C:\fc 1.reg 2.reg" and press Enter. Did you see it? The screen shows exactly the places where the registry has been modified. Note: FC defaults to comparing two files line by line. The length of each line in the file should be less than 256 characters. If the line length exceeds 256 characters or the comparison object is a binary file or program file, add the /b parameter at the end. FC will compare them byte by byte. Case 2: ">" - Redirected Output Let's continue with the above case. Sometimes when we use the above method, we find that the screen keeps scrolling up, and many messages flash by and can't be stopped. This is because the two files are too different and there are too many modified places. What to do? Don't worry. At this time, we need to use another small skill - use the redirected output ">". Format: Command (or program) > Redirected input device (or filename) Usage: We still use the above example. Type "C:\fc 1.reg 2.reg >change.txt" in DOS and press Enter. Why is there no information? Actually, if you look carefully, you will find that a FC.txt file is added in this directory. Quickly open it with Notepad. It contains all the comparison information of these two files: ) So easy, right. Note: You can output it to any format file, and they can all be opened in text mode. Case 3: "copy" - File Merging There are many times when video files on the Internet are divided into many small segments for everyone to download separately. But when watching the downloaded files, you always have to open them continuously. So is there any way to merge them back into a whole file? Although using a special video editing tool is possible, the cumbersome English makes us headache. Actually, there is a ready-made tool under DOS. The commonly used "copy" command can be used to complete it. Let's take a look. Format: copy /b <filename1>+<filename2>+…+<filenameN>>filename> Usage: Suppose you have two files on your hard disk, namely video1.mpg and video2.mpg. Then type "copy /b video1.mpg+video2.mpg video.mpg" in this directory. The video.mpg is the new filename generated after merging. Hurry up and try it. Open the player to see if it is merged well. Of course, if you like novels and music and find it too troublesome to open and close continuously, you might as well try this method to merge them together for viewing. Case 4: "copy" - Batch Renaming Actually, I'm here to earn points, he he A friend needs to rename a series of text files according to numbers for a project. But because the number is too large, it's too troublesome to change them one by one in Windows. Is there a simpler method? ) Many magazines introduce many tools and methods to achieve this, but I think they are all more troublesome. Actually, we can complete batch renaming by combining DOS commands and the Recycle Bin. Usage: Suppose there are a large number of files to be renamed on drive E. Then first move them to the Recycle Bin! (Remember! Just delete them, don't empty the Recycle Bin! I won't be responsible if the files are lost!) Then we enter the MS-DOS mode of drive E, type "cd recycled" in the root directory to enter the Recycle Bin, and type dir to see if all the filenames have been changed to be in order: ) Next, we copy them all out. Type "copy *.* e:\". Go back to Windows and see if all the files are DE1, DE2... Note: 1. Empty the "Recycle Bin" before deleting, otherwise the file may start from an unknown number base. 2. Enter the recycled folder of the corresponding drive if you delete files on that drive. There are no corresponding files in other drives. 3. The filename after modification is named as DX1. D is fixed to represent DISK. X corresponds to your drive letter. If it is on drive F, it is DF1. If it is on drive D, it is DD1, and so on. Case 5: "copy" - Change File Date A colleague needs to change the date of a file for work, but has been busy in Windows for a long time and doesn't know how to do it: ( Do we really have to rely on special tools? Actually, no. The same "copy" command can be used to easily complete it: ) Format: copy <filename>+?? Usage: Suppose the file we want to modify is redate.dat, and it is on drive C. Then we first enter the MS-DOS mode, type "copy 123.dat+,, " (Note: two commas follow the plus sign) in drive C and press Enter. Then the system will ask if you want to overwrite? Type "Y" here to change it to the current date. Isn't it very simple? Case 6: FDISK - Repair Boot Sector My colleague found that the system couldn't start when turning on the computer today. The screen prompted "No System, System Halted". Actually, according to the prompt, we can know that the problem must be in the boot sector of the hard disk. This situation is generally caused by the corruption or virus infection of the boot record, or the absence of the boot flag in the partition table, or the end flag 55AAH being rewritten. Format: fdisk /MBR Usage: Boot the computer with a DOS boot disk, and execute the "FDISK /MBR" command at the prompt. FDISK itself contains the main boot program code and the end flag 55AAH. This trick is both fast and effective for repairing the main boot record and the end flag 55AAH, and there's no need to worry about damaging any files on the hard disk! Case 7: "ping" - Check if Connected When surfing the Internet in an Internet cafe, the server suddenly breaks off. The network administrator is busy solving the fault. We feel embarrassed to ask "When will it be connected". But we can't keep refreshing a web page. At this time, a simple DOS command can detect when the network is connected in the shortest time, and it's not so troublesome: ) Format: ping <count name> -t Usage: Execute "ping http://www.xxx.com/ -t" in the MS-DOS mode: ) You can see the screen keeps scrolling up. If it's connected, it will display the information like "Reply from xxx.xxx.xxx.xxx: bytes=32 ……". Otherwise, it will display "Destination host unreachable". Then you can do other things while knowing in the first time when the network is connected. Case 8: "debug" - Crack COMS My friend's brand computer CMOS was accidentally locked. What to do? ) At this time, you might say that opening the case to discharge the battery will do. But if you disassemble the case of a brand computer, most of the warranty issues will be out of the question. Actually, there is a very useful tool under DOS to unlock this password - DEBUG. Because this is a tool, it's too profound, so the format can't be given. But you can follow me step by step. We don't learn too much, just deal with the matter. Boot the system and enter the DOS mode. If it's Windows Me (XP), use the boot disk to boot. Type the following commands under DOS: debug -o70 21 -o71 20 -q Okay, let's restart the computer and see if it's unlocked:?? Let's stop here for the case analysis. Although DOS has become outdated and far away from us, when your system has a blue screen, when your system crashes, and when you find it cumbersome to solve some problems, maybe DOS can give you the best answer. Note: The above methods can all be used in any Microsoft operating system environment, and all external programs can be found in the startup disk of Windows 98. Latest update time: 2007-08-13 11:45:46 Next: Master 8 DOS Commands Previous: August 10, 2007 Post an evaluation (0)(0) Log in to Yahoo Space to post comments on the blog you like. Yahoo Community only provides information storage space services, and all its contents are provided by the service objects. According to the "Regulations on the Protection of Information Network Transmission Rights", part of the contents may not be displayed as required by the right holder. Please click here to view. About Yahoo | Help Center | Contact Us | Career Opportunities | Advertising Services | Search Bidding | Yahoo Business Window | Website Alliance | Yahoo Directory Copyright ? 2008 Yahoo.com.cn All rights reserved. No reproduction allowed. Usage Terms. Copyright Declaration First, ping It is a command used to check whether the network is unobstructed or the network connection speed. As an administrator or hacker living on the network, the ping command is the first DOS command that must be mastered. The principle it uses is like this: All machines on the network have a unique IP address. We send a data packet to the target IP address, and the other party should return a data packet of the same size. According to the returned data packet, we can determine the existence of the target host and can initially judge the operating system of the target host and so on. Now let's take a look at some of its commonly used operations. First, take a look at the help. Type "ping /?" in the DOS window and press Enter, and the help screen shown is displayed. Here, we only need to master some basic and very useful parameters (the same below). -t means that it will continuously send data packets to the target IP until we force it to stop. Imagine, if you use a 100M broadband access and the target IP is a 56K modem, then it won't take long for the target IP to be disconnected because it can't bear so much data. Hehe, an attack is simply realized like this. -l defines the size of the sent data packet. The default is 32 bytes. We can use it to define up to 65500 bytes at most. Use it together with the -t parameter introduced above, and it will have a better effect. -n defines the number of times to send data packets to the target IP. The default is 3 times. If the network speed is relatively slow, 3 times also wastes a lot of our time. Because now our purpose is only to judge whether the target IP exists, then define it as once. It should be noted that if the -t parameter and the -n parameter are used together, the ping command will be based on the parameter placed later. For example, "ping IP -t -n 3", although the -t parameter is used, it doesn't keep pinging all the time, but only pings 3 times. In addition, the ping command doesn't have to ping the IP necessarily. It can also directly ping the host domain name, so that the IP of the host can be obtained. Now let's take an example to illustrate the specific usage. Here, time=2 means that the time from sending the data packet to receiving the returned data packet is 2 seconds. From this, we can judge the size of the network connection speed. From the return value of TTL, we can initially judge the operating system of the pinged host. The reason why it's said "initially judge" is that this value can be modified. Here, TTL=32 means that the operating system may be win98. (Little knowledge: If TTL=128, it means that the target host may be Win2000; if TTL=250, it means that the target host may be Unix) As for using the ping command to quickly find LAN faults, quickly search for the fastest QQ server, and ping attack others... It's up to you to play. Second, nbtstat This command uses NetBIOS over TCP/IP to display protocol statistics and current TCP/IP connections. With this command, you can get the NETBIOS information of the remote host, such as the user name, the workgroup it belongs to, the MAC address of the network card, etc. Here, we need to understand several basic parameters. -a Use this parameter. As long as you know the machine name of the remote host, you can get its NETBIOS information (the same below). -A This parameter can also get the NETBIOS information of the remote host, but you need to know its IP. -n List the NETBIOS information of the local machine. When you get the IP or machine name of the other party, you can use the nbtstat command to further get the information of the other party, which increases the insurance coefficient of our intrusion. Third, netstat This is a command used to view the network status. It is easy to operate and powerful. -a View all open ports of the local machine. It can effectively discover and prevent trojans and can know the services opened by the machine, as shown in Figure 4. Here, it can be seen that the local machine has open FTP services, Telnet services, mail services, WEB services, etc. Usage: netstat -a IP. -r List the current routing information and tell us the gateway, subnet mask, etc. of the local machine. Usage: netstat -r IP. Fourth, tracert Trace the routing information. Using this command, you can find out all the paths that data travels from the local machine to the target host. This is very helpful for us to understand the network layout and structure. As shown in Figure 5. Here, it shows that data travels from the local machine to the machine with IP 192.168.0.1, and no intermediate transfers are made. It shows that these two machines are in the same LAN segment. Usage: tracert IP. Fifth, net This command is the most important one in network commands. We must thoroughly master the usage of each sub-command, because its function is really too powerful. This is simply the best intrusion tool provided by Microsoft for us. First, let's take a look at its sub-commands. Type net /? and press Enter as shown in Figure 6. Here, we focus on mastering several sub-commands commonly used in intrusion. net view Use this command to view all shared resources of the remote host. The command format is net view \\IP. net use Map a shared resource of the remote host to a local drive letter. The graphical interface is convenient to use, he he. The command format is net use x: \\IP\sharename. The above one means mapping the directory with the shared name magic of IP 192.168.0.5 to the local drive Z. The following one means establishing an IPC$ connection with 192.168.0.7 (net use $">\\IP\IPC$ "password" /user:"name"), After establishing the IPC$ connection, he he, you can upload files: copy nc.exe $">\\192.168.0.7\admin$, which means uploading the nc.exe in the local directory to the remote host. Combined with other DOS commands to be introduced later, intrusion can be realized. net start Use it to start the service on the remote host. When you establish a connection with the remote host and find that a certain service is not started and you want to use this service, use this command to start it. Usage: net start servername, as shown in Figure 9, the telnet service is successfully started. net stop After intrusion, if you find that a certain service of the remote host is in the way, what to do? Use this command to stop it. The usage is the same as net start. net user View the situations related to accounts, including creating new accounts, deleting accounts, viewing specific accounts, activating accounts, disabling accounts, etc. This is very beneficial for our intrusion. Most importantly, it provides the premise for us to clone accounts. Type net user without parameters to view all users, including disabled ones. The following explains them respectively. 1, net user abcd 1234 /add, create a user with username abcd and password 1234, and it is a member of the user group by default. 2, net user abcd /del, delete the user with username abcd. 3, net user abcd /active:no, disable the user with username abcd. 4, net user abcd /active:yes, activate the user with username abcd. 5, net user abcd, view the situation of the user with username abcd net localgroup View all information related to user groups and perform related operations. Type net localgroup without parameters to list all current user groups. In the intrusion process, we generally use it to promote a certain account to an administrator group account, so that we can control the entire remote host with this account. Usage: net localgroup groupname username /add. Now we add the newly created user abcd to the administrator group. At this time, the user abcd is already a super administrator. Hehe, you can use net user abcd to view his status and compare it with Figure 10 to see. But this is too obvious. The network administrator can find the flaw as soon as he sees the user situation. So this method can only deal with novice network administrators, but we still need to know it. The current means are all to clone a super administrator that the network administrator can't see by using other tools and means. This is another story. Interested friends can refer to the article "Analyze Cloning Accounts from the Beginning" in "Hacker Defense" issue 30. net time This command can view the current time of the remote host. If your goal is just to enter the remote host, then maybe you don't need this command. But if a simple intrusion is successful,难道 just look at it? We need to further penetrate. This even requires knowing the current time of the remote host, because using the time and other means (which will be讲到 later) can realize the timing startup of a certain command and program, laying a good foundation for our further intrusion. Usage: net time \\IP. Sixth, at The function of this command is to arrange to execute a certain command and program at a specific date or time (knowing the importance of net time?). When we know the current time of the remote host, we can use this command to make it execute a certain program and command at a certain time in the future (such as 2 minutes later). Usage: at time command \\computer. It means that at 6:55, let the computer named a-01 start the telnet service (here, net start telnet is the command to start the telnet service). Seventh, ftp You should be relatively familiar with this command? There are many FTP hosts open on the network, and a large part of them are anonymous, that is, anyone can log in. Now if you scan a host open with FTP service (generally a machine with port 21 open), and if you don't know how to use FTP commands, what to do? The following gives the basic usage of FTP commands. First, type ftp and press Enter in the command line, and the FTP prompt appears. At this time, you can type "help" to view the help (this method can be used to view the help of any DOS command). You may see that there are so many commands. How to use them? Actually, you don't need so many. Mastering a few basic ones is enough. First is the login process, which requires using open. Just type "open host IP ftp port" directly at the FTP prompt and press Enter. Generally, the port is 21 by default and can be omitted. Then enter the legal username and password to log in. Here, take anonymous FTP as an example for introduction. The username and password are both ftp, and the password is not displayed. When prompted **** logged in, it means that the login is successful. Here, because it is anonymous login, the user is displayed as Anonymous. Next, the usage of specific commands will be introduced. dir is the same as the DOS command, used to view the files on the server. Just type dir and press Enter, and you can see the files on this FTP server. cd enter a certain folder. get download the file to the local machine. put upload the file to the remote server. This depends on whether the remote FTP server gives you writable permission. If yes, he he, how to use it is not多说, you can give full play by yourself. delete delete the file on the remote FTP server. This must also ensure that you have writable permission. bye exit the current connection. quit the same as above. Eighth, telnet The powerful remote login command. Almost all intruders like to use it and it always works. Why? It's simple to operate, just like using your own machine. As long as you are familiar with DOS commands, after successfully connecting to the remote machine as an administrator, you can use it to do everything you want to do. The following introduces the usage method. First, type telnet and press Enter, then type help to view its help information. Then type open IP and press Enter at the prompt, and then the login window appears, asking you to enter the legal username and password. The password entered here is not displayed. When the username and password are both correct, the telnet connection is successfully established. At this time, you have the same permissions as this user on the remote host, and you can use DOS commands to do what you want to do. Here, I logged in with super administrator permissions. Up to here, the introduction of network DOS commands is coming to an end. The purpose of this introduction is just to give novice network administrators an impression and let them know the importance of being familiar with and mastering network DOS commands. In fact, there are far more than these network-related DOS commands. This is just to whet the appetite. I hope it can be helpful to广大 novice network administrators. Learning DOS is of great help to being a good network administrator, especially being proficient in mastering some network DOS commands. In addition, everyone should be clear that anyone must have a legal username and password to enter the system (input method vulnerabilities are almost extinct, right?). Even if you only get a very small permission of the account, you can use it to achieve the final goal. So firmly eliminate empty passwords and add a strong password to your account. This is the best way to defend against weak password intrusions. Finally, I sincerely say, cultivating a good sense of security is the most important. |
|
| Floor2 Sicent | Posted 2008-03-27 22:59 |
| 新手上路 Posts 2 Credits 0 | |
|
Top top top top top top top top top top top top top top top top top top top top top top top top top
|
|
| Floor3 liyanhong520 | Posted 2008-03-30 12:40 |
| 初级用户 Posts 13 Credits 38 | |
|
You are typing with the Wubi method
|
|
| Floor4 gaover | Posted 2008-03-30 16:52 |
| 新手上路 Posts 3 Credits 6 | |
|
Why is this so certain?
|
|
| Floor5 studythedos | Posted 2008-04-01 12:19 |
| 初级用户 Posts 45 Credits 91 | |
|
Um...The first command hasn't been used yet.
|
|
| Floor6 jvive | Posted 2008-04-01 15:01 |
| 初级用户 Posts 17 Credits 122 | |
|
Did everyone find a hidden "secret" in this post?
|
|
| Floor7 wjiyang | Posted 2008-04-03 20:23 |
| 新手上路 Posts 4 Credits 7 | |
|
Case Three, "copy" - File Merging
There are many times when video files on the internet are split into many small segments for everyone to download separately, but when you watch the downloaded files, you always have to open them continuously. So, is there any way to merge them back into a whole file? Using a special video editing tool is fine, but the cumbersome English makes us headache. In fact, there are ready-made tools under DOS, and we can complete it with the commonly used "copy" command. Let's take a look. Format: copy /b <filename1>+<filename2>+…+<filenameN> > filename> Usage method: Suppose there are two files on your hard disk, namely video1.mpg and video2.mpg. Then we enter "copy /b video1.mpg+video2.mpg video.mpg" in this directory, and video.mpg is the new file name generated after merging. Hurry up and try it, open the player to see if it's merged well. Of course, if you like novels and music and find it too troublesome to open and close continuously, you might as well try this method to merge them together for viewing. Case Four, "copy" - Batch Renaming Actually, I'm here to earn points, heh heh |
|
| Floor8 artc | Posted 2008-04-06 12:35 |
| 新手上路 Posts 6 Credits 10 | |
|
dddddddddddddddddddddddddddddddddddddddddddddddd
|
|
| Floor9 aliang10520 | Posted 2008-04-06 12:59 |
| 初级用户 Posts 24 Credits 47 | |
|
Heh
|
|
| Floor10 yyqheaven | Posted 2008-04-07 14:48 |
| 新手上路 Posts 6 Credits 14 | |
|
Hehe, I just started learning DOS, took a look, and it's pretty good.
|
|
| Floor11 jyztl | Posted 2008-07-22 21:07 |
| 新手上路 Posts 1 Credits 2 | |
|
Learning
|
|
| Floor12 zhigang277 | Posted 2008-07-22 22:41 |
| 新手上路 Posts 1 Credits 2 | |
|
Nice
|
|
| Floor13 xiaoyaowuya | Posted 2008-07-23 14:16 |
| 新手上路 Posts 1 Credits 2 | |
|
First time passing by, learning...
Thank you kind person |
|
| Floor14 sdfsadfsdf | Posted 2008-07-25 11:58 |
| 新手上路 Posts 4 Credits 6 | |
|
Hehe, just started learning DOS, took a look, it's pretty good
|
|
| Floor15 cndream | Posted 2008-07-26 10:34 |
| 新手上路 Posts 2 Credits 4 | |
|
First time passing by, learning...
Thank you, kind person |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |