fortify-source

How can I invoke buffer overflow?

无人久伴 提交于 2019-11-29 20:21:52
I got a homework assignment asking me to invoke a function without explicitly calling it, using buffer overflow. The code is basically this: #include <stdio.h> #include <stdlib.h> void g() { printf("now inside g()!\n"); } void f() { printf("now inside f()!\n"); // can only modify this section // cant call g(), maybe use g (pointer to function) } int main (int argc, char *argv[]) { f(); return 0; } Though I'm not sure how to proceed. I thought about changing the return address for the program counter so that it'll proceed directly to the address of g(), but I'm not sure how to access it. Anyway

Compilation fails with OpenMP on Mac OS X Lion (memcpy and SSE intrinsics)

眉间皱痕 提交于 2019-11-28 07:27:35
问题 I have stumbled upon the following problem. The below code snippet does not link on Mac OS X with any Xcode I tried (4.4, 4.5) #include <stdlib.h> #include <string.h> #include <emmintrin.h> int main(int argc, char *argv[]) { char *temp; #pragma omp parallel { __m128d v_a, v_ar; memcpy(temp, argv[0], 10); v_ar = _mm_shuffle_pd(v_a, v_a, _MM_SHUFFLE2 (0,1)); } } The code is just provided as an example and would segfault when you run it. The point is that it does not compile. The compilation is

What is a buffer overflow and how do I cause one?

一个人想着一个人 提交于 2019-11-27 03:24:29
I have heard about a buffer overflow and I would like to know how to cause one. Can someone show me a small buffer overflow example? New(And what they are used for?) David Dean A buffer overflow is basically when a crafted section (or buffer) of memory is written outside of its intended bounds. If an attacker can manage to make this happen from outside of a program it can cause security problems as it could potentially allow them to manipulate arbitrary memory locations, although many modern operating systems protect against the worst cases of this. While both reading and writing outside of

Buffer overflow works in gdb but not without it

风流意气都作罢 提交于 2019-11-26 21:23:22
I am on CentOS 6.4 32 bit and am trying to cause a buffer overflow in a program. Within GDB it works. Here is the output: [root@localhost bufferoverflow]# gdb stack GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-redhat-linux-gnu". For bug reporting

What is a buffer overflow and how do I cause one?

梦想的初衷 提交于 2019-11-26 10:31:35
问题 I have heard about a buffer overflow and I would like to know how to cause one. Can someone show me a small buffer overflow example? New(And what they are used for?) 回答1: A buffer overflow is basically when a crafted section (or buffer) of memory is written outside of its intended bounds. If an attacker can manage to make this happen from outside of a program it can cause security problems as it could potentially allow them to manipulate arbitrary memory locations, although many modern