Skip to content

testing docker container - #9

Open
devsecfranklin wants to merge 2 commits into
rekonnain:masterfrom
devsecfranklin:dev1
Open

testing docker container#9
devsecfranklin wants to merge 2 commits into
rekonnain:masterfrom
devsecfranklin:dev1

Conversation

@devsecfranklin

@devsecfranklin devsecfranklin commented Apr 20, 2020

Copy link
Copy Markdown
  • add docker container
  • add Makefile
  • update file layout to match typical https://pypi.org/ project.

@devsecfranklin

Copy link
Copy Markdown
Author

getting an error with "make docker"

Step 5/6 : WORKDIR /app/asscan
 ---> Running in 742d71a58b03
Removing intermediate container 742d71a58b03
 ---> 0d064b76a853
Step 6/6 : CMD ["python3", "/app/asscan/server.py"]
 ---> Running in da6ca7dab10b
Removing intermediate container da6ca7dab10b
 ---> f45719d02fbf
Successfully built f45719d02fbf
Successfully tagged docker_asscan:latest
Recreating docker_asscan_1 ... done
Attaching to docker_asscan_1
asscan_1      | ERROR:tornado.application:Uncaught exception GET /api/results/ips/ (172.18.0.1)
asscan_1      | HTTPServerRequest(protocol='http', host='0.0.0.0:8888', method='GET', uri='/api/results/ips/', version='HTTP/1.1', remote_ip='172.18.0.1')
asscan_1      | Traceback (most recent call last):
asscan_1      |   File "/usr/local/lib/python3.8/dist-packages/tornado/web.py", line 1701, in _execute
asscan_1      |     result = method(*self.path_args, **self.path_kwargs)
asscan_1      |   File "/app/asscan/server.py", line 150, in get
asscan_1      |     r.read_all('results')
asscan_1      |   File "/app/asscan/results.py", line 222, in read_all
asscan_1      |     files = [x for x in listdir(path) if isfile(join(path, x)) and x.endswith('.xml')]
asscan_1      | FileNotFoundError: [Errno 2] No such file or directory: 'results'
asscan_1      | ERROR:tornado.access:500 GET /api/results/ips/ (172.18.0.1) 2.27ms
asscan_1      | WARNING:tornado.access:404 GET /favicon.ico (172.18.0.1) 0.67ms
asscan_1      | ERROR:tornado.application:Uncaught exception GET /api/results/ips/ (172.18.0.1)
asscan_1      | HTTPServerRequest(protocol='http', host='0.0.0.0:8888', method='GET', uri='/api/results/ips/', version='HTTP/1.1', remote_ip='172.18.0.1')
asscan_1      | Traceback (most recent call last):
asscan_1      |   File "/usr/local/lib/python3.8/dist-packages/tornado/web.py", line 1701, in _execute
asscan_1      |     result = method(*self.path_args, **self.path_kwargs)
asscan_1      |   File "/app/asscan/server.py", line 150, in get
asscan_1      |     r.read_all('results')
asscan_1      |   File "/app/asscan/results.py", line 222, in read_all
asscan_1      |     files = [x for x in listdir(path) if isfile(join(path, x)) and x.endswith('.xml')]
asscan_1      | FileNotFoundError: [Errno 2] No such file or directory: 'results'
asscan_1      | ERROR:tornado.access:500 GET /api/results/ips/ (172.18.0.1) 0.75ms
asscan_1      | ERROR:tornado.application:Uncaught exception GET /api/results/ips/ (172.18.0.1)

@devsecfranklin

Copy link
Copy Markdown
Author

hi @rekonnain this PR runs server.py in a docker container, you just type "make docker" and then navigate to http://0.0.0.0:8888/ as usual. (obviously you would need docker installed first)

@oh6hay

oh6hay commented Apr 21, 2020

Copy link
Copy Markdown
Contributor

Hi! I'm happy to have received the first ever PR on ASSCAN :)

This looks great and I'm looking forward to merging this, it sure helps using this if this can be run inside a container. Some work still remains before this can be merged -- like making sure all binaries are present in the container (at least nmap and masscan seem missing), and testing all scanner modules against some test hosts. Let's make this great!

@devsecfranklin

devsecfranklin commented Apr 22, 2020

Copy link
Copy Markdown
Author

Cool! I added expect, metasploit, nmap, and masscan.

I was wondering why vnc.py is Python2 instead of 3?

The other thing I was thinking, the docker container is a nice addition, but it does not stop us from cloning the repo to any Kali host and running the scanners as before. So if there is any missing dependency it is not a show stopper.

@devsecfranklin

Copy link
Copy Markdown
Author

Type "make" to see all options:

thedevilsvoice@grimoire::~/workspace/asscan$ make
clean                Cleanup all the things
dev                  local dev/test environment
docker               build docker container for testing
python               setup python3
test                 run tests in container

Type "make dev" for local dev environment, basically a shell in the Kali container:

thedevilsvoice@grimoire::~/workspace/asscan$ make dev
Building test env with docker-compose
# remove the --build flag if you don't want to rebuild the container every time
#docker-compose -f docker/docker-compose.yml up --build asscan_dev
docker-compose -f docker/docker-compose.yml up asscan_dev
WARNING: Found orphan containers (xamine_db) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Starting docker_asscan_dev_1 ... done
Attaching to docker_asscan_dev_1
docker_asscan_dev_1 exited with code 0
docker-compose -f docker/docker-compose.yml run asscan_dev /bin/bash
root@asscan:/app# hostname
asscan
root@asscan:/app# 

@@ -0,0 +1,25 @@
name: Docker Image CI

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oh6hay this file configures a github workflow that will build the docker containers on every PR push.

You would have to turn it on in the "Actions" tab of this repo.
https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants