scoopex / scriptreplay_ng Goto Github PK
View Code? Open in Web Editor NEWA improved implementation of scriptreplay
A improved implementation of scriptreplay
Hello, Is there a way to exclude some commands such as vi/cat/less/more from being replayed with the scriptreplay originally captured with script. visual editing commands cause a lot of noise which I would like to reduce if possible using a combination or script/scriptreplay maybe depending on bytes from the timing file or even better from the command to replay.
Let me know if this is possible.
Any way to remove timing information from the typescript using the timing file here ?
Replace the util-linux patch by something which utilizes apparmor to restrict access.
Quick any dirty hack:
(needs additional work)
$ set -x; cat /etc/apparmor.d/restricted-shell ; cat /usr/local/bin/restricted-shell ; sudo aa-enforce /usr/local/bin/restricted-shell ; restricted-shell ; set +x
+ cat /etc/apparmor.d/restricted-shell
#include<tunables/global>
# aa-enforce /usr/local/bin/restricted-shell
/usr/local/bin/restricted-shell {
#include <abstractions/base>
network inet tcp,
/** lrwix,
/bin/bash cx,
profile /bin/bash {
#include <abstractions/base>
#include <abstractions/bash>
network inet tcp,
/** lrwix,
# TCP/UDP network access
network inet stream,
network inet6 stream,
network inet dgram,
network inet6 dgram,
network netlink raw,
deny /tmp/log/ lrwx,
#include <abstractions/dbus-strict>
dbus send
bus=system
path="/org/freedesktop/resolve1"
interface="org.freedesktop.resolve1.Manager"
member="Resolve{Address,Hostname,Record,Service}"
peer=(name="org.freedesktop.resolve1"),
}
}
+ cat /usr/local/bin/restricted-shell
#!/bin/bash
cd /tmp
cat <<EOF
****************************************************
*** RESTRICTED SHELL START
****************************************************
EOF
script --timing=/tmp/log/timing /tmp/log/typescript -c "/bin/bash"
#/bin/bash
cat <<EOF
****************************************************
*** RESTRICTED SHELL END
****************************************************
EOF
+ sudo aa-enforce /usr/local/bin/restricted-shell
/usr/local/bin/restricted-shell wird in den Erzwingen-Modus versetzt.
+ restricted-shell
****************************************************
*** RESTRICTED SHELL START
****************************************************
Skript gestartet, die Datei ist /tmp/log/typescript
xset: unable to open display ":0"
marc@nb18(2017-10-20 22:22:58) /tmp
$ ls
+~JF2596995564123793764.tmp ssh-AhWjvIlYKNMZ warnings-plugin
marc@nb18(2017-10-20 22:23:00) /tmp
$ ssh 256bit.org
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-93-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
____ ____ __ ____ ___ _____ ___ ____ ____
|___ \| ___| / /_ | __ )_ _|_ _/ _ \| _ \ / ___|
__) |___ \| '_ \| _ \| | | || | | | |_) | | _
/ __/ ___) | (_) | |_) | | | || |_| | _ <| |_| |
|_____|____/ \___/|____/___| |_(_)___/|_| \_\\____|
Last login: Fri Oct 20 22:21:30 2017 from 78.42.71.84
ERR 1 : [email protected](2017-10-20 22:23:12) ~
$ logout
Connection to 256bit.org closed.
ERR 1 : marc@nb18(2017-10-20 22:23:07) /tmp
$ exit
Skript wurde beendet, die Datei ist /tmp/log/typescript
****************************************************
*** RESTRICTED SHELL END
****************************************************
+ set +x
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.