What's new
Runion

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Как вытащить с файлов корп емайли?

BENT

Light Weight
Депозит
$0
Подскажите скрипт на петоне или софт что может вытаскивать с файлов корпа емайли?
 
На питоне
Сначала соберем из всех тхт мыло:пасс
Python:
Скопировать в буфер обмена
import os
import re


pattern = r'([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})\:(.*?)\.'

email_password_pairs = []

# Function to extract email:password pairs from a file
def extract_pairs_from_file(file_path):
with open(file_path, 'r', encoding='utf-8', errors='ignore') as file:
for line in file:
# Extract email:password pairs from each line
matches = re.findall(pattern, line)
for match in matches:
email_password_pairs.append(':'.join(match))

directory = 'папка с тхт файлами'


for filename in os.listdir(directory):
if filename.endswith('.txt'):
file_path = os.path.join(directory, filename)
extract_pairs_from_file(file_path)


with open('output.txt', 'w', encoding='utf-8') as output_file:
for pair in email_password_pairs:
output_file.write(pair + '\n')
output_file.flush()

print("Output saved to output.txt")

Далее почистим от бигов(добавить нужные биги можешь сам)

Python:
Скопировать в буфер обмена
domains_to_exclude = ['gmail', 'yahoo', 'outlook', 'live']


with open('output.txt', 'r', encoding='utf-8') as input_file:
lines = input_file.readlines()


filtered_lines = [line for line in lines if not any(domain in line.lower() for domain in domains_to_exclude)]


with open('notbigs.txt', 'w', encoding='utf-8') as output_file:
output_file.writelines(filtered_lines)

print("Done")
 
Top