Humanoid Insomniac ~#root




Aller au contenu | Aller au menu | Aller à la recherche

Bosse au lieu de braire

Fil des billets

dimanche, 8 mars 2015

Spamhaus Exploits Block List ( UPDATE )

Spamhaus Exploits Block List Script:

read the project Spamhaus DROP:

Take this script, edit, chmod 755, ad run it once per 24 H ( Please DO NOT auto-fetch the DROP list more than once per hour! )

#!/bin/bash
# spamhaus.sh - Source adaptee de : https://github.com/cowgill/spamhaus
# MaJ: 08/03/2015 - Brussee YannicK - requis:  iptables
# prends en compte deux listes d'IP chez spamhaus pour proteger les serveurs
#--------------------------------------------------------------
# Voir: http://www.spamhaus.org/drop/ et lire pourquoi...
#--------------------------------------------------------------
# Just ajusted for un CHAIN1 - "Spamhaus" and logs to: [SPAMHAUS BLOCK]
# URL1: http://www.spamhaus.org/drop/drop.lasso
# Just ajusted for un CHAIN2 - "SpamhausEDROP" and logs to: [SPAMHAUS BLOCK EDROP]
# URL2: http://www.spamhaus.org/drop/edrop.txt
#--------------------------------------------------------------
# A mettre en cron toutes les 6 heures passees de 11 Minutes:
#--------------------------------------------------------------
# 11 */6 * * * /usr/local/scripts/spamhaus.sh >/dev/null 2>&1
#--------------------------------------------------------------
# Pour debannir les IP:
# Liste 1:
#--------------------------------------------------------------
# /sbin/iptables -F Spamhaus
#--------------------------------------------------------------
# Liste 2:
#--------------------------------------------------------------
# iptables -F SpamhausEdrop
#--------------------------------------------------------------
# Pour voir les impacts tapez juste: dmesg au bout d'une ou deux heures :)
#--------------------------------------------------------------
# Script Variables:
# path to iptables
IPTABLES="/sbin/iptables";
# list of known spammers
URL1="http://www.spamhaus.org/drop/drop.lasso";
URL2="http://www.spamhaus.org/drop/edrop.txt";
# save local copy here
FILE1="/tmp/drop.lasso";
FILE2="/tmp/edrop.lasso";
# iptables custom CHAIN1
CHAIN1="Spamhaus";
CHAIN2="SpamhausEdrop";
# check to see if the CHAIN1 already exists
$IPTABLES -L $CHAIN1 -n
$IPTABLES -L $CHAIN2 -n
# check to see if the CHAIN1 already exists
if [ $? -eq 0 ]; then
# flush the old rules
$IPTABLES -F $CHAIN1
$IPTABLES -F $CHAIN2
echo "Flushed old rules. Applying updated Spamhaus list DROP and EDROP...."
else
# create a new CHAIN1 set
$IPTABLES -N $CHAIN1
$IPTABLES -N $CHAIN2
# tie CHAIN1 to input rules so it runs
$IPTABLES -A INPUT -j $CHAIN1
$IPTABLES -A INPUT -j $CHAIN2
# don't allow this traffic through
$IPTABLES -A FORWARD -j $CHAIN1
$IPTABLES -A FORWARD -j $CHAIN2
echo "CHAIN1 not detected. Creating new CHAIN1 and adding Spamhaus list...."
echo "CHAIN2 not detected. Creating new CHAIN2 and adding Spamhaus list...."
fi;
# SPAMHAUS DROP
# get a copy of the spam list DROP
wget -qc $URL1 -O $FILE1
# iterate through all known spamming hosts DROP
for IP1 in $( cat $FILE1 | egrep -v '^;' | awk '{ print $1}' ); do
# add the ip address log rule to the CHAIN1 DROP
$IPTABLES -A $CHAIN1 -p 0 -s $IP1 -j LOG --log-prefix "[SPAMHAUS BLOCK DROP]" -m limit --limit 1/min --limit-burst 10
# add the ip address to the CHAIN1
$IPTABLES -A $CHAIN1 -p 0 -s $IP1 -j DROP
echo $IP1
done
#
# SPAMHAUS EDROP
# get a copy of the spam list EDROP
wget -qc $URL2 -O $FILE2
# iterate through all known spamming hosts EDROP
for IP2 in $( cat $FILE2 | egrep -v '^;' | awk '{ print $1}' ); do
# add the ip address log rule to the CHAIN2 2DROP
$IPTABLES -A $CHAIN2 -p 0 -s $IP2 -j LOG --log-prefix "[SPAMHAUS BLOCK EDROP]" -m limit --limit 1/min --limit-burst 10
# add the ip address to the CHAIN2
$IPTABLES -A $CHAIN2 -p 0 -s $IP2 -j DROP
echo $IP2
done
#
echo "Done! for DROP an EDROP Lists"
# remove the spam list
unlink $FILE1
unlink $FILE2

lundi, 23 février 2015

Disable “Waiting for network configuration”

nano /etc/init/failsafe.conf

Change all sleep to 1

For Example:

# failsafe
description "Failsafe Boot Delay"
author "Clint Byrum <clint@ubuntu.com>"
start on filesystem and net-device-up IFACE=lo
stop on static-network-up or starting rc-sysinit
emits failsafe-boot
console output
script
       # Determine if plymouth is available
       if [ -x /bin/plymouth ] && /bin/plymouth --ping ; then
               PLYMOUTH=/bin/plymouth
       else
               PLYMOUTH=":"
       fi
   # The point here is to wait for 2 minutes before forcibly booting
   # the system. Anything that is in an "or" condition with 'started
   # failsafe' in rc-sysinit deserves consideration for mentioning in
   # these messages. currently only static-network-up counts for that.
       sleep 1
   # Plymouth errors should not stop the script because we *must* reach
   # the end of this script to avoid letting the system spin forever
   # waiting on it to start.
       $PLYMOUTH message --text="NO ! NO ! NO ! Boot Fast And Fuck Idiots" || :
       sleep 1
       $PLYMOUTH message --text="Hey guy i'm in work Time is money!" || :
       sleep 1
       $PLYMOUTH message --text="Fast boot for fast work! Time is Money!" || :
   # give user 1 second to see this message since plymouth will go
   # away as soon as failsafe starts.
       sleep 1
   exec initctl emit --no-wait failsafe-boot
end script
post-start exec logger -t 'failsafe' -p daemon.warning "My System is fast BOOTING In Progress..."

lundi, 16 février 2015

Spamhaus Exploits Block List

Spamhaus Exploits Block List Script:

read the project Spamhaus DROP:

Take this script, edit, chmod 755, ad run it once per 24 H ( Please DO NOT auto-fetch the DROP list more than once per hour! )

 #!/bin/bash 
 # based off the following script 
 # http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html
 # Just ajusted for un CHAIN - Spamhaus and logs to: [SPAMHAUS BLOCK]
 # path to iptables
 IPTABLES="/sbin/iptables";
 # list of known spammers
 URL="http://www.spamhaus.org/drop/drop.lasso";
 # save local copy here
 FILE="/tmp/drop.lasso";
 # iptables custom chain
 CHAIN="Spamhaus";
 # check to see if the chain already exists
 $IPTABLES -L $CHAIN -n
 # check to see if the chain already exists
 if [ $? -eq 0 ]; then
 # flush the old rules
 $IPTABLES -F $CHAIN
 echo "Flushed old rules. Applying updated Spamhaus list...."
 else
 # create a new chain set
 $IPTABLES -N $CHAIN
 # tie chain to input rules so it runs
 $IPTABLES -A INPUT -j $CHAIN
 # don't allow this traffic through
 $IPTABLES -A FORWARD -j $CHAIN
 echo "Chain not detected. Creating new chain and adding Spamhaus list...."
 fi;
 # get a copy of the spam list
 wget -qc $URL -O $FILE
 # iterate through all known spamming hosts
 for IP in $( cat $FILE | egrep -v '^;' | awk '{ print $1}' ); do
 # add the ip address log rule to the chain
 $IPTABLES -A $CHAIN -p 0 -s $IP -j LOG --log-prefix "[SPAMHAUS BLOCK]" -m limit --limit 3/min --limit-burst 10
 # add the ip address to the chain
 $IPTABLES -A $CHAIN -p 0 -s $IP -j DROP
 echo $IP
 done
 echo "Done!"
 # remove the spam list
 unlink $FILE

Source from: https://github.com/cowgill/spamhaus

read your logs ..... that's It:

[__SPAMHAUS BLOCK__]IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:12:8a:7b:e6:40:14:02 SRC=195.XXX.XXX.XXX DST=YYY.YYY.YYY.255 LEN=40 TOS=0x00 PREC=0x00 TTL=245 ID=54321 PROTO=TCP SPT=42024 DPT=21320 WINDOW=65535 RES=0x00 SYN URGP=0

dimanche, 12 janvier 2014

Vérifiez l'état de votre batterie d'ordinateur portable à partir de la ligne de commande

En console sous Linux le programme acpi permet de vérifier

l'état de notre batterie d'ordinateur portable en ligne de commande.

Tout d'abord installer le paquet acpi

sudo apt-get install acpi

Pour vérifier l'état ​​de charge de la batterie

acpi

La sortie pourrait être quelque chose comme ça.

 Batterie 1: décharge, 44%, restant 0:18:48

Pour vérifier la température de la batterie

acpi -t

Et la sortie pourrait être

 Batterie 1: décharge, 37%, restant 0:15:59
 Thermique 1: ok, 49,0 degrés C

Pour vérifier l'état d'alimentation AC

acpi -i

La sortie peut être:

 Batterie 1: décharge, 30%, restant 0:13:31
 Adaptateur secteur 1: hors ligne

Vous pouvez vérifier tous les états ensemble

acpi -V

La sortie sera:

 Batterie 1: décharge, 27%, restant 0:11:29
 Thermique 1: ok, 50,0 degrés C
 Adaptateur secteur 1: hors ligne

Toutes les commandes ( RTFM )

acpi -h
 Usage: acpi [OPTION]...
 Shows information from the /proc filesystem, such as battery status or
 thermal information.
  -b, --battery            battery information
  -i, --details            show additional details if available:
                             - battery capacity information
                             - temperature trip points
  -a, --ac-adapter         ac adapter information
  -t, --thermal            thermal information
  -c, --cooling            cooling information
  -V, --everything         show every device, overrides above options
  -s, --show-empty         show non-operational devices
  -f, --fahrenheit         use fahrenheit as the temperature unit
  -k, --kelvin             use kelvin as the temperature unit
  -d, --directory <dir>    path to ACPI info (/sys/class resp. /proc/acpi)
  -p, --proc               use old proc interface instead of new sys interface
  -h, --help               display this help and exit
  -v, --version            output version information and exit

 By default, acpi displays information on installed system batteries. 
 Non-operational devices, for example empty battery slots are hidden.
 The default unit of temperature is degrees celsius.
 Report bugs to Michael Meskes <meskes[AT]debian.org>.

vendredi, 4 octobre 2013

Orange ou Sosh: consulter vos messages depuis un autre téléphone

consulter vos messages depuis un autre téléphone

Pour accéder à votre messagerie vocale 888 depuis un autre téléphone fixe ou mobile en France ou à l'étranger, suivez les indications ci-dessous :

1/ Composez le +33 6 08 08 08 08.

Pour sécuriser votre messagerie vocale, l'appel au numéro long 06 08 08 08 08 demande désormais le code secret de votre messagerie

que vous pouvez récupérer par SMS en appelant le 06 08 08 08 08 et que vous pouvez modifier à tout moment lors d'un appel à votre messagerie vocale.

2/ Composez votre numéro de mobile Orange et terminez par #.

3/ Confirmez votre numéro de mobile en tapant 1.

4/ Composez votre code secret en terminant par #.

5/ Ecoutez vos messages.

- page 1 de 2