File size: 4,914 Bytes
c7f4bd0
 
1
2
3
{"nwo":"Arno0x\/DNSExfiltrator","sha":"8faa972408b0384416fffd5b4d42a7aa00526ca8","path":"dnsexfiltrator.py","language":"python","identifier":"progress","parameters":"(count, total, status='')","argument_list":"","return_statement":"","docstring":"Print a progress bar - https:\/\/gist.github.com\/vladignatyev\/06860ec2040cb497f0f3","docstring_summary":"Print a progress bar - https:\/\/gist.github.com\/vladignatyev\/06860ec2040cb497f0f3","docstring_tokens":["Print","a","progress","bar","-","https",":","\/\/","gist",".","github",".","com","\/","vladignatyev","\/","06860ec2040cb497f0f3"],"function":"def progress(count, total, status=''):\n\t\"\"\"\n\tPrint a progress bar - https:\/\/gist.github.com\/vladignatyev\/06860ec2040cb497f0f3\n\t\"\"\"\n\tbar_len = 60\n\tfilled_len = int(round(bar_len * count \/ float(total)))\n\n\tpercents = round(100.0 * count \/ float(total), 1)\n\tbar = '=' * filled_len + '-' * (bar_len - filled_len)\n\tsys.stdout.write('[%s] %s%s\\t%s\\t\\r' % (bar, percents, '%', status))\n\tsys.stdout.flush()","function_tokens":["def","progress","(","count",",","total",",","status","=","''",")",":","bar_len","=","60","filled_len","=","int","(","round","(","bar_len","*","count","\/","float","(","total",")",")",")","percents","=","round","(","100.0","*","count","\/","float","(","total",")",",","1",")","bar","=","'='","*","filled_len","+","'-'","*","(","bar_len","-","filled_len",")","sys",".","stdout",".","write","(","'[%s] %s%s\\t%s\\t\\r'","%","(","bar",",","percents",",","'%'",",","status",")",")","sys",".","stdout",".","flush","(",")"],"url":"https:\/\/github.com\/Arno0x\/DNSExfiltrator\/blob\/8faa972408b0384416fffd5b4d42a7aa00526ca8\/dnsexfiltrator.py#L43-L53"}
{"nwo":"Arno0x\/DNSExfiltrator","sha":"8faa972408b0384416fffd5b4d42a7aa00526ca8","path":"dnsexfiltrator.py","language":"python","identifier":"color","parameters":"(string, color=None)","argument_list":"","return_statement":"","docstring":"Author: HarmJ0y, borrowed from Empire\n    Change text color for the Linux terminal.","docstring_summary":"Author: HarmJ0y, borrowed from Empire\n    Change text color for the Linux terminal.","docstring_tokens":["Author",":","HarmJ0y","borrowed","from","Empire","Change","text","color","for","the","Linux","terminal","."],"function":"def color(string, color=None):\n    \"\"\"\n    Author: HarmJ0y, borrowed from Empire\n    Change text color for the Linux terminal.\n    \"\"\"\n    \n    attr = []\n    # bold\n    attr.append('1')\n    \n    if color:\n        if color.lower() == \"red\":\n            attr.append('31')\n        elif color.lower() == \"green\":\n            attr.append('32')\n        elif color.lower() == \"blue\":\n            attr.append('34')\n        return '\\x1b[%sm%s\\x1b[0m' % (';'.join(attr), string)\n\n    else:\n        if string.strip().startswith(\"[!]\"):\n            attr.append('31')\n            return '\\x1b[%sm%s\\x1b[0m' % (';'.join(attr), string)\n        elif string.strip().startswith(\"[+]\"):\n            attr.append('32')\n            return '\\x1b[%sm%s\\x1b[0m' % (';'.join(attr), string)\n        elif string.strip().startswith(\"[?]\"):\n            attr.append('33')\n            return '\\x1b[%sm%s\\x1b[0m' % (';'.join(attr), string)\n        elif string.strip().startswith(\"[*]\"):\n            attr.append('34')\n            return '\\x1b[%sm%s\\x1b[0m' % (';'.join(attr), string)\n        else:\n            return string","function_tokens":["def","color","(","string",",","color","=","None",")",":","attr","=","[","]","# bold","attr",".","append","(","'1'",")","if","color",":","if","color",".","lower","(",")","==","\"red\"",":","attr",".","append","(","'31'",")","elif","color",".","lower","(",")","==","\"green\"",":","attr",".","append","(","'32'",")","elif","color",".","lower","(",")","==","\"blue\"",":","attr",".","append","(","'34'",")","return","'\\x1b[%sm%s\\x1b[0m'","%","(","';'",".","join","(","attr",")",",","string",")","else",":","if","string",".","strip","(",")",".","startswith","(","\"[!]\"",")",":","attr",".","append","(","'31'",")","return","'\\x1b[%sm%s\\x1b[0m'","%","(","';'",".","join","(","attr",")",",","string",")","elif","string",".","strip","(",")",".","startswith","(","\"[+]\"",")",":","attr",".","append","(","'32'",")","return","'\\x1b[%sm%s\\x1b[0m'","%","(","';'",".","join","(","attr",")",",","string",")","elif","string",".","strip","(",")",".","startswith","(","\"[?]\"",")",":","attr",".","append","(","'33'",")","return","'\\x1b[%sm%s\\x1b[0m'","%","(","';'",".","join","(","attr",")",",","string",")","elif","string",".","strip","(",")",".","startswith","(","\"[*]\"",")",":","attr",".","append","(","'34'",")","return","'\\x1b[%sm%s\\x1b[0m'","%","(","';'",".","join","(","attr",")",",","string",")","else",":","return","string"],"url":"https:\/\/github.com\/Arno0x\/DNSExfiltrator\/blob\/8faa972408b0384416fffd5b4d42a7aa00526ca8\/dnsexfiltrator.py#L85-L118"}