Thursday, May 29, 2008

Screen, Fruity and Nikto

These are the latest applications I've found extremely useful.

GNU Screen- Terminal multiplexer with ability to detach and reattach a session
Useful when:
  • You want to be sure that a terminal program you started on a server keeps running even if you lose your ssh session
  • You want to leave a terminal program and resume it exactly where you left off.
  • You want multiple sessions within single window. Many other terminals do this, but screen will do it even when there's no GUI(like from the console)
Quickstart:
Start it: screen or screen yourprogram
Detach it: Ctrl-a d
Reattach it: screen -r -d

The beauty of it is, that you can do the reattach from a different computer logging in from an entirely different ssh session. And even if your ssh session dies, you can reconnect and reattach it. That's brilliant! There's lots more cool things you can do with screen. To have multiple terminals within one, do "Ctrl-a C" to create a new window, and Ctrl-A (or Ctrl-a n) to switch to the next window. And yes, when you detach all those windows will stay there.

Fruity- Web-based Nagios configuration tool. (nagios2 only)
Useful when:

  • Your nagios configs are not setup in a logical concise way-this often happens if you start small and add over time.
  • You're not taking advantage of the advanced features of config file modularity, such as separate client/site directories, services, or even service groups applied per hostgroup, or templates.
  • You want a powerful tool, that will easily let you organize and maintain your nagios config file.
Quickstart:
  • Generally you want to install fruity on the same machine that you have Nagios2 on. If that's a production box, then you can tar up /etc/nagios2 and untar it on the test box where you install Fruity on.
  • untar and unzip(tar -zxvf) the source file and move the directory to your Apache DocumentRoot(mv fruity1.0-rc2 /var/www/fruity )
  • Import the DB schema(mysql -u root -p < /var/www/fruity/sqldata/fruity.sql
  • The web interface(ie. http://localhost/fruity) should now "just work". It won't automatically import your configs, nor will it change the actual config files when you make changes. These are done via import and export tabs.
Nikto - Nikto is an HTTP security scanner. It will scan for common files and directories which may reveal versions of not just Apache, but PHP and even MySQL.
Useful when: You want to secure your website against fingerprinting and ensure that nothing more is revealed than necessary.

Quickstart:
Nikto is a perl script, so after you unzip/tar the source, you just run it:
nikto.pl -host yourtargetwebsite

It takes quite a while to run(took about 20min for the site I tried), but it gives you lots of very useful information, and presents it in a concise way. I have yet to figure out how to run it on an SSL(https) website.


2 comments:

Unknown said...

Hey Tibor, Fruity is choice but it's old... which seems to be the standard for most Nagios front ends :(

I currently have an eye on Centreon and Nagvis though, you should check them out :)

Ra

Tibor Incze said...

Thanks man.I ran across it while I was searching. In fact Wikipedia(http://en.wikipedia.org/wiki/Nagios) gives a nice (which I think is) exhaustive list.

I was purposefully trying to stay away from any "integrated" solutions, cause that would require us to replace nagios, which is a big task. All I really wanted is something that can import the configs, so we can sort through it, and then export it back out without too much unecessary modification, although I think even Fruity does some of its own directory structure.

Anyway, will have another look at Centreon as well.