def encrypt(request): # Init of the view encrypt try: # Pool call response, repool = sendPool(request, 'encrypt') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter password password = request.POST.get('password') # Parameter text text = request.POST.get('text') # Execute, get result and show it result = ht.getModule('ht_rc4').encrypt( password=password, text=text ) if request.POST.get('is_async_encrypt', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_encrypt', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def get_mp3_exif(request): # Init of the view get_mp3_exif try: # Pool call response, repool = sendPool(request, 'get_mp3_exif') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: try: # Save file mp3_file filename_mp3_file, location_mp3_file, mp3_file = saveFileOutput( request.FILES['mp3_file'], 'metadata', 'forensic') except Exception as e: # If not param mp3_file if request.POST.get('is_async_get_mp3_exif', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e)) # Execute, get result and show it result = ht.getModule('ht_metadata').get_mp3_exif( mp3_file=mp3_file) if request.POST.get('is_async_get_mp3_exif', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_get_mp3_exif', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def queryShodan(request): # Init of the view queryShodan try: # Pool call response, repool = sendPool(request, 'queryShodan') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter category (Optional - Default ) category = request.POST.get('category', '') if not category: category = None # Parameter osintDays (Optional - Default 100) osintDays = request.POST.get('osintDays', 100) # Parameter shodan_api (Optional - Default None) shodan_api = request.POST.get('shodan_api', None) if not shodan_api: shodan_api = None # Execute, get result and show it result = ht.getModule('ht_shodan').queryShodan( category=category, osintDays=osintDays, shodan_api=shodan_api ) if request.POST.get('is_async_queryShodan', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_queryShodan', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def getSSLCerts(request): # Init of the view getSSLCerts try: # Pool call response, repool = sendPool(request, 'getSSLCerts') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter ip ip = request.POST.get('ip') # Parameter shodan_api (Optional - Default None) shodan_api = request.POST.get('shodan_api', None) if not shodan_api: shodan_api = None # Execute, get result and show it result = ht.getModule('ht_shodan').getSSLCerts( ip=ip, shodan_api=shodan_api ) if request.POST.get('is_async_getSSLCerts', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_getSSLCerts', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def searchFromConfig(request): # Init of the view searchFromConfig try: # Pool call response, repool = sendPool(request, 'searchFromConfig') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter search (Optional - Default ) search = request.POST.get('search', '') if not search: search = None # Parameter keyword (Optional - Default ) keyword = request.POST.get('keyword', '') if not keyword: keyword = None # Parameter shodan_api (Optional - Default None) shodan_api = request.POST.get('shodan_api', None) if not shodan_api: shodan_api = None # Execute, get result and show it result = ht.getModule('ht_shodan').searchFromConfig( search=search, keyword=keyword, shodan_api=shodan_api ) if request.POST.get('is_async_searchFromConfig', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_searchFromConfig', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def extractFile(request): # Init of the view extractFile try: # Pool call response, repool = sendPool(request, 'extractFile') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: try: # Save file zipPathName filename_zipPathName, location_zipPathName, zipPathName = saveFileOutput( request.FILES['zipPathName'], 'unzip', 'crackers') except Exception as e: # If not param zipPathName if request.POST.get('is_async_extractFile', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e)) # Parameter password (Optional - Default None) password = request.POST.get('password', None) if not password: password = None # Execute, get result and show it result = ht.getModule('ht_unzip').extractFile( zipPathName=zipPathName, password=password) if request.POST.get('is_async_extractFile', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_extractFile', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def getDevicePorts(request): # Init of the view getDevicePorts try: # Pool call response, repool = sendPool(request, 'getDevicePorts') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter ip ip = request.POST.get('ip') # Parameter tcp (Optional - Default True) tcp = request.POST.get('tcp', True) # Parameter udp (Optional - Default False) udp = request.POST.get('udp', False) if not udp: udp = None # Execute, get result and show it result = ht.getModule('ht_nmap').getDevicePorts( ip=ip, tcp=tcp, udp=udp ) if request.POST.get('is_async_getDevicePorts', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_getDevicePorts', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def getAPI(request): # Init of the view getAPI try: # Pool call response, repool = sendPool(request, 'getAPI') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter vulndb_api (Optional - Default None) vulndb_api = request.POST.get('vulndb_api', None) if not vulndb_api: vulndb_api = None # Parameter session_id (Optional - Default None) session_id = request.POST.get('session_id', None) if not session_id: session_id = None # Execute, get result and show it result = ht.getModule('ht_vulndb').getAPI(vulndb_api=vulndb_api, session_id=session_id) if request.POST.get('is_async_getAPI', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_getAPI', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def getImports(request): # Init of the view getImports try: # Pool call response, repool = sendPool(request, 'getImports') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: try: # Save file filemon filename_filemon, location_filemon, filemon = saveFileOutput( request.FILES['filemon'], 'radare2', 'reversing') except Exception as e: # If not param filemon if request.POST.get('is_async_getImports', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e)) # Execute, get result and show it result = ht.getModule('ht_radare2').getImports(filemon=filemon) if request.POST.get('is_async_getImports', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_getImports', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def grabPortBanner(request): # Init of the view grabPortBanner try: # Pool call response, repool = sendPool(request, 'grabPortBanner') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter ip ip = request.POST.get('ip') # Parameter port port = request.POST.get('port') # Execute, get result and show it result = ht.getModule('ht_bannergrabber').grabPortBanner(ip=ip, port=port) if request.POST.get('is_async_grabPortBanner', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_grabPortBanner', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def search(request): # Init of the view search try: # Pool call response, repool = sendPool(request, 'search') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter urls urls = request.POST.get('urls') # Parameter gsb_api (Optional - Default None) gsb_api = request.POST.get('gsb_api', None) if not gsb_api: gsb_api = None # Execute, get result and show it result = ht.getModule('ht_phising').search(urls=urls, gsb_api=gsb_api) if request.POST.get('is_async_search', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_search', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def hasDevicePortOpened(request): # Init of the view hasDevicePortOpened try: # Pool call response, repool = sendPool(request, 'hasDevicePortOpened') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter ip ip = request.POST.get('ip') # Parameter port port = request.POST.get('port') # Execute, get result and show it result = ht.getModule('ht_nmap').hasDevicePortOpened( ip=ip, port=port ) if request.POST.get('is_async_hasDevicePortOpened', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_hasDevicePortOpened', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def decrypt(request): # Init of the view decrypt try: # Pool call response, repool = sendPool(request, 'decrypt') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter public_key public_key = tuple(request.POST.get('public_key')) # Parameter ciphertext ciphertext = request.POST.get('ciphertext') # Execute, get result and show it result = ht.getModule('ht_rsa').decrypt(public_key=public_key, ciphertext=ciphertext) if request.POST.get('is_async_decrypt', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_decrypt', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def decodeFromComplexMap(request): # Init of the view decodeFromComplexMap try: # Pool call response, repool = sendPool(request, 'decodeFromComplexMap') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter password password = request.POST.get('password') # Parameter ciphertext ciphertext = request.POST.get('ciphertext') # Parameter complexMap complexMap = request.POST.get('complexMap') # Execute, get result and show it result = ht.getModule('ht_rsa').decodeFromComplexMap( password=password, ciphertext=ciphertext, complexMap=complexMap) if request.POST.get('is_async_decodeFromComplexMap', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_decodeFromComplexMap', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def executeScan(request): # Init of the view executeScan try: # Pool call response, repool = sendPool(request, 'executeScan') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter ip ip = request.POST.get('ip') # Parameter params (Optional - Default ) params = str(request.POST.get('params', '')) if not params: params = None # Execute, get result and show it result = ht.getModule('ht_nmap').executeScan( ip=ip, params=params ) if request.POST.get('is_async_executeScan', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_executeScan', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def set_pdf_field_value(request): # Init of the view set_pdf_field_value try: # Pool call response, repool = sendPool(request, 'set_pdf_field_value') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: try: # Save file pdf_file filename_pdf_file, location_pdf_file, pdf_file = saveFileOutput( request.FILES['pdf_file'], 'metadata', 'forensic') except Exception as e: # If not param pdf_file if request.POST.get('is_async_set_pdf_field_value', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e)) # Parameter field field = request.POST.get('field') # Parameter fieldValue fieldValue = request.POST.get('fieldValue') # Execute, get result and show it result = ht.getModule('ht_metadata').set_pdf_field_value( pdf_file=pdf_file, field=field, fieldValue=fieldValue) if request.POST.get('is_async_set_pdf_field_value', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_set_pdf_field_value', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def get_timeline(request): # Init of the view get_timeline try: # Pool call response, repool = sendPool(request, 'get_timeline') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter username username = request.POST.get('username') # Parameter limit (Optional - Default 1000) limit = int(request.POST.get('limit', 1000)) # Parameter interval (Optional - Default 0) interval = int(request.POST.get('interval', 0)) # Execute, get result and show it result = ht.getModule('ht_twitter').get_timeline( username=username, limit=limit, interval=interval ) if request.POST.get('is_async_get_timeline', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_get_timeline', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def connect(request): # Init of the view connect try: # Pool call response, repool = sendPool(request, 'connect') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter username username = request.POST.get('username') # Parameter password password = request.POST.get('password') # Execute, get result and show it result = ht.getModule('ht_qualys').connect(username=username, password=password) if request.POST.get('is_async_connect', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_connect', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def isBadFileHash(request): # Init of the view isBadFileHash try: # Pool call response, repool = sendPool(request, 'isBadFileHash') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: try: # Save file fileHash filename_fileHash, location_fileHash, fileHash = saveFileOutput( request.FILES['fileHash'], 'virustotal', 'forensic') except Exception as e: # If not param fileHash if request.POST.get('is_async_isBadFileHash', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e)) # Execute, get result and show it result = ht.getModule('ht_virustotal').isBadFileHash( fileHash=fileHash) if request.POST.get('is_async_isBadFileHash', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_isBadFileHash', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def getIPListfromServices(request): # Init of the view getIPListfromServices try: # Pool call response, repool = sendPool(request, 'getIPListfromServices') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter serviceName serviceName = request.POST.get('serviceName') # Parameter shodan_api (Optional - Default None) shodan_api = request.POST.get('shodan_api', None) if not shodan_api: shodan_api = None fromMap = request.POST.get('fromMap', None) if not fromMap: fromMap = None # Execute, get result and show it result = ht.getModule('ht_shodan').getIPListfromServices( serviceName=serviceName, shodan_api=shodan_api ) if request.POST.get('is_async_getIPListfromServices', False): if fromMap: return JsonResponse({ "data" : result }) return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_getIPListfromServices', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def encode(request): # Init of the view encode try: # Pool call response, repool = sendPool(request, 'encode') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter key key = request.POST.get('key') # Parameter plaintext plaintext = request.POST.get('plaintext') # Execute, get result and show it result = ht.getModule('ht_rsa').encode(key=key, plaintext=plaintext) if request.POST.get('is_async_encode', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_encode', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def createStub(request): # Init of the view createStub try: # Pool call response, repool = sendPool(request, 'createStub') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter crypto_data_hex crypto_data_hex = request.POST.get('crypto_data_hex') # Parameter public_key public_key = request.POST.get('public_key') try: # Save file drop_file_name filename_drop_file_name, location_drop_file_name, drop_file_name = saveFileOutput( request.FILES['drop_file_name'], 'crypter', 'av_evasion') except Exception as e: # If not param drop_file_name if request.POST.get('is_async_createStub', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e)) # Parameter save_name save_name = request.POST.get('save_name') # Parameter is_iterating (Optional - Default False) is_iterating = request.POST.get('is_iterating', False) if not is_iterating: is_iterating = None # Parameter is_last (Optional - Default False) is_last = request.POST.get('is_last', False) if not is_last: is_last = None # Parameter convert (Optional - Default False) convert = request.POST.get('convert', False) if not convert: convert = None # Execute, get result and show it result = ht.getModule('ht_crypter').createStub( crypto_data_hex=crypto_data_hex, public_key=public_key, drop_file_name=drop_file_name, save_name=save_name, is_iterating=is_iterating, is_last=is_last, convert=convert) if request.POST.get('is_async_createStub', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_createStub', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def set_mp3_metadata(request): # Init of the view set_mp3_metadata try: # Pool call response, repool = sendPool(request, 'set_mp3_metadata') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: try: # Save file mp3_file filename_mp3_file, location_mp3_file, mp3_file = saveFileOutput( request.FILES['mp3_file'], 'metadata', 'forensic') except Exception as e: # If not param mp3_file if request.POST.get('is_async_set_mp3_metadata', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e)) # Parameter title (Optional - Default None) title = request.POST.get('title', None) if not title: title = None # Parameter artist (Optional - Default None) artist = request.POST.get('artist', None) if not artist: artist = None # Parameter album (Optional - Default None) album = request.POST.get('album', None) if not album: album = None # Parameter album_artist (Optional - Default None) album_artist = request.POST.get('album_artist', None) if not album_artist: album_artist = None # Parameter track_num (Optional - Default None) track_num = request.POST.get('track_num', None) if not track_num: track_num = None # Execute, get result and show it result = ht.getModule('ht_metadata').set_mp3_metadata( mp3_file=mp3_file, title=title, artist=artist, album=album, album_artist=album_artist, track_num=track_num) if request.POST.get('is_async_set_mp3_metadata', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_set_mp3_metadata', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def searchTweets(request): # Init of the view searchTweets try: # Pool call response, repool = sendPool(request, 'searchTweets') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter username (Optional - Default ) username = str(request.POST.get('username', '')) if not username: username = None # Parameter since (Optional - Default ) since = str(request.POST.get('since', '')) if not since: since = None # Parameter until (Optional - Default ) until = str(request.POST.get('until', '')) if not until: until = None # Parameter query (Optional - Default ) query = str(request.POST.get('query', '')) if not query: query = None # Parameter limit (Optional - Default 1000) limit = int(request.POST.get('limit', 1000)) # Parameter verified (Optional - Default False) verified = int(request.POST.get('verified', False)) # Parameter proxy (Optional - Default ) proxy = str(request.POST.get('proxy', '')) if not proxy: proxy = None # Parameter interval (Optional - Default 0) interval = int(request.POST.get('interval', 0)) # Execute, get result and show it result = ht.getModule('ht_twitter').searchTweets( username=username, since=since, until=until, query=query, limit=limit, verified=verified, proxy=proxy, interval=interval ) if request.POST.get('is_async_searchTweets', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_searchTweets', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def createShortcut(request): # Init of the view createShortcut try: # Pool call response, repool = sendPool(request, 'createShortcut') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Parameter url url = request.POST.get('url') # Parameter fakeUrl fakeUrl = request.POST.get('fakeUrl') # Parameter fakeText fakeText = request.POST.get('fakeText') # Parameter domainShortener (Optional - Default tinyurl) domainShortener = str( request.POST.get('domainShortener', 'tinyurl')) # Parameter api_key (Optional - Default None) api_key = request.POST.get('api_key', None) if not api_key: api_key = None # Parameter user_id (Optional - Default None) user_id = request.POST.get('user_id', None) if not user_id: user_id = None # Execute, get result and show it result = ht.getModule('ht_urlshortener').createShortcut( url=url, fakeUrl=fakeUrl, fakeText=fakeText, domainShortener=domainShortener, api_key=api_key, user_id=user_id) if request.POST.get('is_async_createShortcut', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_createShortcut', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def crackZip(request): # Init of the view crackZip try: # Pool call response, repool = sendPool(request, 'crackZip') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: try: # Save file zipPathName filename_zipPathName, location_zipPathName, zipPathName = saveFileOutput(request.FILES['zipPathName'], 'bruteforce', 'crackers') except Exception as e: # If not param zipPathName if request.POST.get('is_async_crackZip', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e)) # Parameter unzipper (Optional - Default None) unzipper = request.POST.get('unzipper', None) if not unzipper: unzipper = None # Parameter alphabet (Optional - Default lalpha) alphabet = request.POST.get('alphabet', 'lalpha') # Parameter password_length (Optional - Default 4) password_length = request.POST.get('password_length', 4) # Parameter password_pattern (Optional - Default None) password_pattern = request.POST.get('password_pattern', None) if not password_pattern: password_pattern = None # Parameter log (Optional - Default False) log = request.POST.get('log', False) if not log: log = None # Execute, get result and show it result = ht.getModule('ht_bruteforce').crackZip( zipPathName=zipPathName, unzipper=unzipper, alphabet=alphabet, password_length=password_length, password_pattern=password_pattern, log=log ) if request.POST.get('is_async_crackZip', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_crackZip', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def getShortDomains(request): # Init of the view getShortDomains try: # Pool call response, repool = sendPool(request, 'getShortDomains') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Execute, get result and show it result = ht.getModule('ht_urlshortener').getShortDomains() if request.POST.get('is_async_getShortDomains', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_getShortDomains', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def readFileToType(request): # Init of the view readFileToType try: # Pool call response, repool = sendPool(request, 'readFileToType') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: try: # Save file filename filename_filename, location_filename, filename = saveFileOutput( request.FILES['filename'], 'parser', 'files') except Exception as e: # If not param filename if request.POST.get('is_async_readFileToType', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e)) # Parameter typeToExport typeToExport = request.POST.get('typeToExport') # Parameter typeOf (Optional - Default None) typeOf = request.POST.get('typeOf', None) if not typeOf: typeOf = None # Parameter csv_headers (Optional - Default False) csv_headers = request.POST.get('csv_headers', False) # Execute, get result and show it result = ht.getModule('ht_parser').readFileToType( filename=filename, typeToExport=typeToExport, typeOf=typeOf, csv_headers=csv_headers) if request.POST.get('is_async_readFileToType', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_readFileToType', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))
def get_posts(request): # Init of the view get_posts try: # Pool call response, repool = sendPool(request, 'get_posts') if response or repool: if repool: return HttpResponse(response) return JsonResponse({ "data" : str(response) }) else: # Parameter account (Optional - Default None) account = request.POST.get('account', None) if not account: account = None # Parameter group (Optional - Default None) group = request.POST.get('group', None) if not group: group = None # Parameter pages (Optional - Default 10) pages = int(request.POST.get('pages', 10)) # Parameter timeout (Optional - Default 5) timeout = int(request.POST.get('timeout', 5)) # Parameter sleep (Optional - Default 0) sleep = int(request.POST.get('sleep', 0)) # Parameter credentials (Optional - Default None) credentials = request.POST.get('credentials', None) if not credentials: credentials = None # Execute, get result and show it result = ht.getModule('ht_facebook').get_posts( account=account, group=group, pages=pages, timeout=timeout, sleep=sleep, credentials=credentials ) if request.POST.get('is_async_get_posts', False): return JsonResponse({ "data" : returnAsModal(result) }) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_get_posts', False): return JsonResponse({ "data" : str(e) }) return renderMainPanel(request=request, popup_text=str(e))
def disconnect(request): # Init of the view disconnect try: # Pool call response, repool = sendPool(request, 'disconnect') if response or repool: if repool: return HttpResponse(response) return JsonResponse({"data": str(response)}) else: # Execute, get result and show it result = ht.getModule('ht_qualys').disconnect() if request.POST.get('is_async_disconnect', False): return JsonResponse({"data": returnAsModal(result)}) return renderMainPanel(request=request, popup_text=result) except Exception as e: if request.POST.get('is_async_disconnect', False): return JsonResponse({"data": str(e)}) return renderMainPanel(request=request, popup_text=str(e))