0
I am developing a framework, in the directory where it is located there is a folder called "Plugins" inside it is the modules that the user can import inside the framework using the command "use", very similar to what Metasploit does, for this I use the library "imp". But each module is a module and in each one of them has different variables and within them specific values, so I wanted that when the user imports some module he can change the contents of some variable of the module using for example the set, very similar to the Metasploit.
from __future__ import print_function
import imp
import sys
def main():
while 1:
request = raw_input("O que você deseja: ")
if "use" in request:
srequest = request.split()
if (len(srequest) < 2 or len(srequest) > 3):
print("Requisição errada!")
else:
modulo = str(srequest[1])
modulo = modulo.replace("/", ".")
arquivo, caminho, descricao = imp.find_module(modulo, ['C:/Users/User/Desktop/TesteCriptografia/Plugins/'])
moduloImportado = imp.load_module(modulo, arquivo, caminho, descricao)
listadosmodulos = arquivo, caminho, descricao
##Era aqui que eu gostaria que o usuario escolhe a variavel que ele deseja trocar e qual valor decidir
if __name__ == '__main__':
main()