Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Asset_Discovery_Offline
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yogesh.m
Asset_Discovery_Offline
Commits
4f11b785
Commit
4f11b785
authored
May 05, 2023
by
yogesh.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated by removing sql
parent
fb305bd9
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
11 additions
and
186 deletions
+11
-186
__pycache__/asset_actions.cpython-310.pyc
__pycache__/asset_actions.cpython-310.pyc
+0
-0
__pycache__/asset_actions.cpython-39.pyc
__pycache__/asset_actions.cpython-39.pyc
+0
-0
__pycache__/json_operations.cpython-39.pyc
__pycache__/json_operations.cpython-39.pyc
+0
-0
__pycache__/sniff.cpython-39.pyc
__pycache__/sniff.cpython-39.pyc
+0
-0
asset_actions.py
asset_actions.py
+0
-97
asset_discover_main.py
asset_discover_main.py
+0
-48
assets.json
assets.json
+1
-1
config.yaml
config.yaml
+1
-1
json_operations.py
json_operations.py
+5
-4
security-management-ui.py
security-management-ui.py
+2
-32
sniff.py
sniff.py
+0
-2
template/index.html
template/index.html
+2
-1
No files found.
__pycache__/asset_actions.cpython-310.pyc
deleted
100644 → 0
View file @
fb305bd9
File deleted
__pycache__/asset_actions.cpython-39.pyc
deleted
100644 → 0
View file @
fb305bd9
File deleted
__pycache__/json_operations.cpython-39.pyc
View file @
4f11b785
No preview for this file type
__pycache__/sniff.cpython-39.pyc
View file @
4f11b785
No preview for this file type
asset_actions.py
deleted
100644 → 0
View file @
fb305bd9
import
sqlite3
import
threading
import
requests
import
yaml
import
os
import
json
from
time
import
sleep
from
sys
import
platform
yamlfile
=
open
(
"config.yaml"
)
data
=
yaml
.
load
(
yamlfile
,
Loader
=
yaml
.
FullLoader
)
plant
=
data
[
"configuration"
][
"edge_device_location"
]
lock
=
threading
.
Lock
()
server_ip_address
=
data
[
"configuration"
][
"unifytwin_server_ip_address"
]
def
transmit_all_assets
():
dicc
=
{}
retry
=
0
try
:
if
platform
==
"linux"
or
platform
==
"linux2"
:
os
.
system
(
'sqlite3 cloned.db "DROP TABLE IF EXISTS inventory" |sqlite3 assets.db ".dump inventory"|sqlite3 cloned.db'
)
elif
platform
==
"darwin"
:
os
.
system
(
'sqlite3 cloned.db "DROP TABLE IF EXISTS inventory" |sqlite3 assets.db ".dump inventory"|sqlite3 cloned.db'
)
elif
platform
==
"win32"
:
os
.
system
(
'del cloned.db && copy assets.db cloned.db'
)
mydb
=
sqlite3
.
connect
(
"cloned.db"
,
check_same_thread
=
False
)
query
=
mydb
.
cursor
()
lock
.
acquire
()
lock
.
release
()
get_asset
=
'SELECT * FROM inventory;'
asset_list
=
query
.
execute
(
get_asset
)
.
fetchall
()
query
.
close
()
mydb
.
commit
()
mydb
.
close
()
#requests.get(server_ip_address, data=str(asset_list))
for
i
in
asset_list
:
dicc
[
i
[
0
]]
=
{}
dicc
[
i
[
0
]][
"name"
]
=
i
[
1
]
dicc
[
i
[
0
]][
"last_activity"
]
=
i
[
2
]
dicc
[
i
[
0
]][
"type"
]
=
i
[
3
]
dicc
[
i
[
0
]][
"protocols"
]
=
i
[
4
]
dicc
[
i
[
0
]][
"mac_address"
]
=
i
[
5
]
dicc
[
i
[
0
]][
"vendor"
]
=
i
[
6
]
dicc
[
i
[
0
]][
"firmware_version"
]
=
i
[
7
]
dicc
[
i
[
0
]][
"model"
]
=
i
[
8
]
dicc
[
i
[
0
]][
"operating system"
]
=
i
[
9
]
dicc
[
i
[
0
]][
"plant"
]
=
i
[
10
]
return
json
.
dumps
(
dicc
)
except
Exception
as
e
:
pass
def
periodic_transmit_all_assets
():
print
(
"here"
)
while
True
:
sleep
(
int
(
data
[
"configuration"
][
"transfer frequency"
]))
retry
=
0
try
:
if
platform
==
"linux"
or
platform
==
"linux2"
:
os
.
system
(
'sqlite3 cloned.db "DROP TABLE IF EXISTS inventory" |sqlite3 assets.db ".dump inventory"|sqlite3 cloned.db'
)
elif
platform
==
"darwin"
:
os
.
system
(
'sqlite3 cloned.db "DROP TABLE IF EXISTS inventory" |sqlite3 assets.db ".dump inventory"|sqlite3 cloned.db'
)
elif
platform
==
"win32"
:
os
.
system
(
'del cloned.db && copy assets.db cloned.db'
)
mydb
=
sqlite3
.
connect
(
"cloned.db"
,
check_same_thread
=
False
)
query
=
mydb
.
cursor
()
lock
.
acquire
()
lock
.
release
()
get_asset
=
'SELECT * FROM inventory;'
asset_list
=
query
.
execute
(
get_asset
)
.
fetchall
()
query
.
close
()
mydb
.
commit
()
mydb
.
close
()
requests
.
get
(
server_ip_address
,
data
=
str
(
asset_list
))
except
Exception
as
e
:
print
(
e
)
retry
=
retry
+
1
if
(
retry
<
3
):
periodic_transmit_all_assets
()
else
:
requests
.
get
(
server_ip_address
,
data
=
str
(
e
))
def
delete_all_assets
():
try
:
mydb
=
sqlite3
.
connect
(
"assets.db"
,
check_same_thread
=
False
)
query
=
mydb
.
cursor
()
statement
=
'DELETE FROM inventory;'
lock
.
acquire
()
lock
.
release
()
query
.
execute
(
statement
)
query
.
close
()
mydb
.
commit
()
mydb
.
close
()
except
:
delete_all_assets
()
return
asset_discover_main.py
deleted
100644 → 0
View file @
fb305bd9
from
sniff
import
start_sniff
import
sys
import
getopt
from
utilities
import
list_interfaces
as
li
import
asset_actions
global
k_
k_
=
{
'start'
:
None
,
'iface'
:
None
}
def
help
(
_exit_
=
False
):
print
(
"Usage:
%
s [OPTION]
\n
"
%
sys
.
argv
[
0
])
print
(
"
\t
--start
\t
Start sniff"
)
print
(
"
\t
-i
\t
Select Interface"
)
print
(
"
\t
--list_interfaces
\t
Select Interface"
)
print
(
"
\t
--transmit_assets
\t
Transmit all assets to Configured Server"
)
if
_exit_
:
sys
.
exit
()
def
main
():
global
k_
if
len
(
sys
.
argv
)
<
2
:
help
(
1
)
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"s:i:l:t:h:"
,[
"start"
,
"iface="
,
"list_interfaces"
,
"transmit_assets"
,
"help"
])
except
Exception
as
e
:
print
(
e
)
for
o
,
a
in
opts
:
if
o
==
'--start'
:
k_
[
'start'
]
=
1
if
o
==
'-i'
:
k_
[
'iface'
]
=
a
if
o
==
'--list_interfaces'
:
li
.
show_list
()
if
o
==
'--transmit_assets'
:
asset_actions
.
transmit_all_assets
()
if
o
==
'--help'
:
help
(
1
)
if
(
k_
[
'start'
]):
if
(
k_
[
'iface'
]):
start_sniff
(
k_
[
'iface'
])
else
:
help
(
1
)
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
assets.json
View file @
4f11b785
{
"192.168.1.178"
:
{
"last_activity"
:
"05-05-23 17:22:09"
,
"dev_type"
:
"netuitive"
,
"protocols"
:
"tcp:udp:modbus"
,
"mac"
:
"7c:76:35:6a:d4:84"
,
"vendor"
:
"Intel Corporate"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"74.125.200.188"
:
{
"last_activity"
:
"05-05-23 17:22:07"
,
"dev_type"
:
"HP Virtual Room Service"
,
"protocols"
:
"tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"142.250.205.227"
:
{
"last_activity"
:
"05-05-23 17:22:06"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"udp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"172.217.160.138"
:
{
"last_activity"
:
"05-05-23 17:19:39"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"udp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"162.19.234.38"
:
{
"last_activity"
:
"05-05-23 17:19:43"
,
"dev_type"
:
"Unknown"
,
"protocols"
:
"modbus:tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Unknown"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"142.250.193.174"
:
{
"last_activity"
:
"05-05-23 17:20:49"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"udp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"192.168.0.222"
:
{
"last_activity"
:
"05-05-23 17:20:45"
,
"dev_type"
:
"Domain Name Server"
,
"protocols"
:
"udp"
,
"mac"
:
"20:67:7c:de:26:04"
,
"vendor"
:
"Hewlett Packard Enterprise"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"142.250.195.142"
:
{
"last_activity"
:
"05-05-23 16:41:41"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"udp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"142.250.196.5"
:
{
"last_activity"
:
"05-05-23 16:41:42"
,
"dev_type"
:
"Unknown"
,
"protocols"
:
"modbus:tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Unknown"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"168.119.249.101"
:
{
"last_activity"
:
"05-05-23 17:22:09"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"172.217.166.99"
:
{
"last_activity"
:
"05-05-23 17:20:48"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"udp:tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"142.250.182.106"
:
{
"last_activity"
:
"05-05-23 17:20:45"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"udp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
}}
{
"192.168.1.178"
:
{
"last_activity"
:
"05-05-23 19:09:25"
,
"dev_type"
:
"Unknown"
,
"protocols"
:
"tcp:modbus"
,
"mac"
:
"7c:76:35:6a:d4:84"
,
"vendor"
:
"Intel Corporate"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"168.119.249.101"
:
{
"last_activity"
:
"05-05-23 19:09:24"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"54.167.180.57"
:
{
"last_activity"
:
"05-05-23 19:09:05"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"35.174.210.7"
:
{
"last_activity"
:
"05-05-23 19:09:06"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"162.19.234.38"
:
{
"last_activity"
:
"05-05-23 19:09:18"
,
"dev_type"
:
"Unknown"
,
"protocols"
:
"modbus:tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Unknown"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"3.225.129.254"
:
{
"last_activity"
:
"05-05-23 19:09:10"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"50.16.7.188"
:
{
"last_activity"
:
"05-05-23 19:09:24"
,
"dev_type"
:
"Unknown"
,
"protocols"
:
"modbus:tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Unknown"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
},
"108.159.15.29"
:
{
"last_activity"
:
"05-05-23 19:09:22"
,
"dev_type"
:
"http protocol over TLS/SSL"
,
"protocols"
:
"tcp"
,
"mac"
:
"7c:5a:1c:7f:6e:ef"
,
"vendor"
:
"Sophos Ltd"
,
"firmware"
:
"Unknown"
,
"model"
:
"Unknown"
,
"os"
:
"Unknown"
,
"plant"
:
"Dalmia Cement"
}}
\ No newline at end of file
\ No newline at end of file
config.yaml
View file @
4f11b785
configuration
:
configuration
:
threads
:
20
#number of threads to scan at once
threads
:
20
#number of threads to scan at once
transfer frequency
:
1
#how frequent the scan needs to be
transfer frequency
:
1
#how frequent the scan needs to be
unifytwin_server_ip_address
:
https://webhook.site/
244b0b77-e8f2-4a5b-9fb9-fd7f0e52e692
#Data will be sent back here
unifytwin_server_ip_address
:
https://webhook.site/
422d91cf-4c18-4728-b7a0-13f14898c4b1
#Data will be sent back here
edge_device_location
:
Dalmia Cement
edge_device_location
:
Dalmia Cement
null_loopback
:
False
null_loopback
:
False
interfaces
:
Wi-Fi
interfaces
:
Wi-Fi
...
...
json_operations.py
View file @
4f11b785
...
@@ -62,10 +62,11 @@ def update_last_activity_and_protocols(ip,prev_protocols,last_activity):
...
@@ -62,10 +62,11 @@ def update_last_activity_and_protocols(ip,prev_protocols,last_activity):
def
update_last_activity
(
ip
,
last_activity
):
def
update_last_activity
(
ip
,
last_activity
):
json_transmit_data
=
{}
json_transmit_data
=
{}
json_transmit_data
[
ip
]
=
{}
json_transmit_data
[
ip
]
=
{}
json_transmit_data
[
ip
][
"last_activity"
]
=
json_decoded
[
ip
][
"last_activity"
]
=
last_activity
if
(
json_decoded
[
ip
][
"last_activity"
]
!=
last_activity
):
write_into_json_file
(
json_decoded
)
json_transmit_data
[
ip
][
"last_activity"
]
=
json_decoded
[
ip
][
"last_activity"
]
=
last_activity
if
transmit_assets
:
write_into_json_file
(
json_decoded
)
requests
.
post
(
url
=
url
,
json
=
json_transmit_data
)
if
transmit_assets
:
requests
.
post
(
url
=
url
,
json
=
json_transmit_data
)
def
delete_asset
():
def
delete_asset
():
print
()
print
()
...
...
security-management-ui.py
View file @
4f11b785
...
@@ -3,7 +3,6 @@ import json
...
@@ -3,7 +3,6 @@ import json
import
sniff
import
sniff
import
multiprocessing
import
multiprocessing
from
utilities.list_interfaces
import
get_interfaces
from
utilities.list_interfaces
import
get_interfaces
import
asset_actions
import
yaml
import
yaml
app
=
Flask
(
__name__
,
template_folder
=
'template'
)
app
=
Flask
(
__name__
,
template_folder
=
'template'
)
...
@@ -30,7 +29,8 @@ def hello_world():
...
@@ -30,7 +29,8 @@ def hello_world():
headings
=
[
"name"
,
"last_activity"
,
"type"
,
"protocols"
,
"mac_addr"
,
"vendor"
,
"firmware_version"
,
"model"
,
"os"
,
headings
=
[
"name"
,
"last_activity"
,
"type"
,
"protocols"
,
"mac_addr"
,
"vendor"
,
"firmware_version"
,
"model"
,
"os"
,
"plant"
]
"plant"
]
try
:
try
:
data
=
json
.
loads
(
asset_actions
.
transmit_all_assets
())
with
open
(
"assets.json"
)
as
json_file
:
data
=
json
.
load
(
json_file
)
except
:
except
:
data
=
{}
data
=
{}
return
render_template
(
"index.html"
,
headings
=
headings
,
data
=
data
,
interfaces
=
get_interfaces
(),
status
=
status
,
transfer_status
=
transfer_status
)
return
render_template
(
"index.html"
,
headings
=
headings
,
data
=
data
,
interfaces
=
get_interfaces
(),
status
=
status
,
transfer_status
=
transfer_status
)
...
@@ -65,37 +65,7 @@ def stop_sniff():
...
@@ -65,37 +65,7 @@ def stop_sniff():
def
refresh
():
def
refresh
():
return
hello_world
()
return
hello_world
()
@
app
.
route
(
'/delete_devices'
,
methods
=
[
'POST'
,
'GET'
])
def
delete
():
asset_actions
.
delete_all_assets
()
return
hello_world
()
@
app
.
route
(
'/start_transfer'
,
methods
=
[
'POST'
,
'GET'
])
def
transfer_data
():
global
transfer_status
global
periodic_transfer
transfer_status
=
"transmitting"
periodic_transfer
=
multiprocessing
.
Process
(
target
=
asset_actions
.
periodic_transmit_all_assets
,
args
=
())
if
(
periodic_transfer
.
is_alive
()):
periodic_transfer
.
kill
()
periodic_transfer
.
start
()
else
:
periodic_transfer
.
start
()
return
hello_world
()
@
app
.
route
(
'/stop_transfer'
,
methods
=
[
'POST'
,
'GET'
])
def
stop_transfer_data
():
global
transfer_status
global
periodic_transfer
if
(
periodic_transfer
):
if
(
periodic_transfer
.
is_alive
()):
periodic_transfer
.
kill
()
transfer_status
=
"not transmitting"
else
:
transfer_status
=
"not transmitting"
else
:
transfer_status
=
"not transmitting"
return
hello_world
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
app
.
run
(
debug
=
True
,
host
=
ui_host
,
port
=
ui_port
)
app
.
run
(
debug
=
True
,
host
=
ui_host
,
port
=
ui_port
)
sniff.py
View file @
4f11b785
...
@@ -63,10 +63,8 @@ def convert_text(pkt):
...
@@ -63,10 +63,8 @@ def convert_text(pkt):
prev_protocols
=
prev_protocols
+
':'
+
str
(
extra_proto
)
.
replace
(
", "
,
":"
)
.
replace
(
"{"
,
""
)
.
replace
(
"}"
,
""
)
.
replace
(
"'"
,
""
)
prev_protocols
=
prev_protocols
+
':'
+
str
(
extra_proto
)
.
replace
(
", "
,
":"
)
.
replace
(
"{"
,
""
)
.
replace
(
"}"
,
""
)
.
replace
(
"'"
,
""
)
if
(
dev_type
!=
"Unknown"
):
if
(
dev_type
!=
"Unknown"
):
jo
.
update_asset
(
ip
,
prev_protocols
,
datetime
.
now
()
.
strftime
(
"
%
d-
%
m-
%
y
%
H:
%
M:
%
S"
),
dev_type
,
vendor
,
firmware
,
model
)
jo
.
update_asset
(
ip
,
prev_protocols
,
datetime
.
now
()
.
strftime
(
"
%
d-
%
m-
%
y
%
H:
%
M:
%
S"
),
dev_type
,
vendor
,
firmware
,
model
)
else
:
else
:
jo
.
update_last_activity_and_protocols
(
ip
,
prev_protocols
,
datetime
.
now
()
.
strftime
(
"
%
d-
%
m-
%
y
%
H:
%
M:
%
S"
))
jo
.
update_last_activity_and_protocols
(
ip
,
prev_protocols
,
datetime
.
now
()
.
strftime
(
"
%
d-
%
m-
%
y
%
H:
%
M:
%
S"
))
else
:
else
:
jo
.
update_last_activity
(
ip
,
datetime
.
now
()
.
strftime
(
"
%
d-
%
m-
%
y
%
H:
%
M:
%
S"
))
jo
.
update_last_activity
(
ip
,
datetime
.
now
()
.
strftime
(
"
%
d-
%
m-
%
y
%
H:
%
M:
%
S"
))
except
sqlite3
.
OperationalError
as
e
:
except
sqlite3
.
OperationalError
as
e
:
...
...
template/index.html
View file @
4f11b785
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
</head>
</head>
<body>
<body>
<form
action =
"
http://127.0.0.1:8080
/start_sniff"
method =
"POST"
>
<form
action =
"/start_sniff"
method =
"POST"
>
<label
id=
"iface"
for=
"interface"
>
Choose an Interface:
</label>
<label
id=
"iface"
for=
"interface"
>
Choose an Interface:
</label>
<select
name=
"interface"
id=
"interface"
>
<select
name=
"interface"
id=
"interface"
>
{% for interface in interfaces %}
{% for interface in interfaces %}
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
</tr>
</tr>
{% for key in data %}
{% for key in data %}
<tr
class=
"row"
>
<tr
class=
"row"
>
<td>
{{key}}
</td>
{% for val in data[key] %}
{% for val in data[key] %}
<td>
{{data[key][val]}}
</td>
<td>
{{data[key][val]}}
</td>
{% endfor %}
{% endfor %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment