Montar dd en linux

sudo apt-get install kpartx
# kpartx -l image.img
loop1p1 : 0 512020 /dev/loop1 61
loop1p2 : 0 512000 /dev/loop1 412062
loop1p3 : 0 44056010 /dev/loop1 924060
# kpartx -a -v image.img
add map loop1p1 (253:6): 0 512020 linear /dev/loop1 61
add map loop1p2 (253:7): 0 512000 linear /dev/loop1 412062
add map loop1p3 (253:8): 0 44056010 linear /dev/loop1 924060
# ls -l /dev/mapper
total 0
crw-rw—- 1 root root 10, 62 2010-06-15 17:40 control
brw-rw-r– 1 aramosf aramosf 253, 6 2019-08-16 00:28 loop1p1
brw-rw-r– 1 aramosf aramosf 253, 7 2011-04-01 00:28 loop1p2
brw-rw-r– 1 aramosf aramosf 253, 8 2011-04-01 00:28 loop1p3
# mount /dev/mapper/loop1p1 /mnt -o ro
# umount /mnt
# kpartx -d image.img
loop deleted : /dev/loop1

Publicado en Forence | Deja un comentario

Copia dd

Ver discos
sudo fdisk -l

Crear imagen
dd if=/dev/disk0s4 of=Win7RAW.dd

Publicado en Forence | Deja un comentario

Armitage Error

Error:

Check:

msfconsole
db_status (you need to get message : postgresql selected, no connection)

Copy:

$ cp /opt/metasploit-framework/config/database.yml.example /opt/metasploit-framework/config/database.yml

Edit

sudo nano /opt/metasploit-framework/config/database.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# To set up a metasploit database, follow the directions hosted at:
# http://r-7.co/MSF-DEV#set-up-postgresql
#
# Kali Linux and the Omnibus installers both include an easy wrapper script for
# managing your database, which may be more convenient than rolling your own.

development: &pgsql
  adapter: postgresql
  database: msf
  username: msf
  password: msf
  host: localhost
  port: 5432
  pool: 200
  timeout: 5

# You will often want to seperate your databases between dev
# mode and prod mode. Absent a production db, though, defaulting
# to dev is pretty sensible for many developer-users.
production: &production
  <<: *pgsql

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
#
# Note also, sqlite3 is totally unsupported by Metasploit now.
test:
  <<: *pgsql
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
#
# Note also, sqlite3 is totally unsupported by Metasploit now.
test:
  <<: *pgsql
  database: metasploit_framework_test
  username: metasploit_framework_test
  password: ___________________________

Check:

msfconsole
db_connect -y /opt/config/database.yml

Publicado en Shell | Deja un comentario

buscar texto dentro de archivos

Buscar en ese directorio, en los que están dentro de él y en cualquier tipo de archivo:

grep -r “texto” /

Publicado en Shell | Deja un comentario

terminal proxy

sudo nano /etc/environment

http_proxy=”http://192.168.1.10:3128/”
https_proxy=”https://192.168.1.10:3128/”
ftp_proxy=”ftp://192.168.1.10:3128/”

Publicado en Shell | Deja un comentario

smbclient

Ver directorios compartidos

smbclient –list ip_del_servidor

Conectase

smbclient -U Usuario //servidor/c$

Publicado en Shell | Deja un comentario

apt-get proxy

sudo nano /etc/apt/apt.conf

Acquire::http::proxy “http://192.168.1.10:3128/”;
Acquire::https::proxy “https://192.168.1.10:3128/”;
Acquire::ftp::proxy “ftp://192.168.1.10:3128/”;

Publicado en Shell | Deja un comentario

Detectar ping

sudo tcpdump -i ethX icmp and icmp[icmptype]=icmp-echo

Publicado en Seguridad | Deja un comentario

Dansguardian Groups

Editar
sudo nano /etc/dansguardian/dansguardian.conf
Buscar
filtergroups = 1
filtergroupslist = ‘/etc/dansguardian/lists/filtergroupslist’
Remplazar por el numero de grupos que deseas
filtergroups = 5
filtergroupslist = ‘/etc/dansguardian/lists/filtergroupslist’

Descomentar
authplugin = ‘/etc/dansguardian/authplugins/ip.conf’

Ponle nombre a tus filtros
nano /etc/dansguardian/lists/filtergroupslist
User1=filter1
User2=filter2
User3=filter3
listanegra=filter4
listablanca=filter5

Agregar los filtros a las ip o rangos de ip que deseas
sudo nano /etc/dansguardian/authplugins/ip.conf’
190.167.0.15 = filter1
190.167.0.16 = filter2
190.167.0.17 = filter3
190.167.0.18 = filter4
190.167.0.19 = filter5

Copia los archivos de configuración que utilizaras en los nuevos grupos
sudo cp /etc/dansguardian/dansguardianf1.conf /etc/dansguardian/dansguardianf2.conf
sudo cp /etc/dansguardian/dansguardianf1.conf /etc/dansguardian/dansguardianf3.conf
sudo cp /etc/dansguardian/dansguardianf1.conf /etc/dansguardian/dansguardianf4.conf
sudo cp /etc/dansguardian/dansguardianf1.conf /etc/dansguardian/dansguardianf5.conf

edita
sudo nano /etc/dansguardian/dansguardianf1.conf

Remplaza
groupname = ”
por
groupname = ‘filter1’

edita
sudo nano /etc/dansguardian/dansguardianf2.conf

Remplaza
groupname = ”
por
groupname = ‘filter2’

edita
sudo nano /etc/dansguardian/dansguardianf3.conf

Remplaza
groupname = ”
por
groupname = ‘filter3’

edita
sudo nano /etc/dansguardian/dansguardianf4.conf

Remplaza
groupname = ”
por
groupname = ‘listanegra’

edita
sudo nano /etc/dansguardian/dansguardianf5.conf

Remplaza
groupname = ”
por
groupname = ‘listablanca’

copia
sudo cp /etc/dansguardian/lists /etc/dansguardian/lists2
sudo cp /etc/dansguardian/lists /etc/dansguardian/lists3
sudo cp /etc/dansguardian/lists /etc/dansguardian/lists4
sudo cp /etc/dansguardian/lists /etc/dansguardian/lists5

Editar
nano /etc/dansguardian/lists5/bannedsitelist

remplaza
#Blanket Block. To block all sites except those in the
#exceptionsitelist and greysitelist files, remove
#the # from the next line to leave only a ‘**’:
#**

#Blanket SSL/CONNECT Block. To block all SSL
#and CONNECT tunnels except to addresses in the
#exceptionsitelist and greysitelist files, remove
#the # from the next line to leave only a ‘**s’:
#**s

por

#Blanket Block. To block all sites except those in the
#exceptionsitelist and greysitelist files, remove
#the # from the next line to leave only a ‘**’:
**

#Blanket SSL/CONNECT Block. To block all SSL
#and CONNECT tunnels except to addresses in the
#exceptionsitelist and greysitelist files, remove
#the # from the next line to leave only a ‘**s’:
**s

editar
nano /etc/dansguardian/lists5/exceptionsitelist

agregar
debian.tallerdigitalvw.com

sudo /etc/init.d/dansguardian restart

Publicado en Dansguardian | Deja un comentario

Convertir .pem to .p12

cat GeoTrust_Global_CA.pem RapidsslinterCA.crt > turootycabundle.cer

openssl pkcs12 -export -in tucertificado.crt -inkey privado.pem -out tunuevocertificadoenp12.p12 -name tomcat -CAfile turootycabundle.cer -caname root -chain

Publicado en Shell | Deja un comentario