Skip to content

Commit 906dbfc

Browse files
committed
Prepare for release
1 parent 07c0201 commit 906dbfc

File tree

5 files changed

+199
-7
lines changed

5 files changed

+199
-7
lines changed

.gitignore

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,138 @@
1+
# Byte-compiled / optimized / DLL files
12
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
2110
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Jamie Hill-Daniel
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.

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import setuptools
2+
3+
with open("README.md", "r", encoding="utf-8") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="wsshuttle",
8+
version="0.0.1",
9+
author="Jamie Hill-Daniel",
10+
author_email="clubby789@gmail.com",
11+
description="A tool to tunnel TCP via WinRM",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://github.com/clubby789/wsshuttle",
15+
project_urls={
16+
"Bug Tracker": "https://github.com/clubby789/wsshuttle/issues",
17+
},
18+
classifiers=[
19+
"Programming Language :: Python :: 3",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: OS Independent",
22+
],
23+
packages=["wsshuttle"],
24+
python_requires=">=3.5",
25+
install_requires=["pywinrm==0.4.2", "requests-ntlm"],
26+
)

wsshuttle/cmdline.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
import argparse
22
import getpass
33
import re
4+
import warnings
45

56
from .listener import WsshuttleListener
67

78

89

910
def main() -> int:
1011
parser = argparse.ArgumentParser(prog="wsshuttle")
11-
parser.add_argument("-u", "--username", required=True)
12-
parser.add_argument("-p", "--password", default=None)
12+
parser.add_argument("-u", "--username", required=True, help="Target username")
13+
parser.add_argument("-p", "--password", default=None, help="Target user's password")
1314
parser.add_argument("-b", "--host", required=True, help="IP of this machine to backconnect to")
1415
parser.add_argument("-i", "--dest", required=True, help="Host to connect to")
15-
parser.add_argument("-H", "--hash", default=None)
16-
parser.add_argument("-m", "--mask", required=True)
16+
parser.add_argument("-H", "--hash", default=None, help="NTLM hash")
17+
parser.add_argument("-m", "--mask", required=True, help="Subnet mask to tunnel into")
1718
args = parser.parse_args()
1819

1920
if args.hash and args.password:
2021
print("Only one of --hash and --password may be specified")
2122
return -1
2223

2324
if args.hash is not None:
25+
print("WARNING: Using hash authentication currently requires installing an extra dependency - \n"
26+
"pip3 install git+https://github.com/clubby789/requests-ntlm@pyspnego")
2427
ntlm = args.hash.lower()
25-
if re.match("[a-z0-9]{32}"):
28+
if re.match("[a-z0-9]{32}", ntlm):
2629
args.password = "0" * 32 + ":" + ntlm
27-
elif re.match(":[a-z0-9]{32}"):
30+
elif re.match(":[a-z0-9]{32}", ntlm):
2831
args.password = "0" * 32 + ntlm
29-
elif re.match("[a-z0-9]{32}:[a-z0-9]{32}"):
32+
elif re.match("[a-z0-9]{32}:[a-z0-9]{32}", ntlm):
3033
args.password = ntlm
3134
else:
3235
print("Invalid hash format")

0 commit comments

Comments
 (0)