Monday, March 8, 2010

SAHI – Web Automation & Application Security Testing Tool

Sahi is an automation tool to test web applications. Sahi injects javascript into web pages using a proxy and the javascript helps automate web applications.

Sahi is a tester friendly tool. It abstracts out most difficulties that testers face while automating web applications. Some salient features include excellent recorder, platform and browser independence, no XPaths, no waits, multi-threaded playback, excellent Java interaction and inbuilt reporting.

Features

  • Browser and Operating System independent
  • Powerful recorder which works across browsers
  • Powerful Object Spy
  • Intuitive and simple APIs
  • Javascript based scripts for good programming control
  • Version Controllable text-based scripts
  • In-built reports
  • In-built multi-threaded or parallel playback of tests
  • Tests do not need the browser window to be in focus
  • Command line and ant support for integration into build processes
  • Supports external proxy, HTTPS, 401 & NTLM authentications
  • Supports browser popups and modal dialogs
  • Supports AJAX and highly dynamic web applications
  • Scripts very robust
  • Works on applications with random auto-generated ids
  • Very lightweight and scalable
  • Supports data-driven testing. Can connect to database, Excel or CSV file.
  • Ability to invoke any Java library from scripts

Limitations

  • Framesets/pages with frames/iframes loading pages from multiple domains is not supported. Sahi cannot handle pages which have other pages from different domains embedded in them using iframes or frames. So you cannot have a page from google.com having an iframe with a page from yahoo.com. Note that this is not the same as switching between domains, where you navigate from a google.com page to a yahoo.com page, which will work in Sahi.
  • File upload field will not be populated on browsers for javascript verification. File upload itself works fine

You can download SAHI here:

http://sourceforge.net/projects/sahi/files/sahi-v3/2010-03-02/sahi_20100302.zip/download

Sunday, March 7, 2010

keimpx – Open Source SMB Credential Scanner

keimpx is an open source tool, released under a modified version of Apache License 1.1. It can be used to quickly check for the usefulness of credentials across a network over SMB. Credentials can be:

  • Combination of user / plain-text password.
  • Combination of user / NTLM hash.
  • Combination of user / NTLM logon session token.

If any valid credentials has been discovered across the network after its attack phase, the user is asked to choose which host to connect to and which valid credentials to use, then he will be prompted with an interactive SMB shell where the user can:

  • Spawn an interactive command prompt.
  • Navigate through the remote SMB shares: list, upload, download files, create, remove files, etc.
  • Deploy and undeploy his own service, for instance, a backdoor listening on a TCP port for incoming connections.
  • List users details, domains and password policy.

You can download keimpx 0.2 here:

http://keimpx.googlecode.com/files/keimpx-0.2.zip

Thursday, February 25, 2010

Web Security Dojo v1.0 release

Web Security Dojo is a turnkey web application security lab with tools,
targets, and training materials built into a Virtual Machine(VM).
It is ideal for both self-instruction and training classes since
everything is pre-configured and no external network connection is
needed. All tools and targets are configured to use non-conflicting
ports and a Firefox proxy switcher is set up to match.

Web Security Dojo is an open source project built on Ubuntu and hosted
at SourceForge. It is available in three flavors: a Virtualbox VM, VMWare VM, and a build script which can be used on a standard Ubuntu 9.10 install to produce the Dojo.
Collaboration and contributions are welcomed.

Major highlights:
Targets:
* OWASP WebGoat
* Damn Vulnerable Web App
* Hacme Casino
* OWASP InsecureWebApp
* custom PHP scripts including REST and JSON labs

Tools:
* Burp Suite (free version)[Thanks to Portswigger for permission to
redistribute]
* w3af
* OWASP Skavenger
* OWASP Dirbuster
* Paros
* Webscarab
* Ratproxy
* sqlmap
* helpful Firefox add-ons

For a quick start grab the VM from http://dojo.mavensecurity.com and
read the included Readme file and/or watch the intro video at
http://www.youtube.com/watch?v=lum6bSsyJ38.

Web Security Dojo v1.0 is now available for free at
http://dojo.mavensecurity.com

Thursday, January 22, 2009

Twitter for Data Mining and Information Gathering

Twitter is a power research tool.People increasingly use Twitter to share advice, opinions, news, moods, concerns, facts, rumors, and everything else imaginable. Much of that data is public and available for mining.

Here’s how to use Twitter to gather useful information about topics, companies, and individuals. I’ll cover native Twitter features, as well as third-party tools with catchy names, such as 5and2fish, Twitter Venn, TwitterFriends, PeopleBrowsr , Twitturly, Twitter Spectrum, and others.

Most of the techniques mentioned here don’t require you to be a registered Twitter user. If you use Twitter, consider what data tidbits you release there, and whether you need to be more careful.

People don’t tend to be so careful or post in such a considered manner when using Twitter as the tidbits posted are so short and off-the-cuff.

This leads to an interesting source of information for people like us doing research about an individual or organization. You can really get a good gauge on the publics feelings for a certain topic too by searching Twitter for relevant keywords.

As you gather information on Twitter, be mindful of others attempting to manipulate you into arriving at their conclusions by feeding you misinformation. Cross-check data and understand its sources.

Information security professionals can use this tool for information gathering during the stage1 of an attack phase.

Wednesday, January 21, 2009

AWLG( Associative Word List Generator) - Create Related Wordlists for Password Cracking

About AWLG

The Associative Word List Generator (AWLG) is a tool that generates a list of words relevant to some subjects, by scouring the Internet in an automated fashion.

Inclusion Example: A search string including the words (without quotes): “John” would give us a word list with lots of words associated with the actor John. This includes all of the words from his MySpace page, words from the Wikipedia article on him, etc.

Exclusion Example: We know that John is an actor for lots of things, including a show called “Sex and the city”. A search string: “John” with omissions: “blog” and “Office” would find words from websites that mention John, but do not mention the word “blog”, “Office”, or “watever”.

wyd the password profiling tool also does something similar to AWLG but it’s a PERL script rather than being based online.


Privacy policy

AWLG.org does not record any transmitted search strings or user information. AWLG.org does record statistical information such as total site usage, total number of words generated per search, etc.

You can get cracking with AWLG here:

http://awlg.org/index.gen

Tuesday, January 20, 2009

IBM Rational App Scan 7.7

IBM Rational AppScan is a leading suite of automated Web application security and compliance assessment tools that scan for common application vulnerabilities, generate actionable reports, and help manage regulatory and standards compliance in online environments. These products are designed for the broadest range of users—from non-security professionals to advanced power users who can utilize the added tools and extensions to create a customized scanning environment.

Where is this IBM Rational Appscan come from ?
Formally Watchfire Corporation before its acquisition by IBM in July 2007.

  • This scanner comes in three different editions:-

    1. Standard Edition
      • Targeted at standalone usage scenarios.
      • Black-box testing tool (does not require source code but requires a running system).
      • Underlying implementation technology independent.
      • Works by crawling an entire website (link depth and type is configurable) after been given a root URL.
      • Suggests common fixes when vulnerabilities are found but cannot automatically fix them. (Obviously since it has no knowledge or access to the underlying code!)
      • Will not be able to detect threats on pages that are not explicitly defined in the test, exist as links in the website or directories that do not allow listing.
      • Supports legal and regulatory compliance by scanning against well known policies (e.g. Sarbanes-Oxley, HIPAA, PCI Data Security Standard, OWASP Top Ten) and generate the necessary reports.
      • Requires regular updates to keep up with latest threat signatures (like anti-virus software).
      • Must run full suite of tests after an update as the tool is unable to determine the delta.
      • Includes a whole bunch of advanced tools for penetration testers.
      • Supports only Windows Platform for running the tool.

    2. Tester Edition
      • Targeted as part of the Quality Assurance process usage.
      • Contains same features as the Standard Edition plus the following.
      • Automatic test creation, modification and maintenance capabilities to enable testing and remediation.

    3. Enterprise Edition
      • Targeted at multi-user environments.
      • Contains same features as the Standard Edition plus the following.
      • Centralized test management and reporting, remote scanning administration.
      • Continuous monitoring and aggregation of metrics to ensure remediation and trend improvement over time.
      • Sophisticated dashboards and flexible reporting views to provide enterprise-wide visibility of risks and remediation progress.
      • Web based access for users.
      • Supports only Windows Platform for server components.
    4. New eXtensions have been added, including Scan Expert Extensions, an eXtensible Panel in the Main Window, and saving manually found issues.
    5. IBM Rational AppScan's scan configuration has been re-architected for improved flow efficiency.
    6. The product has 44 out-of-the-box compliance reports. New reports include Family Education Rights and Privacy Act (FERPA), Freedom of Information and Protection of Privacy Act (FIPPA) and Payment Application Best Practices (PABP).
For more information http://www.ibm.com/software/awdtools/appscan/

Sunday, January 18, 2009

OWASP (Open Web Application Security Project) Testing Guide v3 Released

This project’s goal is to create a “best practices” web application penetration testing framework which users can implement in their own organizations and a “low level” web application penetration testing guide that describes how to find certain issues.

Version 3 of the Testing Guide was released in last month in December 2008, the project was part of the OWASP Summer of Code, started on April 2008 reviewing the version 2 and improving it.

OWASP Testing Guide v3 is a 349 page book; they have split the set of active tests in 9 sub-categories for a total of 66 controls to test during the Web Application Testing activity.

Each control has an OWASP name, so for example a SQL Injection is called: OWASP-DV-005, meaning that it is the 5th control of the Data Validation category. They got a dream team of 21 authors and 4 reviewers: after 6 months of hard work and great team work we realized the v3.

You can download the pdf book from here :-

http://www.owasp.org/images/5/56/OWASP_Testing_Guide_v3.pdf

BROWSER RIDER : WEB Browser Exploitation Framework

Browser Rider is a hacking framework to build payloads that exploit the browser. The project aims to provide a powerful, simple and flexible interface to any client side exploit.

Browser Rider is a hacking framework to build payloads that exploit the browser. The project aims to provide a powerful, simple and flexible interface to any client side exploit

Features

  • Easily create powerful payloads and plugins
  • Manage payloads automatically with plugins
  • All data can be saved in a database
  • Obfuscation
  • Polymorphism
  • Control more than one zombie at a time
  • Simple administration panel

Requirements

  • PHP 5, with json installed
  • Mysql
  • Apache with url_rewrite on
  • Targets must have Javascript turned on

You can download Browser Rider here:

http://www.engineeringforfun.com/cave/browserrider/BrowserRider.20081124.tar.bz2

Saturday, January 17, 2009

.NETIDS - .NET Intrusion Detection System

This tool is another one on the side of protection, again for web-based applications but this time for .NET applications it’s called .NETIDS (.NET Intrusion detection System). This tool is capable of detecting on attacks on web applications and gives the developer the possibility to react. The project files include filter rules and function stubs to react on possible intrusions which may vary from logging to warning or redirecting the user.

The goal of this project is to provide am additional layer of protection to any .NET application this project is used with. This also includes the detection of XSS, directory traversal, SQL injections, protection against overwriting JS objects and methods, advanced logging functions, categorization and tagging of the single filter rules and interfaces for reacting on possible intrusions.

.NET IDS is a actually a port of PHPIDS, which we’ve mentioned before, to the .NET Framework. The library is fully CLS compliant and implements exactly the same filtering sets as the PHP version.

.NETIDS can be used in three ways.

The first method is by inheriting your ASP.NET pages from the SecurePage class. This offers an easy and customizable way to scan page input. If you are relatively new to the .NET Framework this is the simplest way to secure your applications.

The second method is more customizable but harder to implement for novice programmers and involves working directly with the IDS objects.

The third method (available in the upcoming release) is by using the supplied HttpModule.


You can find the documentation here:

http://www.the-mice.co.uk/dotnetids/docs/

You can download .NET IDS v.0.1.3.0 here:

http://dotnetids.googlecode.com/files/dotnetids-bin-0_1_3_0.zip



FireCAT 1.5 Released - Firefox Catalog of Auditing Extensions

FireCAT (Firefox Catalog of Auditing exTension) is a mindmap collection of the most efficient and useful firefox extensions oriented application security auditing and assessment

FireCAT 1.5 will be the last release of this 1.x branch. In fact, we are working on a new improved version 2.0 (management of plugins, instant download from security-database, ability to add new extension, extension version checker, Firefox 3.X compatible extensions..)

Categories :

  • New sub-category added “Anti Phising / Pharming / Jacking” under “Misc”
  • Renamed category “Network utilities” to “Network tools”
  • Added new sub-category “Protocols/Application” under “Network tools”
  • Added sub-category “Passwords” under “Network tools”

Extensions:

  • TraceAssure added in “Misc -> Anti Phishing”
  • Added Surf Jacking Cookie Security Inspector in “Misc->Anti phishing /pharming/jacking” : This extension is based on Sandro Gauci’s paper
  • Added entry Exploit-Me Suite in category “Security auditing”
  • Access-Me added in “Security auditing -> Exploit-Me Suite”
  • Added DNS Unpinning in “Network tools -> Protocols/application”
  • Added UnhidePassword in “Network tools -> Passwords”
  • Added BestSecurityTip in IT Security Related
  • Fixed links to SQL Inject-Me and XSS-Me
You can download Firecat 1.5 here : http://www.security-database.com/toolswatch/IMG/zip/FireCAT_1.5.mm.zip

Top Ten Windows Hacking tools

1. Cain & Abel - Cain & Abel is a password recovery tool for the Microsoft Windows Operating System. It allows easy recovery
of various kind of passwords by sniffing the network, cracking encrypted passwords using Dictionary, Brute-Force and Cryptanalysis attacks, recording VoIP conversations, decoding scrambled passwords, revealing password boxes, uncovering cached passwords and analyzing routing protocols.

2. SuperScan - SuperScan is a powerful TCP port scanner, pinger, resolver. SuperScan 4 (Current Version) is a completely-rewritten update of the highly popular Windows port scanning tool, SuperScan.

3. GFI LANguard Network Security Scanner - GFI LANguard N.S.S. is a network vulnerability management solution that scans your network and performs over 15,000 vulnerability assessments. It identifies all possible security threats and provides you with tools to patch and secure your network. GFI LANguard N.S.S. was voted Favorite Commercial Security Tool by NMAP users for 2 years running and has been sold over 200,000 times!

4. Retina - Retina Network Security Scanner, recognised as the industry standard for vulnerability assessment, identifies known security vulnerabilities and assists in prioritising threats for remediation. Featuring fast, accurate, and non-intrusive scanning, users are able to secure their networks against even the most recent of discovered vulnerabilities.

5. SamSpade - SamSpade provides a consistent GUI and implementation for many handy network query tasks. It was designed with tracking down spammers in mind, but can be useful for many other network exploration, administration, and security tasks. It includes tools such as ping, nslookup, whois, dig, traceroute, finger, raw HTTP web browser, DNS zone transfer, SMTP relay check, website search, and more.

6. N-Stealth - N-Stealth is a commercial web server security scanner. It is generally updated more frequently than free web scanners such as whisker and nikto, but you have to pay for the privilege.

7. Solarwinds - Solarwinds contains many network monitoring, discovery and attack tools. The advanced security tools not only test internet security with the SNMP Brute Force Attack and Dictionary Attack utilities but also validate the security on Cisco Routers with the Router Security Check. The Remote TCP Reset remotely display all active sessions on a device and the Password Decryption can decrypt Type 7 Cisco Passwords. The Port Scanner allows testing for open TCP ports across IP Address and port ranges or selection of specific machines and ports.

8. Achilles - The first publicly released general-purpose web application security assessment tool. Achilles acts as a HTTP/HTTPS proxy that allows a user to intercept, log, and modify web traffic on the fly. Due to a cyber squatt.

9. CookieDigger - CookieDigger helps identify weak cookie generation and insecure implementations of session management by web applications. The tool works by collecting and analyzing cookies issued by a web application for multiple users. The tool reports on the predictability and entropy of the cookie and whether critical information, such as user name and password, are included in the cookie values.

10. Netcat (The Network SwissArmy Knife) - Netcat was originally a Unix utility which reads and writes data across network connections, using TCP or UDP protocol. It is designed to be a reliable “back-end” tool that can be used directly or easily driven by other programs and scripts. At the same time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities.

Monday, April 21, 2008

Introduction to Intrusion Detection (BASICS)

There is something even worse than having your computer hacked and abused for some malicious purpose: Getting hacked and never finding out about it. There is no absolute protection against an illegal intrusion. Someone might figure out a new vulnerability and exploit it on your servers before it is publicly known that this vulnerability exists. This could happen even if you have applied all current security patches. If the vulnerability is not generally known, there is no patch to install
against it. But in general, an intruder leaves some traces behind. Making it hard for the intruder to obscure his trail and interpreting any traces you find is what intrusion detection is about.



The main Objectives of this Blog includes :-

1. Log Files and Their Evaluation.
2. Host-Based Intrusion Detection.
3. Network-Based Intrusion Detection.
4. Incident Response.

Log Files and Their Evaluation

Log files are a valuable tool for detecting intrusions. However, oncesomeone has taken over a computer and become root, she can manipulate the log files to obscure any traces of her activity. Manipulating log files can consist of deleting entries or trying to hide the relevant information by filling the log files with huge amounts of irrelevant entries. One way to prevent the manipulation of log files by deletion of entries is to not only log on the host itself, but to send the log information across the network to another host.
The intruder could stop the sending of logging information to the log host, but the lack of entries would alert you, as would any suspicious ones. Depending on the security needs, the log host can even write the logs onto a worm (write once, read many) medium, making it impossible to change them even if the log host is compromised. Another approach is to have a log host without any network connection. Log messages in this case would be transferred using a serial connection. This setup would make it impossible for an intruder to access the log host via the network.

But even if the incident is logged, you still have to become aware of the relevant log entries. There are tools that help to filter relevant log entries and bring them to your attention. This objective explains how to :-
■ Log to a Remote Host
■ Evaluate Log Files and Run Checks

Log to a Remote Host

The syslog-ng used to log system messages on SUSE Linux Enterprise Server 10 can send messages to and receive messages from other computers. The receiving computer is sometimes
referred to as loghost. Configuration changes are necessary on both sides:-
■ Client Side Configuration of Syslog-ng
■ Server Side Configuration of Syslog-ng


Client Side Configuration of Syslog-ng Logging to other computers is configured in
/etc/syslog-ng/syslog-ng.conf.in, as in the following example:

destination tologhost { udp(10.0.0.254 port(514)); };
log { source(src); destination(tologhost); };

The first line defines a destination tologhost, with protocol, IP address (you could also use the host name), and port. The second line configures logging to this destination. Because no filter is included, all messages from the source src get sent to the destination tologhost. After editing the file /etc/syslog-ng/syslog-ng.conf.in, run SuSEconfig --module syslog-ng to transfer the changes to /etc/syslog-ng/syslog-ng.conf, which is the actual configuration file used by syslog-ng.

Server Side Configuration of Syslog-ng

To receive messages, syslog-ng has to listen on a port, usually port 514. Unlike syslogd, which only supports UDP connections, syslog-ng also supports TCP .

To bind to a port, you have to add a line within a source section.You can either add it to the existing source src section, or create a new one, as in the following:

source network {
udp(ip("10.0.0.254") port(514));
};

Using 0.0.0.0 as the IP address causes syslog-ng to bind to all
available interfaces.
Then a destination and a log entry are required:

destination digiair { file("/var/log/$HOST"); };
log { source(network); destination(digiair); };

The first line defines the destination digiair; each host’s log entries get written to a file with the hostname as file name. The log entry directs messages from the source network to the destination digiair.

Evaluate Log Files and Run Checks

Depending on the activity on the computer, log files can grow by several MB each day. The problem you are faced with is how to find any suspicious entries within this huge amount of data. Without specific tools, it becomes very difficult to find out about unusual activities or security violations. There are several tools that help to extract relevant entries from log files and other sources. There are tools to

■ Extract Information from Log Files
■ Run Security Checks

You can also write scripts of your own that alert you when certain entries appear in a log file.

Extract Information from Log Files

The following introduces two tools used to extract relevant information from log files:

■ logcheck
■ logsurfer

logcheck :-

logcheck parses system logs and generates email reports based on anomalies. In the beginning, logcheck produces long reports. You have to modify the configuration of logcheck so that entries that are harmless do not turn up in the report anymore. After that initial phase, the reports mailed by logcheck should contain only relevant information on security violations and unusual activities. logcheck should be called regularly via cron to parse log files. Because logcheck remembers the point up to which a log file was scanned previously, only the new section is scanned on the next call.

Logcheck is not included with SUSE Linux Enterprise Server 10. You can
get it at http://logcheck.org/.

logsurfer

The disadvantage of parsing log files line by line is that each line is independent of all other lines. However, you might want additional information when a certain entry is found in the log file. logsurfer offers this functionality with contexts: Several lines matching a pattern can be stored in memory as a context. Depending on further patterns in the log file, such a context could be mailed to you for your inspection, or some other action, such as starting a program, could be triggered. The context could be deleted again if this pattern is not found within a certain time or number of lines. It is also possible to dynamically create or delete matching rules,
depending on entries in the log file.Because logsurfer can be configured in great detail, the configuration is not trivial. However, the advantage is that you can configure precisely what should happen under what circumstances .

Logsurfer is not included with SUSE Linux Enterprise Server 10. It can be found under http://www.cert.dfn.de/eng/logsurf/.

Run Security Checks

In addition to checking configuration files, you can run other checks to find out about system configurations that could constitute a security danger. Automated checks usually consist of scripts that are called in regular intervals and inform you, for instance, by email, of what was found. While such scripts can also detect a system compromise under certain circumstances, you should be aware that a successful intruder can modify such scripts to avoid detection.

The following are described:
■ seccheck
■ Custom Scripts
■ Monitor Login Activity from the Command Line

seccheck

The package seccheck offers a series of scripts that check the
computer regularly (daily, weekly, and monthly) and send reports to
you. Items checked by the scripts are

■ Kernel modules loaded
■ SUID files
■ SGID files
■ Bound sockets
■ Users with accounts who never logged in
■ Weak passwords
An email is sent to root detailing what was found.

Custom Scripts
There is no limit to what you can check or have sent to you using
shell or Perl scripts.
Some possibilities are
■ Output of last
■ Output of df
■ Output of netstat
■ Output of ps
■ /etc/passwd to check if an account other than root has UID 0.

Monitor Login Activity from the Command Line

Monitoring tasks include evaluating login activity for signs of a security breach, such as multiple failed logins.To monitor login activity, you can use the following commands:

■ who. This command shows who is currently logged in to the
system and information such as the time of the last login.
You can use options such as -H (display column headings), -r
(current runlevel), and -a (display information provided by most
options).

For example, entering who -H returns information similar to the
following:

da10: ~ # who -H
NAME LINE TIME Command
root 0 Aug 23 05:41 (console)
geeko pts/2 Aug 24 02:32 (10.0.0.50)
da10:~ #


■ w. This command displays information about the users currently on the computer and the processes they are running. The first line includes information such as the current time, how
long the system has been running, how many users are currentlylogged on, and the system load averages for the past 1, 5, and 15 minutes.

Below the first line is an entry for each user that displays the login name, the tty name, the remote host, login time, idle time, JCPU, PCPU, and the command line of the user’s current
process. The JCPU time is the time used by all processes attached to the tty. It does not include past background jobs but does include currently running background jobs.

The PCPU time, specified in the What field, is the time used bythe current process.

You can use options such as -h (don’t display the header), -s (don’t display the login time, JCPU, and PCPU), and -V (display version information). For example, entering w returns information similar to the following:

da10: ~ # w
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
root 0 Mon05 ?xdm? 1:48 0.02s -0
geeko pts/2 02:32 0.00s 0.10s 0.02s ssh: geeko [priv]
da10:~ #

You could also use w within scripts.

■ finger. This command displays information about local and
remote system users. By default, the following information is
displayed about each user currently logged in to the local host:
❑ Login name
❑ User's full name
❑ Associated terminal name
❑ Idle time
❑ Login time and location
You can use options such as -l (long format) and -s (short
format).
For example, entering finger -s returns information similar to
the following:

da10: ~ # finger -s
Login Name Tty Idle Login Time Where
geeko The SUSE Chameleon pts/2 - Tue 02:32 10.0.0.50
root root 0 54d Mon 05:41 console
da10:~ #

■ last. This command displays a list of the last logged-in users. Last searches back through the file /var/log/wtmp (or the file designated by the option -f) and displays a list of all users logged in (and out) since the file was created.
You can specify names of users and tty's to only show information for those entries. You can use options such as -num (where num is the number of lines to display), -a (display the hostname in the last column),and -x (display system shutdown entries and runlevel changes).

For example, entering last -ax returns information similar to the following:

da10: ~ # last -ax
root pts/0 Thu May 4 12:00 still logged in
da10.digitalairlines.com
runlevel (to lvl 5) Thu May 4 11:45 - 12:03 (00:17) 2.6.16.11-7-smp
reboot system boot Thu May 4 11:45 (00:17) 2.6.16.11-7-smp
shutdown system down Thu May 4 10:26 - 12:03 (01:37) 2.6.16.11-7-smp
runlevel (to lvl 0) Thu May 4 10:26 - 10:26 (00:00) 2.6.16.11-7-smp
...
wtmp begins Tue May 2 12:20:52 2006
da10:~ #

■ lastlog. This command formats and prints the contents of the last login log file (/var/log/lastlog). The login name, port, and last login time are displayed. Entering the command without options displays the entries sorted by numerical ID.
You can use options such as -u login_name (display information for designated user only) and -h (display a one-line help message).If a user has never logged, in the message **Never logged in**
is displayed instead of the port and time.

For example, entering lastlog returns information similar to the following:

da10:~ # lastlog
Username Port Latest
at **Never logged in**
bin **Never logged in**
...
ntp **Never logged in**
postfix **Never logged in**
root pts/0 Thu May 4 12:00:45 +0200 2006
sshd **Never logged in**
suse-ncc **Never logged in**
uucp **Never logged in**
wwwrun **Never logged in**
geeko :0 Wed May 3 09:14:55 +0200 2006
squid **Never logged in**
da10:~ #

■ faillog. This command formats and displays the contents of the failure log (/var/log/faillog) and maintains failure counts and limits. You can use options such as -u login_name (display
information for designated user only) and -p (display in UID order).
The command faillog only lists users with no successful login since the last failure. To list a user who has had a successful login since his last failure, you must explicitly name the user
with the -u option.

Entering faillog returns information similar to the following:

da10:~ # faillog
Login Failures Maximum Latest On
geeko 1 3 03/03/06 13:33:25 +0100 /dev/tty2
da10:~ #

The faillog functionality has to be enabled by adding the module pam_tally.so to the respective file in /etc/pam.d/, for instance /etc/pam.d/login:

#%PAM-1.0
auth required pam_securetty.so
auth required pam_tally.so no_magic_root per_user
auth include common-auth
auth required pam_nologin.so
account required pam_tally.so no_magic_root

The rest of the file does not need to be changed.

Reviewing files such as /var/log/messages also gives you information about
login activity.

Will Be Continued =

DOUBTS and COMMENTS are WELCOME :)