Showing preview only (1,647K chars total). Download the full file or copy to clipboard to get everything.
Repository: AlessandroZ/LaZagne
Branch: master
Commit: 858ff6f95f51
Files: 262
Total size: 1.5 MB
Directory structure:
gitextract_rh6z8oxz/
├── .github/
│ └── workflows/
│ ├── WinCompile.yml
│ └── lint_python.yml
├── .gitignore
├── .travis.yml
├── CHANGELOG
├── LICENSE
├── Linux/
│ ├── hook-sys.py
│ ├── laZagne.py
│ ├── lazagne/
│ │ ├── __init__.py
│ │ ├── config/
│ │ │ ├── __init__.py
│ │ │ ├── constant.py
│ │ │ ├── crypto/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── pbkdf2.py
│ │ │ │ ├── pyDes.py
│ │ │ │ └── pyaes/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── aes.py
│ │ │ │ ├── blockfeeder.py
│ │ │ │ └── util.py
│ │ │ ├── dico.py
│ │ │ ├── homes.py
│ │ │ ├── lib/
│ │ │ │ ├── __init__.py
│ │ │ │ └── memorpy/
│ │ │ │ ├── Address.py
│ │ │ │ ├── BaseProcess.py
│ │ │ │ ├── LinProcess.py
│ │ │ │ ├── LinStructures.py
│ │ │ │ ├── Locator.py
│ │ │ │ ├── MemWorker.py
│ │ │ │ ├── OSXProcess.py
│ │ │ │ ├── Process.py
│ │ │ │ ├── SunProcess.py
│ │ │ │ ├── WinProcess.py
│ │ │ │ ├── WinStructures.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── structures.py
│ │ │ │ ├── utils.py
│ │ │ │ ├── version.py
│ │ │ │ └── wintools.py
│ │ │ ├── manage_modules.py
│ │ │ ├── module_info.py
│ │ │ ├── run.py
│ │ │ ├── soft_import_module.py
│ │ │ └── write_output.py
│ │ └── softwares/
│ │ ├── __init__.py
│ │ ├── browsers/
│ │ │ ├── __init__.py
│ │ │ ├── chromium_based.py
│ │ │ ├── chromium_browsers.py
│ │ │ ├── firefox_browsers.py
│ │ │ ├── mozilla.py
│ │ │ └── opera.py
│ │ ├── chats/
│ │ │ ├── __init__.py
│ │ │ ├── pidgin.py
│ │ │ └── psi.py
│ │ ├── databases/
│ │ │ ├── __init__.py
│ │ │ ├── dbvis.py
│ │ │ ├── sqldeveloper.py
│ │ │ └── squirrel.py
│ │ ├── git/
│ │ │ ├── __init__.py
│ │ │ └── gitforlinux.py
│ │ ├── mails/
│ │ │ ├── __init__.py
│ │ │ ├── clawsmail.py
│ │ │ └── thunderbird_mails.py
│ │ ├── memory/
│ │ │ ├── __init__.py
│ │ │ ├── memorydump.py
│ │ │ └── mimipy.py
│ │ ├── sysadmin/
│ │ │ ├── __init__.py
│ │ │ ├── apachedirectorystudio.py
│ │ │ ├── aws.py
│ │ │ ├── cli.py
│ │ │ ├── docker.py
│ │ │ ├── env_variable.py
│ │ │ ├── filezilla.py
│ │ │ ├── fstab.py
│ │ │ ├── gftp.py
│ │ │ ├── grub.py
│ │ │ ├── keepassconfig.py
│ │ │ ├── rclone.py
│ │ │ ├── shadow.py
│ │ │ └── ssh.py
│ │ ├── wallet/
│ │ │ ├── __init__.py
│ │ │ ├── kde.py
│ │ │ └── libsecret.py
│ │ └── wifi/
│ │ ├── __init__.py
│ │ ├── wifi.py
│ │ └── wpa_supplicant.py
│ └── lazagne.spec
├── Mac/
│ ├── hook-sys.py
│ ├── laZagne.py
│ ├── lazagne/
│ │ ├── __init__.py
│ │ ├── config/
│ │ │ ├── __init__.py
│ │ │ ├── constant.py
│ │ │ ├── crypto/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── pyDes.py
│ │ │ │ └── pyaes/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── aes.py
│ │ │ │ ├── blockfeeder.py
│ │ │ │ └── util.py
│ │ │ ├── dico.py
│ │ │ ├── manage_modules.py
│ │ │ ├── module_info.py
│ │ │ ├── run.py
│ │ │ ├── soft_import_module.py
│ │ │ └── write_output.py
│ │ └── softwares/
│ │ ├── __init__.py
│ │ ├── browsers/
│ │ │ ├── __init__.py
│ │ │ ├── chrome.py
│ │ │ ├── firefox_browsers.py
│ │ │ └── mozilla.py
│ │ ├── mails/
│ │ │ ├── __init__.py
│ │ │ └── thunderbird.py
│ │ └── system/
│ │ ├── __init__.py
│ │ ├── chainbreaker.py
│ │ ├── chainbreaker_module/
│ │ │ ├── Schema.py
│ │ │ ├── __init__.py
│ │ │ ├── chainbreaker.py
│ │ │ └── pbkdf2.py
│ │ ├── hashdump.py
│ │ └── system.py
│ └── lazagne.spec
├── README.md
├── Windows/
│ ├── hook-sys.py
│ ├── laZagne.py
│ ├── lazagne/
│ │ ├── __init__.py
│ │ ├── config/
│ │ │ ├── DPAPI/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── blob.py
│ │ │ │ ├── credfile.py
│ │ │ │ ├── credhist.py
│ │ │ │ ├── crypto.py
│ │ │ │ ├── eater.py
│ │ │ │ ├── masterkey.py
│ │ │ │ ├── system.py
│ │ │ │ └── vault.py
│ │ │ ├── __init__.py
│ │ │ ├── change_privileges.py
│ │ │ ├── constant.py
│ │ │ ├── crypto/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── md4.py
│ │ │ │ ├── pyDes.py
│ │ │ │ ├── pyaes/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── aes.py
│ │ │ │ │ ├── blockfeeder.py
│ │ │ │ │ └── util.py
│ │ │ │ └── rc4.py
│ │ │ ├── dico.py
│ │ │ ├── dpapi_structure.py
│ │ │ ├── execute_cmd.py
│ │ │ ├── lib/
│ │ │ │ ├── __init__.py
│ │ │ │ └── memorpy/
│ │ │ │ ├── Address.py
│ │ │ │ ├── BaseProcess.py
│ │ │ │ ├── LinProcess.py
│ │ │ │ ├── LinStructures.py
│ │ │ │ ├── Locator.py
│ │ │ │ ├── MemWorker.py
│ │ │ │ ├── OSXProcess.py
│ │ │ │ ├── Process.py
│ │ │ │ ├── SunProcess.py
│ │ │ │ ├── WinProcess.py
│ │ │ │ ├── WinStructures.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── structures.py
│ │ │ │ ├── utils.py
│ │ │ │ ├── version.py
│ │ │ │ └── wintools.py
│ │ │ ├── manage_modules.py
│ │ │ ├── module_info.py
│ │ │ ├── run.py
│ │ │ ├── soft_import_module.py
│ │ │ ├── users.py
│ │ │ ├── winstructure.py
│ │ │ └── write_output.py
│ │ └── softwares/
│ │ ├── __init__.py
│ │ ├── browsers/
│ │ │ ├── __init__.py
│ │ │ ├── chromium_based.py
│ │ │ ├── chromium_browsers.py
│ │ │ ├── firefox_browsers.py
│ │ │ ├── ie.py
│ │ │ ├── mozilla.py
│ │ │ └── ucbrowser.py
│ │ ├── chats/
│ │ │ ├── __init__.py
│ │ │ ├── pidgin.py
│ │ │ ├── psi.py
│ │ │ └── skype.py
│ │ ├── databases/
│ │ │ ├── __init__.py
│ │ │ ├── dbvis.py
│ │ │ ├── postgresql.py
│ │ │ ├── robomongo.py
│ │ │ ├── sqldeveloper.py
│ │ │ └── squirrel.py
│ │ ├── games/
│ │ │ ├── __init__.py
│ │ │ ├── galconfusion.py
│ │ │ ├── kalypsomedia.py
│ │ │ ├── roguestale.py
│ │ │ └── turba.py
│ │ ├── git/
│ │ │ ├── __init__.py
│ │ │ └── gitforwindows.py
│ │ ├── mails/
│ │ │ ├── __init__.py
│ │ │ ├── outlook.py
│ │ │ └── thunderbird_mails.py
│ │ ├── maven/
│ │ │ ├── __init__.py
│ │ │ └── mavenrepositories.py
│ │ ├── memory/
│ │ │ ├── __init__.py
│ │ │ ├── keepass.py
│ │ │ ├── keethief.py
│ │ │ ├── libkeepass/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── common.py
│ │ │ │ ├── crypto.py
│ │ │ │ ├── hbio.py
│ │ │ │ ├── kdb4.py
│ │ │ │ └── pureSalsa20.py
│ │ │ ├── memorydump.py
│ │ │ └── onepassword.py
│ │ ├── multimedia/
│ │ │ ├── __init__.py
│ │ │ └── eyecon.py
│ │ ├── php/
│ │ │ ├── __init__.py
│ │ │ └── composer.py
│ │ ├── svn/
│ │ │ ├── __init__.py
│ │ │ └── tortoise.py
│ │ ├── sysadmin/
│ │ │ ├── __init__.py
│ │ │ ├── apachedirectorystudio.py
│ │ │ ├── coreftp.py
│ │ │ ├── cyberduck.py
│ │ │ ├── d3des.py
│ │ │ ├── filezilla.py
│ │ │ ├── filezillaserver.py
│ │ │ ├── ftpnavigator.py
│ │ │ ├── iisapppool.py
│ │ │ ├── iiscentralcertp.py
│ │ │ ├── keepassconfig.py
│ │ │ ├── mRemoteNG.py
│ │ │ ├── opensshforwindows.py
│ │ │ ├── openvpn.py
│ │ │ ├── puttycm.py
│ │ │ ├── rclone.py
│ │ │ ├── rdpmanager.py
│ │ │ ├── unattended.py
│ │ │ ├── vnc.py
│ │ │ ├── winscp.py
│ │ │ └── wsl.py
│ │ ├── wifi/
│ │ │ ├── __init__.py
│ │ │ └── wifi.py
│ │ └── windows/
│ │ ├── __init__.py
│ │ ├── autologon.py
│ │ ├── cachedump.py
│ │ ├── creddump7/
│ │ │ ├── __init__.py
│ │ │ ├── addrspace.py
│ │ │ ├── newobj.py
│ │ │ ├── object.py
│ │ │ ├── types.py
│ │ │ └── win32/
│ │ │ ├── __init__.py
│ │ │ ├── domcachedump.py
│ │ │ ├── hashdump.py
│ │ │ ├── lsasecrets.py
│ │ │ └── rawreg.py
│ │ ├── credfiles.py
│ │ ├── credman.py
│ │ ├── hashdump.py
│ │ ├── lsa_secrets.py
│ │ ├── ppypykatz.py
│ │ ├── vault.py
│ │ ├── vaultfiles.py
│ │ └── windows.py
│ └── lazagne.spec
└── requirements.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/WinCompile.yml
================================================
name: Build and Upload LaZagne Release
on:
push:
tags:
- 'v*' # Matches tags like v1.0, v20.15.10
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Build Executable with PyInstaller
run: |
cd Windows
pyinstaller lazagne.spec
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Windows/dist/lazagne.exe
asset_name: LaZagne.exe
asset_content_type: application/octet-stream
================================================
FILE: .github/workflows/lint_python.yml
================================================
name: lint_python
on: [pull_request, push]
jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install --upgrade pip setuptools wheel
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear
flake8-comprehensions isort mypy pytest pyupgrade
- run: bandit --recursive --skip B101,B105,B106,B108,B110,B112,B303,B311,B314,B318,B324,B404,B405,B408,B413,B602,B603,B605,B607,B608 .
- run: black --check . || true
- run: codespell || true # --ignore-words-list="" --skip="*.css,*.js,*.lock"
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88
--show-source --statistics
- run: isort --check-only --profile black . || true
- run: pip install -r requirements.txt
- run: mkdir --parents --verbose .mypy_cache
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
- run: pytest . || pytest --doctest-modules . || true
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
# - run: safety check
================================================
FILE: .gitignore
================================================
.idea
*.pyc
venv
.DS_Store
================================================
FILE: .travis.yml
================================================
os: linux
dist: focal
language: python
lint_steps: &lint_steps
before_install:
- pip install --upgrade pip
- pip install flake8
script: flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics
jobs:
include:
- name: "Test and deploy on Python 2.7"
dist: xenial # Wine is not ready for Ubuntu bionic or focal
python: '2.7'
- name: "Build on Python 2.7 on macOS"
os: osx
language: shell # 'language: python' is not yet supported on Travis CI macOS
before_install:
- python -m pip install --upgrade pip
- pip install "pyinstaller<4.0" -r requirements.txt # v4.0 drops support for legacy Python
script:
- pyinstaller --onefile Mac/laZagne.py
- ls -l dist # See file size (4.8 mb), etc.
- dist/laZagne all
- name: "Lint on Python 2.7"
python: '2.7'
<<: *lint_steps
- name: "Lint on Python 3.8"
python: '3.8'
<<: *lint_steps
before_install:
- sudo add-apt-repository ppa:ubuntu-wine/ppa -y
- sudo apt-get update -qq
- sudo apt-get install -qq wine
- wget https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi --output-document=python.msi
- wine msiexec /i python.msi /qn
- wget https://files.pythonhosted.org/packages/83/cc/2e39fa39b804f7b6e768a37657d75eb14cd917d1f43f376dad9f7c366ccf/pywin32-224-cp27-cp27m-win_amd64.whl --output-document=pywin32-224-cp27-none-win_amd64.whl
- wine c:\\Python27\\python.exe -m pip install pywin32-224-cp27-none-win_amd64.whl
- wine c:\\Python27\\python.exe -m pip install "pyinstaller<4.0" -r requirements.txt
- wine c:\\Python27\\Scripts\\pyinstaller --noconsole --onefile Windows/lazagne.spec
- ls -l dist # See file size (4.8 mb), etc.
install: true # do not repeat `pip install -r requirements.txt`
script:
- wine Z:\\home\\travis\\build\\AlessandroZ\\LaZagne\\dist\\laZagne.exe all
before_deploy:
- tar -zcvf lazagne.tar.gz dist/lazagne.exe
deploy:
provider: releases
skip_cleanup: true
overwrite: true
api_key:
secure: TDw9TTOMSJ+zMOVVrEcCCKG+6eDzrfOPz3dUN6EM0QgDZ0gstsf3T24JIV0wsZQYwY5ceYBlZu33/6Rb62b8U/tOaZXYSy9LWmFzqSRH15RvLBBA+2PtbojYNZw1YymGSiG2GBuNHu0VlkDvR/ogTvJ8lY731MPdxUdXibJMfsBVcoKped0ss+cXsKZV0C8FYz3RU6EJsx0oDLHJmLn30Lji1DA7nTO/SJ5AX6ZD7Qp34/YlwkWdih/x0v8uYUfqsiuqNhmfVcheJua7JaFlfwuJj1IDT0UDVaFQn+xkxkK+Bn+h7qjOUOKYzUEfxh78Q6iDd1YtCETR0NPTlNeDDv6LfJoP9gsE68WWBAFhijnRvF084yN1ciQ1Ch+hITANgpcF2cmMg8Tu+YLeYDWfLi8/G7u4TYAQ7Pmvce6PweP9sQ6WGvsC2H+6xNEAjMCdMoCldPfaDdGprIGtx3DD8NyqyVL6S31HkJ5gcPUcarqjGvUVWETkVUVuAQp9pgdYyx52SHifB0tbvie9NkjVdRjBCy3Oxp5bZvdzj19bAEGWu6QFwZibAtHXDq6IdsmKefktrUQd5QUbx0/Y0gpnMuD5ghSoUVdxA9FY8CyD853R13nMLJN5LedV6TFjx/8DgHRIATBSoiLi8L6/fdZAG0yeH/lBcqbLfTM6tLS5HBo=
file:
- dist/lazagne.exe
- lazagne.tar.gz
on:
tags: true
all_branches: true
repo: AlessandroZ/LaZagne
================================================
FILE: CHANGELOG
================================================
LaZagne 2.4
- Windows / Linux / Mac
* Big code review and lots of bug fixed
* PEP8 Style (thanks to @ingested)
* Pycrypto denpendency removed
- Linux
* Work with Python 3
* Removing external libs to decrypt KDE secrets (only use dbus)
* Bug fix
- Windows
* Adding pypykatz module - awesome work from @skelsec
- https://github.com/skelsec/pypykatz
* Adding VNC module - thanks to @aldorm
* Manage more than 26 different browsers now (thanks to @ingested)
* Removing construct on DPAPI function (lots of bug fix on DPAPI as well)
* Removing psutil dependency
LaZagne 2.3.2 (22/03/2018)
- Windows
* Big code review
* Lots of minor bug fixed
* If windows user password found => domain passwords retrieved from credentials files
* If windows user password not found => DPAPI hash printed to bruteforce with john or hashcat (no admin privilege required)
* New modules added postgresql and psi-im (thanks to @m41nt41n3r)
* XP managed
* Adding support for newest firefox version. Awesome work from lclevy: https://github.com/lclevy/firepwd
* Adding Wdigest passwords (using mimikatz signature)
* Works on Vista / Win7 x86 and x64
* Thanks to
* n1nj4sec for https://github.com/n1nj4sec/memorpy/
* Francesco Picasso for https://github.com/RealityNet/hotoloti/blob/master/volatility/mimikatz.py
* Note: right now, LaZagne x86 cannot read memory from a x64 process (so some modules cannot work using this build such as wdigest passwords)
* That's why, two lazagne binaries have been built (x86 and x64).
- Linux
* Big code review
* Lots of minor bug fixed
* Adding support for newest firefox version. Awesome work from lclevy: https://github.com/lclevy/firepwd
LaZagne 2.3.1 (18/10/2017)
- Only Windows
* Fix unicode issue (#154)
* Print less local output when a specific drive has been choosed (#156)
LaZagne 2.3 (31/08/2017)
- Only Windows
* Bug "UnicodeDecodeError" resolved (#134)
* Support many alphabets (for chinese, russian, ... passwords)
* Well managed when password are written to files (Lazagne.exe all -oA), not always correct when printed on the console (depend on the system encoding)
* New module added
* CocCoc browser supported (#141)
* Quiet mode added to not print anything on the console (#140) => lazagne.exe all -quiet
* Retrieve passwords from another drive (#142) => lazagne all -drive D
* lsa secrets are well written on files (when -oA, -oJ or -oN options are used)
LaZagne 2.2 (17/05/2017)
- Only Windows
* Bug correction: #118
LaZagne 2.1 (28/04/2017)
- Only Windows
* Removing many dependencies (win32api, win32crypt, win32xxx, colorama, etc.) using ctypes
* Adding little modules
* Retrieve passwords when autologon is enabled
* Retrieve passwords stored in unattended files
* Using creddump to retrieve system hashes + LSA secrets
* Retrieve chrome passwords from multiple profiles
* Little bugs fixed + some code review
- Linux
* Adding mimipy module from n1nj4sec (https://github.com/n1nj4sec/mimipy) to retrieve the system password from memory (need root privileges)
LaZagne 2.0 (20/12/2016)
- Only Windows:
* Only one process is launched (impersonnation is done using "ImpersonateLoggedOnUser" and no more "CreateProcessAsUser")
* No more temporary files written on the disk
* Uses of powerdump from empire (thanks to adaptivethreat) to avoid writing hives on the disk (avoid "reg save ...")
* Better way to catch errors
* Json fixes (output to be more "human readable" + error encoding)
* Code cleaned
* New category added called "memory": used to retrieve password in memory
* KeeThief added (thanks to adaptivethreat) - retrieve keepass (version 2.x) password from memory
* Powershell code used from https://github.com/adaptivethreat/KeeThief/
* Browser passwords present in memory could be retrieved
* Thanks to n1nj4sec for his awesome project "memorpy"
* https://github.com/n1nj4sec/memorpy
* New category added called "php":
* New module "PHP Composer" (thanks to righettod => https://github.com/righettod)
LaZagne 1.8 (15/11/2016)
- Only Windows:
* Lots of minor bugs fixed
* Firefox
* when many profiles used (thanks to Aorimn) or when profiles.ini is corrupted
* IE: retrieving historic list or windows vault
* Writing json file
* etc...
LaZagne 1.7 (11/09/2016)
- Only Windows:
* New modules (thanks to righettod => https://github.com/righettod):
* Robomongo - MongoDB client
* Internet Explorer bug fix (for windows 7)
LaZagne 1.6 (05/09/2016)
- Only Windows:
* Internet Explorer history retrieved using powershell - no more dll written on the disk (all in memory)
* Internet Explorer passwords stored in the credential manager retrieved (for Win8 and higher)
* Wifi bug fixed
LaZagne 1.5 (01/08/2016)
- Only Windows:
* New modules (thanks to righettod => https://github.com/righettod):
* Maven java build tool
* Apache Directory Studio
* "OpenSSH" application
LaZagne 1.4 (21/07/2016)
- Only Windows:
* New module: Git for Windows (thanks to righettod => https://github.com/righettod)
LaZagne 1.3 (02/07/2016)
- Only Windows
See "User impersonnation" in README for more information
* User impersonation (high privileges needed)
* Stealing user process token (when other user processes are running on the system)
* All credentials can be retrieved (Chrome, Firefox, etc.)
* Browsing file system (ex: C:\Users\<user>\...)
* Only software's passwords which do not use Windows API to encrypt it, can be retrieved (Firefox, Jitsi, Pidgin, etc.).
* Json output has been implemented (txt output is still present with the options -oN)
* Lazagne all -oJ => Json output
* Standalone lighter (from 18 Mo to 6 Mo) => Thanks to the new version of Pyinstaller
* Fix some bugs
LaZagne 1.1 (22/10/2015)
- Only Windows
* New category: games (Thanks to David Lodge)
* Galcon Fusion
* Kalypso Media Launcher
* Rogue's Tale
* Turba
LaZagne 1.0 (04/10/2015)
- Only Windows
* Fix chrome database locked
* Fix windows secrets bug
* Fix opera bug
- For Linux
* Fix opera bug
LaZagne 0.9.1 (09/07/2015)
- Only Windows
* Fix mastepassword check error - mozilla
* Fix database error - mozilla
- For Linux
* Fix encoding error
LaZagne 0.9 (01/07/2015)
- Only Windows
* Fix Opera bug (thanks to rolandstarke)
* Fix encoding error for generic network passwords
- For Windows / Linux
* Version number available from the main menu (before: Lazagne all --version => now: Lazagne --version)
* spelling mistake corrected
LaZagne 0.8 (11/06/2015)
- Only Linux
* /etc/shadow modules (dictionary attack on hash)
- For Windows / Linux
* Management of the following options "-path" (for dictionary attack) and "-b" (for bruteforce attack) in a different way. Used as general options and not implemented by module. Using the same option, the file will be used by different modules; example: to find the mozilla masterpassword, the unix system password (from the hash), used by skype (for windows), etc.
LaZagne 0.71 (04/06/2015)
- Only Linux
* Wifi password module from WPA Supplicant implemented (by rpesche)
LaZagne 0.7 (29/05/2015)
- For Windows / Linux
* Fix mozilla bug (special characters were not printed)
LaZagne 0.6 (26/05/2015)
- For Windows / Linux
* Firefox / Thunderbird: No more dependency with nss library (many thanks to Laurent Clevy for its awesome technic: https://github.com/lclevy/firepwd)
* Fix opera bug
- Only Windows
* WinSCP false positive removed (when SSH key is used)
LaZagne 0.5 (21/05/2015)
- For Windows
* Fix chrome bug
LaZagne 0.5 (20/05/2015)
- For Windows / Linux
* 2 levels of verbosity added for debugs
* try / except more verbose depending on the verbosity levels
* dico file moved from browsers to config repository (used for dictionary attack)
* new Filezilla versions managed
- Only Windows
* check weak passwords (logins equal to password) for windows account when hashes (nthash) have been found
* function to write the output modified on windows module
* WConio replaced by colorama for the window color
* Skype: try a dictionary attack (500 famous password) when the hash has been retrieved
LaZagne 0.4 (12/05/2015)
- For Linux
* Kwallet module implemented (by quentin hardy)
LaZagne 0.4 (05/05/2015)
- For Windows
* Fix ie bugs
* Fix thunderbird bug
LaZagne 0.3 (30/04/2015)
- For Windows
* Flexibility on the code: much more easy to add modules
* Passwords found previously are used to test firefox masterpassword if set
- For Linux
* Flexibility on the code: much more easy to add modules
* Passwords found previously are used to test firefox masterpassword if set
* 2 different standalones (32 bits / 64 bits)
LaZagne 0.2 (27/04/2015)
- For Windows
* New modules: Windows hashes + LSA Secrets
* Passwords found previously are used to test windows hashes and firefox masterpassword
* 500 most famous passwords are used to retrieve the windows password (once we get the hashes)
* Wifi bug fixed: only one password was printed
* I.E bug fixed
================================================
FILE: LICENSE
================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
================================================
FILE: Linux/hook-sys.py
================================================
from lazagne.config.manage_modules import get_modules_names
from lazagne.softwares.browsers.chromium_browsers import chromium_based_module_location
from lazagne.softwares.browsers.firefox_browsers import mozilla_module_location
all_hidden_imports_module_names = get_modules_names() + [mozilla_module_location, chromium_based_module_location]
hiddenimports = [package_name for package_name, module_name in all_hidden_imports_module_names]
if __name__ == "__main__":
print("\r\n".join(hiddenimports))
================================================
FILE: Linux/laZagne.py
================================================
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
##############################################################################
# #
# By Alessandro ZANNI #
# #
##############################################################################
# Disclaimer: Do Not Use this program for illegal purposes ;)
import sys
import os
import argparse
import logging
from lazagne.config.write_output import write_in_file, StandardOutput
from lazagne.config.manage_modules import get_categories
from lazagne.config.constant import constant
from lazagne.config.run import create_module_dic, run_lazagne
import time
constant.st = StandardOutput() # Object used to manage the output / write functions (cf write_output file)
modules = create_module_dic()
def output(output_dir=None, txt_format=False, json_format=False, all_format=False):
if output_dir:
if os.path.isdir(output_dir):
constant.folder_name = output_dir
else:
print('[!] Specify a directory, not a file !')
if txt_format:
constant.output = 'txt'
if json_format:
constant.output = 'json'
if all_format:
constant.output = 'all'
if constant.output:
if not os.path.exists(constant.folder_name):
os.makedirs(constant.folder_name)
# constant.file_name_results = 'credentials' # let the choice of the name to the user
if constant.output != 'json':
constant.st.write_header()
def quiet_mode(is_quiet_mode=False):
if is_quiet_mode:
constant.quiet_mode = True
def verbosity(verbose=0):
# Write on the console + debug file
if verbose == 0:
level = logging.CRITICAL
elif verbose == 1:
level = logging.INFO
elif verbose >= 2:
level = logging.DEBUG
formatter = logging.Formatter(fmt='%(message)s')
stream = logging.StreamHandler(sys.stdout)
stream.setFormatter(formatter)
root = logging.getLogger()
root.setLevel(level)
# If other logging are set
for r in root.handlers:
r.setLevel(logging.CRITICAL)
root.addHandler(stream)
def clean_args(arg):
"""
Remove not necessary values to get only subcategories
"""
for i in ['output', 'write_normal', 'write_json', 'write_all', 'verbose', 'auditType', 'quiet']:
try:
del arg[i]
except Exception:
pass
return arg
def runLaZagne(category_selected='all', subcategories={}):
"""
This function will be removed, still there for compatibility with other tools
Everything is on the config/run.py file
"""
for pwd_dic in run_lazagne(category_selected=category_selected, subcategories=subcategories):
yield pwd_dic
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=constant.st.banner, formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--version', action='version', version='Version ' + str(constant.CURRENT_VERSION),
help='laZagne version')
# ------------------------------------------- Permanent options -------------------------------------------
# Version and verbosity
PPoptional = argparse.ArgumentParser(
add_help=False,
formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=constant.max_help))
PPoptional._optionals.title = 'optional arguments'
PPoptional.add_argument('-v', dest='verbose', action='count', default=0, help='increase verbosity level')
PPoptional.add_argument('-quiet', dest='quiet', action='store_true', default=False,
help='quiet mode: nothing is printed to the output')
# Output
PWrite = argparse.ArgumentParser(
add_help=False,
formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=constant.max_help)
)
PWrite._optionals.title = 'Output'
PWrite.add_argument('-oN', dest='write_normal', action='store_true', default=None,
help='output file in a readable format')
PWrite.add_argument('-oJ', dest='write_json', action='store_true', default=None,
help='output file in a json format')
PWrite.add_argument('-oA', dest='write_all', action='store_true', default=None, help='output file in all format')
PWrite.add_argument('-output', dest='output', action='store', default='.',
help='destination path to store results (default:.)')
# -------------------------------- Add options and suboptions to all modules ------------------------
all_subparser = []
all_categories = get_categories()
for c in all_categories:
all_categories[c]['parser'] = argparse.ArgumentParser(
add_help=False,
formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=constant.max_help))
all_categories[c]['parser']._optionals.title = all_categories[c]['help']
# Manage options
all_categories[c]['subparser'] = []
for module in modules[c]:
m = modules[c][module]
all_categories[c]['parser'].add_argument(m.options['command'], action=m.options['action'],
dest=m.options['dest'], help=m.options['help'])
# Manage all sub options by modules
if m.suboptions:
tmp = []
for sub in m.suboptions:
tmp_subparser = argparse.ArgumentParser(
add_help=False,
formatter_class=lambda prog: argparse.HelpFormatter(
prog,
max_help_position=constant.max_help
)
)
tmp_subparser._optionals.title = sub['title']
if 'type' in sub:
tmp_subparser.add_argument(sub['command'], type=sub['type'], action=sub['action'],
dest=sub['dest'], help=sub['help'])
else:
tmp_subparser.add_argument(sub['command'], action=sub['action'], dest=sub['dest'],
help=sub['help'])
tmp.append(tmp_subparser)
all_subparser.append(tmp_subparser)
all_categories[c]['subparser'] += tmp
# ------------------------------------------- Print all -------------------------------------------
parents = [PPoptional] + all_subparser + [PWrite]
dic = {'all': {'parents': parents, 'help': 'Run all modules'}}
for c in all_categories:
parser_tab = [PPoptional, all_categories[c]['parser']]
if 'subparser' in all_categories[c]:
if all_categories[c]['subparser']:
parser_tab += all_categories[c]['subparser']
parser_tab += [PWrite]
dic_tmp = {c: {'parents': parser_tab, 'help': 'Run %s module' % c}}
dic.update(dic_tmp)
# 2- Main commands
subparsers = parser.add_subparsers(help='Choose a main command')
for d in dic:
subparsers.add_parser(d, parents=dic[d]['parents'], help=dic[d]['help']).set_defaults(auditType=d)
# ------------------------------------------- Parse arguments -------------------------------------------
# By default, launch all modules
if len(sys.argv) == 1:
args = {
'verbose': 0,
'quiet': False,
'password': None,
'write_normal': None,
'write_json': None,
'write_all': None,
'output': '.',
'auditType': 'all'
}
else:
args = dict(parser.parse_args()._get_kwargs())
# arguments = parser.parse_args()
# Define constant variables
output(
output_dir=args['output'],
txt_format=args['write_normal'],
json_format=args['write_json'],
all_format=args['write_all']
)
verbosity(verbose=args['verbose'])
quiet_mode(is_quiet_mode=args['quiet'])
# Print the title
constant.st.first_title()
start_time = time.time()
category = args['auditType']
subcategories = clean_args(args)
for run in runLaZagne(category, subcategories):
pass
write_in_file(constant.stdout_result)
constant.st.print_footer(elapsed_time=str(time.time() - start_time))
================================================
FILE: Linux/lazagne/__init__.py
================================================
================================================
FILE: Linux/lazagne/config/__init__.py
================================================
================================================
FILE: Linux/lazagne/config/constant.py
================================================
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import sys
import time
date = time.strftime("%d%m%Y_%H%M%S")
class constant():
folder_name = 'results_{current_time}'.format(current_time=date)
file_name_results = 'credentials' # The extension is added depending on the user output choice
max_help = 27
CURRENT_VERSION = '2.4.3'
output = None
file_logger = None
verbose = False
nb_password_found = 0 # Total password found
password_found = []
stdout_result = [] # Tab containing all results by user
finalResults = {}
quiet_mode = False
st = None # Standard output
modules_dic = {}
chrome_storage = [] # Retrieved from libsecrets module
if sys.version_info[0]:
python_version = sys.version_info[0]
================================================
FILE: Linux/lazagne/config/crypto/__init__.py
================================================
================================================
FILE: Linux/lazagne/config/crypto/pbkdf2.py
================================================
#!/usr/bin/python
# A simple implementation of pbkdf2 using stock python modules. See RFC2898
# for details. Basically, it derives a key from a password and salt.
# (c) 2004 Matt Johnston <matt @ ucc asn au>
# This code may be freely used and modified for any purpose.
import hmac
import hashlib
import sys
from struct import pack
BLOCKLEN = 20
def char_to_int(string):
if sys.version_info[0] == 2 or isinstance(string, str):
return ord(string)
else:
return string # Python 3
def chr_or_byte(integer):
if sys.version_info[0] == 2:
return chr(integer)
else:
return bytes([integer]) # Python 3
# this is what you want to call.
def pbkdf2(password, salt, itercount, keylen):
# l - number of output blocks to produce
l = keylen / BLOCKLEN
if keylen % BLOCKLEN != 0:
l += 1
h = hmac.new(password, None, hashlib.sha1)
T = b''
for i in range(1, int(l) + 1):
T += pbkdf2_F(h, salt, itercount, i)
return T[: -(BLOCKLEN - keylen % BLOCKLEN)]
def xorstr(a, b):
if len(a) != len(b):
raise "xorstr(): lengths differ"
ret = b''
for i in range(len(a)):
ret += chr_or_byte(char_to_int(a[i]) ^ char_to_int(b[i]))
return ret
def prf(h, data):
hm = h.copy()
hm.update(data)
return hm.digest()
# Helper as per the spec. h is a hmac which has been created seeded with the
# password, it will be copy()ed and not modified.
def pbkdf2_F(h, salt, itercount, blocknum):
U = prf(h, salt + pack('>i', blocknum))
T = U
for i in range(2, itercount + 1):
U = prf(h, U)
T = xorstr(T, U)
return T
================================================
FILE: Linux/lazagne/config/crypto/pyDes.py
================================================
#############################################################################
# Documentation #
#############################################################################
# Author: Todd Whiteman
# Date: 28th April, 2010
# Version: 2.0.1
# License: MIT
# Homepage: http://twhiteman.netfirms.com/des.html
#
# This is a pure python implementation of the DES encryption algorithm.
# It's pure python to avoid portability issues, since most DES
# implementations are programmed in C (for performance reasons).
#
# Triple DES class is also implemented, utilizing the DES base. Triple DES
# is either DES-EDE3 with a 24 byte key, or DES-EDE2 with a 16 byte key.
#
# See the README.txt that should come with this python module for the
# implementation methods used.
#
# Thanks to:
# * David Broadwell for ideas, comments and suggestions.
# * Mario Wolff for pointing out and debugging some triple des CBC errors.
# * Santiago Palladino for providing the PKCS5 padding technique.
# * Shaya for correcting the PAD_PKCS5 triple des CBC errors.
#
"""A pure python implementation of the DES and TRIPLE DES encryption algorithms.
Class initialization
--------------------
pyDes.des(key, [mode], [IV], [pad], [padmode])
pyDes.triple_des(key, [mode], [IV], [pad], [padmode])
key -> Bytes containing the encryption key. 8 bytes for DES, 16 or 24 bytes
for Triple DES
mode -> Optional argument for encryption type, can be either
pyDes.ECB (Electronic Code Book) or pyDes.CBC (Cypher Block Chaining)
IV -> Optional Initial Value bytes, must be supplied if using CBC mode.
Length must be 8 bytes.
pad -> Optional argument, set the pad character (PAD_NORMAL) to use during
all encrypt/decrypt operations done with this instance.
padmode -> Optional argument, set the padding mode (PAD_NORMAL or PAD_PKCS5)
to use during all encrypt/decrypt operations done with this instance.
I recommend to use PAD_PKCS5 padding, as then you never need to worry about any
padding issues, as the padding can be removed unambiguously upon decrypting
data that was encrypted using PAD_PKCS5 padmode.
Common methods
--------------
encrypt(data, [pad], [padmode])
decrypt(data, [pad], [padmode])
data -> Bytes to be encrypted/decrypted
pad -> Optional argument. Only when using padmode of PAD_NORMAL. For
encryption, adds this characters to the end of the data block when
data is not a multiple of 8 bytes. For decryption, will remove the
trailing characters that match this pad character from the last 8
bytes of the unencrypted data block.
padmode -> Optional argument, set the padding mode, must be one of PAD_NORMAL
or PAD_PKCS5). Defaults to PAD_NORMAL.
Example
-------
from pyDes import *
data = "Please encrypt my data"
k = des("DESCRYPT", CBC, "\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_PKCS5)
# For Python3, you'll need to use bytes, i.e.:
# data = b"Please encrypt my data"
# k = des(b"DESCRYPT", CBC, b"\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_PKCS5)
d = k.encrypt(data)
print "Encrypted: %r" % d
print "Decrypted: %r" % k.decrypt(d)
assert k.decrypt(d, padmode=PAD_PKCS5) == data
See the module source (pyDes.py) for more examples of use.
You can also run the pyDes.py file without and arguments to see a simple test.
Note: This code was not written for high-end systems needing a fast
implementation, but rather a handy portable solution with small usage.
"""
import sys
# _pythonMajorVersion is used to handle Python2 and Python3 differences.
_pythonMajorVersion = sys.version_info[0]
# Modes of crypting / cyphering
ECB = 0
CBC = 1
# Modes of padding
PAD_NORMAL = 1
PAD_PKCS5 = 2
# PAD_PKCS5: is a method that will unambiguously remove all padding
# characters after decryption, when originally encrypted with
# this padding mode.
# For a good description of the PKCS5 padding technique, see:
# http://www.faqs.org/rfcs/rfc1423.html
# The base class shared by des and triple des.
class _baseDes(object):
def __init__(self, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
if IV:
IV = self._guardAgainstUnicode(IV)
if pad:
pad = self._guardAgainstUnicode(pad)
self.block_size = 8
# Sanity checking of arguments.
if pad and padmode == PAD_PKCS5:
raise ValueError("Cannot use a pad character with PAD_PKCS5")
if IV and len(IV) != self.block_size:
raise ValueError("Invalid Initial Value (IV), must be a multiple of " + str(self.block_size) + " bytes")
# Set the passed in variables
self._mode = mode
self._iv = IV
self._padding = pad
self._padmode = padmode
def getKey(self):
"""getKey() -> bytes"""
return self.__key
def setKey(self, key):
"""Will set the crypting key for this object."""
key = self._guardAgainstUnicode(key)
self.__key = key
def getMode(self):
"""getMode() -> pyDes.ECB or pyDes.CBC"""
return self._mode
def setMode(self, mode):
"""Sets the type of crypting mode, pyDes.ECB or pyDes.CBC"""
self._mode = mode
def getPadding(self):
"""getPadding() -> bytes of length 1. Padding character."""
return self._padding
def setPadding(self, pad):
"""setPadding() -> bytes of length 1. Padding character."""
if pad is not None:
pad = self._guardAgainstUnicode(pad)
self._padding = pad
def getPadMode(self):
"""getPadMode() -> pyDes.PAD_NORMAL or pyDes.PAD_PKCS5"""
return self._padmode
def setPadMode(self, mode):
"""Sets the type of padding mode, pyDes.PAD_NORMAL or pyDes.PAD_PKCS5"""
self._padmode = mode
def getIV(self):
"""getIV() -> bytes"""
return self._iv
def setIV(self, IV):
"""Will set the Initial Value, used in conjunction with CBC mode"""
if not IV or len(IV) != self.block_size:
raise ValueError("Invalid Initial Value (IV), must be a multiple of " + str(self.block_size) + " bytes")
IV = self._guardAgainstUnicode(IV)
self._iv = IV
def _padData(self, data, pad, padmode):
# Pad data depending on the mode
if padmode is None:
# Get the default padding mode.
padmode = self.getPadMode()
if pad and padmode == PAD_PKCS5:
raise ValueError("Cannot use a pad character with PAD_PKCS5")
if padmode == PAD_NORMAL:
if len(data) % self.block_size == 0:
# No padding required.
return data
if not pad:
# Get the default padding.
pad = self.getPadding()
if not pad:
raise ValueError("Data must be a multiple of " + str(
self.block_size) + " bytes in length. Use padmode=PAD_PKCS5 or set the pad character.")
data += (self.block_size - (len(data) % self.block_size)) * pad
elif padmode == PAD_PKCS5:
pad_len = 8 - (len(data) % self.block_size)
if _pythonMajorVersion < 3:
data += pad_len * chr(pad_len)
else:
data += bytes([pad_len] * pad_len)
return data
def _unpadData(self, data, pad, padmode):
# Unpad data depending on the mode.
if not data:
return data
if pad and padmode == PAD_PKCS5:
raise ValueError("Cannot use a pad character with PAD_PKCS5")
if padmode is None:
# Get the default padding mode.
padmode = self.getPadMode()
if padmode == PAD_NORMAL:
if not pad:
# Get the default padding.
pad = self.getPadding()
if pad:
data = data[:-self.block_size] + \
data[-self.block_size:].rstrip(pad)
elif padmode == PAD_PKCS5:
if _pythonMajorVersion < 3:
pad_len = ord(data[-1])
else:
pad_len = data[-1]
data = data[:-pad_len]
return data
def _guardAgainstUnicode(self, data):
# Only accept byte strings or ascii unicode values, otherwise
# there is no way to correctly decode the data into bytes.
if _pythonMajorVersion < 3:
if isinstance(data, unicode): # noqa
raise ValueError("pyDes can only work with bytes, not Unicode strings.")
else:
if isinstance(data, str):
# Only accept ascii unicode values.
try:
return data.encode('ascii')
except UnicodeEncodeError:
pass
raise ValueError("pyDes can only work with encoded strings, not Unicode.")
return data
#############################################################################
# DES #
#############################################################################
class des(_baseDes):
"""DES encryption/decrytpion class
Supports ECB (Electronic Code Book) and CBC (Cypher Block Chaining) modes.
pyDes.des(key,[mode], [IV])
key -> Bytes containing the encryption key, must be exactly 8 bytes
mode -> Optional argument for encryption type, can be either pyDes.ECB
(Electronic Code Book), pyDes.CBC (Cypher Block Chaining)
IV -> Optional Initial Value bytes, must be supplied if using CBC mode.
Must be 8 bytes in length.
pad -> Optional argument, set the pad character (PAD_NORMAL) to use
during all encrypt/decrypt operations done with this instance.
padmode -> Optional argument, set the padding mode (PAD_NORMAL or
PAD_PKCS5) to use during all encrypt/decrypt operations done
with this instance.
"""
# Permutation and translation tables for DES
__pc1 = [56, 48, 40, 32, 24, 16, 8,
0, 57, 49, 41, 33, 25, 17,
9, 1, 58, 50, 42, 34, 26,
18, 10, 2, 59, 51, 43, 35,
62, 54, 46, 38, 30, 22, 14,
6, 61, 53, 45, 37, 29, 21,
13, 5, 60, 52, 44, 36, 28,
20, 12, 4, 27, 19, 11, 3
]
# number left rotations of pc1
__left_rotations = [
1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1
]
# permuted choice key (table 2)
__pc2 = [
13, 16, 10, 23, 0, 4,
2, 27, 14, 5, 20, 9,
22, 18, 11, 3, 25, 7,
15, 6, 26, 19, 12, 1,
40, 51, 30, 36, 46, 54,
29, 39, 50, 44, 32, 47,
43, 48, 38, 55, 33, 52,
45, 41, 49, 35, 28, 31
]
# initial permutation IP
__ip = [57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7,
56, 48, 40, 32, 24, 16, 8, 0,
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6
]
# Expansion table for turning 32 bit blocks into 48 bits
__expansion_table = [
31, 0, 1, 2, 3, 4,
3, 4, 5, 6, 7, 8,
7, 8, 9, 10, 11, 12,
11, 12, 13, 14, 15, 16,
15, 16, 17, 18, 19, 20,
19, 20, 21, 22, 23, 24,
23, 24, 25, 26, 27, 28,
27, 28, 29, 30, 31, 0
]
# The (in)famous S-boxes
__sbox = [
# S1
[14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13],
# S2
[15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9],
# S3
[10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12],
# S4
[7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14],
# S5
[2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3],
# S6
[12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13],
# S7
[4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6,
1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2,
6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12],
# S8
[13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2,
7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8,
2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11],
]
# 32-bit permutation function P used on the output of the S-boxes
__p = [
15, 6, 19, 20, 28, 11,
27, 16, 0, 14, 22, 25,
4, 17, 30, 9, 1, 7,
23, 13, 31, 26, 2, 8,
18, 12, 29, 5, 21, 10,
3, 24
]
# final permutation IP^-1
__fp = [
39, 7, 47, 15, 55, 23, 63, 31,
38, 6, 46, 14, 54, 22, 62, 30,
37, 5, 45, 13, 53, 21, 61, 29,
36, 4, 44, 12, 52, 20, 60, 28,
35, 3, 43, 11, 51, 19, 59, 27,
34, 2, 42, 10, 50, 18, 58, 26,
33, 1, 41, 9, 49, 17, 57, 25,
32, 0, 40, 8, 48, 16, 56, 24
]
# Type of crypting being done
ENCRYPT = 0x00
DECRYPT = 0x01
# Initialisation
def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
# Sanity checking of arguments.
if len(key) != 8:
raise ValueError("Invalid DES key size. Key must be exactly 8 bytes long.")
_baseDes.__init__(self, mode, IV, pad, padmode)
self.key_size = 8
self.L = []
self.R = []
self.Kn = [[0] * 48] * 16 # 16 48-bit keys (K1 - K16)
self.final = []
self.setKey(key)
def setKey(self, key):
"""Will set the crypting key for this object. Must be 8 bytes."""
_baseDes.setKey(self, key)
self.__create_sub_keys()
def __String_to_BitList(self, data):
"""Turn the string data, into a list of bits (1, 0)'s"""
if _pythonMajorVersion < 3:
# Turn the strings into integers. Python 3 uses a bytes
# class, which already has this behaviour.
data = [ord(c) for c in data]
l = len(data) * 8
result = [0] * l
pos = 0
for ch in data:
i = 7
while i >= 0:
if ch & (1 << i) != 0:
result[pos] = 1
else:
result[pos] = 0
pos += 1
i -= 1
return result
def __BitList_to_String(self, data):
"""Turn the list of bits -> data, into a string"""
result = []
pos = 0
c = 0
while pos < len(data):
c += data[pos] << (7 - (pos % 8))
if (pos % 8) == 7:
result.append(c)
c = 0
pos += 1
if _pythonMajorVersion < 3:
return ''.join([chr(c) for c in result])
else:
return bytes(result)
def __permutate(self, table, block):
"""Permutate this block with the specified table"""
return list(map(lambda x: block[x], table))
# Transform the secret key, so that it is ready for data processing
# Create the 16 subkeys, K[1] - K[16]
def __create_sub_keys(self):
"""Create the 16 subkeys K[1] to K[16] from the given key"""
key = self.__permutate(des.__pc1, self.__String_to_BitList(self.getKey()))
i = 0
# Split into Left and Right sections
self.L = key[:28]
self.R = key[28:]
while i < 16:
j = 0
# Perform circular left shifts
while j < des.__left_rotations[i]:
self.L.append(self.L[0])
del self.L[0]
self.R.append(self.R[0])
del self.R[0]
j += 1
# Create one of the 16 subkeys through pc2 permutation
self.Kn[i] = self.__permutate(des.__pc2, self.L + self.R)
i += 1
# Main part of the encryption algorithm, the number cruncher :)
def __des_crypt(self, block, crypt_type):
"""Crypt the block of data through DES bit-manipulation"""
block = self.__permutate(des.__ip, block)
self.L = block[:32]
self.R = block[32:]
# Encryption starts from Kn[1] through to Kn[16]
if crypt_type == des.ENCRYPT:
iteration = 0
iteration_adjustment = 1
# Decryption starts from Kn[16] down to Kn[1]
else:
iteration = 15
iteration_adjustment = -1
i = 0
while i < 16:
# Make a copy of R[i-1], this will later become L[i]
tempR = self.R[:]
# Permutate R[i - 1] to start creating R[i]
self.R = self.__permutate(des.__expansion_table, self.R)
# Exclusive or R[i - 1] with K[i], create B[1] to B[8] whilst here
self.R = list(map(lambda x, y: x ^ y, self.R, self.Kn[iteration]))
B = [self.R[:6], self.R[6:12], self.R[12:18], self.R[18:24], self.R[24:30], self.R[30:36], self.R[36:42],
self.R[42:]]
# Optimization: Replaced below commented code with above
# j = 0
# B = []
# while j < len(self.R):
# self.R[j] = self.R[j] ^ self.Kn[iteration][j]
# j += 1
# if j % 6 == 0:
# B.append(self.R[j-6:j])
# Permutate B[1] to B[8] using the S-Boxes
j = 0
Bn = [0] * 32
pos = 0
while j < 8:
# Work out the offsets
m = (B[j][0] << 1) + B[j][5]
n = (B[j][1] << 3) + (B[j][2] << 2) + (B[j][3] << 1) + B[j][4]
# Find the permutation value
v = des.__sbox[j][(m << 4) + n]
# Turn value into bits, add it to result: Bn
Bn[pos] = (v & 8) >> 3
Bn[pos + 1] = (v & 4) >> 2
Bn[pos + 2] = (v & 2) >> 1
Bn[pos + 3] = v & 1
pos += 4
j += 1
# Permutate the concatination of B[1] to B[8] (Bn)
self.R = self.__permutate(des.__p, Bn)
# Xor with L[i - 1]
self.R = list(map(lambda x, y: x ^ y, self.R, self.L))
# Optimization: This now replaces the below commented code
# j = 0
# while j < len(self.R):
# self.R[j] = self.R[j] ^ self.L[j]
# j += 1
# L[i] becomes R[i - 1]
self.L = tempR
i += 1
iteration += iteration_adjustment
# Final permutation of R[16]L[16]
self.final = self.__permutate(des.__fp, self.R + self.L)
return self.final
# Data to be encrypted/decrypted
def crypt(self, data, crypt_type):
"""Crypt the data in blocks, running it through des_crypt()"""
# Error check the data
if not data:
return ''
if len(data) % self.block_size != 0:
if crypt_type == des.DECRYPT: # Decryption must work on 8 byte blocks
raise ValueError(
"Invalid data length, data must be a multiple of " + str(self.block_size) + " bytes\n.")
if not self.getPadding():
raise ValueError("Invalid data length, data must be a multiple of " + str(
self.block_size) + " bytes\n. Try setting the optional padding character")
else:
data += (self.block_size - (len(data) % self.block_size)) * self.getPadding()
# print "Len of data: %f" % (len(data) / self.block_size)
if self.getMode() == CBC:
if self.getIV():
iv = self.__String_to_BitList(self.getIV())
else:
raise ValueError("For CBC mode, you must supply the Initial Value (IV) for ciphering")
# Split the data into blocks, crypting each one seperately
i = 0
dict = {}
result = []
# cached = 0
# lines = 0
while i < len(data):
# Test code for caching encryption results
# lines += 1
# if dict.has_key(data[i:i+8]):
# print "Cached result for: %s" % data[i:i+8]
# cached += 1
# result.append(dict[data[i:i+8]])
# i += 8
# continue
block = self.__String_to_BitList(data[i:i + 8])
# Xor with IV if using CBC mode
if self.getMode() == CBC:
if crypt_type == des.ENCRYPT:
block = list(map(lambda x, y: x ^ y, block, iv))
# j = 0
# while j < len(block):
# block[j] = block[j] ^ iv[j]
# j += 1
processed_block = self.__des_crypt(block, crypt_type)
if crypt_type == des.DECRYPT:
processed_block = list(map(lambda x, y: x ^ y, processed_block, iv))
# j = 0
# while j < len(processed_block):
# processed_block[j] = processed_block[j] ^ iv[j]
# j += 1
iv = block
else:
iv = processed_block
else:
processed_block = self.__des_crypt(block, crypt_type)
# Add the resulting crypted block to our list
# d = self.__BitList_to_String(processed_block)
# result.append(d)
result.append(self.__BitList_to_String(processed_block))
# dict[data[i:i+8]] = d
i += 8
# print "Lines: %d, cached: %d" % (lines, cached)
# Return the full crypted string
if _pythonMajorVersion < 3:
return ''.join(result)
else:
return bytes.fromhex('').join(result)
def encrypt(self, data, pad=None, padmode=None):
"""encrypt(data, [pad], [padmode]) -> bytes
data : Bytes to be encrypted
pad : Optional argument for encryption padding. Must only be one byte
padmode : Optional argument for overriding the padding mode.
The data must be a multiple of 8 bytes and will be encrypted
with the already specified key. Data does not have to be a
multiple of 8 bytes if the padding character is supplied, or
the padmode is set to PAD_PKCS5, as bytes will then added to
ensure the be padded data is a multiple of 8 bytes.
"""
data = self._guardAgainstUnicode(data)
if pad is not None:
pad = self._guardAgainstUnicode(pad)
data = self._padData(data, pad, padmode)
return self.crypt(data, des.ENCRYPT)
def decrypt(self, data, pad=None, padmode=None):
"""decrypt(data, [pad], [padmode]) -> bytes
data : Bytes to be decrypted
pad : Optional argument for decryption padding. Must only be one byte
padmode : Optional argument for overriding the padding mode.
The data must be a multiple of 8 bytes and will be decrypted
with the already specified key. In PAD_NORMAL mode, if the
optional padding character is supplied, then the un-encrypted
data will have the padding characters removed from the end of
the bytes. This pad removal only occurs on the last 8 bytes of
the data (last data block). In PAD_PKCS5 mode, the special
padding end markers will be removed from the data after decrypting.
"""
data = self._guardAgainstUnicode(data)
if pad is not None:
pad = self._guardAgainstUnicode(pad)
data = self.crypt(data, des.DECRYPT)
return self._unpadData(data, pad, padmode)
#############################################################################
# Triple DES #
#############################################################################
class triple_des(_baseDes):
"""Triple DES encryption/decrytpion class
This algorithm uses the DES-EDE3 (when a 24 byte key is supplied) or
the DES-EDE2 (when a 16 byte key is supplied) encryption methods.
Supports ECB (Electronic Code Book) and CBC (Cypher Block Chaining) modes.
pyDes.des(key, [mode], [IV])
key -> Bytes containing the encryption key, must be either 16 or
24 bytes long
mode -> Optional argument for encryption type, can be either pyDes.ECB
(Electronic Code Book), pyDes.CBC (Cypher Block Chaining)
IV -> Optional Initial Value bytes, must be supplied if using CBC mode.
Must be 8 bytes in length.
pad -> Optional argument, set the pad character (PAD_NORMAL) to use
during all encrypt/decrypt operations done with this instance.
padmode -> Optional argument, set the padding mode (PAD_NORMAL or
PAD_PKCS5) to use during all encrypt/decrypt operations done
with this instance.
"""
def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
_baseDes.__init__(self, mode, IV, pad, padmode)
self.setKey(key)
def setKey(self, key):
"""Will set the crypting key for this object. Either 16 or 24 bytes long."""
self.key_size = 24 # Use DES-EDE3 mode
if len(key) != self.key_size:
if len(key) == 16: # Use DES-EDE2 mode
self.key_size = 16
else:
raise ValueError("Invalid triple DES key size. Key must be either 16 or 24 bytes long")
if self.getMode() == CBC:
if not self.getIV():
# Use the first 8 bytes of the key
self._iv = key[:self.block_size]
if len(self.getIV()) != self.block_size:
raise ValueError("Invalid IV, must be 8 bytes in length")
self.__key1 = des(key[:8], self._mode, self._iv,
self._padding, self._padmode)
self.__key2 = des(key[8:16], self._mode, self._iv,
self._padding, self._padmode)
if self.key_size == 16:
self.__key3 = self.__key1
else:
self.__key3 = des(key[16:], self._mode, self._iv,
self._padding, self._padmode)
_baseDes.setKey(self, key)
# Override setter methods to work on all 3 keys.
def setMode(self, mode):
"""Sets the type of crypting mode, pyDes.ECB or pyDes.CBC"""
_baseDes.setMode(self, mode)
for key in (self.__key1, self.__key2, self.__key3):
key.setMode(mode)
def setPadding(self, pad):
"""setPadding() -> bytes of length 1. Padding character."""
_baseDes.setPadding(self, pad)
for key in (self.__key1, self.__key2, self.__key3):
key.setPadding(pad)
def setPadMode(self, mode):
"""Sets the type of padding mode, pyDes.PAD_NORMAL or pyDes.PAD_PKCS5"""
_baseDes.setPadMode(self, mode)
for key in (self.__key1, self.__key2, self.__key3):
key.setPadMode(mode)
def setIV(self, IV):
"""Will set the Initial Value, used in conjunction with CBC mode"""
_baseDes.setIV(self, IV)
for key in (self.__key1, self.__key2, self.__key3):
key.setIV(IV)
def encrypt(self, data, pad=None, padmode=None):
"""encrypt(data, [pad], [padmode]) -> bytes
data : bytes to be encrypted
pad : Optional argument for encryption padding. Must only be one byte
padmode : Optional argument for overriding the padding mode.
The data must be a multiple of 8 bytes and will be encrypted
with the already specified key. Data does not have to be a
multiple of 8 bytes if the padding character is supplied, or
the padmode is set to PAD_PKCS5, as bytes will then added to
ensure the be padded data is a multiple of 8 bytes.
"""
ENCRYPT = des.ENCRYPT
DECRYPT = des.DECRYPT
data = self._guardAgainstUnicode(data)
if pad is not None:
pad = self._guardAgainstUnicode(pad)
# Pad the data accordingly.
data = self._padData(data, pad, padmode)
if self.getMode() == CBC:
self.__key1.setIV(self.getIV())
self.__key2.setIV(self.getIV())
self.__key3.setIV(self.getIV())
i = 0
result = []
while i < len(data):
block = self.__key1.crypt(data[i:i + 8], ENCRYPT)
block = self.__key2.crypt(block, DECRYPT)
block = self.__key3.crypt(block, ENCRYPT)
self.__key1.setIV(block)
self.__key2.setIV(block)
self.__key3.setIV(block)
result.append(block)
i += 8
if _pythonMajorVersion < 3:
return ''.join(result)
else:
return bytes.fromhex('').join(result)
else:
data = self.__key1.crypt(data, ENCRYPT)
data = self.__key2.crypt(data, DECRYPT)
return self.__key3.crypt(data, ENCRYPT)
def decrypt(self, data, pad=None, padmode=None):
"""decrypt(data, [pad], [padmode]) -> bytes
data : bytes to be encrypted
pad : Optional argument for decryption padding. Must only be one byte
padmode : Optional argument for overriding the padding mode.
The data must be a multiple of 8 bytes and will be decrypted
with the already specified key. In PAD_NORMAL mode, if the
optional padding character is supplied, then the un-encrypted
data will have the padding characters removed from the end of
the bytes. This pad removal only occurs on the last 8 bytes of
the data (last data block). In PAD_PKCS5 mode, the special
padding end markers will be removed from the data after
decrypting, no pad character is required for PAD_PKCS5.
"""
ENCRYPT = des.ENCRYPT
DECRYPT = des.DECRYPT
data = self._guardAgainstUnicode(data)
if pad is not None:
pad = self._guardAgainstUnicode(pad)
if self.getMode() == CBC:
self.__key1.setIV(self.getIV())
self.__key2.setIV(self.getIV())
self.__key3.setIV(self.getIV())
i = 0
result = []
while i < len(data):
iv = data[i:i + 8]
block = self.__key3.crypt(iv, DECRYPT)
block = self.__key2.crypt(block, ENCRYPT)
block = self.__key1.crypt(block, DECRYPT)
self.__key1.setIV(iv)
self.__key2.setIV(iv)
self.__key3.setIV(iv)
result.append(block)
i += 8
if _pythonMajorVersion < 3:
data = ''.join(result)
else:
data = bytes.fromhex('').join(result)
else:
data = self.__key3.crypt(data, DECRYPT)
data = self.__key2.crypt(data, ENCRYPT)
data = self.__key1.crypt(data, DECRYPT)
return self._unpadData(data, pad, padmode)
================================================
FILE: Linux/lazagne/config/crypto/pyaes/__init__.py
================================================
# The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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.
# This is a pure-Python implementation of the AES algorithm and AES common
# modes of operation.
# See: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
# See: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
# Supported key sizes:
# 128-bit
# 192-bit
# 256-bit
# Supported modes of operation:
# ECB - Electronic Codebook
# CBC - Cipher-Block Chaining
# CFB - Cipher Feedback
# OFB - Output Feedback
# CTR - Counter
# See the README.md for API details and general information.
# Also useful, PyCrypto, a crypto library implemented in C with Python bindings:
# https://www.dlitz.net/software/pycrypto/
VERSION = [1, 3, 0]
from .aes import AES, AESModeOfOperationCTR, AESModeOfOperationCBC, AESModeOfOperationCFB, AESModeOfOperationECB, AESModeOfOperationOFB, AESModesOfOperation, Counter
from .blockfeeder import decrypt_stream, Decrypter, encrypt_stream, Encrypter
from .blockfeeder import PADDING_NONE, PADDING_DEFAULT
================================================
FILE: Linux/lazagne/config/crypto/pyaes/aes.py
================================================
# The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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.
# This is a pure-Python implementation of the AES algorithm and AES common
# modes of operation.
# See: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
# Honestly, the best description of the modes of operations are the wonderful
# diagrams on Wikipedia. They explain in moments what my words could never
# achieve. Hence the inline documentation here is sparer than I'd prefer.
# See: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
# Also useful, PyCrypto, a crypto library implemented in C with Python bindings:
# https://www.dlitz.net/software/pycrypto/
# Supported key sizes:
# 128-bit
# 192-bit
# 256-bit
# Supported modes of operation:
# ECB - Electronic Codebook
# CBC - Cipher-Block Chaining
# CFB - Cipher Feedback
# OFB - Output Feedback
# CTR - Counter
# See the README.md for API details and general information.
import copy
import struct
__all__ = ["AES", "AESModeOfOperationCTR", "AESModeOfOperationCBC", "AESModeOfOperationCFB",
"AESModeOfOperationECB", "AESModeOfOperationOFB", "AESModesOfOperation", "Counter"]
def _compact_word(word):
return (word[0] << 24) | (word[1] << 16) | (word[2] << 8) | word[3]
def _string_to_bytes(text):
return list(ord(c) for c in text)
def _bytes_to_string(binary):
return "".join(chr(b) for b in binary)
def _concat_list(a, b):
return a + b
# Python 3 compatibility
try:
xrange
except NameError:
xrange = range
# Python 3 supports bytes, which is already an array of integers
def _string_to_bytes(text):
if isinstance(text, bytes):
return text
return [ord(c) for c in text]
# In Python 3, we return bytes
def _bytes_to_string(binary):
return bytes(binary)
# Python 3 cannot concatenate a list onto a bytes, so we bytes-ify it first
def _concat_list(a, b):
return a + bytes(b)
# Based *largely* on the Rijndael implementation
# See: http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
class AES(object):
'''Encapsulates the AES block cipher.
You generally should not need this. Use the AESModeOfOperation classes
below instead.'''
# Number of rounds by keysize
number_of_rounds = {16: 10, 24: 12, 32: 14}
# Round constant words
rcon = [ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 ]
# S-box and Inverse S-box (S is for Substitution)
S = [ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 ]
Si =[ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d ]
# Transformations for encryption
T1 = [ 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a ]
T2 = [ 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616 ]
T3 = [ 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16 ]
T4 = [ 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c ]
# Transformations for decryption
T5 = [ 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742 ]
T6 = [ 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857 ]
T7 = [ 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8 ]
T8 = [ 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0 ]
# Transformations for decryption key expansion
U1 = [ 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3 ]
U2 = [ 0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697 ]
U3 = [ 0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46 ]
U4 = [ 0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d ]
def __init__(self, key):
if len(key) not in (16, 24, 32):
raise ValueError('Invalid key size')
rounds = self.number_of_rounds[len(key)]
# Encryption round keys
self._Ke = [[0] * 4 for i in xrange(rounds + 1)]
# Decryption round keys
self._Kd = [[0] * 4 for i in xrange(rounds + 1)]
round_key_count = (rounds + 1) * 4
KC = len(key) // 4
# Convert the key into ints
tk = [ struct.unpack('>i', key[i:i + 4])[0] for i in xrange(0, len(key), 4) ]
# Copy values into round key arrays
for i in xrange(0, KC):
self._Ke[i // 4][i % 4] = tk[i]
self._Kd[rounds - (i // 4)][i % 4] = tk[i]
# Key expansion (fips-197 section 5.2)
rconpointer = 0
t = KC
while t < round_key_count:
tt = tk[KC - 1]
tk[0] ^= ((self.S[(tt >> 16) & 0xFF] << 24) ^
(self.S[(tt >> 8) & 0xFF] << 16) ^
(self.S[ tt & 0xFF] << 8) ^
self.S[(tt >> 24) & 0xFF] ^
(self.rcon[rconpointer] << 24))
rconpointer += 1
if KC != 8:
for i in xrange(1, KC):
tk[i] ^= tk[i - 1]
# Key expansion for 256-bit keys is "slightly different" (fips-197)
else:
for i in xrange(1, KC // 2):
tk[i] ^= tk[i - 1]
tt = tk[KC // 2 - 1]
tk[KC // 2] ^= (self.S[ tt & 0xFF] ^
(self.S[(tt >> 8) & 0xFF] << 8) ^
(self.S[(tt >> 16) & 0xFF] << 16) ^
(self.S[(tt >> 24) & 0xFF] << 24))
for i in xrange(KC // 2 + 1, KC):
tk[i] ^= tk[i - 1]
# Copy values into round key arrays
j = 0
while j < KC and t < round_key_count:
self._Ke[t // 4][t % 4] = tk[j]
self._Kd[rounds - (t // 4)][t % 4] = tk[j]
j += 1
t += 1
# Inverse-Cipher-ify the decryption round key (fips-197 section 5.3)
for r in xrange(1, rounds):
for j in xrange(0, 4):
tt = self._Kd[r][j]
self._Kd[r][j] = (self.U1[(tt >> 24) & 0xFF] ^
self.U2[(tt >> 16) & 0xFF] ^
self.U3[(tt >> 8) & 0xFF] ^
self.U4[ tt & 0xFF])
def encrypt(self, plaintext):
'Encrypt a block of plain text using the AES block cipher.'
if len(plaintext) != 16:
raise ValueError('wrong block length')
rounds = len(self._Ke) - 1
(s1, s2, s3) = [1, 2, 3]
a = [0, 0, 0, 0]
# Convert plaintext to (ints ^ key)
t = [(_compact_word(plaintext[4 * i:4 * i + 4]) ^ self._Ke[0][i]) for i in xrange(0, 4)]
# Apply round transforms
for r in xrange(1, rounds):
for i in xrange(0, 4):
a[i] = (self.T1[(t[ i ] >> 24) & 0xFF] ^
self.T2[(t[(i + s1) % 4] >> 16) & 0xFF] ^
self.T3[(t[(i + s2) % 4] >> 8) & 0xFF] ^
self.T4[ t[(i + s3) % 4] & 0xFF] ^
self._Ke[r][i])
t = copy.copy(a)
# The last round is special
result = [ ]
for i in xrange(0, 4):
tt = self._Ke[rounds][i]
result.append((self.S[(t[ i ] >> 24) & 0xFF] ^ (tt >> 24)) & 0xFF)
result.append((self.S[(t[(i + s1) % 4] >> 16) & 0xFF] ^ (tt >> 16)) & 0xFF)
result.append((self.S[(t[(i + s2) % 4] >> 8) & 0xFF] ^ (tt >> 8)) & 0xFF)
result.append((self.S[ t[(i + s3) % 4] & 0xFF] ^ tt ) & 0xFF)
return result
def decrypt(self, ciphertext):
'Decrypt a block of cipher text using the AES block cipher.'
if len(ciphertext) != 16:
raise ValueError('wrong block length')
rounds = len(self._Kd) - 1
(s1, s2, s3) = [3, 2, 1]
a = [0, 0, 0, 0]
# Convert ciphertext to (ints ^ key)
t = [(_compact_word(ciphertext[4 * i:4 * i + 4]) ^ self._Kd[0][i]) for i in xrange(0, 4)]
# Apply round transforms
for r in xrange(1, rounds):
for i in xrange(0, 4):
a[i] = (self.T5[(t[ i ] >> 24) & 0xFF] ^
self.T6[(t[(i + s1) % 4] >> 16) & 0xFF] ^
self.T7[(t[(i + s2) % 4] >> 8) & 0xFF] ^
self.T8[ t[(i + s3) % 4] & 0xFF] ^
self._Kd[r][i])
t = copy.copy(a)
# The last round is special
result = [ ]
for i in xrange(0, 4):
tt = self._Kd[rounds][i]
result.append((self.Si[(t[ i ] >> 24) & 0xFF] ^ (tt >> 24)) & 0xFF)
result.append((self.Si[(t[(i + s1) % 4] >> 16) & 0xFF] ^ (tt >> 16)) & 0xFF)
result.append((self.Si[(t[(i + s2) % 4] >> 8) & 0xFF] ^ (tt >> 8)) & 0xFF)
result.append((self.Si[ t[(i + s3) % 4] & 0xFF] ^ tt ) & 0xFF)
return result
class Counter(object):
'''A counter object for the Counter (CTR) mode of operation.
To create a custom counter, you can usually just override the
increment method.'''
def __init__(self, initial_value = 1):
# Convert the value into an array of bytes long
self._counter = [ ((initial_value >> i) % 256) for i in xrange(128 - 8, -1, -8) ]
value = property(lambda s: s._counter)
def increment(self):
'''Increment the counter (overflow rolls back to 0).'''
for i in xrange(len(self._counter) - 1, -1, -1):
self._counter[i] += 1
if self._counter[i] < 256: break
# Carry the one
self._counter[i] = 0
# Overflow
else:
self._counter = [ 0 ] * len(self._counter)
class AESBlockModeOfOperation(object):
'''Super-class for AES modes of operation that require blocks.'''
def __init__(self, key):
self._aes = AES(key)
def decrypt(self, ciphertext):
raise Exception('not implemented')
def encrypt(self, plaintext):
raise Exception('not implemented')
class AESStreamModeOfOperation(AESBlockModeOfOperation):
'''Super-class for AES modes of operation that are stream-ciphers.'''
class AESSegmentModeOfOperation(AESStreamModeOfOperation):
'''Super-class for AES modes of operation that segment data.'''
segment_bytes = 16
class AESModeOfOperationECB(AESBlockModeOfOperation):
'''AES Electronic Codebook Mode of Operation.
o Block-cipher, so data must be padded to 16 byte boundaries
Security Notes:
o This mode is not recommended
o Any two identical blocks produce identical encrypted values,
exposing data patterns. (See the image of Tux on wikipedia)
Also see:
o https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_.28ECB.29
o See NIST SP800-38A (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf); section 6.1'''
name = "Electronic Codebook (ECB)"
def encrypt(self, plaintext):
if len(plaintext) != 16:
raise ValueError('plaintext block must be 16 bytes')
plaintext = _string_to_bytes(plaintext)
return _bytes_to_string(self._aes.encrypt(plaintext))
def decrypt(self, ciphertext):
if len(ciphertext) != 16:
raise ValueError('ciphertext block must be 16 bytes')
ciphertext = _string_to_bytes(ciphertext)
return _bytes_to_string(self._aes.decrypt(ciphertext))
class AESModeOfOperationCBC(AESBlockModeOfOperation):
'''AES Cipher-Block Chaining Mode of Operation.
o The Initialization Vector (IV)
o Block-cipher, so data must be padded to 16 byte boundaries
o An incorrect initialization vector will only cause the first
block to be corrupt; all other blocks will be intact
o A corrupt bit in the cipher text will cause a block to be
corrupted, and the next block to be inverted, but all other
blocks will be intact.
Security Notes:
o This method (and CTR) ARE recommended.
Also see:
o https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher-block_chaining_.28CBC.29
o See NIST SP800-38A (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf); section 6.2'''
name = "Cipher-Block Chaining (CBC)"
def __init__(self, key, iv = None):
if iv is None:
self._last_cipherblock = [ 0 ] * 16
elif len(iv) != 16:
raise ValueError('initialization vector must be 16 bytes')
else:
self._last_cipherblock = _string_to_bytes(iv)
AESBlockModeOfOperation.__init__(self, key)
def encrypt(self, plaintext):
if len(plaintext) != 16:
raise ValueError('plaintext block must be 16 bytes')
plaintext = _string_to_bytes(plaintext)
precipherblock = [ (p ^ l) for (p, l) in zip(plaintext, self._last_cipherblock) ]
self._last_cipherblock = self._aes.encrypt(precipherblock)
return _bytes_to_string(self._last_cipherblock)
def decrypt(self, ciphertext):
if len(ciphertext) != 16:
raise ValueError('ciphertext block must be 16 bytes')
cipherblock = _string_to_bytes(ciphertext)
plaintext = [ (p ^ l) for (p, l) in zip(self._aes.decrypt(cipherblock), self._last_cipherblock) ]
self._last_cipherblock = cipherblock
return _bytes_to_string(plaintext)
class AESModeOfOperationCFB(AESSegmentModeOfOperation):
'''AES Cipher Feedback Mode of Operation.
o A stream-cipher, so input does not need to be padded to blocks,
but does need to be padded to segment_size
Also see:
o https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_feedback_.28CFB.29
o See NIST SP800-38A (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf); section 6.3'''
name = "Cipher Feedback (CFB)"
def __init__(self, key, iv, segment_size = 1):
if segment_size == 0: segment_size = 1
if iv is None:
self._shift_register = [ 0 ] * 16
elif len(iv) != 16:
raise ValueError('initialization vector must be 16 bytes')
else:
self._shift_register = _string_to_bytes(iv)
self._segment_bytes = segment_size
AESBlockModeOfOperation.__init__(self, key)
segment_bytes = property(lambda s: s._segment_bytes)
def encrypt(self, plaintext):
if len(plaintext) % self._segment_bytes != 0:
raise ValueError('plaintext block must be a multiple of segment_size')
plaintext = _string_to_bytes(plaintext)
# Break block into segments
encrypted = [ ]
for i in xrange(0, len(plaintext), self._segment_bytes):
plaintext_segment = plaintext[i: i + self._segment_bytes]
xor_segment = self._aes.encrypt(self._shift_register)[:len(plaintext_segment)]
cipher_segment = [ (p ^ x) for (p, x) in zip(plaintext_segment, xor_segment) ]
# Shift the top bits out and the ciphertext in
self._shift_register = _concat_list(self._shift_register[len(cipher_segment):], cipher_segment)
encrypted.extend(cipher_segment)
return _bytes_to_string(encrypted)
def decrypt(self, ciphertext):
if len(ciphertext) % self._segment_bytes != 0:
raise ValueError('ciphertext block must be a multiple of segment_size')
ciphertext = _string_to_bytes(ciphertext)
# Break block into segments
decrypted = [ ]
for i in xrange(0, len(ciphertext), self._segment_bytes):
cipher_segment = ciphertext[i: i + self._segment_bytes]
xor_segment = self._aes.encrypt(self._shift_register)[:len(cipher_segment)]
plaintext_segment = [ (p ^ x) for (p, x) in zip(cipher_segment, xor_segment) ]
# Shift the top bits out and the ciphertext in
self._shift_register = _concat_list(self._shift_register[len(cipher_segment):], cipher_segment)
decrypted.extend(plaintext_segment)
return _bytes_to_string(decrypted)
class AESModeOfOperationOFB(AESStreamModeOfOperation):
'''AES Output Feedback Mode of Operation.
o A stream-cipher, so input does not need to be padded to blocks,
allowing arbitrary length data.
o A bit twiddled in the cipher text, twiddles the same bit in the
same bit in the plain text, which can be useful for error
correction techniques.
Also see:
o https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Output_feedback_.28OFB.29
o See NIST SP800-38A (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf); section 6.4'''
name = "Output Feedback (OFB)"
def __init__(self, key, iv = None):
if iv is None:
self._last_precipherblock = [ 0 ] * 16
elif len(iv) != 16:
raise ValueError('initialization vector must be 16 bytes')
else:
self._last_precipherblock = _string_to_bytes(iv)
self._remaining_block = [ ]
AESBlockModeOfOperation.__init__(self, key)
def encrypt(self, plaintext):
encrypted = [ ]
for p in _string_to_bytes(plaintext):
if len(self._remaining_block) == 0:
self._remaining_block = self._aes.encrypt(self._last_precipherblock)
self._last_precipherblock = [ ]
precipherbyte = self._remaining_block.pop(0)
self._last_precipherblock.append(precipherbyte)
cipherbyte = p ^ precipherbyte
encrypted.append(cipherbyte)
return _bytes_to_string(encrypted)
def decrypt(self, ciphertext):
# AES-OFB is symetric
return self.encrypt(ciphertext)
class AESModeOfOperationCTR(AESStreamModeOfOperation):
'''AES Counter Mode of Operation.
o A stream-cipher, so input does not need to be padded to blocks,
allowing arbitrary length data.
o The counter must be the same size as the key size (ie. len(key))
o Each block independant of the other, so a corrupt byte will not
damage future blocks.
o Each block has a uniue counter value associated with it, which
contributes to the encrypted value, so no data patterns are
leaked.
o Also known as: Counter Mode (CM), Integer Counter Mode (ICM) and
Segmented Integer Counter (SIC
Security Notes:
o This method (and CBC) ARE recommended.
o Each message block is associated with a counter value which must be
unique for ALL messages with the same key. Otherwise security may be
compromised.
Also see:
o https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_.28CTR.29
o See NIST SP800-38A (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf); section 6.5
and Appendix B for managing the initial counter'''
name = "Counter (CTR)"
def __init__(self, key, counter = None):
AESBlockModeOfOperation.__init__(self, key)
if counter is None:
counter = Counter()
self._counter = counter
self._remaining_counter = [ ]
def encrypt(self, plaintext):
while len(self._remaining_counter) < len(plaintext):
self._remaining_counter += self._aes.encrypt(self._counter.value)
self._counter.increment()
plaintext = _string_to_bytes(plaintext)
encrypted = [ (p ^ c) for (p, c) in zip(plaintext, self._remaining_counter) ]
self._remaining_counter = self._remaining_counter[len(encrypted):]
return _bytes_to_string(encrypted)
def decrypt(self, crypttext):
# AES-CTR is symetric
return self.encrypt(crypttext)
# Simple lookup table for each mode
AESModesOfOperation = dict(
ctr = AESModeOfOperationCTR,
cbc = AESModeOfOperationCBC,
cfb = AESModeOfOperationCFB,
ecb = AESModeOfOperationECB,
ofb = AESModeOfOperationOFB,
)
================================================
FILE: Linux/lazagne/config/crypto/pyaes/blockfeeder.py
================================================
# The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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.
from .aes import AESBlockModeOfOperation, AESSegmentModeOfOperation, AESStreamModeOfOperation
from .util import append_PKCS7_padding, strip_PKCS7_padding, to_bufferable
# First we inject three functions to each of the modes of operations
#
# _can_consume(size)
# - Given a size, determine how many bytes could be consumed in
# a single call to either the decrypt or encrypt method
#
# _final_encrypt(data, padding = PADDING_DEFAULT)
# - call and return encrypt on this (last) chunk of data,
# padding as necessary; this will always be at least 16
# bytes unless the total incoming input was less than 16
# bytes
#
# _final_decrypt(data, padding = PADDING_DEFAULT)
# - same as _final_encrypt except for decrypt, for
# stripping off padding
#
PADDING_NONE = 'none'
PADDING_DEFAULT = 'default'
# @TODO: Ciphertext stealing and explicit PKCS#7
# PADDING_CIPHERTEXT_STEALING
# PADDING_PKCS7
# ECB and CBC are block-only ciphers
def _block_can_consume(self, size):
if size >= 16: return 16
return 0
# After padding, we may have more than one block
def _block_final_encrypt(self, data, padding = PADDING_DEFAULT):
if padding == PADDING_DEFAULT:
data = append_PKCS7_padding(data)
elif padding == PADDING_NONE:
if len(data) != 16:
raise Exception('invalid data length for final block')
else:
raise Exception('invalid padding option')
if len(data) == 32:
return self.encrypt(data[:16]) + self.encrypt(data[16:])
return self.encrypt(data)
def _block_final_decrypt(self, data, padding = PADDING_DEFAULT):
if padding == PADDING_DEFAULT:
return strip_PKCS7_padding(self.decrypt(data))
if padding == PADDING_NONE:
if len(data) != 16:
raise Exception('invalid data length for final block')
return self.decrypt(data)
raise Exception('invalid padding option')
AESBlockModeOfOperation._can_consume = _block_can_consume
AESBlockModeOfOperation._final_encrypt = _block_final_encrypt
AESBlockModeOfOperation._final_decrypt = _block_final_decrypt
# CFB is a segment cipher
def _segment_can_consume(self, size):
return self.segment_bytes * int(size // self.segment_bytes)
# CFB can handle a non-segment-sized block at the end using the remaining cipherblock
def _segment_final_encrypt(self, data, padding = PADDING_DEFAULT):
if padding != PADDING_DEFAULT:
raise Exception('invalid padding option')
faux_padding = (chr(0) * (self.segment_bytes - (len(data) % self.segment_bytes)))
padded = data + to_bufferable(faux_padding)
return self.encrypt(padded)[:len(data)]
# CFB can handle a non-segment-sized block at the end using the remaining cipherblock
def _segment_final_decrypt(self, data, padding = PADDING_DEFAULT):
if padding != PADDING_DEFAULT:
raise Exception('invalid padding option')
faux_padding = (chr(0) * (self.segment_bytes - (len(data) % self.segment_bytes)))
padded = data + to_bufferable(faux_padding)
return self.decrypt(padded)[:len(data)]
AESSegmentModeOfOperation._can_consume = _segment_can_consume
AESSegmentModeOfOperation._final_encrypt = _segment_final_encrypt
AESSegmentModeOfOperation._final_decrypt = _segment_final_decrypt
# OFB and CTR are stream ciphers
def _stream_can_consume(self, size):
return size
def _stream_final_encrypt(self, data, padding = PADDING_DEFAULT):
if padding not in [PADDING_NONE, PADDING_DEFAULT]:
raise Exception('invalid padding option')
return self.encrypt(data)
def _stream_final_decrypt(self, data, padding = PADDING_DEFAULT):
if padding not in [PADDING_NONE, PADDING_DEFAULT]:
raise Exception('invalid padding option')
return self.decrypt(data)
AESStreamModeOfOperation._can_consume = _stream_can_consume
AESStreamModeOfOperation._final_encrypt = _stream_final_encrypt
AESStreamModeOfOperation._final_decrypt = _stream_final_decrypt
class BlockFeeder(object):
'''The super-class for objects to handle chunking a stream of bytes
into the appropriate block size for the underlying mode of operation
and applying (or stripping) padding, as necessary.'''
def __init__(self, mode, feed, final, padding = PADDING_DEFAULT):
self._mode = mode
self._feed = feed
self._final = final
self._buffer = to_bufferable("")
self._padding = padding
def feed(self, data = None):
'''Provide bytes to encrypt (or decrypt), returning any bytes
possible from this or any previous calls to feed.
Call with None or an empty string to flush the mode of
operation and return any final bytes; no further calls to
feed may be made.'''
if self._buffer is None:
raise ValueError('already finished feeder')
# Finalize; process the spare bytes we were keeping
if data is None:
result = self._final(self._buffer, self._padding)
self._buffer = None
return result
self._buffer += to_bufferable(data)
# We keep 16 bytes around so we can determine padding
result = to_bufferable('')
while len(self._buffer) > 16:
can_consume = self._mode._can_consume(len(self._buffer) - 16)
if can_consume == 0: break
result += self._feed(self._buffer[:can_consume])
self._buffer = self._buffer[can_consume:]
return result
class Encrypter(BlockFeeder):
'Accepts bytes of plaintext and returns encrypted ciphertext.'
def __init__(self, mode, padding = PADDING_DEFAULT):
BlockFeeder.__init__(self, mode, mode.encrypt, mode._final_encrypt, padding)
class Decrypter(BlockFeeder):
'Accepts bytes of ciphertext and returns decrypted plaintext.'
def __init__(self, mode, padding = PADDING_DEFAULT):
BlockFeeder.__init__(self, mode, mode.decrypt, mode._final_decrypt, padding)
# 8kb blocks
BLOCK_SIZE = (1 << 13)
def _feed_stream(feeder, in_stream, out_stream, block_size = BLOCK_SIZE):
'Uses feeder to read and convert from in_stream and write to out_stream.'
while True:
chunk = in_stream.read(block_size)
if not chunk:
break
converted = feeder.feed(chunk)
out_stream.write(converted)
converted = feeder.feed()
out_stream.write(converted)
def encrypt_stream(mode, in_stream, out_stream, block_size = BLOCK_SIZE, padding = PADDING_DEFAULT):
'Encrypts a stream of bytes from in_stream to out_stream using mode.'
encrypter = Encrypter(mode, padding = padding)
_feed_stream(encrypter, in_stream, out_stream, block_size)
def decrypt_stream(mode, in_stream, out_stream, block_size = BLOCK_SIZE, padding = PADDING_DEFAULT):
'Decrypts a stream of bytes from in_stream to out_stream using mode.'
decrypter = Decrypter(mode, padding = padding)
_feed_stream(decrypter, in_stream, out_stream, block_size)
================================================
FILE: Linux/lazagne/config/crypto/pyaes/util.py
================================================
# The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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.
# Why to_bufferable?
# Python 3 is very different from Python 2.x when it comes to strings of text
# and strings of bytes; in Python 3, strings of bytes do not exist, instead to
# represent arbitrary binary data, we must use the "bytes" object. This method
# ensures the object behaves as we need it to.
def to_bufferable(binary):
return binary
def _get_byte(c):
return ord(c)
try:
xrange
except NameError:
def to_bufferable(binary):
if isinstance(binary, bytes):
return binary
return bytes(ord(b) for b in binary)
def _get_byte(c):
return c
def append_PKCS7_padding(data):
pad = 16 - (len(data) % 16)
return data + to_bufferable(chr(pad) * pad)
def strip_PKCS7_padding(data):
if len(data) % 16 != 0:
raise ValueError("invalid length")
pad = _get_byte(data[-1])
if pad > 16:
raise ValueError("invalid padding byte")
return data[:-pad]
================================================
FILE: Linux/lazagne/config/dico.py
================================================
def get_dic():
return [
b"password",
b"123456",
b"12345678",
b"1234",
b"qwerty",
b"12345",
b"dragon",
b"pussy",
b"baseball",
b"football",
b"letmein",
b"monkey",
b"696969",
b"abc123",
b"mustang",
b"michael",
b"shadow",
b"master",
b"jennifer",
b"111111",
b"2000",
b"jordan",
b"superman",
b"harley",
b"1234567",
b"fuckme",
b"hunter",
b"fuckyob",
b"trustno1",
b"ranger",
b"buster",
b"thomas",
b"tigger",
b"robert",
b"soccer",
b"fuck",
b"batman",
b"test",
b"pass",
b"killer",
b"hockey",
b"george",
b"charlie",
b"andrew",
b"michelle",
b"love",
b"sunshine",
b"jessica",
b"asshole",
b"6969",
b"pepper",
b"daniel",
b"access",
b"123456789",
b"654321",
b"joshua",
b"maggie",
b"starwars",
b"silver",
b"william",
b"dallas",
b"yankees",
b"123123",
b"ashley",
b"666666",
b"hello",
b"amanda",
b"orange",
b"biteme",
b"freedom",
b"computer",
b"sexy",
b"thunder",
b"nicole",
b"ginger",
b"heather",
b"hammer",
b"summer",
b"corvette",
b"taylor",
b"fucker",
b"austin",
b"1111",
b"merlin",
b"matthew",
b"121212",
b"golfer",
b"cheese",
b"princess",
b"martin",
b"chelsea",
b"patrick",
b"richard",
b"diamond",
b"yellow",
b"bigdog",
b"secret",
b"asdfgh",
b"sparky",
b"cowboy",
b"camaro",
b"anthony",
b"matrix",
b"falcon",
b"iloveyob",
b"bailey",
b"guitar",
b"jackson",
b"purple",
b"scooter",
b"phoenix",
b"aaaaaa",
b"morgan",
b"tigers",
b"porsche",
b"mickey",
b"maverick",
b"cookie",
b"nascar",
b"peanut",
b"justin",
b"131313",
b"money",
b"horny",
b"samantha",
b"panties",
b"steelers",
b"joseph",
b"snoopy",
b"boomer",
b"whatever",
b"iceman",
b"smokey",
b"gateway",
b"dakota",
b"cowboys",
b"eagles",
b"chicken",
b"dick",
b"black",
b"zxcvbn",
b"please",
b"andrea",
b"ferrari",
b"knight",
b"hardcore",
b"melissa",
b"compaq",
b"coffee",
b"booboo",
b"bitch",
b"johnny",
b"bulldog",
b"xxxxxx",
b"welcome",
b"james",
b"player",
b"ncc1701",
b"wizard",
b"scooby",
b"charles",
b"junior",
b"internet",
b"bigdick",
b"mike",
b"brandy",
b"tennis",
b"blowjob",
b"banana",
b"monster",
b"spider",
b"lakers",
b"miller",
b"rabbit",
b"enter",
b"mercedes",
b"brandon",
b"steven",
b"fender",
b"john",
b"yamaha",
b"diablo",
b"chris",
b"boston",
b"tiger",
b"marine",
b"chicago",
b"rangers",
b"gandalf",
b"winter",
b"bigtits",
b"barney",
b"edward",
b"raiders",
b"porn",
b"badboy",
b"blowme",
b"spanky",
b"bigdaddy",
b"johnson",
b"chester",
b"london",
b"midnight",
b"blue",
b"fishing",
b"000000",
b"hannah",
b"slayer",
b"11111111",
b"rachel",
b"sexsex",
b"redsox",
b"thx1138",
b"asdf",
b"marlboro",
b"panther",
b"zxcvbnm",
b"arsenal",
b"oliver",
b"qazwsx",
b"mother",
b"victoria",
b"7777777",
b"jasper",
b"angel",
b"david",
b"winner",
b"crystal",
b"golden",
b"butthead",
b"viking",
b"jack",
b"iwantb",
b"shannon",
b"murphy",
b"angels",
b"prince",
b"cameron",
b"girls",
b"madison",
b"wilson",
b"carlos",
b"hooters",
b"willie",
b"startrek",
b"captain",
b"maddog",
b"jasmine",
b"butter",
b"booger",
b"angela",
b"golf",
b"lauren",
b"rocket",
b"tiffany",
b"theman",
b"dennis",
b"liverpoo",
b"flower",
b"forever",
b"green",
b"jackie",
b"muffin",
b"turtle",
b"sophie",
b"danielle",
b"redskins",
b"toyota",
b"jason",
b"sierra",
b"winston",
b"debbie",
b"giants",
b"packers",
b"newyork",
b"jeremy",
b"casper",
b"bubba",
b"112233",
b"sandra",
b"lovers",
b"mountain",
b"united",
b"cooper",
b"driver",
b"tucker",
b"helpme",
b"fucking",
b"pookie",
b"lucky",
b"maxwell",
b"8675309",
b"bear",
b"suckit",
b"gators",
b"5150",
b"222222",
b"shithead",
b"fuckoff",
b"jaguar",
b"monica",
b"fred",
b"happy",
b"hotdog",
b"tits",
b"gemini",
b"lover",
b"xxxxxxxx",
b"777777",
b"canada",
b"nathan",
b"victor",
b"florida",
b"88888888",
b"nicholas",
b"rosebud",
b"metallic",
b"doctor",
b"trouble",
b"success",
b"stupid",
b"tomcat",
b"warrior",
b"peaches",
b"apples",
b"fish",
b"qwertyui",
b"magic",
b"buddy",
b"dolphins",
b"rainbow",
b"gunner",
b"987654",
b"freddy",
b"alexis",
b"braves",
b"cock",
b"2112",
b"1212",
b"cocacola",
b"xavier",
b"dolphin",
b"testing",
b"bond007",
b"member",
b"calvin",
b"voodoo",
b"7777",
b"samson",
b"alex",
b"apollo",
b"fire",
b"tester",
b"walter",
b"beavis",
b"voyager",
b"peter",
b"porno",
b"bonnie",
b"rush2112",
b"beer",
b"apple",
b"scorpio",
b"jonathan",
b"skippy",
b"sydney",
b"scott",
b"red123",
b"power",
b"gordon",
b"travis",
b"beaver",
b"star",
b"jackass",
b"flyers",
b"boobs",
b"232323",
b"zzzzzz",
b"steve",
b"rebecca",
b"scorpion",
b"doggie",
b"legend",
b"ou812",
b"yankee",
b"blazer",
b"bill",
b"runner",
b"birdie",
b"bitches",
b"555555",
b"parker",
b"topgun",
b"asdfasdf",
b"heaven",
b"viper",
b"animal",
b"2222",
b"bigboy",
b"4444",
b"arthur",
b"baby",
b"private",
b"godzilla",
b"donald",
b"williams",
b"lifehack",
b"phantom",
b"dave",
b"rock",
b"august",
b"sammy",
b"cool",
b"brian",
b"platinum",
b"jake",
b"bronco",
b"paul",
b"mark",
b"frank",
b"heka6w2",
b"copper",
b"billy",
b"cumshot",
b"garfield",
b"willow",
b"cunt",
b"little",
b"carter",
b"slut",
b"albert",
b"69696969",
b"kitten",
b"super",
b"jordan23",
b"eagle1",
b"shelby",
b"america",
b"11111",
b"jessie",
b"house",
b"free",
b"123321",
b"chevy",
b"bullshit",
b"white",
b"broncos",
b"horney",
b"surfer",
b"nissan",
b"999999",
b"saturn",
b"airborne",
b"elephant",
b"marvin",
b"shit",
b"action",
b"adidas",
b"qwert",
b"kevin",
b"1313",
b"explorer",
b"walker",
b"police",
b"christin",
b"december",
b"benjamin",
b"wolf",
b"sweet",
b"therock",
b"king",
b"online",
b"dickhead",
b"brooklyn",
b"teresa",
b"cricket",
b"sharon",
b"dexter",
b"racing",
b"penis",
b"gregory",
b"0000",
b"teens",
b"redwings",
b"dreams",
b"michigan",
b"hentai",
b"magnum",
b"87654321",
b"nothing",
b"donkey",
b"trinity",
b"digital",
b"333333",
b"stella",
b"cartman",
b"guinness",
b"123abc",
b"speedy",
b"buffalo",
b"kitty"]
================================================
FILE: Linux/lazagne/config/homes.py
================================================
import pwd
import os
def directories():
"""
Retrieve all users' homes
"""
visited = set()
# Get all user data stored on the Unix Password Database
for pw in pwd.getpwall():
if pw.pw_dir not in visited:
yield pw.pw_dir
visited.add(pw.pw_dir)
# Get current user home
if 'HOME' in os.environ:
home = os.environ['HOME']
if home not in visited:
yield home
visited.add(home)
def get(file=[], directory=[]):
"""
List all existing directoryectories / files found on the disk (for all users)
using homes.get(directory=.mozilla/firefox)
will return if enough privilege: ["/home/user1/.mozilla/firefox", "/home/user2/.mozilla/firefox"]
"""
files = file if (type(file) in (tuple, list)) else [file]
dirs = directory if (type(directory) in (tuple, list)) else [directory]
for p in directories():
if files:
for file in files:
if os.path.isfile(os.path.join(p, file)):
yield os.path.join(p, file)
if dirs:
for d in dirs:
if os.path.isdir(os.path.join(p, d)):
yield os.path.join(p, d)
if not files and not dirs and os.path.isdir(p):
yield p
def users(file=[], directory=[]):
files = file if (type(file) in (tuple, list)) else [file]
dirs = directory if (type(directory) in (tuple, list)) else [directory]
for pw in pwd.getpwall():
if files:
for file in files:
if os.path.isfile(os.path.join(pw.pw_dir, file)):
yield pw.pw_name, os.path.join(pw.pw_dir, file)
if dirs:
for directory in dirs:
if os.path.isdir(os.path.join(pw.pw_dir, directory)):
yield pw.pw_name, os.path.join(pw.pw_dir, directory)
if not files and not dirs and os.path.isdir(pw.pw_dir):
yield pw.pw_name, pw.pw_dir
def get_linux_env(pid):
try:
with open('/proc/%d/environ' % (int(pid))) as env:
records = [
record.split('=', 1) for record in env.read().split('\x00')
]
return {
record[0]: record[1] for record in records if len(record) == 2
}
except Exception:
return {}
def sessions(setenv=True):
import psutil
visited = set()
try:
for process in psutil.process_iter():
try:
if hasattr(process, 'environ'):
environ = process.environ()
else:
# Fallback to manual linux-only method
# if psutils is very old
environ = get_linux_env(process.pid)
except Exception:
continue
if 'DBUS_SESSION_BUS_ADDRESS' not in environ:
continue
address = environ['DBUS_SESSION_BUS_ADDRESS']
if address not in visited:
uid = process.uids().effective
previous = None
previous_uid = None
if setenv:
previous_uid = os.geteuid()
if not uid == previous_uid:
try:
os.seteuid(uid)
except Exception:
continue
if 'DBUS_SESSION_BUS_ADDRESS' in os.environ:
previous = os.environ['DBUS_SESSION_BUS_ADDRESS']
os.environ['DBUS_SESSION_BUS_ADDRESS'] = address
try:
yield (uid, address)
except Exception:
pass
finally:
if setenv:
if previous:
os.environ['DBUS_SESSION_BUS_ADDRESS'] = previous
else:
del os.environ['DBUS_SESSION_BUS_ADDRESS']
if previous_uid != uid:
try:
os.seteuid(previous_uid)
except Exception:
pass
visited.add(address)
except AttributeError:
# Fix AttributeError: 'module' object has no attribute 'process_iter'
pass
# Problems occured with this block of code => permission denied to lots of file even with sudo
# for session_bus_directory in get(directory='.dbus/session-bus'):
# for envs in os.listdir(session_bus_directory):
# try:
# env_file = os.path.join(session_bus_directory, envs)
# uid = os.stat(env_file).st_uid
# with open(env_file) as env:
# for line in env.readlines():
# if not line.startswith('DBUS_SESSION_BUS_ADDRESS'):
# continue
#
# if line.startswith('#'):
# continue
#
# _, v = line.split('=', 1)
#
# if v.startswith("'") or v.startswith('"'):
# v = v[1:-1]
#
# if v in visited:
# continue
#
# if setenv:
# previous_uid = os.geteuid()
# if not previous_uid == uid:
# try:
# os.seteuid(uid)
# except Exception:
# continue
#
# previous = os.environ['DBUS_SESSION_BUS_ADDRESS']
# os.environ['DBUS_SESSION_BUS_ADDRESS'] = address
#
# try:
# yield (uid, v)
#
# finally:
#
# if setenv:
# os.environ['DBUS_SESSION_BUS_ADDRESS'] = previous
# if previous_uid != uid:
# try:
# os.seteuid(previous_uid)
# except Exception:
# pass
#
# except Exception:
# pass
================================================
FILE: Linux/lazagne/config/lib/__init__.py
================================================
================================================
FILE: Linux/lazagne/config/lib/memorpy/Address.py
================================================
# Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with memorpy. If not, see <http://www.gnu.org/licenses/>.
from .utils import *
class AddressException(Exception):
pass
class Address(object):
""" this class is used to have better representation of memory addresses """
def __init__(self, value, process, default_type = 'uint'):
self.value = int(value)
self.process = process
self.default_type = default_type
self.symbolic_name = None
def read(self, type = None, maxlen = None, errors='raise'):
if maxlen is None:
try:
int(type)
maxlen = int(type)
type = None
except:
pass
if not type:
type = self.default_type
if not maxlen:
return self.process.read(self.value, type=type, errors=errors)
else:
return self.process.read(self.value, type=type, maxlen=maxlen, errors=errors)
def write(self, data, type = None):
if not type:
type = self.default_type
return self.process.write(self.value, data, type=type)
def symbol(self):
return self.process.get_symbolic_name(self.value)
def get_instruction(self):
return self.process.get_instruction(self.value)
def dump(self, ftype = 'bytes', size = 512, before = 32):
buf = self.process.read_bytes(self.value - before, size)
print(hex_dump(buf, self.value - before, ftype=ftype))
def __nonzero__(self):
return self.value is not None and self.value != 0
def __add__(self, other):
return Address(self.value + int(other), self.process, self.default_type)
def __sub__(self, other):
return Address(self.value - int(other), self.process, self.default_type)
def __repr__(self):
if not self.symbolic_name:
self.symbolic_name = self.symbol()
return str('<Addr: %s' % self.symbolic_name + '>')
def __str__(self):
if not self.symbolic_name:
self.symbolic_name = self.symbol()
return str('<Addr: %s' % self.symbolic_name + ' : "%s" (%s)>' % (str(self.read()).encode('unicode_escape'), self.default_type))
def __int__(self):
return int(self.value)
def __hex__(self):
return hex(self.value)
def __get__(self, instance, owner):
return self.value
def __set__(self, instance, value):
self.value = int(value)
def __lt__(self, other):
return self.value < int(other)
def __le__(self, other):
return self.value <= int(other)
def __eq__(self, other):
return self.value == int(other)
def __ne__(self, other):
return self.value != int(other)
def __gt__(self, other):
return self.value > int(other)
def __ge__(self, other):
return self.value >= int(other)
================================================
FILE: Linux/lazagne/config/lib/memorpy/BaseProcess.py
================================================
#!/usr/bin/env python
# -*- coding: UTF8 -*-
import struct
from .utils import *
""" Base class for process not linked to any platform """
class ProcessException(Exception):
pass
class BaseProcess(object):
def __init__(self, *args, **kwargs):
""" Create and Open a process object from its pid or from its name """
self.h_process = None
self.pid = None
self.isProcessOpen = False
self.buffer = None
self.bufferlen = 0
def __del__(self):
self.close()
def close(self):
pass
def iter_region(self, *args, **kwargs):
raise NotImplementedError
def write_bytes(self, address, data):
raise NotImplementedError
def read_bytes(self, address, bytes = 4):
raise NotImplementedError
def get_symbolic_name(self, address):
return '0x%08X' % int(address)
def read(self, address, type = 'uint', maxlen = 50, errors='raise'):
if type == 's' or type == 'string':
s = self.read_bytes(int(address), bytes=maxlen)
try:
idx = s.index(b'\x00')
return s[:idx]
except:
if errors == 'ignore':
return s
raise ProcessException('string > maxlen')
else:
if type == 'bytes' or type == 'b':
return self.read_bytes(int(address), bytes=maxlen)
s, l = type_unpack(type)
return struct.unpack(s, self.read_bytes(int(address), bytes=l))[0]
def write(self, address, data, type = 'uint'):
if type != 'bytes':
s, l = type_unpack(type)
return self.write_bytes(int(address), struct.pack(s, data))
else:
return self.write_bytes(int(address), data)
================================================
FILE: Linux/lazagne/config/lib/memorpy/LinProcess.py
================================================
# Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with memorpy. If not, see <http://www.gnu.org/licenses/>.
import copy
import struct
# import utils
import platform
import ctypes, re, sys
from ctypes import create_string_buffer, byref, c_int, c_void_p, c_long, c_size_t, c_ssize_t, POINTER, get_errno
import errno
import os
import signal
from .BaseProcess import BaseProcess, ProcessException
from .structures import *
import logging
logger = logging.getLogger('memorpy')
libc=ctypes.CDLL("libc.so.6", use_errno=True)
get_errno_loc = libc.__errno_location
get_errno_loc.restype = POINTER(c_int)
def errcheck(ret, func, args):
if ret == -1:
_errno = get_errno() or errno.EPERM
raise OSError(os.strerror(_errno))
return ret
c_ptrace = libc.ptrace
c_pid_t = ctypes.c_int32 # This assumes pid_t is int32_t
c_ptrace.argtypes = [c_int, c_pid_t, c_void_p, c_void_p]
c_ptrace.restype = c_long
mprotect = libc.mprotect
mprotect.restype = c_int
mprotect.argtypes = [c_void_p, c_size_t, c_int]
LARGE_FILE_SUPPORT=False
try:
c_off64_t=ctypes.c_longlong
lseek64 = libc.lseek64
lseek64.argtypes = [c_int, c_off64_t, c_int]
lseek64.errcheck=errcheck
open64 = libc.open64
open64.restype = c_int
open64.argtypes = [c_void_p, c_int]
open64.errcheck=errcheck
pread64=libc.pread64
pread64.argtypes = [c_int, c_void_p, c_size_t, c_off64_t]
pread64.restype = c_ssize_t
pread64.errcheck=errcheck
c_close=libc.close
c_close.argtypes = [c_int]
c_close.restype = c_int
LARGE_FILE_SUPPORT=True
except:
logger.warning("no Large File Support")
class LinProcess(BaseProcess):
def __init__(self, pid=None, name=None, debug=True, ptrace=None):
""" Create and Open a process object from its pid or from its name """
super(LinProcess, self).__init__()
self.mem_file=None
self.ptrace_started=False
if pid is not None:
self.pid=pid
elif name is not None:
self.pid=LinProcess.pid_from_name(name)
else:
raise ValueError("You need to instanciate process with at least a name or a pid")
if ptrace is None:
if os.getuid()==0:
self.read_ptrace=False # no need to ptrace the process when root to read memory
else:
self.read_ptrace=True
self._open()
def check_ptrace_scope(self):
""" check ptrace scope and raise an exception if privileges are unsufficient
The sysctl settings (writable only with CAP_SYS_PTRACE) are:
0 - classic ptrace permissions: a process can PTRACE_ATTACH to any other
process running under the same uid, as long as it is dumpable (i.e.
did not transition uids, start privileged, or have called
prctl(PR_SET_DUMPABLE...) already). Similarly, PTRACE_TRACEME is
unchanged.
1 - restricted ptrace: a process must have a predefined relationship
with the inferior it wants to call PTRACE_ATTACH on. By default,
this relationship is that of only its descendants when the above
classic criteria is also met. To change the relationship, an
inferior can call prctl(PR_SET_PTRACER, debugger, ...) to declare
an allowed debugger PID to call PTRACE_ATTACH on the inferior.
Using PTRACE_TRACEME is unchanged.
2 - admin-only attach: only processes with CAP_SYS_PTRACE may use ptrace
with PTRACE_ATTACH, or through children calling PTRACE_TRACEME.
3 - no attach: no processes may use ptrace with PTRACE_ATTACH nor via
PTRACE_TRACEME. Once set, this sysctl value cannot be changed.
"""
try:
with open("/proc/sys/kernel/yama/ptrace_scope",'rb') as f:
ptrace_scope=int(f.read().strip())
if ptrace_scope==3:
logger.warning("yama/ptrace_scope == 3 (no attach). :/")
if os.getuid()==0:
return
elif ptrace_scope == 1:
logger.warning("yama/ptrace_scope == 1 (restricted). you can't ptrace other process ... get root")
elif ptrace_scope == 2:
logger.warning("yama/ptrace_scope == 2 (admin-only). Warning: check you have CAP_SYS_PTRACE")
except IOError:
pass
except Exception as e:
logger.warning("Error getting ptrace_scope ?? : %s"%e)
def close(self):
if self.mem_file:
if not LARGE_FILE_SUPPORT:
self.mem_file.close()
else:
c_close(self.mem_file)
self.mem_file=None
if self.ptrace_started:
self.ptrace_detach()
def __del__(self):
self.close()
def _open(self):
self.isProcessOpen = True
self.check_ptrace_scope()
if os.getuid()!=0:
#to raise an exception if ptrace is not allowed
self.ptrace_attach()
self.ptrace_detach()
#open file descriptor
if not LARGE_FILE_SUPPORT:
self.mem_file=open("/proc/" + str(self.pid) + "/mem", 'rb', 0)
else:
path=create_string_buffer(b"/proc/%d/mem" % self.pid)
self.mem_file=open64(byref(path), os.O_RDONLY)
@staticmethod
def list():
processes=[]
for pid in os.listdir("/proc"):
try:
exe=os.readlink("/proc/%s/exe"%pid)
processes.append({"pid":int(pid), "name":exe})
except:
pass
return processes
@staticmethod
def pid_from_name(name):
#quick and dirty, works with all linux not depending on ps output
for pid in os.listdir("/proc"):
try:
int(pid)
except:
continue
pname=""
with open("/proc/%s/cmdline"%pid,'r') as f:
pname=f.read()
if name in pname:
return int(pid)
raise ProcessException("No process with such name: %s"%name)
## Partial interface to ptrace(2), only for PTRACE_ATTACH and PTRACE_DETACH.
def _ptrace(self, attach):
op = ctypes.c_int(PTRACE_ATTACH if attach else PTRACE_DETACH)
c_pid = c_pid_t(self.pid)
null = ctypes.c_void_p()
if not attach:
os.kill(self.pid, signal.SIGSTOP)
os.waitpid(self.pid, 0)
err = c_ptrace(op, c_pid, null, null)
if not attach:
os.kill(self.pid, signal.SIGCONT)
if err != 0:
raise OSError("%s: %s"%(
'PTRACE_ATTACH' if attach else 'PTRACE_DETACH',
errno.errorcode.get(ctypes.get_errno(), 'UNKNOWN')
))
def iter_region(self, start_offset=None, end_offset=None, protec=None, optimizations=None):
"""
optimizations :
i for inode==0 (no file mapping)
s to avoid scanning shared regions
x to avoid scanning x regions
r don't scan ronly regions
"""
with open("/proc/" + str(self.pid) + "/maps", 'r') as maps_file:
for line in maps_file:
m = re.match(r'([0-9A-Fa-f]+)-([0-9A-Fa-f]+)\s+([-rwpsx]+)\s+([0-9A-Fa-f]+)\s+([0-9A-Fa-f]+:[0-9A-Fa-f]+)\s+([0-9]+)\s*(.*)', line)
if not m:
continue
start, end, region_protec, offset, dev, inode, pathname = int(m.group(1), 16), int(m.group(2), 16), m.group(3), m.group(4), m.group(5), int(m.group(6)), m.group(7)
if start_offset is not None:
if start < start_offset:
continue
if end_offset is not None:
if start > end_offset:
continue
chunk=end-start
if 'r' in region_protec: # TODO: handle protec parameter
if optimizations:
if 'i' in optimizations and inode != 0:
continue
if 's' in optimizations and 's' in region_protec:
continue
if 'x' in optimizations and 'x' in region_protec:
continue
if 'r' in optimizations and not 'w' in region_protec:
continue
yield start, chunk
def ptrace_attach(self):
if not self.ptrace_started:
res=self._ptrace(True)
self.ptrace_started=True
return res
def ptrace_detach(self):
if self.ptrace_started:
res=self._ptrace(False)
self.ptrace_started=False
return res
def write_bytes(self, address, data):
if not self.ptrace_started:
self.ptrace_attach()
c_pid = c_pid_t(self.pid)
null = ctypes.c_void_p()
#we can only copy data per range of 4 or 8 bytes
word_size=ctypes.sizeof(ctypes.c_void_p)
#mprotect(address, len(data)+(len(data)%word_size), PROT_WRITE|PROT_READ)
for i in range(0, len(data), word_size):
word=data[i:i+word_size]
if len(word)<word_size: #we need to let some data untouched, so let's read at given offset to complete our 8 bytes
existing_data=self.read_bytes(int(address)+i+len(word), bytes=(word_size-len(word)))
word+=existing_data
if sys.byteorder=="little":
word=word[::-1]
attempt=0
err = c_ptrace(ctypes.c_int(PTRACE_POKEDATA), c_pid, int(address)+i, int(word.encode("hex"), 16))
if err != 0:
error=errno.errorcode.get(ctypes.get_errno(), 'UNKNOWN')
raise OSError("Error using PTRACE_POKEDATA: %s"%error)
self.ptrace_detach()
return True
def read_bytes(self, address, bytes = 4):
if self.read_ptrace:
self.ptrace_attach()
data=b''
if not LARGE_FILE_SUPPORT:
mem_file.seek(address)
data=mem_file.read(bytes)
else:
lseek64(self.mem_file, address, os.SEEK_SET)
data=b""
try:
data=os.read(self.mem_file, bytes)
except Exception as e:
logger.info("Error reading %s at %s: %s"%((bytes),address, e))
if self.read_ptrace:
self.ptrace_detach()
return data
================================================
FILE: Linux/lazagne/config/lib/memorpy/LinStructures.py
================================================
#!/usr/bin/env python
# -*- coding: UTF8 -*-
PROT_NONE = 0
PROT_READ = 1
PROT_WRITE = 2
PROT_EXEC = 4
PROT_PRIVATE = 8
PROT_SHARED = 16
#Use some Windows constants for compatibility
PAGE_EXECUTE_READWRITE = PROT_EXEC | PROT_READ | PROT_WRITE
PAGE_EXECUTE_READ = PROT_EXEC | PROT_READ
PAGE_READONLY = PROT_READ
PAGE_READWRITE = PROT_READ | PROT_WRITE
PTRACE_POKEDATA = 5
PTRACE_ATTACH = 16
PTRACE_DETACH =17
PTRACE_CONT = 7
================================================
FILE: Linux/lazagne/config/lib/memorpy/Locator.py
================================================
# Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with memorpy. If not, see <http://www.gnu.org/licenses/>.
import copy
import time
import struct
from .Address import Address
class Locator(object):
"""
take a memoryworker and a type to search
then you can feed the locator with values and it will reduce the addresses possibilities
"""
def __init__(self, mw, type = 'unknown', start = None, end = None):
self.mw = mw
self.type = type
self.last_iteration = {}
self.last_value = None
self.start = start
self.end = end
def find(self, value, erase_last = True):
return self.feed(value, erase_last)
def feed(self, value, erase_last = True):
self.last_value = value
new_iter = copy.copy(self.last_iteration)
if self.type == 'unknown':
all_types = ['uint',
'int',
'long',
'ulong',
'float',
'double',
'short',
'ushort']
else:
all_types = [self.type]
for type in all_types:
if type not in new_iter:
try:
new_iter[type] = [ Address(x, self.mw.process, type) for x in self.mw.mem_search(value, type, start_offset=self.start, end_offset=self.end) ]
except struct.error:
new_iter[type] = []
else:
l = []
for address in new_iter[type]:
try:
found = self.mw.process.read(address, type)
if int(found) == int(value):
l.append(Address(address, self.mw.process, type))
except Exception as e:
pass
new_iter[type] = l
if erase_last:
del self.last_iteration
self.last_iteration = new_iter
return new_iter
def get_addresses(self):
return self.last_iteration
def diff(self, erase_last = False):
return self.get_modified_addr(erase_last)
def get_modified_addr(self, erase_last = False):
last = self.last_iteration
new = self.feed(self.last_value, erase_last=erase_last)
ret = {}
for type, l in last.iteritems():
typeset = set(new[type])
for addr in l:
if addr not in typeset:
if type not in ret:
ret[type] = []
ret[type].append(addr)
return ret
================================================
FILE: Linux/lazagne/config/lib/memorpy/MemWorker.py
================================================
# Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with memorpy. If not, see <http://www.gnu.org/licenses/>.
import sys
import string
import re
import logging
import traceback
import binascii
import struct
from .Process import *
from .utils import *
from .Address import Address
from .BaseProcess import ProcessException
from .structures import *
logger = logging.getLogger('memorpy')
REGEX_TYPE=type(re.compile("^plop$"))
class MemWorker(object):
def __init__(self, pid=None, name=None, end_offset = None, start_offset = None, debug=True):
self.process = Process(name=name, pid=pid, debug=debug)
def __enter__(self):
return self
def __exit__(self, type, value, traceback):
self.process.close()
def Address(self, value, default_type = 'uint'):
""" wrapper to instanciate an Address class for the memworker.process"""
return Address(value, process=self.process, default_type=default_type)
def umem_replace(self, regex, replace):
""" like search_replace_mem but works with unicode strings """
regex = re_to_unicode(regex)
replace = replace.encode('utf-16-le')
return self.mem_replace(re.compile(regex, re.UNICODE), replace)
def mem_replace(self, regex, replace):
""" search memory for a pattern and replace all found occurrences """
allWritesSucceed = True
for _, start_offset in self.mem_search(regex, ftype='re'):
if self.process.write_bytes(start_offset, replace) == 1:
logger.debug('Write at offset %s succeeded !' % start_offset)
else:
allWritesSucceed = False
logger.debug('Write at offset %s failed !' % start_offset)
return allWritesSucceed
def umem_search(self, regex):
""" like mem_search but works with unicode strings """
regex = re_to_unicode(regex)
for _, i in self.mem_search(str(regex), ftype='re'):
yield i
def group_search(self, group, start_offset = None, end_offset = None):
regex = ''
for value, type in group:
if type == 'f' or type == 'float':
f = struct.pack('<f', float(value))
regex += '..' + f[2:4]
else:
raise NotImplementedError('unknown type %s' % type)
return self.mem_search(regex, ftype='re', start_offset=start_offset, end_offset=end_offset)
def search_address(self, addr):
a = '%08X' % addr
logger.debug('searching address %s' % a)
regex = ''
for i in range(len(a) - 2, -1, -2):
regex += binascii.unhexlify(a[i:i + 2])
for _, a in self.mem_search(re.escape(regex), ftype='re'):
yield a
def parse_re_function(self, b, value, offset):
for name, regex in value:
for res in regex.finditer(b):
yield name, self.Address(offset+res.start(), 'bytes')
"""
index = b.find(res)
while index != -1:
soffset = offset + index
if soffset not in duplicates_cache:
duplicates_cache.add(soffset)
yield name, self.Address(soffset, 'bytes')
index = b.find(res, index + len(res))
"""
def parse_float_function(self, b, value, offset):
for index in range(0, len(b)):
try:
structtype, structlen = type_unpack('float')
tmpval = struct.unpack(structtype, b[index:index + 4])[0]
if int(value) == int(tmpval):
soffset = offset + index
yield self.Address(soffset, 'float')
except Exception as e:
pass
def parse_named_groups_function(self, b, value, offset=None):
for name, regex in value:
for res in regex.finditer(b):
yield name, res.groupdict()
def parse_groups_function(self, b, value, offset=None):
for name, regex in value:
for res in regex.finditer(b):
yield name, res.groups()
def parse_any_function(self, b, value, offset):
index = b.find(value)
while index != -1:
soffset = offset + index
yield self.Address(soffset, 'bytes')
index = b.find(value, index + 1)
def mem_search(self, value, ftype = 'match', protec = PAGE_READWRITE | PAGE_READONLY, optimizations=None, start_offset = None, end_offset = None):
"""
iterator returning all indexes where the pattern has been found
"""
# pre-compile regex to run faster
if ftype == 're' or ftype == 'groups' or ftype == 'ngroups':
# value should be an array of regex
if type(value) is not list:
value = [value]
tmp = []
for reg in value:
if type(reg) is tuple:
name = reg[0]
if type(reg[1]) != REGEX_TYPE:
regex = re.compile(reg[1], re.IGNORECASE)
else:
regex=reg[1]
elif type(reg) == REGEX_TYPE:
name = ''
regex=reg
else:
name = ''
regex = re.compile(reg, re.IGNORECASE)
tmp.append((name, regex))
value = tmp
elif ftype != 'match' and ftype != 'group' and ftype != 're' and ftype != 'groups' and ftype != 'ngroups' and ftype != 'lambda':
structtype, structlen = type_unpack(ftype)
value = struct.pack(structtype, value)
# different functions avoid if statement before parsing the buffer
if ftype == 're':
func = self.parse_re_function
elif ftype == 'groups':
func = self.parse_groups_function
elif ftype == 'ngroups':
func = self.parse_named_groups_function
elif ftype == 'float':
func = self.parse_float_function
elif ftype == 'lambda': # use a custm function
func = value
else:
func = self.parse_any_function
if not self.process.isProcessOpen:
raise ProcessException("Can't read_bytes, process %s is not open" % (self.process.pid))
for offset, chunk_size in self.process.iter_region(start_offset=start_offset, end_offset=end_offset, protec=protec, optimizations=optimizations):
b = b''
current_offset = offset
chunk_read = 0
chunk_exc = False
while chunk_read < chunk_size:
try:
b += self.process.read_bytes(current_offset, chunk_size)
except IOError as e:
print(traceback.format_exc())
if e.errno == 13:
raise
else:
logger.warning(e)
chunk_exc=True
break
except Exception as e:
print('coucou')
logger.warning(e)
chunk_exc = True
break
finally:
current_offset += chunk_size
chunk_read += chunk_size
if chunk_exc:
continue
if b:
if ftype=="lambda":
for res in func(b.decode('latin'), offset):
yield res
else:
for res in func(b.decode('latin'), value, offset):
yield res
================================================
FILE: Linux/lazagne/config/lib/memorpy/OSXProcess.py
================================================
# Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with memorpy. If not, see <http://www.gnu.org/licenses/>.
import copy
import struct
import utils
import platform
import ctypes, re, sys
import ctypes.util
import errno
import os
import signal
from .BaseProcess import BaseProcess, ProcessException
from .structures import *
import logging
import subprocess
logger = logging.getLogger('memorpy')
libc = ctypes.CDLL(ctypes.util.find_library('c'))
VM_REGION_BASIC_INFO_64 = 9
class vm_region_basic_info_64(ctypes.Structure):
_fields_ = [
('protection', ctypes.c_uint32),
('max_protection', ctypes.c_uint32),
('inheritance', ctypes.c_uint32),
('shared', ctypes.c_uint32),
('reserved', ctypes.c_uint32),
('offset', ctypes.c_ulonglong),
('behavior', ctypes.c_uint32),
('user_wired_count',ctypes.c_ushort),
]
VM_REGION_BASIC_INFO_COUNT_64 = ctypes.sizeof(vm_region_basic_info_64) / 4
VM_PROT_READ = 1
VM_PROT_WRITE = 2
VM_PROT_EXECUTE = 4
class OSXProcess(BaseProcess):
def __init__(self, pid=None, name=None, debug=True):
""" Create and Open a process object from its pid or from its name """
super(OSXProcess, self).__init__()
if pid is not None:
self.pid=pid
elif name is not None:
self.pid=OSXProcess.pid_from_name(name)
else:
raise ValueError("You need to instanciate process with at least a name or a pid")
self.task=None
self.mytask=None
self._open()
def close(self):
pass
def __del__(self):
pass
def _open(self):
self.isProcessOpen = True
self.task = ctypes.c_uint32()
self.mytask=libc.mach_task_self()
ret=libc.task_for_pid(self.mytask, ctypes.c_int(self.pid), ctypes.pointer(self.task))
if ret!=0:
raise ProcessException("task_for_pid failed with error code : %s"%ret)
@staticmethod
def list():
#TODO list processes with ctypes
processes=[]
res=subprocess.check_output("ps A", shell=True)
for line in res.split('\n'):
try:
tab=line.split()
pid=int(tab[0])
exe=' '.join(tab[4:])
processes.append({"pid":int(pid), "name":exe})
except:
pass
return processes
@staticmethod
def pid_from_name(name):
for dic in OSXProcess.list():
if name in dic['exe']:
return dic['pid']
def iter_region(self, start_offset=None, end_offset=None, protec=None, optimizations=None):
"""
optimizations :
i for inode==0 (no file mapping)
s to avoid scanning shared regions
x to avoid scanning x regions
r don't scan ronly regions
"""
maps = []
address = ctypes.c_ulong(0)
mapsize = ctypes.c_ulong(0)
name = ctypes.c_uint32(0)
count = ctypes.c_uint32(VM_REGION_BASIC_INFO_COUNT_64)
info = vm_region_basic_info_64()
while True:
r = libc.mach_vm_region(self.task, ctypes.pointer(address),
ctypes.pointer(mapsize), VM_REGION_BASIC_INFO_64,
ctypes.pointer(info), ctypes.pointer(count),
ctypes.pointer(name))
# If we get told "invalid address", we have crossed into kernel land...
if r == 1:
break
if r != 0:
raise ProcessException('mach_vm_region failed with error code %s' % r)
if start_offset is not None:
if address.value < start_offset:
address.value += mapsize.value
continue
if end_offset is not None:
if address.value > end_offset:
break
p = info.protection
if p & VM_PROT_EXECUTE:
if optimizations and 'x' in optimizations:
address.value += mapsize.value
continue
if info.shared:
if optimizations and 's' in optimizations:
address.value += mapsize.value
continue
if p & VM_PROT_READ:
if not (p & VM_PROT_WRITE):
if optimizations and 'r' in optimizations:
address.value += mapsize.value
continue
yield address.value, mapsize.value
address.value += mapsize.value
def write_bytes(self, address, data):
raise NotImplementedError("write not implemented on OSX")
return True
def read_bytes(self, address, bytes = 4):
pdata = ctypes.c_void_p(0)
data_cnt = ctypes.c_uint32(0)
ret = libc.mach_vm_read(self.task, ctypes.c_ulonglong(address), ctypes.c_longlong(bytes), ctypes.pointer(pdata), ctypes.pointer(data_cnt));
#if ret==1:
# return ""
if ret!=0:
raise ProcessException("mach_vm_read returned : %s"%ret)
buf=ctypes.string_at(pdata.value, data_cnt.value)
libc.vm_deallocate(self.mytask, pdata, data_cnt)
return buf
================================================
FILE: Linux/lazagne/config/lib/memorpy/Process.py
================================================
#!/usr/bin/env python
# -*- coding: UTF8 -*-
import sys
from .BaseProcess import *
if sys.platform=='win32':
from .WinProcess import WinProcess as Process
elif sys.platform=='darwin':
from .OSXProcess import OSXProcess as Process
elif 'sunos' in sys.platform:
from .SunProcess import SunProcess as Process
else:
from .LinProcess import LinProcess as Process
================================================
FILE: Linux/lazagne/config/lib/memorpy/SunProcess.py
================================================
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with memorpy. If not, see <http://www.gnu.org/licenses/>.
from .BaseProcess import BaseProcess, ProcessException
import struct
import os
MA_READ = 0x04
MA_WRITE = 0x02
MA_EXEC = 0x01
MA_SHARED = 0x08
MA_ANON = 0x40
MA_ISM = 0x80
MA_NORESERVE = 0x100
MA_SHM = 0x200
MA_RESERVED1 = 0x400
MA_OSM = 0x800
PSINFO_T = struct.Struct(
'iiiIIIIIIIILLLLHHLLLLLL16s80siiLLciILLcccchi8sLLIIIIII'
)
MAP_T = struct.Struct(
'LL64sQiiii'
)
class SunProcess(BaseProcess):
def __init__(self, pid=None, name=None, debug=True, ptrace=None):
''' Create and Open a process object from its pid or from its name '''
super(SunProcess, self).__init__()
self.pid = int(pid)
self.pas = None
self.writable = False
if name and not self.pid:
self.pid = SunProcess.pid_from_name(name)
if not name and not self.pid:
raise ValueError('You need to instanciate process with at least a name or a pid')
try:
self._open()
except:
pass
def close(self):
if self.pas:
self.pas.close()
def __del__(self):
self.close()
def _open(self):
try:
self.pas = open('/proc/%d/as'%(self.pid), 'w+')
self.writable = True
except IOError:
self.pas = open('/proc/%d/as'%(self.pid))
self.isProcessOpen = True
@staticmethod
def _name_args(pid):
with open('/proc/%d/psinfo'%(int(pid))) as psinfo:
items = PSINFO_T.unpack_from(psinfo.read())
return items[23].rstrip('\x00'), items[24].rstrip('\x00')
@staticmethod
def list():
processes=[]
for pid in os.listdir('/proc'):
try:
pid = int(pid)
name, _ = SunProcess._name_args(pid)
processes.append({
'pid': pid,
'name': name
})
except:
pass
return processes
@staticmethod
def pid_from_name(name):
processes=[]
for pid in os.listdir('/proc'):
try:
pid = int(pid)
pname, cmdline = SunProcess._name_args(pid)
if name in pname:
return pid
if name in cmdline.split(' ', 1)[0]:
return pid
except:
pass
raise ProcessException('No process with such name: %s'%name)
def iter_region(self, start_offset=None, end_offset=None, protec=None, optimizations=None):
"""
optimizations :
i for inode==0 (no file mapping)
s to avoid scanning shared regions
x to avoid scanning x regions
r don't scan ronly regions
"""
if not self.isProcessOpen:
return
with open('/proc/%d/map'%(self.pid)) as maps_file:
while True:
mapping = maps_file.read(MAP_T.size)
if not mapping:
break
start, size, name, offset, flags, pagesize, shmid, filler = MAP_T.unpack(mapping)
if start_offset is not None:
if start < start_offset:
continue
if end_offset is not None:
if start > end_offset:
continue
if not flags & MA_READ:
continue
if optimizations:
if 'i' in optimizations and not flags & MA_ANON:
continue
if 's' in optimizations and flags & MA_SHM:
continue
# in sunos it's quite common when this flag is set, so let's use other letter
if 'X' in optimizations and flags & MA_EXEC:
continue
if 'r' in optimizations and not flags & MA_WRITE:
continue
yield start, size
def write_bytes(self, address, data):
if not self.pas or not self.writable:
return False
self.pas.seek(address)
self.pas.write(data)
return True
def read_bytes(self, address, bytes = 4):
if not self.pas:
return
self.pas.seek(address)
return self.pas.read(bytes)
================================================
FILE: Linux/lazagne/config/lib/memorpy/WinProcess.py
================================================
# Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with memorpy. If not, see <http://www.gnu.org/licenses/>.
from ctypes import pointer, sizeof, windll, create_string_buffer, c_ulong, byref, GetLastError, c_bool, WinError
from .structures import *
import copy
import struct
# import utils
import platform
from .BaseProcess import BaseProcess, ProcessException
psapi = windll.psapi
kernel32 = windll.kernel32
advapi32 = windll.advapi32
IsWow64Process=None
if hasattr(kernel32,'IsWow64Process'):
IsWow64Process=kernel32.IsWow64Process
IsWow64Process.restype = c_bool
IsWow64Process.argtypes = [c_void_p, POINTER(c_bool)]
class WinProcess(BaseProcess):
def __init__(self, pid=None, name=None, debug=True):
""" Create and Open a process object from its pid or from its name
gitextract_rh6z8oxz/ ├── .github/ │ └── workflows/ │ ├── WinCompile.yml │ └── lint_python.yml ├── .gitignore ├── .travis.yml ├── CHANGELOG ├── LICENSE ├── Linux/ │ ├── hook-sys.py │ ├── laZagne.py │ ├── lazagne/ │ │ ├── __init__.py │ │ ├── config/ │ │ │ ├── __init__.py │ │ │ ├── constant.py │ │ │ ├── crypto/ │ │ │ │ ├── __init__.py │ │ │ │ ├── pbkdf2.py │ │ │ │ ├── pyDes.py │ │ │ │ └── pyaes/ │ │ │ │ ├── __init__.py │ │ │ │ ├── aes.py │ │ │ │ ├── blockfeeder.py │ │ │ │ └── util.py │ │ │ ├── dico.py │ │ │ ├── homes.py │ │ │ ├── lib/ │ │ │ │ ├── __init__.py │ │ │ │ └── memorpy/ │ │ │ │ ├── Address.py │ │ │ │ ├── BaseProcess.py │ │ │ │ ├── LinProcess.py │ │ │ │ ├── LinStructures.py │ │ │ │ ├── Locator.py │ │ │ │ ├── MemWorker.py │ │ │ │ ├── OSXProcess.py │ │ │ │ ├── Process.py │ │ │ │ ├── SunProcess.py │ │ │ │ ├── WinProcess.py │ │ │ │ ├── WinStructures.py │ │ │ │ ├── __init__.py │ │ │ │ ├── structures.py │ │ │ │ ├── utils.py │ │ │ │ ├── version.py │ │ │ │ └── wintools.py │ │ │ ├── manage_modules.py │ │ │ ├── module_info.py │ │ │ ├── run.py │ │ │ ├── soft_import_module.py │ │ │ └── write_output.py │ │ └── softwares/ │ │ ├── __init__.py │ │ ├── browsers/ │ │ │ ├── __init__.py │ │ │ ├── chromium_based.py │ │ │ ├── chromium_browsers.py │ │ │ ├── firefox_browsers.py │ │ │ ├── mozilla.py │ │ │ └── opera.py │ │ ├── chats/ │ │ │ ├── __init__.py │ │ │ ├── pidgin.py │ │ │ └── psi.py │ │ ├── databases/ │ │ │ ├── __init__.py │ │ │ ├── dbvis.py │ │ │ ├── sqldeveloper.py │ │ │ └── squirrel.py │ │ ├── git/ │ │ │ ├── __init__.py │ │ │ └── gitforlinux.py │ │ ├── mails/ │ │ │ ├── __init__.py │ │ │ ├── clawsmail.py │ │ │ └── thunderbird_mails.py │ │ ├── memory/ │ │ │ ├── __init__.py │ │ │ ├── memorydump.py │ │ │ └── mimipy.py │ │ ├── sysadmin/ │ │ │ ├── __init__.py │ │ │ ├── apachedirectorystudio.py │ │ │ ├── aws.py │ │ │ ├── cli.py │ │ │ ├── docker.py │ │ │ ├── env_variable.py │ │ │ ├── filezilla.py │ │ │ ├── fstab.py │ │ │ ├── gftp.py │ │ │ ├── grub.py │ │ │ ├── keepassconfig.py │ │ │ ├── rclone.py │ │ │ ├── shadow.py │ │ │ └── ssh.py │ │ ├── wallet/ │ │ │ ├── __init__.py │ │ │ ├── kde.py │ │ │ └── libsecret.py │ │ └── wifi/ │ │ ├── __init__.py │ │ ├── wifi.py │ │ └── wpa_supplicant.py │ └── lazagne.spec ├── Mac/ │ ├── hook-sys.py │ ├── laZagne.py │ ├── lazagne/ │ │ ├── __init__.py │ │ ├── config/ │ │ │ ├── __init__.py │ │ │ ├── constant.py │ │ │ ├── crypto/ │ │ │ │ ├── __init__.py │ │ │ │ ├── pyDes.py │ │ │ │ └── pyaes/ │ │ │ │ ├── __init__.py │ │ │ │ ├── aes.py │ │ │ │ ├── blockfeeder.py │ │ │ │ └── util.py │ │ │ ├── dico.py │ │ │ ├── manage_modules.py │ │ │ ├── module_info.py │ │ │ ├── run.py │ │ │ ├── soft_import_module.py │ │ │ └── write_output.py │ │ └── softwares/ │ │ ├── __init__.py │ │ ├── browsers/ │ │ │ ├── __init__.py │ │ │ ├── chrome.py │ │ │ ├── firefox_browsers.py │ │ │ └── mozilla.py │ │ ├── mails/ │ │ │ ├── __init__.py │ │ │ └── thunderbird.py │ │ └── system/ │ │ ├── __init__.py │ │ ├── chainbreaker.py │ │ ├── chainbreaker_module/ │ │ │ ├── Schema.py │ │ │ ├── __init__.py │ │ │ ├── chainbreaker.py │ │ │ └── pbkdf2.py │ │ ├── hashdump.py │ │ └── system.py │ └── lazagne.spec ├── README.md ├── Windows/ │ ├── hook-sys.py │ ├── laZagne.py │ ├── lazagne/ │ │ ├── __init__.py │ │ ├── config/ │ │ │ ├── DPAPI/ │ │ │ │ ├── __init__.py │ │ │ │ ├── blob.py │ │ │ │ ├── credfile.py │ │ │ │ ├── credhist.py │ │ │ │ ├── crypto.py │ │ │ │ ├── eater.py │ │ │ │ ├── masterkey.py │ │ │ │ ├── system.py │ │ │ │ └── vault.py │ │ │ ├── __init__.py │ │ │ ├── change_privileges.py │ │ │ ├── constant.py │ │ │ ├── crypto/ │ │ │ │ ├── __init__.py │ │ │ │ ├── md4.py │ │ │ │ ├── pyDes.py │ │ │ │ ├── pyaes/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── aes.py │ │ │ │ │ ├── blockfeeder.py │ │ │ │ │ └── util.py │ │ │ │ └── rc4.py │ │ │ ├── dico.py │ │ │ ├── dpapi_structure.py │ │ │ ├── execute_cmd.py │ │ │ ├── lib/ │ │ │ │ ├── __init__.py │ │ │ │ └── memorpy/ │ │ │ │ ├── Address.py │ │ │ │ ├── BaseProcess.py │ │ │ │ ├── LinProcess.py │ │ │ │ ├── LinStructures.py │ │ │ │ ├── Locator.py │ │ │ │ ├── MemWorker.py │ │ │ │ ├── OSXProcess.py │ │ │ │ ├── Process.py │ │ │ │ ├── SunProcess.py │ │ │ │ ├── WinProcess.py │ │ │ │ ├── WinStructures.py │ │ │ │ ├── __init__.py │ │ │ │ ├── structures.py │ │ │ │ ├── utils.py │ │ │ │ ├── version.py │ │ │ │ └── wintools.py │ │ │ ├── manage_modules.py │ │ │ ├── module_info.py │ │ │ ├── run.py │ │ │ ├── soft_import_module.py │ │ │ ├── users.py │ │ │ ├── winstructure.py │ │ │ └── write_output.py │ │ └── softwares/ │ │ ├── __init__.py │ │ ├── browsers/ │ │ │ ├── __init__.py │ │ │ ├── chromium_based.py │ │ │ ├── chromium_browsers.py │ │ │ ├── firefox_browsers.py │ │ │ ├── ie.py │ │ │ ├── mozilla.py │ │ │ └── ucbrowser.py │ │ ├── chats/ │ │ │ ├── __init__.py │ │ │ ├── pidgin.py │ │ │ ├── psi.py │ │ │ └── skype.py │ │ ├── databases/ │ │ │ ├── __init__.py │ │ │ ├── dbvis.py │ │ │ ├── postgresql.py │ │ │ ├── robomongo.py │ │ │ ├── sqldeveloper.py │ │ │ └── squirrel.py │ │ ├── games/ │ │ │ ├── __init__.py │ │ │ ├── galconfusion.py │ │ │ ├── kalypsomedia.py │ │ │ ├── roguestale.py │ │ │ └── turba.py │ │ ├── git/ │ │ │ ├── __init__.py │ │ │ └── gitforwindows.py │ │ ├── mails/ │ │ │ ├── __init__.py │ │ │ ├── outlook.py │ │ │ └── thunderbird_mails.py │ │ ├── maven/ │ │ │ ├── __init__.py │ │ │ └── mavenrepositories.py │ │ ├── memory/ │ │ │ ├── __init__.py │ │ │ ├── keepass.py │ │ │ ├── keethief.py │ │ │ ├── libkeepass/ │ │ │ │ ├── __init__.py │ │ │ │ ├── common.py │ │ │ │ ├── crypto.py │ │ │ │ ├── hbio.py │ │ │ │ ├── kdb4.py │ │ │ │ └── pureSalsa20.py │ │ │ ├── memorydump.py │ │ │ └── onepassword.py │ │ ├── multimedia/ │ │ │ ├── __init__.py │ │ │ └── eyecon.py │ │ ├── php/ │ │ │ ├── __init__.py │ │ │ └── composer.py │ │ ├── svn/ │ │ │ ├── __init__.py │ │ │ └── tortoise.py │ │ ├── sysadmin/ │ │ │ ├── __init__.py │ │ │ ├── apachedirectorystudio.py │ │ │ ├── coreftp.py │ │ │ ├── cyberduck.py │ │ │ ├── d3des.py │ │ │ ├── filezilla.py │ │ │ ├── filezillaserver.py │ │ │ ├── ftpnavigator.py │ │ │ ├── iisapppool.py │ │ │ ├── iiscentralcertp.py │ │ │ ├── keepassconfig.py │ │ │ ├── mRemoteNG.py │ │ │ ├── opensshforwindows.py │ │ │ ├── openvpn.py │ │ │ ├── puttycm.py │ │ │ ├── rclone.py │ │ │ ├── rdpmanager.py │ │ │ ├── unattended.py │ │ │ ├── vnc.py │ │ │ ├── winscp.py │ │ │ └── wsl.py │ │ ├── wifi/ │ │ │ ├── __init__.py │ │ │ └── wifi.py │ │ └── windows/ │ │ ├── __init__.py │ │ ├── autologon.py │ │ ├── cachedump.py │ │ ├── creddump7/ │ │ │ ├── __init__.py │ │ │ ├── addrspace.py │ │ │ ├── newobj.py │ │ │ ├── object.py │ │ │ ├── types.py │ │ │ └── win32/ │ │ │ ├── __init__.py │ │ │ ├── domcachedump.py │ │ │ ├── hashdump.py │ │ │ ├── lsasecrets.py │ │ │ └── rawreg.py │ │ ├── credfiles.py │ │ ├── credman.py │ │ ├── hashdump.py │ │ ├── lsa_secrets.py │ │ ├── ppypykatz.py │ │ ├── vault.py │ │ ├── vaultfiles.py │ │ └── windows.py │ └── lazagne.spec └── requirements.txt
SYMBOL INDEX (1646 symbols across 182 files)
FILE: Linux/laZagne.py
function output (line 28) | def output(output_dir=None, txt_format=False, json_format=False, all_for...
function quiet_mode (line 53) | def quiet_mode(is_quiet_mode=False):
function verbosity (line 58) | def verbosity(verbose=0):
function clean_args (line 78) | def clean_args(arg):
function runLaZagne (line 90) | def runLaZagne(category_selected='all', subcategories={}):
FILE: Linux/lazagne/config/constant.py
class constant (line 9) | class constant():
FILE: Linux/lazagne/config/crypto/pbkdf2.py
function char_to_int (line 18) | def char_to_int(string):
function chr_or_byte (line 24) | def chr_or_byte(integer):
function pbkdf2 (line 32) | def pbkdf2(password, salt, itercount, keylen):
function xorstr (line 47) | def xorstr(a, b):
function prf (line 58) | def prf(h, data):
function pbkdf2_F (line 66) | def pbkdf2_F(h, salt, itercount, blocknum):
FILE: Linux/lazagne/config/crypto/pyDes.py
class _baseDes (line 108) | class _baseDes(object):
method __init__ (line 109) | def __init__(self, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method getKey (line 126) | def getKey(self):
method setKey (line 130) | def setKey(self, key):
method getMode (line 135) | def getMode(self):
method setMode (line 139) | def setMode(self, mode):
method getPadding (line 143) | def getPadding(self):
method setPadding (line 147) | def setPadding(self, pad):
method getPadMode (line 153) | def getPadMode(self):
method setPadMode (line 157) | def setPadMode(self, mode):
method getIV (line 161) | def getIV(self):
method setIV (line 165) | def setIV(self, IV):
method _padData (line 172) | def _padData(self, data, pad, padmode):
method _unpadData (line 202) | def _unpadData(self, data, pad, padmode):
method _guardAgainstUnicode (line 229) | def _guardAgainstUnicode(self, data):
class des (line 249) | class des(_baseDes):
method __init__ (line 397) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method setKey (line 411) | def setKey(self, key):
method __String_to_BitList (line 416) | def __String_to_BitList(self, data):
method __BitList_to_String (line 437) | def __BitList_to_String(self, data):
method __permutate (line 454) | def __permutate(self, table, block):
method __create_sub_keys (line 460) | def __create_sub_keys(self):
method __des_crypt (line 485) | def __des_crypt(self, block, crypt_type):
method crypt (line 564) | def crypt(self, data, crypt_type):
method encrypt (line 643) | def encrypt(self, data, pad=None, padmode=None):
method decrypt (line 662) | def decrypt(self, data, pad=None, padmode=None):
class triple_des (line 687) | class triple_des(_baseDes):
method __init__ (line 709) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method setKey (line 713) | def setKey(self, key):
method setMode (line 740) | def setMode(self, mode):
method setPadding (line 746) | def setPadding(self, pad):
method setPadMode (line 752) | def setPadMode(self, mode):
method setIV (line 758) | def setIV(self, IV):
method encrypt (line 764) | def encrypt(self, data, pad=None, padmode=None):
method decrypt (line 808) | def decrypt(self, data, pad=None, padmode=None):
FILE: Linux/lazagne/config/crypto/pyaes/aes.py
function _compact_word (line 61) | def _compact_word(word):
function _string_to_bytes (line 64) | def _string_to_bytes(text):
function _bytes_to_string (line 67) | def _bytes_to_string(binary):
function _concat_list (line 70) | def _concat_list(a, b):
function _string_to_bytes (line 81) | def _string_to_bytes(text):
function _bytes_to_string (line 87) | def _bytes_to_string(binary):
function _concat_list (line 91) | def _concat_list(a, b):
class AES (line 97) | class AES(object):
method __init__ (line 131) | def __init__(self, key):
method encrypt (line 203) | def encrypt(self, plaintext):
method decrypt (line 237) | def decrypt(self, ciphertext):
class Counter (line 272) | class Counter(object):
method __init__ (line 278) | def __init__(self, initial_value = 1):
method increment (line 285) | def increment(self):
class AESBlockModeOfOperation (line 301) | class AESBlockModeOfOperation(object):
method __init__ (line 303) | def __init__(self, key):
method decrypt (line 306) | def decrypt(self, ciphertext):
method encrypt (line 309) | def encrypt(self, plaintext):
class AESStreamModeOfOperation (line 313) | class AESStreamModeOfOperation(AESBlockModeOfOperation):
class AESSegmentModeOfOperation (line 316) | class AESSegmentModeOfOperation(AESStreamModeOfOperation):
class AESModeOfOperationECB (line 323) | class AESModeOfOperationECB(AESBlockModeOfOperation):
method encrypt (line 340) | def encrypt(self, plaintext):
method decrypt (line 347) | def decrypt(self, ciphertext):
class AESModeOfOperationCBC (line 356) | class AESModeOfOperationCBC(AESBlockModeOfOperation):
method __init__ (line 377) | def __init__(self, key, iv = None):
method encrypt (line 387) | def encrypt(self, plaintext):
method decrypt (line 397) | def decrypt(self, ciphertext):
class AESModeOfOperationCFB (line 409) | class AESModeOfOperationCFB(AESSegmentModeOfOperation):
method __init__ (line 422) | def __init__(self, key, iv, segment_size = 1):
method encrypt (line 438) | def encrypt(self, plaintext):
method decrypt (line 458) | def decrypt(self, ciphertext):
class AESModeOfOperationOFB (line 480) | class AESModeOfOperationOFB(AESStreamModeOfOperation):
method __init__ (line 496) | def __init__(self, key, iv = None):
method encrypt (line 508) | def encrypt(self, plaintext):
method decrypt (line 521) | def decrypt(self, ciphertext):
class AESModeOfOperationCTR (line 527) | class AESModeOfOperationCTR(AESStreamModeOfOperation):
method __init__ (line 556) | def __init__(self, key, counter = None):
method encrypt (line 565) | def encrypt(self, plaintext):
method decrypt (line 577) | def decrypt(self, crypttext):
FILE: Linux/lazagne/config/crypto/pyaes/blockfeeder.py
function _block_can_consume (line 54) | def _block_can_consume(self, size):
function _block_final_encrypt (line 59) | def _block_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _block_final_decrypt (line 75) | def _block_final_decrypt(self, data, padding = PADDING_DEFAULT):
function _segment_can_consume (line 94) | def _segment_can_consume(self, size):
function _segment_final_encrypt (line 98) | def _segment_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _segment_final_decrypt (line 107) | def _segment_final_decrypt(self, data, padding = PADDING_DEFAULT):
function _stream_can_consume (line 123) | def _stream_can_consume(self, size):
function _stream_final_encrypt (line 126) | def _stream_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _stream_final_decrypt (line 132) | def _stream_final_decrypt(self, data, padding = PADDING_DEFAULT):
class BlockFeeder (line 144) | class BlockFeeder(object):
method __init__ (line 149) | def __init__(self, mode, feed, final, padding = PADDING_DEFAULT):
method feed (line 156) | def feed(self, data = None):
class Encrypter (line 186) | class Encrypter(BlockFeeder):
method __init__ (line 189) | def __init__(self, mode, padding = PADDING_DEFAULT):
class Decrypter (line 193) | class Decrypter(BlockFeeder):
method __init__ (line 196) | def __init__(self, mode, padding = PADDING_DEFAULT):
function _feed_stream (line 203) | def _feed_stream(feeder, in_stream, out_stream, block_size = BLOCK_SIZE):
function encrypt_stream (line 216) | def encrypt_stream(mode, in_stream, out_stream, block_size = BLOCK_SIZE,...
function decrypt_stream (line 223) | def decrypt_stream(mode, in_stream, out_stream, block_size = BLOCK_SIZE,...
FILE: Linux/lazagne/config/crypto/pyaes/util.py
function to_bufferable (line 29) | def to_bufferable(binary):
function _get_byte (line 32) | def _get_byte(c):
function to_bufferable (line 39) | def to_bufferable(binary):
function _get_byte (line 44) | def _get_byte(c):
function append_PKCS7_padding (line 47) | def append_PKCS7_padding(data):
function strip_PKCS7_padding (line 51) | def strip_PKCS7_padding(data):
FILE: Linux/lazagne/config/dico.py
function get_dic (line 1) | def get_dic():
FILE: Linux/lazagne/config/homes.py
function directories (line 5) | def directories():
function get (line 25) | def get(file=[], directory=[]):
function users (line 49) | def users(file=[], directory=[]):
function get_linux_env (line 68) | def get_linux_env(pid):
function sessions (line 82) | def sessions(setenv=True):
FILE: Linux/lazagne/config/lib/memorpy/Address.py
class AddressException (line 19) | class AddressException(Exception):
class Address (line 23) | class Address(object):
method __init__ (line 26) | def __init__(self, value, process, default_type = 'uint'):
method read (line 32) | def read(self, type = None, maxlen = None, errors='raise'):
method write (line 48) | def write(self, data, type = None):
method symbol (line 53) | def symbol(self):
method get_instruction (line 56) | def get_instruction(self):
method dump (line 59) | def dump(self, ftype = 'bytes', size = 512, before = 32):
method __nonzero__ (line 63) | def __nonzero__(self):
method __add__ (line 66) | def __add__(self, other):
method __sub__ (line 69) | def __sub__(self, other):
method __repr__ (line 72) | def __repr__(self):
method __str__ (line 77) | def __str__(self):
method __int__ (line 82) | def __int__(self):
method __hex__ (line 85) | def __hex__(self):
method __get__ (line 88) | def __get__(self, instance, owner):
method __set__ (line 91) | def __set__(self, instance, value):
method __lt__ (line 94) | def __lt__(self, other):
method __le__ (line 97) | def __le__(self, other):
method __eq__ (line 100) | def __eq__(self, other):
method __ne__ (line 103) | def __ne__(self, other):
method __gt__ (line 106) | def __gt__(self, other):
method __ge__ (line 109) | def __ge__(self, other):
FILE: Linux/lazagne/config/lib/memorpy/BaseProcess.py
class ProcessException (line 11) | class ProcessException(Exception):
class BaseProcess (line 14) | class BaseProcess(object):
method __init__ (line 16) | def __init__(self, *args, **kwargs):
method __del__ (line 24) | def __del__(self):
method close (line 27) | def close(self):
method iter_region (line 29) | def iter_region(self, *args, **kwargs):
method write_bytes (line 31) | def write_bytes(self, address, data):
method read_bytes (line 34) | def read_bytes(self, address, bytes = 4):
method get_symbolic_name (line 37) | def get_symbolic_name(self, address):
method read (line 40) | def read(self, address, type = 'uint', maxlen = 50, errors='raise'):
method write (line 59) | def write(self, address, data, type = 'uint'):
FILE: Linux/lazagne/config/lib/memorpy/LinProcess.py
function errcheck (line 36) | def errcheck(ret, func, args):
class LinProcess (line 70) | class LinProcess(BaseProcess):
method __init__ (line 71) | def __init__(self, pid=None, name=None, debug=True, ptrace=None):
method check_ptrace_scope (line 89) | def check_ptrace_scope(self):
method close (line 132) | def close(self):
method __del__ (line 142) | def __del__(self):
method _open (line 145) | def _open(self):
method list (line 161) | def list():
method pid_from_name (line 172) | def pid_from_name(name):
method _ptrace (line 187) | def _ptrace(self, attach):
method iter_region (line 207) | def iter_region(self, start_offset=None, end_offset=None, protec=None,...
method ptrace_attach (line 240) | def ptrace_attach(self):
method ptrace_detach (line 246) | def ptrace_detach(self):
method write_bytes (line 252) | def write_bytes(self, address, data):
method read_bytes (line 280) | def read_bytes(self, address, bytes = 4):
FILE: Linux/lazagne/config/lib/memorpy/Locator.py
class Locator (line 24) | class Locator(object):
method __init__ (line 30) | def __init__(self, mw, type = 'unknown', start = None, end = None):
method find (line 38) | def find(self, value, erase_last = True):
method feed (line 41) | def feed(self, value, erase_last = True):
method get_addresses (line 78) | def get_addresses(self):
method diff (line 81) | def diff(self, erase_last = False):
method get_modified_addr (line 84) | def get_modified_addr(self, erase_last = False):
FILE: Linux/lazagne/config/lib/memorpy/MemWorker.py
class MemWorker (line 33) | class MemWorker(object):
method __init__ (line 35) | def __init__(self, pid=None, name=None, end_offset = None, start_offse...
method __enter__ (line 38) | def __enter__(self):
method __exit__ (line 41) | def __exit__(self, type, value, traceback):
method Address (line 44) | def Address(self, value, default_type = 'uint'):
method umem_replace (line 48) | def umem_replace(self, regex, replace):
method mem_replace (line 54) | def mem_replace(self, regex, replace):
method umem_search (line 66) | def umem_search(self, regex):
method group_search (line 72) | def group_search(self, group, start_offset = None, end_offset = None):
method search_address (line 83) | def search_address(self, addr):
method parse_re_function (line 93) | def parse_re_function(self, b, value, offset):
method parse_float_function (line 107) | def parse_float_function(self, b, value, offset):
method parse_named_groups_function (line 118) | def parse_named_groups_function(self, b, value, offset=None):
method parse_groups_function (line 123) | def parse_groups_function(self, b, value, offset=None):
method parse_any_function (line 128) | def parse_any_function(self, b, value, offset):
method mem_search (line 135) | def mem_search(self, value, ftype = 'match', protec = PAGE_READWRITE |...
FILE: Linux/lazagne/config/lib/memorpy/OSXProcess.py
class vm_region_basic_info_64 (line 37) | class vm_region_basic_info_64(ctypes.Structure):
class OSXProcess (line 55) | class OSXProcess(BaseProcess):
method __init__ (line 56) | def __init__(self, pid=None, name=None, debug=True):
method close (line 69) | def close(self):
method __del__ (line 72) | def __del__(self):
method _open (line 75) | def _open(self):
method list (line 84) | def list():
method pid_from_name (line 99) | def pid_from_name(name):
method iter_region (line 105) | def iter_region(self, start_offset=None, end_offset=None, protec=None,...
method write_bytes (line 157) | def write_bytes(self, address, data):
method read_bytes (line 161) | def read_bytes(self, address, bytes = 4):
FILE: Linux/lazagne/config/lib/memorpy/SunProcess.py
class SunProcess (line 39) | class SunProcess(BaseProcess):
method __init__ (line 40) | def __init__(self, pid=None, name=None, debug=True, ptrace=None):
method close (line 55) | def close(self):
method __del__ (line 59) | def __del__(self):
method _open (line 62) | def _open(self):
method _name_args (line 72) | def _name_args(pid):
method list (line 78) | def list():
method pid_from_name (line 94) | def pid_from_name(name):
method iter_region (line 109) | def iter_region(self, start_offset=None, end_offset=None, protec=None,...
method write_bytes (line 153) | def write_bytes(self, address, data):
method read_bytes (line 162) | def read_bytes(self, address, bytes = 4):
FILE: Linux/lazagne/config/lib/memorpy/WinProcess.py
class WinProcess (line 35) | class WinProcess(BaseProcess):
method __init__ (line 37) | def __init__(self, pid=None, name=None, debug=True):
method __del__ (line 57) | def __del__(self):
method is_64bit (line 60) | def is_64bit(self):
method list (line 71) | def list():
method processes_from_name (line 99) | def processes_from_name(processName):
method name_from_process (line 109) | def name_from_process(dwProcessId):
method _open (line 117) | def _open(self, dwProcessId, debug=False):
method close (line 136) | def close(self):
method _open_from_name (line 146) | def _open_from_name(self, processName, debug=False):
method GetSystemInfo (line 157) | def GetSystemInfo(self):
method GetNativeSystemInfo (line 162) | def GetNativeSystemInfo(self):
method VirtualQueryEx (line 167) | def VirtualQueryEx(self, lpAddress):
method VirtualQueryEx64 (line 173) | def VirtualQueryEx64(self, lpAddress):
method VirtualProtectEx (line 179) | def VirtualProtectEx(self, base_address, size, protection):
method iter_region (line 185) | def iter_region(self, start_offset=None, end_offset=None, protec=None,...
method write_bytes (line 209) | def write_bytes(self, address, data):
method read_bytes (line 231) | def read_bytes(self, address, bytes = 4, use_NtWow64ReadVirtualMemory6...
method list_modules (line 268) | def list_modules(self):
method get_symbolic_name (line 284) | def get_symbolic_name(self, address):
method hasModule (line 291) | def hasModule(self, module):
method get_instruction (line 301) | def get_instruction(self, address):
FILE: Linux/lazagne/config/lib/memorpy/WinStructures.py
class SECURITY_DESCRIPTOR (line 26) | class SECURITY_DESCRIPTOR(Structure):
class MEMORY_BASIC_INFORMATION (line 36) | class MEMORY_BASIC_INFORMATION(Structure):
class MEMORY_BASIC_INFORMATION64 (line 46) | class MEMORY_BASIC_INFORMATION64(Structure):
class SYSTEM_INFO (line 59) | class SYSTEM_INFO(Structure):
class PROCESSENTRY32 (line 73) | class PROCESSENTRY32(Structure):
class MODULEENTRY32 (line 89) | class MODULEENTRY32(Structure):
class THREADENTRY32 (line 102) | class THREADENTRY32(Structure):
class TH32CS_CLASS (line 112) | class TH32CS_CLASS(object):
FILE: Linux/lazagne/config/lib/memorpy/utils.py
function re_to_unicode (line 20) | def re_to_unicode(s):
function type_unpack (line 28) | def type_unpack(type):
function hex_dump (line 62) | def hex_dump(data, addr = 0, prefix = '', ftype = 'bytes'):
FILE: Linux/lazagne/config/lib/memorpy/wintools.py
function start_winforeground_daemon (line 20) | def start_winforeground_daemon():
function window_foreground_loop (line 26) | def window_foreground_loop(timeout=20):
FILE: Linux/lazagne/config/manage_modules.py
function get_categories (line 18) | def get_categories():
function get_modules_names (line 34) | def get_modules_names():
function get_modules (line 71) | def get_modules():
FILE: Linux/lazagne/config/module_info.py
class ModuleInfo (line 22) | class ModuleInfo(object):
method __init__ (line 23) | def __init__(self, name, category, options={}, suboptions=[]):
method error (line 34) | def error(self, message):
method info (line 37) | def info(self, message):
method debug (line 40) | def debug(self, message):
method warning (line 43) | def warning(self, message):
FILE: Linux/lazagne/config/run.py
function create_module_dic (line 12) | def create_module_dic():
function run_module (line 30) | def run_module(module, subcategories):
function run_modules (line 59) | def run_modules(category_selected, subcategories):
function run_lazagne (line 73) | def run_lazagne(category_selected='all', subcategories={}):
FILE: Linux/lazagne/config/soft_import_module.py
function soft_import (line 9) | def soft_import(package_name, module_name):
class _MOCK_ImportErrorInModule (line 25) | class _MOCK_ImportErrorInModule(ModuleInfo):
method __init__ (line 27) | def __init__(self, name, exception):
method run (line 31) | def run(self):
FILE: Linux/lazagne/config/write_output.py
class Bcolors (line 17) | class Bcolors():
class StandardOutput (line 27) | class StandardOutput():
method __init__ (line 28) | def __init__(self):
method set_color (line 39) | def set_color(self, color=None):
method first_title (line 47) | def first_title(self):
method print_title (line 54) | def print_title(self, title):
method title_info (line 59) | def title_info(self, title):
method write_header (line 63) | def write_header(self):
method write_footer (line 74) | def write_footer(self):
method print_footer (line 79) | def print_footer(self, elapsed_time=None):
method print_logging (line 87) | def print_logging(self, function, prefix='[!]', message='', color=False):
method try_unicode (line 103) | def try_unicode(self, obj, encoding='utf-8'):
method print_without_error (line 112) | def print_without_error(self, message):
method do_print (line 119) | def do_print(self, message='', color=False):
method checks_write (line 132) | def checks_write(self, values, category):
method print_output (line 138) | def print_output(self, software_name, pwd_found):
function print_debug (line 210) | def print_debug(error_level, message):
function parse_json_result_to_buffer (line 238) | def parse_json_result_to_buffer(json_string, color=False):
function write_in_file (line 279) | def write_in_file(result):
FILE: Linux/lazagne/softwares/browsers/chromium_based.py
class ChromiumBased (line 20) | class ChromiumBased(ModuleInfo):
method __init__ (line 21) | def __init__(self, browser_name, path):
method get_paths (line 32) | def get_paths(self):
method remove_padding (line 44) | def remove_padding(self, data):
method _decrypt_v80 (line 59) | def _decrypt_v80(self, buff, master_key, AES_mode):
method chrome_decrypt (line 70) | def chrome_decrypt(self, encrypted_value, key, init_vector):
method get_passwords (line 77) | def get_passwords(self, path):
method run (line 137) | def run(self):
FILE: Linux/lazagne/softwares/browsers/mozilla.py
function l (line 30) | def l(n):
function convert_to_byte (line 41) | def convert_to_byte(s):
function o (line 48) | def o(c):
function long_to_bytes (line 55) | def long_to_bytes(n, blocksize=0):
class Mozilla (line 86) | class Mozilla(ModuleInfo):
method __init__ (line 88) | def __init__(self, browser_name, path, category='browsers'):
method get_firefox_profiles (line 92) | def get_firefox_profiles(self, directory):
method get_key (line 121) | def get_key(self, profile):
method get_short_le (line 208) | def get_short_le(d, a):
method get_long_be (line 212) | def get_long_be(d, a):
method print_asn1 (line 215) | def print_asn1(self, d, l, rl):
method read_bsddb (line 244) | def read_bsddb(self, name):
method decrypt_3des (line 302) | def decrypt_3des(decoded_item, master_password, global_salt):
method extract_secret_key (line 349) | def extract_secret_key(self, key_data, global_salt, master_password, e...
method decode_login_data (line 373) | def decode_login_data(data):
method get_login_data (line 378) | def get_login_data(self, profile):
method manage_masterpassword (line 415) | def manage_masterpassword(self, master_password=b'', key_data=None, ne...
method is_master_password_correct (line 433) | def is_master_password_correct(self, key_data, master_password=b'', ne...
method brute_master_password (line 472) | def brute_master_password(self, key_data, new_version=True):
method remove_padding (line 491) | def remove_padding(self, data):
method decrypt (line 506) | def decrypt(self, key, iv, ciphertext):
method run (line 513) | def run(self):
FILE: Linux/lazagne/softwares/browsers/opera.py
class Opera (line 20) | class Opera(ModuleInfo):
method __init__ (line 21) | def __init__(self):
method get_paths (line 24) | def get_paths(self):
method run (line 27) | def run(self):
method decipher_old_version (line 50) | def decipher_old_version(self, path):
method master_password_used (line 100) | def master_password_used(self, path):
method parse_results (line 118) | def parse_results(self, passwords):
FILE: Linux/lazagne/softwares/chats/pidgin.py
class Pidgin (line 12) | class Pidgin(ModuleInfo):
method __init__ (line 13) | def __init__(self):
method get_password_from_dbus (line 17) | def get_password_from_dbus(self):
method run (line 52) | def run(self):
FILE: Linux/lazagne/softwares/chats/psi.py
class PSI (line 10) | class PSI(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method get_profiles_files (line 16) | def get_profiles_files(self):
method decode_password (line 29) | def decode_password(self, password, jid):
method process_one_file (line 38) | def process_one_file(self, _path):
method run (line 58) | def run(self):
FILE: Linux/lazagne/softwares/databases/dbvis.py
class DbVisualizer (line 18) | class DbVisualizer(ModuleInfo):
method __init__ (line 19) | def __init__(self):
method get_salt (line 25) | def get_salt(self):
method get_derived_key (line 31) | def get_derived_key(self, password, salt, count):
method decrypt (line 39) | def decrypt(self, msg):
method run (line 46) | def run(self):
FILE: Linux/lazagne/softwares/databases/sqldeveloper.py
class SQLDeveloper (line 23) | class SQLDeveloper(ModuleInfo):
method __init__ (line 24) | def __init__(self):
method get_salt (line 30) | def get_salt(self):
method get_derived_key (line 36) | def get_derived_key(self, password, salt, count):
method decrypt (line 43) | def decrypt(self, msg):
method aes_cbc_decrypt (line 50) | def aes_cbc_decrypt(self, encrypted_password, decryption_key, iv):
method decrypt_v19_2 (line 57) | def decrypt_v19_2(self, encrypted, db_system_id):
method get_passphrase (line 72) | def get_passphrase(self, path):
method run (line 95) | def run(self):
FILE: Linux/lazagne/softwares/databases/squirrel.py
class Squirrel (line 12) | class Squirrel(ModuleInfo):
method __init__ (line 13) | def __init__(self):
method get_paths (line 16) | def get_paths(self):
method parse_xml (line 19) | def parse_xml(self, path):
method run (line 34) | def run(self):
FILE: Linux/lazagne/softwares/git/gitforlinux.py
class GitForLinux (line 14) | class GitForLinux(ModuleInfo):
method __init__ (line 15) | def __init__(self):
method extract_credentials (line 18) | def extract_credentials(self, location):
method run (line 41) | def run(self):
FILE: Linux/lazagne/softwares/mails/clawsmail.py
class ClawsMail (line 26) | class ClawsMail(ModuleInfo):
method __init__ (line 27) | def __init__(self):
method get_paths (line 43) | def get_paths(self):
method get_clawsrc_conf (line 46) | def get_clawsrc_conf(self, path):
method pass_decrypt_old (line 57) | def pass_decrypt_old(self, p):
method pass_decrypt_new (line 75) | def pass_decrypt_new(self, encrypted_pwd):
method parse_passwordstorerc (line 99) | def parse_passwordstorerc(self, path, section):
method parse_accountrc (line 111) | def parse_accountrc(self, path):
method run (line 158) | def run(self):
FILE: Linux/lazagne/softwares/memory/memorydump.py
class MemoryDump (line 56) | class MemoryDump(ModuleInfo):
method __init__ (line 57) | def __init__(self):
method run (line 62) | def run(self):
FILE: Linux/lazagne/softwares/memory/mimipy.py
class Mimipy (line 26) | class Mimipy(ModuleInfo):
method __init__ (line 27) | def __init__(self):
method get_shadow_hashes (line 77) | def get_shadow_hashes(self):
method memstrings (line 86) | def memstrings(self, mw, start_offset=None, end_offset=None, optimizat...
method password_list_match (line 91) | def password_list_match(self, password_list, near):
method cleanup_string (line 97) | def cleanup_string(self, s):
method test_shadow (line 108) | def test_shadow(self, name, pid, rule, optimizations='nsrx'):
method mimipy_loot_passwords (line 146) | def mimipy_loot_passwords(self, optimizations='nsrx'):
method run (line 159) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/apachedirectorystudio.py
class ApacheDirectoryStudio (line 11) | class ApacheDirectoryStudio(ModuleInfo):
method __init__ (line 13) | def __init__(self):
method extract_connections_credentials (line 18) | def extract_connections_credentials(self):
method run (line 45) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/aws.py
class Aws (line 15) | class Aws(ModuleInfo):
method __init__ (line 16) | def __init__(self):
method get_paths (line 19) | def get_paths(self):
method get_creds (line 22) | def get_creds(self, path):
method run (line 37) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/cli.py
class Cli (line 17) | class Cli(ModuleInfo):
method __init__ (line 18) | def __init__(self):
method get_files (line 21) | def get_files(self):
method get_lines (line 59) | def get_lines(self):
method suspicious (line 97) | def suspicious(self, user, line):
method run (line 129) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/docker.py
class Docker (line 10) | class Docker(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method get_paths (line 14) | def get_paths(self):
method get_creds (line 17) | def get_creds(self, path):
method run (line 30) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/env_variable.py
class Env_variable (line 13) | class Env_variable(ModuleInfo):
method __init__ (line 14) | def __init__(self):
method run (line 17) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/filezilla.py
class Filezilla (line 13) | class Filezilla(ModuleInfo):
method __init__ (line 14) | def __init__(self):
method run (line 17) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/fstab.py
class Fstab (line 9) | class Fstab(ModuleInfo):
method __init__ (line 10) | def __init__(self):
method run (line 13) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/gftp.py
class gFTP (line 13) | class gFTP(ModuleInfo):
method __init__ (line 15) | def __init__(self):
method decode_password (line 19) | def decode_password(self, encoded_pass):
method get_parameter (line 33) | def get_parameter(self, name, file_content):
method run (line 39) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/grub.py
class Grub (line 10) | class Grub(ModuleInfo):
method __init__ (line 12) | def __init__(self):
method dictionary_attack (line 15) | def dictionary_attack(self, crypt_pwd):
method run (line 50) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/keepassconfig.py
class KeePassConfig (line 15) | class KeePassConfig(ModuleInfo):
method __init__ (line 17) | def __init__(self):
method run (line 21) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/rclone.py
class Rclone (line 22) | class Rclone(ModuleInfo):
method __init__ (line 23) | def __init__(self):
method get_paths (line 28) | def get_paths(self):
method base64_urlsafedecode (line 31) | def base64_urlsafedecode(self, string):
method aes_ctr_decrypt (line 40) | def aes_ctr_decrypt(self, encrypted_password, iv):
method deobscure (line 50) | def deobscure(self, obscured):
method run (line 56) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/shadow.py
class Shadow (line 10) | class Shadow(ModuleInfo):
method __init__ (line 12) | def __init__(self):
method dictionary_attack (line 15) | def dictionary_attack(self, user, crypt_pwd):
method run (line 65) | def run(self):
FILE: Linux/lazagne/softwares/sysadmin/ssh.py
class Ssh (line 9) | class Ssh(ModuleInfo):
method __init__ (line 10) | def __init__(self):
method get_ids (line 13) | def get_ids(self):
method get_configs (line 44) | def get_configs(self):
method create_pw_object (line 47) | def create_pw_object(self, identity, host, port, user):
method get_ids_from_config (line 57) | def get_ids_from_config(self, default_user, config):
method run (line 108) | def run(self):
FILE: Linux/lazagne/softwares/wallet/kde.py
class Kde (line 14) | class Kde(ModuleInfo):
method __init__ (line 15) | def __init__(self):
method run (line 23) | def run(self):
FILE: Linux/lazagne/softwares/wallet/libsecret.py
function make_auth_external (line 17) | def make_auth_external():
class Libsecret (line 23) | class Libsecret(ModuleInfo):
method __init__ (line 24) | def __init__(self):
method run (line 27) | def run(self):
FILE: Linux/lazagne/softwares/wifi/wifi.py
class Wifi (line 17) | class Wifi(ModuleInfo):
method __init__ (line 18) | def __init__(self):
method run (line 21) | def run(self):
FILE: Linux/lazagne/softwares/wifi/wpa_supplicant.py
class Wpa_supplicant (line 16) | class Wpa_supplicant(ModuleInfo):
method __init__ (line 17) | def __init__(self):
method parse_file_network (line 20) | def parse_file_network(self, fd):
method run (line 34) | def run(self):
FILE: Mac/laZagne.py
function output (line 30) | def output(output_dir=None, txt_format=False, json_format=False, all_for...
function quiet_mode (line 55) | def quiet_mode(is_quiet_mode=False):
function verbosity (line 60) | def verbosity(verbose=0):
function manage_advanced_options (line 80) | def manage_advanced_options(user_password=None, dictionary_attack=None):
function clean_args (line 88) | def clean_args(arg):
function runLaZagne (line 100) | def runLaZagne(category_selected='all', subcategories={}, password=None,...
FILE: Mac/lazagne/config/constant.py
class constant (line 9) | class constant():
FILE: Mac/lazagne/config/crypto/pyDes.py
class _baseDes (line 108) | class _baseDes(object):
method __init__ (line 109) | def __init__(self, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method getKey (line 127) | def getKey(self):
method setKey (line 131) | def setKey(self, key):
method getMode (line 136) | def getMode(self):
method setMode (line 140) | def setMode(self, mode):
method getPadding (line 144) | def getPadding(self):
method setPadding (line 148) | def setPadding(self, pad):
method getPadMode (line 154) | def getPadMode(self):
method setPadMode (line 158) | def setPadMode(self, mode):
method getIV (line 162) | def getIV(self):
method setIV (line 166) | def setIV(self, IV):
method _padData (line 173) | def _padData(self, data, pad, padmode):
method _unpadData (line 203) | def _unpadData(self, data, pad, padmode):
method _guardAgainstUnicode (line 230) | def _guardAgainstUnicode(self, data):
class des (line 250) | class des(_baseDes):
method __init__ (line 398) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method setKey (line 412) | def setKey(self, key):
method __String_to_BitList (line 417) | def __String_to_BitList(self, data):
method __BitList_to_String (line 438) | def __BitList_to_String(self, data):
method __permutate (line 455) | def __permutate(self, table, block):
method __create_sub_keys (line 461) | def __create_sub_keys(self):
method __des_crypt (line 486) | def __des_crypt(self, block, crypt_type):
method crypt (line 565) | def crypt(self, data, crypt_type):
method encrypt (line 644) | def encrypt(self, data, pad=None, padmode=None):
method decrypt (line 663) | def decrypt(self, data, pad=None, padmode=None):
class triple_des (line 688) | class triple_des(_baseDes):
method __init__ (line 710) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method setKey (line 714) | def setKey(self, key):
method setMode (line 741) | def setMode(self, mode):
method setPadding (line 747) | def setPadding(self, pad):
method setPadMode (line 753) | def setPadMode(self, mode):
method setIV (line 759) | def setIV(self, IV):
method encrypt (line 765) | def encrypt(self, data, pad=None, padmode=None):
method decrypt (line 809) | def decrypt(self, data, pad=None, padmode=None):
FILE: Mac/lazagne/config/crypto/pyaes/aes.py
function _compact_word (line 61) | def _compact_word(word):
function _string_to_bytes (line 64) | def _string_to_bytes(text):
function _bytes_to_string (line 67) | def _bytes_to_string(binary):
function _concat_list (line 70) | def _concat_list(a, b):
function _string_to_bytes (line 81) | def _string_to_bytes(text):
function _bytes_to_string (line 87) | def _bytes_to_string(binary):
function _concat_list (line 91) | def _concat_list(a, b):
class AES (line 97) | class AES(object):
method __init__ (line 131) | def __init__(self, key):
method encrypt (line 203) | def encrypt(self, plaintext):
method decrypt (line 237) | def decrypt(self, ciphertext):
class Counter (line 272) | class Counter(object):
method __init__ (line 278) | def __init__(self, initial_value = 1):
method increment (line 285) | def increment(self):
class AESBlockModeOfOperation (line 301) | class AESBlockModeOfOperation(object):
method __init__ (line 303) | def __init__(self, key):
method decrypt (line 306) | def decrypt(self, ciphertext):
method encrypt (line 309) | def encrypt(self, plaintext):
class AESStreamModeOfOperation (line 313) | class AESStreamModeOfOperation(AESBlockModeOfOperation):
class AESSegmentModeOfOperation (line 316) | class AESSegmentModeOfOperation(AESStreamModeOfOperation):
class AESModeOfOperationECB (line 323) | class AESModeOfOperationECB(AESBlockModeOfOperation):
method encrypt (line 340) | def encrypt(self, plaintext):
method decrypt (line 347) | def decrypt(self, ciphertext):
class AESModeOfOperationCBC (line 356) | class AESModeOfOperationCBC(AESBlockModeOfOperation):
method __init__ (line 377) | def __init__(self, key, iv = None):
method encrypt (line 387) | def encrypt(self, plaintext):
method decrypt (line 397) | def decrypt(self, ciphertext):
class AESModeOfOperationCFB (line 409) | class AESModeOfOperationCFB(AESSegmentModeOfOperation):
method __init__ (line 422) | def __init__(self, key, iv, segment_size = 1):
method encrypt (line 438) | def encrypt(self, plaintext):
method decrypt (line 458) | def decrypt(self, ciphertext):
class AESModeOfOperationOFB (line 480) | class AESModeOfOperationOFB(AESStreamModeOfOperation):
method __init__ (line 496) | def __init__(self, key, iv = None):
method encrypt (line 508) | def encrypt(self, plaintext):
method decrypt (line 521) | def decrypt(self, ciphertext):
class AESModeOfOperationCTR (line 527) | class AESModeOfOperationCTR(AESStreamModeOfOperation):
method __init__ (line 556) | def __init__(self, key, counter = None):
method encrypt (line 565) | def encrypt(self, plaintext):
method decrypt (line 577) | def decrypt(self, crypttext):
FILE: Mac/lazagne/config/crypto/pyaes/blockfeeder.py
function _block_can_consume (line 54) | def _block_can_consume(self, size):
function _block_final_encrypt (line 59) | def _block_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _block_final_decrypt (line 75) | def _block_final_decrypt(self, data, padding = PADDING_DEFAULT):
function _segment_can_consume (line 94) | def _segment_can_consume(self, size):
function _segment_final_encrypt (line 98) | def _segment_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _segment_final_decrypt (line 107) | def _segment_final_decrypt(self, data, padding = PADDING_DEFAULT):
function _stream_can_consume (line 123) | def _stream_can_consume(self, size):
function _stream_final_encrypt (line 126) | def _stream_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _stream_final_decrypt (line 132) | def _stream_final_decrypt(self, data, padding = PADDING_DEFAULT):
class BlockFeeder (line 144) | class BlockFeeder(object):
method __init__ (line 149) | def __init__(self, mode, feed, final, padding = PADDING_DEFAULT):
method feed (line 156) | def feed(self, data = None):
class Encrypter (line 186) | class Encrypter(BlockFeeder):
method __init__ (line 189) | def __init__(self, mode, padding = PADDING_DEFAULT):
class Decrypter (line 193) | class Decrypter(BlockFeeder):
method __init__ (line 196) | def __init__(self, mode, padding = PADDING_DEFAULT):
function _feed_stream (line 203) | def _feed_stream(feeder, in_stream, out_stream, block_size = BLOCK_SIZE):
function encrypt_stream (line 216) | def encrypt_stream(mode, in_stream, out_stream, block_size = BLOCK_SIZE,...
function decrypt_stream (line 223) | def decrypt_stream(mode, in_stream, out_stream, block_size = BLOCK_SIZE,...
FILE: Mac/lazagne/config/crypto/pyaes/util.py
function to_bufferable (line 29) | def to_bufferable(binary):
function _get_byte (line 32) | def _get_byte(c):
function to_bufferable (line 39) | def to_bufferable(binary):
function _get_byte (line 44) | def _get_byte(c):
function append_PKCS7_padding (line 47) | def append_PKCS7_padding(data):
function strip_PKCS7_padding (line 51) | def strip_PKCS7_padding(data):
FILE: Mac/lazagne/config/dico.py
function get_dic (line 1) | def get_dic():
FILE: Mac/lazagne/config/manage_modules.py
function get_categories (line 7) | def get_categories():
function get_modules_names (line 17) | def get_modules_names():
function get_modules (line 30) | def get_modules():
FILE: Mac/lazagne/config/module_info.py
class ModuleInfo (line 20) | class ModuleInfo(object):
method __init__ (line 21) | def __init__(self, name, category, sub_options=[]):
method error (line 32) | def error(self, message):
method info (line 35) | def info(self, message):
method debug (line 38) | def debug(self, message):
method warning (line 41) | def warning(self, message):
FILE: Mac/lazagne/config/run.py
function create_module_dic (line 13) | def create_module_dic():
function get_safe_storage_key (line 31) | def get_safe_storage_key(key):
function run_cmd (line 42) | def run_cmd(cmd):
function run_module (line 51) | def run_module(module, subcategories):
function run_modules (line 80) | def run_modules(category_selected, subcategories):
function run_lazagne (line 91) | def run_lazagne(category_selected='all', subcategories={}, password=None...
FILE: Mac/lazagne/config/soft_import_module.py
function soft_import (line 9) | def soft_import(package_name, module_name):
class _MOCK_ImportErrorInModule (line 25) | class _MOCK_ImportErrorInModule(ModuleInfo):
method __init__ (line 27) | def __init__(self, name, exception):
method run (line 31) | def run(self):
FILE: Mac/lazagne/config/write_output.py
class Bcolors (line 14) | class Bcolors(object):
class StandardOutput (line 24) | class StandardOutput(object):
method __init__ (line 25) | def __init__(self):
method set_color (line 36) | def set_color(self, color=None):
method first_title (line 44) | def first_title(self):
method print_title (line 51) | def print_title(self, title):
method title_info (line 56) | def title_info(self, title):
method write_header (line 60) | def write_header(self):
method write_footer (line 71) | def write_footer(self):
method print_footer (line 76) | def print_footer(self, elapsed_time=None):
method print_logging (line 84) | def print_logging(self, function, prefix='[!]', message='', color=False):
method try_unicode (line 100) | def try_unicode(self, obj, encoding='utf-8'):
method print_without_error (line 109) | def print_without_error(self, message):
method do_print (line 116) | def do_print(self, message='', color=None):
method checks_write (line 129) | def checks_write(self, values, category):
method print_output (line 135) | def print_output(self, software_name, pwd_found):
function print_debug (line 207) | def print_debug(error_level, message):
function parse_json_result_to_buffer (line 235) | def parse_json_result_to_buffer(json_string, color=False):
function write_in_file (line 279) | def write_in_file(result):
FILE: Mac/lazagne/softwares/browsers/chrome.py
function pbkdf2_bin (line 23) | def pbkdf2_bin(hash_fxn, password, salt, iterations, key_len=16):
class Chrome (line 52) | class Chrome(ModuleInfo):
method __init__ (line 53) | def __init__(self, safe_storage_key=None):
method get_cc (line 61) | def get_cc(self, cc_num):
method chrome_decrypt (line 73) | def chrome_decrypt(self, encrypted, iv, key):
method chrome_process (line 88) | def chrome_process(self, safe_storage_key, chrome_data):
method run (line 126) | def run(self):
FILE: Mac/lazagne/softwares/browsers/mozilla.py
function l (line 32) | def l(n):
function convert_to_byte (line 43) | def convert_to_byte(s):
function o (line 50) | def o(c):
function long_to_bytes (line 57) | def long_to_bytes(n, blocksize=0):
class Mozilla (line 88) | class Mozilla(ModuleInfo):
method __init__ (line 90) | def __init__(self, browser_name, path):
method get_firefox_profiles (line 94) | def get_firefox_profiles(self, directory):
method get_key (line 123) | def get_key(self, profile):
method get_short_le (line 210) | def get_short_le(d, a):
method get_long_be (line 214) | def get_long_be(d, a):
method print_asn1 (line 217) | def print_asn1(self, d, l, rl):
method read_bsddb (line 246) | def read_bsddb(self, name):
method decrypt_3des (line 304) | def decrypt_3des(decoded_item, master_password, global_salt):
method extract_secret_key (line 351) | def extract_secret_key(self, key_data, global_salt, master_password, e...
method decode_login_data (line 375) | def decode_login_data(data):
method get_login_data (line 380) | def get_login_data(self, profile):
method manage_masterpassword (line 417) | def manage_masterpassword(self, master_password=b'', key_data=None, ne...
method is_master_password_correct (line 435) | def is_master_password_correct(self, key_data, master_password=b'', ne...
method brute_master_password (line 474) | def brute_master_password(self, key_data, new_version=True):
method remove_padding (line 494) | def remove_padding(self, data):
method decrypt (line 509) | def decrypt(self, key, iv, ciphertext):
method run (line 516) | def run(self):
FILE: Mac/lazagne/softwares/mails/thunderbird.py
class Thunderbird (line 5) | class Thunderbird(Mozilla):
method __init__ (line 7) | def __init__(self):
FILE: Mac/lazagne/softwares/system/chainbreaker.py
class ChainBreaker (line 18) | class ChainBreaker(ModuleInfo):
method __init__ (line 19) | def __init__(self):
method list_users (line 22) | def list_users(self):
method list_keychains (line 32) | def list_keychains(self, keychains_path):
method run (line 40) | def run(self):
FILE: Mac/lazagne/softwares/system/chainbreaker_module/chainbreaker.py
class _APPL_DB_HEADER (line 42) | class _APPL_DB_HEADER(BigEndianStructure):
class _APPL_DB_SCHEMA (line 52) | class _APPL_DB_SCHEMA(BigEndianStructure):
class _KEY_BLOB_REC_HEADER (line 59) | class _KEY_BLOB_REC_HEADER(BigEndianStructure):
class _GENERIC_PW_HEADER (line 67) | class _GENERIC_PW_HEADER(BigEndianStructure):
class _APPLE_SHARE_HEADER (line 94) | class _APPLE_SHARE_HEADER(BigEndianStructure):
class _INTERNET_PW_HEADER (line 125) | class _INTERNET_PW_HEADER(BigEndianStructure):
class _X509_CERT_HEADER (line 156) | class _X509_CERT_HEADER(BigEndianStructure):
class _SECKEY_HEADER (line 178) | class _SECKEY_HEADER(BigEndianStructure):
class _TABLE_HEADER (line 216) | class _TABLE_HEADER(BigEndianStructure):
class _SCHEMA_INFO_RECORD (line 228) | class _SCHEMA_INFO_RECORD(BigEndianStructure):
class _COMMON_BLOB (line 243) | class _COMMON_BLOB(BigEndianStructure):
class _KEY_BLOB (line 251) | class _KEY_BLOB(BigEndianStructure):
class _DB_PARAMETERS (line 260) | class _DB_PARAMETERS(BigEndianStructure):
class _DB_BLOB (line 267) | class _DB_BLOB(BigEndianStructure):
class _SSGP (line 281) | class _SSGP(BigEndianStructure):
function _memcpy (line 289) | def _memcpy(buf, fmt):
class KeyChain (line 293) | class KeyChain():
method __init__ (line 294) | def __init__(self, filepath):
method open (line 298) | def open(self):
method checkValidKeychain (line 309) | def checkValidKeychain(self):
method getHeader (line 315) | def getHeader(self):
method getSchemaInfo (line 320) | def getSchemaInfo(self, offset):
method getTable (line 331) | def getTable(self, offset):
method getTablenametoList (line 356) | def getTablenametoList(self, recordList, tableList):
method getKeyblobRecord (line 364) | def getKeyblobRecord(self, base_addr, offset):
method getGenericPWRecord (line 388) | def getGenericPWRecord(self, base_addr, offset):
method getInternetPWRecord (line 418) | def getInternetPWRecord(self, base_addr, offset):
method getx509Record (line 450) | def getx509Record(self, base_addr, offset):
method getKeyRecord (line 474) | def getKeyRecord(self, base_addr, offset): ## PUBLIC and PRIVATE KEY
method getEncryptedDatainBlob (line 499) | def getEncryptedDatainBlob(self, BlobBuf):
method getKeychainTime (line 508) | def getKeychainTime(self, BASE_ADDR, pCol):
method getInt (line 515) | def getInt(self, BASE_ADDR, pCol):
method getFourCharCode (line 521) | def getFourCharCode(self, BASE_ADDR, pCol):
method getLV (line 527) | def getLV(self, BASE_ADDR, pCol):
method getAppleshareRecord (line 545) | def getAppleshareRecord(self, base_addr, offset):
method SSGPDecryption (line 580) | def SSGPDecryption(self, ssgp, dbkey):
method KeyblobDecryption (line 589) | def KeyblobDecryption(self, encryptedblob, iv, dbkey):
method PrivateKeyDecryption (line 616) | def PrivateKeyDecryption(self, encryptedblob, iv, dbkey):
method generateMasterKey (line 638) | def generateMasterKey(self, pw, symmetrickey_offset):
method findWrappingKey (line 647) | def findWrappingKey(self, master, symmetrickey_offset):
function kcdecrypt (line 669) | def kcdecrypt(key, iv, data):
function dump_creds (line 699) | def dump_creds(keychain_file, password=None, key=None):
FILE: Mac/lazagne/softwares/system/chainbreaker_module/pbkdf2.py
function pbkdf2 (line 18) | def pbkdf2(password, salt, itercount, keylen, hashfn=sha1):
function xorstr (line 33) | def xorstr(a, b):
function prf (line 44) | def prf(h, data):
function pbkdf2_F (line 52) | def pbkdf2_F(h, salt, itercount, blocknum):
FILE: Mac/lazagne/softwares/system/hashdump.py
class HashDump (line 26) | class HashDump(ModuleInfo):
method __init__ (line 27) | def __init__(self):
method root_access (line 35) | def root_access(self):
method check_version (line 41) | def check_version(self):
method run_cmd (line 53) | def run_cmd(self, cmd):
method list_users (line 61) | def list_users(self):
method get_hash_using_guid (line 72) | def get_hash_using_guid(self, guid):
method get_user_hash_using_niutil (line 85) | def get_user_hash_using_niutil(self, username):
method get_user_hash_using_dscl (line 101) | def get_user_hash_using_dscl(self, username):
method get_user_hash_from_plist (line 117) | def get_user_hash_from_plist(self, username):
method dictionary_attack (line 152) | def dictionary_attack(self, username, dic, pbkdf2=True):
method dictionary_attack_pbkdf2 (line 178) | def dictionary_attack_pbkdf2(self, password, salt, iterations):
method run (line 185) | def run(self):
FILE: Mac/lazagne/softwares/system/system.py
class System (line 8) | class System(ModuleInfo):
method __init__ (line 9) | def __init__(self):
method run (line 12) | def run(self):
FILE: Windows/laZagne.py
function output (line 27) | def output(output_dir=None, txt_format=False, json_format=False, all_for...
function quiet_mode (line 52) | def quiet_mode(is_quiet_mode=False):
function verbosity (line 57) | def verbosity(verbose=0):
function manage_advanced_options (line 77) | def manage_advanced_options(user_password=None):
function runLaZagne (line 82) | def runLaZagne(category_selected='all', subcategories={}, password=None):
function clean_args (line 91) | def clean_args(arg):
FILE: Windows/lazagne/config/DPAPI/blob.py
class DPAPIBlob (line 23) | class DPAPIBlob(DataStruct):
method __init__ (line 26) | def __init__(self, raw=None):
method parse (line 51) | def parse(self, data):
method decrypt (line 82) | def decrypt(self, masterkey, entropy=None, strongPassword=None):
method decrypt_encrypted_blob (line 119) | def decrypt_encrypted_blob(self, mkp, entropy_hex=False):
FILE: Windows/lazagne/config/DPAPI/credfile.py
class CredentialDecryptedHeader (line 14) | class CredentialDecryptedHeader(DataStruct):
method __init__ (line 19) | def __init__(self, raw=None):
method parse (line 32) | def parse(self, data):
class CredentialDecrypted (line 45) | class CredentialDecrypted(DataStruct):
method __init__ (line 49) | def __init__(self, raw=None):
method parse (line 60) | def parse(self, data):
class CredFile (line 73) | class CredFile(DataStruct):
method __init__ (line 77) | def __init__(self, raw=None):
method parse (line 84) | def parse(self, data):
method decrypt (line 92) | def decrypt(self, mkp, credfile):
FILE: Windows/lazagne/config/DPAPI/credhist.py
class RPC_SID (line 17) | class RPC_SID(DataStruct):
method __init__ (line 21) | def __init__(self, raw=None):
method parse (line 27) | def parse(self, data):
method __str__ (line 33) | def __str__(self):
class CredhistEntry (line 39) | class CredhistEntry(DataStruct):
method __init__ (line 41) | def __init__(self, raw=None):
method parse (line 58) | def parse(self, data):
method decrypt_with_hash (line 78) | def decrypt_with_hash(self, pwdhash):
method decrypt_with_key (line 86) | def decrypt_with_key(self, enckey):
class CredHistFile (line 98) | class CredHistFile(DataStruct):
method __init__ (line 100) | def __init__(self, raw=None):
method parse (line 108) | def parse(self, data):
method addEntry (line 118) | def addEntry(self, blob):
method decrypt_with_hash (line 126) | def decrypt_with_hash(self, pwdhash):
method decrypt_with_password (line 137) | def decrypt_with_password(self, password):
FILE: Windows/lazagne/config/DPAPI/crypto.py
class CryptoAlgo (line 40) | class CryptoAlgo(object):
class Algo (line 45) | class Algo(object):
method __init__ (line 46) | def __init__(self, data):
method __getattr__ (line 49) | def __getattr__(self, attr):
method add_algo (line 57) | def add_algo(cls, algnum, **kargs):
method get_algo (line 64) | def get_algo(cls, algnum):
method __init__ (line 67) | def __init__(self, i):
method do_fixup_key (line 78) | def do_fixup_key(self, key):
method __repr__ (line 84) | def __repr__(self):
function des_set_odd_parity (line 88) | def des_set_odd_parity(key):
function CryptSessionKeyXP (line 129) | def CryptSessionKeyXP(masterkey, nonce, hashAlgo, entropy=None, strongPa...
function CryptSessionKeyWin7 (line 168) | def CryptSessionKeyWin7(masterkey, nonce, hashAlgo, entropy=None, strong...
function CryptDeriveKey (line 198) | def CryptDeriveKey(h, cipherAlgo, hashAlgo):
function decrypt_lsa_key_nt5 (line 215) | def decrypt_lsa_key_nt5(lsakey, syskey):
function decrypt_lsa_key_nt6 (line 228) | def decrypt_lsa_key_nt6(lsakey, syskey):
function SystemFunction005 (line 255) | def SystemFunction005(secret, key):
function decrypt_lsa_secret (line 286) | def decrypt_lsa_secret(secret, lsa_keys):
function pbkdf2 (line 306) | def pbkdf2(passphrase, salt, keylen, iterations, digest='sha1'):
function derivePwdHash (line 330) | def derivePwdHash(pwdhash, sid, digest='sha1'):
function dataDecrypt (line 337) | def dataDecrypt(cipherAlgo, hashAlgo, raw, encKey, iv, rounds):
function DPAPIHmac (line 356) | def DPAPIHmac(hashAlgo, pwdhash, hmacSalt, value):
FILE: Windows/lazagne/config/DPAPI/eater.py
class Eater (line 23) | class Eater(object):
method __init__ (line 26) | def __init__(self, raw, offset=0, end=None, endianness="<"):
method prepare_fmt (line 34) | def prepare_fmt(self, fmt):
method read (line 47) | def read(self, fmt):
method eat (line 59) | def eat(self, fmt):
method eat_string (line 72) | def eat_string(self, length):
method eat_length_and_string (line 76) | def eat_length_and_string(self, fmt):
method pop (line 84) | def pop(self, fmt):
method pop_string (line 93) | def pop_string(self, length):
method pop_length_and_string (line 97) | def pop_length_and_string(self, fmt):
method remain (line 105) | def remain(self):
method eat_sub (line 109) | def eat_sub(self, length):
method __nonzero__ (line 115) | def __nonzero__(self):
class DataStruct (line 119) | class DataStruct(object):
method __init__ (line 122) | def __init__(self, raw=None):
method parse (line 126) | def parse(self, eater_obj):
FILE: Windows/lazagne/config/DPAPI/masterkey.py
class MasterKey (line 26) | class MasterKey(DataStruct):
method __init__ (line 31) | def __init__(self, raw=None):
method parse (line 46) | def parse(self, data):
method decrypt_with_hash (line 54) | def decrypt_with_hash(self, sid, pwdhash):
method decrypt_with_password (line 61) | def decrypt_with_password(self, sid, pwd):
method decrypt_with_key (line 85) | def decrypt_with_key(self, pwdhash):
class CredHist (line 106) | class CredHist(DataStruct):
method __init__ (line 109) | def __init__(self, raw=None):
method parse (line 114) | def parse(self, data):
class DomainKey (line 119) | class DomainKey(DataStruct):
method __init__ (line 127) | def __init__(self, raw=None):
method parse (line 136) | def parse(self, data):
class MasterKeyFile (line 145) | class MasterKeyFile(DataStruct):
method __init__ (line 150) | def __init__(self, raw=None):
method parse (line 162) | def parse(self, data):
method get_key (line 186) | def get_key(self):
method jhash (line 197) | def jhash(self, sid=None, context='local'):
class MasterKeyPool (line 235) | class MasterKeyPool(object):
method __init__ (line 241) | def __init__(self):
method add_master_key (line 256) | def add_master_key(self, mkey):
method load_directory (line 267) | def load_directory(self, directory):
method get_master_keys (line 283) | def get_master_keys(self, guid):
method get_password (line 289) | def get_password(self, guid):
method add_credhist_file (line 295) | def add_credhist_file(self, sid, credfile):
method get_preferred_guid (line 306) | def get_preferred_guid(self):
method get_cleartext_password (line 331) | def get_cleartext_password(self, guid=None):
method get_dpapi_hash (line 342) | def get_dpapi_hash(self, sid, context='local'):
method add_system_credential (line 355) | def add_system_credential(self, blob):
method try_credential (line 362) | def try_credential(self, sid, password=None):
method try_credential_hash (line 415) | def try_credential_hash(self, sid, pwdhash=None):
method try_system_credential (line 451) | def try_system_credential(self):
FILE: Windows/lazagne/config/DPAPI/system.py
class CredSystem (line 13) | class CredSystem(DataStruct):
method __init__ (line 22) | def __init__(self, raw=None):
method parse (line 28) | def parse(self, data):
FILE: Windows/lazagne/config/DPAPI/vault.py
class VaultPolicyKey (line 27) | class VaultPolicyKey(DataStruct):
method __init__ (line 31) | def __init__(self, raw=None):
method parse (line 41) | def parse(self, data):
class VaultPolicyKeys (line 54) | class VaultPolicyKeys(DataStruct):
method __init__ (line 60) | def __init__(self, raw=None):
method parse (line 67) | def parse(self, data):
class VaultPolicy (line 79) | class VaultPolicy(DataStruct):
method __init__ (line 85) | def __init__(self, raw=None):
method parse (line 101) | def parse(self, data):
class VaultAttribute (line 123) | class VaultAttribute(DataStruct):
method __init__ (line 127) | def __init__(self, raw=None):
method parse (line 143) | def parse(self, data):
class VaultAttributeMapEntry (line 163) | class VaultAttributeMapEntry(DataStruct):
method __init__ (line 167) | def __init__(self, raw=None):
method parse (line 175) | def parse(self, data):
class VaultVcrd (line 181) | class VaultVcrd(DataStruct):
method __init__ (line 185) | def __init__(self, raw=None):
method parse (line 197) | def parse(self, data):
class VaultVsch (line 217) | class VaultVsch(DataStruct):
method __init__ (line 222) | def __init__(self, raw=None):
method parse (line 230) | def parse(self, data):
class VaultAttributeItem (line 238) | class VaultAttributeItem(object):
method __init__ (line 239) | def __init__(self, id_, item):
class VaultSchemaGeneric (line 244) | class VaultSchemaGeneric(DataStruct):
method __init__ (line 248) | def __init__(self, raw=None):
method parse (line 255) | def parse(self, data):
class VaultSchemaPin (line 276) | class VaultSchemaPin(DataStruct):
method __init__ (line 280) | def __init__(self, raw=None):
method parse (line 295) | def parse(self, data):
class VaultSchemaWebPassword (line 311) | class VaultSchemaWebPassword(DataStruct):
method __init__ (line 315) | def __init__(self, raw=None):
method parse (line 327) | def parse(self, data):
class VaultSchemaActiveSync (line 339) | class VaultSchemaActiveSync(DataStruct):
method __init__ (line 343) | def __init__(self, raw=None):
method parse (line 355) | def parse(self, data):
class Vault (line 380) | class Vault(object):
method __init__ (line 384) | def __init__(self, vaults_dir):
method decrypt_vault_attribute (line 387) | def decrypt_vault_attribute(self, vault_attr, key_aes128, key_aes256):
method get_vault_schema (line 405) | def get_vault_schema(self, guid, base_dir, default_schema):
method decrypt (line 422) | def decrypt(self, mkp):
FILE: Windows/lazagne/config/change_privileges.py
function get_token_info (line 13) | def get_token_info(hToken):
function enable_privilege (line 36) | def enable_privilege(privilegeStr, hToken=None):
function get_debug_privilege (line 72) | def get_debug_privilege():
function list_sids (line 79) | def list_sids():
function get_sid_token (line 111) | def get_sid_token(token_sid):
function impersonate_sid (line 158) | def impersonate_sid(sid, close=True):
function impersonate_sid_long_handle (line 175) | def impersonate_sid_long_handle(*args, **kwargs):
function impersonate_token (line 191) | def impersonate_token(hToken):
function rev2self (line 209) | def rev2self():
FILE: Windows/lazagne/config/constant.py
class constant (line 12) | class constant():
FILE: Windows/lazagne/config/crypto/md4.py
class MD4 (line 19) | class MD4:
method __init__ (line 28) | def __init__(self, msg=None):
method __repr__ (line 44) | def __repr__(self):
method __str__ (line 49) | def __str__(self):
method __eq__ (line 52) | def __eq__(self, other):
method bytes (line 55) | def bytes(self):
method hexbytes (line 59) | def hexbytes(self):
method hexdigest (line 63) | def hexdigest(self):
method _process (line 67) | def _process(self, chunks):
method F (line 99) | def F(x, y, z):
method G (line 103) | def G(x, y, z):
method H (line 107) | def H(x, y, z):
method lrot (line 111) | def lrot(value, n):
FILE: Windows/lazagne/config/crypto/pyDes.py
class _baseDes (line 107) | class _baseDes(object):
method __init__ (line 108) | def __init__(self, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method getKey (line 126) | def getKey(self):
method setKey (line 130) | def setKey(self, key):
method getMode (line 135) | def getMode(self):
method setMode (line 139) | def setMode(self, mode):
method getPadding (line 143) | def getPadding(self):
method setPadding (line 147) | def setPadding(self, pad):
method getPadMode (line 153) | def getPadMode(self):
method setPadMode (line 157) | def setPadMode(self, mode):
method getIV (line 161) | def getIV(self):
method setIV (line 165) | def setIV(self, IV):
method _padData (line 172) | def _padData(self, data, pad, padmode):
method _unpadData (line 201) | def _unpadData(self, data, pad, padmode):
method _guardAgainstUnicode (line 228) | def _guardAgainstUnicode(self, data):
class des (line 247) | class des(_baseDes):
method __init__ (line 397) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method setKey (line 411) | def setKey(self, key):
method __String_to_BitList (line 416) | def __String_to_BitList(self, data):
method __BitList_to_String (line 437) | def __BitList_to_String(self, data):
method __permutate (line 454) | def __permutate(self, table, block):
method __create_sub_keys (line 460) | def __create_sub_keys(self):
method __des_crypt (line 485) | def __des_crypt(self, block, crypt_type):
method crypt (line 564) | def crypt(self, data, crypt_type):
method encrypt (line 642) | def encrypt(self, data, pad=None, padmode=None):
method decrypt (line 661) | def decrypt(self, data, pad=None, padmode=None):
class triple_des (line 687) | class triple_des(_baseDes):
method __init__ (line 708) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
method setKey (line 712) | def setKey(self, key):
method setMode (line 739) | def setMode(self, mode):
method setPadding (line 745) | def setPadding(self, pad):
method setPadMode (line 751) | def setPadMode(self, mode):
method setIV (line 757) | def setIV(self, IV):
method encrypt (line 763) | def encrypt(self, data, pad=None, padmode=None):
method decrypt (line 807) | def decrypt(self, data, pad=None, padmode=None):
FILE: Windows/lazagne/config/crypto/pyaes/aes.py
function _compact_word (line 61) | def _compact_word(word):
function _string_to_bytes (line 64) | def _string_to_bytes(text):
function _bytes_to_string (line 67) | def _bytes_to_string(binary):
function _concat_list (line 70) | def _concat_list(a, b):
function _string_to_bytes (line 81) | def _string_to_bytes(text):
function _bytes_to_string (line 87) | def _bytes_to_string(binary):
function _concat_list (line 91) | def _concat_list(a, b):
class AES (line 97) | class AES(object):
method __init__ (line 131) | def __init__(self, key):
method encrypt (line 203) | def encrypt(self, plaintext):
method decrypt (line 237) | def decrypt(self, ciphertext):
class Counter (line 272) | class Counter(object):
method __init__ (line 278) | def __init__(self, initial_value = 1):
method increment (line 285) | def increment(self):
class AESBlockModeOfOperation (line 301) | class AESBlockModeOfOperation(object):
method __init__ (line 303) | def __init__(self, key):
method decrypt (line 306) | def decrypt(self, ciphertext):
method encrypt (line 309) | def encrypt(self, plaintext):
class AESStreamModeOfOperation (line 313) | class AESStreamModeOfOperation(AESBlockModeOfOperation):
class AESSegmentModeOfOperation (line 316) | class AESSegmentModeOfOperation(AESStreamModeOfOperation):
class AESModeOfOperationECB (line 323) | class AESModeOfOperationECB(AESBlockModeOfOperation):
method encrypt (line 340) | def encrypt(self, plaintext):
method decrypt (line 347) | def decrypt(self, ciphertext):
class AESModeOfOperationCBC (line 356) | class AESModeOfOperationCBC(AESBlockModeOfOperation):
method __init__ (line 377) | def __init__(self, key, iv = None):
method encrypt (line 387) | def encrypt(self, plaintext):
method decrypt (line 397) | def decrypt(self, ciphertext):
class AESModeOfOperationCFB (line 409) | class AESModeOfOperationCFB(AESSegmentModeOfOperation):
method __init__ (line 422) | def __init__(self, key, iv, segment_size = 1):
method encrypt (line 438) | def encrypt(self, plaintext):
method decrypt (line 458) | def decrypt(self, ciphertext):
class AESModeOfOperationOFB (line 480) | class AESModeOfOperationOFB(AESStreamModeOfOperation):
method __init__ (line 496) | def __init__(self, key, iv = None):
method encrypt (line 508) | def encrypt(self, plaintext):
method decrypt (line 521) | def decrypt(self, ciphertext):
class AESModeOfOperationCTR (line 527) | class AESModeOfOperationCTR(AESStreamModeOfOperation):
method __init__ (line 556) | def __init__(self, key, counter = None):
method encrypt (line 565) | def encrypt(self, plaintext):
method decrypt (line 577) | def decrypt(self, crypttext):
FILE: Windows/lazagne/config/crypto/pyaes/blockfeeder.py
function _block_can_consume (line 54) | def _block_can_consume(self, size):
function _block_final_encrypt (line 59) | def _block_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _block_final_decrypt (line 75) | def _block_final_decrypt(self, data, padding = PADDING_DEFAULT):
function _segment_can_consume (line 94) | def _segment_can_consume(self, size):
function _segment_final_encrypt (line 98) | def _segment_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _segment_final_decrypt (line 107) | def _segment_final_decrypt(self, data, padding = PADDING_DEFAULT):
function _stream_can_consume (line 123) | def _stream_can_consume(self, size):
function _stream_final_encrypt (line 126) | def _stream_final_encrypt(self, data, padding = PADDING_DEFAULT):
function _stream_final_decrypt (line 132) | def _stream_final_decrypt(self, data, padding = PADDING_DEFAULT):
class BlockFeeder (line 144) | class BlockFeeder(object):
method __init__ (line 149) | def __init__(self, mode, feed, final, padding = PADDING_DEFAULT):
method feed (line 156) | def feed(self, data = None):
class Encrypter (line 186) | class Encrypter(BlockFeeder):
method __init__ (line 189) | def __init__(self, mode, padding = PADDING_DEFAULT):
class Decrypter (line 193) | class Decrypter(BlockFeeder):
method __init__ (line 196) | def __init__(self, mode, padding = PADDING_DEFAULT):
function _feed_stream (line 203) | def _feed_stream(feeder, in_stream, out_stream, block_size = BLOCK_SIZE):
function encrypt_stream (line 216) | def encrypt_stream(mode, in_stream, out_stream, block_size = BLOCK_SIZE,...
function decrypt_stream (line 223) | def decrypt_stream(mode, in_stream, out_stream, block_size = BLOCK_SIZE,...
FILE: Windows/lazagne/config/crypto/pyaes/util.py
function to_bufferable (line 29) | def to_bufferable(binary):
function _get_byte (line 32) | def _get_byte(c):
function to_bufferable (line 39) | def to_bufferable(binary):
function _get_byte (line 44) | def _get_byte(c):
function append_PKCS7_padding (line 47) | def append_PKCS7_padding(data):
function strip_PKCS7_padding (line 51) | def strip_PKCS7_padding(data):
FILE: Windows/lazagne/config/crypto/rc4.py
class RC4 (line 7) | class RC4(object):
method __init__ (line 9) | def __init__(self, key):
method text_to_bytes (line 12) | def text_to_bytes(self, text):
method bytes_to_text (line 22) | def bytes_to_text(self, byte_list):
method encrypt (line 28) | def encrypt(self, data):
method crypt (line 33) | def crypt(self, plain_bytes, key_bytes):
FILE: Windows/lazagne/config/dico.py
function get_dic (line 1) | def get_dic():
FILE: Windows/lazagne/config/dpapi_structure.py
function are_masterkeys_retrieved (line 15) | def are_masterkeys_retrieved():
function manage_response (line 39) | def manage_response(ok, msg):
class UserDpapi (line 47) | class UserDpapi(object):
method __init__ (line 52) | def __init__(self, password=None, pwdhash=None):
method check_credentials (line 89) | def check_credentials(self, passwords):
method decrypt_blob (line 99) | def decrypt_blob(self, dpapi_blob):
method decrypt_cred (line 108) | def decrypt_cred(self, credfile):
method decrypt_vault (line 118) | def decrypt_vault(self, vaults_dir):
method decrypt_encrypted_blob (line 127) | def decrypt_encrypted_blob(self, ciphered, entropy_hex=False):
method get_dpapi_hash (line 136) | def get_dpapi_hash(self, context='local'):
method get_cleartext_password (line 143) | def get_cleartext_password(self):
class SystemDpapi (line 152) | class SystemDpapi(object):
method __init__ (line 158) | def __init__(self):
method decrypt_wifi_blob (line 179) | def decrypt_wifi_blob(self, key_material):
FILE: Windows/lazagne/config/execute_cmd.py
function powershell_execute (line 20) | def powershell_execute(script, func):
function save_hives (line 67) | def save_hives():
function delete_hives (line 88) | def delete_hives():
FILE: Windows/lazagne/config/lib/memorpy/Address.py
class AddressException (line 19) | class AddressException(Exception):
class Address (line 23) | class Address(object):
method __init__ (line 26) | def __init__(self, value, process, default_type = 'uint'):
method read (line 32) | def read(self, type = None, maxlen = None, errors='raise'):
method write (line 48) | def write(self, data, type = None):
method symbol (line 53) | def symbol(self):
method get_instruction (line 56) | def get_instruction(self):
method dump (line 59) | def dump(self, ftype = 'bytes', size = 512, before = 32):
method __nonzero__ (line 63) | def __nonzero__(self):
method __add__ (line 66) | def __add__(self, other):
method __sub__ (line 69) | def __sub__(self, other):
method __repr__ (line 72) | def __repr__(self):
method __str__ (line 77) | def __str__(self):
method __int__ (line 82) | def __int__(self):
method __hex__ (line 85) | def __hex__(self):
method __get__ (line 88) | def __get__(self, instance, owner):
method __set__ (line 91) | def __set__(self, instance, value):
method __lt__ (line 94) | def __lt__(self, other):
method __le__ (line 97) | def __le__(self, other):
method __eq__ (line 100) | def __eq__(self, other):
method __ne__ (line 103) | def __ne__(self, other):
method __gt__ (line 106) | def __gt__(self, other):
method __ge__ (line 109) | def __ge__(self, other):
FILE: Windows/lazagne/config/lib/memorpy/BaseProcess.py
class ProcessException (line 11) | class ProcessException(Exception):
class BaseProcess (line 14) | class BaseProcess(object):
method __init__ (line 16) | def __init__(self, *args, **kwargs):
method __del__ (line 24) | def __del__(self):
method close (line 27) | def close(self):
method iter_region (line 29) | def iter_region(self, *args, **kwargs):
method write_bytes (line 31) | def write_bytes(self, address, data):
method read_bytes (line 34) | def read_bytes(self, address, bytes = 4):
method get_symbolic_name (line 37) | def get_symbolic_name(self, address):
method read (line 40) | def read(self, address, type = 'uint', maxlen = 50, errors='raise'):
method write (line 59) | def write(self, address, data, type = 'uint'):
FILE: Windows/lazagne/config/lib/memorpy/LinProcess.py
function errcheck (line 36) | def errcheck(ret, func, args):
class LinProcess (line 70) | class LinProcess(BaseProcess):
method __init__ (line 71) | def __init__(self, pid=None, name=None, debug=True, ptrace=None):
method check_ptrace_scope (line 89) | def check_ptrace_scope(self):
method close (line 132) | def close(self):
method __del__ (line 142) | def __del__(self):
method _open (line 145) | def _open(self):
method list (line 161) | def list():
method pid_from_name (line 172) | def pid_from_name(name):
method _ptrace (line 187) | def _ptrace(self, attach):
method iter_region (line 207) | def iter_region(self, start_offset=None, end_offset=None, protec=None,...
method ptrace_attach (line 240) | def ptrace_attach(self):
method ptrace_detach (line 246) | def ptrace_detach(self):
method write_bytes (line 252) | def write_bytes(self, address, data):
method read_bytes (line 280) | def read_bytes(self, address, bytes = 4):
FILE: Windows/lazagne/config/lib/memorpy/Locator.py
class Locator (line 24) | class Locator(object):
method __init__ (line 30) | def __init__(self, mw, type = 'unknown', start = None, end = None):
method find (line 38) | def find(self, value, erase_last = True):
method feed (line 41) | def feed(self, value, erase_last = True):
method get_addresses (line 78) | def get_addresses(self):
method diff (line 81) | def diff(self, erase_last = False):
method get_modified_addr (line 84) | def get_modified_addr(self, erase_last = False):
FILE: Windows/lazagne/config/lib/memorpy/MemWorker.py
class MemWorker (line 33) | class MemWorker(object):
method __init__ (line 35) | def __init__(self, pid=None, name=None, end_offset = None, start_offse...
method __enter__ (line 38) | def __enter__(self):
method __exit__ (line 41) | def __exit__(self, type, value, traceback):
method Address (line 44) | def Address(self, value, default_type = 'uint'):
method umem_replace (line 48) | def umem_replace(self, regex, replace):
method mem_replace (line 54) | def mem_replace(self, regex, replace):
method umem_search (line 66) | def umem_search(self, regex):
method group_search (line 72) | def group_search(self, group, start_offset = None, end_offset = None):
method search_address (line 83) | def search_address(self, addr):
method parse_re_function (line 93) | def parse_re_function(self, b, value, offset):
method parse_float_function (line 107) | def parse_float_function(self, b, value, offset):
method parse_named_groups_function (line 118) | def parse_named_groups_function(self, b, value, offset=None):
method parse_groups_function (line 123) | def parse_groups_function(self, b, value, offset=None):
method parse_any_function (line 128) | def parse_any_function(self, b, value, offset):
method mem_search (line 135) | def mem_search(self, value, ftype = 'match', protec = PAGE_READWRITE |...
FILE: Windows/lazagne/config/lib/memorpy/OSXProcess.py
class vm_region_basic_info_64 (line 37) | class vm_region_basic_info_64(ctypes.Structure):
class OSXProcess (line 55) | class OSXProcess(BaseProcess):
method __init__ (line 56) | def __init__(self, pid=None, name=None, debug=True):
method close (line 69) | def close(self):
method __del__ (line 72) | def __del__(self):
method _open (line 75) | def _open(self):
method list (line 84) | def list():
method pid_from_name (line 99) | def pid_from_name(name):
method iter_region (line 105) | def iter_region(self, start_offset=None, end_offset=None, protec=None,...
method write_bytes (line 157) | def write_bytes(self, address, data):
method read_bytes (line 161) | def read_bytes(self, address, bytes = 4):
FILE: Windows/lazagne/config/lib/memorpy/SunProcess.py
class SunProcess (line 39) | class SunProcess(BaseProcess):
method __init__ (line 40) | def __init__(self, pid=None, name=None, debug=True, ptrace=None):
method close (line 55) | def close(self):
method __del__ (line 59) | def __del__(self):
method _open (line 62) | def _open(self):
method _name_args (line 72) | def _name_args(pid):
method list (line 78) | def list():
method pid_from_name (line 94) | def pid_from_name(name):
method iter_region (line 109) | def iter_region(self, start_offset=None, end_offset=None, protec=None,...
method write_bytes (line 153) | def write_bytes(self, address, data):
method read_bytes (line 162) | def read_bytes(self, address, bytes = 4):
FILE: Windows/lazagne/config/lib/memorpy/WinProcess.py
class WinProcess (line 35) | class WinProcess(BaseProcess):
method __init__ (line 37) | def __init__(self, pid=None, name=None, debug=True):
method __del__ (line 57) | def __del__(self):
method is_64bit (line 60) | def is_64bit(self):
method list (line 71) | def list():
method processes_from_name (line 99) | def processes_from_name(processName):
method name_from_process (line 109) | def name_from_process(dwProcessId):
method _open (line 117) | def _open(self, dwProcessId, debug=False):
method close (line 136) | def close(self):
method _open_from_name (line 146) | def _open_from_name(self, processName, debug=False):
method GetSystemInfo (line 157) | def GetSystemInfo(self):
method GetNativeSystemInfo (line 162) | def GetNativeSystemInfo(self):
method VirtualQueryEx (line 167) | def VirtualQueryEx(self, lpAddress):
method VirtualQueryEx64 (line 173) | def VirtualQueryEx64(self, lpAddress):
method VirtualProtectEx (line 179) | def VirtualProtectEx(self, base_address, size, protection):
method iter_region (line 185) | def iter_region(self, start_offset=None, end_offset=None, protec=None,...
method write_bytes (line 209) | def write_bytes(self, address, data):
method read_bytes (line 231) | def read_bytes(self, address, bytes = 4, use_NtWow64ReadVirtualMemory6...
method list_modules (line 268) | def list_modules(self):
method get_symbolic_name (line 284) | def get_symbolic_name(self, address):
method hasModule (line 291) | def hasModule(self, module):
method get_instruction (line 301) | def get_instruction(self, address):
FILE: Windows/lazagne/config/lib/memorpy/WinStructures.py
class SECURITY_DESCRIPTOR (line 26) | class SECURITY_DESCRIPTOR(Structure):
class MEMORY_BASIC_INFORMATION (line 36) | class MEMORY_BASIC_INFORMATION(Structure):
class MEMORY_BASIC_INFORMATION64 (line 46) | class MEMORY_BASIC_INFORMATION64(Structure):
class SYSTEM_INFO (line 59) | class SYSTEM_INFO(Structure):
class PROCESSENTRY32 (line 73) | class PROCESSENTRY32(Structure):
class MODULEENTRY32 (line 89) | class MODULEENTRY32(Structure):
class THREADENTRY32 (line 102) | class THREADENTRY32(Structure):
class TH32CS_CLASS (line 112) | class TH32CS_CLASS(object):
FILE: Windows/lazagne/config/lib/memorpy/utils.py
function re_to_unicode (line 20) | def re_to_unicode(s):
function type_unpack (line 28) | def type_unpack(type):
function hex_dump (line 62) | def hex_dump(data, addr = 0, prefix = '', ftype = 'bytes'):
FILE: Windows/lazagne/config/lib/memorpy/wintools.py
function start_winforeground_daemon (line 20) | def start_winforeground_daemon():
function window_foreground_loop (line 26) | def window_foreground_loop(timeout=20):
FILE: Windows/lazagne/config/manage_modules.py
function get_modules_names (line 10) | def get_modules_names():
function get_categories (line 81) | def get_categories():
function get_modules (line 104) | def get_modules():
FILE: Windows/lazagne/config/module_info.py
class ModuleInfo (line 20) | class ModuleInfo(object):
method __init__ (line 22) | def __init__(self, name, category, options={}, suboptions=[], registry...
method error (line 39) | def error(self, message):
method info (line 42) | def info(self, message):
method debug (line 45) | def debug(self, message):
method warning (line 48) | def warning(self, message):
FILE: Windows/lazagne/config/run.py
function create_module_dic (line 21) | def create_module_dic():
function run_module (line 39) | def run_module(title, module):
function run_modules (line 56) | def run_modules(module, subcategories={}, system_module=False):
function run_category (line 99) | def run_category(category_selected, subcategories={}, system_module=False):
function run_lazagne (line 132) | def run_lazagne(category_selected='all', subcategories={}, password=None):
FILE: Windows/lazagne/config/soft_import_module.py
function soft_import (line 9) | def soft_import(package_name, module_name):
class _MOCK_ImportErrorInModule (line 25) | class _MOCK_ImportErrorInModule(ModuleInfo):
method __init__ (line 27) | def __init__(self, name, exception):
method run (line 31) | def run(self):
FILE: Windows/lazagne/config/users.py
function get_user_list_on_filesystem (line 11) | def get_user_list_on_filesystem(impersonated_user=[]):
function set_env_variables (line 37) | def set_env_variables(user, to_impersonate=False):
function get_username_winapi (line 64) | def get_username_winapi():
FILE: Windows/lazagne/config/winstructure.py
class CREDENTIAL_ATTRIBUTE (line 74) | class CREDENTIAL_ATTRIBUTE(Structure):
class CREDENTIAL (line 86) | class CREDENTIAL(Structure):
class DATA_BLOB (line 107) | class DATA_BLOB(Structure):
class GUID (line 114) | class GUID(Structure):
class VAULT_CREDENTIAL_ATTRIBUTEW (line 126) | class VAULT_CREDENTIAL_ATTRIBUTEW(Structure):
class VAULT_BYTE_BUFFER (line 139) | class VAULT_BYTE_BUFFER(Structure):
class DATA (line 146) | class DATA(Structure):
class Flag (line 164) | class Flag(Structure):
class VAULT_ITEM_DATA (line 183) | class VAULT_ITEM_DATA(Structure):
class VAULT_ITEM_WIN8 (line 197) | class VAULT_ITEM_WIN8(Structure):
class VAULT_ITEM_WIN7 (line 216) | class VAULT_ITEM_WIN7(Structure):
class OSVERSIONINFOEXW (line 232) | class OSVERSIONINFOEXW(Structure):
class CRYPTPROTECT_PROMPTSTRUCT (line 248) | class CRYPTPROTECT_PROMPTSTRUCT(Structure):
class LUID (line 260) | class LUID(Structure):
class SID_AND_ATTRIBUTES (line 270) | class SID_AND_ATTRIBUTES(Structure):
class TOKEN_USER (line 277) | class TOKEN_USER(Structure):
class LUID_AND_ATTRIBUTES (line 282) | class LUID_AND_ATTRIBUTES(Structure):
class TOKEN_PRIVILEGES (line 289) | class TOKEN_PRIVILEGES(Structure):
class SECURITY_ATTRIBUTES (line 299) | class SECURITY_ATTRIBUTES(Structure):
class SID_NAME_USE (line 310) | class SID_NAME_USE(DWORD):
method __init__ (line 315) | def __init__(self, value=None):
method __str__ (line 321) | def __str__(self):
method __repr__ (line 326) | def __repr__(self):
function get_vault_objects_for_this_version_of_windows (line 431) | def get_vault_objects_for_this_version_of_windows():
function EnumProcesses (line 473) | def EnumProcesses():
function LookupAccountSidW (line 500) | def LookupAccountSidW(lpSystemName, lpSid):
function QueryFullProcessImageNameW (line 524) | def QueryFullProcessImageNameW(hProcess, dwFlags=0):
function RtlAdjustPrivilege (line 548) | def RtlAdjustPrivilege(privilege_id):
function getData (line 567) | def getData(blobOut):
function get_full_path_from_pid (line 576) | def get_full_path_from_pid(pid):
function Win32CryptUnprotectData (line 596) | def Win32CryptUnprotectData(cipherText, entropy=False, is_current_user=T...
function get_os_version (line 647) | def get_os_version():
function isx64machine (line 661) | def isx64machine():
function OpenKey (line 673) | def OpenKey(key, path, index=0, access=KEY_READ):
function string_to_unicode (line 683) | def string_to_unicode(string):
function chr_or_byte (line 690) | def chr_or_byte(integer):
function int_or_bytes (line 697) | def int_or_bytes(integer):
function char_to_int (line 704) | def char_to_int(string):
function convert_to_byte (line 711) | def convert_to_byte(string):
FILE: Windows/lazagne/config/write_output.py
class StandardOutput (line 25) | class StandardOutput(object):
method __init__ (line 26) | def __init__(self):
method set_color (line 40) | def set_color(self, color='white', intensity=False):
method first_title (line 49) | def first_title(self):
method print_title (line 56) | def print_title(self, title):
method title_info (line 61) | def title_info(self, title):
method print_user (line 65) | def print_user(self, user, force_print=False):
method print_footer (line 69) | def print_footer(self, elapsed_time=None):
method print_hex (line 77) | def print_hex(self, src, length=8):
method try_unicode (line 88) | def try_unicode(self, obj, encoding='utf-8'):
method do_print (line 103) | def do_print(self, message='', color=False, intensity=False):
method print_without_error (line 116) | def print_without_error(self, message):
method print_logging (line 125) | def print_logging(self, function, prefix='[!]', message='', color=Fals...
method print_output (line 141) | def print_output(self, software_name, pwd_found):
method write_header (line 230) | def write_header(self):
method write_footer (line 246) | def write_footer(self):
method checks_write (line 250) | def checks_write(self, values, category):
function print_debug (line 257) | def print_debug(error_level, message):
function json_to_string (line 284) | def json_to_string(json_string):
function write_in_file (line 323) | def write_in_file(result):
FILE: Windows/lazagne/softwares/browsers/chromium_based.py
class ChromiumBased (line 29) | class ChromiumBased(ModuleInfo):
method __init__ (line 30) | def __init__(self, browser_name, paths):
method _get_database_dirs (line 35) | def _get_database_dirs(self):
method _decrypt_v80 (line 83) | def _decrypt_v80(self, buff, master_key):
method _yandex_extract_enc_key (line 94) | def _yandex_extract_enc_key(self, db_cursor, decrypted_key):
method _yandex_decrypt (line 130) | def _yandex_decrypt(self, key : bytes, encrypted_data : bytes, nonce :...
method _export_credentials (line 137) | def _export_credentials(self, db_path, is_yandex=False, master_key=Non...
method copy_db (line 235) | def copy_db(self, database_path):
method clean_file (line 257) | def clean_file(self, db_path):
method run (line 263) | def run(self):
FILE: Windows/lazagne/softwares/browsers/ie.py
class IE (line 23) | class IE(ModuleInfo):
method __init__ (line 24) | def __init__(self):
method get_hash_table (line 27) | def get_hash_table(self):
method get_history (line 41) | def get_history(self):
method history_from_powershell (line 52) | def history_from_powershell(self):
method history_from_regedit (line 101) | def history_from_regedit(self):
method decipher_password (line 117) | def decipher_password(self, cipher_text, u):
method run (line 159) | def run(self):
FILE: Windows/lazagne/softwares/browsers/mozilla.py
function l (line 33) | def l(n):
function long_to_bytes (line 44) | def long_to_bytes(n, blocksize=0):
class Mozilla (line 75) | class Mozilla(ModuleInfo):
method __init__ (line 77) | def __init__(self, browser_name, path, category='browsers'):
method get_firefox_profiles (line 81) | def get_firefox_profiles(self, directory):
method get_key (line 111) | def get_key(self, profile):
method get_short_le (line 198) | def get_short_le(d, a):
method get_long_be (line 202) | def get_long_be(d, a):
method print_asn1 (line 205) | def print_asn1(self, d, l, rl):
method read_bsddb (line 234) | def read_bsddb(self, name):
method decrypt_3des (line 292) | def decrypt_3des(decoded_item, master_password, global_salt):
method extract_secret_key (line 339) | def extract_secret_key(self, key_data, global_salt, master_password, e...
method decode_login_data (line 363) | def decode_login_data(data):
method get_login_data (line 368) | def get_login_data(self, profile):
method manage_masterpassword (line 405) | def manage_masterpassword(self, master_password=b'', key_data=None, ne...
method is_master_password_correct (line 423) | def is_master_password_correct(self, key_data, master_password=b'', ne...
method brute_master_password (line 462) | def brute_master_password(self, key_data, new_version=True):
method remove_padding (line 481) | def remove_padding(self, data):
method decrypt (line 496) | def decrypt(self, key, iv, ciphertext):
method run (line 503) | def run(self):
FILE: Windows/lazagne/softwares/browsers/ucbrowser.py
class UCBrowser (line 9) | class UCBrowser(ChromiumBased):
method __init__ (line 10) | def __init__(self):
method _get_database_dirs (line 14) | def _get_database_dirs(self):
FILE: Windows/lazagne/softwares/chats/pidgin.py
class Pidgin (line 9) | class Pidgin(ModuleInfo):
method __init__ (line 10) | def __init__(self):
method run (line 13) | def run(self):
FILE: Windows/lazagne/softwares/chats/psi.py
class PSI (line 12) | class PSI(ModuleInfo):
method __init__ (line 13) | def __init__(self):
method get_profiles_files (line 18) | def get_profiles_files(self):
method decode_password (line 31) | def decode_password(self, password, jid):
method process_one_file (line 40) | def process_one_file(self, _path):
method run (line 60) | def run(self):
FILE: Windows/lazagne/softwares/chats/skype.py
class Skype (line 20) | class Skype(ModuleInfo):
method __init__ (line 21) | def __init__(self):
method aes_encrypt (line 26) | def aes_encrypt(self, message, passphrase):
method get_regkey (line 32) | def get_regkey(self):
method get_hash_credential (line 50) | def get_hash_credential(self, xml_file):
method get_md5_hash (line 59) | def get_md5_hash(self, enc_hex, key):
method dictionary_attack (line 82) | def dictionary_attack(self, login, md5):
method get_username (line 90) | def get_username(self, path):
method get_info (line 101) | def get_info(self, key, username, path):
method run (line 127) | def run(self):
FILE: Windows/lazagne/softwares/databases/dbvis.py
class Dbvisualizer (line 15) | class Dbvisualizer(ModuleInfo):
method __init__ (line 16) | def __init__(self):
method get_salt (line 23) | def get_salt(self):
method get_derived_key (line 29) | def get_derived_key(self, password, salt, count):
method decrypt (line 37) | def decrypt(self, msg):
method run (line 44) | def run(self):
FILE: Windows/lazagne/softwares/databases/postgresql.py
class PostgreSQL (line 9) | class PostgreSQL(ModuleInfo):
method __init__ (line 10) | def __init__(self):
method run (line 13) | def run(self):
FILE: Windows/lazagne/softwares/databases/robomongo.py
class Robomongo (line 9) | class Robomongo(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method read_file_content (line 25) | def read_file_content(self, file_path):
method parse_json (line 40) | def parse_json(self, connection_file_path):
method run (line 89) | def run(self):
FILE: Windows/lazagne/softwares/databases/sqldeveloper.py
class SQLDeveloper (line 21) | class SQLDeveloper(ModuleInfo):
method __init__ (line 22) | def __init__(self):
method get_salt (line 29) | def get_salt(self):
method get_derived_key (line 35) | def get_derived_key(self, password, salt, count):
method decrypt (line 42) | def decrypt(self, msg):
method aes_cbc_decrypt (line 49) | def aes_cbc_decrypt(self, encrypted_password, decryption_key, iv):
method decrypt_v19_2 (line 56) | def decrypt_v19_2(self, encrypted, db_system_id):
method get_passphrase (line 71) | def get_passphrase(self, path):
method run (line 94) | def run(self):
FILE: Windows/lazagne/softwares/databases/squirrel.py
class Squirrel (line 9) | class Squirrel(ModuleInfo):
method __init__ (line 10) | def __init__(self):
method run (line 13) | def run(self):
FILE: Windows/lazagne/softwares/games/galconfusion.py
class GalconFusion (line 15) | class GalconFusion(ModuleInfo):
method __init__ (line 16) | def __init__(self):
method run (line 19) | def run(self):
FILE: Windows/lazagne/softwares/games/kalypsomedia.py
class KalypsoMedia (line 15) | class KalypsoMedia(ModuleInfo):
method __init__ (line 16) | def __init__(self):
method xorstring (line 19) | def xorstring(self, s, k):
method run (line 25) | def run(self):
FILE: Windows/lazagne/softwares/games/roguestale.py
class RoguesTale (line 10) | class RoguesTale(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method run (line 14) | def run(self):
FILE: Windows/lazagne/softwares/games/turba.py
class Turba (line 15) | class Turba(ModuleInfo):
method __init__ (line 16) | def __init__(self):
method run (line 19) | def run(self):
FILE: Windows/lazagne/softwares/git/gitforwindows.py
class GitForWindows (line 14) | class GitForWindows(ModuleInfo):
method __init__ (line 15) | def __init__(self):
method extract_credentials (line 18) | def extract_credentials(self, location):
method run (line 41) | def run(self):
FILE: Windows/lazagne/softwares/mails/outlook.py
class Outlook (line 12) | class Outlook(ModuleInfo):
method __init__ (line 13) | def __init__(self):
method trySingleKey (line 16) | def trySingleKey(self, keyPath):
method retrieve_info (line 48) | def retrieve_info(self, hkey, name_key):
method run (line 72) | def run(self):
FILE: Windows/lazagne/softwares/maven/mavenrepositories.py
class MavenRepositories (line 9) | class MavenRepositories(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method extract_master_password (line 17) | def extract_master_password(self):
method extract_repositories_credentials (line 39) | def extract_repositories_credentials(self):
method use_key_auth (line 66) | def use_key_auth(self, creds_dict):
method run (line 81) | def run(self):
FILE: Windows/lazagne/softwares/memory/keepass.py
class Keepass (line 15) | class Keepass(ModuleInfo):
method __init__ (line 16) | def __init__(self):
method run (line 19) | def run(self):
FILE: Windows/lazagne/softwares/memory/keethief.py
class KeeThief (line 11) | class KeeThief():
method run (line 27) | def run(self, full_exe_path):
FILE: Windows/lazagne/softwares/memory/libkeepass/__init__.py
function open (line 18) | def open(filename, **credentials):
function add_kdb_reader (line 40) | def add_kdb_reader(sub_signature, cls):
function get_kdb_reader (line 55) | def get_kdb_reader(signature):
FILE: Windows/lazagne/softwares/memory/libkeepass/common.py
class HeaderDictionary (line 17) | class HeaderDictionary(dict):
method __init__ (line 78) | def __init__(self, *args):
method __getitem__ (line 81) | def __getitem__(self, key):
method __setitem__ (line 87) | def __setitem__(self, key, val):
method __getattr__ (line 93) | def __getattr__(self, key):
method __setattr__ (line 123) | def __setattr__(self, key, val):
class KDBFile (line 131) | class KDBFile(object):
method __init__ (line 132) | def __init__(self, stream=None, **credentials):
method read_from (line 155) | def read_from(self, stream):
method _read_header (line 161) | def _read_header(self, stream):
method _decrypt (line 165) | def _decrypt(self, stream):
method write_to (line 172) | def write_to(self, stream):
method add_credentials (line 175) | def add_credentials(self, **credentials):
method clear_credentials (line 181) | def clear_credentials(self):
method add_key_hash (line 185) | def add_key_hash(self, key_hash):
method _make_master_key (line 194) | def _make_master_key(self):
method close (line 198) | def close(self):
method read (line 202) | def read(self, n=-1):
method seek (line 215) | def seek(self, offset, whence=io.SEEK_SET):
method tell (line 219) | def tell(self):
function load_keyfile (line 225) | def load_keyfile(filename):
function load_xml_keyfile (line 236) | def load_xml_keyfile(filename):
function load_plain_keyfile (line 257) | def load_plain_keyfile(filename):
function stream_unpack (line 275) | def stream_unpack(stream, offset, length, typecode='I'):
function read_signature (line 282) | def read_signature(stream):
FILE: Windows/lazagne/softwares/memory/libkeepass/crypto.py
function sha256 (line 11) | def sha256(s):
function transform_key (line 16) | def transform_key(key, seed, rounds):
function aes_cbc_decrypt (line 27) | def aes_cbc_decrypt(data, key, enc_iv):
function aes_cbc_encrypt (line 33) | def aes_cbc_encrypt(data, key, enc_iv):
function unpad (line 38) | def unpad(data):
function pad (line 43) | def pad(s):
function xor (line 48) | def xor(aa, bb):
FILE: Windows/lazagne/softwares/memory/libkeepass/hbio.py
function read_int (line 16) | def read_int(stream, length):
class HashedBlockIO (line 23) | class HashedBlockIO(io.BytesIO):
method __init__ (line 41) | def __init__(self, block_stream=None, bytes=None):
method read_block_stream (line 53) | def read_block_stream(self, block_stream):
method _next_block (line 65) | def _next_block(self, block_stream):
method write_block_stream (line 82) | def write_block_stream(self, stream, block_length=BLOCK_LENGTH):
FILE: Windows/lazagne/softwares/memory/libkeepass/kdb4.py
class KDB4Header (line 26) | class KDB4Header(HeaderDictionary):
class KDB4File (line 53) | class KDB4File(KDBFile):
method __init__ (line 54) | def __init__(self, stream=None, **credentials):
method set_compression (line 58) | def set_compression(self, flag=1):
method read_from (line 67) | def read_from(self, stream):
method _read_header (line 89) | def _read_header(self, stream):
method _decrypt (line 171) | def _decrypt(self, stream):
method _encrypt (line 194) | def _encrypt(self):
method _unzip (line 220) | def _unzip(self):
method _zip (line 229) | def _zip(self):
method _make_master_key (line 241) | def _make_master_key(self):
class KDBXmlExtension (line 256) | class KDBXmlExtension:
method __init__ (line 266) | def __init__(self, unprotect=True):
method unprotect (line 280) | def unprotect(self):
method to_dic (line 320) | def to_dic(self):
method _reset_salsa (line 346) | def _reset_salsa(self):
method _get_salsa (line 351) | def _get_salsa(self, length):
method _unprotect (line 363) | def _unprotect(self, string):
method _protect (line 371) | def _protect(self, string):
class KDB4Reader (line 380) | class KDB4Reader(KDB4File, KDBXmlExtension):
method __init__ (line 399) | def __init__(self, stream=None, **credentials):
method read_from (line 402) | def read_from(self, stream, unprotect=True):
FILE: Windows/lazagne/softwares/memory/libkeepass/pureSalsa20.py
class Salsa20 (line 188) | class Salsa20(object):
method __init__ (line 189) | def __init__(self, key=None, iv=None, rounds=20):
method set_key (line 200) | def set_key(self, key):
method set_iv (line 215) | def set_iv(self, iv):
method set_counter (line 225) | def set_counter(self, counter):
method get_counter (line 231) | def get_counter(self):
method set_rounds (line 234) | def set_rounds(self, rounds, testing=False):
method encrypt_bytes (line 238) | def encrypt_bytes(self, data):
function salsa20_wordtobyte (line 258) | def salsa20_wordtobyte(input, n_rounds=20, check_rounds=True):
function trunc32 (line 319) | def trunc32(w):
function add32 (line 327) | def add32(a, b):
function rot32 (line 337) | def rot32(w, n_left):
FILE: Windows/lazagne/softwares/memory/memorydump.py
class MemoryDump (line 66) | class MemoryDump(ModuleInfo):
method __init__ (line 67) | def __init__(self):
method run (line 72) | def run(self):
FILE: Windows/lazagne/softwares/memory/onepassword.py
class OnePassword (line 5) | class OnePassword(ModuleInfo):
method __init__ (line 7) | def __init__(self):
method run (line 10) | def run(self):
FILE: Windows/lazagne/softwares/multimedia/eyecon.py
class EyeCON (line 13) | class EyeCON(ModuleInfo):
method __init__ (line 18) | def __init__(self):
method deobfuscate (line 25) | def deobfuscate(self, ciphered_str):
method get_db_hosts (line 28) | def get_db_hosts(self):
method credentials_from_registry (line 50) | def credentials_from_registry(self):
method run (line 93) | def run(self):
FILE: Windows/lazagne/softwares/php/composer.py
class Composer (line 10) | class Composer(ModuleInfo):
method __init__ (line 12) | def __init__(self):
method extract_credentials (line 15) | def extract_credentials(self, location):
method run (line 42) | def run(self):
FILE: Windows/lazagne/softwares/svn/tortoise.py
class Tortoise (line 11) | class Tortoise(ModuleInfo):
method __init__ (line 12) | def __init__(self):
method run (line 15) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/apachedirectorystudio.py
class ApacheDirectoryStudio (line 10) | class ApacheDirectoryStudio(ModuleInfo):
method __init__ (line 12) | def __init__(self):
method extract_connections_credentials (line 17) | def extract_connections_credentials(self):
method run (line 44) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/coreftp.py
class CoreFTP (line 13) | class CoreFTP(ModuleInfo):
method __init__ (line 14) | def __init__(self):
method decrypt (line 19) | def decrypt(self, hex):
method run (line 25) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/cyberduck.py
class Cyberduck (line 14) | class Cyberduck(ModuleInfo):
method __init__ (line 15) | def __init__(self):
method get_application_path (line 19) | def get_application_path(self):
method run (line 28) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/d3des.py
function decrypt_passwd (line 54) | def decrypt_passwd(data):
function generate_response (line 59) | def generate_response(passwd, challange):
function deskey (line 97) | def deskey(key, decrypt): # Thanks to James Gillogly & Phil Karn!
function cookey (line 140) | def cookey(raw):
function desfunc (line 310) | def desfunc(block, keys):
FILE: Windows/lazagne/softwares/sysadmin/filezilla.py
class Filezilla (line 12) | class Filezilla(ModuleInfo):
method __init__ (line 13) | def __init__(self):
method run (line 16) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/filezillaserver.py
class FilezillaServer (line 10) | class FilezillaServer(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method run (line 14) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/ftpnavigator.py
class FtpNavigator (line 10) | class FtpNavigator(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method decode (line 14) | def decode(self, encode_password):
method run (line 20) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/iisapppool.py
class IISAppPool (line 9) | class IISAppPool(ModuleInfo):
method __init__ (line 10) | def __init__(self):
method find_files (line 13) | def find_files(self, path, file):
method execute_get_stdout (line 25) | def execute_get_stdout(self, exe_file, arguments):
method run (line 35) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/iiscentralcertp.py
class IISCentralCertP (line 20) | class IISCentralCertP(ModuleInfo):
method __init__ (line 21) | def __init__(self):
method find_files (line 24) | def find_files(self, path, file):
method create_RSAKeyValueFile (line 36) | def create_RSAKeyValueFile(self, exe_file, container):
method get_registry_key (line 46) | def get_registry_key(self, reg_key, parameter):
method decrypt_hash_b64 (line 58) | def decrypt_hash_b64(self, hash_b64, privkey):
method GetLong (line 66) | def GetLong(self, nodelist):
method read_RSAKeyValue (line 76) | def read_RSAKeyValue(self, rsa_key_xml):
method run (line 91) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/keepassconfig.py
class KeePassConfig (line 9) | class KeePassConfig(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method run (line 15) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/mRemoteNG.py
class mRemoteNG (line 28) | class mRemoteNG(ModuleInfo):
method __init__ (line 34) | def __init__(self):
method gcm_decrypt (line 42) | def gcm_decrypt(self, password):
method cbc_decrypt (line 86) | def cbc_decrypt(self, password):
method decrypt (line 98) | def decrypt(self, password):
method run (line 107) | def run(self, software_name = None):
method parser (line 118) | def parser(self, filename):
method get_configuration_files (line 173) | def get_configuration_files(self):
FILE: Windows/lazagne/softwares/sysadmin/opensshforwindows.py
class OpenSSHForWindows (line 9) | class OpenSSHForWindows(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method extract_private_keys_unprotected (line 42) | def extract_private_keys_unprotected(self):
method run (line 76) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/openvpn.py
class OpenVPN (line 13) | class OpenVPN(ModuleInfo):
method __init__ (line 14) | def __init__(self):
method check_openvpn_installed (line 17) | def check_openvpn_installed(self):
method decrypt_password (line 25) | def decrypt_password(self, encrypted_password, entropy):
method get_credentials (line 32) | def get_credentials(self, key):
method get_vpn_config_file_path (line 63) | def get_vpn_config_file_path(profile_name):
method collect_extra_data_for_profile (line 92) | def collect_extra_data_for_profile(self, profile_name):
method run (line 127) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/puttycm.py
class Puttycm (line 15) | class Puttycm(ModuleInfo):
method __init__ (line 16) | def __init__(self):
method run (line 19) | def run(self):
method get_default_database (line 24) | def get_default_database(self):
method parse_xml (line 33) | def parse_xml(self, database_path):
FILE: Windows/lazagne/softwares/sysadmin/rclone.py
class Rclone (line 21) | class Rclone(ModuleInfo):
method __init__ (line 22) | def __init__(self):
method base64_urlsafedecode (line 27) | def base64_urlsafedecode(self, string):
method aes_ctr_decrypt (line 36) | def aes_ctr_decrypt(self, encrypted_password, iv):
method deobscure (line 46) | def deobscure(self, obscured):
method run (line 52) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/rdpmanager.py
class RDPManager (line 13) | class RDPManager(ModuleInfo):
method __init__ (line 14) | def __init__(self):
method decrypt_password (line 17) | def decrypt_password(self, encrypted_password):
method format_output_tag (line 28) | def format_output_tag(self, tag):
method check_tag_content (line 36) | def check_tag_content(self, values, c):
method parse_element (line 44) | def parse_element(self, root, element):
method run (line 65) | def run(self):
method parse_xml (line 100) | def parse_xml(self, xml_file):
FILE: Windows/lazagne/softwares/sysadmin/unattended.py
class Unattended (line 14) | class Unattended(ModuleInfo):
method __init__ (line 15) | def __init__(self):
method try_b64_decode (line 19) | def try_b64_decode(self, message):
method run (line 25) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/vnc.py
class Vnc (line 17) | class Vnc(ModuleInfo):
method __init__ (line 18) | def __init__(self):
method split_len (line 22) | def split_len(self, seq, length):
method do_crypt (line 25) | def do_crypt(self, password, decrypt):
method unhex (line 32) | def unhex(self, s):
method reverse_vncpassword (line 43) | def reverse_vncpassword(self, hash):
method vnc_from_registry (line 63) | def vnc_from_registry(self):
method vnc_from_filesystem (line 115) | def vnc_from_filesystem(self):
method vnc_from_process (line 157) | def vnc_from_process(self):
method run (line 161) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/winscp.py
class WinSCP (line 11) | class WinSCP(ModuleInfo):
method __init__ (line 12) | def __init__(self):
method decrypt_char (line 17) | def decrypt_char(self):
method check_winscp_installed (line 33) | def check_winscp_installed(self):
method check_masterPassword (line 41) | def check_masterPassword(self, key):
method get_credentials (line 49) | def get_credentials(self):
method decrypt_password (line 93) | def decrypt_password(self, username, hostname, _hash):
method run (line 121) | def run(self):
FILE: Windows/lazagne/softwares/sysadmin/wsl.py
class Wsl (line 9) | class Wsl(ModuleInfo):
method __init__ (line 10) | def __init__(self):
method run (line 13) | def run(self):
FILE: Windows/lazagne/softwares/wifi/wifi.py
class Wifi (line 14) | class Wifi(ModuleInfo):
method __init__ (line 15) | def __init__(self):
method decrypt_using_lsa_secret (line 18) | def decrypt_using_lsa_secret(self, key):
method decrypt_using_netsh (line 30) | def decrypt_using_netsh(self, ssid):
method run (line 54) | def run(self):
FILE: Windows/lazagne/softwares/windows/autologon.py
class Autologon (line 14) | class Autologon(ModuleInfo):
method __init__ (line 15) | def __init__(self):
method run (line 18) | def run(self):
FILE: Windows/lazagne/softwares/windows/cachedump.py
class Cachedump (line 8) | class Cachedump(ModuleInfo):
method __init__ (line 9) | def __init__(self):
method run (line 12) | def run(self):
FILE: Windows/lazagne/softwares/windows/creddump7/addrspace.py
class FileAddressSpace (line 36) | class FileAddressSpace:
method __init__ (line 37) | def __init__(self, fname, mode='rb', fast=False):
method fread (line 46) | def fread(self, len):
method read (line 49) | def read(self, addr, len):
method read_long (line 53) | def read_long(self, addr):
method get_address_range (line 58) | def get_address_range(self):
method get_available_addresses (line 61) | def get_available_addresses(self):
method is_valid_address (line 64) | def is_valid_address(self, addr):
method close (line 67) | def close(self):
class HiveFileAddressSpace (line 76) | class HiveFileAddressSpace:
method __init__ (line 77) | def __init__(self, fname):
method vtop (line 81) | def vtop(self, vaddr):
method read (line 84) | def read(self, vaddr, length, zero=False):
method read_long_phys (line 136) | def read_long_phys(self, addr):
method is_valid_address (line 141) | def is_valid_address(self, vaddr):
FILE: Windows/lazagne/softwares/windows/creddump7/newobj.py
function get_ptr_type (line 28) | def get_ptr_type(structure, member):
class Obj (line 48) | class Obj(object):
method __new__ (line 55) | def __new__(typ, name, address, space):
method __init__ (line 66) | def __init__(self, name, address, space):
method __getattribute__ (line 76) | def __getattribute__(self, attr):
method __truediv__ (line 109) | def __truediv__(self, other):
method __div__ (line 117) | def __div__(self, other):
method members (line 125) | def members(self):
method values (line 133) | def values(self):
method bytes (line 141) | def bytes(self, length=-1):
method size (line 153) | def size(self):
method __repr__ (line 161) | def __repr__(self):
method __eq__ (line 164) | def __eq__(self, other):
method __ne__ (line 169) | def __ne__(self, other):
method __hash__ (line 172) | def __hash__(self):
method is_valid (line 175) | def is_valid(self):
method get_offset (line 178) | def get_offset(self, member):
class Primitive (line 182) | class Primitive(Obj):
method __new__ (line 189) | def __new__(typ, *args, **kwargs):
method __init__ (line 193) | def __init__(self, name, address, space):
method __repr__ (line 202) | def __repr__(self):
method members (line 205) | def members(self):
class Pointer (line 209) | class Pointer(Obj):
method __new__ (line 218) | def __new__(typ, *args, **kwargs):
method __init__ (line 222) | def __init__(self, name, address, space, ptr_type):
method __getattribute__ (line 230) | def __getattribute__(self, attr):
method __repr__ (line 240) | def __repr__(self):
method members (line 243) | def members(self):
class _UNICODE_STRING (line 247) | class _UNICODE_STRING(Obj):
method __new__ (line 256) | def __new__(typ, *args, **kwargs):
method __str__ (line 260) | def __str__(self):
method getBuffer (line 264) | def getBuffer(self):
class _CM_KEY_NODE (line 269) | class _CM_KEY_NODE(Obj):
method __new__ (line 270) | def __new__(typ, *args, **kwargs):
method getName (line 274) | def getName(self):
class _CM_KEY_VALUE (line 279) | class _CM_KEY_VALUE(Obj):
method __new__ (line 280) | def __new__(typ, *args, **kwargs):
method getName (line 284) | def getName(self):
class _CHILD_LIST (line 289) | class _CHILD_LIST(Obj):
method __new__ (line 290) | def __new__(typ, *args, **kwargs):
method getList (line 294) | def getList(self):
class _CM_KEY_INDEX (line 303) | class _CM_KEY_INDEX(Obj):
method __new__ (line 304) | def __new__(typ, *args, **kwargs):
method getList (line 308) | def getList(self):
FILE: Windows/lazagne/softwares/windows/creddump7/object.py
function obj_size (line 44) | def obj_size(types, objname):
function builtin_size (line 51) | def builtin_size(builtin):
function read_value (line 58) | def read_value(addr_space, value_type, vaddr):
function read_unicode_string (line 81) | def read_unicode_string(addr_space, types, member_list, vaddr):
function read_string (line 108) | def read_string(addr_space, types, member_list, vaddr, max_length=256):
function read_null_string (line 118) | def read_null_string(addr_space, types, member_list, vaddr, max_length=2...
function get_obj_offset (line 130) | def get_obj_offset(types, member_list):
function read_obj (line 170) | def read_obj(addr_space, types, member_list, vaddr):
FILE: Windows/lazagne/softwares/windows/creddump7/win32/domcachedump.py
function get_nlkm (line 37) | def get_nlkm(secaddr, lsakey, vista):
function decrypt_hash (line 41) | def decrypt_hash(edata, nlkm, ch):
function decrypt_hash_vista (line 50) | def decrypt_hash_vista(edata, nlkm, ch):
function parse_cache_entry (line 65) | def parse_cache_entry(cache_data):
function parse_decrypted_cache (line 73) | def parse_decrypted_cache(dec_data, uname_len, domain_len, domain_name_l...
function dump_hashes (line 94) | def dump_hashes(sysaddr, secaddr, vista):
function dump_file_hashes (line 139) | def dump_file_hashes(syshive_fname, sechive_fname, vista):
FILE: Windows/lazagne/softwares/windows/creddump7/win32/hashdump.py
function str_to_key (line 69) | def str_to_key(s):
function sid_to_key (line 87) | def sid_to_key(sid):
function find_control_set (line 101) | def find_control_set(sysaddr):
function get_bootkey (line 115) | def get_bootkey(sysaddr):
function get_hbootkey (line 141) | def get_hbootkey(samaddr, bootkey):
function get_user_keys (line 177) | def get_user_keys(samaddr):
function decrypt_single_hash (line 190) | def decrypt_single_hash(rid, hbootkey, enc_hash, lmntstr):
function decrypt_single_salted_hash (line 205) | def decrypt_single_salted_hash(rid, hbootkey, enc_hash, lmntstr, salt):
function get_user_hashes (line 218) | def get_user_hashes(user_key, hbootkey):
function get_user_name (line 260) | def get_user_name(user_key):
function dump_hashes (line 276) | def dump_hashes(sysaddr, samaddr):
function dump_file_hashes (line 292) | def dump_file_hashes(syshive_fname, samhive_fname):
FILE: Windows/lazagne/softwares/windows/creddump7/win32/lsasecrets.py
function get_lsa_key (line 33) | def get_lsa_key(secaddr, bootkey, vista):
function decrypt_secret (line 70) | def decrypt_secret(secret, key):
function decrypt_aes (line 96) | def decrypt_aes(secret, key):
function get_secret_by_name (line 115) | def get_secret_by_name(secaddr, name, lsakey, vista):
function get_secrets (line 143) | def get_secrets(sysaddr, secaddr, vista):
function get_file_secrets (line 179) | def get_file_secrets(sysfile, secfile, vista):
FILE: Windows/lazagne/softwares/windows/creddump7/win32/rawreg.py
function get_root (line 31) | def get_root(address_space):
function open_key (line 35) | def open_key(root, key):
function subkeys (line 50) | def subkeys(key, stable=True):
function values (line 75) | def values(key):
function walk (line 80) | def walk(root):
FILE: Windows/lazagne/softwares/windows/credfiles.py
class CredFiles (line 7) | class CredFiles(ModuleInfo):
method __init__ (line 8) | def __init__(self):
method run (line 11) | def run(self):
FILE: Windows/lazagne/softwares/windows/credman.py
class Credman (line 6) | class Credman(ModuleInfo):
method __init__ (line 7) | def __init__(self):
method run (line 10) | def run(self):
FILE: Windows/lazagne/softwares/windows/hashdump.py
class Hashdump (line 7) | class Hashdump(ModuleInfo):
method __init__ (line 8) | def __init__(self):
method run (line 11) | def run(self):
FILE: Windows/lazagne/softwares/windows/lsa_secrets.py
class LSASecrets (line 10) | class LSASecrets(ModuleInfo):
method __init__ (line 11) | def __init__(self):
method run (line 14) | def run(self):
FILE: Windows/lazagne/softwares/windows/ppypykatz.py
class Pypykatz (line 15) | class Pypykatz(ModuleInfo):
method __init__ (line 23) | def __init__(self):
method run (line 26) | def run(self):
FILE: Windows/lazagne/softwares/windows/vault.py
class Vault (line 7) | class Vault(ModuleInfo):
method __init__ (line 8) | def __init__(self):
method run (line 11) | def run(self):
FILE: Windows/lazagne/softwares/windows/vaultfiles.py
class VaultFiles (line 7) | class VaultFiles(ModuleInfo):
method __init__ (line 8) | def __init__(self):
method run (line 11) | def run(self):
FILE: Windows/lazagne/softwares/windows/windows.py
class WindowsPassword (line 13) | class WindowsPassword(ModuleInfo):
method __init__ (line 14) | def __init__(self):
method is_in_domain (line 18) | def is_in_domain(self):
method run (line 31) | def run(self):
Condensed preview — 262 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,669K chars).
[
{
"path": ".github/workflows/WinCompile.yml",
"chars": 1183,
"preview": "name: Build and Upload LaZagne Release\n\non:\n push:\n tags:\n - 'v*' # Matches tags like v1.0, v20.15.10\n\njobs:\n "
},
{
"path": ".github/workflows/lint_python.yml",
"chars": 1305,
"preview": "name: lint_python\non: [pull_request, push]\njobs:\n lint_python:\n runs-on: ubuntu-latest\n steps:\n - uses: acti"
},
{
"path": ".gitignore",
"chars": 27,
"preview": ".idea\n*.pyc\nvenv\n.DS_Store\n"
},
{
"path": ".travis.yml",
"chars": 2831,
"preview": "os: linux\ndist: focal\nlanguage: python\n\nlint_steps: &lint_steps\n before_install:\n - pip install --upgrade pip\n - "
},
{
"path": "CHANGELOG",
"chars": 9020,
"preview": "LaZagne 2.4\n- Windows / Linux / Mac\n\t* Big code review and lots of bug fixed\n\t* PEP8 Style (thanks to @ingested)\n\t* Pycr"
},
{
"path": "LICENSE",
"chars": 7632,
"preview": "GNU LESSER GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foun"
},
{
"path": "Linux/hook-sys.py",
"chars": 504,
"preview": "from lazagne.config.manage_modules import get_modules_names\nfrom lazagne.softwares.browsers.chromium_browsers import chr"
},
{
"path": "Linux/laZagne.py",
"chars": 8612,
"preview": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\n#######################################################################"
},
{
"path": "Linux/lazagne/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Linux/lazagne/config/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Linux/lazagne/config/constant.py",
"chars": 878,
"preview": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\nimport sys\nimport time\n\ndate = time.strftime(\"%d%m%Y_%H%M%S\")\n\n\nclass co"
},
{
"path": "Linux/lazagne/config/crypto/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Linux/lazagne/config/crypto/pbkdf2.py",
"chars": 1658,
"preview": "#!/usr/bin/python\n\n# A simple implementation of pbkdf2 using stock python modules. See RFC2898\n# for details. Basically,"
},
{
"path": "Linux/lazagne/config/crypto/pyDes.py",
"chars": 32332,
"preview": "#############################################################################\n# Documentation "
},
{
"path": "Linux/lazagne/config/crypto/pyaes/__init__.py",
"chars": 2087,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Linux/lazagne/config/crypto/pyaes/aes.py",
"chars": 60310,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Linux/lazagne/config/crypto/pyaes/blockfeeder.py",
"chars": 8123,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Linux/lazagne/config/crypto/pyaes/util.py",
"chars": 2060,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Linux/lazagne/config/dico.py",
"chars": 9631,
"preview": "def get_dic():\n return [\n b\"password\",\n b\"123456\",\n b\"12345678\",\n b\"1234\",\n b\"qwer"
},
{
"path": "Linux/lazagne/config/homes.py",
"chars": 6432,
"preview": "import pwd\nimport os\n\n\ndef directories():\n \"\"\"\n Retrieve all users' homes\n \"\"\"\n visited = set()\n\n # Get a"
},
{
"path": "Linux/lazagne/config/lib/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Linux/lazagne/config/lib/memorpy/Address.py",
"chars": 3463,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/BaseProcess.py",
"chars": 1798,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nimport struct\n\nfrom .utils import *\n\n\n\"\"\" Base class for process not linke"
},
{
"path": "Linux/lazagne/config/lib/memorpy/LinProcess.py",
"chars": 11069,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/LinStructures.py",
"chars": 427,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nPROT_NONE = 0\nPROT_READ = 1\nPROT_WRITE = 2\nPROT_EXEC = 4\nPROT_PRIVATE = 8\n"
},
{
"path": "Linux/lazagne/config/lib/memorpy/Locator.py",
"chars": 3156,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/MemWorker.py",
"chars": 8318,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/OSXProcess.py",
"chars": 5948,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/Process.py",
"chars": 375,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nimport sys\nfrom .BaseProcess import *\nif sys.platform=='win32':\n from ."
},
{
"path": "Linux/lazagne/config/lib/memorpy/SunProcess.py",
"chars": 5069,
"preview": "# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or modify\n# it under the terms"
},
{
"path": "Linux/lazagne/config/lib/memorpy/WinProcess.py",
"chars": 11953,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/WinStructures.py",
"chars": 6155,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/__init__.py",
"chars": 1081,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/structures.py",
"chars": 155,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nimport sys\nif sys.platform==\"win32\":\n from .WinStructures import *\nelse"
},
{
"path": "Linux/lazagne/config/lib/memorpy/utils.py",
"chars": 3336,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/lib/memorpy/version.py",
"chars": 92,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nversion=(1,7)\nversion_string=\"%s.%s\"%version\n\n"
},
{
"path": "Linux/lazagne/config/lib/memorpy/wintools.py",
"chars": 1227,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Linux/lazagne/config/manage_modules.py",
"chars": 3003,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom lazagne.config.soft_import_module import soft_import\n# browsers\nfrom"
},
{
"path": "Linux/lazagne/config/module_info.py",
"chars": 1095,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nname => Name of a class\ncategory => windows / browsers / etc\noptions "
},
{
"path": "Linux/lazagne/config/run.py",
"chars": 2429,
"preview": "# -*- coding: utf-8 -*-\n# !/usr/bin/python\nimport getpass\nimport traceback\nfrom collections import OrderedDict\n\nfrom laz"
},
{
"path": "Linux/lazagne/config/soft_import_module.py",
"chars": 1125,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom importlib import import_module\n\nfrom lazagne.config.module_info impo"
},
{
"path": "Linux/lazagne/config/write_output.py",
"chars": 12086,
"preview": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\nimport json\nimport logging\nimport getpass\nimport socket\nimport sys\nimpor"
},
{
"path": "Linux/lazagne/softwares/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Linux/lazagne/softwares/browsers/__init__.py",
"chars": 24,
"preview": "# -*- coding: utf-8 -*-\n"
},
{
"path": "Linux/lazagne/softwares/browsers/chromium_based.py",
"chars": 5158,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \nimport os\nimport shutil\nimport sqlite3\nimport struct\nimport traceback\n\nfr"
},
{
"path": "Linux/lazagne/softwares/browsers/chromium_browsers.py",
"chars": 949,
"preview": "from lazagne.config.soft_import_module import soft_import\n\nchromium_based_module_location = \"lazagne.softwares.browsers."
},
{
"path": "Linux/lazagne/softwares/browsers/firefox_browsers.py",
"chars": 487,
"preview": "from lazagne.config.soft_import_module import soft_import\n\nmozilla_module_location = \"lazagne.softwares.browsers.mozilla"
},
{
"path": "Linux/lazagne/softwares/browsers/mozilla.py",
"chars": 21745,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# portable decryption functions and BSD DB parsing by Laurent Clevy (@lore"
},
{
"path": "Linux/lazagne/softwares/browsers/opera.py",
"chars": 4776,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\nimport re\nimport os\nimport binascii\nimport hashlib\nimport struct\n\nfrom l"
},
{
"path": "Linux/lazagne/softwares/chats/__init__.py",
"chars": 24,
"preview": "# -*- coding: utf-8 -*-\n"
},
{
"path": "Linux/lazagne/softwares/chats/pidgin.py",
"chars": 2313,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\nimport os\nimport traceback\n\nfrom lazagne.config.module_info import Modul"
},
{
"path": "Linux/lazagne/softwares/chats/psi.py",
"chars": 1963,
"preview": "# -*- coding: utf-8 -*- \nimport os\nfrom xml.etree.cElementTree import ElementTree\nfrom itertools import cycle\n\nfrom laza"
},
{
"path": "Linux/lazagne/softwares/databases/__init__.py",
"chars": 24,
"preview": "# -*- coding: utf-8 -*-\n"
},
{
"path": "Linux/lazagne/softwares/databases/dbvis.py",
"chars": 2919,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\nimport binascii\nimport hashlib\nimport base64\nimport array\nimport re\nimpo"
},
{
"path": "Linux/lazagne/softwares/databases/sqldeveloper.py",
"chars": 7584,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\n# Passwords decryption for new verion have been taken from:\n# https://gi"
},
{
"path": "Linux/lazagne/softwares/databases/squirrel.py",
"chars": 1102,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\n\nfrom xml.etree.cElementTree import ElementTree\n\nfrom lazagne.c"
},
{
"path": "Linux/lazagne/softwares/git/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Linux/lazagne/softwares/git/gitforlinux.py",
"chars": 2529,
"preview": "# -*- coding: utf-8 -*-\nimport os\nimport psutil\n\ntry: \n from urlparse import urlparse, unquote\nexcept ImportError: \n "
},
{
"path": "Linux/lazagne/softwares/mails/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Linux/lazagne/softwares/mails/clawsmail.py",
"chars": 5668,
"preview": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n# Thanks to https://github.com/b4n/clawsmail-password-decrypter\n\nimport "
},
{
"path": "Linux/lazagne/softwares/mails/thunderbird_mails.py",
"chars": 373,
"preview": "from lazagne.config.soft_import_module import soft_import\n\nmozilla_module_location = \"lazagne.softwares.browsers.mozilla"
},
{
"path": "Linux/lazagne/softwares/memory/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Linux/lazagne/softwares/memory/memorydump.py",
"chars": 4584,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n# Author: Nicolas VERDIER (contact@n1nj4.eu)\n\n\"\"\" \nThis script uses memorpy"
},
{
"path": "Linux/lazagne/softwares/memory/mimipy.py",
"chars": 6732,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n Author: Nicolas VERDIER (contact@n1nj4.eu)\n Original idea from"
},
{
"path": "Linux/lazagne/softwares/sysadmin/__init__.py",
"chars": 24,
"preview": "# -*- coding: utf-8 -*-\n"
},
{
"path": "Linux/lazagne/softwares/sysadmin/apachedirectorystudio.py",
"chars": 2506,
"preview": "# -*- coding: utf-8 -*- \nfrom xml.etree.ElementTree import parse\n\nfrom lazagne.config.module_info import ModuleInfo\nfrom"
},
{
"path": "Linux/lazagne/softwares/sysadmin/aws.py",
"chars": 1294,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\n\nfrom lazagne.config.module_info import ModuleInfo\nfrom lazagne"
},
{
"path": "Linux/lazagne/softwares/sysadmin/cli.py",
"chars": 4072,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\nimport psutil\nimport pwd\nimport os\n\nfrom lazagne.config.module_info impo"
},
{
"path": "Linux/lazagne/softwares/sysadmin/docker.py",
"chars": 1183,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport json\nimport os\n\nfrom lazagne.config.module_info import ModuleInfo\nf"
},
{
"path": "Linux/lazagne/softwares/sysadmin/env_variable.py",
"chars": 3789,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport psutil\n\nfrom lazagne.config.module_info import ModuleInfo\n\ntry:\n "
},
{
"path": "Linux/lazagne/softwares/sysadmin/filezilla.py",
"chars": 1743,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport base64\n\nfrom xml.etree.cElementTree import ElementTree\n\n"
},
{
"path": "Linux/lazagne/softwares/sysadmin/fstab.py",
"chars": 1114,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\nimport os\n\nfrom lazagne.config.module_info import ModuleInfo\n\n\nclass Fst"
},
{
"path": "Linux/lazagne/softwares/sysadmin/gftp.py",
"chars": 5089,
"preview": "# -*- coding: utf-8 -*- \nfrom lazagne.config.module_info import ModuleInfo\nfrom lazagne.config.constant import *\nfrom la"
},
{
"path": "Linux/lazagne/softwares/sysadmin/grub.py",
"chars": 3089,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport crypt\nimport os\n\nfrom lazagne.config.module_info import ModuleInfo\n"
},
{
"path": "Linux/lazagne/softwares/sysadmin/keepassconfig.py",
"chars": 4420,
"preview": "# -*- coding: utf-8 -*- \nfrom lazagne.config.module_info import ModuleInfo\nfrom lazagne.config.constant import *\nfrom la"
},
{
"path": "Linux/lazagne/softwares/sysadmin/rclone.py",
"chars": 2621,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# This code has been taken from https://github.com/maaaaz/rclonedeobscure"
},
{
"path": "Linux/lazagne/softwares/sysadmin/shadow.py",
"chars": 3227,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport crypt\nimport os\n\nfrom lazagne.config.module_info import ModuleInfo\n"
},
{
"path": "Linux/lazagne/softwares/sysadmin/ssh.py",
"chars": 3271,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\n\nfrom lazagne.config.module_info import ModuleInfo\nfrom lazagne."
},
{
"path": "Linux/lazagne/softwares/wallet/__init__.py",
"chars": 24,
"preview": "# -*- coding: utf-8 -*-\n"
},
{
"path": "Linux/lazagne/softwares/wallet/kde.py",
"chars": 2012,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\n#######################\n#\n# By Quentin HARDY\n#\n#######################\n\n"
},
{
"path": "Linux/lazagne/softwares/wallet/libsecret.py",
"chars": 3496,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom lazagne.config.constant import constant\nfrom lazagne.config.module_in"
},
{
"path": "Linux/lazagne/softwares/wifi/__init__.py",
"chars": 24,
"preview": "# -*- coding: utf-8 -*-\n"
},
{
"path": "Linux/lazagne/softwares/wifi/wifi.py",
"chars": 1246,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\nimport os\n\nfrom lazagne.config.module_info import ModuleInfo\n\n\ntry:\n "
},
{
"path": "Linux/lazagne/softwares/wifi/wpa_supplicant.py",
"chars": 1534,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\n#######################\n#\n# By rpesche\n#\n#######################\n\nimport"
},
{
"path": "Linux/lazagne.spec",
"chars": 665,
"preview": "# -*- mode: python ; coding: utf-8 -*-\n\n\na = Analysis(\n ['laZagne.py'],\n pathex=[],\n binaries=[],\n datas=[],"
},
{
"path": "Mac/hook-sys.py",
"chars": 504,
"preview": "from lazagne.config.manage_modules import get_modules_names\nfrom lazagne.softwares.browsers.chromium_browsers import chr"
},
{
"path": "Mac/laZagne.py",
"chars": 9718,
"preview": "# -*- coding: utf-8 -*- \n# !/usr/bin/python\n\n###########################################################################"
},
{
"path": "Mac/lazagne/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Mac/lazagne/config/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Mac/lazagne/config/constant.py",
"chars": 981,
"preview": "# -*- coding: utf-8 -*- \n# !/usr/bin/python\n\nimport time\n\ndate = time.strftime(\"%d%m%Y_%H%M%S\")\n\n\nclass constant():\n "
},
{
"path": "Mac/lazagne/config/crypto/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Mac/lazagne/config/crypto/pyDes.py",
"chars": 32333,
"preview": "#############################################################################\n# Documentation "
},
{
"path": "Mac/lazagne/config/crypto/pyaes/__init__.py",
"chars": 2087,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Mac/lazagne/config/crypto/pyaes/aes.py",
"chars": 60310,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Mac/lazagne/config/crypto/pyaes/blockfeeder.py",
"chars": 8123,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Mac/lazagne/config/crypto/pyaes/util.py",
"chars": 2060,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Mac/lazagne/config/dico.py",
"chars": 9631,
"preview": "def get_dic():\n return [\n b\"password\",\n b\"123456\",\n b\"12345678\",\n b\"1234\",\n b\"qwer"
},
{
"path": "Mac/lazagne/config/manage_modules.py",
"chars": 1060,
"preview": "# -*- coding: utf-8 -*- \n# !/usr/bin/python\nfrom lazagne.config.soft_import_module import soft_import\nfrom lazagne.softw"
},
{
"path": "Mac/lazagne/config/module_info.py",
"chars": 1027,
"preview": "\"\"\"\nname => Name of a class\ncategory => windows / browsers / etc\noptions => dictionary\n- command\n- action\n- dest\n- help\n"
},
{
"path": "Mac/lazagne/config/run.py",
"chars": 4491,
"preview": "# -*- coding: utf-8 -*-\n# !/usr/bin/python\nimport subprocess\nimport traceback\nimport getpass\n\nfrom lazagne.config.consta"
},
{
"path": "Mac/lazagne/config/soft_import_module.py",
"chars": 1125,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom importlib import import_module\n\nfrom lazagne.config.module_info impo"
},
{
"path": "Mac/lazagne/config/write_output.py",
"chars": 11832,
"preview": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\nfrom lazagne.config.constant import constant\nfrom platform import uname\n"
},
{
"path": "Mac/lazagne/softwares/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Mac/lazagne/softwares/browsers/__init__.py",
"chars": 24,
"preview": "# -*- coding: utf-8 -*-\n"
},
{
"path": "Mac/lazagne/softwares/browsers/chrome.py",
"chars": 6012,
"preview": "# -*- coding: utf-8 -*- \n# !/usr/bin/python\n\n# Awesome work from @manwhoami\n# check the github repo: https://github.com/"
},
{
"path": "Mac/lazagne/softwares/browsers/firefox_browsers.py",
"chars": 711,
"preview": "from lazagne.config.soft_import_module import soft_import\n\n\nmozilla_based_module_location = \"lazagne.softwares.browsers."
},
{
"path": "Mac/lazagne/softwares/browsers/mozilla.py",
"chars": 21603,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# portable decryption functions and BSD DB parsing by Laurent Clevy (@lore"
},
{
"path": "Mac/lazagne/softwares/mails/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Mac/lazagne/softwares/mails/thunderbird.py",
"chars": 272,
"preview": "from lazagne.config.module_info import ModuleInfo\nfrom lazagne.softwares.browsers.mozilla import Mozilla\nimport os\n\nclas"
},
{
"path": "Mac/lazagne/softwares/system/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Mac/lazagne/softwares/system/chainbreaker.py",
"chars": 4866,
"preview": "# -*- coding: utf-8 -*- \n# !/usr/bin/python\n\n# Awesome work done by @n0fate\n# check the chainbreaker tool: https://githu"
},
{
"path": "Mac/lazagne/softwares/system/chainbreaker_module/Schema.py",
"chars": 11443,
"preview": "# http://web.mit.edu/darwin/src/modules/Security/cdsa/cdsa/cssmtype.h\nKEY_TYPE = {\n 0x00 + 0x0F: 'CSSM_KEYCLASS_PUBLI"
},
{
"path": "Mac/lazagne/softwares/system/chainbreaker_module/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Mac/lazagne/softwares/system/chainbreaker_module/chainbreaker.py",
"chars": 28924,
"preview": "#!/usr/bin/python\n\n# Author : n0fate\n# E-Mail rapfer@gmail.com, n0fate@n0fate.com\n#\n# This program is free software; you"
},
{
"path": "Mac/lazagne/softwares/system/chainbreaker_module/pbkdf2.py",
"chars": 1333,
"preview": "#!/usr/bin/python\n\n# A simple implementation of pbkdf2 using stock python modules. See RFC2898\n# for details. Basically,"
},
{
"path": "Mac/lazagne/softwares/system/hashdump.py",
"chars": 8499,
"preview": "# -*- coding: utf-8 -*- \n# !/usr/bin/python\n\n# Inspired from :\n# https://apple.stackexchange.com/questions/220729/what-t"
},
{
"path": "Mac/lazagne/softwares/system/system.py",
"chars": 400,
"preview": "# -*- coding: utf-8 -*- \n# !/usr/bin/python\n\nfrom lazagne.config.module_info import ModuleInfo\nfrom lazagne.config.const"
},
{
"path": "Mac/lazagne.spec",
"chars": 1245,
"preview": "# -*- mode: python ; coding: utf-8 -*-\nimport sys\nsys.path.append(\".\")\nfrom lazagne.config.manage_modules import get_mod"
},
{
"path": "README.md",
"chars": 5944,
"preview": "\n__The LaZagne Project !!!__\n==\n\nDescription\n----\nThe __LaZagne project__ is an open source application used to __retrie"
},
{
"path": "Windows/hook-sys.py",
"chars": 504,
"preview": "from lazagne.config.manage_modules import get_modules_names\nfrom lazagne.softwares.browsers.chromium_browsers import chr"
},
{
"path": "Windows/laZagne.py",
"chars": 9809,
"preview": "# -*- coding: utf-8 -*- \r\n# !/usr/bin/python\r\n\r\n########################################################################"
},
{
"path": "Windows/lazagne/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/config/DPAPI/__init__.py",
"chars": 2,
"preview": " \n"
},
{
"path": "Windows/lazagne/config/DPAPI/blob.py",
"chars": 5243,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCode based from these two awesome projects:\n- DPAPICK \t: https://bitb"
},
{
"path": "Windows/lazagne/config/DPAPI/credfile.py",
"chars": 3706,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCode based from these two awesome projects: \n- DPAPICK \t: https://bit"
},
{
"path": "Windows/lazagne/config/DPAPI/credhist.py",
"chars": 4351,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCode based from these two awesome projects: \n- DPAPICK \t: https://bit"
},
{
"path": "Windows/lazagne/config/DPAPI/crypto.py",
"chars": 15281,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#########################################################################"
},
{
"path": "Windows/lazagne/config/DPAPI/eater.py",
"chars": 4466,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#########################################################################"
},
{
"path": "Windows/lazagne/config/DPAPI/masterkey.py",
"chars": 18618,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCode based from these two awesome projects: \n- DPAPICK : https://bitb"
},
{
"path": "Windows/lazagne/config/DPAPI/system.py",
"chars": 957,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCode based from these two awesome projects: \n- DPAPICK \t: https://bit"
},
{
"path": "Windows/lazagne/config/DPAPI/vault.py",
"chars": 17188,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCode based from these two awesome projects: \n- DPAPICK : https://bi"
},
{
"path": "Windows/lazagne/config/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/config/change_privileges.py",
"chars": 6433,
"preview": "# -*- coding: utf-8 -*-\n# Original code from https://github.com/joren485/PyWinPrivEsc/blob/master/RunAsSystem.py\n\nimport"
},
{
"path": "Windows/lazagne/config/constant.py",
"chars": 2104,
"preview": "# -*- coding: utf-8 -*- \r\nimport tempfile\r\nimport random\r\nimport string\r\nimport time\r\nimport os\r\n\r\ndate = time.strftime("
},
{
"path": "Windows/lazagne/config/crypto/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/config/crypto/md4.py",
"chars": 3501,
"preview": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# Copyright © 2019 James Seo <james@equiv.tech> (github.com/kangtastic)"
},
{
"path": "Windows/lazagne/config/crypto/pyDes.py",
"chars": 32239,
"preview": "#############################################################################\n# Documentation "
},
{
"path": "Windows/lazagne/config/crypto/pyaes/__init__.py",
"chars": 2087,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Windows/lazagne/config/crypto/pyaes/aes.py",
"chars": 60310,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Windows/lazagne/config/crypto/pyaes/blockfeeder.py",
"chars": 8123,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Windows/lazagne/config/crypto/pyaes/util.py",
"chars": 2060,
"preview": "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Richard Moore\n#\n# Permission is hereby granted, free of charge, to any pe"
},
{
"path": "Windows/lazagne/config/crypto/rc4.py",
"chars": 1537,
"preview": "# Thanks to g2jun for his RC4-Python project\n# Code from https://github.com/g2jun/RC4-Python\n\nfrom lazagne.config.winstr"
},
{
"path": "Windows/lazagne/config/dico.py",
"chars": 9631,
"preview": "def get_dic():\n return [\n b\"password\",\n b\"123456\",\n b\"12345678\",\n b\"1234\",\n b\"qwer"
},
{
"path": "Windows/lazagne/config/dpapi_structure.py",
"chars": 6539,
"preview": "#!/usr/bin/python\n# -*- coding: utf-8 -*- \nimport codecs\nimport os\n\nfrom lazagne.config.DPAPI.masterkey import MasterKey"
},
{
"path": "Windows/lazagne/config/execute_cmd.py",
"chars": 3715,
"preview": "# -*- coding: utf-8 -*-\r\n# !/usr/bin/python\r\nimport base64\r\nimport os\r\nimport subprocess\r\nimport re\r\n\r\nfrom lazagne.conf"
},
{
"path": "Windows/lazagne/config/lib/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/config/lib/memorpy/Address.py",
"chars": 3463,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/BaseProcess.py",
"chars": 1798,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nimport struct\n\nfrom .utils import *\n\n\n\"\"\" Base class for process not linke"
},
{
"path": "Windows/lazagne/config/lib/memorpy/LinProcess.py",
"chars": 11069,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/LinStructures.py",
"chars": 427,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nPROT_NONE = 0\nPROT_READ = 1\nPROT_WRITE = 2\nPROT_EXEC = 4\nPROT_PRIVATE = 8\n"
},
{
"path": "Windows/lazagne/config/lib/memorpy/Locator.py",
"chars": 3156,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/MemWorker.py",
"chars": 8318,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/OSXProcess.py",
"chars": 5948,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/Process.py",
"chars": 375,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nimport sys\nfrom .BaseProcess import *\nif sys.platform=='win32':\n from ."
},
{
"path": "Windows/lazagne/config/lib/memorpy/SunProcess.py",
"chars": 5069,
"preview": "# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or modify\n# it under the terms"
},
{
"path": "Windows/lazagne/config/lib/memorpy/WinProcess.py",
"chars": 11967,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/WinStructures.py",
"chars": 6155,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/__init__.py",
"chars": 1081,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/structures.py",
"chars": 155,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nimport sys\nif sys.platform==\"win32\":\n from .WinStructures import *\nelse"
},
{
"path": "Windows/lazagne/config/lib/memorpy/utils.py",
"chars": 3336,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/lib/memorpy/version.py",
"chars": 92,
"preview": "#!/usr/bin/env python\n# -*- coding: UTF8 -*-\n\nversion=(1,7)\nversion_string=\"%s.%s\"%version\n\n"
},
{
"path": "Windows/lazagne/config/lib/memorpy/wintools.py",
"chars": 1227,
"preview": "# Author: Nicolas VERDIER\n# This file is part of memorpy.\n#\n# memorpy is free software: you can redistribute it and/or m"
},
{
"path": "Windows/lazagne/config/manage_modules.py",
"chars": 4984,
"preview": "# Browsers\r\nfrom lazagne.config.soft_import_module import soft_import\r\nfrom lazagne.softwares.browsers.chromium_browsers"
},
{
"path": "Windows/lazagne/config/module_info.py",
"chars": 1447,
"preview": "\"\"\"\r\nname => Name of a class\r\ncategory => windows / browsers / etc\r\noptions => dictionary\r\n - command\r\n - action\r\n - des"
},
{
"path": "Windows/lazagne/config/run.py",
"chars": 10020,
"preview": "# -*- coding: utf-8 -*-\n# !/usr/bin/python\nimport ctypes\nimport logging\nimport sys\nimport traceback\n\nfrom lazagne.config"
},
{
"path": "Windows/lazagne/config/soft_import_module.py",
"chars": 1157,
"preview": "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n\r\nfrom importlib import import_module\r\n\r\nfrom lazagne.config.module_info"
},
{
"path": "Windows/lazagne/config/users.py",
"chars": 2920,
"preview": "# -*- coding: utf-8 -*-\n# !/usr/bin/python\nimport os\nimport ctypes\nimport sys\n\nfrom lazagne.config.winstructure import g"
},
{
"path": "Windows/lazagne/config/winstructure.py",
"chars": 21678,
"preview": "# Vault Structure has been taken from mimikatz\r\nfrom ctypes.wintypes import *\r\nfrom ctypes import *\r\n\r\nimport sys\r\nimpor"
},
{
"path": "Windows/lazagne/config/write_output.py",
"chars": 14433,
"preview": "# -*- coding: utf-8 -*-\nimport ctypes\nimport getpass\nimport json\nimport logging\nimport os\nimport socket\nimport sys\nimpor"
},
{
"path": "Windows/lazagne/softwares/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/softwares/browsers/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/softwares/browsers/chromium_based.py",
"chars": 11752,
"preview": "# -*- coding: utf-8 -*-\n\n# Thank you all for the Yandex browser support: \n# - https://github.com/AlessandroZ/LaZagne/iss"
},
{
"path": "Windows/lazagne/softwares/browsers/chromium_browsers.py",
"chars": 2157,
"preview": "from lazagne.config.soft_import_module import soft_import\r\n\r\n\r\nchromium_based_module_location = \"lazagne.softwares.brows"
},
{
"path": "Windows/lazagne/softwares/browsers/firefox_browsers.py",
"chars": 785,
"preview": "from lazagne.config.soft_import_module import soft_import\r\n\r\n\r\nmozilla_module_location = \"lazagne.softwares.browsers.moz"
},
{
"path": "Windows/lazagne/softwares/browsers/ie.py",
"chars": 6973,
"preview": "import hashlib\nimport subprocess\nimport traceback\n\nimport lazagne.config.winstructure as win\nfrom lazagne.config.module_"
},
{
"path": "Windows/lazagne/softwares/browsers/mozilla.py",
"chars": 21644,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# portable decryption functions and BSD DB parsing by Laurent Clevy (@lore"
},
{
"path": "Windows/lazagne/softwares/browsers/ucbrowser.py",
"chars": 856,
"preview": "# -*- coding: utf-8 -*-\nimport os\n\nfrom lazagne.config.constant import constant\nfrom lazagne.config.module_info import M"
},
{
"path": "Windows/lazagne/softwares/chats/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/softwares/chats/pidgin.py",
"chars": 908,
"preview": "# -*- coding: utf-8 -*- \nimport os\nfrom xml.etree.cElementTree import ElementTree\n\nfrom lazagne.config.constant import c"
},
{
"path": "Windows/lazagne/softwares/chats/psi.py",
"chars": 1969,
"preview": "# -*- coding: utf-8 -*- \nimport os\nfrom xml.etree.cElementTree import ElementTree\nfrom glob import glob\nfrom itertools i"
},
{
"path": "Windows/lazagne/softwares/chats/skype.py",
"chars": 5238,
"preview": "# -*- coding: utf-8 -*-\r\nimport binascii\r\nimport hashlib\r\nimport os\r\nimport struct\r\nfrom xml.etree.cElementTree import E"
},
{
"path": "Windows/lazagne/softwares/databases/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/softwares/databases/dbvis.py",
"chars": 2768,
"preview": "# -*- coding: utf-8 -*- \nimport array\nimport base64\nimport binascii\nimport hashlib\nimport os\nimport re\nfrom xml.etree.cE"
},
{
"path": "Windows/lazagne/softwares/databases/postgresql.py",
"chars": 1035,
"preview": "# -*- coding: utf-8 -*-\r\n\r\nimport os\r\n\r\nfrom lazagne.config.constant import constant\r\nfrom lazagne.config.module_info im"
},
{
"path": "Windows/lazagne/softwares/databases/robomongo.py",
"chars": 3903,
"preview": "# -*- coding: utf-8 -*- \nimport json\nimport os\n\nfrom lazagne.config.constant import constant\nfrom lazagne.config.module_"
},
{
"path": "Windows/lazagne/softwares/databases/sqldeveloper.py",
"chars": 7123,
"preview": "# -*- coding: utf-8 -*- \n\n# Passwords decryption for new verion have been taken from:\n# https://github.com/maaaaz/sqldev"
},
{
"path": "Windows/lazagne/softwares/databases/squirrel.py",
"chars": 929,
"preview": "# -*- coding: utf-8 -*- \nimport os\nfrom xml.etree.cElementTree import ElementTree\n\nfrom lazagne.config.constant import c"
},
{
"path": "Windows/lazagne/softwares/games/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/softwares/games/galconfusion.py",
"chars": 1812,
"preview": "# -*- coding: utf-8 -*-\n\nimport os\n\ntry: \n import _winreg as winreg\nexcept ImportError:\n import winreg\n\nimport laz"
},
{
"path": "Windows/lazagne/softwares/games/kalypsomedia.py",
"chars": 1312,
"preview": "# -*- coding: utf-8 -*- \nimport base64\nimport os\n\nfrom lazagne.config.constant import constant\nfrom lazagne.config.modul"
},
{
"path": "Windows/lazagne/softwares/games/roguestale.py",
"chars": 1362,
"preview": "# -*- coding: utf-8 -*- \nimport os\nimport re\nfrom xml.etree.cElementTree import ElementTree\n\nfrom lazagne.config.constan"
},
{
"path": "Windows/lazagne/softwares/games/turba.py",
"chars": 1760,
"preview": "# -*- coding: utf-8 -*-\n\nimport os\n\ntry: \n import _winreg as winreg\nexcept ImportError:\n import winreg\n\nimport laz"
},
{
"path": "Windows/lazagne/softwares/git/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/softwares/git/gitforwindows.py",
"chars": 2239,
"preview": "# -*- coding: utf-8 -*- \nimport os\n\ntry: \n from urlparse import urlparse, unquote\nexcept ImportError: \n from urlli"
},
{
"path": "Windows/lazagne/softwares/mails/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/softwares/mails/outlook.py",
"chars": 3646,
"preview": "# -*- coding: utf-8 -*-\ntry:\n import _winreg as winreg\nexcept ImportError:\n import winreg\n\nimport lazagne.config.w"
},
{
"path": "Windows/lazagne/softwares/mails/thunderbird_mails.py",
"chars": 495,
"preview": "from lazagne.config.soft_import_module import soft_import\n\nmozilla_module_location = \"lazagne.softwares.browsers.mozilla"
},
{
"path": "Windows/lazagne/softwares/maven/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "Windows/lazagne/softwares/maven/mavenrepositories.py",
"chars": 5696,
"preview": "# -*- coding: utf-8 -*-\nimport os\nfrom xml.etree import ElementTree\n\nfrom lazagne.config.constant import constant\nfrom l"
},
{
"path": "Windows/lazagne/softwares/memory/__init__.py",
"chars": 0,
"preview": ""
}
]
// ... and 62 more files (download for full content)
About this extraction
This page contains the full source code of the AlessandroZ/LaZagne GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 262 files (1.5 MB), approximately 619.8k tokens, and a symbol index with 1646 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.