quinta-feira, 15 de maio de 2014

Rastreando os ips visíveis aos dispositivos de rede

  • Rastreamento Geral
for i in $(ip route | grep -v default | awk '{print $1 "-" $3}'); \
do \
nmap -sP $(echo $i | cut -d \- -f 1) | grep 'Nmap scan' | awk '{print "\033[32m" $5 "\033[39m"}'; \
done | sort | uniq
  • Rastreamento por interface
for i in $(ip route | grep -v default | awk '{print $1 "-" $3}'); \
do \
echo "============================="; \
echo "Rastreando a rede $(echo $i | cut -d \- -f 2)"; \
nmap -sP $(echo $i | cut -d \- -f 1) | grep 'Nmap scan' | awk '{print "\033[32m" $5 "\033[39m"}'; \
done;
  • Rastramento por interface com portas
for i in $(ip route | grep -v default | awk '{print $1 "-" $3}'); \
do echo "============================="; \
echo "Rastreando a rede $(echo $i | cut -d \- -f 2)"; \
nmap $(echo $i | cut -d \- -f 1) | egrep -v 'Not shown' | \
awk '{if ($0 ~ /PORT/) print "\033[33m" $0 "\033[39m"; \
else if ($2 ~ /open/) print "\033[32m" $0 "\033[39m"; \
else if($2 ~ /closed/) print "\033[31m" $0 "\033[39m"; \
else print $0}'; \
done;

terça-feira, 29 de abril de 2014

Rastreando canais e frequencias das redes wifi proximas

  • Para rastrear as frequências e canais
sudo iwlist wlp2s0 scan | egrep "Frequency\:.*\(Channel" | sort | uniq -c | sort -nr ; iwgetid -c
  • Para ober informações das redes
sudo iwlist wlp2s0 scan | egrep "Frequency\:.*\(Channel|ESSID|Quality|Address"

quinta-feira, 17 de abril de 2014

quarta-feira, 26 de março de 2014

Instalar Skype de um repositório yum

Installing Skype from Repository

Edit: Here is the new version that works with Fedora 13. It installs the latest Skype from the Skype repository (apparently the Skype repo was outdated in the past, but now it contains the same version as on the Skype website).

First, create the skype.repo file in the /etc/yum.repos.d directory:
Code:
su -
cat <<EOF> /etc/yum.repos.d/skype.repo
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-skype
enabled=1
gpgcheck=0
EOF
exit
Second, install Skype with
Code:
sudo yum -y install skype
Third, one may have to install a few libraries that Skype needs. If you're interested, you can find out more about these libraries with ldd /usr/share/skype and with yum provides *..., but this is not required for installation. All you need to do is (got this from Krellan's post):
Code:
sudo yum -y install alsa-lib.i686 dbus-libs.i686 e2fsprogs-libs.i686 expat.i686 fontconfig.i686 freetype.i686 glib2.i686 glibc.i686 keyutils-libs.i686 krb5-libs.i686 libcap.i686 libgcc.i686 libICE.i686 libpng.i686 libselinux.i686 libSM.i686 libstdc++.i686 libX11.i686 libXau.i686 libxcb.i686 libXcursor.i686 libXdmcp.i686 libXext.i686 libXfixes.i686 libXi.i686 libXinerama.i686 libXrandr.i686 libXrender.i686 libXScrnSaver.i686 libXv.i686 openssl.i686 qt.i686 qt-x11.i686 zlib.i686
Note: I am aware that setting gpgcheck=0 is a solution that is not optimal. However, it seems that the Skype key that is available on gpg.mit.edu doesn't work with the Skype repo any more. If you happen to know how to deal with this in a better way (e.g. if you know where the current Skype key is), please post it and I will update this guide.


================================

Below is the old version for Fedora 10. It might still be of some value to some people.

First, get Skype's public key:
Code:
gpg --keyserver pgp.mit.edu --recv-keys 0xD66B746E
gpg -a -o RPM-GPG-KEY-skype --export 0xD66B746E
sudo rpm --import RPM-GPG-KEY-skype
rm RPM-GPG-KEY-skype
Second, create the skype.repo file in the /etc/yum.repos.d directory:
Code:
su -
cat <<EOF> /etc/yum.repos.d/skype.repo
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-skype
enabled=1
gpgcheck=1
EOF
exit
Third, finish off the installation with
Code:
sudo yum -y install skype
Fonte: http://forums.fedoraforum.org/showthread.php?t=229573

Resolvendo problemas de permissão do Policykit / Packagekit para a role update-package

Acrescentar a action abaixo no arquivo

# yum install PackageKit
# vim /usr/share/polkit-1/actions/org.freedesktop.packagekit.policy

...
  <action id="org.freedesktop.packagekit.update-package">
    <description>Update foreign package</description>
    <description xml:lang="pt_BR">Atualiza pacote externo</description>
    <message>Authentication is required to update a package that was not started by yourself</message>
    <message xml:lang="pt_BR">É necessário autenticar para atualizar um pacote que não foi iniciada por você</message>
    <icon_name>package-x-generic</icon_name>
    <defaults>
      <allow_any>no</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>
  </action>
...

segunda-feira, 3 de fevereiro de 2014

Correção do run.sh do jboss 6.1 ou inferior

Para fazer com que o jboss possa iniciar sem carregar o aquivo run.conf que se encontra dentro da pasta bin e sim com o run.conf que está dentro da pasta do profile

basta substituir o bloco de codigo

# Read an optional running configuration file
if [ "x$RUN_CONF" = "x" ]; then

if [ -f "$DIRNAME/../server/$JBOSSCONF/run.conf" ]; then
RUN_CONF="$DIRNAME/../server/$JBOSSCONF/run.conf"
else
RUN_CONF="$DIRNAME/run.conf"
fi
fi
if [ -r "$RUN_CONF" ]; then
. "$RUN_CONF"
fi

dentro do run.sh por

JBOSSCONF="default"
arg_count=1
eval SWITCH=\${$arg_count}
while [ ! -z "$SWITCH" ]
do

if [ "$SWITCH" = "-c" ]; then
eval JBOSSCONF=\$`expr $arg_count + 1`
break
fi

echo "$SWITCH" | grep "^\-\-configuration=" > /dev/null
if [ $? -eq 0 ]; then
JBOSSCONF=`echo $SWITCH|sed 's/\-\-configuration=//'`
break
fi

arg_count=`expr $arg_count + 1`
eval SWITCH=\${$arg_count}
done


# Read an optional running configuration file
if [ "x$RUN_CONF" = "x" ]; then

if [ -f "$DIRNAME/../server/$JBOSSCONF/run.conf" ]; then
RUN_CONF="$DIRNAME/../server/$JBOSSCONF/run.conf"
else
RUN_CONF="$DIRNAME/run.conf"
fi
fi
if [ -r "$RUN_CONF" ]; then
. "$RUN_CONF"
fi


E pronto, agora basta copiar o run.conf dentro da pasta bin do jboss para dentro da pasta do profile do jboss e executar o
$ run.sh -c profile
Que o jboss vai iniciar com as configurações do run.conf dentro do profile e quando não tiver esse arquivo o jboss vai utilizar o que estiver dentro da pasta bin.