├── output ├── [20200403-194346]test.py.txt ├── [20200403-194645]test.py.txt ├── [20200403-194737]test.py.txt ├── [20200403-194758]test.py.txt ├── [20200403-195827]test.py.txt ├── [20200403-203825]test.py.txt ├── [20200403-182446]test.py.txt ├── [20200403-182837]test.py.txt ├── [20200403-182958]test.py.txt ├── [20200403-183251]test.py.txt ├── [20200403-184236]test.py.txt ├── [20200403-192117]test.py.txt ├── [20200403-192240]test.py.txt ├── [20200403-192808]test.py.txt ├── [20200403-193330]test.py.txt ├── [20200403-193423]test.py.txt ├── [20200403-193448]test.py.txt ├── [20200403-193542]test.py.txt ├── [20200403-193652]test.py.txt ├── [20200403-193717]test.py.txt ├── [20200403-193839]test.py.txt ├── [20200403-193857]test.py.txt ├── [20200403-194005]test.py.txt └── [20200403-194326]test.py.txt ├── .DS_Store ├── lib ├── .DS_Store ├── __init__.py ├── __init__.pyc ├── core │ ├── __init__.py │ ├── __pycache__ │ │ ├── data.cpython-37.pyc │ │ ├── log.cpython-37.pyc │ │ ├── common.cpython-37.pyc │ │ ├── enums.cpython-37.pyc │ │ ├── option.cpython-37.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── convert.cpython-37.pyc │ │ ├── datatype.cpython-37.pyc │ │ ├── exception.cpython-37.pyc │ │ ├── register.cpython-37.pyc │ │ └── settings.cpython-37.pyc │ ├── data.py │ ├── exception.py │ ├── enums.py │ ├── settings.py │ ├── revision.py │ ├── convert.py │ ├── log.py │ ├── datatype.py │ ├── register.py │ ├── common.py │ └── option.py ├── api │ ├── __init__.pyc │ ├── fofa │ │ ├── pack.pyc │ │ ├── __init__.pyc │ │ ├── __pycache__ │ │ │ ├── pack.cpython-37.pyc │ │ │ └── __init__.cpython-37.pyc │ │ ├── __init__.py │ │ └── pack.py │ ├── google │ │ ├── pack.pyc │ │ ├── __init__.pyc │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── pack.cpython-37.pyc │ │ │ └── __init__.cpython-37.pyc │ │ └── pack.py │ ├── shodan │ │ ├── pack.pyc │ │ ├── __init__.pyc │ │ ├── __pycache__ │ │ │ ├── pack.cpython-37.pyc │ │ │ └── __init__.cpython-37.pyc │ │ ├── __init__.py │ │ └── pack.py │ ├── zoomeye │ │ ├── base.pyc │ │ ├── pack.pyc │ │ ├── __init__.pyc │ │ ├── __pycache__ │ │ │ ├── base.cpython-37.pyc │ │ │ ├── pack.cpython-37.pyc │ │ │ └── __init__.cpython-37.pyc │ │ ├── __init__.py │ │ ├── pack.py │ │ └── base.py │ ├── __init__.py │ └── __pycache__ │ │ └── __init__.cpython-37.pyc ├── parse │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ └── cmdline.cpython-37.pyc │ └── cmdline.py ├── utils │ ├── __init__.py │ ├── __init__.pyc │ ├── versioncheck.pyc │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── config.cpython-37.pyc │ │ ├── console.cpython-37.pyc │ │ └── versioncheck.cpython-37.pyc │ ├── versioncheck.py │ ├── config.py │ └── console.py ├── controller │ ├── __init__.py │ ├── __pycache__ │ │ ├── api.cpython-37.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── engine.cpython-37.pyc │ │ └── loader.cpython-37.pyc │ ├── api.py │ ├── loader.py │ └── engine.py ├── __pycache__ │ ├── cli.cpython-37.pyc │ └── __init__.cpython-37.pyc ├── cli.py └── debug.py ├── plugin ├── .DS_Store ├── __init__.py ├── urlparser.py ├── useragent.py ├── extracts.py ├── cloudeye.py ├── util.py └── static.py ├── script ├── __init__.py ├── __pycache__ │ └── test.cpython-37.pyc └── test.py ├── thirdparty ├── .DS_Store ├── IPy │ ├── IPy.pyc │ ├── __init__.pyc │ ├── __pycache__ │ │ ├── IPy.cpython-37.pyc │ │ └── __init__.cpython-37.pyc │ └── __init__.py ├── __init__.pyc ├── odict │ ├── odict.pyc │ ├── __init__.pyc │ ├── __pycache__ │ │ ├── odict.cpython-37.pyc │ │ └── __init__.cpython-37.pyc │ └── __init__.py ├── ansistrm │ ├── .DS_Store │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ └── ansistrm.cpython-37.pyc │ └── ansistrm.py ├── colorama │ ├── ansi.pyc │ ├── win32.pyc │ ├── __init__.pyc │ ├── winterm.pyc │ ├── ansitowin32.pyc │ ├── initialise.pyc │ ├── __init__.py │ ├── __pycache__ │ │ ├── ansi.cpython-37.pyc │ │ ├── win32.cpython-37.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── winterm.cpython-37.pyc │ │ ├── initialise.cpython-37.pyc │ │ └── ansitowin32.cpython-37.pyc │ ├── ansi.py │ ├── initialise.py │ ├── win32.py │ ├── winterm.py │ └── ansitowin32.py ├── termcolor │ ├── __init__.pyc │ ├── termcolor.pyc │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ └── termcolor.cpython-37.pyc │ └── termcolor.py ├── __pycache__ │ └── __init__.cpython-37.pyc ├── __init__.py └── httplib2 │ ├── __pycache__ │ ├── socks.cpython-37.pyc │ ├── __init__.cpython-37.pyc │ └── iri2uri.cpython-37.pyc │ ├── certs.py │ ├── test │ └── other_cacerts.txt │ ├── iri2uri.py │ └── socks.py ├── Bayonet.py ├── README.md ├── toolkit.conf └── data ├── pass100.txt └── pass1000.txt /output/[20200403-194346]test.py.txt: -------------------------------------------------------------------------------- 1 | www.baidu.com 2 | -------------------------------------------------------------------------------- /output/[20200403-194645]test.py.txt: -------------------------------------------------------------------------------- 1 | www.baidu.com 2 | -------------------------------------------------------------------------------- /output/[20200403-194737]test.py.txt: -------------------------------------------------------------------------------- 1 | www.baidu.com 2 | -------------------------------------------------------------------------------- /output/[20200403-194758]test.py.txt: -------------------------------------------------------------------------------- 1 | www.baidu.com 2 | -------------------------------------------------------------------------------- /output/[20200403-195827]test.py.txt: -------------------------------------------------------------------------------- 1 | www.baidu.com 2 | -------------------------------------------------------------------------------- /output/[20200403-203825]test.py.txt: -------------------------------------------------------------------------------- 1 | www.baidu.com 2 | -------------------------------------------------------------------------------- /output/[20200403-182446]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-182837]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-182958]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-183251]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-184236]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-192117]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-192240]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-192808]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-193330]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-193423]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-193448]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-193542]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-193652]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-193717]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-193839]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-193857]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-194005]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /output/[20200403-194326]test.py.txt: -------------------------------------------------------------------------------- 1 | www.syst1m.com 2 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/.DS_Store -------------------------------------------------------------------------------- /lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/.DS_Store -------------------------------------------------------------------------------- /lib/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m -------------------------------------------------------------------------------- /lib/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/__init__.pyc -------------------------------------------------------------------------------- /lib/core/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m -------------------------------------------------------------------------------- /plugin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/plugin/.DS_Store -------------------------------------------------------------------------------- /plugin/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m -------------------------------------------------------------------------------- /script/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m -------------------------------------------------------------------------------- /lib/api/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/__init__.pyc -------------------------------------------------------------------------------- /lib/parse/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m -------------------------------------------------------------------------------- /lib/utils/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m -------------------------------------------------------------------------------- /thirdparty/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/.DS_Store -------------------------------------------------------------------------------- /lib/api/fofa/pack.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/fofa/pack.pyc -------------------------------------------------------------------------------- /lib/controller/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m -------------------------------------------------------------------------------- /lib/utils/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/utils/__init__.pyc -------------------------------------------------------------------------------- /thirdparty/IPy/IPy.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/IPy/IPy.pyc -------------------------------------------------------------------------------- /lib/api/fofa/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/fofa/__init__.pyc -------------------------------------------------------------------------------- /lib/api/google/pack.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/google/pack.pyc -------------------------------------------------------------------------------- /lib/api/shodan/pack.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/shodan/pack.pyc -------------------------------------------------------------------------------- /lib/api/zoomeye/base.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/zoomeye/base.pyc -------------------------------------------------------------------------------- /lib/api/zoomeye/pack.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/zoomeye/pack.pyc -------------------------------------------------------------------------------- /thirdparty/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/__init__.pyc -------------------------------------------------------------------------------- /lib/api/google/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/google/__init__.pyc -------------------------------------------------------------------------------- /lib/api/shodan/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/shodan/__init__.pyc -------------------------------------------------------------------------------- /lib/utils/versioncheck.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/utils/versioncheck.pyc -------------------------------------------------------------------------------- /thirdparty/IPy/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/IPy/__init__.pyc -------------------------------------------------------------------------------- /thirdparty/odict/odict.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/odict/odict.pyc -------------------------------------------------------------------------------- /lib/api/zoomeye/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/zoomeye/__init__.pyc -------------------------------------------------------------------------------- /thirdparty/ansistrm/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/ansistrm/.DS_Store -------------------------------------------------------------------------------- /thirdparty/colorama/ansi.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/ansi.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/win32.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/win32.pyc -------------------------------------------------------------------------------- /thirdparty/odict/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/odict/__init__.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/__init__.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/winterm.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/winterm.pyc -------------------------------------------------------------------------------- /lib/__pycache__/cli.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/__pycache__/cli.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/ansitowin32.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/ansitowin32.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/initialise.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/initialise.pyc -------------------------------------------------------------------------------- /thirdparty/termcolor/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/termcolor/__init__.pyc -------------------------------------------------------------------------------- /thirdparty/termcolor/termcolor.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/termcolor/termcolor.pyc -------------------------------------------------------------------------------- /lib/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/data.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/data.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/log.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/log.cpython-37.pyc -------------------------------------------------------------------------------- /script/__pycache__/test.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/script/__pycache__/test.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/common.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/common.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/enums.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/enums.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/option.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/option.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # project = https://github.com/Xyntax/POC-T 4 | # author = i@cdxy.me -------------------------------------------------------------------------------- /lib/api/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/fofa/__pycache__/pack.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/fofa/__pycache__/pack.cpython-37.pyc -------------------------------------------------------------------------------- /lib/controller/__pycache__/api.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/controller/__pycache__/api.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/convert.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/convert.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/datatype.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/datatype.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/exception.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/exception.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/register.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/register.cpython-37.pyc -------------------------------------------------------------------------------- /lib/core/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/core/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /lib/parse/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/parse/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/parse/__pycache__/cmdline.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/parse/__pycache__/cmdline.cpython-37.pyc -------------------------------------------------------------------------------- /lib/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/utils/__pycache__/config.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/utils/__pycache__/config.cpython-37.pyc -------------------------------------------------------------------------------- /lib/utils/__pycache__/console.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/utils/__pycache__/console.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/IPy/__pycache__/IPy.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/IPy/__pycache__/IPy.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/fofa/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # project = https://github.com/Xyntax/POC-T 4 | # author = bit4 5 | -------------------------------------------------------------------------------- /lib/api/google/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # project = https://github.com/Xyntax/POC-T 4 | # author = i@cdxy.me -------------------------------------------------------------------------------- /lib/api/google/__pycache__/pack.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/google/__pycache__/pack.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/shodan/__pycache__/pack.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/shodan/__pycache__/pack.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/zoomeye/__pycache__/base.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/zoomeye/__pycache__/base.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/zoomeye/__pycache__/pack.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/zoomeye/__pycache__/pack.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/IPy/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # author = i@cdxy.me 4 | # project = https://github.com/Xyntax/POC-T -------------------------------------------------------------------------------- /thirdparty/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/fofa/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/fofa/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/google/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/google/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/shodan/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # project = https://github.com/Xyntax/POC-T 4 | # author = i@cdxy.me 5 | -------------------------------------------------------------------------------- /lib/api/shodan/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/shodan/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/zoomeye/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # project = https://github.com/Xyntax/POC-T 4 | # author = i@cdxy.me -------------------------------------------------------------------------------- /lib/controller/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/controller/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /lib/controller/__pycache__/engine.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/controller/__pycache__/engine.cpython-37.pyc -------------------------------------------------------------------------------- /lib/controller/__pycache__/loader.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/controller/__pycache__/loader.cpython-37.pyc -------------------------------------------------------------------------------- /lib/utils/__pycache__/versioncheck.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/utils/__pycache__/versioncheck.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/IPy/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/IPy/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # project = https://github.com/Xyntax/POC-T 4 | # author = i@cdxy.me 5 | -------------------------------------------------------------------------------- /thirdparty/ansistrm/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # author = i@cdxy.me 4 | # project = https://github.com/Xyntax/POC-T -------------------------------------------------------------------------------- /thirdparty/colorama/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # author = i@cdxy.me 4 | # project = https://github.com/Xyntax/POC-T -------------------------------------------------------------------------------- /thirdparty/odict/__pycache__/odict.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/odict/__pycache__/odict.cpython-37.pyc -------------------------------------------------------------------------------- /lib/api/zoomeye/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/lib/api/zoomeye/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/__pycache__/ansi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/__pycache__/ansi.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/__pycache__/win32.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/__pycache__/win32.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/httplib2/__pycache__/socks.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/httplib2/__pycache__/socks.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/odict/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/odict/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/termcolor/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # author = i@cdxy.me 4 | # project = https://github.com/Xyntax/POC-T -------------------------------------------------------------------------------- /thirdparty/ansistrm/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/ansistrm/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/ansistrm/__pycache__/ansistrm.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/ansistrm/__pycache__/ansistrm.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/__pycache__/winterm.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/__pycache__/winterm.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/httplib2/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/httplib2/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/httplib2/__pycache__/iri2uri.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/httplib2/__pycache__/iri2uri.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/__pycache__/initialise.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/__pycache__/initialise.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/termcolor/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/termcolor/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/termcolor/__pycache__/termcolor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/termcolor/__pycache__/termcolor.cpython-37.pyc -------------------------------------------------------------------------------- /thirdparty/colorama/__pycache__/ansitowin32.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaOkuoAi/Bayonet/HEAD/thirdparty/colorama/__pycache__/ansitowin32.cpython-37.pyc -------------------------------------------------------------------------------- /Bayonet.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # auther = Syst1m 4 | 5 | from lib.utils import versioncheck 6 | from lib.cli import main 7 | 8 | 9 | if __name__ == '__main__': 10 | main() -------------------------------------------------------------------------------- /script/test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # auther = Syst1m 4 | 5 | import random 6 | import time 7 | 8 | def poc(str): 9 | time.sleep(3) 10 | if random.randint(1,10)>5: 11 | return True 12 | return False -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bayonet 2 | Python3版本Poc-T(渗透测试插件化并发框架) 3 | 4 | 5 | **由于自己比较喜欢python3,又比较喜欢POC-T这款框架,于是对代码进行了部分修改,使Python3也可以进行使用。** 6 | 7 | - 使用方法相同于POC-T 8 | 9 |  10 | 11 | 12 | 13 | >原框架地址:https://github.com/Xyntax/POC-T/ 14 | -------------------------------------------------------------------------------- /lib/core/data.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | 6 | from lib.core.log import MY_LOGGER 7 | from lib.core.datatype import AttribDict 8 | 9 | logger = MY_LOGGER 10 | 11 | paths = AttribDict() 12 | 13 | cmdLineOptions = AttribDict() 14 | 15 | conf = AttribDict() 16 | 17 | th = AttribDict() -------------------------------------------------------------------------------- /lib/utils/versioncheck.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | 6 | import sys 7 | 8 | PYVERSION = sys.version.split()[0] 9 | 10 | if PYVERSION <= "3": 11 | exit("[CRITICAL] incompatible Python version detected ('%s'). " 12 | "For successfully running this project, you'll have to use version 3" 13 | "(visit 'http://www.python.org/download/')" % PYVERSION) -------------------------------------------------------------------------------- /toolkit.conf: -------------------------------------------------------------------------------- 1 | [zoomeye] zoomeye API 2 | email: 3 | password: 4 | 5 | [shodan] shadan API 6 | api_key: 7 | 8 | [google] 9 | #proxy:http 127.0.0.1 1894 10 | #proxy:sock5 127.0.0.1 7070 11 | proxy: 12 | developer_key: 13 | search_engine: 14 | 15 | [fofa] fofa API 16 | email: 17 | api_key: 18 | 19 | [bing] bing APU 20 | api_key: 21 | 22 | [cloudeye] cloudeye APi 23 | # your API-key in "http://cloudeye.me/?a=list" 24 | api_key: 25 | # your personal sub-domain, like: [user].dnslog.info 26 | personal_domain: -------------------------------------------------------------------------------- /lib/core/exception.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | class ToolkitBaseException(Exception): 6 | pass 7 | 8 | 9 | class ToolkitConnectionException(Exception): 10 | pass 11 | 12 | 13 | class ToolkitDataException(ToolkitBaseException): 14 | pass 15 | 16 | 17 | class ToolkitMissingPrivileges(ToolkitBaseException): 18 | pass 19 | 20 | 21 | class ToolkitUserQuitException(ToolkitBaseException): 22 | pass 23 | 24 | 25 | class ToolkitSystemException(ToolkitBaseException): 26 | pass 27 | 28 | 29 | class ToolkitValueException(ToolkitBaseException): 30 | pass 31 | 32 | 33 | class ToolkitPluginException(ToolkitBaseException): 34 | pass 35 | 36 | 37 | class RegisterException(Exception): 38 | pass 39 | 40 | 41 | class RegisterValueException(RegisterException): 42 | pass 43 | 44 | 45 | class RegisterDataException(RegisterException): 46 | pass 47 | 48 | 49 | class RegisterMutexException(RegisterException): 50 | pass 51 | -------------------------------------------------------------------------------- /lib/core/enums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | class CUSTOM_LOGGING: 6 | SYSINFO = 9 7 | SUCCESS = 8 8 | ERROR = 7 9 | WARNING = 6 10 | 11 | 12 | class CONTENT_STATUS: 13 | IN_PROGRESS = 0 14 | COMPLETE = 1 15 | 16 | 17 | class EXIT_STATUS: 18 | SYSETM_EXIT = 0 19 | ERROR_EXIT = 1 20 | USER_QUIT = 2 21 | 22 | 23 | class POC_RESULT_STATUS: 24 | FAIL = 0 25 | SUCCESS = 1 26 | RETRAY = 2 27 | 28 | 29 | class API_MODE_NAME: 30 | ZOOMEYE = 'ZoomEye' 31 | SHODAN = 'Shodan' 32 | GOOGLE = 'Google' 33 | FOFA = 'Fofa' 34 | 35 | 36 | class TARGET_MODE_STATUS: 37 | FILE = 9 38 | SINGLE = 8 39 | IPMASK = 7 40 | RANGE = 6 41 | API = 5 42 | 43 | 44 | class ENGINE_MODE_STATUS: 45 | THREAD = 9 46 | GEVENT = 8 47 | 48 | 49 | class PROXY_TYPE: # keep same with SocksiPy(import socks) 50 | PROXY_TYPE_SOCKS4 = SOCKS4 = 1 51 | PROXY_TYPE_SOCKS5 = SOCKS5 = 2 52 | PROXY_TYPE_HTTP = HTTP = 3 53 | PROXY_TYPE_HTTP_NO_TUNNEL = 4 54 | -------------------------------------------------------------------------------- /lib/core/settings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | import os 6 | import subprocess 7 | 8 | VERSION = '1.0.0' 9 | PROJECT = "Bayonet" 10 | AUTHOR = 'syst1m' 11 | MAIL = '1990758989@qq.com' 12 | PLATFORM = os.name 13 | IS_WIN = subprocess._mswindows 14 | 15 | # essential methods/functions in custom scripts/PoC (such as function poc()) 16 | ESSENTIAL_MODULE_METHODS = ['poc'] 17 | 18 | # Encoding used for Unicode data 19 | UNICODE_ENCODING = "utf-8" 20 | 21 | # String representation for NULL value 22 | NULL = "NULL" 23 | 24 | # Format used for representing invalid unicode characters 25 | INVALID_UNICODE_CHAR_FORMAT = r"\x%02x" 26 | 27 | ISSUES_PAGE = "" 28 | GIT_REPOSITORY = "" 29 | GIT_PAGE = "" 30 | 31 | BANNER = """\033[01;34m 32 | __ \033[01;31m__/\033[01;34m 33 | )_) _ _ _ _ _)_ \033[01;33m/ \033[01;31m__/\033[01;34m 34 | /__) (_( (_( (_) ) ) )_) (_ \033[01;33m_/\033[01;34m 35 | _) (_ 36 | 37 | 38 | \033[01;37m{\033[01;m Version %s by %s mail:%s \033[01;37m}\033[0m 39 | \n"""% (VERSION, AUTHOR, MAIL) -------------------------------------------------------------------------------- /thirdparty/httplib2/certs.py: -------------------------------------------------------------------------------- 1 | """Utilities for certificate management.""" 2 | 3 | import os 4 | 5 | certifi_available = False 6 | certifi_where = None 7 | try: 8 | from certifi import where as certifi_where 9 | certifi_available = True 10 | except ImportError: 11 | pass 12 | 13 | custom_ca_locater_available = False 14 | custom_ca_locater_where = None 15 | try: 16 | from ca_certs_locater import get as custom_ca_locater_where 17 | custom_ca_locater_available = True 18 | except ImportError: 19 | pass 20 | 21 | 22 | BUILTIN_CA_CERTS = os.path.join( 23 | os.path.dirname(os.path.abspath(__file__)), "cacerts.txt" 24 | ) 25 | 26 | 27 | def where(): 28 | env = os.environ.get("HTTPLIB2_CA_CERTS") 29 | if env is not None: 30 | if os.path.isfile(env): 31 | return env 32 | else: 33 | raise RuntimeError("Environment variable HTTPLIB2_CA_CERTS not a valid file") 34 | if custom_ca_locater_available: 35 | return custom_ca_locater_where() 36 | if certifi_available: 37 | return certifi_where() 38 | return BUILTIN_CA_CERTS 39 | 40 | 41 | if __name__ == "__main__": 42 | print(where()) 43 | -------------------------------------------------------------------------------- /thirdparty/colorama/ansi.py: -------------------------------------------------------------------------------- 1 | ''' 2 | This module generates ANSI character codes to printing colors to terminals. 3 | See: http://en.wikipedia.org/wiki/ANSI_escape_code 4 | ''' 5 | 6 | CSI = '\033[' 7 | 8 | def code_to_chars(code): 9 | return CSI + str(code) + 'm' 10 | 11 | class AnsiCodes(object): 12 | def __init__(self, codes): 13 | for name in dir(codes): 14 | if not name.startswith('_'): 15 | value = getattr(codes, name) 16 | setattr(self, name, code_to_chars(value)) 17 | 18 | class AnsiFore: 19 | BLACK = 30 20 | RED = 31 21 | GREEN = 32 22 | YELLOW = 33 23 | BLUE = 34 24 | MAGENTA = 35 25 | CYAN = 36 26 | WHITE = 37 27 | RESET = 39 28 | 29 | class AnsiBack: 30 | BLACK = 40 31 | RED = 41 32 | GREEN = 42 33 | YELLOW = 43 34 | BLUE = 44 35 | MAGENTA = 45 36 | CYAN = 46 37 | WHITE = 47 38 | RESET = 49 39 | 40 | class AnsiStyle: 41 | BRIGHT = 1 42 | DIM = 2 43 | NORMAL = 22 44 | RESET_ALL = 0 45 | 46 | Fore = AnsiCodes( AnsiFore ) 47 | Back = AnsiCodes( AnsiBack ) 48 | Style = AnsiCodes( AnsiStyle ) 49 | 50 | -------------------------------------------------------------------------------- /lib/api/zoomeye/pack.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # project = https://github.com/Xyntax/POC-T 4 | # author = i@cdxy.me 5 | 6 | import sys 7 | from lib.api.zoomeye.base import ZoomEye 8 | from lib.core.data import logger 9 | 10 | 11 | def _initial(): 12 | z = ZoomEye() 13 | z.auto_login() 14 | info = z.resources_info().get('resources') 15 | if info: 16 | msg = 'Available ZoomEye search: (search:%s)' % (info.get('search', 'NO FOUND')) 17 | logger.info(msg) 18 | else: 19 | msg = 'ZoomEye API authorization failed, Please re-run it and enter a new token.' 20 | sys.exit(logger.error(msg)) 21 | return z 22 | 23 | 24 | def ZoomEyeSearch(query, limit, type='host', offset=0): 25 | z = _initial() 26 | ans = [] 27 | limit += offset 28 | for page_n in range(int(offset / 10), int((limit + 10 - 1) / 10)): 29 | data = z.dork_search(query, resource=type, page=page_n) 30 | if data: 31 | for i in data: 32 | ip_str = i.get('ip') 33 | if 'portinfo' in i: 34 | ip_str = ip_str + ':' + str(i.get('portinfo').get('port')) 35 | ans.append(ip_str) 36 | else: 37 | break 38 | return ans 39 | -------------------------------------------------------------------------------- /thirdparty/odict/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # The BSD License 4 | # 5 | # Copyright 2003-2008 Nicola Larosa, Michael Foord 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | pass 27 | -------------------------------------------------------------------------------- /lib/core/revision.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | 6 | import os 7 | import re 8 | 9 | from subprocess import PIPE 10 | from subprocess import Popen as execute 11 | 12 | def getRevisionNumber(): 13 | """ 14 | Returns abbreviated commit hash number as retrieved with "git rev-parse --short HEAD" 15 | """ 16 | 17 | retval = None 18 | filePath = None 19 | _ = os.path.dirname(__file__) 20 | 21 | while True: 22 | filePath = os.path.join(_,".git","HEAD") 23 | if os.path.exists(filePath): 24 | break 25 | else: 26 | filePath = None 27 | if _ == os.path.dirname(_): 28 | break 29 | else: 30 | _ = os.path.dirname(_) 31 | while True: 32 | if filePath and os.path.isfile(filePath): 33 | with open(filePath,"r") as f: 34 | content = f.read() 35 | filePath = None 36 | if content.startwith("ref: "): 37 | filePath = os.path.join(_,".git",content.replace("ref: ","").strip()) 38 | else: 39 | match = re.match(r"(?i)[0-9a-f]{32}", content) 40 | retval = match.group(0) if match else None 41 | else: 42 | break 43 | 44 | if not retval: 45 | process = execute("git rev-parse --verify HEAD", shell=True, stdout=PIPE, stderr=PIPE) 46 | stdout, _ = process.communicate() 47 | match = re.search(r"(?i)[0-9a-f]{32}", stdout or "") 48 | retVal = match.group(0) if match else None 49 | 50 | return retval[:7] if retVal else None -------------------------------------------------------------------------------- /thirdparty/colorama/initialise.py: -------------------------------------------------------------------------------- 1 | import atexit 2 | import sys 3 | 4 | from .ansitowin32 import AnsiToWin32 5 | 6 | 7 | orig_stdout = sys.stdout 8 | orig_stderr = sys.stderr 9 | 10 | wrapped_stdout = sys.stdout 11 | wrapped_stderr = sys.stderr 12 | 13 | atexit_done = False 14 | 15 | 16 | def reset_all(): 17 | AnsiToWin32(orig_stdout).reset_all() 18 | 19 | 20 | def init(autoreset=False, convert=None, strip=None, wrap=True): 21 | 22 | if not wrap and any([autoreset, convert, strip]): 23 | raise ValueError('wrap=False conflicts with any other arg=True') 24 | 25 | global wrapped_stdout, wrapped_stderr 26 | sys.stdout = wrapped_stdout = \ 27 | wrap_stream(orig_stdout, convert, strip, autoreset, wrap) 28 | sys.stderr = wrapped_stderr = \ 29 | wrap_stream(orig_stderr, convert, strip, autoreset, wrap) 30 | 31 | global atexit_done 32 | if not atexit_done: 33 | atexit.register(reset_all) 34 | atexit_done = True 35 | 36 | 37 | def deinit(): 38 | sys.stdout = orig_stdout 39 | sys.stderr = orig_stderr 40 | 41 | 42 | def reinit(): 43 | sys.stdout = wrapped_stdout 44 | sys.stderr = wrapped_stdout 45 | 46 | 47 | def wrap_stream(stream, convert, strip, autoreset, wrap): 48 | if wrap: 49 | wrapper = AnsiToWin32(stream, 50 | convert=convert, strip=strip, autoreset=autoreset) 51 | if wrapper.should_wrap(): 52 | stream = wrapper.stream 53 | return stream 54 | 55 | 56 | -------------------------------------------------------------------------------- /lib/core/convert.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | import sys 6 | from lib.core.settings import IS_WIN, UNICODE_ENCODING 7 | 8 | 9 | def singleTimeWarnMessage(message): # Cross-linked function 10 | sys.stdout.write(message) 11 | sys.stdout.write("\n") 12 | sys.stdout.flush() 13 | 14 | 15 | def stdoutencode(data): 16 | retVal = None 17 | 18 | try: 19 | data = data or "" 20 | 21 | # Reference: http://bugs.python.org/issue1602 22 | if IS_WIN: 23 | output = data.encode(sys.stdout.encoding, "replace") 24 | # 用?代替错误 25 | 26 | if '?' in output and '?' not in data: 27 | warnMsg = "cannot properly display Unicode characters " 28 | warnMsg += "inside Windows OS command prompt " 29 | warnMsg += "(http://bugs.python.org/issue1602). All " 30 | warnMsg += "unhandled occurances will result in " 31 | warnMsg += "replacement with '?' character. Please, find " 32 | warnMsg += "proper character representation inside " 33 | warnMsg += "corresponding output files. " 34 | singleTimeWarnMessage(warnMsg) 35 | 36 | retVal = output 37 | else: 38 | retVal = data.encode(sys.stdout.encoding) 39 | except Exception: 40 | retVal = data.encode(UNICODE_ENCODING) if isinstance(data, unicode) else data 41 | 42 | return retVal 43 | -------------------------------------------------------------------------------- /data/pass100.txt: -------------------------------------------------------------------------------- 1 | 123456789 2 | a123456 3 | 123456 4 | a123456789 5 | 1234567890 6 | woaini1314 7 | qq123456 8 | abc123456 9 | 123456a 10 | 123456789a 11 | 147258369 12 | zxcvbnm 13 | 987654321 14 | 12345678910 15 | abc123 16 | qq123456789 17 | 123456789. 18 | 7708801314520 19 | woaini 20 | 5201314520 21 | q123456 22 | 123456abc 23 | 1233211234567 24 | 123123123 25 | 123456. 26 | 0123456789 27 | asd123456 28 | aa123456 29 | 135792468 30 | q123456789 31 | abcd123456 32 | 12345678900 33 | woaini520 34 | woaini123 35 | zxcvbnm123 36 | 1111111111111111 37 | w123456 38 | aini1314 39 | abc123456789 40 | 111111 41 | woaini521 42 | qwertyuiop 43 | 1314520520 44 | 1234567891 45 | qwe123456 46 | asd123 47 | 000000 48 | 1472583690 49 | 1357924680 50 | 789456123 51 | 123456789abc 52 | z123456 53 | 1234567899 54 | aaa123456 55 | abcd1234 56 | www123456 57 | 123456789q 58 | 123abc 59 | qwe123 60 | w123456789 61 | 7894561230 62 | 123456qq 63 | zxc123456 64 | 123456789qq 65 | 1111111111 66 | 111111111 67 | 0000000000000000 68 | 1234567891234567 69 | qazwsxedc 70 | qwerty 71 | 123456.. 72 | zxc123 73 | asdfghjkl 74 | 0000000000 75 | 1234554321 76 | 123456q 77 | 123456aa 78 | 9876543210 79 | 110120119 80 | qaz123456 81 | qq5201314 82 | 123698745 83 | 5201314 84 | 000000000 85 | as123456 86 | 123123 87 | 5841314520 88 | z123456789 89 | 52013145201314 90 | a123123 91 | caonima 92 | a5201314 93 | wang123456 94 | abcd123 95 | 123456789.. 96 | woaini1314520 97 | 123456asd 98 | aa123456789 99 | 741852963 100 | a12345678 -------------------------------------------------------------------------------- /plugin/urlparser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # auther = Syst1m 4 | 5 | from urllib import parse 6 | 7 | def get_domain(url): 8 | 9 | """ 10 | added by cdxy May 8 Sun,2016 11 | 12 | Use: 13 | get_domain('http://cdxy.me:80/cdsa/cda/aaa.jsp?id=2#') 14 | 15 | Return: 16 | 'http://cdxy.me:80' 17 | """ 18 | p = parse.urlparse(url) 19 | return parse.urlunsplit([p.scheme, p.netloc, '', '', '']) 20 | 21 | def iterate_path(ori_str): 22 | """ 23 | 24 | Use: 25 | iterate_path_to_list('http://xxx.com:80/cdsa/cda/aaa.jsp?id=2#') 26 | 27 | Return: 28 | ['http://xxx.com:80/cdsa/cda/aaa.jsp?id=2#', 29 | 'http://xxx.com:80/' 30 | 'http://xxx.com:80/cdsa', 31 | 'http://xxx.com:80/cdsa/cda', 32 | 'http://xxx.com:80/cdsa/cda/aaa.jsp'] 33 | 34 | """ 35 | parser = parse.urlparse(ori_str) 36 | _path_list = parser.path.replace('//', '/').strip('/').split('/') 37 | _ans_list = set() 38 | _ans_list.add(ori_str) 39 | 40 | if not _path_list[0]: 41 | return _ans_list 42 | 43 | _ans_list.add(get_domain(ori_str)) 44 | s = '' 45 | for each in _path_list: 46 | s += '/' + each 47 | _ans_list.add(parse.urljoin(ori_str, s)) 48 | return _ans_list 49 | 50 | 51 | 52 | if __name__ =='__main__': 53 | 54 | 55 | url = "http://xxx.com:80/cdsa/cda/aaa.jsp?id=2#" 56 | 57 | iterate_path(url) 58 | 59 | # print(parse.urlparse(url)) 60 | # print(get_domain(url)) 61 | 62 | # for each in iterate_path(url): 63 | # print(each) 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /lib/controller/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | import os 6 | import time 7 | from lib.core.data import conf, logger 8 | from lib.core.exception import ToolkitValueException 9 | from lib.core.enums import API_MODE_NAME 10 | from lib.api.shodan.pack import ShodanSearch 11 | from lib.api.zoomeye.pack import ZoomEyeSearch 12 | from lib.api.google.pack import GoogleSearch 13 | from lib.api.fofa.pack import FofaSearch 14 | 15 | def runApi(): 16 | output = conf.API_OUTPUT 17 | dork = conf.API_DORK 18 | limit = conf.API_LIMIT 19 | logger.info('Activate %s API' % conf.API_MODE) 20 | if conf.API_MODE is API_MODE_NAME.ZOOMEYE: 21 | anslist = ZoomEyeSearch(query=dork, limit=limit, type=conf.ZOOMEYE_SEARCH_TYPE, offset=conf.API_OFFSET) 22 | elif conf.API_MODE is API_MODE_NAME.SHODAN: 23 | anslist = ShodanSearch(query=dork, limit=limit, offset=conf.API_OFFSET) 24 | elif conf.API_MODE is API_MODE_NAME.GOOGLE: 25 | anslist = GoogleSearch(query=dork, limit=limit, offset=conf.API_OFFSET) 26 | elif conf.API_MODE is API_MODE_NAME.FOFA: 27 | anslist = FofaSearch(query=dork, limit=limit, offset=conf.API_OFFSET) 28 | else: 29 | raise ToolkitValueException('Unknown API mode') 30 | 31 | tmpIpFile = os.path.join(output, '%s.txt' % (time.strftime('%Y%m%d%H%M%S'))) 32 | with open(tmpIpFile, 'w') as fp: 33 | for each in anslist: 34 | if isinstance(each, list): # for ZoomEye web type 35 | each = each[0] 36 | fp.write(each + '\n') 37 | return tmpIpFile -------------------------------------------------------------------------------- /lib/utils/config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | 6 | import ConfigParser 7 | from lib.core.data import paths, logger 8 | from lib.core.common import getSafeExString 9 | 10 | 11 | class ConfigFileParser: 12 | @staticmethod 13 | def _get_option(section, option): 14 | try: 15 | cf = ConfigParser.ConfigParser() 16 | cf.read(paths.CONFIG_PATH) 17 | return cf.get(section=section, option=option) 18 | except ConfigParser.NoOptionError as e: 19 | logger.warning('Missing essential options, please check your config-file.') 20 | logger.error(getSafeExString(e)) 21 | return '' 22 | 23 | def ZoomEyeEmail(self): 24 | return self._get_option('zoomeye', 'email') 25 | 26 | def ZoomEyePassword(self): 27 | return self._get_option('zoomeye', 'password') 28 | 29 | def ShodanApikey(self): 30 | return self._get_option('shodan', 'api_key') 31 | 32 | def BingApikey(self): 33 | return self._get_option('bing', 'api_key') 34 | 35 | def CloudEyeApikey(self): 36 | return self._get_option('cloudeye', 'api_key') 37 | 38 | def ColudEyePersonaldomain(self): 39 | return self._get_option('cloudeye', 'personal_domain') 40 | 41 | def GoogleProxy(self): 42 | return self._get_option('google', 'proxy') 43 | 44 | def GoogleDeveloperKey(self): 45 | return self._get_option('google', 'developer_key') 46 | 47 | def GoogleEngine(self): 48 | return self._get_option('google', 'search_engine') 49 | 50 | def FofaEmail(self): 51 | return self._get_option('fofa','email') 52 | 53 | def FofaKey(self): 54 | return self._get_option('fofa','api_key') 55 | -------------------------------------------------------------------------------- /lib/core/log.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # author = syst1m 4 | 5 | import logging 6 | import sys 7 | 8 | from lib.core.enums import CUSTOM_LOGGING 9 | 10 | logging.addLevelName(CUSTOM_LOGGING.SYSINFO, "*") 11 | logging.addLevelName(CUSTOM_LOGGING.SUCCESS, "+") 12 | logging.addLevelName(CUSTOM_LOGGING.ERROR, "-") 13 | logging.addLevelName(CUSTOM_LOGGING.WARNING, "!") 14 | 15 | LOGGER = logging.getLogger("TookitLogger") 16 | 17 | LOGGER_HANDLER = None 18 | try: 19 | from thirdparty.ansistrm.ansistrm import ColorizingStreamHandler 20 | 21 | try: 22 | LOGGER_HANDLER = ColorizingStreamHandler(sys.stdout) 23 | LOGGER_HANDLER.level_map[logging.getLevelName("*")] = (None, "cyan", False) 24 | LOGGER_HANDLER.level_map[logging.getLevelName("+")] = (None, "green", False) 25 | LOGGER_HANDLER.level_map[logging.getLevelName("-")] = (None, "red", False) 26 | LOGGER_HANDLER.level_map[logging.getLevelName("!")] = (None, "yellow", False) 27 | except Exception: 28 | LOGGER_HANDLER = logging.StreamHandler(sys.stdout) 29 | 30 | except ImportError: 31 | LOGGER_HANDLER = logging.StreamHandler(sys.stdout) 32 | 33 | FORMATTER = logging.Formatter("\r[%(levelname)s] %(message)s", "%H:%M:%S") 34 | 35 | LOGGER_HANDLER.setFormatter(FORMATTER) 36 | LOGGER.addHandler(LOGGER_HANDLER) 37 | LOGGER.setLevel(CUSTOM_LOGGING.WARNING) 38 | 39 | 40 | class MY_LOGGER: 41 | @staticmethod 42 | def success(msg): 43 | return LOGGER.log(CUSTOM_LOGGING.SUCCESS, msg) 44 | 45 | @staticmethod 46 | def info(msg): 47 | return LOGGER.log(CUSTOM_LOGGING.SYSINFO, msg) 48 | 49 | @staticmethod 50 | def warning(msg): 51 | return LOGGER.log(CUSTOM_LOGGING.WARNING, msg) 52 | 53 | @staticmethod 54 | def error(msg): 55 | return LOGGER.log(CUSTOM_LOGGING.ERROR, msg) -------------------------------------------------------------------------------- /plugin/useragent.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # auther = Syst1m 4 | 5 | import random 6 | from lib.core.data import conf, th, paths, logger 7 | from lib.core.common import getFileItems 8 | 9 | 10 | def _init_UAlist(path): 11 | infoMsg = "loading HTTP User-Agent header(s) from " 12 | infoMsg += "file '%s'" % path 13 | logger.info(infoMsg) 14 | 15 | # TODO 此处 conf.RANDOM_UA 在其他地方暂时没有用到 16 | conf.RANDOM_UA = True 17 | th.UA_LIST = getFileItems(path) 18 | 19 | successMsg = "Total: %d" % len(th.UA_LIST) 20 | logger.info(successMsg) 21 | 22 | 23 | def get_random_agent(path=paths.UA_LIST_PATH): 24 | if "UA_LIST" not in th: 25 | _init_UAlist(path) 26 | try: 27 | return random.sample(th.UA_LIST, 1)[0] 28 | except IOError as e: 29 | warnMsg = "unable to read HTTP User-Agent header " 30 | warnMsg += "file '%s'" % path 31 | logger.warning(warnMsg) 32 | return 33 | 34 | def ie(): 35 | return 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)' 36 | 37 | 38 | def chrome(): 39 | return 'Mozilla/5.0 (Windows NT 5.2) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30' 40 | 41 | 42 | def opera(): 43 | return 'Opera/9.80 (Windows NT 5.1; U; zh-cn) Presto/2.9.168 Version/11.50' 44 | 45 | 46 | def iphone(): 47 | return 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16' 48 | 49 | 50 | def google_bot(): 51 | return 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' 52 | 53 | 54 | def msn_bot(): 55 | return 'msnbot/1.1 (+http://search.msn.com/msnbot.htm)' 56 | 57 | 58 | def yahoo_bot(): 59 | return 'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)' 60 | -------------------------------------------------------------------------------- /plugin/extracts.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | # auther = Syst1m 4 | 5 | 6 | import re 7 | import requests 8 | 9 | 10 | def getIP(content, remove_duplicate=True, remove_private=False): 11 | """ 12 | Functions to extract IP from content string 13 | 14 | parameters: 15 | content 16 | remove_duplicate (default:true) 17 | remove_private (default:False) 18 | 19 | usage: 20 | from lib.util.extracts import * 21 | ip_list = getIP(content) 22 | 23 | private address: 24 | 10.0.0.0 - 10.255.255.255 25 | 172.16.0.0 - 172.31.255.255 26 | 192.168.0.0 - 192.168.255.255 27 | 127.0.0.0 - 127.255.255.255 28 | 29 | example: 30 | > print getIP('ffeac12.2.2.2asf^&10.10\n.1.1ffa2\n') 31 | ['12.2.2.2','10.10.1.1'] 32 | 33 | """ 34 | 35 | def _isPrivateIP(strict_IP): 36 | p1 = re.compile(r'^10\.|^172\.(?:1[6789]|2\d|31)\.|^192\.168\.|^127\.') 37 | return True if re.match(p1, strict_IP) else False 38 | 39 | content = content.replace('\n', ',') 40 | p = re.compile(r'(?:(?:2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(?:2[0-4]\d|25[0-5]|[01]?\d\d?)') 41 | _ = re.findall(p, content) 42 | ans = list(set(_)) if remove_duplicate else _ 43 | 44 | if remove_private: 45 | for each in ans: 46 | if _isPrivateIP(each): 47 | ans.remove(each) 48 | 49 | return ans 50 | 51 | 52 | def getTitle(input): 53 | """ 54 | Get title from html-content/ip/url 55 | 56 | :param input:html-content OR ip OR url 57 | :return text in
");
62 | while((a=in.read(b))!=-1){
63 | out.println(new String(b,0,a));
64 | }
65 | out.print("");
66 | }
67 | %>"""
68 |
69 | NMAP_PORTS_1000 = \
70 | ['1', '3', '4', '6', '7', '9', '13', '17', '19', '20', '21', '22', '23', '24', '25', '26', '30', '32', '33',
71 | '37', '42', '43', '49', '53', '70', '79', '80', '81', '82', '83', '84', '85', '88', '89', '90', '99', '100',
72 | '106', '109', '110', '111', '113', '119', '125', '135', '139', '143', '144', '146', '161', '163', '179', '199',
73 | '211', '212', '222', '254', '255', '256', '259', '264', '280', '301', '306', '311', '340', '366', '389', '406',
74 | '407', '416', '417', '425', '427', '443', '444', '445', '458', '464', '465', '481', '497', '500', '512', '513',
75 | '514', '515', '524', '541', '543', '544', '545', '548', '554', '555', '563', '587', '593', '616', '617', '625',
76 | '631', '636', '646', '648', '666', '667', '668', '683', '687', '691', '700', '705', '711', '714', '720', '722',
77 | '726', '749', '765', '777', '783', '787', '800', '801', '808', '843', '873', '880', '888', '898', '900', '901',
78 | '902', '903', '911', '912', '981', '987', '990', '992', '993', '995', '999', '1000', '1001', '1002', '1007',
79 | '1009', '1010', '1011', '1021', '1022', '1023', '1024', '1025', '1026', '1027', '1028', '1029', '1030', '1031',
80 | '1032', '1033', '1034', '1035', '1036', '1037', '1038', '1039', '1040', '1041', '1042', '1043', '1044', '1045',
81 | '1046', '1047', '1048', '1049', '1050', '1051', '1052', '1053', '1054', '1055', '1056', '1057', '1058', '1059',
82 | '1060', '1061', '1062', '1063', '1064', '1065', '1066', '1067', '1068', '1069', '1070', '1071', '1072', '1073',
83 | '1074', '1075', '1076', '1077', '1078', '1079', '1080', '1081', '1082', '1083', '1084', '1085', '1086', '1087',
84 | '1088', '1089', '1090', '1091', '1092', '1093', '1094', '1095', '1096', '1097', '1098', '1099', '1100', '1102',
85 | '1104', '1105', '1106', '1107', '1108', '1110', '1111', '1112', '1113', '1114', '1117', '1119', '1121', '1122',
86 | '1123', '1124', '1126', '1130', '1131', '1132', '1137', '1138', '1141', '1145', '1147', '1148', '1149', '1151',
87 | '1152', '1154', '1163', '1164', '1165', '1166', '1169', '1174', '1175', '1183', '1185', '1186', '1187', '1192',
88 | '1198', '1199', '1201', '1213', '1216', '1217', '1218', '1233', '1234', '1236', '1244', '1247', '1248', '1259',
89 | '1271', '1272', '1277', '1287', '1296', '1300', '1301', '1309', '1310', '1311', '1322', '1328', '1334', '1352',
90 | '1417', '1433', '1434', '1443', '1455', '1461', '1494', '1500', '1501', '1503', '1521', '1524', '1533', '1556',
91 | '1580', '1583', '1594', '1600', '1641', '1658', '1666', '1687', '1688', '1700', '1717', '1718', '1719', '1720',
92 | '1721', '1723', '1755', '1761', '1782', '1783', '1801', '1805', '1812', '1839', '1840', '1862', '1863', '1864',
93 | '1875', '1900', '1914', '1935', '1947', '1971', '1972', '1974', '1984', '1998', '1999', '2000', '2001', '2002',
94 | '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2013', '2020', '2021', '2022', '2030', '2033',
95 | '2034', '2035', '2038', '2040', '2041', '2042', '2043', '2045', '2046', '2047', '2048', '2049', '2065', '2068',
96 | '2099', '2100', '2103', '2105', '2106', '2107', '2111', '2119', '2121', '2126', '2135', '2144', '2160', '2161',
97 | '2170', '2179', '2190', '2191', '2196', '2200', '2222', '2251', '2260', '2288', '2301', '2323', '2366', '2381',
98 | '2382', '2383', '2393', '2394', '2399', '2401', '2492', '2500', '2522', '2525', '2557', '2601', '2602', '2604',
99 | '2605', '2607', '2608', '2638', '2701', '2702', '2710', '2717', '2718', '2725', '2800', '2809', '2811', '2869',
100 | '2875', '2909', '2910', '2920', '2967', '2968', '2998', '3000', '3001', '3003', '3005', '3006', '3007', '3011',
101 | '3013', '3017', '3030', '3031', '3052', '3071', '3077', '3128', '3168', '3211', '3221', '3260', '3261', '3268',
102 | '3269', '3283', '3300', '3301', '3306', '3322', '3323', '3324', '3325', '3333', '3351', '3367', '3369', '3370',
103 | '3371', '3372', '3389', '3390', '3404', '3476', '3493', '3517', '3527', '3546', '3551', '3580', '3659', '3689',
104 | '3690', '3703', '3737', '3766', '3784', '3800', '3801', '3809', '3814', '3826', '3827', '3828', '3851', '3869',
105 | '3871', '3878', '3880', '3889', '3905', '3914', '3918', '3920', '3945', '3971', '3986', '3995', '3998', '4000',
106 | '4001', '4002', '4003', '4004', '4005', '4006', '4045', '4111', '4125', '4126', '4129', '4224', '4242', '4279',
107 | '4321', '4343', '4443', '4444', '4445', '4446', '4449', '4550', '4567', '4662', '4848', '4899', '4900', '4998',
108 | '5000', '5001', '5002', '5003', '5004', '5009', '5030', '5033', '5050', '5051', '5054', '5060', '5061', '5080',
109 | '5087', '5100', '5101', '5102', '5120', '5190', '5200', '5214', '5221', '5222', '5225', '5226', '5269', '5280',
110 | '5298', '5357', '5405', '5414', '5431', '5432', '5440', '5500', '5510', '5544', '5550', '5555', '5560', '5566',
111 | '5631', '5633', '5666', '5678', '5679', '5718', '5730', '5800', '5801', '5802', '5810', '5811', '5815', '5822',
112 | '5825', '5850', '5859', '5862', '5877', '5900', '5901', '5902', '5903', '5904', '5906', '5907', '5910', '5911',
113 | '5915', '5922', '5925', '5950', '5952', '5959', '5960', '5961', '5962', '5963', '5987', '5988', '5989', '5998',
114 | '5999', '6000', '6001', '6002', '6003', '6004', '6005', '6006', '6007', '6009', '6025', '6059', '6100', '6101',
115 | '6106', '6112', '6123', '6129', '6156', '6346', '6389', '6502', '6510', '6543', '6547', '6565', '6566', '6567',
116 | '6580', '6646', '6666', '6667', '6668', '6669', '6689', '6692', '6699', '6779', '6788', '6789', '6792', '6839',
117 | '6881', '6901', '6969', '7000', '7001', '7002', '7004', '7007', '7019', '7025', '7070', '7100', '7103', '7106',
118 | '7200', '7201', '7402', '7435', '7443', '7496', '7512', '7625', '7627', '7676', '7741', '7777', '7778', '7800',
119 | '7911', '7920', '7921', '7937', '7938', '7999', '8000', '8001', '8002', '8007', '8008', '8009', '8010', '8011',
120 | '8021', '8022', '8031', '8042', '8045', '8080', '8081', '8082', '8083', '8084', '8085', '8086', '8087', '8088',
121 | '8089', '8090', '8093', '8099', '8100', '8180', '8181', '8192', '8193', '8194', '8200', '8222', '8254', '8290',
122 | '8291', '8292', '8300', '8333', '8383', '8400', '8402', '8443', '8500', '8600', '8649', '8651', '8652', '8654',
123 | '8701', '8800', '8873', '8888', '8899', '8994', '9000', '9001', '9002', '9003', '9009', '9010', '9011', '9040',
124 | '9050', '9071', '9080', '9081', '9090', '9091', '9099', '9100', '9101', '9102', '9103', '9110', '9111', '9200',
125 | '9207', '9220', '9290', '9415', '9418', '9485', '9500', '9502', '9503', '9535', '9575', '9593', '9594', '9595',
126 | '9618', '9666', '9876', '9877', '9878', '9898', '9900', '9917', '9929', '9943', '9944', '9968', '9998', '9999',
127 | '10000', '10001', '10002', '10003', '10004', '10009', '10010', '10012', '10024', '10025', '10082', '10180',
128 | '10215', '10243', '10566', '10616', '10617', '10621', '10626', '10628', '10629', '10778', '11110', '11111',
129 | '11967', '12000', '12174', '12265', '12345', '13456', '13722', '13782', '13783', '14000', '14238', '14441',
130 | '14442', '15000', '15002', '15003', '15004', '15660', '15742', '16000', '16001', '16012', '16016', '16018',
131 | '16080', '16113', '16992', '16993', '17877', '17988', '18040', '18101', '18988', '19101', '19283', '19315',
132 | '19350', '19780', '19801', '19842', '20000', '20005', '20031', '20221', '20222', '20828', '21571', '22939',
133 | '23502', '24444', '24800', '25734', '25735', '26214', '27000', '27352', '27353', '27355', '27356', '27715',
134 | '28201', '30000', '30718', '30951', '31038', '31337', '32768', '32769', '32770', '32771', '32772', '32773',
135 | '32774', '32775', '32776', '32777', '32778', '32779', '32780', '32781', '32782', '32783', '32784', '32785',
136 | '33354', '33899', '34571', '34572', '34573', '35500', '38292', '40193', '40911', '41511', '42510', '44176',
137 | '44442', '44443', '44501', '45100', '48080', '49152', '49153', '49154', '49155', '49156', '49157', '49158',
138 | '49159', '49160', '49161', '49163', '49165', '49167', '49175', '49176', '49400', '49999', '50000', '50001',
139 | '50002', '50003', '50006', '50300', '50389', '50500', '50636', '50800', '51103', '51493', '52673', '52822',
140 | '52848', '52869', '54045', '54328', '55055', '55056', '55555', '55600', '56737', '56738', '57294', '57797',
141 | '58080', '60020', '60443', '61532', '61900', '62078', '63331', '64623', '64680', '65000', '65129', '65389']
142 |
--------------------------------------------------------------------------------
/data/pass1000.txt:
--------------------------------------------------------------------------------
1 | password
2 | 123456
3 | 12345678
4 | 1234
5 | qwerty
6 | 12345
7 | dragon
8 | pussy
9 | baseball
10 | football
11 | letmein
12 | monkey
13 | 696969
14 | abc123
15 | mustang
16 | michael
17 | shadow
18 | master
19 | jennifer
20 | 111111
21 | 2000
22 | jordan
23 | superman
24 | harley
25 | 1234567
26 | fuckme
27 | hunter
28 | fuckyou
29 | trustno1
30 | ranger
31 | buster
32 | thomas
33 | tigger
34 | robert
35 | soccer
36 | fuck
37 | batman
38 | test
39 | pass
40 | killer
41 | hockey
42 | george
43 | charlie
44 | andrew
45 | michelle
46 | love
47 | sunshine
48 | jessica
49 | asshole
50 | 6969
51 | pepper
52 | daniel
53 | access
54 | 123456789
55 | 654321
56 | joshua
57 | maggie
58 | starwars
59 | silver
60 | william
61 | dallas
62 | yankees
63 | 123123
64 | ashley
65 | 666666
66 | hello
67 | amanda
68 | orange
69 | biteme
70 | freedom
71 | computer
72 | sexy
73 | thunder
74 | nicole
75 | ginger
76 | heather
77 | hammer
78 | summer
79 | corvette
80 | taylor
81 | fucker
82 | austin
83 | 1111
84 | merlin
85 | matthew
86 | 121212
87 | golfer
88 | cheese
89 | princess
90 | martin
91 | chelsea
92 | patrick
93 | richard
94 | diamond
95 | yellow
96 | bigdog
97 | secret
98 | asdfgh
99 | sparky
100 | cowboy
101 | camaro
102 | anthony
103 | matrix
104 | falcon
105 | iloveyou
106 | bailey
107 | guitar
108 | jackson
109 | purple
110 | scooter
111 | phoenix
112 | aaaaaa
113 | morgan
114 | tigers
115 | porsche
116 | mickey
117 | maverick
118 | cookie
119 | nascar
120 | peanut
121 | justin
122 | 131313
123 | money
124 | horny
125 | samantha
126 | panties
127 | steelers
128 | joseph
129 | snoopy
130 | boomer
131 | whatever
132 | iceman
133 | smokey
134 | gateway
135 | dakota
136 | cowboys
137 | eagles
138 | chicken
139 | dick
140 | black
141 | zxcvbn
142 | please
143 | andrea
144 | ferrari
145 | knight
146 | hardcore
147 | melissa
148 | compaq
149 | coffee
150 | booboo
151 | bitch
152 | johnny
153 | bulldog
154 | xxxxxx
155 | welcome
156 | james
157 | player
158 | ncc1701
159 | wizard
160 | scooby
161 | charles
162 | junior
163 | internet
164 | bigdick
165 | mike
166 | brandy
167 | tennis
168 | blowjob
169 | banana
170 | monster
171 | spider
172 | lakers
173 | miller
174 | rabbit
175 | enter
176 | mercedes
177 | brandon
178 | steven
179 | fender
180 | john
181 | yamaha
182 | diablo
183 | chris
184 | boston
185 | tiger
186 | marine
187 | chicago
188 | rangers
189 | gandalf
190 | winter
191 | bigtits
192 | barney
193 | edward
194 | raiders
195 | porn
196 | badboy
197 | blowme
198 | spanky
199 | bigdaddy
200 | johnson
201 | chester
202 | london
203 | midnight
204 | blue
205 | fishing
206 | 000000
207 | hannah
208 | slayer
209 | 11111111
210 | rachel
211 | sexsex
212 | redsox
213 | thx1138
214 | asdf
215 | marlboro
216 | panther
217 | zxcvbnm
218 | arsenal
219 | oliver
220 | qazwsx
221 | mother
222 | victoria
223 | 7777777
224 | jasper
225 | angel
226 | david
227 | winner
228 | crystal
229 | golden
230 | butthead
231 | viking
232 | jack
233 | iwantu
234 | shannon
235 | murphy
236 | angels
237 | prince
238 | cameron
239 | girls
240 | madison
241 | wilson
242 | carlos
243 | hooters
244 | willie
245 | startrek
246 | captain
247 | maddog
248 | jasmine
249 | butter
250 | booger
251 | angela
252 | golf
253 | lauren
254 | rocket
255 | tiffany
256 | theman
257 | dennis
258 | liverpoo
259 | flower
260 | forever
261 | green
262 | jackie
263 | muffin
264 | turtle
265 | sophie
266 | danielle
267 | redskins
268 | toyota
269 | jason
270 | sierra
271 | winston
272 | debbie
273 | giants
274 | packers
275 | newyork
276 | jeremy
277 | casper
278 | bubba
279 | 112233
280 | sandra
281 | lovers
282 | mountain
283 | united
284 | cooper
285 | driver
286 | tucker
287 | helpme
288 | fucking
289 | pookie
290 | lucky
291 | maxwell
292 | 8675309
293 | bear
294 | suckit
295 | gators
296 | 5150
297 | 222222
298 | shithead
299 | fuckoff
300 | jaguar
301 | monica
302 | fred
303 | happy
304 | hotdog
305 | tits
306 | gemini
307 | lover
308 | xxxxxxxx
309 | 777777
310 | canada
311 | nathan
312 | victor
313 | florida
314 | 88888888
315 | nicholas
316 | rosebud
317 | metallic
318 | doctor
319 | trouble
320 | success
321 | stupid
322 | tomcat
323 | warrior
324 | peaches
325 | apples
326 | fish
327 | qwertyui
328 | magic
329 | buddy
330 | dolphins
331 | rainbow
332 | gunner
333 | 987654
334 | freddy
335 | alexis
336 | braves
337 | cock
338 | 2112
339 | 1212
340 | cocacola
341 | xavier
342 | dolphin
343 | testing
344 | bond007
345 | member
346 | calvin
347 | voodoo
348 | 7777
349 | samson
350 | alex
351 | apollo
352 | fire
353 | tester
354 | walter
355 | beavis
356 | voyager
357 | peter
358 | porno
359 | bonnie
360 | rush2112
361 | beer
362 | apple
363 | scorpio
364 | jonathan
365 | skippy
366 | sydney
367 | scott
368 | red123
369 | power
370 | gordon
371 | travis
372 | beaver
373 | star
374 | jackass
375 | flyers
376 | boobs
377 | 232323
378 | zzzzzz
379 | steve
380 | rebecca
381 | scorpion
382 | doggie
383 | legend
384 | ou812
385 | yankee
386 | blazer
387 | bill
388 | runner
389 | birdie
390 | bitches
391 | 555555
392 | parker
393 | topgun
394 | asdfasdf
395 | heaven
396 | viper
397 | animal
398 | 2222
399 | bigboy
400 | 4444
401 | arthur
402 | baby
403 | private
404 | godzilla
405 | donald
406 | williams
407 | lifehack
408 | phantom
409 | dave
410 | rock
411 | august
412 | sammy
413 | cool
414 | brian
415 | platinum
416 | jake
417 | bronco
418 | paul
419 | mark
420 | frank
421 | heka6w2
422 | copper
423 | billy
424 | cumshot
425 | garfield
426 | willow
427 | cunt
428 | little
429 | carter
430 | slut
431 | albert
432 | 69696969
433 | kitten
434 | super
435 | jordan23
436 | eagle1
437 | shelby
438 | america
439 | 11111
440 | jessie
441 | house
442 | free
443 | 123321
444 | chevy
445 | bullshit
446 | white
447 | broncos
448 | horney
449 | surfer
450 | nissan
451 | 999999
452 | saturn
453 | airborne
454 | elephant
455 | marvin
456 | shit
457 | action
458 | adidas
459 | qwert
460 | kevin
461 | 1313
462 | explorer
463 | walker
464 | police
465 | christin
466 | december
467 | benjamin
468 | wolf
469 | sweet
470 | therock
471 | king
472 | online
473 | dickhead
474 | brooklyn
475 | teresa
476 | cricket
477 | sharon
478 | dexter
479 | racing
480 | penis
481 | gregory
482 | 0000
483 | teens
484 | redwings
485 | dreams
486 | michigan
487 | hentai
488 | magnum
489 | 87654321
490 | nothing
491 | donkey
492 | trinity
493 | digital
494 | 333333
495 | stella
496 | cartman
497 | guinness
498 | 123abc
499 | speedy
500 | buffalo
501 | kitty
502 | pimpin
503 | eagle
504 | einstein
505 | kelly
506 | nelson
507 | nirvana
508 | vampire
509 | xxxx
510 | playboy
511 | louise
512 | pumpkin
513 | snowball
514 | test123
515 | girl
516 | sucker
517 | mexico
518 | beatles
519 | fantasy
520 | ford
521 | gibson
522 | celtic
523 | marcus
524 | cherry
525 | cassie
526 | 888888
527 | natasha
528 | sniper
529 | chance
530 | genesis
531 | hotrod
532 | reddog
533 | alexande
534 | college
535 | jester
536 | passw0rd
537 | bigcock
538 | smith
539 | lasvegas
540 | carmen
541 | slipknot
542 | 3333
543 | death
544 | kimberly
545 | 1q2w3e
546 | eclipse
547 | 1q2w3e4r
548 | stanley
549 | samuel
550 | drummer
551 | homer
552 | montana
553 | music
554 | aaaa
555 | spencer
556 | jimmy
557 | carolina
558 | colorado
559 | creative
560 | hello1
561 | rocky
562 | goober
563 | friday
564 | bollocks
565 | scotty
566 | abcdef
567 | bubbles
568 | hawaii
569 | fluffy
570 | mine
571 | stephen
572 | horses
573 | thumper
574 | 5555
575 | pussies
576 | darkness
577 | asdfghjk
578 | pamela
579 | boobies
580 | buddha
581 | vanessa
582 | sandman
583 | naughty
584 | douglas
585 | honda
586 | matt
587 | azerty
588 | 6666
589 | shorty
590 | money1
591 | beach
592 | loveme
593 | 4321
594 | simple
595 | poohbear
596 | 444444
597 | badass
598 | destiny
599 | sarah
600 | denise
601 | vikings
602 | lizard
603 | melanie
604 | assman
605 | sabrina
606 | nintendo
607 | water
608 | good
609 | howard
610 | time
611 | 123qwe
612 | november
613 | xxxxx
614 | october
615 | leather
616 | bastard
617 | young
618 | 101010
619 | extreme
620 | hard
621 | password1
622 | vincent
623 | pussy1
624 | lacrosse
625 | hotmail
626 | spooky
627 | amateur
628 | alaska
629 | badger
630 | paradise
631 | maryjane
632 | poop
633 | crazy
634 | mozart
635 | video
636 | russell
637 | vagina
638 | spitfire
639 | anderson
640 | norman
641 | eric
642 | cherokee
643 | cougar
644 | barbara
645 | long
646 | 420420
647 | family
648 | horse
649 | enigma
650 | allison
651 | raider
652 | brazil
653 | blonde
654 | jones
655 | 55555
656 | dude
657 | drowssap
658 | jeff
659 | school
660 | marshall
661 | lovely
662 | 1qaz2wsx
663 | jeffrey
664 | caroline
665 | franklin
666 | booty
667 | molly
668 | snickers
669 | leslie
670 | nipples
671 | courtney
672 | diesel
673 | rocks
674 | eminem
675 | westside
676 | suzuki
677 | daddy
678 | passion
679 | hummer
680 | ladies
681 | zachary
682 | frankie
683 | elvis
684 | reggie
685 | alpha
686 | suckme
687 | simpson
688 | patricia
689 | 147147
690 | pirate
691 | tommy
692 | semperfi
693 | jupiter
694 | redrum
695 | freeuser
696 | wanker
697 | stinky
698 | ducati
699 | paris
700 | natalie
701 | babygirl
702 | bishop
703 | windows
704 | spirit
705 | pantera
706 | monday
707 | patches
708 | brutus
709 | houston
710 | smooth
711 | penguin
712 | marley
713 | forest
714 | cream
715 | 212121
716 | flash
717 | maximus
718 | nipple
719 | bobby
720 | bradley
721 | vision
722 | pokemon
723 | champion
724 | fireman
725 | indian
726 | softball
727 | picard
728 | system
729 | clinton
730 | cobra
731 | enjoy
732 | lucky1
733 | claire
734 | claudia
735 | boogie
736 | timothy
737 | marines
738 | security
739 | dirty
740 | admin
741 | wildcats
742 | pimp
743 | dancer
744 | hardon
745 | veronica
746 | fucked
747 | abcd1234
748 | abcdefg
749 | ironman
750 | wolverin
751 | remember
752 | great
753 | freepass
754 | bigred
755 | squirt
756 | justice
757 | francis
758 | hobbes
759 | kermit
760 | pearljam
761 | mercury
762 | domino
763 | 9999
764 | denver
765 | brooke
766 | rascal
767 | hitman
768 | mistress
769 | simon
770 | tony
771 | bbbbbb
772 | friend
773 | peekaboo
774 | naked
775 | budlight
776 | electric
777 | sluts
778 | stargate
779 | saints
780 | bondage
781 | brittany
782 | bigman
783 | zombie
784 | swimming
785 | duke
786 | qwerty1
787 | babes
788 | scotland
789 | disney
790 | rooster
791 | brenda
792 | mookie
793 | swordfis
794 | candy
795 | duncan
796 | olivia
797 | hunting
798 | blink182
799 | alicia
800 | 8888
801 | samsung
802 | bubba1
803 | whore
804 | virginia
805 | general
806 | passport
807 | aaaaaaaa
808 | erotic
809 | liberty
810 | arizona
811 | jesus
812 | abcd
813 | newport
814 | skipper
815 | rolltide
816 | balls
817 | happy1
818 | galore
819 | christ
820 | weasel
821 | 242424
822 | wombat
823 | digger
824 | classic
825 | bulldogs
826 | poopoo
827 | accord
828 | popcorn
829 | turkey
830 | jenny
831 | amber
832 | bunny
833 | mouse
834 | 007007
835 | titanic
836 | liverpool
837 | dreamer
838 | everton
839 | friends
840 | chevelle
841 | carrie
842 | gabriel
843 | psycho
844 | nemesis
845 | burton
846 | pontiac
847 | connor
848 | eatme
849 | lickme
850 | roland
851 | cumming
852 | mitchell
853 | ireland
854 | lincoln
855 | arnold
856 | spiderma
857 | patriots
858 | goblue
859 | devils
860 | eugene
861 | empire
862 | asdfg
863 | cardinal
864 | brown
865 | shaggy
866 | froggy
867 | qwer
868 | kawasaki
869 | kodiak
870 | people
871 | phpbb
872 | light
873 | 54321
874 | kramer
875 | chopper
876 | hooker
877 | honey
878 | whynot
879 | lesbian
880 | lisa
881 | baxter
882 | adam
883 | snake
884 | teen
885 | ncc1701d
886 | qqqqqq
887 | airplane
888 | britney
889 | avalon
890 | sandy
891 | sugar
892 | sublime
893 | stewart
894 | wildcat
895 | raven
896 | scarface
897 | elizabet
898 | 123654
899 | trucks
900 | wolfpack
901 | pervert
902 | lawrence
903 | raymond
904 | redhead
905 | american
906 | alyssa
907 | bambam
908 | movie
909 | woody
910 | shaved
911 | snowman
912 | tiger1
913 | chicks
914 | raptor
915 | 1969
916 | stingray
917 | shooter
918 | france
919 | stars
920 | madmax
921 | kristen
922 | sports
923 | jerry
924 | 789456
925 | garcia
926 | simpsons
927 | lights
928 | ryan
929 | looking
930 | chronic
931 | alison
932 | hahaha
933 | packard
934 | hendrix
935 | perfect
936 | service
937 | spring
938 | srinivas
939 | spike
940 | katie
941 | 252525
942 | oscar
943 | brother
944 | bigmac
945 | suck
946 | single
947 | cannon
948 | georgia
949 | popeye
950 | tattoo
951 | texas
952 | party
953 | bullet
954 | taurus
955 | sailor
956 | wolves
957 | panthers
958 | japan
959 | strike
960 | flowers
961 | pussycat
962 | chris1
963 | loverboy
964 | berlin
965 | sticky
966 | marina
967 | tarheels
968 | fisher
969 | russia
970 | connie
971 | wolfgang
972 | testtest
973 | mature
974 | bass
975 | catch22
976 | juice
977 | michael1
978 | nigger
979 | 159753
980 | women
981 | alpha1
982 | trooper
983 | hawkeye
984 | head
985 | freaky
986 | dodgers
987 | pakistan
988 | machine
989 | pyramid
990 | vegeta
991 | katana
992 | moose
993 | tinker
994 | coyote
995 | infinity
996 | inside
997 | pepsi
998 | letmein1
999 | bang
1000 | control
--------------------------------------------------------------------------------
/thirdparty/httplib2/socks.py:
--------------------------------------------------------------------------------
1 | """SocksiPy - Python SOCKS module.
2 |
3 | Version 1.00
4 |
5 | Copyright 2006 Dan-Haim. All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 | 1. Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 | 2. Redistributions in binary form must reproduce the above copyright notice,
12 | this list of conditions and the following disclaimer in the documentation
13 | and/or other materials provided with the distribution.
14 | 3. Neither the name of Dan Haim nor the names of his contributors may be used
15 | to endorse or promote products derived from this software without specific
16 | prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED
19 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
21 | EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE.
27 |
28 | This module provides a standard socket-like interface for Python
29 | for tunneling connections through SOCKS proxies.
30 |
31 | Minor modifications made by Christopher Gilbert (http://motomastyle.com/) for
32 | use in PyLoris (http://pyloris.sourceforge.net/).
33 |
34 | Minor modifications made by Mario Vilas (http://breakingcode.wordpress.com/)
35 | mainly to merge bug fixes found in Sourceforge.
36 | """
37 |
38 | import base64
39 | import socket
40 | import struct
41 | import sys
42 |
43 | if getattr(socket, "socket", None) is None:
44 | raise ImportError("socket.socket missing, proxy support unusable")
45 |
46 | PROXY_TYPE_SOCKS4 = 1
47 | PROXY_TYPE_SOCKS5 = 2
48 | PROXY_TYPE_HTTP = 3
49 | PROXY_TYPE_HTTP_NO_TUNNEL = 4
50 |
51 | _defaultproxy = None
52 | _orgsocket = socket.socket
53 |
54 |
55 | class ProxyError(Exception):
56 | pass
57 |
58 |
59 | class GeneralProxyError(ProxyError):
60 | pass
61 |
62 |
63 | class Socks5AuthError(ProxyError):
64 | pass
65 |
66 |
67 | class Socks5Error(ProxyError):
68 | pass
69 |
70 |
71 | class Socks4Error(ProxyError):
72 | pass
73 |
74 |
75 | class HTTPError(ProxyError):
76 | pass
77 |
78 |
79 | _generalerrors = (
80 | "success",
81 | "invalid data",
82 | "not connected",
83 | "not available",
84 | "bad proxy type",
85 | "bad input",
86 | )
87 |
88 | _socks5errors = (
89 | "succeeded",
90 | "general SOCKS server failure",
91 | "connection not allowed by ruleset",
92 | "Network unreachable",
93 | "Host unreachable",
94 | "Connection refused",
95 | "TTL expired",
96 | "Command not supported",
97 | "Address type not supported",
98 | "Unknown error",
99 | )
100 |
101 | _socks5autherrors = (
102 | "succeeded",
103 | "authentication is required",
104 | "all offered authentication methods were rejected",
105 | "unknown username or invalid password",
106 | "unknown error",
107 | )
108 |
109 | _socks4errors = (
110 | "request granted",
111 | "request rejected or failed",
112 | "request rejected because SOCKS server cannot connect to identd on the client",
113 | "request rejected because the client program and identd report different "
114 | "user-ids",
115 | "unknown error",
116 | )
117 |
118 |
119 | def setdefaultproxy(
120 | proxytype=None, addr=None, port=None, rdns=True, username=None, password=None
121 | ):
122 | """setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])
123 | Sets a default proxy which all further socksocket objects will use,
124 | unless explicitly changed.
125 | """
126 | global _defaultproxy
127 | _defaultproxy = (proxytype, addr, port, rdns, username, password)
128 |
129 |
130 | def wrapmodule(module):
131 | """wrapmodule(module)
132 |
133 | Attempts to replace a module's socket library with a SOCKS socket. Must set
134 | a default proxy using setdefaultproxy(...) first.
135 | This will only work on modules that import socket directly into the
136 | namespace;
137 | most of the Python Standard Library falls into this category.
138 | """
139 | if _defaultproxy != None:
140 | module.socket.socket = socksocket
141 | else:
142 | raise GeneralProxyError((4, "no proxy specified"))
143 |
144 |
145 | class socksocket(socket.socket):
146 | """socksocket([family[, type[, proto]]]) -> socket object
147 | Open a SOCKS enabled socket. The parameters are the same as
148 | those of the standard socket init. In order for SOCKS to work,
149 | you must specify family=AF_INET, type=SOCK_STREAM and proto=0.
150 | """
151 |
152 | def __init__(
153 | self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None
154 | ):
155 | _orgsocket.__init__(self, family, type, proto, _sock)
156 | if _defaultproxy != None:
157 | self.__proxy = _defaultproxy
158 | else:
159 | self.__proxy = (None, None, None, None, None, None)
160 | self.__proxysockname = None
161 | self.__proxypeername = None
162 | self.__httptunnel = True
163 |
164 | def __recvall(self, count):
165 | """__recvall(count) -> data
166 | Receive EXACTLY the number of bytes requested from the socket.
167 | Blocks until the required number of bytes have been received.
168 | """
169 | data = self.recv(count)
170 | while len(data) < count:
171 | d = self.recv(count - len(data))
172 | if not d:
173 | raise GeneralProxyError((0, "connection closed unexpectedly"))
174 | data = data + d
175 | return data
176 |
177 | def sendall(self, content, *args):
178 | """ override socket.socket.sendall method to rewrite the header
179 | for non-tunneling proxies if needed
180 | """
181 | if not self.__httptunnel:
182 | content = self.__rewriteproxy(content)
183 | return super(socksocket, self).sendall(content, *args)
184 |
185 | def __rewriteproxy(self, header):
186 | """ rewrite HTTP request headers to support non-tunneling proxies
187 | (i.e. those which do not support the CONNECT method).
188 | This only works for HTTP (not HTTPS) since HTTPS requires tunneling.
189 | """
190 | host, endpt = None, None
191 | hdrs = header.split("\r\n")
192 | for hdr in hdrs:
193 | if hdr.lower().startswith("host:"):
194 | host = hdr
195 | elif hdr.lower().startswith("get") or hdr.lower().startswith("post"):
196 | endpt = hdr
197 | if host and endpt:
198 | hdrs.remove(host)
199 | hdrs.remove(endpt)
200 | host = host.split(" ")[1]
201 | endpt = endpt.split(" ")
202 | if self.__proxy[4] != None and self.__proxy[5] != None:
203 | hdrs.insert(0, self.__getauthheader())
204 | hdrs.insert(0, "Host: %s" % host)
205 | hdrs.insert(0, "%s http://%s%s %s" % (endpt[0], host, endpt[1], endpt[2]))
206 | return "\r\n".join(hdrs)
207 |
208 | def __getauthheader(self):
209 | auth = self.__proxy[4] + b":" + self.__proxy[5]
210 | return "Proxy-Authorization: Basic " + base64.b64encode(auth).decode()
211 |
212 | def setproxy(
213 | self,
214 | proxytype=None,
215 | addr=None,
216 | port=None,
217 | rdns=True,
218 | username=None,
219 | password=None,
220 | headers=None,
221 | ):
222 | """setproxy(proxytype, addr[, port[, rdns[, username[, password]]]])
223 |
224 | Sets the proxy to be used.
225 | proxytype - The type of the proxy to be used. Three types
226 | are supported: PROXY_TYPE_SOCKS4 (including socks4a),
227 | PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP
228 | addr - The address of the server (IP or DNS).
229 | port - The port of the server. Defaults to 1080 for SOCKS
230 | servers and 8080 for HTTP proxy servers.
231 | rdns - Should DNS queries be preformed on the remote side
232 | (rather than the local side). The default is True.
233 | Note: This has no effect with SOCKS4 servers.
234 | username - Username to authenticate with to the server.
235 | The default is no authentication.
236 | password - Password to authenticate with to the server.
237 | Only relevant when username is also provided.
238 | headers - Additional or modified headers for the proxy connect
239 | request.
240 | """
241 | self.__proxy = (
242 | proxytype,
243 | addr,
244 | port,
245 | rdns,
246 | username.encode() if username else None,
247 | password.encode() if password else None,
248 | headers,
249 | )
250 |
251 | def __negotiatesocks5(self, destaddr, destport):
252 | """__negotiatesocks5(self,destaddr,destport)
253 | Negotiates a connection through a SOCKS5 server.
254 | """
255 | # First we'll send the authentication packages we support.
256 | if (self.__proxy[4] != None) and (self.__proxy[5] != None):
257 | # The username/password details were supplied to the
258 | # setproxy method so we support the USERNAME/PASSWORD
259 | # authentication (in addition to the standard none).
260 | self.sendall(struct.pack("BBBB", 0x05, 0x02, 0x00, 0x02))
261 | else:
262 | # No username/password were entered, therefore we
263 | # only support connections with no authentication.
264 | self.sendall(struct.pack("BBB", 0x05, 0x01, 0x00))
265 | # We'll receive the server's response to determine which
266 | # method was selected
267 | chosenauth = self.__recvall(2)
268 | if chosenauth[0:1] != chr(0x05).encode():
269 | self.close()
270 | raise GeneralProxyError((1, _generalerrors[1]))
271 | # Check the chosen authentication method
272 | if chosenauth[1:2] == chr(0x00).encode():
273 | # No authentication is required
274 | pass
275 | elif chosenauth[1:2] == chr(0x02).encode():
276 | # Okay, we need to perform a basic username/password
277 | # authentication.
278 | packet = bytearray()
279 | packet.append(0x01)
280 | packet.append(len(self.__proxy[4]))
281 | packet.extend(self.__proxy[4])
282 | packet.append(len(self.__proxy[5]))
283 | packet.extend(self.__proxy[5])
284 | self.sendall(packet)
285 | authstat = self.__recvall(2)
286 | if authstat[0:1] != chr(0x01).encode():
287 | # Bad response
288 | self.close()
289 | raise GeneralProxyError((1, _generalerrors[1]))
290 | if authstat[1:2] != chr(0x00).encode():
291 | # Authentication failed
292 | self.close()
293 | raise Socks5AuthError((3, _socks5autherrors[3]))
294 | # Authentication succeeded
295 | else:
296 | # Reaching here is always bad
297 | self.close()
298 | if chosenauth[1] == chr(0xFF).encode():
299 | raise Socks5AuthError((2, _socks5autherrors[2]))
300 | else:
301 | raise GeneralProxyError((1, _generalerrors[1]))
302 | # Now we can request the actual connection
303 | req = struct.pack("BBB", 0x05, 0x01, 0x00)
304 | # If the given destination address is an IP address, we'll
305 | # use the IPv4 address request even if remote resolving was specified.
306 | try:
307 | ipaddr = socket.inet_aton(destaddr)
308 | req = req + chr(0x01).encode() + ipaddr
309 | except socket.error:
310 | # Well it's not an IP number, so it's probably a DNS name.
311 | if self.__proxy[3]:
312 | # Resolve remotely
313 | ipaddr = None
314 | req = (
315 | req
316 | + chr(0x03).encode()
317 | + chr(len(destaddr)).encode()
318 | + destaddr.encode()
319 | )
320 | else:
321 | # Resolve locally
322 | ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))
323 | req = req + chr(0x01).encode() + ipaddr
324 | req = req + struct.pack(">H", destport)
325 | self.sendall(req)
326 | # Get the response
327 | resp = self.__recvall(4)
328 | if resp[0:1] != chr(0x05).encode():
329 | self.close()
330 | raise GeneralProxyError((1, _generalerrors[1]))
331 | elif resp[1:2] != chr(0x00).encode():
332 | # Connection failed
333 | self.close()
334 | if ord(resp[1:2]) <= 8:
335 | raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))
336 | else:
337 | raise Socks5Error((9, _socks5errors[9]))
338 | # Get the bound address/port
339 | elif resp[3:4] == chr(0x01).encode():
340 | boundaddr = self.__recvall(4)
341 | elif resp[3:4] == chr(0x03).encode():
342 | resp = resp + self.recv(1)
343 | boundaddr = self.__recvall(ord(resp[4:5]))
344 | else:
345 | self.close()
346 | raise GeneralProxyError((1, _generalerrors[1]))
347 | boundport = struct.unpack(">H", self.__recvall(2))[0]
348 | self.__proxysockname = (boundaddr, boundport)
349 | if ipaddr != None:
350 | self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)
351 | else:
352 | self.__proxypeername = (destaddr, destport)
353 |
354 | def getproxysockname(self):
355 | """getsockname() -> address info
356 | Returns the bound IP address and port number at the proxy.
357 | """
358 | return self.__proxysockname
359 |
360 | def getproxypeername(self):
361 | """getproxypeername() -> address info
362 | Returns the IP and port number of the proxy.
363 | """
364 | return _orgsocket.getpeername(self)
365 |
366 | def getpeername(self):
367 | """getpeername() -> address info
368 | Returns the IP address and port number of the destination
369 | machine (note: getproxypeername returns the proxy)
370 | """
371 | return self.__proxypeername
372 |
373 | def __negotiatesocks4(self, destaddr, destport):
374 | """__negotiatesocks4(self,destaddr,destport)
375 | Negotiates a connection through a SOCKS4 server.
376 | """
377 | # Check if the destination address provided is an IP address
378 | rmtrslv = False
379 | try:
380 | ipaddr = socket.inet_aton(destaddr)
381 | except socket.error:
382 | # It's a DNS name. Check where it should be resolved.
383 | if self.__proxy[3]:
384 | ipaddr = struct.pack("BBBB", 0x00, 0x00, 0x00, 0x01)
385 | rmtrslv = True
386 | else:
387 | ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))
388 | # Construct the request packet
389 | req = struct.pack(">BBH", 0x04, 0x01, destport) + ipaddr
390 | # The username parameter is considered userid for SOCKS4
391 | if self.__proxy[4] != None:
392 | req = req + self.__proxy[4]
393 | req = req + chr(0x00).encode()
394 | # DNS name if remote resolving is required
395 | # NOTE: This is actually an extension to the SOCKS4 protocol
396 | # called SOCKS4A and may not be supported in all cases.
397 | if rmtrslv:
398 | req = req + destaddr + chr(0x00).encode()
399 | self.sendall(req)
400 | # Get the response from the server
401 | resp = self.__recvall(8)
402 | if resp[0:1] != chr(0x00).encode():
403 | # Bad data
404 | self.close()
405 | raise GeneralProxyError((1, _generalerrors[1]))
406 | if resp[1:2] != chr(0x5A).encode():
407 | # Server returned an error
408 | self.close()
409 | if ord(resp[1:2]) in (91, 92, 93):
410 | self.close()
411 | raise Socks4Error((ord(resp[1:2]), _socks4errors[ord(resp[1:2]) - 90]))
412 | else:
413 | raise Socks4Error((94, _socks4errors[4]))
414 | # Get the bound address/port
415 | self.__proxysockname = (
416 | socket.inet_ntoa(resp[4:]),
417 | struct.unpack(">H", resp[2:4])[0],
418 | )
419 | if rmtrslv != None:
420 | self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)
421 | else:
422 | self.__proxypeername = (destaddr, destport)
423 |
424 | def __negotiatehttp(self, destaddr, destport):
425 | """__negotiatehttp(self,destaddr,destport)
426 | Negotiates a connection through an HTTP server.
427 | """
428 | # If we need to resolve locally, we do this now
429 | if not self.__proxy[3]:
430 | addr = socket.gethostbyname(destaddr)
431 | else:
432 | addr = destaddr
433 | headers = ["CONNECT ", addr, ":", str(destport), " HTTP/1.1\r\n"]
434 | wrote_host_header = False
435 | wrote_auth_header = False
436 | if self.__proxy[6] != None:
437 | for key, val in self.__proxy[6].iteritems():
438 | headers += [key, ": ", val, "\r\n"]
439 | wrote_host_header = key.lower() == "host"
440 | wrote_auth_header = key.lower() == "proxy-authorization"
441 | if not wrote_host_header:
442 | headers += ["Host: ", destaddr, "\r\n"]
443 | if not wrote_auth_header:
444 | if self.__proxy[4] != None and self.__proxy[5] != None:
445 | headers += [self.__getauthheader(), "\r\n"]
446 | headers.append("\r\n")
447 | self.sendall("".join(headers).encode())
448 | # We read the response until we get the string "\r\n\r\n"
449 | resp = self.recv(1)
450 | while resp.find("\r\n\r\n".encode()) == -1:
451 | resp = resp + self.recv(1)
452 | # We just need the first line to check if the connection
453 | # was successful
454 | statusline = resp.splitlines()[0].split(" ".encode(), 2)
455 | if statusline[0] not in ("HTTP/1.0".encode(), "HTTP/1.1".encode()):
456 | self.close()
457 | raise GeneralProxyError((1, _generalerrors[1]))
458 | try:
459 | statuscode = int(statusline[1])
460 | except ValueError:
461 | self.close()
462 | raise GeneralProxyError((1, _generalerrors[1]))
463 | if statuscode != 200:
464 | self.close()
465 | raise HTTPError((statuscode, statusline[2]))
466 | self.__proxysockname = ("0.0.0.0", 0)
467 | self.__proxypeername = (addr, destport)
468 |
469 | def connect(self, destpair):
470 | """connect(self, despair)
471 | Connects to the specified destination through a proxy.
472 | destpar - A tuple of the IP/DNS address and the port number.
473 | (identical to socket's connect).
474 | To select the proxy server use setproxy().
475 | """
476 | # Do a minimal input check first
477 | if (
478 | (not type(destpair) in (list, tuple))
479 | or (len(destpair) < 2)
480 | or (not isinstance(destpair[0], (str, bytes)))
481 | or (type(destpair[1]) != int)
482 | ):
483 | raise GeneralProxyError((5, _generalerrors[5]))
484 | if self.__proxy[0] == PROXY_TYPE_SOCKS5:
485 | if self.__proxy[2] != None:
486 | portnum = self.__proxy[2]
487 | else:
488 | portnum = 1080
489 | _orgsocket.connect(self, (self.__proxy[1], portnum))
490 | self.__negotiatesocks5(destpair[0], destpair[1])
491 | elif self.__proxy[0] == PROXY_TYPE_SOCKS4:
492 | if self.__proxy[2] != None:
493 | portnum = self.__proxy[2]
494 | else:
495 | portnum = 1080
496 | _orgsocket.connect(self, (self.__proxy[1], portnum))
497 | self.__negotiatesocks4(destpair[0], destpair[1])
498 | elif self.__proxy[0] == PROXY_TYPE_HTTP:
499 | if self.__proxy[2] != None:
500 | portnum = self.__proxy[2]
501 | else:
502 | portnum = 8080
503 | _orgsocket.connect(self, (self.__proxy[1], portnum))
504 | self.__negotiatehttp(destpair[0], destpair[1])
505 | elif self.__proxy[0] == PROXY_TYPE_HTTP_NO_TUNNEL:
506 | if self.__proxy[2] != None:
507 | portnum = self.__proxy[2]
508 | else:
509 | portnum = 8080
510 | _orgsocket.connect(self, (self.__proxy[1], portnum))
511 | if destpair[1] == 443:
512 | self.__negotiatehttp(destpair[0], destpair[1])
513 | else:
514 | self.__httptunnel = False
515 | elif self.__proxy[0] == None:
516 | _orgsocket.connect(self, (destpair[0], destpair[1]))
517 | else:
518 | raise GeneralProxyError((4, _generalerrors[4]))
519 |
--------------------------------------------------------------------------------