From bb30b82b72f77167c7681682368af861b1dc781e Mon Sep 17 00:00:00 2001 From: sog Date: Sat, 18 Apr 2020 11:08:29 -0400 Subject: [PATCH] tried to get command logging working, but differences in docker and normal environment makes it behave differently. Unsure what the deal is right now. --- Dockerfile | 2 +- dot_bashrc | 11 +++++------ run.sh | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27b1ed0..39125bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ FROM ubuntu:19.10 ENV LC_CTYPE C.UTF-8 ENV DEBIAN_FRONTEND=noninteractive COPY dot_radare2rc /root/.radare2rc -COPY dot_bashrc /root/.bashrc +#COPY dot_bashrc /root/.bashrc RUN dpkg --add-architecture i386 && \ apt-get update && \ apt-get install -y build-essential jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools \ diff --git a/dot_bashrc b/dot_bashrc index 9b6fe02..1230b1f 100644 --- a/dot_bashrc +++ b/dot_bashrc @@ -1,8 +1,7 @@ -[ -z "$PS1" ] && return -HISTCONTROL=ignoredups:ignorespace -shopt -s histappend -HISTSIZE=5000 -HISTFILESIZE=5000 + +export HISTCONTROL=ignoredups:ignorespace +export HISTSIZE=5000 +export HISTFILESIZE=5000 if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' @@ -24,7 +23,7 @@ ps1_state(){ echo -e "[$(date +%H:%M:%S)]\xF0\x9F\x94\xB4->$ret " fi } -PS1='${debian_chroot:+($debian_chroot)}$(ps1_state)\[\033[01;31m\]\u\[\033[00m\][ \[\033[01;34m\]\w\[\033[00m\] ]\$ ' +export PS1='${debian_chroot:+($debian_chroot)}$(ps1_state)\[\033[01;31m\]\u\[\033[00m\][ \[\033[01;34m\]\w\[\033[00m\] ]\$ ' # From https://twitter.com/n00py1/status/1230755337797394434 script -f /logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log \ No newline at end of file diff --git a/run.sh b/run.sh index ada72ed..5fbf51c 100755 --- a/run.sh +++ b/run.sh @@ -1,2 +1,2 @@ #!/bin/sh -docker run --rm -v "$(pwd):/pwd" -v "$(pwd)/logs:/logs" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -d --name docker-binaryexploitation -i docker-binaryexploitation:ubuntu19.10 +docker run --rm -v "$(pwd)/host:/host" -v "$(pwd)/logs:/logs" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -d --name docker-binaryexploitation -i docker-binaryexploitation:ubuntu19.10