W8 L4 Preventing Buffer Overflow Attacks
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
🛠️ 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.
🔬 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.
💡 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.
🛡️ 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
💡Shellcode
💡Stack
💡NX Bit
💡Return-Oriented Programming (ROP)
💡Gadget
💡ASLR (Address Space Layout Randomization)
💡Canaries
💡Executable Stack
💡Libc
💡ROP Chain
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
வணக்கம்.
முந்திய வீடியோவில், கணினியின் அங்கீகரிக்கப்படாத
பயனர் எப்படி தாங்கல் பிழைத்திருத்த பிழை
என்று அறியப்பட்டதன் மூலம் கணினியில்
செயல்படுவதற்கு தனது சொந்த குறியீட்டை
எவ்வாறு தாக்குபவர் என்பதை நாம் கண்டோம்.
எனவே நாம் பார்த்தோம், குறைந்தபட்சம் நாம்
அத்தகைய இடைநிலை வழி ஓட்டம் பிழை
ஒன்றை உருவாக்கியதுடன், தாக்குபவர் தனது
சுரண்டல் குறியீட்டை எவ்வாறு உருவாக்கி,
கணினியில் ஒரு ஷெல் உருவாக்கிய குறியீட்டைப்
பயன்படுத்துவார் என்பதைக் காட்டினார்.
எனவே, இந்த குறிப்பிட்ட எடுத்துக்காட்டு
பயனர் பயன்பாட்டில் ஒரு பயன்பாட்டு அடிப்படையிலான
உதாரணம், ஆனால் மிகவும் இதேபோன்ற வகையான
சுரண்டல்களை இயங்குதளத்தில் எழுதலாம்.
எனவே, இந்த வீடியோவில் காணப்படுவது என்னவென்றால்
இந்த இடையகப் பெருக்கம் பாதிக்கப்படுவது
எப்படி என்பது பற்றிய நுட்பங்கள், மேலும்
இந்த ஆண்டுகளில் தாக்குதல்கள் முன்னேற்றமடைந்தன
மற்றும் பல ஆண்டுகளாக உருவாகியுள்ளன, இந்த
பாதுகாப்புகளை வெற்றிகொள்வதற்கு மிகவும் சக்தி வாய்ந்த
தாக்குதல்களை மேற்கொள்வதற்காக.
ஸ்டேக்கில் ஏற்படும் இடையக வழி ஓட்டம்
தாக்குதல் தடுக்கும் முதல் மற்றும் மிகவும்
தெளிவான வழி ஸ்டாக் பக்கங்களை இயங்காத
செயலாகும்.
நாம் பார்த்தது என்னவென்றால், தாக்குபவர் CPU ஐ ஒரு
ஸ்டோக்கில் உள்ள ஒரு சுரண்டல் குறியீட்டை
செயல்படுத்துவதற்கு நிர்பந்திக்கும்
என்பதாகும்.
எனவே, உதாரணமாக இங்கே, ஸ்டேக்கில் வரையறுக்கப்பட்டுள்ள
இந்த இடையகம், சுரண்டல் குறியீட்டைக் கொண்டிருக்கும்,
மேலும் சரத்தின் நகல் நிறைவேற்றப்பட்டால்,
சரம் நகல் அதன் செயல்பாட்டை நிறைவுசெய்த பிறகு,
ஷெல் குறியீட்டின் செயல்படுத்தப்படும்
ஸ்டாக் மீது உள்ளது.
எனவே, இந்தத் தாக்குதலைத் தடுக்க ஒரு தெளிவான
வழி ஸ்டேக் பக்கங்களை இயங்கமுடியாததாக்குவதன்
மூலம், இந்த நாட்களில் பயன்படுத்தும் கணினிகளில்
இது செய்யப்படுகிறது.
எனவே, நீங்கள் உண்மையிலேயே இந்த குறிப்பிட்ட
நிரலை உங்கள் இன்டெல் கணினிகளில் இயக்கினால்,
அதற்கு பதிலாக செயல்பட பயன்படும் குறியீட்டைப்
பெறுவதற்கு பதிலாக, நீங்கள் பிரித்தெடுக்கும்
தவறு.
திட்டம் காரணமாக ஸ்டேக் மீது சில
வழிமுறைகளை இயக்க முயற்சி ஏனெனில்
இது ஏற்படும்.
இன்டெல் கணினிகளில், NX பிட்டானது பக்க
அட்டவணையில் உள்ளது, இது ஸ்டாக் ஐ இயங்கக்கூடியதாக
குறிக்கின்றது.
இது பெரும்பாலான நிரல்களிலுள்ள பெரும்பாலான
நிரல்களுக்கான வேலைகளில் கூடுதலான கூடுதல்
நன்மையாகும், ஆனால் பிரச்சனை ஸ்டாக்
இருந்து இயக்கத் தீங்கற்றதாக இல்லாவிட்டாலும்
சில திட்டங்கள் ஆகும்.
எனவே இந்த திட்டங்கள் சரியாக செயல்பட பொருட்டு
ஸ்டாக் இருந்து இயக்க வேண்டும்.
எனவே, NX பிட் அமைப்பது எல்லா திட்டங்களுக்கும்
மிகவும் பயனுள்ளதாக இருக்கும்.
எனவே அடுத்த விஷயத்தை நாம் கேட்டுக்கொள்ளப்
போகிறோம், நாம் ஸ்டேக் அச்சடிக்க இயலாவிட்டால்,
அது பஃபர் ஆழ்ந்த தாக்குதல்களை முற்றிலும்
தடுக்காது, உண்மையில் அது இல்லை.
ஆண்டுகளில் தாங்கல் வழிதல் தாக்குதல்கள்
லிப்க் தாக்குதல்களுக்குத் திரும்புவதாக அறியப்பட்ட
ஒன்றுக்கு உருவாகியுள்ளன, இது இயங்காத ஸ்டேக்
இல்லாத கணினிகளிலும் பயன்படுத்தப்படலாம்.
எனவே, லிப்ட் தாக்குதலுக்கு எவ்வாறு திரும்புவது
என்பதை மிக சுருக்கமாக பார்ப்போம்.
எனவே, அடிப்படையில் நாம் என்ன செய்திருக்கிறோம்,
நாம் ஸ்டாக் இல் உள்ள இடைவெளியை நிரப்புவதற்கு
முயற்சி செய்யும்போது, நாம் ஸ்டாக் மீது
சுரண்டல் குறியீட்டை வைத்திருக்கிறோம்,
மற்றும் நாம் அடைவு முகவரியைக் கொண்டு
தவறான திரும்ப முகவரியை மாற்றினோம்.
இப்போது இது நவீன முறைகளில் நமக்கு
வேலை செய்யவில்லை, ஏனென்றால் ஸ்டேக்
இயங்கக்கூடியதாக அமைக்கப்பட்டது.
NX பிட் செட் கொண்டிருக்கும்போதும், இயங்கக்கூடிய ஸ்டேக்
இல்லாதபோதும், libc க்கு எவ்வாறு மீண்டும்
வருவது என்பதை பார்ப்போம்.
எனவே, libc க்கு திரும்புவது என்னவென்றால், மீண்டும்
முகவரிக்கு ஸ்டாக் க்குள் கிளையண்டிற்கு
மாற்றுவதற்கு பதிலாக, மறுபடியும் வேறு
முகவரிக்கு வேறு முகவரிக்கு செல்லும்படியான
முகவரிக்கு இது செல்லுகிறது.
இந்த செயல்பாடு F 1 என்று சொல்லலாம்.
எனவே, ஒரு buffer overflow வழியாக ஸ்டேக் மீது என்ன
நிரப்பப்பட்ட F1 ஒரு சுட்டிக்காட்டி
எனவே செயல்பாட்டை முடிக்கும் போது,
இங்கே இருந்து எடுக்கப்பட்ட முகவரி
F1 ஒரு சுட்டிக்காட்டி, எனவே, CPU இந்த செயல்பாட்டை
செயல்படுத்துவதற்கு கட்டாயப்படுத்தப்படுகிறது
F. இப்போது, அடுத்த கேள்வி - இந்த செயல்பாடு
F1 என்ன?
எனவே, இந்த செயல்பாடு தாக்குதல் செய்பவரின்
சொந்த சுரண்டல் குறியீடாக இருக்க முடியாது
என்பது ஒரு விஷயம் நிச்சயம்.
எனவே, இது சில செல்லுபடியாகும் செயல்பாடாக இருக்க
வேண்டும், இது ஏற்கனவே குறியீட்டு பிரிவில்
உள்ளது.
எனவே, இந்த செயல்பாடு F 1 இருக்க வேண்டும்?
புள்ளி எண் 1 மற்றும் புள்ளி எண் 2 என்பது
எப்படி தாக்குதல் நடத்துவது என்பது
ஒரு இயல்பான செயல்பாட்டை எவ்வாறு செயல்படுத்துகிறது,
இது குறியீடுகளை ரன் மற்றும் சுரண்டுவதற்கு
தீங்கிழைக்கும் ஏதாவது செய்ய வேண்டுமா?
பல்வேறு வழிகள் உள்ளன, இதில் செயல்பாடு
F1 செயல்படுத்தப்படலாம், ஆனால் இன்று நாம்
பார்க்கும் செயல்பாடு F1 ஆனது இந்த குறிப்பிட்ட
செயல்பாடு முறையைப் பயன்படுத்தி செயல்படுத்தப்படுகிறது.
இப்போது, கணினி libbc என்றழைக்கப்படும்
ஒரு செயல்பாடாகும், அது என்ன செய்கிறது
என்பது ஒரு சார்பின் ஒரு சுட்டிக்காட்டி
எடுக்கும், இது ஒரு இயங்கக்கூடிய எடுக்கும்.
எனவே கணினிக்கு அனுப்பப்படும் சரம் ஒரு இயங்கக்கூடிய
பெயரை எடுக்கும் போது, அது செயல்படுத்தப்பட்டால்,
அது குறிப்பாக இந்த குறிப்பிட்ட நிரலை
நிறைவேற்றும்.
எனவே, இந்த குறிப்பிட்ட எடுத்துக்காட்டில்,
என்ன கணினி செய்ய வேண்டும் என்று அது
பாஷ் ஷெல் இயக்க வேண்டும், இதனால்
ஒரு பாஷ் ஷெல் உருவாக்கும்.
இப்போது libc ஒரு நூலகம், இது பெரும்பாலான
நிரல்களால் பயன்படுத்தப்படுகிறது.
எனவே, நீங்கள் எழுதிய ஒரு சாதாரண "ஹலோ உலக"
திட்டம் கூட libc நூலகத்தைப் பயன்படுத்தலாம்.
எனவே, இதன் அர்த்தம் என்னவென்றால் உங்கள்
செயல்பாட்டின் முகவரி இடத்தில், செயல்பாடு
முறை உள்ளது.
எனவே, தாக்கரே இப்போது செய்ய வேண்டியது
என்னவென்றால், உங்கள் செயல்பாட்டின் முகவரி
இடத்திலுள்ள அமைப்பு செயல்பாட்டில் உள்ளதை
அடையாளம் காணுவதாகும்.
அடுத்து அவர் ஒரு திட்டத்தை இயக்க
வேண்டுமெனில், இது ஒரு வாதத்தை எப்படியாவது
கடக்க வேண்டும்.
எனவே, நாம் முன்மாதிரியைத் தொடர்ந்தால், நாம்
முந்தைய வீடியோவில் பார்த்தால், தாக்குபவர்
ஒரு ஷெல் செயல்படும் ஒரு சுரண்டலை உருவாக்குகின்றார்
என்பதைக் கூறுவோம்.
எனவே, இந்த வழக்கில், தாக்குபவர் அதே ஷெல்
இயக்க விரும்பினால், பின்னர் நினைவகம்
நினைவகத்தில் செயல்படும் முகவரிகளை கண்டுபிடிக்கும்
கூடுதலாக, தாக்குதல் எப்படியோ இந்த குறிப்பிட்ட
சரம் ஸ்லாஷ் பின் சாய்வு கடக்க வேண்டும்
ஒரு அளவுருவாக அமைப்பு.
எனவே, இதன் அர்த்தம், தாங்குவோர் ஒரு சரத்தை
ஸ்லாஷ் பின் ச்லாஷ் ஷோக்கு சுட்டிக்காட்டும்
முகவரியைக் கண்டுபிடிக்க வேண்டும்.
எனவே, பொதுவாக என்ன செய்யப்படுகிறது
என்பது ஒரு ஸ்டாக் ஃப்ரேமைக் கொண்டிருக்கும்,
இது மீண்டும் முகவரி அல்லது அதற்கு பதிலாக
செல்லுபடியாகும் பதில் முகவரி F1 சுட்டிக்காட்டி
மூலம் மாற்றப்படுகிறது, இது தற்போது இருக்கும்
அமைப்பு செயல்பாட்டிற்கு சுட்டிக்காட்டி
libc இல், உங்கள் நிரல் மாறும் இணைக்கப்பட்ட
நூலகம் libc ஐப் பயன்படுத்தினால், அத்தகைய முகவரி செல்லுபடியாகும்.
இரண்டாவது, தாக்குதல் என்ன செய்ய வேண்டும்
என்பது ஒரு செயல்பாட்டு பெயரை கொண்ட அமைப்பின்
செயல்பாட்டிற்கு ஒரு வாதத்தை அனுப்ப
வேண்டும்.
எனவே, முக்கியமாக எங்காவது உங்கள்
முகவரி இடத்தில், தாக்குதல் இந்த குறிப்பிட்ட
சரத்தை காண வேண்டும், இது ஸ்லாஷ் பின்
ஸ்லாஷ் பாஷ் அல்லது ஸ்லாஷ் பின் ஸ்லாஷ்
ஷி என்று நிரப்பி, இந்த குறிப்பிட்ட
சரத்திற்கு சுட்டிக்காட்டி மூலம் ஸ்டேக் நிரப்பவும்.
எனவே, அடிப்படையில், அது இரண்டு விஷயங்கள்
தேவை; ஒன்று என்பது libc இல் உள்ள கணினி
அழைப்பு முகவரியுடன் மாற்றியமைக்கப்பட்ட
ஸ்டேக்கிலுள்ள முகவரி, மேலும் libc க்கு அனுப்பிய
அளவுரு ஸ்டேக்கில் இருக்க வேண்டும்.
எனவே, இந்த விஷயத்தில் இது ஒரு ஷெல் சுட்டிக்காட்டி,
இது குறிப்பிட்ட சரம் ஸ்லாஷ் பை ஸ்லாஷ்
பாஷ் என்று சுட்டிக்காட்டுகிறது.
எனவே, இது முடிந்தவுடன், செயல்பாடு தவறான
முகவரிக்கு திரும்புவதற்கு பதிலாக திரும்பும்
போது, அது CPU ஐ இந்த இயக்கத்தை செயல்படுத்தும்நரம்பு
மண்டலம்.
இப்போது இந்த செயல்பாட்டில், இந்த குறிப்பிட்ட
ஷெல் ஸ்லாஷ் பை ஸ்லாஷ் பாஷ் சுட்டிக்காட்டி
கணினி அழைப்பில் கருதப்படும், அது
ஒரு ஷெல் உருவாகலாம்.
எனவே, ஷெல் இருந்து, தாக்காளர் பின்னர்
பல்வேறு விஷயங்களை உருவாக்கி தனது சொந்த
திட்டங்கள் இயக்க முடியும்.
எனவே, இந்த வழியில், மீண்டும் இயங்கக்கூடிய
ஒரு ஸ்டேக் இருப்பினும் கூட லிப்ட் தாக்குதல்
மீண்டும் வேலை.
எனவே, இந்த அறிவுறுத்தல்கள் ஏதும் செயல்படவில்லை
என்பதை கவனத்தில் கொள்க.
நாம் செயல்படுவதன் மூலம், குறியீட்டு
பிரிவில் உண்மையான செயல்படுத்தல் நிகழும்போது,
நாம் வாசித்து எழுதுகிறோம்.
இப்போது, libc க்கு திரும்புவதற்கான
வரம்பு சில தன்னிச்சையான குறியீட்டை இயக்க
மிகவும் கடினமாக உள்ளது.
எனவே, தாக்குதல் எப்படி ஒரு ஷெல்
இயக்க முடியும் என்பதை ஒரு உதாரணம் பார்த்தோம்,
ஆனால் தாக்குதல் தாக்குதல் libc வகை
மீண்டும் செய்ய முடியும் என்று அளவு மிகவும்
குறைவாக உள்ளது.
ஆகையால், காலம் காலத்தின் மீதான தாக்குதல்கள்
இன்னும் வலுவாக எழும்.
மேலும் சமீபத்தில், ரிட்டர்ண்ட் அன்டென்ட்
புரோகிராமிங் தாக்குதல்கள் என்று அழைக்கப்படும்
ஒன்று உள்ளது.
எனவே, இது அதிகமான சக்திவாய்ந்த தாக்குதல்களில்
ஒன்றாகும், இது இடையகப் பாய்ச்சலைப் பயன்படுத்துகிறது.
எனவே, இயங்கக்கூடிய ஸ்டேக் இல்லாத கணினிகளுக்கு
இது பொருந்தும்.
திரும்ப சார்ந்த திட்டம் அல்லது ROP
தாக்குதல் என அறியப்பட்ட குறுகிய காலத்திற்கு
ஸ்டான்போர்ட் பல்கலைக்கழகத்தில் Hovav Shacham ஆல் கண்டறியப்பட்டது
மற்றும் எந்த இயல்பான கணக்கீடு அல்லது
ஒரு தன்னிச்சையான குறியீட்டை நிரல்
அல்லாத இயங்கக்கூடிய ஸ்டாக் கொண்டிருக்கும்
போதும் அது அனுமதிக்கின்றது.
எனவே, இந்த விஷயத்தை எப்படிச் செய்வது
என்பது மிகச் சிறிய உதாரணம்.
எனவே, தாக்குபவர் செயல்பட விரும்பும்
குறியீட்டை இந்த தொகுப்பின் மூலம்
வழங்கலாம்.
எனவே, இந்த சட்டமியற்றும் குறியீடுகளைத் தாக்குவதற்கு
முகாமையாளர் நடவடிக்கை எடுத்தால், அவரின்
வேலை முடிந்தவுடன், அவர் விரும்பும்
அனைத்தையும் இயக்க முடியும்.
இப்போது ROP தாக்குதல் என்னவென்றால் கேட்ஜெட்
என அறியப்படும் ஒன்று.
இப்போது கேஜெட்கள் முக்கியமாக இந்த
குறிப்பிட்ட குறியீட்டை அல்லது பெயரிடப்பட்டதைக்
குறிக்கும், சிறிய கூறுகளாக கேஜெட்கள்
என அறியப்படுகின்றன.
எனவே, வெவ்வேறு பேலோடுகள் கேஜெட்களைப் பயன்படுத்துவதன்
மூலம் செயல்படுத்தப்பட முடியும் என்பதைக்
காட்டியுள்ளன, எனவே தாக்குதல் செய்பவரால்
பயன்படுத்தப்பட்டு வரும் பல்வேறு சுரண்டல்
குறியீடுகளை நாம் கொண்டிருக்கலாம்.
ஒரு கேஜெட்டை என்னவென்று பார்க்கலாம்
எனவே முக்கியமாக ஒரு கேஜெட் சில பயனுள்ள
அறிவுறுத்தல்கள் மற்றும் நான் இங்கு
பயனுள்ள அறிவுறுத்தலைக் கூறும் போது, இது
ஒரு பயனுறுப்பின் ஒரு பகுதியாக செயல்படுத்தப்பட
வேண்டிய அவசியமான ஒரு கட்டளை ஆகும்
'ரெட்' - திரும்பும்.
எனவே, நீங்கள் இன்டெல் அறிவுறுத்தலில்
அறிந்திருங்கள், அது குறிப்பிட்ட
செயல்பாட்டிலிருந்து திரும்புவதை அர்த்தப்படுத்துகிறது.
எனவே, இந்த மிக எளிய விஷயம் - ஒரு கேஜெட்டை
என்ன?
எனவே இப்போது, தாக்குதல் என்ன செய்ய வேண்டும்
என்று பேலோடு தொடர்புடைய அவர் செயல்பட வேண்டும்
என்று, அவர் போன்ற பயனுள்ள கேஜெட்டுகள்
கண்டுபிடிக்க நிறைவேற்றக்கூடிய முழு பைனரி குறியீடு
ஸ்கேன் வேண்டும்.
எனவே, உதாரணமாக, நாம் இந்த குறிப்பிட்ட
சம்பளத்தை எடுத்துக் கொண்டால், தற்போது
இருக்கும் அனைத்து வழிமுறைகளிலிருந்தும்
நிரல் பைனரிகளில் எவரேனும் தாக்குதலை
கண்டிருக்கலாம், அதேவேளையில், இந்த
குறிப்பிட்ட கட்டளையை பேலோடு செய்ய வேண்டியது
என்னவென்றால், mov esi comma 0x8 esi ஆகும்.
இதேபோல், தாக்குதல் என்ன செய்வது என்பது
போன்ற கருவிகளைக் கண்டுபிடிப்பதற்கு
அவர் திட்ட பைனரி பகுதியின் மற்ற பகுதிகளை
ஸ்கேன் செய்வார்.
எனவே பேலோடு இரண்டாவது வரி கேஜெட்டில் இரு
உள்ளது; மூன்றாவது கோடு இங்கே மற்றும்
பல உள்ளது.
எனவே, முக்கியமாக அவர் என்ன செய்வார்
இந்த பேலோடு கேஜெட்களை பயன்படுத்தி இயக்க
வேண்டும்.
எனவே, அவர் ஸ்டேக் ஒன்றைக் கொண்டு செல்வதால்
கேஜெட்களின் ஒரு சங்கிலி, எனவே ஸ்டேக்கை
G 1, G 3, G 4 ஆகியவற்றைக் கொண்டிருக்கும்.
எனவே இந்த கேஜெட்டுகள் அல்லது இந்த கேஜெட்டுகளுக்கான
முகவரிகள் செல்லுபடியாகும் திரும்ப முகவரியை
கண்டறிவதற்குப் பதிலாக முதல் செல்லுபடியாகும்
முகவரி திரும்பும்போது, கேஜெட் 1 முகவரியின்
முகவரி காணப்படுகிறது, இதன் விளைவாக கேட்ஜெட்
1 உடன் தொடர்புடைய இந்த வழிமுறை செயல்படுத்தப்படுகிறது.
பின்னர் ஒரு திரும்புதலும், கேஜெட் 2, கேஜெட் 3,
கேஜெட் 4 மற்றும் பலவும் செயல்படுத்தப்படும்
விதத்தில் ஸ்டேக் நிர்வகிக்கப்படுகிறது.
எனவே, மொத்தமாக, அறிவுறுத்தல்கள் தொடர்ச்சியான இடங்களில்
இல்லை என்றாலும், தாக்குதல் செய்தவர்
என்ன செய்தார், அவர் இந்த வழிமுறைகளை
நிறைவேற்ற முடிந்தது.
எனவே, இந்த வழியில், அவர் தனது பேலோடு
இயக்க முடியும் மற்றும் அது போன்ற பெரிய
கேட் கருவிகளை திட்டங்கள் நிரூபிக்க முடியும்
என்று காட்டப்பட்டுள்ளது.
எனவே, இடையக வழிபாடுகளுக்கான மற்ற முன்னெச்சரிக்கைகள்,
ஜாவா போன்ற நிரலாக்க மொழியைப் பயன்படுத்த
வேண்டும், இது தானாக வரிசை எல்லைகளை சரிபார்க்கிறது.
எனவே, எந்த வரம்பு அதன் வரம்புகளிலிருந்து
அணுகப்படவில்லை என்பதை இது உறுதி
செய்யும்.
மற்றொரு வழி மிகவும் பாதுகாப்பான நூலகங்களைப்
பயன்படுத்துவதாகும்.
உதாரணமாக, C 11 விவரக்குறிப்பு இணைப்பு K, இந்த பாதுகாப்பான
நூலகங்களை பயன்படுத்த வேண்டும் என்பதைக்
குறிப்பிடுகிறது.
எனவே, எடுத்துக்காட்டாக, s கள் underscore s, string copy underscore
s, string n பிரதி underscore கள் கிடைக்கும், எனவே
இவை அனைத்தும் நாம் பயன்படுத்தும் நிலையான
செயல்பாடுகளின் அதே செயல்பாடு ஆகும்,
ஆனால் இந்த செயல்பாடுகள் பாதுகாப்பானவை மற்றும்
buffer overflows ஐ தடுக்கும்.
இடையக வழிபாடுகளைத் தடுக்க மற்றொரு பிரபலமான
பயன்முறை கேனரிகளின் பயன்பாடு ஆகும்.
எனவே, ஒரு கேனரி என்பது ஒரு அறியப்பட்ட சூடோ
சீரற்ற மதிப்பு, இது ஸ்டேக்கிற்குள்
வைக்கப்படுகிறது, இது இடையக வழிப்பாதைகளை
கண்டறியும்.
என்ன செய்வது என்பது செயல்பாட்டின் துவக்கத்தில்
ஒரு கேனரி ஸ்டாக் மீது செருகப்படுகிறது;
இங்கே காட்டப்பட்டுள்ளபடி ஸ்டேக்கிற்கு சில
கேனரி மதிப்பை அழுத்துங்கள்.
எனவே, அளவுருக்கள் கூடுதலாக, மீண்டும்
முகவரி, சட்ட சுட்டிக்காட்டி, நாம் இப்போது ஒரு
கேனரி உள்ளது.
திரும்பும் முன் அல்லது செயல்பாட்டை
விட்டுச் செல்வதற்கு முன், அது மாற்றியமைக்கப்பட்டுள்ளதா
என்பதை அறிய கேனரி சோதிக்கப்படுகிறது.
இப்போது ஒரு தாங்கல் வழிதல் ஏற்பட்டால்,
இடையக வழிப்பாதை அடுக்குகளில் முகவரிகளை
மாற்றியமைக்கும், அதன் விளைவாக கேனரி
மதிப்பு மாற்றியமைக்கப்படும், எனவே, கேனரி மதிப்பில்
மாற்றத்தை கண்டறிந்து கொள்ளலாம்.
வழிதல் ஏற்பட்டது.
எனவே, திட்டத்தை நிறுத்தக்கூடும்.
எனவே, இந்த நாட்களில் gcc தொகுப்பின் சமீபத்திய
பதிப்புகளில், இத்தகைய கேனையர்கள் இயல்புநிலையில்
செயல்படுத்தப்படுகின்றன.
எனவே, கேனரி மதிப்பை அறியப்பட்டால், கேனரி
முழு பயன்பாடும் அகற்றப்பட்டுவிட்டது,
அதாவது கேனரி மதிப்பு பயன்படுத்தப்படுவதைத்
தெரிந்து கொள்ள முடிந்தால், அவர் மாற்றிக்கொள்ளலாம்
அல்லது கேனரி இந்த மதிப்பை அமைக்கலாம்.
கேனரி அனைத்து மாற்றப்படவில்லை, எனவே அதன் பயன்பாடு
குறைவாக உள்ளது.
குறிப்பிட்ட ஸ்பேஸ் ரேண்டமைசேசன் அல்லது
ASLR என்று அழைக்கப்படும் இந்த குறிப்பிட்ட
தாக்குதலைத் தடுக்க மற்றொரு வழி, இந்த
குறிப்பிட்ட கவுண்ட்டர் நுட்பத்தில் அது
தாக்குதல்களுக்கு குறியீட்டில் குறிப்பிட்ட
இடங்களைத் தெரிந்துகொள்ள வேண்டும் என்ற உண்மையைப்
பயன்படுத்துகிறது.
உதாரணமாக libc தாக்கத்திற்குத் திரும்புவதற்கு,
தாக்குதல் F1 அல்லது எங்கிருந்தாலும்
செயல்பாடு அமைப்பில் நிரல் இடத்திலேயே
அமைந்துள்ளதா என்பதைத் தெரிந்து கொள்ள வேண்டும்.
இப்போது நாம் ASLR ஐ இயக்கியிருந்தால்,
முகவரியின் தளவமைப்பு அமைப்பை சீரமைக்கிறதாம்,
தாக்குப்பிடிப்பவர் சரியாகச் செயல்பட
வேண்டிய செயல்பாடு எங்கே என்பதை தீர்மானிக்க
கடினமாக இருப்பார்.
வேறு வார்த்தைகளில் கூறுவதானால், முகவரிக்கு
இடமில்லாமல் செயல்பாட்டு அமைப்பு எங்கே என்பதைத்
தெரிந்துகொள்வது கடினமாக இருக்கும்.
இதனால் தாக்குதல் மிகவும் கடினமாகிவிடும்.
நன்றி.
Voir Plus de Vidéos Connexes
CompTIA Security+ SY0-701 Course - 2.4 Analyze Indicators of Malicious Activity. - PART B
SMT 1-3 Client Side Security
Network Security Model
Розділ 16: Основи мережної безпеки CCNA-1
HACKED! How a Buffer Overflow Exploit works, plus Code Red!
CompTIA Security+ SY0-701 Course - 2.3 Explain Various Types of Vulnerabilities
5.0 / 5 (0 votes)