From e3f3606f1880944fe2f4dd801f99025150a6b989 Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Thu, 4 Oct 2018 22:56:57 +0300 Subject: [PATCH] logging should be used instead of stdout_to_file scriptlet --- pupy/scriptlets/stdout_to_file/__init__.py | 0 pupy/scriptlets/stdout_to_file/generator.py | 37 --------------------- 2 files changed, 37 deletions(-) delete mode 100644 pupy/scriptlets/stdout_to_file/__init__.py delete mode 100644 pupy/scriptlets/stdout_to_file/generator.py diff --git a/pupy/scriptlets/stdout_to_file/__init__.py b/pupy/scriptlets/stdout_to_file/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/pupy/scriptlets/stdout_to_file/generator.py b/pupy/scriptlets/stdout_to_file/generator.py deleted file mode 100644 index 5661dbaa..00000000 --- a/pupy/scriptlets/stdout_to_file/generator.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) -# Pupy is under the BSD 3-Clause license. see the LICENSE file at the root of the project for the detailed licence terms -import textwrap -from scriptlets import Scriptlet - -class ScriptletGenerator(Scriptlet): - """ redirect stdout to a file to debug windows payloads """ - - dependencies=[] - arguments={ - 'path': 'path to debug file. default %TEMP%\\pupy.log' - } - - def __init__(self, path="%TEMP%\\pupy.log"): - self.path=path - - def generate(self, os): - return textwrap.dedent(""" - import sys, os.path - class RedirToFile(object): - def __init__(self, path): - self.path=path - softspace = 0 - def read(self): - pass - def write(self, text): - with open(self.path, 'a') as f: - f.write(text) - def flush(self): - pass - path=os.path.expandvars({}) - sys.stdout = RedirToFile(path) - sys.stderr = RedirToFile(path) - - """.format(repr(self.path)))