operatorequals / covertutils

A framework for Backdoor development!
http://covertutils.readthedocs.io
437 stars 69 forks source link

A StegoOrchestrator example wanted #1

Closed dalifooder closed 7 years ago

dalifooder commented 7 years ago

The document of StegoInjector and StegoOrchestrator is puzzles me. Can you give a example?

operatorequals commented 7 years ago

Hello! Some documentation has been added. https://covertutils.readthedocs.io/en/latest/covertutils.orchestration.html#module-covertutils.orchestration.stegoorchestrator

It is not complete but it may help. I do not have enough time to properly document the whole project yet, but it is in the TODOs to make a decent rtfd page!

An example will be ready as a new project implementing TCP stego shell. Probably in a new repo.

dalifooder commented 7 years ago

I think this project really cool if you can implement all the features as you said in README. Looking forward to seeing your progress.

operatorequals commented 7 years ago

Thanks a lot! Every feature mentioned is implemented. Unfortunately they aren't documented yet. For the time being you can sneak on the source code for the explanation of several things. I am also preparing a blog post at Securosophy (my blog) fully explaining the internals.

dalifooder commented 7 years ago

I have read the source code and your newest blog. Your code is elegant and readable. NICE! But it makes me even more confused, the stream concept in your blog, is A sequence of such tags is called a Stream., the template concept in the documentation, is packet_template_name = '''Hex of the template packet with Tag Letters among the valid bytes'''. How can you place them in the same one list and called 'streams'? I print it out and find this

  super( StegoOrchestrator, self ).__init__( passphrase, tag_length, cycling_algorithm, streams, reverse )
  self.__simple_orchestrators = {}
  print 'stego_orch 54', streams
  for index, template in enumerate( streams ) :
      print 'stego_orch 55',index, template

The output: stego_orch 54 ['control', 'ip_tcp_syn'] stego_orch 55 0 control stego_orch 55 1 ip_tcp_syn

In my comprehension, the stream is a more abstract concept, the template is a definite concept, I can't understand why you code like this.

SO, can you release more detailed documentation ?

operatorequals commented 7 years ago

Hello. At this very moment I am working on Bug Fixing and documentation of Stego* classes.

You are absolutely right. The use of streams with the StegoOrchestrator class is redundant at best. It worked as a PoC, when I first wrote the class, and I moved on. It has to be changed. Really thank you for figuring this out for me! You motivate me.

If you have any idea on how to keep the Orchestrator's readyMessage() signature the same in StegoOrchestrator and make the template - stream relation 1-many, consider making a pull request. I am gonna fix this (it has to be changed anyway, for the shell implementation I want to implement), but (I won't lie) it will take some time, as I am currently working on Component Documentation.

Thanks again

operatorequals commented 7 years ago

Check my last commit on the Stream-Template subject. https://github.com/operatorequals/covertutils/commit/ce4e25f85c6d264324794ff7a10b190cb4c61dde

dalifooder commented 7 years ago

I tried to build a runable StegoOrchestrator example as those pairs in the examples folder but failed. I found It's difficult to play with RAW packet without stream control, How are you going to solve the problem?

operatorequals commented 7 years ago

Hello. With the current design it is not that easy to refactor StegoOrchestrator. Work is being done toward the stream-template logical split though. I created the AdHocChunker class (subpackage: covertutils.datamanipulation) to use instead of the standard Chunker class. In case that you are trying to solve that problem yourself, I highly suggest to use the AdHocChunker.

Thank you for your interest!

operatorequals commented 7 years ago

A full fledged example of the StegoOrchestrator class is available at http://covertutils.readthedocs.io/en/latest/prog_examples.html#advanced-http-reverse-shell