Giter Site home page Giter Site logo

utmpfucc's Introduction

utmpfucc

Automatically remove records based on an IP address from:

  • /var/run/utmp
  • /var/log/wtmp
  • /var/log/lastlog

You must have root, or at least write access on those files, for this tool to work.

Example

$ whoami
root

$ w
 08:50:07 up 10:40,  2 users,  load average: 0.05, 0.13, 0.17
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
root     tty1      08:49   33.00s  0.15s  0.15s -zsh
root     pts/1     08:48    6.00s  0.33s  0.00s w

$ utmpfucc
/var/run/utmp: 7854     root     pts/1        2017-02-25 08:48 (10.0.0.99)
[$] /var/run/utmp: removed 1 records
/var/log/wtmp: 7854     root     pts/1        2017-02-25 08:48 (10.0.0.99)
[$] /var/log/wtmp: removed 1 records
[$] /var/log/lastlog: removed 1 records

$ w
 08:50:22 up 10:40,  1 user,  load average: 0.11, 0.14, 0.18
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
root     tty1      08:49   48.00s  0.15s  0.15s -zsh

$ what now bitch
sh: what: command not found

Usage info

usage: utmpfucc [OPTION]...
remove entries from utmp/wtmp logs
   -i, --ip=IP         specify ip address to remove
   -n, --dry-run       don't modify log files
   -f, --file          utmp file to edit (default /var/run/utmp and
                       /var/log/wtmp)
       --skip-utmp     skip /var/run/utmp
       --skip-wtmp     skip /var/log/wtmp
       --skip-lastlog  skip /var/log/lastlog
   -v, --verbose       control verbosity (can be given twice)
   -h, --help          display this help and exit
   -V, --version       output version information and exit

utmpfucc's People

Contributors

raincoats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

utmpfucc's Issues

Does it work when utmp is rw-rw-r-- ?

I haven't tested it, but after a quick look at the code, I think it requires write access to /var/log/wtmp and /var/run/utmp. On most distros, these files are rw-rw-r-- root:utmp, so modifying them would require either root or being in the utmp group.

I guess it's still useful even if it requires root access, but in such case the example in the readme is a bit misleading.

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.