Giter Site home page Giter Site logo

yabsat's Introduction

yabsat

YABSAT - Yet Another But Simple AIDE Tool

The goal of this repository is to show how extremely simple yet powerfull tools can be created with a few lines of code, reusing utilities that already exist (why reinvent the wheel when almost-perfect wheels are out there).

In this case, the output is a bash script that allow to perform AIDE operations - check what things have changed in a system from a known previous state.

What is needed?

  • "find" utility
  • "stat" utility
  • "diff" utility

With those three core utilities that are present in most of the GNU/Linux distros, a fairly depth analysis of a system can be carried out, without configuring complex dot files, neither launching daemons nor messing with admin inner guts. KISS principle at is finest.

Steps to AIDE-ize a directory with the script:

1- Launch yabsat script to obtain the known state or "base snapshot"

  $> bash yabsat.bsh ./interesting_dir
  $> mv yabsatlog* base_snapshot.txt

2- Play as usual with the system

3- Launch yabsat script to obtain a report of the modified state

  $> bash yabsat.bsh ./interesting_dir
  $> mv yabsatlog* new_state.txt

4- Diff the base snapshot with the last report. Enjoy the inquiry

  $> diff base_* new_*

Of course, this script is not as complete and powerful as HIDS tools. But sometimes (many times) you dont need that power. The previous steps allows you to detect creation, deletion and modification of the most typical linux file types. And by modification, it shall be understood the change in content as well as change in status (i.e chmod or chown).

Need more? The script can be used as a reliable base from where build more advanced utilities. Or, add the wrappers you want. For example, the python script yabsatdiff.py shows the "diff" result in a more readable way, and it uses as input the text files generated by yabsat.bsh.

$> python yabsatdiff.py base_* new_*
# Now, read the results file "yabsatdiff_results.txt"

Need even more? Combine the yabsat.bsh script with the python script with "check_these_dir.bsh" script, which analyzes a list of custom directories (of course, this last script must be modified by the user to meet its needs)

# Obtain the base snapshot of all the directories to be analyzed
$> bash check_these_dirs.bsh && mv all_logs.txt base_logs.txt
# Now, mess around with the system as always, and get the new state
$> bash check_these_dirs.bsh && mv all_logs.txt new_logs.txt
# And compare
$> python yabsatdiff.py base_* new_*

This script may not be fit to be used as a real AIDE tool, but it can be helpfull when dealing with complex applications that, uppon execution:

  • modifies lot of files, without telling you what files are
  • creates logs, without telling you where they are created
  • perform subtle permisson changes that are hide to the user

Managing or simply learning to use such applications can be a real pain. Did you ever face a situation like this, and wondered "What changes has <insert_here_app> made?". If so, this less-than-10-lines script may be useful.

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.