-
Notifications
You must be signed in to change notification settings - Fork 10
Added certificates parsing, Python Flask web viewer and update requir… #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
x4v1l0k
wants to merge
5
commits into
r4ulcl:dev
Choose a base branch
from
x4v1l0k:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
076f081
Added certificates parsing, Python Flask web viewer and update requir…
42d3850
Added -i and -p parameters to specify the ip and port on which to ser…
3afdb58
Review the Codacy tab and fix the issues
0d1f44f
Update VERSION
f1831b6
Review the new Codacy issues and fixed them
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ nest_asyncio==1.5.8 | |
| pyshark==0.6 | ||
| Requests==2.32.3 | ||
| pytest==8.2.2 | ||
| Flask==3.0.3 | ||
| pandas==1.5.3 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
| <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> | ||
| <title>Wifi_db Viewer</title> | ||
| <style> | ||
| .tab-pane { | ||
| overflow: scroll; | ||
| } | ||
|
|
||
| .table tbody tr.highlight td { | ||
| background-color: lightblue; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="container-fluid"> | ||
| <h1 class="mt-4 mb-4">Wifi_db Viewer</h1> | ||
| <ul class="nav nav-tabs" id="tab" role="tablist"> | ||
| {% for table in tables %} | ||
| <li class="nav-item" role="presentation"> | ||
| <button class="nav-link {% if loop.first %}active{% endif %}" id="{{ table }}-tab" data-bs-toggle="tab" data-bs-target="#{{ table }}" type="button" role="tab" aria-controls="{{ table }}" aria-selected="true">{{ table }}</button> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| <div class="tab-content mt-3" id="tableContent"> | ||
| {% for table, data in table_data.items() %} | ||
| <div class="tab-pane fade {% if loop.first %}show active{% endif %}" id="{{ table }}" role="tabpanel" aria-labelledby="{{ table }}-tab"> | ||
| <input class="form-control mb-3" id="searchInput{{ loop.index }}" type="text" placeholder="Search in {{ table }}"> | ||
| <table class="table table-bordered table-hover"> | ||
| <thead class="table-light"> | ||
| <tr> | ||
| {% for column in data.columns %} | ||
| <th>{{ column }}</th> | ||
| {% endfor %} | ||
| </tr> | ||
| </thead> | ||
| <tbody id="tableBody{{ loop.index }}"> | ||
| {% for row in data.itertuples(index=False) %} | ||
| <tr> | ||
| {% for value in row %} | ||
| <td>{{ value }}</td> | ||
| {% endfor %} | ||
| </tr> | ||
| {% endfor %} | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> | ||
|
|
||
| <script> | ||
| document.addEventListener("DOMContentLoaded", function() { | ||
| {% for table in tables %} | ||
| document.getElementById('searchInput{{ loop.index }}').addEventListener('keyup', function() { | ||
| var value = this.value.toLowerCase(); | ||
| var rows = document.querySelectorAll("#tableBody{{ loop.index }} tr"); | ||
| rows.forEach(function(row) { | ||
| row.style.display = row.innerText.toLowerCase().includes(value) ? "" : "none"; | ||
| }); | ||
| }); | ||
| {% endfor %} | ||
| const rows = document.querySelectorAll('tbody tr'); | ||
|
|
||
| rows.forEach(function(row) { | ||
| row.addEventListener('click', function() { | ||
| rows.forEach(function(r) { | ||
| r.classList.remove('highlight'); | ||
| }); | ||
| this.classList.add('highlight'); | ||
| }); | ||
| }); | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/bin/python3 | ||
| ''' Utils to Web Viewer ''' | ||
| # -*- coding: utf-8 -*- | ||
| import sqlite3 | ||
| from flask import Flask, render_template | ||
| import pandas as pd | ||
| from os import path | ||
|
|
||
| def start(db_path, host, port): | ||
| template_dir = path.join(path.dirname(path.abspath(__file__)), '..', 'templates') | ||
| app = Flask(__name__, template_folder=template_dir) | ||
|
|
||
| @app.route('/') | ||
| def index(): | ||
| conn = sqlite3.connect(db_path) | ||
| cursor = conn.cursor() | ||
|
|
||
| # Get table names | ||
| cursor.execute("SELECT name FROM sqlite_master WHERE type='table';") | ||
| tables = [table[0] for table in cursor.fetchall()] | ||
|
|
||
| # Retrieve table data | ||
| table_data = {} | ||
| for table in tables: | ||
| if table.isidentifier(): | ||
| df = pd.read_sql_query(f"SELECT * FROM {table}", conn) | ||
| table_data[table] = df | ||
|
|
||
| conn.close() | ||
| return render_template('index.html', tables=tables, table_data=table_data) | ||
|
|
||
| app.run(host=host, port=port) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information