lanscape 1.2.8a3__tar.gz → 1.2.9a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lanscape-1.2.8a3/src/lanscape.egg-info → lanscape-1.2.9a1}/PKG-INFO +1 -9
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/README.md +0 -8
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/pyproject.toml +1 -1
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/subnet_scan.py +16 -15
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/tests/test_library.py +1 -1
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/blueprints/api/scan.py +1 -1
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/blueprints/web/routes.py +1 -1
- {lanscape-1.2.8a3 → lanscape-1.2.9a1/src/lanscape.egg-info}/PKG-INFO +1 -9
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/LICENSE +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/MANIFEST.in +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/setup.cfg +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/__init__.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/__main__.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/app_scope.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/decorators.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/errors.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/ip_parser.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/logger.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/mac_lookup.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/net_tools.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/port_manager.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/runtime_args.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/libraries/version_manager.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/resources/mac_addresses/convert_csv.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/resources/mac_addresses/mac_db.json +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/resources/ports/convert_csv.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/resources/ports/full.json +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/resources/ports/large.json +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/resources/ports/medium.json +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/resources/ports/small.json +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/tests/__init__.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/tests/_helpers.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/tests/test_api.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/tests/test_env.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/app.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/blueprints/__init__.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/blueprints/api/__init__.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/blueprints/api/port.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/blueprints/api/tools.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/blueprints/web/__init__.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/main.py +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/css/style.css +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/android-chrome-192x192.png +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/android-chrome-512x512.png +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/apple-touch-icon.png +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/favicon-16x16.png +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/favicon-32x32.png +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/favicon.ico +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/site.webmanifest +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/js/core.js +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/js/layout-sizing.js +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/js/main.js +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/js/quietReload.js +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/js/shutdown-server.js +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/js/subnet-info.js +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/js/subnet-selector.js +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/lanscape.webmanifest +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/base.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/core/head.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/core/scripts.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/error.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/info.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/main.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/scan/export.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/scan/ip-table-row.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/scan/ip-table.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/scan/overview.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/scan/scan-error.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/scan.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/templates/shutdown.html +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape.egg-info/SOURCES.txt +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape.egg-info/dependency_links.txt +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape.egg-info/requires.txt +0 -0
- {lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lanscape
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.9a1
|
|
4
4
|
Summary: A python based local network scanner
|
|
5
5
|
Author-email: Michael Dennis <michael@dipduo.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mdennis281/py-lanscape
|
|
@@ -55,14 +55,6 @@ can sometimes require admin-level permissions to retrieve accurate results.
|
|
|
55
55
|
This is a missing dependency related to the ARP lookup. This is handled in the code, but you would get marginally faster/better results with this installed: [npcap download](https://npcap.com/#download)
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
### Unable to start webview client. Try --nogui (Linux)
|
|
59
|
-
Linux and QT (GUI package) dont seem to play well with each other very well. If you really want the gui (`python -m lanscape --nogui` is almost as good) I had success on ubuntu desktop by running these:
|
|
60
|
-
```sh
|
|
61
|
-
sudo apt install libcairo2-dev libxt-dev libgirepository1.0-dev
|
|
62
|
-
pip install pycairo PyGObject qtpy PyQt5 PyQtWebEngine
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
|
|
66
58
|
### Something else
|
|
67
59
|
Feel free to submit a github issue detailing your experience.
|
|
68
60
|
|
|
@@ -34,14 +34,6 @@ can sometimes require admin-level permissions to retrieve accurate results.
|
|
|
34
34
|
This is a missing dependency related to the ARP lookup. This is handled in the code, but you would get marginally faster/better results with this installed: [npcap download](https://npcap.com/#download)
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
### Unable to start webview client. Try --nogui (Linux)
|
|
38
|
-
Linux and QT (GUI package) dont seem to play well with each other very well. If you really want the gui (`python -m lanscape --nogui` is almost as good) I had success on ubuntu desktop by running these:
|
|
39
|
-
```sh
|
|
40
|
-
sudo apt install libcairo2-dev libxt-dev libgirepository1.0-dev
|
|
41
|
-
pip install pycairo PyGObject qtpy PyQt5 PyQtWebEngine
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
45
37
|
### Something else
|
|
46
38
|
Feel free to submit a github issue detailing your experience.
|
|
47
39
|
|
|
@@ -27,7 +27,14 @@ TCNT_DEVICE_ISALIVE = 256
|
|
|
27
27
|
class ScanConfig:
|
|
28
28
|
subnet: str
|
|
29
29
|
port_list: str
|
|
30
|
-
|
|
30
|
+
t_multiplier: float = 1.0
|
|
31
|
+
t_cnt_port_scan: int = 10
|
|
32
|
+
t_cnt_port_test: int = 128
|
|
33
|
+
t_cnt_isalive: int = 256
|
|
34
|
+
|
|
35
|
+
def t_cnt(self, id: str) -> int:
|
|
36
|
+
return int(int(getattr(self, f't_cnt_{id}')) * float(self.t_multiplier))
|
|
37
|
+
|
|
31
38
|
|
|
32
39
|
|
|
33
40
|
|
|
@@ -40,8 +47,9 @@ class SubnetScanner:
|
|
|
40
47
|
self.port_list = config.port_list
|
|
41
48
|
self.ports: list = PortManager().get_port_list(config.port_list).keys()
|
|
42
49
|
self.running = False
|
|
43
|
-
self.parallelism: float = float(config.parallelism)
|
|
44
50
|
self.subnet_str = config.subnet
|
|
51
|
+
|
|
52
|
+
self.cfg = config
|
|
45
53
|
self.job_stats = JobStats()
|
|
46
54
|
self.uid = str(uuid.uuid4())
|
|
47
55
|
self.results = ScannerResults(self)
|
|
@@ -58,7 +66,7 @@ class SubnetScanner:
|
|
|
58
66
|
"""
|
|
59
67
|
self._set_stage('scanning devices')
|
|
60
68
|
self.running = True
|
|
61
|
-
with ThreadPoolExecutor(max_workers=self.
|
|
69
|
+
with ThreadPoolExecutor(max_workers=self.cfg.t_cnt('isalive')) as executor:
|
|
62
70
|
futures = {executor.submit(self._get_host_details, str(ip)): str(ip) for ip in self.subnet}
|
|
63
71
|
for future in futures:
|
|
64
72
|
ip = futures[future]
|
|
@@ -104,7 +112,7 @@ class SubnetScanner:
|
|
|
104
112
|
remaining_isalive_sec = (self.results.devices_total - self.results.devices_scanned) * avg_host_detail_sec
|
|
105
113
|
total_isalive_sec = self.results.devices_total * avg_host_detail_sec
|
|
106
114
|
|
|
107
|
-
isalive_multiplier = self.
|
|
115
|
+
isalive_multiplier = self.cfg.t_cnt('isalive')
|
|
108
116
|
|
|
109
117
|
# --- Port scanning calculations ---
|
|
110
118
|
device_ports_scanned = self.job_stats.finished.get('_test_port', 0)
|
|
@@ -116,7 +124,7 @@ class SubnetScanner:
|
|
|
116
124
|
remaining_port_test_sec = device_ports_unscanned * avg_port_test_sec
|
|
117
125
|
total_port_test_sec = est_subnet_devices * len(self.ports) * avg_port_test_sec
|
|
118
126
|
|
|
119
|
-
port_test_multiplier = self.
|
|
127
|
+
port_test_multiplier = self.cfg.t_cnt('port_scan') * self.cfg.t_cnt('port_test')
|
|
120
128
|
|
|
121
129
|
# --- Overall progress ---
|
|
122
130
|
est_total_time = (total_isalive_sec / isalive_multiplier) + (total_port_test_sec / port_test_multiplier)
|
|
@@ -157,7 +165,7 @@ class SubnetScanner:
|
|
|
157
165
|
|
|
158
166
|
@terminator
|
|
159
167
|
def _scan_network_ports(self):
|
|
160
|
-
with ThreadPoolExecutor(max_workers=self.
|
|
168
|
+
with ThreadPoolExecutor(max_workers=self.cfg.t_cnt('port_scan')) as executor:
|
|
161
169
|
futures = {executor.submit(self._scan_ports, device): device for device in self.results.devices}
|
|
162
170
|
for future in futures:
|
|
163
171
|
future.result()
|
|
@@ -167,7 +175,7 @@ class SubnetScanner:
|
|
|
167
175
|
def _scan_ports(self, device: Device):
|
|
168
176
|
self.log.debug(f'[{device.ip}] Initiating port scan')
|
|
169
177
|
device.stage = 'scanning'
|
|
170
|
-
with ThreadPoolExecutor(max_workers=self.
|
|
178
|
+
with ThreadPoolExecutor(max_workers=self.cfg.t_cnt('port_test')) as executor:
|
|
171
179
|
futures = {executor.submit(self._test_port, device, int(port)): port for port in self.ports}
|
|
172
180
|
for future in futures:
|
|
173
181
|
future.result()
|
|
@@ -192,13 +200,6 @@ class SubnetScanner:
|
|
|
192
200
|
"""
|
|
193
201
|
return host.is_alive(host.ip)
|
|
194
202
|
|
|
195
|
-
def _t_cnt(self, base_threads: int) -> int:
|
|
196
|
-
"""
|
|
197
|
-
Calculate the number of threads to use based on the base number
|
|
198
|
-
of threads and the parallelism factor.
|
|
199
|
-
"""
|
|
200
|
-
return int(base_threads * self.parallelism)
|
|
201
|
-
|
|
202
203
|
def _set_stage(self,stage):
|
|
203
204
|
self.log.debug(f'[{self.uid}] Moving to Stage: {stage}')
|
|
204
205
|
self.results.stage = stage
|
|
@@ -210,7 +211,6 @@ class ScannerResults:
|
|
|
210
211
|
self.scan = scan
|
|
211
212
|
self.port_list: str = scan.port_list
|
|
212
213
|
self.subnet: str = scan.subnet_str
|
|
213
|
-
self.parallelism: float = scan.parallelism
|
|
214
214
|
self.uid = scan.uid
|
|
215
215
|
|
|
216
216
|
self.devices_total: int = len(list(scan.subnet))
|
|
@@ -249,6 +249,7 @@ class ScannerResults:
|
|
|
249
249
|
out = vars(self).copy()
|
|
250
250
|
out.pop('scan')
|
|
251
251
|
out.pop('log')
|
|
252
|
+
out['cfg'] = vars(self.scan.cfg)
|
|
252
253
|
|
|
253
254
|
devices: List[Device] = out.pop('devices')
|
|
254
255
|
sortedDevices = sorted(devices, key=lambda obj: ipaddress.IPv4Address(obj.ip))
|
|
@@ -22,7 +22,7 @@ def index():
|
|
|
22
22
|
scan = scanner.results.export()
|
|
23
23
|
subnet = scan['subnet']
|
|
24
24
|
port_list = scan['port_list']
|
|
25
|
-
parallelism = scan['
|
|
25
|
+
parallelism = scan['cfg']['t_multiplier']
|
|
26
26
|
else:
|
|
27
27
|
log.debug(f'Redirecting, scan {scan_id} doesnt exist in memory')
|
|
28
28
|
return redirect('/')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lanscape
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.9a1
|
|
4
4
|
Summary: A python based local network scanner
|
|
5
5
|
Author-email: Michael Dennis <michael@dipduo.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mdennis281/py-lanscape
|
|
@@ -55,14 +55,6 @@ can sometimes require admin-level permissions to retrieve accurate results.
|
|
|
55
55
|
This is a missing dependency related to the ARP lookup. This is handled in the code, but you would get marginally faster/better results with this installed: [npcap download](https://npcap.com/#download)
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
### Unable to start webview client. Try --nogui (Linux)
|
|
59
|
-
Linux and QT (GUI package) dont seem to play well with each other very well. If you really want the gui (`python -m lanscape --nogui` is almost as good) I had success on ubuntu desktop by running these:
|
|
60
|
-
```sh
|
|
61
|
-
sudo apt install libcairo2-dev libxt-dev libgirepository1.0-dev
|
|
62
|
-
pip install pycairo PyGObject qtpy PyQt5 PyQtWebEngine
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
|
|
66
58
|
### Something else
|
|
67
59
|
Feel free to submit a github issue detailing your experience.
|
|
68
60
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/android-chrome-192x192.png
RENAMED
|
File without changes
|
{lanscape-1.2.8a3 → lanscape-1.2.9a1}/src/lanscape/ui/static/img/ico/android-chrome-512x512.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|