def ffuf_func(url): url = url if not url.endswith('/') else url[:-1] _return = [] ffuf_run = subprocess.Popen( f'$(pwd)/ffuf -w dicc.txt -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" -u {url}/FUZZ', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8") ffuf_run.wait(timeout=40) try: outs, err = ffuf_run.communicate() _ = outs.split('\n') for i in _: if i: _return.append( ("{}{}".format(url, i.split(' ')[0].replace("\x1b[2K", "")), _split("[|:|,|]", i)[1], _split("[|:|,|]", i)[3])) except Exception as e: outs, errs = ffuf_run.communicate() _ = outs.split('\n') for i in _: if i: _tmp_data = _split("[|:|,|]", i) if len(_tmp_data) < 3: continue _return.append( ("{}{}".format(url, i.split(' ')[0].replace("\x1b[2K", "")), _tmp_data[1], _tmp_data[3])) finally: ffuf_run.kill() return _return
def getParticular(particular): ''' Returns customer address by splitting to set in table ''' particularItem = _split('[^a-zA-Z0-9\.\,]', particular) formattedParticular = [] splitted_customer = [] for word in particularItem: if len(word) > 42: for i in range(0, len(word), 42): splitted_customer.append(word[i:i + 42]) else: splitted_customer.append(word) particularItem = splitted_customer tempStr = '' count = 0 for cust in particularItem: if isinstance(cust, str) and count + len(cust) < 42: tempStr += '{} '.format(cust) count += len(cust) + 1 else: formattedParticular.append(tempStr) tempStr = '{} '.format(cust) count = len(tempStr) + 1 if len(formattedParticular) > 1 and count + len(''._join( formattedParticular[-1])) < 42: formattedParticular[-1] += tempStr else: formattedParticular.append(tempStr) return formattedParticular
def _str_clean( *strings ): fin = [] for s in strings: tmpS = '' for sub in _split( _REGEX_NON_ALNUM, s): tmpS = tmpS + sub fin.append(tmpS) return fin
def _str_clean(*strings): fin = [] for s in strings: tmpS = '' for sub in _split(_REGEX_NON_ALNUM, s): tmpS = tmpS + sub fin.append(tmpS) return fin
def _str_clean(*strings): fin = [] for s in strings: tmp = '' if not _match(_REGEX_LETTER, s): s = 'X_' + s for sub in _split(_REGEX_NON_ALNUM, s): tmp += sub fin.append(tmp) return fin
def parse_nmap_og(file): _return = {} for i in file: try: ip = i.split(':')[1].split('(')[0].strip() _list = [(o.lstrip(', ').split('/')[0], o.split('/')[4]) for o in _split('///', i.split(':')[2])[:-1] if 'close' not in o] _return.update({ip: _list}) except Exception as e: pass return _return
def getCustomerAddress(customerAddress): ''' Returns customer address by splitting to set in table ''' count = 0 formattedAddress = [] sample_str = '' for cust in _split('[^a-zA-Z0-9\.\,]', customerAddress): if isinstance(cust, (str, unicode)) and count + len(cust) < 43: sample_str += '{} '.format(cust) count += len(cust) else: formattedAddress.append(sample_str) sample_str = '{} '.format(cust) count = len(sample_str) if len(formattedAddress) > 1 and count + len(formattedAddress[-1]) < 43: formattedAddress[-1] += sample_str else: formattedAddress.append(sample_str) return formattedAddress
_cfg = _CFG() # AlterImages _sct = 'AlterImages' ALTER_FTYPES = _cfg.getlines(_sct, 'file_types') # ConvertVideo _sct = 'ConvertVideo' CON_WD = max(40, _cfg.getint(_sct, 'console_wd')) - 1 CON_HT = _cfg.getint(_sct, 'console_ht') CON_SZ_CMD = ('$ps = (Get-Host).ui.rawui; ' '$sz = $ps.windowsize; ' f'$sz.width = {CON_WD}; ' f'$sz.height = {CON_HT}; ' '$ps.windowsize = $sz; ' '$bf = $ps.buffersize; ' f'$bf.width = {CON_WD}; ' '$ps.buffersize = $bf') CON_CLOSE_AFTER = _cfg.getint(_sct, 'console_close_after') CRF_VALS = tuple((int(ht), int(crf)) for ht, crf in [ _split(r'\s*:\s*', val) for val in _cfg.getlines(_sct, 'ffmpeg_crf_values') ]) CONV_FTYPES = _cfg.getlines(_sct, 'file_types') CONV_NVENC = _cfg.getboolean(_sct, 'use_hevc_nvenc') CONV_THREADS = max(1, _cfg.getint(_sct, 'thread_count')) if CONV_NVENC: CONV_THREADS = min(3, CONV_THREADS) CONV_STREAMS = max(1, _cfg.getint(_sct, 'stream_count')) CONV_CUTOFF = _cfg.getint(_sct, 'playtime_cutoff')