davidtavarez / pwndb

Search for leaked credentials
https://davidtavarez.github.io/2019/tutorial-pwndb-command-line-tool-python/
MIT License
1.28k stars 240 forks source link

Importing list from email cc's #4

Closed BusesCanFly closed 5 years ago

BusesCanFly commented 5 years ago

This isn't an issue, but a feature request/idea/general comment.

If you are part of/found an email chain with a list of cc's, they come in the format of: "name <email@email.email>, name1 <email1@email.email>," etc... An easy way to sort that is to copy and paste the raw cc list into a file and then run cat [filename] | sed 's/\s\+/\n/g' | grep "@" | tr -d '<>,"' This properly formats the list so it can passed through ./pwndb --list :D

josu22 commented 5 years ago

Put a commit!

davidtavarez commented 5 years ago

this weekend I will publish some updates.

BusesCanFly commented 5 years ago

Here is a quick PoC: (Super dirty combo of python and bash but /shrug)

Script:

#!/usr/bin/env python

import os
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-if', '--raw_list', type=str, help='Raw list of emails from the cc list')
parser.add_argument('-of', '--clean_list', type=str, help='Name for sorted list')
args = parser.parse_args()

os.system("cat "+args.raw_list+ "| sed \'s/\\s\+/\\n/g\' | grep @ | tr -d \'<>,\"\' > "+args.clean_list)

Usage:

root@BusesCanFly:~/pwndb# ls
cc_sort.py  lists  pwndb.py  raw_email_cc_list.txt
root@BusesCanFly:~/pwndb# ./cc_sort.py -h
usage: cc_sort.py [-h] [-if RAW_LIST] [-of CLEAN_LIST]

optional arguments:
  -h, --help            show this help message and exit
  -if RAW_LIST, --raw_list RAW_LIST
                        Raw list of emails from the cc list
  -of CLEAN_LIST, --clean_list CLEAN_LIST
root@BusesCanFly:~/pwndb# ./cc_sort.py -if raw_email_cc_list.txt -of formatted.txt
root@BusesCanFly:~/pwndb# ls
cc_sort.py  formatted.txt  lists  pwndb.py  raw_email_cc_list.txt
root@BusesCanFly:~/pwndb# 
davidtavarez commented 5 years ago

Fixed in https://github.com/davidtavarez/pwndb/pull/10