『楼 主』:
DOS命令大全
使用 LLM 解释/回答一下
──────────────── 版务记录 ────────────────
执行:namejm
说明:转移自 DOS批处理 & 脚本技术(批处理室)
──────────────── 版务记录 ────────────────
网管和黑客的斗争是永不会停息的,他们的关系就如同警察和小偷。在网络这个没有硝烟的战场上,谁的技术手段高明,谁的头脑灵活,谁虚心学习不断成长,谁就能立于不败之地。网管为了维护自己服务器的安全,黑客为了成功入侵一台服务器,他们使用工具是一种很简便、很省时间、很高效的做法,但你可曾想过很多问题其实不是我们想象的那么复杂,而且工具都是别人的,自己用着心里也不很舒服。防御也好入侵也好,我们能否利用最简单的办法达到自己的目的呢?答案是肯定的,熟练掌握一些和网络有关的DOS命令,就能让我们在DOS窗口下完成别人使用工具才能完成的工作。废话少说,follow me。
(说明一下,这篇本来是为了写利用DOS进行网络入侵的,写的差不多的时候,才突然感觉这样的东西太多了,而且也没什么变化,就改写成对网络DOS命令常见用法的介绍了。着重点在于网络*作的DOS命令,很不全面----要不为什么叫“不完全教程”呢?呵呵。只是希望让大家对DOS有一个正确的认识,虽然已经到了Windows的时代了,但它的功能还是的确不可小窥的。说大了,学好了DOS的朋友,电脑方面的造诣都不底,大家应该能认识到这一点。)
一,ping
它是用来检查网络是否通畅或者网络连接速度的命令。作为一个生活在网络上的管理员或者黑客来说,ping命令是第一个必须掌握的DOS命令,它所利用的原理是这样的:网络上的机器都有唯一确定的IP地址,我们给目标IP地址发送一个数据包,对方就要返回一个同样大小的数据包,根据返回的数据包我们可以确定目标主机的存在,可以初步判断目标主机的*作系统等。下面就来看看它的一些常用的*作。先看看帮助吧,在DOS窗口中键入:ping /? 回车,出现如图1。所示的帮助画面。在此,我们只掌握一些基本的很有用的参数就可以了(下同)。
-t 表示将不间断向目标IP发送数据包,直到我们强迫其停止。试想,如果你使用100M的宽带接入,而目标IP是56K的小猫,那么要不了多久,目标IP就因为承受不了这么多的数据而掉线,呵呵,一次攻击就这么简单的实现了。
-l 定义发送数据包的大小,默认为32字节,我们利用它可以最大定义到65500字节。结合上面介绍的-t参数一起使用,会有更好的效果哦。
-n 定义向目标IP发送数据包的次数,默认为3次。如果网络速度比较慢,3次对我们来说也浪费了不少时间,因为现在我们的目的仅仅是判断目标IP是否存在,那么就定义为一次吧。
说明一下,如果-t 参数和 -n参数一起使用,ping命令就以放在后面的参数为标准,比如“ping IP -t -n 3”,虽然使用了-t参数,但并不是一直ping下去,而是只ping 3次。另外,ping命令不一定非得ping IP,也可以直接ping主机域名,这样就可以得到主机的IP。
下面我们举个例子来说明一下具体用法,如图2。
这里time=2表示从发出数据包到接受到返回数据包所用的时间是2秒,从这里可以判断网络连接速度的大小 。从TTL的返回值可以初步判断被ping主机的*作系统,之所以说“初步判断”是因为这个值是可以修改的。这里TTL=32表示*作系统可能是win98。
(小知识:如果TTL=128,则表示目标主机可能是Win2000;如果TTL=250,则目标主机可能是Unix)
至于利用ping命令可以快速查找局域网故障,可以快速搜索最快的QQ服务器,可以对别人进行ping攻击……这些就靠大家自己发挥了。
二,nbtstat
该命令使用TCP/IP上的NetBIOS显示协议统计和当前TCP/IP连接,使用这个命令你可以得到远程主机的NETBIOS信息,比如用户名、所属的工作组、网卡的MAC地址等。在此我们就有必要了解几个基本的参数。
-a 使用这个参数,只要你知道了远程主机的机器名称,就可以得到它的NETBIOS信息如图3(下同)。
-A 这个参数也可以得到远程主机的NETBIOS信息,但需要你知道它的IP。
-n 列出本地机器的NETBIOS信息。
当得到了对方的IP或者机器名的时候,就可以使用nbtstat命令来进一步得到对方的信息了,这又增加了我们入侵的保险系数。
三,netstat
这是一个用来查看网络状态的命令,*作简便功能强大。
-a 查看本地机器的所有开放端口,可以有效发现和预防木马,可以知道机器所开的服务等信息,如图4。
这里可以看出本地机器开放有FTP服务、Telnet服务、邮件服务、WEB服务等。用法:netstat -a IP。
-r 列出当前的路由信息,告诉我们本地机器的网关、子网掩码等信息。用法:netstat -r IP。
四,tracert
跟踪路由信息,使用此命令可以查出数据从本地机器传输到目标主机所经过的所有途径,这对我们了解网络布局和结构很有帮助。如图5。
这里说明数据从本地机器传输到192.168.0.1的机器上,中间没有经过任何中转,说明这两台机器是在同一段局域网内。用法:tracert IP。
五,net
这个命令是网络命令中最重要的一个,必须透彻掌握它的每一个子命令的用法,因为它的功能实在是太强大了,这简直就是微软为我们提供的最好的入侵工具。首先让我们来看一看它都有那些子命令,键入net /?回车如图6。
在这里,我们重点掌握几个入侵常用的子命令。
net view
使用此命令查看远程主机的所以共享资源。命令格式为net view \\\\IP。如图7。
net use
把远程主机的某个共享资源影射为本地盘符,图形界面方便使用,呵呵。命令格式为net use x: \\\\IP\\sharename。上面一个表示把192.168.0.5IP的共享名为magic的目录影射为本地的Z盘。下面表示和192.168.0.7建立IPC$连接(net use \\\\IP\\IPC$ "password" /user:"name"),如图8。
建立了IPC$连接后,呵呵,就可以上传文件了:copy nc.exe \\\\192.168.0.7\\admin$,表示把本地目录下的nc.exe传到远程主机,结合后面要介绍到的其他DOS命令就可以实现入侵了。
net start
使用它来启动远程主机上的服务。当你和远程主机建立连接后,如果发现它的什么服务没有启动,而你又想利用此服务怎么办?就使用这个命令来启动吧。用法:net start servername,如图9,成功启动了telnet服务。
net stop
入侵后发现远程主机的某个服务碍手碍脚,怎么办?利用这个命令停掉就ok了,用法和net start同。
net user
查看和帐户有关的情况,包括新建帐户、删除帐户、查看特定帐户、激活帐户、帐户禁用等。这对我们入侵是很有利的,最重要的,它为我们克隆帐户提供了前提。键入不带参数的net user,可以查看所有用户,包括已经禁用的。下面分别讲解。
1,net user abcd 1234 /add,新建一个用户名为abcd,密码为1234的帐户,默认为user组成员。
2,net user abcd /del,将用户名为abcd的用户删除。
3,net user abcd /active:no,将用户名为abcd的用户禁用。
4,net user abcd /active:yes,激活用户名为abcd的用户。
5,net user abcd,查看用户名为abcd的用户的情况,如图10。
net localgroup
查看所有和用户组有关的信息和进行相关*作。键入不带参数的net localgroup即列出当前所有的用户组。在入侵过程中,我们一般利用它来把某个帐户提升为administrator组帐户,这样我们利用这个帐户就可以控制整个远程主机了。用法:net localgroup groupname username /add,如图11。
现在我们把刚才新建的用户abcd加到administrator组里去了,这时候abcd用户已经是超级管理员了,呵呵,你可以再使用net user abcd来查看他的状态,和图10进行比较就可以看出来。但这样太明显了,网管一看用户情况就能漏出破绽,所以这种方法只能对付菜鸟网管,但我们还得知道。现在的手段都是利用其他工具和手段克隆一个让网管看不出来的超级管理员,这是后话。有兴趣的朋友可以参照《黑客防线》第30期上的《由浅入深解析隆帐户》一文。
net time
这个命令可以查看远程主机当前的时间。如果你的目标只是进入到远程主机里面,那么也许就用不到这个命令了。但简单的入侵成功了,难道只是看看吗?我们需要进一步渗透。这就连远程主机当前的时间都需要知道,因为利用时间和其他手段(后面会讲到)可以实现某个命令和程序的定时启动,为我们进一步入侵打好基础。用法:net time \\\\IP。如图12。
六,at
这个命令的作用是安排在特定日期或时间执行某个特定的命令和程序(知道net time的重要了吧?)。当我们知道了远程主机的当前时间,就可以利用此命令让其在以后的某个时间(比如2分钟后)执行某个程序和命令。用法:at time command \\\\computer。如图13。
表示在6点55分时,让名称为a-01的计算机开启telnet服务(这里net start telnet即为开启telnet服务的命令)。
七,ftp
大家对这个命令应该比较熟悉了吧?网络上开放的ftp的主机很多,其中很大一部分是匿名的,也就是说任何人都可以登陆上去。现在如果你扫到了一台开放ftp服务的主机(一般都是开了21端口的机器),如果你还不会使用ftp的命令怎么办?下面就给出基本的ftp命令使用方法。
首先在命令行键入ftp回车,出现ftp的提示符,这时候可以键入“help”来查看帮助(任何DOS命令都可以使用此方法查看其帮助),如图14。
大家可能看到了,这么多命令该怎么用?其实也用不到那么多,掌握几个基本的就够了。
首先是登陆过程,这就要用到open了,直接在ftp的提示符下输入“open 主机IP ftp端口”回车即可,一般端口默认都是21,可以不写。接着就是输入合法的用户名和密码进行登陆了,这里以匿名ftp为例介绍,如图15。
用户名和密码都是ftp,密码是不显示的。当提示**** logged in时,就说明登陆成功。这里因为是匿名登陆,所以用户显示为Anonymous。
接下来就要介绍具体命令的使用方法了,如图16。
dir 跟DOS命令一样,用于查看服务器的文件,直接敲上dir回车,就可以看到此ftp服务器上的文件。
cd 进入某个文件夹。
get 下载文件到本地机器。
put 上传文件到远程服务器。这就要看远程ftp服务器是否给了你可写的权限了,如果可以,呵呵,该怎么 利用就不多说了,大家就自由发挥去吧。
delete 删除远程ftp服务器上的文件。这也必须保证你有可写的权限。
bye 退出当前连接。
quit 同上。
八,telnet
功能强大的远程登陆命令,几乎所有的入侵者都喜欢用它,屡试不爽。为什么?它*作简单,如同使用自己的机器一样,只要你熟悉DOS命令,在成功以administrator身份连接了远程机器后,就可以用它来干你想干的一切了。下面介绍一下使用方法,首先键入telnet回车,再键入help查看其帮助信息,如图17。
然后在提示符下键入open IP回车,这时就出现了登陆窗口,让你输入合法的用户名和密码,这里输入任何密码都是不显示的,如图18。
当输入用户名和密码都正确后就成功建立了telnet连接,这时候你就在远程主机上具有了和此用户一样的权限,利用DOS命令就可以实现你想干的事情了,如图19。这里我使用的超级管理员权限登陆的。
到这里为止,网络DOS命令的介绍就告一段落了,这里介绍的目的只是给菜鸟网管一个印象,让其知道熟悉和掌握网络DOS命令的重要性。其实和网络有关的DOS命令还远不止这些,这里只是抛砖引玉,
望能对广大菜鸟网管有所帮助。学好DOS对当好网管有很大的帮助,特别的熟练掌握了一些网络的DOS命令。
另外大家应该清楚,任何人要想进入系统,必须得有一个合法的用户名和密码(输入法漏洞差不多绝迹了吧),哪怕你拿到帐户的只有一个很小的权限,你也可以利用它来达到最后的目的。所以坚决消灭空口令,给自己的帐户加上一个强壮的密码,是最好的防御弱口令入侵的方法。
最后,由衷的说一句,培养良好的安全意识才是最重要的。
Last edited by namejm on 2006-12-17 at 11:56 PM ]
──────────────── Moderation Record ────────────────
Performed by: namejm
Description: Moved from DOS Batch & Script Technology (Batch Room)
──────────────── Moderation Record ────────────────
The struggle between network administrators and hackers never stops; their relationship is like that between police and thieves. On the network battlefield without gunpowder, whoever has more sophisticated technical means, a flexible mind, and is willing to learn and grow continuously will be invincible. Network administrators maintain the security of their servers, and hackers attempt to successfully intrude into a server. Using tools is a convenient, time-saving, and efficient method, but have you ever thought that many problems are not as complicated as we imagine, and tools are someone else's, making us feel uncomfortable using them. Whether it's defense or intrusion, can we use the simplest methods to achieve our goals? The answer is yes. Mastering some network-related DOS commands allows us to complete tasks in the DOS window that others can only do with tools. Enough chatter, follow me.
(Note: This article was originally intended to write about network intrusion using DOS, but when it was almost finished, I suddenly felt that there were too many such things and no changes, so it was rewritten to introduce common usages of network DOS commands. The focus is on network *operation DOS commands, which is very incomplete----that's why it's called the "Incomplete Tutorial", heh heh. Just hope to let everyone have a correct understanding of DOS. Although we've entered the Windows era, its functions are indeed not to be underestimated. To put it broadly, friends who are good at DOS have high attainments in computers, and everyone should recognize this.)
I. ping
It is a command used to check if 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 as follows: Machines on the network have uniquely determined IP addresses. We send a data packet to the target IP address, and the other party will return an equally sized data packet. Based on the returned data packet, we can determine the existence of the target host and initially judge the operating system of the target host, etc. Now let's look at some of its common *operations. First, look at the help. Type "ping /?" in the DOS window and press Enter, and the help screen shown in Figure 1 appears. Here, we only need to master some basic and useful parameters (the same below).
-t means continuously sending data packets to the target IP until we force it to stop. Imagine, if you use a 100M broadband connection and the target IP is a 56K modem, the target IP will be disconnected soon because it can't bear so much data. Hehe, an attack is realized so simply.
-l defines the size of the sent data packet, with a default of 32 bytes. We can use it to define up to 65500 bytes at most. Using it together with the -t parameter introduced above will have a better effect.
-n defines the number of data packets sent to the target IP, with a default of 3 times. If the network speed is relatively slow, 3 times is also a waste of time for us. Since our purpose here is only to judge whether the target IP exists, we can define it as once.
Note 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 ping continuously, 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, and then we can get the host's IP.
Now let's take an example to illustrate the specific usage, as shown in Figure 2.
Here, time=2 means 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 TTL return value, we can initially judge the operating system of the pinged host. The reason for saying "initially judge" is that this value can be modified. Here, TTL=32 means the operating system may be win98.
(Little knowledge: If TTL=128, it means the target host may be Win2000; if TTL=250, 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 attack others by pinging... these are up to everyone to develop.
II. nbtstat
This command displays NetBIOS statistics and current TCP/IP connections on TCP/IP. Using 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 Using this parameter, as long as you know the machine name of the remote host, you can get its NetBIOS information as shown in Figure 3 (the same below).
-A This parameter can also get the NetBIOS information of the remote host, but you need to know its IP.
-n Lists 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 other party's information, which increases the security factor of our intrusion.
III. netstat
This is a command used to view the network status, with simple *operation and powerful functions.
-a View all open ports of the local machine, which can effectively discover and prevent trojans, and know the services opened by the machine, etc., 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 Lists the current routing information, telling us the gateway, subnet mask, etc. of the local machine. Usage: netstat -r IP.
IV. tracert
Tracks the routing information. Using this command, we can find out all the paths that data takes from the local machine to the target host, which is very helpful for us to understand the network layout and structure. As shown in Figure 5.
Here, it indicates that the data is transmitted from the local machine to the machine with IP 192.168.0.1, and no intermediaries are passed through in the middle, indicating that these two machines are in the same LAN segment. Usage: tracert IP.
V. net
This command is the most important one among network commands. We must thoroughly master the usage of each sub-command, because its functions are really 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 for intrusion.
net view
Use this command to view all shared resources of the remote host. The command format is net view \\\\IP. As shown in Figure 7.
net use
Map a shared resource of the remote host to a local drive letter, which is convenient for use in the graphical interface, heh heh. 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 Z drive. The following one means establishing an IPC$ connection with 192.168.0.7 (net use \\\\IP\\IPC$ "password" /user:"name"), as shown in Figure 8.
After establishing the IPC$ connection, heh heh, we can upload files: copy nc.exe \\\\192.168.0.7\\admin$, which means transferring 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 services on the remote host. When you establish a connection with the remote host and find that some 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, successfully started the telnet service.
net stop
After intrusion, if you find that a certain service on 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 and account-related situations, including creating a new account, deleting an account, viewing a specific account, activating an account, disabling an account, 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 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, as shown in Figure 10.
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, as shown in Figure 11.
Now we added the just-created user abcd to the administrator group. At this time, the user abcd is already a super administrator, heh heh. You can use net user abcd to view his status again, and compare it with Figure 10 to see the difference. But this is too obvious. The network administrator can find the flaw as soon as he looks at the user situation. So this method can only deal with novice network administrators, but we still need to know it. The current means are to clone a super administrator that the network administrator can't see using other tools and means. This is a later topic. Interested friends can refer to the article "In-depth Analysis of Cloning Accounts" 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 this command may not be needed. But after a simple intrusion is successful,难道 just take a look? We need to penetrate further. This even requires knowing the current time of the remote host, because using time and other means (to be introduced later) can realize the timing startup of a certain command and program, laying the foundation for further intrusion. Usage: net time \\\\IP. As shown in Figure 12.
VI. at
The function of this command is to arrange to execute a certain command and program at a specific date or time (you know 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. As shown in Figure 13.
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).
VII. ftp
Everyone should be relatively familiar with this command, right? 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 that opens FTP service (usually 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), as shown in Figure 14.
Everyone may see that there are so many commands, how to use them? Actually, not so many are needed, just master a few basic ones.
First is the login process, which requires using open. Just type "open host IP ftp port" and press Enter under the FTP prompt. Generally, the port is 21 by default, and it can be omitted. Then enter a legal username and password to log in. Here, take anonymous FTP as an example to introduce, as shown in Figure 15.
Both the username and password are ftp, and the password is not displayed. When it prompts **** logged in, it means 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, as shown in Figure 16.
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 enters a certain folder.
get downloads files to the local machine.
put uploads files to the remote server. This depends on whether the remote FTP server gives you write permissions. If yes, heh heh, how to use it won't be said more, everyone can use their imagination.
delete deletes files on the remote FTP server. This must also ensure that you have write permissions.
bye exits the current connection.
quit the same as above.
VIII. telnet
A powerful remote login command, almost all intruders like to use it, and it works every time. Why? It's easy 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 whatever you want. The following introduces the usage method. First, type telnet and press Enter, then type help to view its help information, as shown in Figure 17.
Then type open IP and press Enter under the prompt, and then the login window appears, asking you to enter a legal username and password. Any password entered here is not displayed, as shown in Figure 18.
When the username and password are entered correctly, 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, as shown in Figure 19. Here I logged in with super administrator permissions.
Up to here, the introduction of network DOS commands comes 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. Here is just to whet the appetite,
hoping to be helpful to the majority of novice network administrators. Learning DOS is of great help for being a good network administrator, especially being proficient in some network DOS commands.
In addition, everyone should be clear that anyone who wants to enter the system must have a legal username and password (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 resolutely eliminate empty passwords and add a strong password to your account, which is the best way to defend against weak password intrusion.
Finally, I sincerely say that cultivating a good sense of security is the most important.
Last edited by namejm on 2006-12-17 at 11:56 PM ]
|