Grafica Circulos desde DB

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
<div class="row-fluid">
<div class="row-fluid hideInIE8 circleStats">
<?php  
//tomamos los datos del archivo conexion.php  
include("conexion.php");
$registro = mysql_query("select * from circle_stats WHERE published_circle='1' AND category_circle='SGSI' order by order_circle")
or die("problemas en el query".mysqli_error());
while ($reg = mysql_fetch_array($registro)) {
    echo '<div class="span2" onTablet="span4" onDesktop="span2">';
        echo "<div class='circleStatsItemBox $reg[color_circle]'>";
            echo "<div class='header' title='$reg[desc_circle]'>$reg[title_circle]</div>";
                echo "<span class='percent'>$reg[identctl_circle]</span>";
                    echo "<div class='circleStat'>";
                        echo "<input type='text' value='$reg[valor_circle]' class='whiteCircle' />";
                    echo "</div>";     
                    echo '<div class="footer">';
                        echo "<span class='value'>";
                            echo "<span class='number'>$reg[valordesc_circle]</span>";
                            echo "<span class='unit'>$reg[valdesc_circle]</span>";
                        echo "</span>";
                    echo "</div>";
        echo "</div>";
    echo "</div>";
}
?>
</div>
</div>
Publicado en php | Deja un comentario

Archivo de conexion a mysql php

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
include ("configuracion.php");
$identificador = mysql_connect($host, $user, $pwd);
if (!$identificador) {
    die('No se pudo conectar : ' . mysql_error());
}
 
$db_seleccionada = mysql_select_db($base_de_datos, $identificador);
if (!$db_seleccionada) {
    die ("Imposible usar  $base_de_datos " . mysql_error());
}
mysql_set_charset("UTF8", $identificador);
?>
Publicado en php | Deja un comentario

Archivo de configuracion php

1
2
3
4
5
6
<?php
$host = "127.0.0.1";
$user = "Usuario";
$pwd = "Contraseña";
$base_de_datos = "nombre_de_la_base_de_datos";
?>
Publicado en php | Deja un comentario

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