July 2, 2015

Deadly Linux Commands

  • If you are new to Linux, chances are you will meet a stupid person perhaps in a forum or chat room that can trick you into using commands that will harm your files or even your entire operating system.
  • Don’t run anything without understanding exactly what it does. Look it up (use Google orman command) if there’s any part of a command you’re not clear on.
  • Also you can use http://explainshell.com/ to explain what command is.
  • To avoid this dangerous scenario from happening, I have here a list of deadly (Most Dangerous) Linux commands that you should avoid

Delete Everything Recursively

  • This command will recursively and forcefully delete all the files inside the / root directory.
[mitesh@Matrix ~]$ sudo rm -rf /

Fork Bomb

  • The following weird looking command is actually function which created copies of itself endlessly.
  • This Fork Bomb quickly use all your system resources like CPU, RAM, etc and cause system crash.
  • This can often lead to corruption of data.
  • For More Detailed Information Refer https://en.wikipedia.org/wiki/Fork_bomb
[mitesh@Matrix ~]$ :(){:|:&};:

Format Hard Disk Drive

  • This will reformat or wipeout all the files of the device that is mentioned after the mkfscommand.
[mitesh@Matrix ~]$ sudo mkfs.ext3 /dev/sda

Fill Hard Disk Drive with Junk Data

# Fill HDD with letter y
[mitesh@Matrix ~]$ sudo yes > /dev/sda
# Fill HDD with number zero 0
[mitesh@Matrix ~]$ sudo dd if=/dev/null of=/dev/sda
# Fill HDD with random data
[mitesh@Matrix ~]$ sudo dd if=/dev/urandom of=/dev/sda
# Overwrite HDD Data (Multiple Times)
[mitesh@Matrix ~]$ sudo shred /dev/sda

Delete /etc Directory

  • The following command delete all the linux configuration files.
# Delete /boot Directory
[mitesh@Matrix ~]$ sudo rm -rf /etc

Delete Boot Entry

  • The following command delete Kernel, Initrd, and GRUB/LILO Files (Needed For Linux Startup)
# Delete /boot Directory
[mitesh@Matrix ~]$ sudo rm -rf /boot/

Move Everything to Blackhole

  • This command will move all the files inside your home directory to a /dev/null(Blackhole)
[mitesh@Matrix ~]$ mv ~/* /dev/null
[mitesh@Matrix ~]$ mv /home/username/* /dev/null

Find and Delete configuration files

[mitesh@Matrix ~]$ sudo find / -iname "*.conf" -exec rm -rf  {} \;

World Writable

  • The following command make your system world writable.
[mitesh@Matrix ~]$ sudo chmod -R 777 /

Remove Access Privilege

[mitesh@Matrix ~]$ sudo chmod -R 000 /
# Another way
[mitesh@Matrix ~]$ sudo chown -R nobody:nobody /

Related Posts:

  • Lệnh kiểm tra các thông số VPS Linux Một số câu lệnh để các bạn có thể kiểm tra thông số cấu hình của VPS Linux Lệnh kiểm tra CPU: cat /proc/cpuinfo Lệnh theo dõi CPU: top -c Lệnh kiểm tra hệ điều hành: uname -a Lệnh kiểm tra phiên bản hệ điều hành (CentOS)… Read More
  • Hướng dẫn tìm file bất kỳ trong Linux Thông thường các webserver hoặc service bạn cài đặt trên server sử dụng 1 file quản lý cấu hình. Mỗi service lại có file cấu hình với đường dẫn khác nhau. Bản thân mình nhiều khi cũng không nhớ nổi file cấu hình được để ở đâ… Read More
  • Hướng dẫn sử dụng text editor vi trong linux Hôm trước, mình có hướng dẫn các bạn cách sử dụng text edior nano trong Linux. Còn một công cụ nữa có chức năng tương tự là vi, hôm nay mình sẽ hướng dẫn sử dụng tiếp. 1. Mở file Cũng giống như các editor khác bạn cần… Read More
  • Hiển thị số dòng trong vi / vim Linux Hiển thị số dòng ở vi / vim có thể sẽ rất cần thiết khi debug code hoặc debug lỗi, hoặc sẽ giúp bạn dễ dàng tìm đến dòng cần thiết. Tiếp theo bài viết hướng dẫn sử dụng text editor vi trong Linux cơ bản, bài viết … Read More
  • Một số lệnh cơ bản kiểm tra server khi bị DDoS Tấn công từ chối dịch vụ phân tán (DDoS – Distributed Denial Of Service) là kiểu tấn công làm cho hệ thống máy tính hay hệ thống mạng quá tải, không thể cung cấp dịch vụ hoặc phải dừng hoạt động. Trong các cuộc tấn công DDoS… Read More

0 comments:

Post a Comment