Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docker scripts for GUI #17738

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extras/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN apt-get dist-upgrade -y
RUN apt-get install -y python-pip build-essential libxslt1-dev libxml2-dev libsqlite3-dev \
libyaml-dev openssh-server python-dev git python-lxml wget libssl-dev \
xdot python-gtk2 python-gtksourceview2 ubuntu-artwork dmz-cursor-theme \
ca-certificates libffi-dev
ca-certificates libffi-dev python-webkit

# Add the w3af user
# TODO - actually use the w3af user instead of running everything as root
Expand Down
14 changes: 11 additions & 3 deletions extras/docker/scripts/common/docker_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@
ROOT_PATH = os.path.dirname(os.path.realpath(__file__))
DOCKER_RUN = ('docker run'
' -d'
' -v ~/.w3af:/root/.w3af'
' -v ~/w3af-shared:/root/w3af-shared'
' -v ~/.w3af:~/.w3af'
' -v ~/w3af-shared:~/w3af-shared'
' -p 44444:44444'
' andresriancho/w3af')

DOCKER_RUN_GUI = ('docker run'
' -d'
' -v ~/.w3af:~/.w3af'
' -v ~/w3af-shared:~/w3af-shared'
' -v /tmp/.X11-unix:/tmp/.X11-unix'
' -e DISPLAY=unix$DISPLAY'
' -p 44444:44444'
' andresriancho/w3af')

def start_container(tag, command=DOCKER_RUN):
"""
Expand Down Expand Up @@ -132,7 +140,7 @@ def restore_file_ownership():
# will run w3af inside docker: sudo w3af_console_docker
uid = int(os.getenv('SUDO_UID'))
gid = int(os.getenv('SUDO_GID'))
except ValueError:
except (ValueError, TypeError):
# TODO: More things to be implemented here
return False

Expand Down
2 changes: 1 addition & 1 deletion extras/docker/scripts/w3af_gui_docker
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if __name__ == '__main__':
args = parse_args()

create_volumes()
container_id = start_container(args.tag)
container_id = start_container(args.tag, DOCKER_RUN_GUI)

cmd = '/home/w3af/w3af/w3af_gui --no-update'
extra_ssh_flags = ('-X',)
Expand Down