Code Monkey home page Code Monkey logo

ioctlbf's Issues

Why was a proper use guide not shown?

I'm confused because the way the tool is shown to run is like "hey simple just -d and name the device" But its not, you can't just name any simple directory and its going to find it. Clearly there is a method to "\." and I've been trying to figure it out for almost 3 hours on how to run this binary. It's super frustrating.

Why cont never change in src/ioctl_bf.c from line 527 to 629?

           cont = TRUE;
	if(SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlHandler, TRUE)) {
		// Fill the buffer with data from FuzzConstants (1 DWORD after 1)
		memset(bufInput, 0x00, MAX_BUFSIZE);
		for(i=0; cont && i<posListIoctls->maxBufferLength; i=i+4) {
		
			printf("Fuzzing DWORD %d/%d\n", 
				   i/4+1, posListIoctls->maxBufferLength/4);
			
			// Fill the whole buffer with random data...
			for(j=0; cont && j<posListIoctls->maxBufferLength; j++) {
				bufInput[j] = (BYTE)getrand(0x00, 0xff);
			}
			
			// ...and put a DWORD from FuzzConstants at the i_th position
			for(j=0; cont && j<(sizeof(FuzzConstants)/4); j++) {
				fuzzData = FuzzConstants[j];
				
				/*
				printf("Fuzzing DWORD %d/%d with 0x%08x (%d/%d)\n", 
					   i/4+1, posListIoctls->maxBufferLength/4, 
					   fuzzData, j+1, sizeof(FuzzConstants)/4);
				*/
												
				// Choose a random element into FuzzConstants
				bufInput[i]   = fuzzData & 0x000000ff;
				bufInput[i+1] = (fuzzData & 0x0000ff00) >> 8;
				bufInput[i+2] = (fuzzData & 0x00ff0000) >> 16;
				bufInput[i+3] = (fuzzData & 0xff000000) >> 24;
				
				if(!quietflg) {
					Hexdump(bufInput, posListIoctls->maxBufferLength);
					printf("Fuzzing DWORD %d/%d with 0x%08x (%d/%d)\n", 
					       i/4+1, posListIoctls->maxBufferLength/4, 
					       fuzzData, j+1, sizeof(FuzzConstants)/4);
					printf("Input buffer: %d (0x%x) bytes \n", 
					                     posListIoctls->maxBufferLength,
						                 posListIoctls->maxBufferLength);
				}
				
				status = DeviceIoControl(deviceHandle, 
										 posListIoctls->IOCTL, 
										 &bufInput, 
										 posListIoctls->maxBufferLength,
										 &bufOutput, 
										 posListIoctls->maxBufferLength, 
										 &nbBytes, 
										 NULL);
										 
				if(!quietflg) {
					if(status == 0)
						printf("Error %d: %s\n\n", GetLastError(), 
						                 errorCode2String(GetLastError()));
					printf("-------------------------------------------------------------------\n\n");
				}
				
				Sleep(SLEEP_TIME);
			}
		}
		
		printf("Filling the whole buffer with predetermined DWORDs\n");
		while(cont) {
			// Choose a random length for the buffer
			randomLength = getrand(posListIoctls->minBufferLength, 
			                       posListIoctls->maxBufferLength);
			
			// Fill the whole buffer with data from FuzzConstants
			memset(bufInput, 0x00, MAX_BUFSIZE);
			for(i=0; i<randomLength; i=i+4) {
				fuzzData = FuzzConstants[getrand(0, (sizeof(FuzzConstants)/4)-1)];
													
				// Choose a random element into FuzzConstants
				bufInput[i]   = fuzzData & 0x000000ff;
				bufInput[i+1] = (fuzzData & 0x0000ff00) >> 8;
				bufInput[i+2] = (fuzzData & 0x00ff0000) >> 16;
				bufInput[i+3] = (fuzzData & 0xff000000) >> 24;
			}
			
			if(!quietflg) {
				Hexdump(bufInput, randomLength);
				printf("Filling the whole buffer with predetermined DWORDs\n");
				printf("Input buffer: %d (0x%x) bytes \n", randomLength,
														   randomLength);
			}

			status = DeviceIoControl(deviceHandle, 
									 posListIoctls->IOCTL, 
									 &bufInput, 
									 randomLength,
									 &bufOutput, 
									 randomLength, 
									 &nbBytes, 
									 NULL);
									 
			if(!quietflg) {
				if(status == 0)
					printf("Error %d: %s\n\n", GetLastError(), errorCode2String(GetLastError()));
				printf("-------------------------------------------------------------------\n\n");
			}
									 
			Sleep(SLEEP_TIME);	
		}

Since cont never change in this piece of code,how could while(cont) break out?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.