Coder Social home page Coder Social logo

scriptreplay_ng's People

Contributors

brlin-tw avatar cykutw avatar jimihford avatar paco0x avatar scoopex avatar zealws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

scriptreplay_ng's Issues

script usage to exclude some command from 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.

Make the patch obsolete

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.