portune 0.1.0__tar.gz → 0.1.2__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.
Potentially problematic release.
This version of portune might be problematic. Click here for more details.
- {portune-0.1.0 → portune-0.1.2}/.gitignore +1 -1
- {portune-0.1.0/portune.egg-info → portune-0.1.2}/PKG-INFO +12 -2
- portune-0.1.2/README.md +11 -0
- {portune-0.1.0 → portune-0.1.2}/portune/__init__.py +1 -1
- portune-0.1.0/portune/re_port.py → portune-0.1.2/portune/portune.py +26 -20
- {portune-0.1.0 → portune-0.1.2}/portune/version.py +2 -2
- {portune-0.1.0 → portune-0.1.2/portune.egg-info}/PKG-INFO +12 -2
- {portune-0.1.0 → portune-0.1.2}/portune.egg-info/SOURCES.txt +1 -1
- portune-0.1.0/README.md +0 -1
- {portune-0.1.0 → portune-0.1.2}/.github/workflows/python-publish.yml +0 -0
- {portune-0.1.0 → portune-0.1.2}/LICENSE +0 -0
- {portune-0.1.0 → portune-0.1.2}/portune.egg-info/dependency_links.txt +0 -0
- {portune-0.1.0 → portune-0.1.2}/portune.egg-info/entry_points.txt +0 -0
- {portune-0.1.0 → portune-0.1.2}/portune.egg-info/top_level.txt +0 -0
- {portune-0.1.0 → portune-0.1.2}/pyproject.toml +0 -0
- {portune-0.1.0 → portune-0.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: portune
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Simple Python HTTP Exec Server
|
|
5
5
|
Author: Franck Jouvanceau
|
|
6
6
|
Maintainer: Franck Jouvanceau
|
|
@@ -52,4 +52,14 @@ Description-Content-Type: text/markdown
|
|
|
52
52
|
License-File: LICENSE
|
|
53
53
|
Dynamic: license-file
|
|
54
54
|
|
|
55
|
-
#
|
|
55
|
+
# portune
|
|
56
|
+
|
|
57
|
+
Multitreaded port scanner
|
|
58
|
+
|
|
59
|
+
# features
|
|
60
|
+
|
|
61
|
+
* parallel check of port availability against server/ports
|
|
62
|
+
* console output result / summary
|
|
63
|
+
* html full report / dns domain summary / vlan timeout summary
|
|
64
|
+
* mail with html summary / report attachment (mailhost relay)
|
|
65
|
+
|
portune-0.1.2/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# portune
|
|
2
|
+
|
|
3
|
+
Multitreaded port scanner
|
|
4
|
+
|
|
5
|
+
# features
|
|
6
|
+
|
|
7
|
+
* parallel check of port availability against server/ports
|
|
8
|
+
* console output result / summary
|
|
9
|
+
* html full report / dns domain summary / vlan timeout summary
|
|
10
|
+
* mail with html summary / report attachment (mailhost relay)
|
|
11
|
+
|
|
@@ -906,6 +906,29 @@ def format_percent(value: int, total: int) -> Tuple[str, str]:
|
|
|
906
906
|
return "0/0", "0.0%"
|
|
907
907
|
return f"{value}/{total}", f"{(value/total*100):.1f}%"
|
|
908
908
|
|
|
909
|
+
def get_vlan_base(ip: str, bits: int) -> str:
|
|
910
|
+
"""Calculate VLAN base address with end padding 0."""
|
|
911
|
+
if ip == 'N/A':
|
|
912
|
+
return 'N/A'
|
|
913
|
+
try:
|
|
914
|
+
octets = ip.split('.')
|
|
915
|
+
if len(octets) != 4:
|
|
916
|
+
return 'invalid'
|
|
917
|
+
|
|
918
|
+
# Convert IP to 32-bit integer
|
|
919
|
+
ip_int = sum(int(octet) << (24 - 8 * i) for i, octet in enumerate(octets))
|
|
920
|
+
|
|
921
|
+
# Apply mask
|
|
922
|
+
mask = ((1 << bits) - 1) << (32 - bits)
|
|
923
|
+
masked_ip = ip_int & mask
|
|
924
|
+
|
|
925
|
+
# Convert back to dotted notation
|
|
926
|
+
result_octets = [(masked_ip >> (24 - 8 * i)) & 255 for i in range(4)]
|
|
927
|
+
return '.'.join(map(str, result_octets))
|
|
928
|
+
except:
|
|
929
|
+
return 'N/A'
|
|
930
|
+
|
|
931
|
+
|
|
909
932
|
def compute_stats(
|
|
910
933
|
results: List[Tuple[str, str, int, str, bool]],
|
|
911
934
|
start_time: float,
|
|
@@ -954,25 +977,6 @@ def compute_stats(
|
|
|
954
977
|
}
|
|
955
978
|
|
|
956
979
|
|
|
957
|
-
def get_vlan_base(ip: str, bits: int) -> str:
|
|
958
|
-
"""Calculate VLAN base address with end padding 0."""
|
|
959
|
-
try:
|
|
960
|
-
octets = ip.split('.')
|
|
961
|
-
if len(octets) != 4:
|
|
962
|
-
return 'invalid'
|
|
963
|
-
|
|
964
|
-
# Convert IP to 32-bit integer
|
|
965
|
-
ip_int = sum(int(octet) << (24 - 8 * i) for i, octet in enumerate(octets))
|
|
966
|
-
|
|
967
|
-
# Apply mask
|
|
968
|
-
mask = ((1 << bits) - 1) << (32 - bits)
|
|
969
|
-
masked_ip = ip_int & mask
|
|
970
|
-
|
|
971
|
-
# Convert back to dotted notation
|
|
972
|
-
result_octets = [(masked_ip >> (24 - 8 * i)) & 255 for i in range(4)]
|
|
973
|
-
return '.'.join(map(str, result_octets))
|
|
974
|
-
except:
|
|
975
|
-
return 'invalid'
|
|
976
980
|
|
|
977
981
|
# Collect VLAN statistics for timeouts
|
|
978
982
|
for hostname, ip, port, status, _ in results:
|
|
@@ -1179,13 +1183,14 @@ def generate_html_report(
|
|
|
1179
1183
|
f.write(f'<h3 class="icon">Port Accessibility Report from {HOSTNAME} ({MY_IP}) to {os.path.basename(input_file)} - {time.strftime("%Y-%m-%d %H:%M:%S", scan_time)}</h3>\n')
|
|
1180
1184
|
|
|
1181
1185
|
# Write detailed results table
|
|
1182
|
-
f.write('''
|
|
1186
|
+
f.write(f'''
|
|
1183
1187
|
<div class="table-container" id="result-container">
|
|
1184
1188
|
<table id="commandTable">
|
|
1185
1189
|
<thead>
|
|
1186
1190
|
<tr>
|
|
1187
1191
|
<th>Hostname</th>
|
|
1188
1192
|
<th>IP</th>
|
|
1193
|
+
<th>VLAN/{stats['vlan_bits']}</th>
|
|
1189
1194
|
<th>Port</th>
|
|
1190
1195
|
<th>Status</th>
|
|
1191
1196
|
<th>Ping</th>
|
|
@@ -1203,6 +1208,7 @@ def generate_html_report(
|
|
|
1203
1208
|
<tr>
|
|
1204
1209
|
<td>{escape(str(hostname))}</td>
|
|
1205
1210
|
<td>{escape(str(ip))}</td>
|
|
1211
|
+
<td>{str(get_vlan_base(ip, stats['vlan_bits']))}</td>
|
|
1206
1212
|
<td style="text-align: right;">{port}</td>
|
|
1207
1213
|
<td style="text-align: center;"><span class="{status_class} status">{escape(status)}</span></td>
|
|
1208
1214
|
<td style="text-align: center;"><span class="{ping_class} ping">{ping_status}</span></td>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: portune
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Simple Python HTTP Exec Server
|
|
5
5
|
Author: Franck Jouvanceau
|
|
6
6
|
Maintainer: Franck Jouvanceau
|
|
@@ -52,4 +52,14 @@ Description-Content-Type: text/markdown
|
|
|
52
52
|
License-File: LICENSE
|
|
53
53
|
Dynamic: license-file
|
|
54
54
|
|
|
55
|
-
#
|
|
55
|
+
# portune
|
|
56
|
+
|
|
57
|
+
Multitreaded port scanner
|
|
58
|
+
|
|
59
|
+
# features
|
|
60
|
+
|
|
61
|
+
* parallel check of port availability against server/ports
|
|
62
|
+
* console output result / summary
|
|
63
|
+
* html full report / dns domain summary / vlan timeout summary
|
|
64
|
+
* mail with html summary / report attachment (mailhost relay)
|
|
65
|
+
|
portune-0.1.0/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# re-port
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|