vendredi 25 février 2011

Dead Drops


‘Dead Drops’ is an anonymous, offline, peer to peer file-sharing network in public space. USB flash drives are embedded into walls, buildings and curbs accessable to anybody in public space. Everyone is invited to drop or find files on a dead drop. Plug your laptop to a wall, house or pole to share your favorite files and data. Each dead drop is installed empty except a readme.txt file explaining the project. ‘Dead Drops’ is open to participation. If you want to install a dead drop in your city/neighborhood follow the ‘how to’ instructions and submit the location and pictures.

Moblin

Moblin is an open source project focused on building a Linux-based platform optimized for the next generation of mobile devices including Netbooks, Mobile Internet Devices, and In-vehicle infotainment systems.

How to test with a USB drive ?

1) download the image
2) Use 'dd' from the command-line

# dd bs=4096 if=<image file> of=<usb drive>

3) Boot your PC from USB 

Informations from wikipedia : 

Moblin, short for 'mobile Linux', was an open source operating system and application stack for Mobile Internet Devices (MIDs), netbooks, nettops and embedded devices.[1] Now it is called MeeGo. Built around the Intel Atom processor, current builds are designed to minimize boot times and power consumption to create a netbook and MID-centric operating system. The netbook/desktop version of Moblin currently supports other chipsets based on the SSSE3 instruction set, such as the Core2 and some Celeron processors.
Commercial products built around Moblin 2 include a Foxconn netbook[2] and an InvenTech smartphone[3], both announced at Computex 2009. Acer has also announced the replacement of Linpus Linux with Moblin on their Acer Aspire One netbooks.[4][5] For its mobile Internet device class smartphone LG GW990, LG Electronics chose Moblin OS 2.1[6][7]. More recently, Dell began accepting orders for its Ubuntu Moblin Remix, a Canonical Ltd. project that builds Moblin using a more full-featured Ubuntu distribution as base [8]. Mandriva has started to offer Moblin's v2 version to all Mandriva distribution and netbook owners. [9]
At the Consumer Electronics Show in January 2010, MSI and Novell announced the upcoming availability of SUSE Moblin preloaded on the MSI U135 netbook. Following the recent release of Moblin version 2.1, this marks the first original equipment manufacturer (OEM) to sell a fully-supported Intel Atom processor-based netbook running Moblin-based technology to consumers. It was demonstrated at both the MSI and Intel booths at the show.[10] In addition, Samsung showed four netbooks preloaded with SUSE Moblin.
At the Mobile World Congress in February 2010, it was announced that the Moblin project would be merging with Maemo to create the MeeGo mobile software platform.



Project web site : http://moblin.org/

jeudi 24 février 2011

La TV live en streaming avec mplayer

BFM:
mplayer mms://vipmms9.yacast.net/bfm_bfmtv


à tester :

  • La chaîne parlementaire : mplayer mms://vipmms9.yacast.net/rcs_lcplive
  • France 0 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=france_o
  • France 2 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=france_2
  • France 3 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=france_3
  • France 4 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=france_4
  • France 5 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=france_5
  • Arte : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=arte
  • Direct 8 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=direct_8
  • NT 1 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=nt1
  • NRJ 12 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=nrj12
  • Euronews : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=euronews
  • TV 5 : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=tv5_monde
  • Liberty TV : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=liberty_tv
  • Beur TV : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=beur_tv
  • NRJ Hits : mplayer -playlist http://80.118.196.219/webtv-asx.cgi?channel=nrj_hits



Votre Linux est-il vraiment libre ?



Vous souhaitez savoir si votre Système GNU/Linux est libre ?
Et si ce n’est pas le cas comment faire pour le rendre libre ?
VRMS (Virtual Richard Matthew Stallman ) se charge de ça
Pour l’installer rien de plus simple (en root) :
# apt-get install vrms
Ensuite on le lance dans un terminal (oui pas d’interface graphique) :
# vrms
Et tout de suite les statistiques apparaissent.

Lubuntu ou la distrub linux graphique legère

Lubuntu est une variante d'Ubuntu dont l'environnement de bureau est LXDE (tout comme Kubuntu et Xubuntu qui ont pour environnement de bureau respectivement KDE et Xfce).

Quelques infos sur wikipedia

Voici un comparatif d'utilisattion mémoire en live CD :
  • Lubuntu : 57,908 KB
  • Xubuntu : 156,852 KB
  • Ubuntu : 153,840 KB
Même si il est possible d'installer tous les logiciels disponibles pour Ubuntu, Lubuntu choisit les plus légers :
  • Google Chrome : Le navigateur Web (je préfère Midori)
  • Claws Mail : Le client Mail que j'utilise
  • Gpicview : Visionneur d'images
  • MTpaint : Retouche d'images (beaucoup plus rapide que Gimp)
  • Aqualung : Lecteur audio
  • SMPlayer : Lecteur vidéo
  • Abiword : Le traitement de texte poids plume (mais efficace)

Plusieurs marqueurs avec Google Maps


mercredi 23 février 2011

Acer Liquid - Recovery

Recovery :
=======

1. eteindre le téléphone
2. appuyer sur camera + volume down et sans relacher appuyer sur power
3. Le telephone vibre alors 2 fois
4. relachez les boutons
3. Appuyer sur power.

15 Useful Android Terminal (ADB Shell) Commands

While rooting your Android Phone or installing custom ROM on your mobile or partitioning your android device to install applications, requires some android terminal command and ADB (Android Debug Bridge) shell command knowledge. Below is the list of some basic android commands that are being used on Android platform frequently and that every android user must know.
android adb shell
Basic Android Terminal and ADB Shell Command List

1. How to open a cmd in Android Phone

Method 1: “Start” – “”Program”-” “Accessories” – “” Command Prompt ”
Method 2: “Start” – “” Run “, type cmd ENTER

2. How to restart Android Phone
When the phone and Computer is connected to the data cable, you can enter the following command

adb shell reboot === ENTER

3. Restart Android into Recovery Mode
With the data cable connected to your phone and computer, enter the following command

adb shell reboot recovery === ENTER

4. Convert back to ext2 partition
Restart the phone into Recovery mode, press “Alt + X” into the console. Open cmd and enter the following command

1 adb shell === ENTER
2 tune2fs-O ^ has_journal / dev/block/mmcblk0p2 === carriage return
3 e2fsck / dev/block/mmcblk0p2 === carriage return (optional, can be a problem area in section 2, when used)

5. Pulling applications from Android phone to computer

adb pull /system/sd/app app
adb pull /system/sd/app-private app-private

6. Pushing applications back to android phone from the computer

adb push app /system/sd/app
adb push app-private /system/sd/app-private

7. Delete existing apps on Android SD

adb shell rm -r /system/sd/app
adb shell rm -r /system/sd/app-private

8. Repair gravity System or switch to screen
Sometimes frequent brushing of phone can cause gravity system or switch to screen failure. Just follow the steps below-
Restart the phone into Recovery mode, press “Alt + X” into the console
Open cmd and enter the following command

mount / data === carriage return
rm / data / misc / akmd * / data / misc / rild * === ENTER

9. Ext2/ext3/ext4 formatted partition
Enter the following command in the cmd

adb remount === ENTER
adb shell === ENTER
rm-r / system / sd / * === carriage return

10. Remove/ system / app under the application

Under normal circumstances / system / app is not under an application. Use the following methods to remove these applications.
Open cmd and enter the following command

adb remount === ENTER
adb rm / system / app / Stocks.apk === Enter

11. If the start Time is too Long
Just enter the following command in order to view the boot process.

adb logcat === ENTER

12. Through Terminal Partition SD card
It will erase everything on your SD card

$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
# chmod 555 sdsplit
# /data/sdsplit -fs *size* (add -nc to the end for JFv1.5ADP)

13. From the Recovery Screen, send an update file to your SD card.

adb shell mount /sdcard
adb shell rm /sdcard/update.zip
adb push *filename* /sdcard/update.zip

14. Restoring a nandroid backup via Fastboot
Start command-prompt/terminal cd to the nandroid folder and enter following commands

fastboot erase boot
fastboot erase recovery
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash userdata data.img
fastboot flash recovery recovery.img
fastboot reboot

15. Clear Search History in Android

Search History is accounted for Mobile Memory. It can also leak your privacy information as well. Just follow the steps below to clear android history.

Steps are as follows:

1. Make sure your mobile phone has Root authority.
2. Open the super-terminal.
3. Enter the following command

su
rm / data / data / com.android.vending / databases / suggestions.db

4. Exit Hyper Terminal and restart the phone.

Source : http://www.gadgetsdna.com/android-terminal-adb-shell-command-list/1168/

vendredi 11 février 2011

Extraire une page d'un fichier .ps ou .pdf

Pour les pdf en installant "pdftk" (très pratique au passage), on peut faire ça.

Par exemple pour extraire les pages 2 à 5 et 23 à 45 d'un pdf (bash.fr) vers un nouveau document (test.pdf) :
pdftk bash.pdf cat 2-5 23-45 output test.pdf

jeudi 10 février 2011

Comparer des pays ????

Sur le site suivant :
http://www.ifitweremyhome.com/

qui semble se baser sur celui ci : https://www.cia.gov/library/publications/the-world-factbook/

Télécharger les tableaux de Google Art Project

Télécharger les tableaux de Google Art Project
Il y a quelques jours, je vous présentais Google Art Project qui permet de visiter quelques uns des plus beaux musées du monde. Google a numérisé de nombreuses oeuvres en très haute définition pour notre plus grand plaisir ! Mais c’était sans compter sur Bohwaz qui a mis au point un petit script PHP plutôt bien foutu, qui permet de récupérer les oeuvres en haute définition sur votre disque dur.
Le script se connecte à l’url de l’oeuvre que vous lui donnez, et il récupère chaque morceau de l’image avant de les reassembler pour n’en faire qu’une que vous pourrez par exemple vous mettre en fond d’écran. C’est terriblement efficace et super simple à mettre en place.
Voici comment faire :
Il faut être sous Linux et vous devez avoir installé ImageMagick et PHP en ligne de commande : sudo apt-get install php5-cli imagemagick
Ensuite, créez un fichier php et mettez le code source suivant dedans. Je l’ai sauvegardé sous le nom get.php.
Allez faire un tour sur Google Art Projet et choisissez une oeuvre qui vous plait. Pour ma part, j’ai choisi celle-ci que j’aime beaucoup.
Entrez ensuite la ligne de commande suivante :
php get.php http://www.googleartproject.com/museums/vangogh/seascape-near-les-saintes-maries-de-la-mer-46
cap 2011 02 09 à 03.48.41 Télécharger les tableaux de Google Art Project
Et observez ce qui se passe… Le script va récupérer chaque petit bout d’image pour ensuite reformer l’image d’origine qui a une résolution de dingue !
cap 2011 02 09 à 03.56.11 Télécharger les tableaux de Google Art Project
Youpi c’est beau !
J’ai cherché à savoir si ce tableau était tombé ou pas dans le domaine public mais je n’ai trouvé aucune information sur ce sujet… Mais si vous voulez récupérer des oeuvres, prenez uniquement celles qui sont dans le domaine public sinon, vous irez en enfer à Guantanamo, on congèlera vos enfants et on mangera vos vieux pour avoir osé télécharger une oeuvre numérisée.

Source : http://www.korben.info

lundi 7 février 2011

Afficher les informations des Intel Core i3, i5 et i7 sous Linux



i7z est un utilitaire pour Linux qui permet d'obtenir des informations sur les processeurs Intel Core i3, i5 et i7. On pourra ainsi vérifier le bon fonctionnement du mode Turbo (une technologie propre à ce modèle de CPU), ou afficher la fréquence d'utilisation de chacun des coeurs.

i7z
Pour installer i7z, ouvrez un terminal en root et lancez la commande suivante pour une distribution à base de Debian :
sudo apt-get install build-essential libqt4-dev qt4-qmake libncurses5-dev subversion
Ou celle-ci pour une distribution à base de RPM :
yum install qt qt4-devel libncurses5-devel subversion
Ensuite, on pourra compiler le programme comme ceci :
svn checkout http://i7z.googlecode.com/svn/trunk/ i7z-read-only
cd i7z-read-only
make
make install
Vous pourrez ensuite lancer le programme avec la commande i7z, en root, depuis une console. Le message suivant indiquera que le mode Turbo est désactivé (il faudra alors revoir les réglages de votre Bios) :
TURBO DISABLED on 4 Cores
Tandis que celui-ci confirmera son bon fonctionnement :
TURBO ENABLED on 4 Cores
Voici ce que j'obtiens chez moi, après avoir lancé un cat /dev/urandom > /dev/null dans un autre shell. Ici, on voit bien que le mode Turbo est actif avec des Multiplier à x22 sur les quatre coeurs du processeur :
Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
  TURBO ENABLED on 4 Cores, Hyper Threading ON
  True Frequency 3075.73 MHz (133.73 x [23])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  27x/26x/24x/24x
  Current Frequency 2942.09 MHz (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %
        Core 1 [0]:       2942.01 (22.00x)      3.38    0.923      0    95.7
        Core 2 [1]:       2942.00 (22.00x)       100       0       0       0
        Core 3 [2]:       2942.09 (22.00x)      2.52    1.53       0    95.9
        Core 4 [3]:       2940.99 (21.99x)         1    1.63       0    97.6
Si vous souhaitez utiliser l'interface graphique, il faudra se rendre dans le dossier GUI des sources et lancer la compilation comme ceci :
cd GUI
make clean
rm Makefile
qmake-qt4 -project
qmake-qt4
make
./GUI

Accélérer Firefox par la Ram sans TmpF

Précédemment j’utilisais TmpFS afin de déplacer  le cache de Firefox (Iceweasel sous debian) dans la mémoire vive (RAM). Le but principal étant d’accélérer le temps de chargement des pages vu que la RAM est plus rapide que le disque dur et, également de diminuer l’usure d’un SSD.
Hors, il existe une option dans Firefox pour utiliser le cache dans la mémoire vive, pour cela :
  1. Entrer « about:config » dans la barre d’adresse puis valider.
  2. Taper le mot clef « browser.cache » dans le champ de recherche.
  3. Passer la valeur « browser.cache.disk.enable » à « false ».
  4. Regarder que la valeur « browser.cache.memory.enable » est à « true ».
  5. Créer une nouvelle valeur numérique au nom « browser.cache.memory.capacity » ayant pour valeur « -1 » (taille dynamique).
  6. Redémarrer Firefox, Enjoy ^^.
Voilà, bonne année :D

Tuto pour avoir un joli boot-loader graphique

Par défaut GRUB est loin d’être élégant et sont interface fait vraiment peut moderne, mais il y a une façon de remédier à cela en utilisant BURG qui est un chargeur d’amorçage tout nouveau basé sur GRUB.
BURG est compatible avec plus de systèmes d’exploitations et dispose d’un système de menus hautement configurable qui travaille en mode texte et graphique.
ATTENTION : N’essayez pas ceci à moins de savoir vraiment ce que vous faites. Cette manipulation peut-être dangereuse pour votre système car il pourrait ne plus démarrer. Je ne fais que traduire cette source, je ne suis en aucun cas responsable de vos dégâts.
Ajouter le dépôt et le logiciel :
sudo add-apt-repository ppa:bean123ch/burg
sudo apt-get update && sudo apt-get install burg burg-themes
Réponder au questions durant l’installation des paquets, pour être sûr taper quand même cette commande à adapter selon votre MBR :
sudo burg-install « (hd0) » 
Mettre à jour le nouveau chargeur de démarrage (ça doit absolument marcher, sinon ne redémarrer plus…) :
sudo update-burg
Si tout c’est bien passé au démarrage vous aurez un joli thème que vous pourrez choisir en pressant la touche « t ».  Ou sinon vous pouvez visualiser directement les thèmes en tapant la commande « burg-emu » dans un terminal (presser la touche « c » puis taper « exit » pour quitter).


sources :
http://hackurx.wordpress.com/2010/06/21/tuto-pour-avoir-un-joli-boot-loader-graphique/
http://www.tux-planet.fr/ameliorez-votre-grub-avec-burg/
http://forum.ubuntu-fr.org/viewtopic.php?id=381017


vendredi 4 février 2011

Admin Setup Process / CentOS 64 bits

Configuration

Updated System

  • Configured Yum Priorities & to use our mirror
    • Edited /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.clarkson.edu/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
exclude=nmap

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror.clarkson.edu/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://mirror.clarkson.edu/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror.clarkson.edu/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirror.clarkson.edu/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror.clarkson.edu/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2
    • Edited /etc/yum.repos.d/rpmforge.repo
# Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
# URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
baseurl = http://mirror.clarkson.edu/rpmforge/redhat/el5/en/$basearch/dag
#mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=15
    • Edited /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
baseurl=http://mirror.clarkson.edu/epel/5/$basearch
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
priority=30

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
baseurl=http://mirror.clarkson.edu/epel/5/$basearch/debug
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
priority=30

[epel-source]
name=Extra Packages for Enterprise Linux 5 - $basearch - Source
baseurl=http://mirror.clarkson.edu/epel/5/SRPMS
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
priority=30
    • Edited /etc/yum.repos.d/epel-testing.repo
[epel-testing]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch
baseurl=http://mirror.clarkson.edu/epel/testing/5/$basearch
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
priority=40

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch - Debug
baseurl=http://mirror.clarkson.edu/epel/testing/5/$basearch/debug
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-debug-epel5&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
priority=40

[epel-testing-source]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch - Source
baseurl=http://mirror.clarkson.edu/epel/testing/5/SRPMS
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-source-epel5&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
priority=40
  • Disabled Yum FastestMirror since using local mirror
    • sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
  • Installed Yum Priorities (Note: This must be installed prior to installing the packages below.)
    • yum install yum-priorities
  • Configured Yum Priorities to check for obsoletes
    • echo "check_obsoletes=1" >> /etc/yum/pluginconf.d/priorities.conf
  • yum install vim-enhanced gcc emacs-nox screen net-snmp net-snmp-libs net-snmp-perl net-snmp-perl net-snmp-utils net-snmp-devel nmap
  • yum update

Created User

  • Created user mccarrms
    • /usr/sbin/useradd -m mccarrms
  • Set password for mccarrms
    • passwd mccarrms

Configured Sudo

  • /usr/sbin/visudo
## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.

## Networking
Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool

## Installation and management of software
Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum

## Services
Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig

## Updating the locate database
Cmnd_Alias LOCATE = /usr/sbin/updatedb

## Storage
Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount

## Delegating permissions
Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp

## Processes
Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall

## Drivers
Cmnd_Alias DRIVERS = /sbin/modprobe

## Shells
Cmnd_Alias SHELLS = /bin/sh, /bin/bash, /usr/bin/rsh, /bin/dash, /bin/rbash, /bin/su

## Users
Cmnd_Alias USERS = /usr/sbin/useradd, /usr/sbin/userdel

Defaults    requiretty

Defaults    env_reset,tty_tickets,lecture=always,logfile=/var/log/sudo.log
Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
                        LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
                        LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
                        LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
                        LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
                        _XKB_CHARSET XAUTHORITY"

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
%wheel  ALL=(ALL)       ALL
%admins ALL=(root) ALL, !SHELLS

Configured Networks

  • Configured hostname in /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=admin
GATEWAY=128.153.145.1
  • Verified eth0 configuration for Clarkson Network in /etc/sysconfig/network-scripts/ifcfg-eth0
# Xen Virtual Ethernet
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:16:36:17:47:B5
IPADDR=128.153.145.35
NETMASK=255.255.255.0
ONBOOT=yes
  • Verified eth1 configuration for Server Room Network in /etc/sysconfig/network-scripts/ifcfg-eth1
# Xen Virtual Ethernet
DEVICE=eth1
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:16:36:09:86:84
IPADDR=10.0.1.60
NETMASK=255.255.255.0
ONBOOT=yes
  • Verified eth2 configuration for Internal Network in /etc/sysconfig/network-scripts/ifcfg-eth2
# Xen Virtual Ethernet
DEVICE=eth2
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:16:36:24:48:B6
IPADDR=10.0.0.25
NETMASK=255.255.255.0
ONBOOT=yes

Configured Hosts

  • Edited /etc/hosts
127.0.0.1       localhost.localdomain   localhost
128.153.145.35  admin.cslabs.clarkson.edu admin.cslabs admin
10.0.1.60       admin.sr.cslabs.clarkson.edu admin.sr.cslabs admin.sr
10.0.0.25       admin.int.cslabs.clarkson.edu admin.int.cslabs admin.int
  • Edited /etc/hosts.allow
For security purposes, this information has been intentionally left off.
  • Edited /etc/hosts.deny
ALL: ALL

Configured DNS Servers

  • Edited /etc/resolv.conf
search cslabs.clarkson.edu clarkson.edu
nameserver 128.153.145.3
nameserver 128.153.145.4

Disabled IP v6

  • Appended the following to /etc/modprobe.conf
install ipv6 /bin/true
  • Disabled IP v6 firewall
    • /sbin/chkconfig ip6tables off

Configured IPtables

Due to the sensitivity of this material, this config file has been left off; however, the following rule is needed.

-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT

Configured SSH

  • Edited /etc/ssh/sshd_config
Due to the sensitivity of this material, this config file has been left off.
  • Restarted sshd
    • /etc/init.d/sshd restart

Set Up SSH Login Banner

  • Edited /etc/issue.net
__      _    
 ___ ____/ /_ _  (_)__ 
/ _ `/ _  /  ' \/ / _ \
\_,_/\_,_/_/_/_/_/_//_/
                           

Configured Password Requirements

  • Edited /etc/login.defs
MAIL_DIR        /var/spool/mail

PASS_MAX_DAYS   360
PASS_MIN_DAYS   0
PASS_MIN_LEN    8
PASS_WARN_AGE   60

UID_MIN                   500
UID_MAX                 60000

GID_MIN                   500
GID_MAX                 60000

CREATE_HOME     yes

UMASK           077

USERGROUPS_ENAB yes

MD5_CRYPT_ENAB yes

ENCRYPT_METHOD MD5

Added Custom PATH Variables

  • Added the following to /etc/profile
PATH=$PATH:/usr/sbin:/sbin
export PATH

Configured Aliases

  • Edited /etc/aliases
#
#  Aliases in this file will NOT be expanded in the header from
#  Mail, but WILL be visible over networks or from /bin/mail.
#
#       >>>>>>>>>>      The program "newaliases" must be run after
#       >> NOTE >>      this file is updated for any changes to
#       >>>>>>>>>>      show through to sendmail.
#

# Basic system aliases -- these MUST be present.
mailer-daemon:  postmaster
postmaster:     logwatch@cslabs.clarkson.edu

# General redirections for pseudo accounts.
bin:            logwatch@cslabs.clarkson.edu
daemon:         logwatch@cslabs.clarkson.edu
adm:            logwatch@cslabs.clarkson.edu
lp:             logwatch@cslabs.clarkson.edu
sync:           logwatch@cslabs.clarkson.edu
shutdown:       logwatch@cslabs.clarkson.edu
halt:           logwatch@cslabs.clarkson.edu
mail:           logwatch@cslabs.clarkson.edu
news:           logwatch@cslabs.clarkson.edu
uucp:           logwatch@cslabs.clarkson.edu
operator:       logwatch@cslabs.clarkson.edu
games:          logwatch@cslabs.clarkson.edu
gopher:         logwatch@cslabs.clarkson.edu
ftp:            logwatch@cslabs.clarkson.edu
nobody:         logwatch@cslabs.clarkson.edu
radiusd:        logwatch@cslabs.clarkson.edu
nut:            logwatch@cslabs.clarkson.edu
dbus:           logwatch@cslabs.clarkson.edu
vcsa:           logwatch@cslabs.clarkson.edu
canna:          logwatch@cslabs.clarkson.edu
wnn:            logwatch@cslabs.clarkson.edu
rpm:            logwatch@cslabs.clarkson.edu
nscd:           logwatch@cslabs.clarkson.edu
pcap:           logwatch@cslabs.clarkson.edu
apache:         logwatch@cslabs.clarkson.edu
webalizer:      logwatch@cslabs.clarkson.edu
dovecot:        logwatch@cslabs.clarkson.edu
fax:            logwatch@cslabs.clarkson.edu
quagga:         logwatch@cslabs.clarkson.edu
radvd:          logwatch@cslabs.clarkson.edu
pvm:            logwatch@cslabs.clarkson.edu
amanda:         logwatch@cslabs.clarkson.edu
privoxy:        logwatch@cslabs.clarkson.edu
ident:          logwatch@cslabs.clarkson.edu
named:          logwatch@cslabs.clarkson.edu
xfs:            logwatch@cslabs.clarkson.edu
gdm:            logwatch@cslabs.clarkson.edu
mailnull:       logwatch@cslabs.clarkson.edu
postgres:       logwatch@cslabs.clarkson.edu
sshd:           logwatch@cslabs.clarkson.edu
smmsp:          logwatch@cslabs.clarkson.edu
postfix:        logwatch@cslabs.clarkson.edu
netdump:        logwatch@cslabs.clarkson.edu
ldap:           logwatch@cslabs.clarkson.edu
squid:          logwatch@cslabs.clarkson.edu
ntp:            logwatch@cslabs.clarkson.edu
mysql:          logwatch@cslabs.clarkson.edu
desktop:        logwatch@cslabs.clarkson.edu
rpcuser:        logwatch@cslabs.clarkson.edu
rpc:            logwatch@cslabs.clarkson.edu
nfsnobody:      logwatch@cslabs.clarkson.edu

ingres:         logwatch@cslabs.clarkson.edu
system:         logwatch@cslabs.clarkson.edu
toor:           logwatch@cslabs.clarkson.edu
manager:        logwatch@cslabs.clarkson.edu
dumper:         logwatch@cslabs.clarkson.edu
abuse:          logwatch@cslabs.clarkson.edu

newsadm:        news
newsadmin:      news
usenet:         news
ftpadm:         ftp
ftpadmin:       ftp
ftp-adm:        ftp
ftp-admin:      ftp
www:            webmaster
webmaster:      logwatch@cslabs.clarkson.edu
noc:            logwatch@cslabs.clarkson.edu
security:       logwatch@cslabs.clarkson.edu
hostmaster:     logwatch@cslabs.clarkson.edu
info:           postmaster
marketing:      postmaster
sales:          postmaster
support:        postmaster


# trap decode to catch security attacks
decode:         logwatch@cslabs.clarkson.edu

# Person who should get roots's mail
root:           logwatch@cslabs.clarkson.edu
  • Updated aliases
    • /usr/bin/newaliases

Disabled Various Kernel Modules

  • Added the following to /etc/modprobe.conf
install pppox /bin/true
install bluetooth /bin/true
install sctp /bin/true

Installed & Configured SNMP

  • Installed needed packages
yum install net-snmp ntp
  • Configured SNMP Daemon /etc/snmp/snmpd.conf
rocommunity     <passphrase>  127.0.0.1
rocommunity     <passphrase>  <ipsallowed>
 
syslocation Clarkson University Applied CS Labs
syscontact Matt McCarrell <mccarrms@gmail.com>
disk /
disk /var
exec timeskew /usr/local/sbin/ntp_check
exec uptime /usr/bin/uptime
  • Deployed ntp_check script
    • Copied over ntp_check to /usr/local/sbin/
    • chown root.root /usr/local/sbin/ntp_check
  • Configured SNMP to start at specific run levels
/sbin/chkconfig --levels 2345 snmpd on
  • Started daemon
/etc/init.d/snmpd start

Increased Detail of Logwatch Reports

  • Set detail level to be high
echo "Detail = High" >> /etc/logwatch/conf/logwatch.conf

Disabled Unneeded Services

chkconfig nfs off
/etc/init.d/nfs stop
chkconfig nfslock off
/etc/init.d/nfslock stop
chkconfig rpcgssd off
/etc/init.d/rpcgssd stop
chkconfig rpcidmapd off
/etc/init.d/rpcidmapd stop
chkconfig rpcsvcgssd off
/etc/init.d/rpcsvcgssd stop
chkconfig portmap off
/etc/init.d/portmap stop
chkconfig netfs off
/etc/init.d/netfs stop
chkconfig anacron off
/etc/init.d/anacron stop
chkconfig autofs off
/etc/init.d/autofs stop
chkconfig avahi-daemon off
/etc/init.d/avahi-daemon stop
chkconfig avahi-dnsconfd off
/etc/init.d/avahi-dnsconfd stop
chkconfig bluetooth off
/etc/init.d/bluetooth stop
chkconfig hidd off
/etc/init.d/hidd stop
chkconfig cups off
/etc/init.d/cups stop
chkconfig firstboot off
/etc/init.d/firstboot stop
chkconfig gpm off
/etc/init.d/gpm stop
chkconfig haldaemon off
/etc/init.d/haldaemon stop
chkconfig irda off
/etc/init.d/irda stop
chkconfig kudzu off
/etc/init.d/kudzu stop
chkconfig messagebus off
/etc/init.d/messagebus stop
chkconfig microcode_ctl off
/etc/init.d/microcode_ctl stop
chkconfig pcscd off
/etc/init.d/pcscd stop
chkconfig readahead_early off
/etc/init.d/readahead_early stop
chkconfig readahead_later off
/etc/init.d/readahead_later stop
chkconfig ypbind off
/etc/init.d/ypbind stop

Modified Cron Weekly Execution Time

This was done to reduce load spikes that produce Nagios alerts around 4:30 AM every Sunday. In the event that this VM get moved off of righteous, this should be changed back to the default setting of 4:22 AM.
  • Modified the following line in /etc/crontab
32 5 * * 0 root run-parts /etc/cron.weekly

Installed Apache

  • yum install httpd mod_ssl openssl-devel php php-devel php-gd php-imap php-ldap php-mysql php-suhosin php-odbc php-pear php-xml php-xmlrpc mysql
  • Modified Apache Config /etc/httpd/conf/httpd.conf
ServerTokens Prod
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 30
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
TraceEnable Off

<IfModule prefork.c>
StartServers       5
MinSpareServers    5
MaxSpareServers   10
ServerLimit       50
MaxClients        50
MaxRequestsPerChild  0
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

Listen 80

LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule version_module modules/mod_version.so

Include conf.d/*.conf

User apache
Group apache

ServerAdmin web-admin@cslabs.clarkson.edu

UseCanonicalName Off

DocumentRoot "/var/www/html"

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

<IfModule mod_userdir.c>
    UserDir disable
</IfModule>

DirectoryIndex index.html index.html.var

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

TypesConfig /etc/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
#   MIMEMagicFile /usr/share/magic.mime
    MIMEMagicFile conf/magic
</IfModule>

HostnameLookups Off

ErrorLog logs/error_log
LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog logs/access_log combined

ServerSignature Off

Alias /icons/ "/var/www/icons/"

<Directory "/var/www/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb
</IfModule>

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName README.html
HeaderName HEADER.html

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw

LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

ForceLanguagePriority Prefer Fallback

AddDefaultCharset UTF-8

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddHandler type-map var

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>
</IfModule>
</IfModule>

#ErrorDocument 404 /error/404.html

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/x-httpd-eruby
AddOutputFilterByType DEFLATE text/html
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  • Disabled /etc/httpd/conf.d/welcome.conf
#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
#<LocationMatch "^/+$">
#    Options -Indexes
#    ErrorDocument 403 /error/noindex.html
#</LocationMatch>
  • Configured server so php is not exposed and y2k compliance is off
    • Edited /etc/php.ini
y2k_compliance = Off
expose_php = Off
memory_limit = 128M
  • Disabled /etc/httpd/conf.d/proxy_ajp.conf
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

#
# When loaded, the mod_proxy_ajp module adds support for
# proxying to an AJP/1.3 backend server (such as Tomcat).
# To proxy to an AJP backend, use the "ajp://" URI scheme;
# Tomcat is configured to listen on port 8009 for AJP requests
# by default.
#

#
# Uncomment the following lines to serve the ROOT webapp
# under the /tomcat/ location, and the jsp-examples webapp
# under the /examples/ location.
#
#ProxyPass /tomcat/ ajp://localhost:8009/
#ProxyPass /examples/ ajp://localhost:8009/jsp-examples/

  • Configured Apache to start on boot
    • /sbin/chkconfig --levels 345 httpd on

AWStats

jeudi 3 février 2011

WifiZoo

Introduction

Wifizoo est un outil de capture d'informations à partir de réseau wifi ouvert.

Configuration dans BT3 beta

Editez: /usr/local/etc/kismet.conf
ligne 27 : indiquez votre interface wifi. ex :
source = rt73,rausb0,Ralink
Lancez Kismet
kismet -x
Editez: /pentest/wireless/wifizoo/scapy.py
ligne 13215 : AJOUTEZ la ligne et indiquez votre interface wifi. ex :
conf.iface = 'rt73,rausb0,Ralink'
Editez: /pentest/wireless/wifizoo/wifizoo.py
ligne 49 : indiquez votre interface wifi. ex :
conf.iface = 'rausb0'
Ensuite il ne reste plus qu'à lancer wifizoo.py dans un shell.

Usage

Wifizoo en mode live

version 1.3 et 1.4

démarrage

placez vous dans le répertoire de wifizoo et tappez :
python wifizoo.py
Image:wifizoo1.jpg
Choix du mode Live ou Pcap
Image:wifizoo2.jpg
sélectionnez votre interface
Image:wifizoo3.jpg
Scan aléatoire ou fixé sur un seul channel
Image:wifizoo4.jpg
Choix de la bande (A/BG/ABG)
Image:wifizoo5.jpg
Choix du server local pour afficher le gui html : LO
Image:wifizoo6.jpg

Interface graphique

Nous allons utiliser les onglets pour accéder aux différents types d'information capturés (cookies, ftp data, etc...)
Image:wifizoo7.jpg
Exemple de capture de données ftp, ip, user pass :)
Image:wifizoo8.jpg
Exemple de captures de cookies, punbb et gmail :)
Image:wifizoo9.jpg
Cliquer sur le lien afin de forger le cookie
Image:wifizoo9b.jpg
Une fois le cookie forgé, il faut cliquer sur l'ip pour accéder à la page que la victime est en train de consulter
Image:wifizoo10.jpg
On arrive sur la page "d'accueil" et comme on l'a vu précédemment, la personne surfait sur gmail, donc on va cliquer sur gmail, logique.
Image:wifizoo11.jpg
Et voila, nous nous trouvons dans la session gmail.
Image:wifizoo12.jpg

Wifizoo en mode Pcap

ATTENTION : seulement disponible avec la version 1.4 (version 1.3 + patch)

Récuperation d'un fichier cap

Suite à un scan avec airodump, nous nous retrouvons avec un fichier cap. Au lieu de s'amuser à l'analyser avec wireshark pour en tirer des infos intéressantes, nous allons utiliser wifizoo qui va s'occuper de nous trouver le meilleur :)

Décryptage du fichier

Il peut arriver que notre fichier soit cryptà par une protection ultra résistante comme le WEP. Dans ce as nous allons utliser l'outil decrypt pour les décrypter.
dans un shell tappez :
bt wiscan # decrypt -p MA:KE:YW:EP:00 -m MA:ST:AT:IO:N! -e capture-01.cap -d capture.cap

démarrage

placez vous dans le répertoire de wifizoo et tapez :
python wifizoo.py
Image:wifizoo1.jpg
Choix du mode Live ou Pcap
Image:wifizoo1p.jpg
Entrez le chemin du fichier de capture
Image:wifizoo2p.jpg
Ca fonctionne
Image:wifizoo3p.jpg
Choix du server local pour afficher le gui html : LO
Image:wifizoo4p.jpg
On constate que les données sont bien interpretées
Image:wifizoo5p.jpg

Interface graphique

Nous allons utiliser les onglets pour accéder aux différents types d'information capturés (cookies, ftp data, etc...)
Image:wifizoo6p.jpg
Exemple de captures de cookies, punbb :) Cliquer sur le lien afin de forger le cookie
Image:wifizoo7p.jpg
Une fois le cookie forgé, il faut cliquer sur l'ip pour accéder à la page que la victime est en train de consulter
Image:wifizoo8p.jpg
Et voila, nous nous trouvons loggué dans la session de la victime.
Image:wifizoo9p.jpg

bonne capture

Image:wifizooEND.jpg

Vidéo

Wifizoo 1.3, vol de session gmail : http://backtrack-fr.net/test/wifizoo13.ogv

Liens externes 

Wifizoo 1.3, vol de session gmail : http://backtrack-fr.net/test/wifizoo13.ogv

 

Tuto Xplico internet decodeur

la première partie présente l'installation d'xplico et son web ui, la seconde partie montre son utilisation en live sur du Wep (video + texte); la troisième partie montre son utilisation réelle c'est à dire en forensics sur un fichier pcap (video + texte), et la partie 4 en cli.

Alors, Xplico permet quoi ? il permet d'avoir une vision "humaine" du contenu de votre pcap, si vous prenez wireshark, vous voyez trucs muche tcp icmp etc, vous pouvez extraire l'intégralité via follow tcp stream, mais pour une visualisation rapide du contenu cela n'est pas l'idéal.

C'est là qu'intervient xplico, il va permettre de voir directement les images videos etc.

Let's go on installe le cool tool, je pars sur une base ubuntu, mais pour les autres ca montre bien les dépendances et ne devrait pas poser de problèmes majeurs.


sudo su
#libpcap est nécessaire, mais on va foutre des trucs en plus pour les scripts.

apt-get install sqlite tcpdump tshark
libx11-dev libxt-dev libxi-dev apache2 php5 php5-sqlite build-essential perl zlib1g-dev libpcap-dev libsqlite0-dev libmysqlclient15-dev python2.5-minimal python2.5 python-all
#sqlite car il nous faut la version 2 d'sqlite + la lib-dev
#(nommé sqlite dans les dépots ubuntu)
#apache2 ca c'est pour la web ui (interface web) pas
#obigé php5-sqilte idem
#tcpdump tshark pour les scripts et de toute manière
#libpcap nécessaire (tshark peut ne pas etre utilisé ou rempacé
#par wireshark qui le contient)
#zlib1g ca c'est pour geoip
#libx* pour pcl6 (option)


cd /tmp
wget http://downloads.sourceforge.net/project/xplico/xplico/version%200.5.2/xplico-0.5.2.tgz

tar zxvf xplico-0.5.2.tgz
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.5.tar.gztar zxvf GeoIP-1.4.5.tar.gz
cd GeoIP-1.4.5
./configure
make
make install
rm -f *.tar.gz
cd /tmp/xplico
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gzip -d GeoLiteCity.dat.gz
rm -f *dat.gz
make
cd ..
wget http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/ghostpdl/ghostpdl-8.70.tar.bz2
tar jxvf ghostpdl-8.70.tar.bz2
#de ghostpcl on a juste besoin de pcl6 c'est necessaire pour "network printer job"
rm -f *.bz2
cd ghostpdl-8.70
make
#ca ca prend du temps...
cd ..
cp /tmp/ghostpdl-8.70/main/obj/pcl6 /tmp/xplico/
rm -rf
ghostpdl-8.70
cd /tmp/xplico
make install

#Ça c'était la part 1 de l'installation, maintenant on installe la web ui
#(interface web)

cd /var/www
wget http://downloads.sourceforge.net/project/xplico/xplico/version%200.5.2/xplico_interface-0.5.2.tgz
tar zxvf xplico_interface-0.5.2.tgz
rm -f *2.tgz

#le chmod recursif en 777 c'est si vous avez un problème d'accès,
#attention ca offre les droits max,
#lecture écriture exécution pour tous les fichiers groupes utilisateurs.

chmod -R 777 /gui.xplico.org

On continue ?
Ok il faut que l'interface web soit accessible pour apache avec toutes les options activées et allow override allow.

Pour plus de simplicité vous pouvez directement télécharger la conf (ca ne touche en rien apache, ça active tout pour xplico et uniquement xplico.

cd /etc/apache2/sites-enabled
wget http://bricowifi.free.fr/xplico

Ensuite dans /etc/apache2/ports.conf vous devez ajouter xplico et son port
Voici un extrait du mien avec l'ajout en rouge:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
# xplico Host port
NameVirtualHost *:9876
Listen 9876
NameVirtualHost *:80
Listen 80

Il faut aussi éditer php.ini pour le down, l'upload max:

nano /etc/php5/apache2/php.ini

post_max_size = 100M

upload_max_filesize = 100M

On oublie pas d'activer le mode rewrite sur apache !!!!
a2enmod rewrite

Terminé, on relance apache:
/etc/init.d/apache2 restart

///////////////Pour le tutoriel d'instalation c'est terminé///////////// ouf... (merci de préciser si y a une coquille)

  • Phase 2 Demo live Wep sniffing avec airodump-ng et airtun-ng; décodage avec Xplico


Détail des commandes:

airmon-ng
airmon-ng start wlan1
airodump-ng -w /root/Bureau/s -c 11 --bssid 00:11:22:33:44:55 mon0

(airmon-ng pour passer a carte en monitor)
(airodump-ng pour enregistrer; -w "écrire" -c "canal" --bssid "@ mac de l'ap")

|-------------------------------------------------------------------

|--[3] Launch airtun-ng with the Wep key and mount your tun/tap at0

airtun-ng -a 00:11:22:33:44:55 -w 55:44:33:22:11 mon0
ifconfig at0 up

(airtun-ng -a "@mac ap" -w "clé wep" interface wifi)

|-------------------------------------------------------------------

|--[4] Hack Xplico

| a] enlevez /opt/xplico/xplico.db
| b] enlevez tous /opt/xplico/pol
| c] exec:
| cd /opt/xplico/script/db/sqlite2
| ./create_xplico_db.sh
| d] avec la web ui, réalisez une seul case
| c] dans cette case créez seulement une session d'écoute (sol) listening sessions
| ici /opt/xplico/script vous trouverez
| rt_demo.sh. éditez l'interface par la votre



cd /opt/xplico/script/ && ./sqlite_demo.sh
|#abort

|-------------------------------------------------------------------

|--[5] Run Xplico in live, 1337

cd /opt/xplico/script/ && ./rt_demo.sh


  • Phase 3 demo forensics sur un pcap avec xplico, airdecap-ng pour decrypter le Wep et décoder son contenu


Détail des commandes:

|--[1] First decrypt your wep packet

airdecap-ng -w 55:44:33:22:11 s-01.cap

(airdecap-ng -w "clé wep" "emplacement pcap"

|-------------------------------------------------------------------

|--[2] Run Xplico demo sqlite

cd /opt/xplico/script/ && ./sqlite_demo.sh

|-------------------------------------------------------------------

|--[3] Jump to the web ui, create case & sol, upload your pcap (*dec*)
http://127.0.0.1:9876
  • Phase 4 Xplico en cli (sans l'interface web)
On se place dans notre répertoire de binaire:

./xplico -m pcap -f s-01.cap

pour un dossier de pcap:

./xplico -m pcap -d ~/wardrive/

En temps reel sur eth0:

./xplico -m rltm -i eth0

Voila qui boucle le tuto sur xplico, site web: xplico


Troubleshotings : 

Activate the verbose mode. So, edit /opt/xplico/xi/app/config/core.php, look for

Code:
        Configure::write('debug', 0);

and change the value for '2'. Reload the web and tell us what outputs.


Installing THC-Hydra6.1 on Ubuntu 10.10 (Maverick Meerkat) with SSL support

Wikipedia describes THC-Hydra as “… software … that uses a dictionary attack to test for weak or simple passwords on one or many remote hosts running a variety of different services.” Its useful for doing quick tests against your servers to make sure that your users are not using simple passwords. In pen tester speak, this is called a brute-force attack.
Here are the steps needed for installing it on the 32-bit version of Ubuntu 10.10 (Maverick Meerkat).
Make sure you have all the necessary development tools (i.e. libraries, compilers, headers) and the source files for GTK:

sudo apt-get install build-essential linux-headers-$(uname -r) libgtk2.0-dev libssl-dev cmake

Before we compile Hydra, we need to install libssh. For some odd reason, hydra does not like the libssh-dev package that comes with Ubuntu.

wget -c http://www.libssh.org/files/0.4/libssh-0.4.6.tar.gz
tar -xvzf libssh-0.4.6.tar.gz
cd libssh-0.4.6
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
make
sudo make install
cd ../..
 
Download and extract the THC-Hydra tarball
 
wget -c http://edwincastillo.com/wp-content/uploads/2010/12/hydra-6.1-src.tar.gz
tar -xvzf hydra-6.1-src.tar.gz
cd hydra-6.1-src
 
Now you are ready to compile:
./configure
make
sudo make install
 
You are now ready to use Hydra. Type ./hydra -h to get syntax help. The GUI version can be started by running xhydra.
If you have a GMail account with IMAP enabled, you can use the following example to test hydra:
 
hydra -S -l email@gmail.com -p your_password -V imap.gmail.com imap