From d5a62b6956ca367fe6724cf15d8294642c9a7377 Mon Sep 17 00:00:00 2001 From: n1nj4sec Date: Tue, 19 Jan 2016 20:10:44 +0100 Subject: [PATCH] update --- Installation.md | 10 ++++++++++ Writing-a-module.md | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 Installation.md create mode 100644 Writing-a-module.md diff --git a/Installation.md b/Installation.md new file mode 100644 index 0000000..edf39ba --- /dev/null +++ b/Installation.md @@ -0,0 +1,10 @@ +On kali linux 2.0 you just needs the following dependencies : +#Installation +```bash +pip install rpyc +pip install pefile +pip install pycrypto +pip install yaml +``` +##Troubleshooting +If you have some issues with rpyc while running the server on windows, take a look at issue #25, @deathfantasy made a fix diff --git a/Writing-a-module.md b/Writing-a-module.md new file mode 100644 index 0000000..dc5f2d1 --- /dev/null +++ b/Writing-a-module.md @@ -0,0 +1,47 @@ +#Writing a MsgBox module +First of all write the function/class you want to import on the remote client +in the example we create the file pupy/packages/windows/all/pupwinutils/msgbox.py +```python +import ctypes +import threading + +def MessageBox(text, title): + t=threading.Thread(target=ctypes.windll.user32.MessageBoxA, args=(None, text, title, 0)) + t.daemon=True + t.start() +``` +then, simply create a module to load our package and call the function remotely +```python +class MsgBoxPopup(PupyModule): + """ Pop up a custom message box """ + + def init_argparse(self): + self.arg_parser = PupyArgumentParser(prog="msgbox", description=self.__doc__) + self.arg_parser.add_argument('--title', help='msgbox title') + self.arg_parser.add_argument('text', help='text to print in the msgbox :)') + + @windows_only + def is_compatible(self): + pass + + def run(self, args): + self.client.load_package("pupwinutils.msgbox") + self.client.conn.modules['pupwinutils.msgbox'].MessageBox(args.text, args.title) + self.log("message box popped !") + +``` +and that's it, we have a fully functional module :) + +```bash +>> run msgbox -h +usage: msgbox [-h] [--title TITLE] text + +Pop up a custom message box + +positional arguments: + text text to print in the msgbox :) + + optional arguments: + -h, --help show this help message and exit + --title TITLE msgbox title +```