Inicio
Buscar
Ingresar
Registrarse
Starfield: el juego que revolucionará el espacio y la tecnología
Hack x Crack - Comunidad de Seguridad informática
»
Programación
»
Scripting
»
Batch / Bash
»
[BASH] Hosts up en una interfaz
Imprimir
Páginas: [
1
]
Ir Abajo
Autor
Tema: [BASH] Hosts up en una interfaz (Leído 3396 veces)
k133
{ L3 } Über
Mensajes: 201
[BASH] Hosts up en una interfaz
«
en:
Agosto 25, 2015, 05:46:33 pm »
Estaba leyendo un post de hace tiempo sobre buscar los hots vivos en una red, y aquí voy a poner como lo hago yo. Puesto que cada red está en una interfaz, el script necesita que le des la interfaz donde buscar, y él ya se encargará de saber que red esta en la interfaz xD.
Código: Bash
#!/bin/bash
# Host's up. Install: ipcalc fping
# Autor: K133 (hackxcrack.net)
# CC BY-NC
if
[
$#
-ne
1
]
||
!
/
sbin
/
ifconfig
"$1"
&>
/
dev
/
null;
then
echo
-e
"Uso:
$(basename $0)
<INTERFAZ>
\n
"
exit
1
fi
ip_priv
=
"
$(/sbin/ifconfig "$1" | grep "inet addr" | awk '{printf $2}' | cut --delimiter=':' --fields=2)
"
netmask
=
"
$(/sbin/ifconfig "$1" | grep "Mask" | awk -F':' '{printf $NF}')
"
cdir
=
"
$(ipcalc "$ip_priv" "$netmask" | grep -w "Network:" | awk '{printf $2}')
"
echo
"Escaneando '
$cdir
' ..."
fping
-a
-g
"
$cdir
"
2
>
/
dev
/
null
exit
0
En línea
Linux member #545609
samurai
{ L3 } Über
Mensajes: 266
Re:[BASH] Hosts up en una interfaz
«
Respuesta #1 en:
Agosto 26, 2015, 01:17:48 am »
Me gusta, te lo tomo prestado xD
En línea
Look at you, hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?
si usas internet explorer no entres aquí
http://crashie8.com/
The hacker noob
{ L0 } Ñuub
Mensajes: 7
Re:[BASH] Hosts up en una interfaz
«
Respuesta #2 en:
Agosto 26, 2015, 01:34:36 am »
WoooW, en qe lenguaje de programacion devo hacer copy paste.?
En línea
elbrujo20
{ L2 } Nativo Digital
Mensajes: 109
Re:[BASH] Hosts up en una interfaz
«
Respuesta #3 en:
Agosto 26, 2015, 03:12:00 am »
orale
En línea
Imprimir
Páginas: [
1
]
Ir Arriba
Hack x Crack - Comunidad de Seguridad informática
»
Programación
»
Scripting
»
Batch / Bash
»
[BASH] Hosts up en una interfaz
Va un mudo y le dice a un sordo: Hack x Crack usa cookies. Pues eso...
OK
Learn more