vancaho / avalanche

Automatically exported from code.google.com/p/avalanche
2 stars 0 forks source link

the tool doesn't expand input file size if necessary #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Test environment:
Ubuntu 10.04 32 bit (2.6.32-33-generic i686 SMP) in Virtualbox OSE 4.0.4, 2 
core of i5-2500, 768 mb of RAM
Host OS: ubuntu 11.04 64 bit (2.6.38-10-generic x86_64 SMP)
compiler: gcc version 4.4.3

=====================================
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

#define BUF_SIZE        128

int main(int argc, char** argv)
{
        uint8_t input[BUF_SIZE];
        const uint8_t expected[BUF_SIZE]="verylongexpectedbadstring123456789abcdefghijklmnopqrstuvwxyz____";
        uint16_t dest;
        int  fd1 = open(argv[1], O_RDONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);

        dest=(argv[2])?atoi(argv[2]):32;

        if(dest>BUF_SIZE)
                dest=BUF_SIZE;

        read(fd1, input, dest);

        if(!memcmp(input,expected,dest))
                abort();

        return 0;
}
======================================

in2 - input zero-filled file
Compare:
ioex@ioex-desktop:~/workspace/avalanche/tests$ stat -c %s in2
28
ioex@ioex-desktop:~/workspace/avalanche/tests$ ~/avalanche-0.5/bin/avalanche 
--filename=./in2 ./test5 ./in2 32
Starting iteration 0
...
Starting iteration 13

Exploits report:

ioex@ioex-desktop:~/workspace/avalanche/tests$ stat -c %s in
4097
ioex@ioex-desktop:~/workspace/avalanche/tests$ ~/avalanche-0.5/bin/avalanche 
--filename=./in ./test5 ./in 32
Starting iteration 0
Starting iteration 1
...
Starting iteration 31
Crash detected.
No stack trace is available.
Dumping an exploit to file exploit_0_0
Starting iteration 32

Exploits report:
chunk 0: exploit_0_0 - No stack trace available

avalanche version: 0.4,0.5

Original issue reported on code.google.com by xeioexception on 22 Aug 2011 at 10:44

GoogleCodeExporter commented 8 years ago
Hello!

Unfortunately, changing lengths of tainted input files is impossible with 
current method of tainted data tracing used in Avalanche.

Original comment by m.k.erma...@gmail.com on 22 Aug 2011 at 12:59