Over the Wire – Bandit

I. Giới thiệu

Trên trang http://overthewire.org/ có rất nhiều hack game để luyện tập và Bandit chính là phần đầu tiên được khuyến nghị. Để giải các challenge trong bandit thì yêu cầu có kiến thức về *nix nên Bandit này còn có thể được dùng làm các bài lab cho các chương trình như LPI.

Cách chơi: Kết nối phiên SSH tới bandit.labs.overthewire.org sử dụng username/password là bandit0/bandit0 (tương ứng level 0). Nhiệm vụ của chúng ta là tìm ra password để của các level tiếp theo, username thì mặc định sẽ là bandit1, bandit2…. tương ứng mới mức level.

Các challenge bắt đầu từ level 0 –> level 27, nội dụng cụ thể của từng challenge có thể xem tại: http://overthewire.org/wargames/bandit/

II. Tham khảo cách giải (Sưu tầm)

1. Level 0 –> 1

Password được lưu trong file readme. Đơn giản dùng lệnh cat/more để xem nội dung file.

Lệnh: cat readme

Ý nghĩa: xem nội dung file có tên là readme

Kết quả: boJ9jbbUNNfktd78OOpsqOltutMc3MY1

2. Level 1 –> 2

File chứa password là file có tên là 1 dấu gạch ngang “-“. Để xem nội dung file này thì lệnh không đơn giản là “cat -“, nguyên nhân là khi cat nhìn thấy – nó sẽ hiểu đây là stdin chứ không phải là filename. Do đó, phải làm cách nào đó để cat hiểu – thực sự là 1 filename. Cách đơn giản nhất là thêm đường dẫn trỏ tới file.

Lệnh: cat ./-

Ý nghĩa: xem nội dung file có tên là “-” nằm trong thư mục hiện hành (./)

Kết quả: CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

3. Level 2 –> 3

File chứa password có tên là spaces in this filename. Với những file mà phần tên có chứa khoảng trống thì cần thêm dấu “\” trước mỗi khoảng trống, đây là kỹ thuật escape. Cách thư

Lệnh: cat spaces\ in\ this\ filename hoặc cat “spaces in this filename”

Kết quả: UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK

 

 

 

 

 

 

Video hướng dẫn CEH

http://root.vn/forums/Video-Hacking/

Link các bài viết hay về Attack trong CEH

– Dos
http://vnexperts.net/bai-viet-ky-thuat/security/664-dos-va-ddos-toan-tp-phn-i.html

http://vnexperts.net/bai-viet-ky-thuat/security/667-dos-va-ddos-toan-tp–phn-ii.html

– Tổng hợp Tools hay nhất cho nghiên cứu Security:

http://vnexperts.net/bai-viet-ky-thuat/security/693-tng-hp-tools-hay-nht-cho-nghien-cu-security-i.html

http://vnexperts.net/bai-viet-ky-thuat/security/695-tng-hp-tools-hay-nht-cho-nghien-cu-security-ii.html

– Các phương thức Crack Password:
http://vnexperts.net/bai-viet-ky-thuat/security/637-cac-phng-thc-crack-passwords.html

– Hack Windows toàn tập – Cách phòng chống

http://vnexperts.net/bai-viet-ky-thuat/security/639-hack-windows-toan-tp–cach-phong-chng.html

– Trojan&Backdoor toàn tập:

http://vnexperts.net/bai-viet-ky-thuat/security/691-trojan-a-backdoor-toan-tp.html

– Scan Port toàn tập

http://vnexperts.net/bai-viet-ky-thuat/security/666-scan-port-toan-tap.html

– IDS trong bảo mật hệ thống mạng

http://vnexperts.net/bai-viet-ky-thuat/security/593-ids-trong-bo-mt-h-thng-mng.html

Một số phương thức tấn công Dos đơn giản

The PING of Death and Other DoS Network Attacks

In my last article on How to Prevent Threats and Attacks on Your Cisco Network I explained in detail the various reconnaissance techniques that an attacker can exploit.

Today I will focus on what is known as Denial-of-Service (DoS) Attacks.

I’m very disappointed to admit that in our days this type of attack is one of the most common attacks found in the network community. The intention of the attacker in this case is to stress the victim with a tremendous amount of spurious traffic so that the network has no more free resources to process normal legitimate traffic.

Learning about these types of network attacks — learning your enemy — will help you be prepared for the worst. Once you understand your enemy’s behavior and the different types of network threats we’ll move on to specific solutions and how to protect your network.

DoS Attacks

Denial of Service Attacks can take many forms. The most important ones are:

  • SYN Flood
  • UDP Flood
  • ICMP Flood
  • Land Attack
  • Teardrop Attack

All these attacks have one thing in common which is nothing else than making their victim unable to serve legitimate traffic by filling up its session table with malicious connection attempts.

Let’s see in more detail how these attacks are utilized.

SYN Flood Attack

Then SYN flag of a TCP segment is activated when a host is initiating a new TCP connection. The connection establishment is successfully completed when the 3-way handshake method is performed as seen below:

Cisco CCNA Security: Learn Your Enemy - SYN Flood Attack

An attacker could deliberately flood the server with TCP SYN segments without acknowledging back the server’s SYN response. As a consequence the server’s session table is filled up with ongoing Session requests driving its resources to the edge making it unable to accept legitimate connection requests until its TCP inactivity timer is reached where it would start dropping incomplete sessions.

This kind of attack is usually originated by a spoofed source IP address making it harder to track down the attacker. A schematic explanation of the TCP SYN attack is presented below:

Cisco CCNA Security: Learn Your Enemy - 2

ICMP Flood Attack

Similar to the SYN Flood attack, an ICMP flood takes place when an attacker overloads its victim with a huge number of ICMP echo requests with spoofed source IP addresses.

This type of attack has caused a lot of headaches to network administrators in the past therefore it is the first attack that has been “fought and killed” nowadays, using various methods. The simplest one was to completely disable ICMP from untrusted interfaces and the more complicated one was to policy the rate of transmission of ICMP requests and limit down this rate in case of aggression.

The following diagram shows how this type of attack is performed:

Cisco CCNA Security: Learn Your Enemy - ICMP Flood Attack

UDP Flood Attack

UDP flooding doesn’t differ from ICMP flooding. The idea behind these attacks is the same and we have already talked about it. The only difference in this case is the fact that the IP packets that the attacker uses against its victim contain UDP datagrams of different sizes.

The following picture illustrates the “concept” of this attack:

Cisco CCNA Security: Learn Your Enemy - 4

Land Attack

When the attacker initiates a SYN Flood attack using the IP address of the victim as source and destination IP address, then it is said that the attacker has launched a “land attack”.

If the victim has not taken any precautions for this type of attack, it could end up trying to establish a connection with itself falling into a dead-end loop that exists until the idle timeout value is reached.

The following diagram shows clearly the sequence flow of this attack:

Cisco CCNA Security: Learn Your Enemy - Land Attack

Teardrop Attack

This type of attack deals with fragmentation and reassembly of IP packets. The IP header contains the necessary fields to handle fragmentation issues. Basically there are three fields within an IP datagram related to fragmentation and reassembly; these area:

  • Do not fragment bit
  • More fragments bit
  • Fragment Offset

The Fragment Offset field, which is the crucial field in our case, is used to indicate the starting position of each fragment relative to the original unfragmented packet. An attacker could start transmitting fragmented IP packets containing overlapped Fragment Offsets making the victim unable to reassemble them exhausting the victim’s resources and possibly crashing it.

The following diagram will help you understand how this attack is utilized:

Cisco CCNA Security: Learn Your Enemy - Teardrop Attack

The PING of Death

Finally, to close the discussion, I would like to say a few things about the PING of Death attack.

There is a specific ICMP echo variation that could cause a system crash. The difference of the echo request from the normal ones is the large size of IP packet it contains. RFC 791 specifies that the maximum size of an IP packet is 65,535 bytes. An ICMP echo request with more than 65,507 (65,535-20-8) bytes of data could cause a remote system to crash while reassembling the packet fragments.

The Ping of Death Datagram is presented below:

Cisco CCNA Security: Learn Your Enemy - PING of Death

Ready for Action

You should have “learned your enemies” by now. The information in this and my previous article will prepare you for any kind of network threat.

Equipped with the appropriate knowledge and with the will and strength to defeat all potential attackers, you are ready for the “battle”. It won’t be easy — you will have to continuously monitor and adjust your configuration to be able to handle possible new discovered attacks.

Please Note:

It was not my intention to discuss possible solutions for each specific attack type, I will cover this in my upcoming articles.

For the time being, keep in mind that there is no single solution to any problem. There are good, bad, cheap, expensive, upgradeable and fast-fix solutions. Finding the appropriate one is not an easy task. You will always have to adjust your protection measures according to your network. This is very important and you should not forget this.

No one can tell you the “correct” values for you to configure. YOU have to find those values by performing tests within your infrastructure in terms of connectivity and application.