Network Analyzer
|
Defines a Sniffer class. More...
Public Member Functions | |
def | __init__ (self, tabs) |
The Sniffer class initializer. More... | |
def | add_feedback (self, feedback_text) |
Appends feedback to user of current activity. More... | |
def | add_table_entry (self, pkt) |
Function than takes fields from the packet and adds entries to a table. More... | |
def | clear_table (self) |
Clears table network capture table entries. More... | |
def | get_host_name (self, ip) |
Function that resolves given IP address to a host name. More... | |
def | interface_selected (self) |
Sets selected interface (network card) More... | |
def | open_pcap (self) |
Opens file dialog to select file to be opened within application (.pcap). More... | |
def | plot_bar_chart (self) |
Creates Bar chart from loaded data from captures. More... | |
def | plot_pie_chart (self) |
Creates Pie chart from loaded data from captures. More... | |
def | populate_filter_options (self) |
Populates gathered data from database in a filter options dropdown field. More... | |
def | save_pcap (self) |
Opens file dialog to select file to be saved OR creates new file with a capture (.pcap). More... | |
def | set_filter (self) |
Sets current filter option within filter field. More... | |
def | sniff_thread (self, a) |
Function that is run in a separate thread. More... | |
def | start_sniff (self) |
Function that is activated when RUN button is pressed. More... | |
def | statistics (self) |
Organizes captured data by frequency and presents to user in readable manner. More... | |
def | stop_sniff (self) |
Function that stops network capture. More... | |
def | stop_sniffing (self, a) |
Function that is used by Scapy sniff function. More... | |
def | table_row_item_selected (self) |
On a row selected within capture table, displays details of a packet selected within details field. More... | |
def | update_filter_options_table (self) |
Inserts NOT present item to database (filter options) More... | |
Public Attributes | |
btn_clear | |
Initializes clear button. More... | |
btn_clear_text | |
Sets filter button text. More... | |
btn_graph | |
Initializes clear button. More... | |
btn_graph_text | |
Sets clear button text. More... | |
btn_offset | |
Sets offset for buttons. More... | |
btn_open | |
Initializes open button. More... | |
btn_open_text | |
Sets open button text. More... | |
btn_pie | |
Initializes clear button. More... | |
btn_pie_text | |
Sets clear button text. More... | |
btn_run | |
Initializes run button. More... | |
btn_run_text | |
Sets run button text. More... | |
btn_save | |
Initializes save button. More... | |
btn_save_text | |
Sets save button text. More... | |
btn_stop | |
Initializes stop button. More... | |
btn_stop_text | |
Sets stop button text. More... | |
details_field | |
Initializes field for packets details. More... | |
dropdown_if_selection | |
Current interface selection default is None. More... | |
dropdown_interfaces | |
Initializes dropdown combo box for interfaces. More... | |
feedback_field | |
Initializes field for feedback text. More... | |
filter_input_combobox | |
Initializes dropdown combo box for filters. More... | |
filter_option | |
Initializes filter options to None. More... | |
host_name_checkbox | |
Checkbox that that allows host name mapping. More... | |
interfaces | |
Gets interfaces from underlying operating system. More... | |
is_filter_wrong | |
Initializes boolean for a filter option if it is wrong default is False. More... | |
is_running | |
Status of sniffer default is False. More... | |
layout | |
Creates layout that will be used for a tab. More... | |
packets_count | |
Initializes packets captired to None. More... | |
progress_label | |
Initializes label for amount of packets captured. More... | |
raw_field | |
Initializes field for raw text. More... | |
sniffer_results | |
Initializes variable for captured results from sniff function. More... | |
sniffer_tab | |
Creates tab that will be returned. More... | |
sniffer_thread | |
Initializes thread for a sniffer (sniff function runs in its own thread) More... | |
source_ips | |
variable that stores source ips for statistics More... | |
table | |
Creates table for network capture results. More... | |
Defines a Sniffer class.
The Sniffer class is responsible for all components that is capable to capture network traffic and displaying result to user. Within application data can be filtered by type. Capture files can be saved and opened within application.
Copyright (c) 2022 by Erlandas Bacauskas is licensed under CC BY-NC-SA 4.0. To view copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/
def __init__ | ( | self, | |
tabs | |||
) |
def add_feedback | ( | self, | |
feedback_text | |||
) |
Appends feedback to user of current activity.
feedback_text | String that will be displayed within feedback field |
def add_table_entry | ( | self, | |
pkt | |||
) |
Function than takes fields from the packet and adds entries to a table.
pkt | Captured packet that is dissected |
def clear_table | ( | self | ) |
Clears table network capture table entries.
Activated when clear button pressed.
def get_host_name | ( | self, | |
ip | |||
) |
Function that resolves given IP address to a host name.
ip | IP address to resolve |
def interface_selected | ( | self | ) |
Sets selected interface (network card)
def open_pcap | ( | self | ) |
Opens file dialog to select file to be opened within application (.pcap).
def plot_bar_chart | ( | self | ) |
Creates Bar chart from loaded data from captures.
def plot_pie_chart | ( | self | ) |
Creates Pie chart from loaded data from captures.
def populate_filter_options | ( | self | ) |
Populates gathered data from database in a filter options dropdown field.
def save_pcap | ( | self | ) |
Opens file dialog to select file to be saved OR creates new file with a capture (.pcap).
def set_filter | ( | self | ) |
Sets current filter option within filter field.
Activated when set filter button is pressed.
def sniff_thread | ( | self, | |
a | |||
) |
Function that is run in a separate thread.
Captures network packets.
def start_sniff | ( | self | ) |
Function that is activated when RUN button is pressed.
Starts network capture.
def statistics | ( | self | ) |
Organizes captured data by frequency and presents to user in readable manner.
def stop_sniff | ( | self | ) |
Function that stops network capture.
Activated when stop button pressed.
def stop_sniffing | ( | self, | |
a | |||
) |
Function that is used by Scapy sniff function.
After each packet capture checks if sniffing still should be active.
def table_row_item_selected | ( | self | ) |
On a row selected within capture table, displays details of a packet selected within details field.
def update_filter_options_table | ( | self | ) |
Inserts NOT present item to database (filter options)
btn_clear |
Initializes clear button.
btn_clear_text |
Sets filter button text.
Initializes set filter button Sets clear button text
btn_graph |
Initializes clear button.
btn_graph_text |
Sets clear button text.
btn_offset |
Sets offset for buttons.
btn_open |
Initializes open button.
btn_open_text |
Sets open button text.
btn_pie |
Initializes clear button.
btn_pie_text |
Sets clear button text.
btn_run |
Initializes run button.
btn_run_text |
Sets run button text.
btn_save |
Initializes save button.
btn_save_text |
Sets save button text.
btn_stop |
Initializes stop button.
btn_stop_text |
Sets stop button text.
details_field |
Initializes field for packets details.
dropdown_if_selection |
Current interface selection default is None.
dropdown_interfaces |
Initializes dropdown combo box for interfaces.
feedback_field |
Initializes field for feedback text.
filter_input_combobox |
Initializes dropdown combo box for filters.
filter_option |
Initializes filter options to None.
host_name_checkbox |
Checkbox that that allows host name mapping.
interfaces |
Gets interfaces from underlying operating system.
is_filter_wrong |
Initializes boolean for a filter option if it is wrong default is False.
is_running |
Status of sniffer default is False.
layout |
Creates layout that will be used for a tab.
packets_count |
Initializes packets captired to None.
progress_label |
Initializes label for amount of packets captured.
raw_field |
Initializes field for raw text.
sniffer_results |
Initializes variable for captured results from sniff function.
sniffer_tab |
Creates tab that will be returned.
sniffer_thread |
Initializes thread for a sniffer (sniff function runs in its own thread)
source_ips |
variable that stores source ips for statistics
table |
Creates table for network capture results.