def mutate(self,
               info,
               host='pastebin.com',
               port=443,
               path='/',
               scheme="http"):
        url = security.strip_dangerous_characters(
            f"{scheme}://{host}:{port}{path}")
        cmd = helpers.run_cmd(f'curl --insecure {url}')

        owner = Owner.query.filter_by(name='DVGAUser').first()
        Paste.create_paste(title='Imported Paste from URL - {}'.format(
            helpers.generate_uuid()),
                           content=cmd,
                           public=False,
                           burn=False,
                           owner_id=owner.id,
                           owner=owner,
                           ip_addr=request.remote_addr,
                           user_agent=request.headers.get('User-Agent', ''))

        Audit.create_audit_entry(info)

        return ImportPaste(result=cmd)
Example #2
0
 def resolve_system_health(self, info):
     return 'System Load: {}'.format(
         helpers.run_cmd("uptime | awk -F'averages: ' '{print $2}'"))
 def resolve_system_health(self, info):
     Audit.create_audit_entry(info)
     return 'System Load: {}'.format(
         helpers.run_cmd("uptime | awk '{print $10, $11, $12}'"))
 def resolve_system_health(self, info):
     Audit.create_audit_entry(
         gqloperation=helpers.get_opname(info.operation))
     return 'System Load: {}'.format(
         helpers.run_cmd("uptime | awk '{print $10, $11, $12}'"))