tcpsweep 0.1.0__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.
- tcpsweep-0.1.0/.gitignore +55 -0
- tcpsweep-0.1.0/LICENSE +21 -0
- tcpsweep-0.1.0/PKG-INFO +91 -0
- tcpsweep-0.1.0/README.md +69 -0
- tcpsweep-0.1.0/pyproject.toml +41 -0
- tcpsweep-0.1.0/tcpsweep.py +1601 -0
- tcpsweep-0.1.0/test_scan.py +1478 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ── Scan output / reconnaissance data ────────────────────────────────
|
|
2
|
+
# scan.py writes NAME.json / NAME.gnmap / NAME.state.json (and -oX/-oJ/-oC
|
|
3
|
+
# reports) to the working directory. These contain sensitive recon data and
|
|
4
|
+
# must never be committed.
|
|
5
|
+
*.gnmap
|
|
6
|
+
*.state.json
|
|
7
|
+
*.json
|
|
8
|
+
*.xml
|
|
9
|
+
*.csv
|
|
10
|
+
# Keep tracked project config despite the broad rules above.
|
|
11
|
+
!.claude/settings.json
|
|
12
|
+
|
|
13
|
+
# ── Python ───────────────────────────────────────────────────────────
|
|
14
|
+
__pycache__/
|
|
15
|
+
*.py[cod]
|
|
16
|
+
*$py.class
|
|
17
|
+
*.so
|
|
18
|
+
.Python
|
|
19
|
+
build/
|
|
20
|
+
dist/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.eggs/
|
|
23
|
+
.installed.cfg
|
|
24
|
+
|
|
25
|
+
# ── Testing / coverage ───────────────────────────────────────────────
|
|
26
|
+
.pytest_cache/
|
|
27
|
+
.tox/
|
|
28
|
+
.nox/
|
|
29
|
+
.coverage
|
|
30
|
+
.coverage.*
|
|
31
|
+
htmlcov/
|
|
32
|
+
coverage.xml
|
|
33
|
+
.hypothesis/
|
|
34
|
+
|
|
35
|
+
# ── Virtual environments ─────────────────────────────────────────────
|
|
36
|
+
.venv/
|
|
37
|
+
venv/
|
|
38
|
+
env/
|
|
39
|
+
ENV/
|
|
40
|
+
|
|
41
|
+
# ── Editors / OS ─────────────────────────────────────────────────────
|
|
42
|
+
.vscode/
|
|
43
|
+
.idea/
|
|
44
|
+
*.swp
|
|
45
|
+
*.swo
|
|
46
|
+
*~
|
|
47
|
+
.DS_Store
|
|
48
|
+
Thumbs.db
|
|
49
|
+
|
|
50
|
+
# ── Claude Code local settings (per-user, not shared) ────────────────
|
|
51
|
+
.claude/settings.local.json
|
|
52
|
+
|
|
53
|
+
# ── Atomic-write temp files (scan.py and others write NAME.tmp.* then rename)
|
|
54
|
+
*.tmp.*
|
|
55
|
+
|
tcpsweep-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Philipp Herkert
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tcpsweep-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tcpsweep
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A netcat-style TCP connect sweep in a single, dependency-free Python file.
|
|
5
|
+
Project-URL: Homepage, https://github.com/BearlyStable/scanner
|
|
6
|
+
Project-URL: Repository, https://github.com/BearlyStable/scanner
|
|
7
|
+
Project-URL: Issues, https://github.com/BearlyStable/scanner/issues
|
|
8
|
+
Author-email: Philipp Herkert <philipp.herkert@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: netcat,network,portscan,recon,scanner,security,tcp
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Information Technology
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Topic :: Security
|
|
19
|
+
Classifier: Topic :: System :: Networking :: Monitoring
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# tcpsweep
|
|
24
|
+
|
|
25
|
+
A netcat-style TCP connect sweep in a single, dependency-free Python file.
|
|
26
|
+
|
|
27
|
+
`tcpsweep` sends the same probe as `nc -z` (a full TCP connect) to every
|
|
28
|
+
host/port in a target spec and reports which ports are open. It uses the
|
|
29
|
+
standard library only, so it can be dropped onto any box with a Python 3
|
|
30
|
+
interpreter and run directly (`./tcpsweep.py ...`) or as a module
|
|
31
|
+
(`python3 -m tcpsweep ...`).
|
|
32
|
+
|
|
33
|
+
Discovered open ports stream to **stdout** (one `IP PORT` line each) so the
|
|
34
|
+
tool composes in a pipeline; progress and the summary go to **stderr**.
|
|
35
|
+
Results are also written to `NAME.json` and `NAME.gnmap` plus a resumable
|
|
36
|
+
`NAME.state.json` — all written atomically and owner-readable only (`0600`),
|
|
37
|
+
since a scan result is sensitive reconnaissance data.
|
|
38
|
+
|
|
39
|
+
> **Authorized use only.** Only scan hosts and networks you own or have
|
|
40
|
+
> explicit permission to test.
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
pipx install tcpsweep # isolated, recommended for a CLI tool
|
|
46
|
+
pip install tcpsweep # or a plain pip install
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Both provide a `tcpsweep` command on your `PATH`. The tool has no third-party
|
|
50
|
+
dependencies, so you can also just copy `tcpsweep.py` onto a host and run it.
|
|
51
|
+
|
|
52
|
+
## Requirements
|
|
53
|
+
|
|
54
|
+
- Python 3.8+ (standard library only — no third-party packages)
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
tcpsweep 192.168.1.1 22 80 443
|
|
60
|
+
tcpsweep 192.168.1.0/24 -p 22,80,443 -t 16
|
|
61
|
+
tcpsweep 10.0.0.{1-10,254} -p 1-1024 -r -o office
|
|
62
|
+
tcpsweep 192.168.1.1 -p 1-65535 -w 2 -P 0.2 # rate-limited, 0.2s gap
|
|
63
|
+
tcpsweep 10.0.0.0/24 -p 22 -b # grab banners
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Run `tcpsweep --help` for the full option list, including target selection
|
|
67
|
+
(CIDR / dash ranges / brace notation / `-iL` target files / `--exclude`),
|
|
68
|
+
threading, rate limiting, link-health auto-pause, and the various output
|
|
69
|
+
formats (`-oJ` / `-oX` / `-oT` / `-oC` / `-oA`).
|
|
70
|
+
|
|
71
|
+
## Output files
|
|
72
|
+
|
|
73
|
+
By default the scanner writes working files named after the target (or the
|
|
74
|
+
`-o NAME` base):
|
|
75
|
+
|
|
76
|
+
| File | Contents |
|
|
77
|
+
| ------------------ | ----------------------------------------- |
|
|
78
|
+
| `NAME.json` | Full structured results |
|
|
79
|
+
| `NAME.gnmap` | Greppable, nmap-style summary |
|
|
80
|
+
| `NAME.state.json` | Resume state for an interrupted scan |
|
|
81
|
+
|
|
82
|
+
These files hold reconnaissance data and are excluded from version control via
|
|
83
|
+
`.gitignore`.
|
|
84
|
+
|
|
85
|
+
## Development
|
|
86
|
+
|
|
87
|
+
Run the test suite with:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
python3 -m pytest test_scan.py -q # or: python3 -m unittest test_scan
|
|
91
|
+
```
|
tcpsweep-0.1.0/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# tcpsweep
|
|
2
|
+
|
|
3
|
+
A netcat-style TCP connect sweep in a single, dependency-free Python file.
|
|
4
|
+
|
|
5
|
+
`tcpsweep` sends the same probe as `nc -z` (a full TCP connect) to every
|
|
6
|
+
host/port in a target spec and reports which ports are open. It uses the
|
|
7
|
+
standard library only, so it can be dropped onto any box with a Python 3
|
|
8
|
+
interpreter and run directly (`./tcpsweep.py ...`) or as a module
|
|
9
|
+
(`python3 -m tcpsweep ...`).
|
|
10
|
+
|
|
11
|
+
Discovered open ports stream to **stdout** (one `IP PORT` line each) so the
|
|
12
|
+
tool composes in a pipeline; progress and the summary go to **stderr**.
|
|
13
|
+
Results are also written to `NAME.json` and `NAME.gnmap` plus a resumable
|
|
14
|
+
`NAME.state.json` — all written atomically and owner-readable only (`0600`),
|
|
15
|
+
since a scan result is sensitive reconnaissance data.
|
|
16
|
+
|
|
17
|
+
> **Authorized use only.** Only scan hosts and networks you own or have
|
|
18
|
+
> explicit permission to test.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pipx install tcpsweep # isolated, recommended for a CLI tool
|
|
24
|
+
pip install tcpsweep # or a plain pip install
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Both provide a `tcpsweep` command on your `PATH`. The tool has no third-party
|
|
28
|
+
dependencies, so you can also just copy `tcpsweep.py` onto a host and run it.
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
- Python 3.8+ (standard library only — no third-party packages)
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
tcpsweep 192.168.1.1 22 80 443
|
|
38
|
+
tcpsweep 192.168.1.0/24 -p 22,80,443 -t 16
|
|
39
|
+
tcpsweep 10.0.0.{1-10,254} -p 1-1024 -r -o office
|
|
40
|
+
tcpsweep 192.168.1.1 -p 1-65535 -w 2 -P 0.2 # rate-limited, 0.2s gap
|
|
41
|
+
tcpsweep 10.0.0.0/24 -p 22 -b # grab banners
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Run `tcpsweep --help` for the full option list, including target selection
|
|
45
|
+
(CIDR / dash ranges / brace notation / `-iL` target files / `--exclude`),
|
|
46
|
+
threading, rate limiting, link-health auto-pause, and the various output
|
|
47
|
+
formats (`-oJ` / `-oX` / `-oT` / `-oC` / `-oA`).
|
|
48
|
+
|
|
49
|
+
## Output files
|
|
50
|
+
|
|
51
|
+
By default the scanner writes working files named after the target (or the
|
|
52
|
+
`-o NAME` base):
|
|
53
|
+
|
|
54
|
+
| File | Contents |
|
|
55
|
+
| ------------------ | ----------------------------------------- |
|
|
56
|
+
| `NAME.json` | Full structured results |
|
|
57
|
+
| `NAME.gnmap` | Greppable, nmap-style summary |
|
|
58
|
+
| `NAME.state.json` | Resume state for an interrupted scan |
|
|
59
|
+
|
|
60
|
+
These files hold reconnaissance data and are excluded from version control via
|
|
61
|
+
`.gitignore`.
|
|
62
|
+
|
|
63
|
+
## Development
|
|
64
|
+
|
|
65
|
+
Run the test suite with:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
python3 -m pytest test_scan.py -q # or: python3 -m unittest test_scan
|
|
69
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tcpsweep"
|
|
7
|
+
description = "A netcat-style TCP connect sweep in a single, dependency-free Python file."
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.8"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
authors = [{ name = "Philipp Herkert", email = "philipp.herkert@gmail.com" }]
|
|
13
|
+
keywords = ["portscan", "network", "tcp", "scanner", "netcat", "security", "recon"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: System Administrators",
|
|
18
|
+
"Intended Audience :: Information Technology",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Topic :: System :: Networking :: Monitoring",
|
|
22
|
+
"Topic :: Security",
|
|
23
|
+
]
|
|
24
|
+
dynamic = ["version"]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/BearlyStable/scanner"
|
|
28
|
+
Repository = "https://github.com/BearlyStable/scanner"
|
|
29
|
+
Issues = "https://github.com/BearlyStable/scanner/issues"
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
tcpsweep = "tcpsweep:main"
|
|
33
|
+
|
|
34
|
+
[tool.hatch.version]
|
|
35
|
+
path = "tcpsweep.py"
|
|
36
|
+
|
|
37
|
+
[tool.hatch.build.targets.wheel]
|
|
38
|
+
only-include = ["tcpsweep.py"]
|
|
39
|
+
|
|
40
|
+
[tool.hatch.build.targets.sdist]
|
|
41
|
+
include = ["tcpsweep.py", "test_scan.py", "README.md", "LICENSE"]
|