W8 L4 Preventing Buffer Overflow Attacks

Introduction to Operating Systems
5 Sept 201620:04

Summary

TLDRThe video script discusses the intricacies of buffer overflow attacks and the mechanisms employed to mitigate them. It explains how attackers exploit vulnerabilities to execute malicious code and the importance of stack protection, non-executable stack, and NX bit in modern processors. The script also covers advanced topics like Return-Oriented Programming (ROP) and the use of canaries for defense. It emphasizes the need for secure coding practices and the implementation of robust security measures to protect against evolving threats.

Takeaways

  • 😀 The video discusses the concept of a user-triggered buffer overflow vulnerability in computer systems and how attackers can exploit it.
  • 🔒 It explains how attackers can create a malicious payload that can be injected into a computer system to execute their own code.
  • 💡 The script provides an example of how attackers can use shell scripts to demonstrate the creation of a malicious payload.
  • 🛠️ The video talks about the technicalities of how the stack is manipulated to redirect the program's control flow to the attacker's code.
  • 🚫 It highlights the importance of stack protection mechanisms, such as the NX (No Execute) bit, to prevent buffer overflow attacks.
  • 🛡️ The script mentions that modern computers implement stack canaries to detect and prevent buffer overflow attacks.
  • 🔄 The video describes how attackers can bypass stack protection by manipulating the return address and other stack variables.
  • 🎯 It explains the use of gadgets in the context of return-oriented programming (ROP), where an attacker chains together small snippets of code to execute arbitrary actions.
  • 🔍 The script discusses the challenges of finding the right gadgets and the need for precise control over the stack to successfully execute a ROP attack.
  • 👀 It mentions the use of canaries and Address Space Layout Randomization (ASLR) as additional security measures to make buffer overflow attacks more difficult.
  • 🛑 The video concludes with the importance of secure coding practices and the use of safe libraries and functions to prevent such vulnerabilities.

Q & A

  • What is the main topic discussed in the video script?

    -The main topic discussed in the video script is about computer security, specifically addressing buffer overflow attacks, stack protection mechanisms, and techniques such as Return-Oriented Programming (ROP).

  • What is a buffer overflow attack as mentioned in the script?

    -A buffer overflow attack is a type of cyber attack where an attacker attempts to overrun a buffer's boundary and inject malicious code, which can be executed by the system, leading to unauthorized actions.

  • What is stack protection and why is it important?

    -Stack protection is a security mechanism implemented in programming to prevent buffer overflow attacks by ensuring that the stack is not overflowed with excessive data, which could lead to the execution of malicious code.

  • What is NX bit and how does it relate to stack protection?

    -The NX (No eXecute) bit is a security feature used in computer systems that marks a page of memory as non-executable. It is related to stack protection as it can prevent the execution of code placed on the stack, thus mitigating the risk of buffer overflow attacks.

  • What is Return-Oriented Programming (ROP) and how does it work?

    -Return-Oriented Programming (ROP) is a technique used by attackers to chain together small fragments of code, called 'gadgets', that already exist in a program's memory space to execute a malicious payload without the need for injecting new code.

  • What is a 'gadget' in the context of ROP attacks?

    -In the context of ROP attacks, a 'gadget' refers to a short series of machine code instructions that, when executed in a particular order, perform a useful operation for the attacker, such as moving data or altering control flow.

  • How can attackers find and utilize gadgets in an ROP attack?

    -Attackers can find gadgets by scanning the memory space of a program, particularly the library code (libc), for useful sequences of instructions. They then carefully construct a payload that includes the addresses of these gadgets to be executed in a specific order to achieve the desired malicious outcome.

  • What is ASLR and how does it help in preventing attacks like ROP?

    -ASLR (Address Space Layout Randomization) is a security technique that randomizes the base address of loaded executables, libraries, and stack locations in memory. It helps prevent attacks like ROP by making it difficult for an attacker to predict the exact memory addresses of gadgets and other code segments.

  • What is a canary in the context of stack protection?

    -A canary is a security mechanism used in stack protection. It is a random value placed on the stack between the return address and the local variables. If a buffer overflow occurs, the canary value is expected to change, which can be detected to indicate a potential security breach.

  • Why are canaries used in stack protection?

    -Canaries are used in stack protection to detect buffer overflow attacks. If an overflow alters the canary value, it indicates that the stack's integrity has been compromised, allowing the program to take defensive actions, such as terminating the process.

  • How do modern compilers like GCC implement canary protection?

    -Modern compilers like GCC implement canary protection by inserting checks for the canary value at the beginning of functions that are vulnerable to buffer overflow attacks. If the canary value is found to be altered, the program will take appropriate defensive measures.

Outlines

00:00

🛠️ Understanding Buffer Overflow Attacks

This paragraph discusses the concept of buffer overflow attacks, where an attacker manipulates a program's stack to execute their own malicious code. It explains how attackers can create a shell on the computer by exploiting a buffer overflow vulnerability. The paragraph also touches on the technicalities of how such an attack can be carried out, including the creation of a payload that can be injected into the program to redirect the control flow to the attacker's code.

05:03

🔬 Deep Dive into Stack Buffer Overflow Techniques

The second paragraph delves deeper into the technical aspects of stack buffer overflow attacks. It describes how attackers can use the 'libc' function to execute a shell and the importance of finding the correct function address in the program's memory to successfully execute the attack. The paragraph also explains the process of identifying and utilizing the right function pointers within the stack to redirect the program's execution flow to the attacker's intended payload.

10:03

💡 Exploiting Return-Oriented Programming (ROP) in Attacks

This paragraph introduces Return-Oriented Programming (ROP), a more advanced technique used by attackers to exploit buffer overflow vulnerabilities. It explains that ROP allows attackers to chain together small fragments of code, known as 'gadgets,' that already exist in the program's memory, such as the libc library, to perform the desired actions. The paragraph also discusses the use of 'canaries' to detect buffer overflows and the challenges faced by attackers in identifying and utilizing the correct gadgets for their exploit.

15:06

🛡️ Mitigating Buffer Overflow Vulnerabilities

The final paragraph focuses on various strategies to mitigate buffer overflow vulnerabilities and protect against such attacks. It mentions the use of safe programming languages like Java that automatically check array bounds, the adoption of secure coding practices, and the implementation of security features such as Address Space Layout Randomization (ASLR) to make it more difficult for attackers to predict memory addresses. The paragraph concludes by emphasizing the importance of these protective measures in defending against buffer overflow attacks.

Mindmap

Keywords

💡Buffer Overflow

Buffer Overflow is a type of security vulnerability that occurs when a program or process tries to store more data in a buffer than it can hold. In the video, it is mentioned as a method attackers use to inject malicious code into a system, by overrunning the buffer and altering the control flow of a program. The script discusses how attackers can leverage buffer overflow to execute their own code, demonstrating its relevance to the theme of cybersecurity.

💡Shellcode

Shellcode is a small piece of code that is used during a buffer overflow attack to gain control of a system. It is injected into the overflowed buffer and executed by the affected program. The video script explains how an attacker crafts shellcode to be executed within the system, emphasizing its importance in the context of understanding attack methodologies.

💡Stack

The stack is a region of memory that stores temporary variable data, function return addresses, and other information. In the script, the stack is discussed as a common target for buffer overflow attacks because of its role in function call management. The video explains how attackers can manipulate the stack to execute their shellcode, illustrating the stack's significance in the context of system security.

💡NX Bit

The NX (No eXecute) bit is a security feature that prevents a region of memory from being executed. The script mentions NX bit as a mechanism used by modern processors to prevent the execution of code placed on the stack, which is a common tactic in buffer overflow attacks. It is a key concept in the video's discussion on how systems can be protected against such vulnerabilities.

💡Return-Oriented Programming (ROP)

Return-Oriented Programming is a technique used by attackers to execute code already present in a program or system's memory, by chaining together small fragments of code called 'gadgets'. The video script describes ROP as an advanced method for bypassing security measures like the NX bit, highlighting its role in modern cybersecurity threats.

💡Gadget

In the context of ROP, a gadget is a sequence of instructions in a program's memory that can be executed as a unit. The script explains how attackers use gadgets to perform ROP attacks, by finding and executing these small code sequences to achieve their goals, such as bypassing security measures.

💡ASLR (Address Space Layout Randomization)

ASLR is a security technique used to randomize the memory layout of a process, making it more difficult for attackers to predict the location of code and data. The video script discusses ASLR as a defense mechanism against attacks like ROP, by complicating the attacker's task of finding and executing specific code fragments.

💡Canaries

Canaries are values placed in a buffer to detect overflows before they can cause damage. The script mentions canaries as a security feature that, when altered by an overflow, can alert the system to a potential attack, thus preventing the execution of malicious code.

💡Executable Stack

An executable stack is a stack that allows the execution of code placed on it. The video script contrasts this with non-executable stacks, which are protected by features like the NX bit, to illustrate the risks associated with allowing code execution on the stack.

💡Libc

Libc, or the C standard library, is a collection of standard functions used by C programs. The script refers to libc in the context of ROP attacks, where attackers may target specific functions within libc to execute their code, demonstrating the importance of understanding system libraries in the context of security.

💡ROP Chain

A ROP chain is a sequence of gadgets used in a ROP attack to execute a series of operations. The video script explains how attackers construct ROP chains to perform complex actions, such as elevating privileges or bypassing security mechanisms, showcasing the sophistication of modern attack techniques.

Highlights

Introduction to how attackers exploit buffer overflow vulnerabilities in computer systems.

Explanation of how an attacker crafts shellcode to execute on a compromised computer.

Demonstration of creating an intermediate buffer overflow to inject malicious code.

Discussion on the use of stack canaries to prevent stack overflow attacks.

The importance of stack protection mechanisms and their effectiveness against attacks over the years.

How attackers can bypass stack protection by manipulating the CPU with crafted shellcode.

The concept of Return-Oriented Programming (ROP) as an advanced attack technique.

The discovery of Hovav Shacham at Stanford University regarding the exploitation of gadgets in ROP attacks.

The role of canaries in detecting buffer overflow attempts and preventing attacks.

The implementation of Address Space Layout Randomization (ASLR) to complicate the execution of attacks.

The use of secure coding practices and libraries to mitigate the risk of buffer overflows.

The impact of compiler improvements like GCC in enabling security features such as stack canaries.

The necessity for developers to understand and utilize secure functions to prevent vulnerabilities.

The presentation of various techniques used by attackers to find and utilize gadgets in a program's binary.

An overview of how attackers can chain gadgets together to execute arbitrary code.

The importance of constant vigilance and the adoption of secure programming languages like Java.

The role of security measures in the evolution of attack and defense strategies in the cybersecurity landscape.

Conclusion emphasizing the continuous arms race between attackers and defenders in the field of cybersecurity.

Transcripts

play00:01

வணக்கம்.

play00:02

முந்திய வீடியோவில், கணினியின் அங்கீகரிக்கப்படாத

play00:05

பயனர் எப்படி தாங்கல் பிழைத்திருத்த பிழை

play00:09

என்று அறியப்பட்டதன் மூலம் கணினியில்

play00:12

செயல்படுவதற்கு தனது சொந்த குறியீட்டை

play00:15

எவ்வாறு தாக்குபவர் என்பதை நாம் கண்டோம்.

play00:19

எனவே நாம் பார்த்தோம், குறைந்தபட்சம் நாம்

play00:23

அத்தகைய இடைநிலை வழி ஓட்டம் பிழை

play00:27

ஒன்றை உருவாக்கியதுடன், தாக்குபவர் தனது

play00:30

சுரண்டல் குறியீட்டை எவ்வாறு உருவாக்கி,

play00:34

கணினியில் ஒரு ஷெல் உருவாக்கிய குறியீட்டைப்

play00:38

பயன்படுத்துவார் என்பதைக் காட்டினார்.

play00:40

எனவே, இந்த குறிப்பிட்ட எடுத்துக்காட்டு

play00:43

பயனர் பயன்பாட்டில் ஒரு பயன்பாட்டு அடிப்படையிலான

play00:47

உதாரணம், ஆனால் மிகவும் இதேபோன்ற வகையான

play00:52

சுரண்டல்களை இயங்குதளத்தில் எழுதலாம்.

play00:54

எனவே, இந்த வீடியோவில் காணப்படுவது என்னவென்றால்

play00:58

இந்த இடையகப் பெருக்கம் பாதிக்கப்படுவது

play01:01

எப்படி என்பது பற்றிய நுட்பங்கள், மேலும்

play01:05

இந்த ஆண்டுகளில் தாக்குதல்கள் முன்னேற்றமடைந்தன

play01:09

மற்றும் பல ஆண்டுகளாக உருவாகியுள்ளன, இந்த

play01:13

பாதுகாப்புகளை வெற்றிகொள்வதற்கு மிகவும் சக்தி வாய்ந்த

play01:17

தாக்குதல்களை மேற்கொள்வதற்காக.

play01:18

ஸ்டேக்கில் ஏற்படும் இடையக வழி ஓட்டம்

play01:22

தாக்குதல் தடுக்கும் முதல் மற்றும் மிகவும்

play01:26

தெளிவான வழி ஸ்டாக் பக்கங்களை இயங்காத

play01:30

செயலாகும்.

play01:31

நாம் பார்த்தது என்னவென்றால், தாக்குபவர் CPU ஐ ஒரு

play01:36

ஸ்டோக்கில் உள்ள ஒரு சுரண்டல் குறியீட்டை

play01:39

செயல்படுத்துவதற்கு நிர்பந்திக்கும்

play01:41

என்பதாகும்.

play01:42

எனவே, உதாரணமாக இங்கே, ஸ்டேக்கில் வரையறுக்கப்பட்டுள்ள

play01:45

இந்த இடையகம், சுரண்டல் குறியீட்டைக் கொண்டிருக்கும்,

play01:48

மேலும் சரத்தின் நகல் நிறைவேற்றப்பட்டால்,

play01:51

சரம் நகல் அதன் செயல்பாட்டை நிறைவுசெய்த பிறகு,

play01:55

ஷெல் குறியீட்டின் செயல்படுத்தப்படும்

play01:57

ஸ்டாக் மீது உள்ளது.

play01:59

எனவே, இந்தத் தாக்குதலைத் தடுக்க ஒரு தெளிவான

play02:03

வழி ஸ்டேக் பக்கங்களை இயங்கமுடியாததாக்குவதன்

play02:06

மூலம், இந்த நாட்களில் பயன்படுத்தும் கணினிகளில்

play02:09

இது செய்யப்படுகிறது.

play02:10

எனவே, நீங்கள் உண்மையிலேயே இந்த குறிப்பிட்ட

play02:14

நிரலை உங்கள் இன்டெல் கணினிகளில் இயக்கினால்,

play02:17

அதற்கு பதிலாக செயல்பட பயன்படும் குறியீட்டைப்

play02:21

பெறுவதற்கு பதிலாக, நீங்கள் பிரித்தெடுக்கும்

play02:23

தவறு.

play02:24

திட்டம் காரணமாக ஸ்டேக் மீது சில

play02:27

வழிமுறைகளை இயக்க முயற்சி ஏனெனில்

play02:30

இது ஏற்படும்.

play02:32

இன்டெல் கணினிகளில், NX பிட்டானது பக்க

play02:35

அட்டவணையில் உள்ளது, இது ஸ்டாக் ஐ இயங்கக்கூடியதாக

play02:39

குறிக்கின்றது.

play02:40

இது பெரும்பாலான நிரல்களிலுள்ள பெரும்பாலான

play02:42

நிரல்களுக்கான வேலைகளில் கூடுதலான கூடுதல்

play02:45

நன்மையாகும், ஆனால் பிரச்சனை ஸ்டாக்

play02:48

இருந்து இயக்கத் தீங்கற்றதாக இல்லாவிட்டாலும்

play02:51

சில திட்டங்கள் ஆகும்.

play02:53

எனவே இந்த திட்டங்கள் சரியாக செயல்பட பொருட்டு

play02:57

ஸ்டாக் இருந்து இயக்க வேண்டும்.

play02:59

எனவே, NX பிட் அமைப்பது எல்லா திட்டங்களுக்கும்

play03:03

மிகவும் பயனுள்ளதாக இருக்கும்.

play03:05

எனவே அடுத்த விஷயத்தை நாம் கேட்டுக்கொள்ளப்

play03:09

போகிறோம், நாம் ஸ்டேக் அச்சடிக்க இயலாவிட்டால்,

play03:12

அது பஃபர் ஆழ்ந்த தாக்குதல்களை முற்றிலும்

play03:16

தடுக்காது, உண்மையில் அது இல்லை.

play03:19

ஆண்டுகளில் தாங்கல் வழிதல் தாக்குதல்கள்

play03:21

லிப்க் தாக்குதல்களுக்குத் திரும்புவதாக அறியப்பட்ட

play03:24

ஒன்றுக்கு உருவாகியுள்ளன, இது இயங்காத ஸ்டேக்

play03:28

இல்லாத கணினிகளிலும் பயன்படுத்தப்படலாம்.

play03:30

எனவே, லிப்ட் தாக்குதலுக்கு எவ்வாறு திரும்புவது

play03:33

என்பதை மிக சுருக்கமாக பார்ப்போம்.

play03:36

எனவே, அடிப்படையில் நாம் என்ன செய்திருக்கிறோம்,

play03:40

நாம் ஸ்டாக் இல் உள்ள இடைவெளியை நிரப்புவதற்கு

play03:44

முயற்சி செய்யும்போது, ​​நாம் ஸ்டாக் மீது

play03:48

சுரண்டல் குறியீட்டை வைத்திருக்கிறோம்,

play03:50

மற்றும் நாம் அடைவு முகவரியைக் கொண்டு

play03:53

தவறான திரும்ப முகவரியை மாற்றினோம்.

play03:56

இப்போது இது நவீன முறைகளில் நமக்கு

play04:00

வேலை செய்யவில்லை, ஏனென்றால் ஸ்டேக்

play04:02

இயங்கக்கூடியதாக அமைக்கப்பட்டது.

play04:04

NX பிட் செட் கொண்டிருக்கும்போதும், இயங்கக்கூடிய ஸ்டேக்

play04:08

இல்லாதபோதும், libc க்கு எவ்வாறு மீண்டும்

play04:10

வருவது என்பதை பார்ப்போம்.

play04:11

எனவே, libc க்கு திரும்புவது என்னவென்றால், மீண்டும்

play04:13

முகவரிக்கு ஸ்டாக் க்குள் கிளையண்டிற்கு

play04:16

மாற்றுவதற்கு பதிலாக, மறுபடியும் வேறு

play04:19

முகவரிக்கு வேறு முகவரிக்கு செல்லும்படியான

play04:22

முகவரிக்கு இது செல்லுகிறது.

play04:25

இந்த செயல்பாடு F 1 என்று சொல்லலாம்.

play04:29

எனவே, ஒரு buffer overflow வழியாக ஸ்டேக் மீது என்ன

play04:37

நிரப்பப்பட்ட F1 ஒரு சுட்டிக்காட்டி

play04:39

எனவே செயல்பாட்டை முடிக்கும் போது,

play04:42

​​இங்கே இருந்து எடுக்கப்பட்ட முகவரி

play04:45

F1 ஒரு சுட்டிக்காட்டி, எனவே, CPU இந்த செயல்பாட்டை

play04:49

செயல்படுத்துவதற்கு கட்டாயப்படுத்தப்படுகிறது

play04:51

F. இப்போது, ​​அடுத்த கேள்வி - இந்த செயல்பாடு

play04:54

F1 என்ன?

play04:55

எனவே, இந்த செயல்பாடு தாக்குதல் செய்பவரின்

play04:59

சொந்த சுரண்டல் குறியீடாக இருக்க முடியாது

play05:03

என்பது ஒரு விஷயம் நிச்சயம்.

play05:05

எனவே, இது சில செல்லுபடியாகும் செயல்பாடாக இருக்க

play05:10

வேண்டும், இது ஏற்கனவே குறியீட்டு பிரிவில்

play05:13

உள்ளது.

play05:14

எனவே, இந்த செயல்பாடு F 1 இருக்க வேண்டும்?

play05:19

புள்ளி எண் 1 மற்றும் புள்ளி எண் 2 என்பது

play05:25

எப்படி தாக்குதல் நடத்துவது என்பது

play05:27

ஒரு இயல்பான செயல்பாட்டை எவ்வாறு செயல்படுத்துகிறது,

play05:31

இது குறியீடுகளை ரன் மற்றும் சுரண்டுவதற்கு

play05:34

தீங்கிழைக்கும் ஏதாவது செய்ய வேண்டுமா?

play05:37

பல்வேறு வழிகள் உள்ளன, இதில் செயல்பாடு

play05:41

F1 செயல்படுத்தப்படலாம், ஆனால் இன்று நாம்

play05:44

பார்க்கும் செயல்பாடு F1 ஆனது இந்த குறிப்பிட்ட

play05:49

செயல்பாடு முறையைப் பயன்படுத்தி செயல்படுத்தப்படுகிறது.

play05:51

இப்போது, ​​கணினி libbc என்றழைக்கப்படும்

play05:54

ஒரு செயல்பாடாகும், அது என்ன செய்கிறது

play05:58

என்பது ஒரு சார்பின் ஒரு சுட்டிக்காட்டி

play06:01

எடுக்கும், இது ஒரு இயங்கக்கூடிய எடுக்கும்.

play06:05

எனவே கணினிக்கு அனுப்பப்படும் சரம் ஒரு இயங்கக்கூடிய

play06:09

பெயரை எடுக்கும் போது, ​​அது செயல்படுத்தப்பட்டால்,

play06:13

அது குறிப்பாக இந்த குறிப்பிட்ட நிரலை

play06:16

நிறைவேற்றும்.

play06:17

எனவே, இந்த குறிப்பிட்ட எடுத்துக்காட்டில்,

play06:20

என்ன கணினி செய்ய வேண்டும் என்று அது

play06:24

பாஷ் ஷெல் இயக்க வேண்டும், இதனால்

play06:27

ஒரு பாஷ் ஷெல் உருவாக்கும்.

play06:30

இப்போது libc ஒரு நூலகம், இது பெரும்பாலான

play06:34

நிரல்களால் பயன்படுத்தப்படுகிறது.

play06:35

எனவே, நீங்கள் எழுதிய ஒரு சாதாரண "ஹலோ உலக"

play06:40

திட்டம் கூட libc நூலகத்தைப் பயன்படுத்தலாம்.

play06:42

எனவே, இதன் அர்த்தம் என்னவென்றால் உங்கள்

play06:45

செயல்பாட்டின் முகவரி இடத்தில், செயல்பாடு

play06:48

முறை உள்ளது.

play06:49

எனவே, தாக்கரே இப்போது செய்ய வேண்டியது

play06:52

என்னவென்றால், உங்கள் செயல்பாட்டின் முகவரி

play06:55

இடத்திலுள்ள அமைப்பு செயல்பாட்டில் உள்ளதை

play06:57

அடையாளம் காணுவதாகும்.

play06:59

அடுத்து அவர் ஒரு திட்டத்தை இயக்க

play07:02

வேண்டுமெனில், இது ஒரு வாதத்தை எப்படியாவது

play07:05

கடக்க வேண்டும்.

play07:06

எனவே, நாம் முன்மாதிரியைத் தொடர்ந்தால், நாம்

play07:10

முந்தைய வீடியோவில் பார்த்தால், தாக்குபவர்

play07:12

ஒரு ஷெல் செயல்படும் ஒரு சுரண்டலை உருவாக்குகின்றார்

play07:16

என்பதைக் கூறுவோம்.

play07:17

எனவே, இந்த வழக்கில், தாக்குபவர் அதே ஷெல்

play07:21

இயக்க விரும்பினால், பின்னர் நினைவகம்

play07:24

நினைவகத்தில் செயல்படும் முகவரிகளை கண்டுபிடிக்கும்

play07:26

கூடுதலாக, தாக்குதல் எப்படியோ இந்த குறிப்பிட்ட

play07:29

சரம் ஸ்லாஷ் பின் சாய்வு கடக்க வேண்டும்

play07:33

ஒரு அளவுருவாக அமைப்பு.

play07:35

எனவே, இதன் அர்த்தம், தாங்குவோர் ஒரு சரத்தை

play07:39

ஸ்லாஷ் பின் ச்லாஷ் ஷோக்கு சுட்டிக்காட்டும்

play07:42

முகவரியைக் கண்டுபிடிக்க வேண்டும்.

play07:44

எனவே, பொதுவாக என்ன செய்யப்படுகிறது

play07:47

என்பது ஒரு ஸ்டாக் ஃப்ரேமைக் கொண்டிருக்கும்,

play07:50

இது மீண்டும் முகவரி அல்லது அதற்கு பதிலாக

play07:54

செல்லுபடியாகும் பதில் முகவரி F1 சுட்டிக்காட்டி

play07:57

மூலம் மாற்றப்படுகிறது, இது தற்போது இருக்கும்

play08:00

அமைப்பு செயல்பாட்டிற்கு சுட்டிக்காட்டி

play08:02

libc இல், உங்கள் நிரல் மாறும் இணைக்கப்பட்ட

play08:06

நூலகம் libc ஐப் பயன்படுத்தினால், அத்தகைய முகவரி செல்லுபடியாகும்.

play08:09

இரண்டாவது, தாக்குதல் என்ன செய்ய வேண்டும்

play08:12

என்பது ஒரு செயல்பாட்டு பெயரை கொண்ட அமைப்பின்

play08:16

செயல்பாட்டிற்கு ஒரு வாதத்தை அனுப்ப

play08:19

வேண்டும்.

play08:20

எனவே, முக்கியமாக எங்காவது உங்கள்

play08:22

முகவரி இடத்தில், தாக்குதல் இந்த குறிப்பிட்ட

play08:25

சரத்தை காண வேண்டும், இது ஸ்லாஷ் பின்

play08:28

ஸ்லாஷ் பாஷ் அல்லது ஸ்லாஷ் பின் ஸ்லாஷ்

play08:32

ஷி என்று நிரப்பி, இந்த குறிப்பிட்ட

play08:35

சரத்திற்கு சுட்டிக்காட்டி மூலம் ஸ்டேக் நிரப்பவும்.

play08:38

எனவே, அடிப்படையில், அது இரண்டு விஷயங்கள்

play08:41

தேவை; ஒன்று என்பது libc இல் உள்ள கணினி

play08:44

அழைப்பு முகவரியுடன் மாற்றியமைக்கப்பட்ட

play08:46

ஸ்டேக்கிலுள்ள முகவரி, மேலும் libc க்கு அனுப்பிய

play08:49

அளவுரு ஸ்டேக்கில் இருக்க வேண்டும்.

play08:51

எனவே, இந்த விஷயத்தில் இது ஒரு ஷெல் சுட்டிக்காட்டி,

play08:56

இது குறிப்பிட்ட சரம் ஸ்லாஷ் பை ஸ்லாஷ்

play09:00

பாஷ் என்று சுட்டிக்காட்டுகிறது.

play09:02

எனவே, இது முடிந்தவுடன், செயல்பாடு தவறான

play09:06

முகவரிக்கு திரும்புவதற்கு பதிலாக திரும்பும்

play09:08

போது, ​​அது CPU ஐ இந்த இயக்கத்தை செயல்படுத்தும்நரம்பு

play09:13

மண்டலம்.

play09:14

இப்போது இந்த செயல்பாட்டில், இந்த குறிப்பிட்ட

play09:17

ஷெல் ஸ்லாஷ் பை ஸ்லாஷ் பாஷ் சுட்டிக்காட்டி

play09:21

கணினி அழைப்பில் கருதப்படும், அது

play09:24

ஒரு ஷெல் உருவாகலாம்.

play09:26

எனவே, ஷெல் இருந்து, தாக்காளர் பின்னர்

play09:29

பல்வேறு விஷயங்களை உருவாக்கி தனது சொந்த

play09:33

திட்டங்கள் இயக்க முடியும்.

play09:35

எனவே, இந்த வழியில், மீண்டும் இயங்கக்கூடிய

play09:38

ஒரு ஸ்டேக் இருப்பினும் கூட லிப்ட் தாக்குதல்

play09:42

மீண்டும் வேலை.

play09:44

எனவே, இந்த அறிவுறுத்தல்கள் ஏதும் செயல்படவில்லை

play09:47

என்பதை கவனத்தில் கொள்க.

play09:49

நாம் செயல்படுவதன் மூலம், குறியீட்டு

play09:52

பிரிவில் உண்மையான செயல்படுத்தல் நிகழும்போது,

play09:55

​​நாம் வாசித்து எழுதுகிறோம்.

play09:57

இப்போது, ​​libc க்கு திரும்புவதற்கான

play09:59

வரம்பு சில தன்னிச்சையான குறியீட்டை இயக்க

play10:03

மிகவும் கடினமாக உள்ளது.

play10:05

எனவே, தாக்குதல் எப்படி ஒரு ஷெல்

play10:08

இயக்க முடியும் என்பதை ஒரு உதாரணம் பார்த்தோம்,

play10:12

ஆனால் தாக்குதல் தாக்குதல் libc வகை

play10:15

மீண்டும் செய்ய முடியும் என்று அளவு மிகவும்

play10:20

குறைவாக உள்ளது.

play10:21

ஆகையால், காலம் காலத்தின் மீதான தாக்குதல்கள்

play10:25

இன்னும் வலுவாக எழும்.

play10:28

மேலும் சமீபத்தில், ரிட்டர்ண்ட் அன்டென்ட்

play10:31

புரோகிராமிங் தாக்குதல்கள் என்று அழைக்கப்படும்

play10:34

ஒன்று உள்ளது.

play10:35

எனவே, இது அதிகமான சக்திவாய்ந்த தாக்குதல்களில்

play10:39

ஒன்றாகும், இது இடையகப் பாய்ச்சலைப் பயன்படுத்துகிறது.

play10:43

எனவே, இயங்கக்கூடிய ஸ்டேக் இல்லாத கணினிகளுக்கு

play10:47

இது பொருந்தும்.

play10:49

திரும்ப சார்ந்த திட்டம் அல்லது ROP

play10:52

தாக்குதல் என அறியப்பட்ட குறுகிய காலத்திற்கு

play10:57

ஸ்டான்போர்ட் பல்கலைக்கழகத்தில் Hovav Shacham ஆல் கண்டறியப்பட்டது

play11:04

மற்றும் எந்த இயல்பான கணக்கீடு அல்லது

play11:09

ஒரு தன்னிச்சையான குறியீட்டை நிரல்

play11:13

அல்லாத இயங்கக்கூடிய ஸ்டாக் கொண்டிருக்கும்

play11:18

போதும் அது அனுமதிக்கின்றது.

play11:21

எனவே, இந்த விஷயத்தை எப்படிச் செய்வது

play11:26

என்பது மிகச் சிறிய உதாரணம்.

play11:30

எனவே, தாக்குபவர் செயல்பட விரும்பும்

play11:35

குறியீட்டை இந்த தொகுப்பின் மூலம்

play11:39

வழங்கலாம்.

play11:40

எனவே, இந்த சட்டமியற்றும் குறியீடுகளைத் தாக்குவதற்கு

play11:45

முகாமையாளர் நடவடிக்கை எடுத்தால், அவரின்

play11:50

வேலை முடிந்தவுடன், அவர் விரும்பும்

play11:54

அனைத்தையும் இயக்க முடியும்.

play11:57

இப்போது ROP தாக்குதல் என்னவென்றால் கேட்ஜெட்

play12:03

என அறியப்படும் ஒன்று.

play12:06

இப்போது கேஜெட்கள் முக்கியமாக இந்த

play12:10

குறிப்பிட்ட குறியீட்டை அல்லது பெயரிடப்பட்டதைக்

play12:14

குறிக்கும், சிறிய கூறுகளாக கேஜெட்கள்

play12:19

என அறியப்படுகின்றன.

play12:21

எனவே, வெவ்வேறு பேலோடுகள் கேஜெட்களைப் பயன்படுத்துவதன்

play12:26

மூலம் செயல்படுத்தப்பட முடியும் என்பதைக்

play12:30

காட்டியுள்ளன, எனவே தாக்குதல் செய்பவரால்

play12:35

பயன்படுத்தப்பட்டு வரும் பல்வேறு சுரண்டல்

play12:39

குறியீடுகளை நாம் கொண்டிருக்கலாம்.

play12:42

ஒரு கேஜெட்டை என்னவென்று பார்க்கலாம்

play12:46

எனவே முக்கியமாக ஒரு கேஜெட் சில பயனுள்ள

play12:53

அறிவுறுத்தல்கள் மற்றும் நான் இங்கு

play12:57

பயனுள்ள அறிவுறுத்தலைக் கூறும் போது, ​​இது

play13:02

ஒரு பயனுறுப்பின் ஒரு பகுதியாக செயல்படுத்தப்பட

play13:08

வேண்டிய அவசியமான ஒரு கட்டளை ஆகும்

play13:13

'ரெட்' - திரும்பும்.

play13:15

எனவே, நீங்கள் இன்டெல் அறிவுறுத்தலில்

play13:20

அறிந்திருங்கள், அது குறிப்பிட்ட

play13:23

செயல்பாட்டிலிருந்து திரும்புவதை அர்த்தப்படுத்துகிறது.

play13:26

எனவே, இந்த மிக எளிய விஷயம் - ஒரு கேஜெட்டை

play13:33

என்ன?

play13:35

எனவே இப்போது, ​​தாக்குதல் என்ன செய்ய வேண்டும்

play13:41

என்று பேலோடு தொடர்புடைய அவர் செயல்பட வேண்டும்

play13:47

என்று, அவர் போன்ற பயனுள்ள கேஜெட்டுகள்

play13:53

கண்டுபிடிக்க நிறைவேற்றக்கூடிய முழு பைனரி குறியீடு

play13:58

ஸ்கேன் வேண்டும்.

play14:00

எனவே, உதாரணமாக, நாம் இந்த குறிப்பிட்ட

play14:06

சம்பளத்தை எடுத்துக் கொண்டால், தற்போது

play14:10

இருக்கும் அனைத்து வழிமுறைகளிலிருந்தும்

play14:13

நிரல் பைனரிகளில் எவரேனும் தாக்குதலை

play14:17

கண்டிருக்கலாம், அதேவேளையில், இந்த

play14:20

குறிப்பிட்ட கட்டளையை பேலோடு செய்ய வேண்டியது

play14:26

என்னவென்றால், mov esi comma 0x8 esi ஆகும்.

play14:35

இதேபோல், தாக்குதல் என்ன செய்வது என்பது

play14:39

போன்ற கருவிகளைக் கண்டுபிடிப்பதற்கு

play14:41

அவர் திட்ட பைனரி பகுதியின் மற்ற பகுதிகளை

play14:46

ஸ்கேன் செய்வார்.

play14:47

எனவே பேலோடு இரண்டாவது வரி கேஜெட்டில் இரு

play14:52

உள்ளது; மூன்றாவது கோடு இங்கே மற்றும்

play14:56

பல உள்ளது.

play14:58

எனவே, முக்கியமாக அவர் என்ன செய்வார்

play15:01

இந்த பேலோடு கேஜெட்களை பயன்படுத்தி இயக்க

play15:05

வேண்டும்.

play15:06

எனவே, அவர் ஸ்டேக் ஒன்றைக் கொண்டு செல்வதால்

play15:11

கேஜெட்களின் ஒரு சங்கிலி, எனவே ஸ்டேக்கை

play15:15

G 1, G 3, G 4 ஆகியவற்றைக் கொண்டிருக்கும்.

play15:18

எனவே இந்த கேஜெட்டுகள் அல்லது இந்த கேஜெட்டுகளுக்கான

play15:23

முகவரிகள் செல்லுபடியாகும் திரும்ப முகவரியை

play15:26

கண்டறிவதற்குப் பதிலாக முதல் செல்லுபடியாகும்

play15:29

முகவரி திரும்பும்போது, ​​கேஜெட் 1 முகவரியின்

play15:32

முகவரி காணப்படுகிறது, இதன் விளைவாக கேட்ஜெட்

play15:36

1 உடன் தொடர்புடைய இந்த வழிமுறை செயல்படுத்தப்படுகிறது.

play15:40

பின்னர் ஒரு திரும்புதலும், கேஜெட் 2, கேஜெட் 3,

play15:45

கேஜெட் 4 மற்றும் பலவும் செயல்படுத்தப்படும்

play15:49

விதத்தில் ஸ்டேக் நிர்வகிக்கப்படுகிறது.

play15:51

எனவே, மொத்தமாக, அறிவுறுத்தல்கள் தொடர்ச்சியான இடங்களில்

play15:55

இல்லை என்றாலும், தாக்குதல் செய்தவர்

play15:58

என்ன செய்தார், அவர் இந்த வழிமுறைகளை

play16:02

நிறைவேற்ற முடிந்தது.

play16:03

எனவே, இந்த வழியில், அவர் தனது பேலோடு

play16:07

இயக்க முடியும் மற்றும் அது போன்ற பெரிய

play16:12

கேட் கருவிகளை திட்டங்கள் நிரூபிக்க முடியும்

play16:15

என்று காட்டப்பட்டுள்ளது.

play16:17

எனவே, இடையக வழிபாடுகளுக்கான மற்ற முன்னெச்சரிக்கைகள்,

play16:21

ஜாவா போன்ற நிரலாக்க மொழியைப் பயன்படுத்த

play16:24

வேண்டும், இது தானாக வரிசை எல்லைகளை சரிபார்க்கிறது.

play16:29

எனவே, எந்த வரம்பு அதன் வரம்புகளிலிருந்து

play16:32

அணுகப்படவில்லை என்பதை இது உறுதி

play16:35

செய்யும்.

play16:36

மற்றொரு வழி மிகவும் பாதுகாப்பான நூலகங்களைப்

play16:40

பயன்படுத்துவதாகும்.

play16:41

உதாரணமாக, C 11 விவரக்குறிப்பு இணைப்பு K, இந்த பாதுகாப்பான

play16:46

நூலகங்களை பயன்படுத்த வேண்டும் என்பதைக்

play16:49

குறிப்பிடுகிறது.

play16:50

எனவே, எடுத்துக்காட்டாக, s கள் underscore s, string copy underscore

play17:00

s, string n பிரதி underscore கள் கிடைக்கும், எனவே

play17:05

இவை அனைத்தும் நாம் பயன்படுத்தும் நிலையான

play17:09

செயல்பாடுகளின் அதே செயல்பாடு ஆகும்,

play17:12

ஆனால் இந்த செயல்பாடுகள் பாதுகாப்பானவை மற்றும்

play17:16

buffer overflows ஐ தடுக்கும்.

play17:19

இடையக வழிபாடுகளைத் தடுக்க மற்றொரு பிரபலமான

play17:22

பயன்முறை கேனரிகளின் பயன்பாடு ஆகும்.

play17:25

எனவே, ஒரு கேனரி என்பது ஒரு அறியப்பட்ட சூடோ

play17:30

சீரற்ற மதிப்பு, இது ஸ்டேக்கிற்குள்

play17:33

வைக்கப்படுகிறது, இது இடையக வழிப்பாதைகளை

play17:36

கண்டறியும்.

play17:37

என்ன செய்வது என்பது செயல்பாட்டின் துவக்கத்தில்

play17:40

ஒரு கேனரி ஸ்டாக் மீது செருகப்படுகிறது;

play17:44

இங்கே காட்டப்பட்டுள்ளபடி ஸ்டேக்கிற்கு சில

play17:47

கேனரி மதிப்பை அழுத்துங்கள்.

play17:49

எனவே, அளவுருக்கள் கூடுதலாக, மீண்டும்

play17:52

முகவரி, சட்ட சுட்டிக்காட்டி, நாம் இப்போது ஒரு

play17:56

கேனரி உள்ளது.

play17:57

திரும்பும் முன் அல்லது செயல்பாட்டை

play18:00

விட்டுச் செல்வதற்கு முன், அது மாற்றியமைக்கப்பட்டுள்ளதா

play18:04

என்பதை அறிய கேனரி சோதிக்கப்படுகிறது.

play18:07

இப்போது ஒரு தாங்கல் வழிதல் ஏற்பட்டால்,

play18:10

இடையக வழிப்பாதை அடுக்குகளில் முகவரிகளை

play18:13

மாற்றியமைக்கும், அதன் விளைவாக கேனரி

play18:16

மதிப்பு மாற்றியமைக்கப்படும், எனவே, கேனரி மதிப்பில்

play18:19

மாற்றத்தை கண்டறிந்து கொள்ளலாம்.

play18:22

வழிதல் ஏற்பட்டது.

play18:23

எனவே, திட்டத்தை நிறுத்தக்கூடும்.

play18:25

எனவே, இந்த நாட்களில் gcc தொகுப்பின் சமீபத்திய

play18:29

பதிப்புகளில், இத்தகைய கேனையர்கள் இயல்புநிலையில்

play18:32

செயல்படுத்தப்படுகின்றன.

play18:33

எனவே, கேனரி மதிப்பை அறியப்பட்டால், கேனரி

play18:37

முழு பயன்பாடும் அகற்றப்பட்டுவிட்டது,

play18:39

அதாவது கேனரி மதிப்பு பயன்படுத்தப்படுவதைத்

play18:42

தெரிந்து கொள்ள முடிந்தால், அவர் மாற்றிக்கொள்ளலாம்

play18:45

அல்லது கேனரி இந்த மதிப்பை அமைக்கலாம்.

play18:49

கேனரி அனைத்து மாற்றப்படவில்லை, எனவே அதன் பயன்பாடு

play18:53

குறைவாக உள்ளது.

play18:54

குறிப்பிட்ட ஸ்பேஸ் ரேண்டமைசேசன் அல்லது

play18:57

ASLR என்று அழைக்கப்படும் இந்த குறிப்பிட்ட

play19:01

தாக்குதலைத் தடுக்க மற்றொரு வழி, இந்த

play19:04

குறிப்பிட்ட கவுண்ட்டர் நுட்பத்தில் அது

play19:07

தாக்குதல்களுக்கு குறியீட்டில் குறிப்பிட்ட

play19:09

இடங்களைத் தெரிந்துகொள்ள வேண்டும் என்ற உண்மையைப்

play19:13

பயன்படுத்துகிறது.

play19:14

உதாரணமாக libc தாக்கத்திற்குத் திரும்புவதற்கு,

play19:16

தாக்குதல் F1 அல்லது எங்கிருந்தாலும்

play19:20

செயல்பாடு அமைப்பில் நிரல் இடத்திலேயே

play19:23

அமைந்துள்ளதா என்பதைத் தெரிந்து கொள்ள வேண்டும்.

play19:27

இப்போது நாம் ASLR ஐ இயக்கியிருந்தால்,

play19:32

முகவரியின் தளவமைப்பு அமைப்பை சீரமைக்கிறதாம்,

play19:35

தாக்குப்பிடிப்பவர் சரியாகச் செயல்பட

play19:38

வேண்டிய செயல்பாடு எங்கே என்பதை தீர்மானிக்க

play19:42

கடினமாக இருப்பார்.

play19:44

வேறு வார்த்தைகளில் கூறுவதானால், முகவரிக்கு

play19:47

இடமில்லாமல் செயல்பாட்டு அமைப்பு எங்கே என்பதைத்

play19:52

தெரிந்துகொள்வது கடினமாக இருக்கும்.

play19:54

இதனால் தாக்குதல் மிகவும் கடினமாகிவிடும்.

play19:58

நன்றி.

Rate This

5.0 / 5 (0 votes)

Связанные теги
Buffer OverflowCode InjectionCybersecurityExploit TechniquesStack OverflowNX BitASLRLibc AttacksROP AttacksSystem Security
Вам нужно краткое изложение на английском?