Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat(lib): 修改目录结构与import #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.venv/
venv
*.pyc
__pycache__
dist/
*.log
result/
13 changes: 13 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python
# coding=utf-8

'''
Version: 0.1
Autor: zmf96
Email: zmf96@qq.com
Date: 2022-03-04 07:26:01
LastEditors: zmf96
LastEditTime: 2022-03-04 07:26:01
FilePath: /__init__.py
Description:
'''
10 changes: 0 additions & 10 deletions config/__init__.py

This file was deleted.

13 changes: 13 additions & 0 deletions emailall/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python
# coding=utf-8

'''
Version: 0.1
Autor: zmf96
Email: zmf96@qq.com
Date: 2022-03-04 07:32:29
LastEditors: zmf96
LastEditTime: 2022-03-04 09:31:15
FilePath: /emailall/__init__.py
Description:
'''
File renamed without changes.
2 changes: 1 addition & 1 deletion common/output.py → emailall/common/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)
from prettytable import PrettyTable
from config import settings
from emailall.config import settings
import json


Expand Down
6 changes: 3 additions & 3 deletions common/search.py → emailall/common/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# coding=utf-8
# Author: @Tao.

from modules.module import Module
from config import settings
from config.log import logger
from emailall.modules.module import Module
from emailall.config import settings
from emailall.config.log import logger

import json

Expand Down
4 changes: 2 additions & 2 deletions common/utils.py → emailall/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import re
import json

from config.log import logger
from emailall.config.log import logger
from pathlib import Path
from config import settings
from emailall.config import settings


def check_net():
Expand Down
24 changes: 24 additions & 0 deletions emailall/config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python
# coding=utf-8

'''
Version: 0.1
Autor: zmf96
Email: zmf96@qq.com
Date: 2022-03-04 07:15:27
LastEditors: zmf96
LastEditTime: 2022-03-04 07:38:53
FilePath: /emailall/config/__init__.py
Description:
'''
import importlib

class Settings(object):
def __init__(self):
setting_modules = ['emailall.config.setting','emailall.config.api']
for setting_module in setting_modules:
print(setting_module)
setting = importlib.import_module(setting_module)
for attr in dir(setting):
setattr(self, attr, getattr(setting,attr))
settings = Settings()
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions config/setting.py → emailall/config/setting.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
#!/usr/bin/env python
# coding=utf-8

'''
Version: 0.1
Autor: zmf96
Email: zmf96@qq.com
Date: 2022-03-04 07:15:27
LastEditors: zmf96
LastEditTime: 2022-03-04 07:34:40
FilePath: /emailall/config/setting.py
Description:
'''
#!/usr/bin/python3
# coding=utf-8
# Author: @Tao.
Expand All @@ -9,6 +22,7 @@
"""
# 路径设置
relative_directory = pathlib.Path(__file__).parent.parent # EmailAll代码相对路径
print(relative_directory)
modules_storage_dir = relative_directory.joinpath('modules') # modules存放目录
result_save_dir = relative_directory.joinpath('result')

Expand Down
30 changes: 30 additions & 0 deletions emailall/lib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python
# coding=utf-8

'''
Version: 0.1
Autor: zmf96
Email: zmf96@qq.com
Date: 2022-03-04 04:58:33
LastEditors: zmf96
LastEditTime: 2022-03-04 10:01:37
FilePath: /emailall/lib.py
Description:
'''
from emailall.modules.collect import Collect
from emailall.config import settings


def run_emailall(domain):
col = Collect(domain)
col.run()
emails = set()
for datas in settings.emails:
for data in datas:
emails.update(data['emails'])

return emails


if __name__ == "__main__":
print(run_emailall('example.com'))
File renamed without changes.
24 changes: 19 additions & 5 deletions modules/collect.py → emailall/modules/collect.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#!/usr/bin/env python
# coding=utf-8

'''
Version: 0.1
Autor: zmf96
Email: zmf96@qq.com
Date: 2022-03-04 07:15:27
LastEditors: zmf96
LastEditTime: 2022-03-04 08:05:37
FilePath: /emailall/modules/collect.py
Description:
'''
#!/usr/bin/python3
# coding=utf-8
# Author: @Tao.

import threading
import importlib

from config.log import logger
from config import settings
from emailall.config.log import logger
from emailall.config import settings


class Collect(object):
Expand All @@ -20,12 +33,13 @@ def get_mod(self):
"""
Get modules
"""
modules = ['certificates', 'check', 'datasets',
'dnsquery', 'intelligence', 'search']
# modules = ['certificates', 'check', 'datasets',
# 'dnsquery', 'intelligence', 'search']
modules = ['datasets','search']
for module in modules:
module_path = settings.modules_storage_dir.joinpath(module)
for path in module_path.rglob('*.py'):
import_module = f'modules.{module}.{path.stem}'
import_module = f'emailall.modules.{module}.{path.stem}'
self.modules.append(import_module)

def import_func(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)

from common.search import Search
from emailall.common.search import Search
from lxml import etree
from config import settings
from emailall.config import settings
from prettytable import PrettyTable


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# @name : EmailAll - Email Information Gathering Tools
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)
from common.search import Search
from config import settings
from config.log import logger
from emailall.common.search import Search
from emailall.config import settings
from emailall.config.log import logger


class PhoneBook(Search):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)

from common.search import Search
from emailall.common.search import Search
import re


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import requests
import re

from common.search import Search
from emailall.common.search import Search
from urllib.parse import unquote, quote
from config import settings
from config.log import logger
from emailall.config import settings
from emailall.config.log import logger


class Snov(Search):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# @name : EmailAll - Email Information Gathering Tools
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)
from common.search import Search
from emailall.common.search import Search
from urllib.parse import unquote,quote
from config import settings
from emailall.config import settings
import requests

import json
Expand Down
4 changes: 2 additions & 2 deletions modules/module.py → emailall/modules/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import requests
import urllib3

from config.log import logger
from emailall.config.log import logger
from prettytable import PrettyTable
from fake_useragent import UserAgent
from common import utils
from emailall.common import utils

urllib3.disable_warnings()

Expand Down
6 changes: 3 additions & 3 deletions modules/search/ask.py → emailall/modules/search/ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@


import time
from common.search import Search
from config.log import logger
from emailall.common.search import Search
from emailall.config.log import logger
from lxml import etree
from config import settings
from emailall.config import settings


class Ask(Search):
Expand Down
4 changes: 2 additions & 2 deletions modules/search/baidu.py → emailall/modules/search/baidu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


import time
from common.search import Search
from config.setting import emails
from emailall.common.search import Search
from emailall.config.setting import emails
from lxml import etree


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


import time
from common.search import Search
from config.setting import emails
from emailall.common.search import Search
from emailall.config.setting import emails
from lxml import etree


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import time
import base64

from common.search import Search
from config import settings
from config.log import logger
from common import utils
from emailall.common.search import Search
from emailall.config import settings
from emailall.config.log import logger
from emailall.common import utils


class Github(Search):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# @name : EmailAll - Email Information Gathering Tools
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)
from common.search import Search
from emailall.common.search import Search
import time
import re
from urllib.parse import unquote
from config.log import logger
from config import settings
from emailall.config.log import logger
from emailall.config import settings


class Google(Search):
Expand Down
9 changes: 1 addition & 8 deletions modules/search/qwant.py → emailall/modules/search/qwant.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/usr/bin/python3
# -*- coding:utf-8 -*-
#
# @name : EmailAll - Email Information Gathering Tools
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)

# !/usr/bin/python3
# -*- coding:utf-8 -*-
#
# @name : EmailAll - Email Information Gathering Tools
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)
from common.search import Search
from emailall.common.search import Search
import time


Expand Down
4 changes: 2 additions & 2 deletions modules/search/so.py → emailall/modules/search/so.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# @author : Tao. (Taonn)

import time
from common.search import Search
from config.log import logger
from emailall.common.search import Search
from emailall.config.log import logger
from lxml import etree
import re

Expand Down
4 changes: 2 additions & 2 deletions modules/search/sogou.py → emailall/modules/search/sogou.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# @url : http://github.com/Taonn
# @author : Tao. (Taonn)
import time
from common.search import Search
from config.log import logger
from emailall.common.search import Search
from emailall.config.log import logger
from lxml import etree
import re

Expand Down
Loading