Skip to main content

Identifying your version of GNU/Linux

[email protected]:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.3 (squeeze)
Release: 6.0.3
Codename: squeeze

Identifying remote web servers

Another awesome cURL feature. Option -I just downloads an http header, helping identify the remote web server.

[email protected]:~$ curl -I abaltazar.org
HTTP/1.1 200 OK
Date: Wed, 07 Dec 2011 04:04:41 GMT
Server: Apache
X-Pingback: http://abaltazar.org/wordpress/xmlrpc.php
Content-Type: text/html; charset=UTF-8

Awesome Applications: 

Monitor your public IP

My simple yet effective home public IP monitoring script.

#!/bin/bash

current_ip="YOURIPHERE"
ip=`curl -s ifconfig.me`

if [ "$current_ip" != "$ip" ] && [ $ip != "" ]
then
	echo "New IP detected: $ip" | mail -s "Public IP has been changed" [email protected]
fi

Programming: 

Awesome Applications: 

Installing wget on FreeBSD

[[email protected] ~]# cd /usr/ports/ftp/wget
[[email protected] ~]# make install clean

Unix: 

Securely cloning Linux partitions to a different system

Getting a bit-by-bit copy of a partition or an entire hard drive is quite simple using the tool dd.

Depending on what you're trying to accomplish, there are two ways to get a copy of your partitions/drives.

One option is to clone the partition/drive directly to an actual partion/drive of your different system.

dd if=/dev/sdb1 | ssh [email protected] of=/dev/sdb1

Other option is to clone the partition/drive to a raw file on your second system, and associate the raw file to a loopback on your secondary host. This will give you the ability to easily mount the file as it were an actual partion/drive stored on your drive.

dd if=/dev/sdb1 | ssh [email protected] of=/root/rubysecurity_sdb1
[email protected] # losetup /dev/loop2 /root/rubysecurity_sdb1
[email protected] # mount /root/rubysecurity_sdb1 /mnt

Awesome Applications: 

Installing PHP 5.3 in CentOS

To view the PHP related packages available in CentOS 5.x, simply run the following command:

[[email protected] ~]# yum search php

You should see the PHP 5.3 rpm packages prefixed as php53.***

Now it's just a matter of installing the package, and you should be all set.

[[email protected] ~]# yum install php53 php53-cli

Note:
If you made the mistake of installing PHP 5.1 previously, You will need to remove all of the PHP 5.1 packages currently installed on your system prior to installing the PHP 5.3 packages.
This can be accomplished as the following.

[[email protected] ~]# rpm -qa --queryformat="%{NAME}\n" | grep php
php
php-cli
php-common
php-imap
php-mssql
php-snmp
php-mhash
php-mysql
php-mbstring
[[email protected] ~]# yum remove php php-cli php-common php-imap php-mssql php-snmp php-mhash php-mysql php-mbstring

About

Why rubysecurity.org?

I originally planned on using this name because the site was initially going to be about my security research and development (Metasploit Meterpreter scripting). Since I'm pretty constraint in time at the moment to focus on this area at this point in time, I have put that on hold. (Though, I plan on doing extensive security research and add my fair share to make the internet a much safer place with contributions to the Metasploit Project in the near future).

This site is focused on documenting my experiences as both a user and Linux Systems Administrator; the good, bad, and the ugly. Also about the occasional programming project and gotchas, and finally, technical book reviews.

-Tony Baltazar

Pages

Premium Drupal Themes by Adaptivethemes