Giter Club home page Giter Club logo

stresser's People

Contributors

avivshabtay avatar eladshriki avatar orpinhas20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stresser's Issues

Convert usage of `SetConsoleCtrlHandler` to support RAII

Problem: If the main thread finish it's work but the application doesn't close yet (because other thread still running) it is possible to press CTRL+C and the "installed" handler keep on handling the interrupt.

It's better to remove the CTRL handler when the main thread as finish it's work.

if (!SetConsoleCtrlHandler(consoleHandler, TRUE))

Uninstall process safety

Corresponding to ProcessArtifact:

  1. Check if the process still exists (by it's PID) after signaling policy-changed event, then try to close it.
  2. Accept number of tries & sleep amount - try to do the action, then wait and repeat until the action is preformed or you have reached the number of tries.

Break ETW event handler to individual components

EtwManager register OnEventRecord callback function for all the exists EtwEventType.
We should change to logic, so this function will trigger other object which will handle specific event by the event type.
Possible solution whould be like:

class EtwManager
{
public:
	// ....
	
private:
	// Key = EventType
	std::map<EventType, IEtwEventHandler*> m_handlers;
}

EtwManager:registerEventHandler(IEtwEventHandler handler, EventType type)
{
	// Check if the handler already exists, throw....
	
	// Otherwise, add the new handler:
	this->handlers.insert({ type, handler });
}

EtwManager::OnEventRecord(PEVENT_RECORD record)
{
	// extract event type (by opcode)
	// int opcode = .....
	
	switch(opcode)
	{
		case EventType::Registry:
		{
			try
			{
				const IEtwEventHandler* handler = this->handlers.get[EventType::Registry];
				
				// Verify handler, otherwise throw...
				
				handler->onEvent(record);
			}
			catch(// Case key doesn't exsits)
			{
				
			}
		}
		
		case EventType::IoFile: // other bulshit
		{
			
		}
	}
}

Add wait(timeout) for WindowsEvent

WindowsEvent used for managing Win32 Event Object.
Common use case is to wait on the event object to be signaled.
Use case example from the main function:

WaitForSingleObject(g_shutdownEvent.get(), INFINITE);

Need to add 2 useful methods:

  • wait(timeout) - call to WaitForSingleObject with given value
  • waitInfintly() - call to previous method with timeout=INFINITE

Create interface for entities conversion

Every entity in our application need to support serialization from Json and to Json for the HTTP operations preformed on the entity data.
Create interface named IJsonConverted (or other meaningful name) and make sure to implement it for all the enitities in the Stresser project (Endpoint, Policy, Rule, Event).
The inerface should contains the method:

template<class Entity>
static Json convertFromEntity(Entity entity);

template<class Entity>
static Entity convertFromJason(Json data);

Get computer ip

image
Create function that return the ip that connected to the internet

Add logger for the application

Many logs using DEBUG_PRINT macro to print logs only in Debug mode.

Should write these logs to log file in both cases of release and debug,
with adding more trace data (class/function that print the data, etc).

The logger should:

  • Create StresserLogger class / wrapped logger
  • Add methods to write log to logfile
  • Start in the initialization of the application as Singleton
  • Create local file in TEMP directory
  • Support logging in Stresser

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.