{"id":16655189,"url":"https://github.com/franckferman/lastlog-audit","last_synced_at":"2025-04-19T13:57:00.347Z","repository":{"id":54095298,"uuid":"522008286","full_name":"franckferman/LastLog-Audit","owner":"franckferman","description":"A Python tool to analyze and export login activity from /var/log/lastlog for security.","archived":false,"fork":false,"pushed_at":"2025-03-12T13:46:58.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"stable","last_synced_at":"2025-03-29T08:24:30.608Z","etag":null,"topics":["forensic","forensic-tools","forensics","forensics-tools","lastlog","lastlogin","lastlogontimestamp","linux","linux-logs","linux-python","linux-security","linux-security-audit","logs","logs-analysis","parser-python","python","python-3","python-linux","python-linux-audit","python3"],"latest_commit_sha":null,"homepage":"https://github.com/franckferman/LastLog-Audit","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/franckferman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-06T17:13:49.000Z","updated_at":"2025-03-12T13:47:01.000Z","dependencies_parsed_at":"2024-04-05T02:10:45.227Z","dependency_job_id":"0301a1b8-f39f-401f-995c-d1b5f71dcfd6","html_url":"https://github.com/franckferman/LastLog-Audit","commit_stats":null,"previous_names":["franckferman/lastlog-audit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2FLastLog-Audit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2FLastLog-Audit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2FLastLog-Audit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2FLastLog-Audit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franckferman","download_url":"https://codeload.github.com/franckferman/LastLog-Audit/tar.gz/refs/heads/stable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249708448,"owners_count":21313940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forensic","forensic-tools","forensics","forensics-tools","lastlog","lastlogin","lastlogontimestamp","linux","linux-logs","linux-python","linux-security","linux-security-audit","logs","logs-analysis","parser-python","python","python-3","python-linux","python-linux-audit","python3"],"created_at":"2024-10-12T09:52:12.860Z","updated_at":"2025-04-19T13:57:00.328Z","avatar_url":"https://github.com/franckferman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv id=\"top\" align=\"center\"\u003e\r\n\r\n\u003c!-- Shields Header --\u003e\r\n[![Contributors][contributors-shield]](https://github.com/franckferman/LastLog-Audit/graphs/contributors)\r\n[![Stargazers][stars-shield]](https://github.com/franckferman/LastLog-Audit/stargazers)\r\n[![License][license-shield]](https://github.com/franckferman/LastLog-Audit/blob/stable/LICENSE)\r\n\r\n\u003c!-- Logo --\u003e\r\n\u003ca href=\"https://github.com/franckferman/LastLog-Audit\"\u003e\r\n  \u003cimg src=\"https://raw.githubusercontent.com/franckferman/LastLog-Audit/refs/heads/stable/docs/github/graphical_resources/Logo-without_background-LastLog-Audit.png\" alt=\"LastLog-Audit Logo\" width=\"auto\" height=\"auto\"\u003e\r\n\u003c/a\u003e\r\n\r\n\u003c!-- Title \u0026 Tagline --\u003e\r\n\u003ch3 align=\"center\"\u003e🧭 LastLog-Audit\u003c/h3\u003e\r\n\u003cp align=\"center\"\u003e\r\n    \u003cem\u003eAnalyzing system login activities.\u003c/em\u003e\r\n    \u003cbr\u003e\r\n    A Python tool to analyze and export login activity from /var/log/lastlog for security.\r\n\u003c/p\u003e\r\n\r\n\u003c/div\u003e\r\n\r\n## 📜 Table of Contents\r\n\r\n\u003cdetails open\u003e\r\n  \u003csummary\u003e\u003cstrong\u003eClick to collapse/expand\u003c/strong\u003e\u003c/summary\u003e\r\n  \u003col\u003e\r\n    \u003cli\u003e\u003ca href=\"#-about\"\u003e📖 About\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#-installation\"\u003e🛠️ Installation\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#-usage\"\u003e🎮 Usage\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#-contributing\"\u003e🤝 Contributing\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#-license\"\u003e📜 License\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#-contact\"\u003e📞 Contact\u003c/a\u003e\u003c/li\u003e\r\n  \u003c/ol\u003e\r\n\u003c/details\u003e\r\n\r\n## 📖 About\r\n\r\n**LastLog-Audit** is a lightweight Python tool designed to **parse and analyze system login activity** stored in `/var/log/lastlog`.\r\n\r\nOriginally built for personal use and professional system audits, this tool offers **customizable output** (table/line) and **export options (TXT/CSV)** for easy reporting, tracking, and compliance.\r\n\r\n\u003e ⚙️ **Note:** LastLog-Audit is a simple, focused tool — perfect for quick audits and reviews.\r\n\r\n### ⚙️ **Features of _LastLog-Audit_**\r\n\r\n- ✅ Parse `/var/log/lastlog` and extract login records (terminal, hostname, last login date).\r\n- ✅ Optionally **include usernames** mapped via system UID.\r\n- ✅ **Multiple output modes**: clean **table view** or **line output** (easy for grep/awk parsing).\r\n- ✅ **Export to TXT or CSV** formats for archiving and sharing reports.\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003e🔼 Back to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n## 🚀 Installation\r\n\r\nBefore getting started, make sure you meet the following prerequisites.\r\n\r\n### Prerequisites\r\n\r\n1. **Python 3**: Ensure Python 3 is installed on your system.\r\n\r\n2. **Dependencies**: No external libraries required.\r\n\r\nLastLog-Audit relies **only on Python's standard library** — ready to use out-of-the-box on any modern Linux system (Python 3.7+).\r\n\r\n\u003e ⚙️ Optional: For Python 3.6 support, you may install the backport of `dataclasses` via `pip install dataclasses`.\r\n\r\n\u003e ⚠️ Note: LastLog-Audit has been tested on Python 3.11.10 under Linux. While it might work on other versions or operating systems, compatibility is officially guaranteed only for this specific setup.\r\n\r\n### Installation Methods\r\n\r\n1. **Clone the repository via Git**:\r\n```bash\r\ngit clone https://github.com/franckferman/LastLog-Audit.git\r\n```\r\n\r\n2. **Direct download of the script (_without Git_)**:\r\nIf you only need the script without cloning the entire repository:\r\n```bash\r\ncurl -O https://raw.githubusercontent.com/franckferman/LastLog-Audit/stable/src/LastLog-Audit.py\r\n```\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003e🔼 Back to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n## 🎮 Usage\r\n\r\nMake sure to adjust the commands based on your setup.\r\n\r\n### **Basic usage**\r\n\r\nTo display the full help menu and explore available options:\r\n\r\n```bash\r\npython3 LastLog-Audit.py --help\r\n```\r\n\r\n### 📝 **Example Commands**\r\n\r\n| Task | Command |\r\n| --- | --- |\r\n| Parse and display lastlog in a table | `python3 LastLogAudit.py` |\r\n| Show logins in a simple line format | `python3 LastLogAudit.py --display line` |\r\n| Include usernames (if available) | `python3 LastLogAudit.py --include-username` |\r\n| Export to CSV | `python3 LastLogAudit.py --export output.csv --export-format csv` |\r\n| Export to TXT (table format) | `python3 LastLogAudit.py --export output.txt` |\r\n| Parse a custom lastlog file | `python3 LastLogAudit.py --file /path/to/custom_lastlog` |\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003e🔼 Back to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n## 🤝 Contributing\r\n\r\nWe truly appreciate and welcome community involvement. Your contributions, feedback, and suggestions play a crucial role in improving the project for everyone. If you're interested in contributing or have ideas for enhancements, please feel free to open an issue or submit a pull request on our GitHub repository. Every contribution, no matter how big or small, is highly valued and greatly appreciated!\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003e🔼 Back to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n## 📚 License\r\n\r\nThis project is licensed under the GNU Affero General Public License, Version 3.0. For more details, please refer to the LICENSE file in the repository: [Read the license on GitHub](https://github.com/franckferman/LastLog-Audit/blob/stable/LICENSE)\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003e🔼 Back to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n## 📞 Contact\r\n\r\n[![ProtonMail][protonmail-shield]](mailto:contact@franckferman.fr)\r\n[![LinkedIn][linkedin-shield]](https://www.linkedin.com/in/franckferman)\r\n[![Twitter][twitter-shield]](https://www.twitter.com/franckferman)\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003e🔼 Back to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\r\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\r\n[contributors-shield]: https://img.shields.io/github/contributors/franckferman/LastLog-Audit.svg?style=for-the-badge\r\n[contributors-url]: https://github.com/franckferman/LastLog-Audit/graphs/contributors\r\n[stars-shield]: https://img.shields.io/github/stars/franckferman/LastLog-Audit.svg?style=for-the-badge\r\n[stars-url]: https://github.com/franckferman/LastLog-Audit/stargazers\r\n[license-shield]: https://img.shields.io/github/license/franckferman/LastLog-Audit.svg?style=for-the-badge\r\n[license-url]: https://github.com/franckferman/LastLog-Audit/blob/stable/LICENSE\r\n[protonmail-shield]: https://img.shields.io/badge/ProtonMail-8B89CC?style=for-the-badge\u0026logo=protonmail\u0026logoColor=blueviolet\r\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=blue\r\n[twitter-shield]: https://img.shields.io/badge/-Twitter-black.svg?style=for-the-badge\u0026logo=twitter\u0026colorB=blue\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranckferman%2Flastlog-audit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranckferman%2Flastlog-audit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranckferman%2Flastlog-audit/lists"}