Wednesday, November 24, 2010

How to Clone a Virtual Box image

To clone a Virtual Box image do the following:

1. Copy the VM disk using following command
    VBoxManage clonevdi SourceDisk.VDI TargetDisk.VDI
2. Go To File -> Virtual Media Manager -> Add -> add the newly created disk (TargetDisk.vdi)
3. Create a New VM from Machine -> New,
   Type the new VM name,
   Allocate Memory,
   Virtual Hard Disk, Use Existing Hard Disk
   Select the  Hard Disk you added in step 2.
   Finish

   Copying the Virtual Machine HDD to other location will not work. You have to explicitly use the VBoxManage command in order to create a clone image.

Thursday, April 1, 2010

Recover your Internet User Password using Firefox

Most of the time when you subscribe to broadband/internet services, a technician comes to your home and sets up the router/wifi for you. Than after you never think about this password or you dont even need to.

The moment you want to replace the router with your favorite one, you just cannot find the username/password that your provider gave you at the time of subscribing for internet.

Follow the below steps to recover the password from any broadband router, gateway 
Below steps are for Aztech DSL605 ADSL router.

1. Open the gateway administrator page in firefox.
2. Go to Advanced, WAN and select your exisitng WAN connection


3. The moment you navigate to this page, firefox will pop-up with option for "Remember Password"
4. Select "Remember Password"
5. Goto  Tools, Options, Security, Saved Password
6. You will see all the passwords including the one for your WAN conneciton

Sunday, March 14, 2010

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Problem
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Solution

$mysql -u root -p

GRANT ALL PRIVILEGES ON *.* TO user@ip-address IDENTIFIED BY 'password';
commit;

Sunday, March 7, 2010

Could not load host key: /etc/ssh/ssh_host_key

 Error starting ssh
root@slax:/etc# /usr/sbin/sshd
Could not load host key: /etc/ssh/ssh_host_key
Could not load host key: /etc/ssh/ssh_host_rsa_key

Solution:

ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ''
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''

Re-start SSH

Wednesday, March 3, 2010

Connecting to windows share from Ubuntu using smbclient

How to connect windows share from Ubuntu

smbclinet -U username%password //hostname/c$ or //hostname/ipc$
Ensure that File and Print Sharing is enabled on windows.

Open Source and Free Web Scanners


Cal9000: CAL9000 is a collection of web application security testing tools that complement the feature set of current web proxies and automated scanners. CAL9000 gives you the flexibility and functionality you need for more effective manual testing efforts. Works best when used with Firefox or Internet Explorer. CAL9000 is written in Javascript, so you have full access to the source code.
Grendel-Scan: Grendel-Scan is an open-source web application security testing tool. It has automated testing module for detecting common web application vulnerabilities, and features geared at aiding manual penetration tests. The only system requirement is Java 5; Windows, Linux and Macintosh builds are available.

Nikto: Nikto is an Open Source (GPL) web server scanner which performs comprehensive tests against web servers for multiple items, including over 3500 potentially dangerous files/CGIs, versions on over 900 servers, and version specific problems on over 250 servers. Scan items and plugins are frequently updated and can be automatically updated (if desired).
Nnikto: A console app to perform forced browsing checks against a web server. The application uses a simple algorithm and various techniques to prevent/reduce false positives.

Ratproxy: A semi-automated, largely passive web application security audit tool, optimized for an accurate and sensitive detection, and automatic annotation, of potential problems and security-relevant design patterns based on the observation of existing, user-initiated traffic in complex web 2.0 environments. Detects and prioritizes broad classes of security problems, such as dynamic cross-site trust model considerations, script inclusion issues, content serving problems, insufficient XSRF and XSS defenses, and much more.

W3af: w3af is a Web Application Attack and Audit Framework. The project's goal is to create a framework to find and exploit web application vulnerabilities that is easy to use and extend. To read our short and long term objectives, please click over the Project Objectives item in the main menu. This project is currently hosted at SourceForge , for further information, you may also want to visit w3af SourceForge project page.
Wapiti: Wapiti currently search vulnerabilities like XSS, SQL and XPath injections, file inclusions, command execution, LDAP injections, CRLF injections. Wapiti uses the Python programming language.Wapiti allows you to audit the security of your web applications. Wapiti performs "black-box" scans and does not study the source code of the application but scans the webpages of the deployed webapp, looking for scripts and forms where it can inject data.

Friday, February 26, 2010

Synaptic Manager Error - avast4server

Synaptic Manager not starting with an error "The package avast4server needs to be reinstalled, but I can't find an archive for it."

Solution
dpkg --remove --force-remove-reinstreq avast4server

Wednesday, February 24, 2010

Installing package from source

To install a package from source.tar.gz
tar -xzvf source.tar.gz
cd source(dir)
./configure (Option: --prefix=/opt/package_name if you wish to install the package in a different folder
make
make install

To install a package in Ubuntu using apt-get (with dependencies)
apt-get install package_name --fix-missing

Installing Essential Packages
# apt-get update && apt-get upgrade
# apt-get install build-essential

Installing from source.bz2
tar -xvjf source.bz2
cd (folder in which tar extracted the files)
./configure
make
make install

Adding Path in Ubuntu
Edit /etc/environment file and update it with the folder you need to add to the path.

Sunday, February 21, 2010

Setting root password on Ubuntu

By default ubuntu does not allow root access. while installing ubuntu you will be asked to provide a username and password to access the system. Log in to ubuntu with the user created while installation.
$sudo passwd
will ask for your password and allow you to set the new password for root

Thursday, February 18, 2010

Synaptic Package Manager not accepting root password

When i start Synatic Manager,
Synamtic Manager challenges for the root password but does not accept password even if it is correct.

Run Synaptic from the command line using gksudo synaptic

Sunday, January 3, 2010

Oracle SOA Suite Error while installing on Linux RH5 Enterprise

Problem :

Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2008-05-28_12-31-38PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred..
java.lang.UnsatisfiedLinkError: /tmp/OraInstall2008-05-28_12-31-38PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.security.action.LoadLibraryAction.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
at sun.awt.DebugHelper.(Unknown Source)
at java.awt.Component.(Unknown Source)
at oracle.sysman.oii.oiif.oiifm.OiifmGraphicInterfaceManager.(OiifmGraphicInterfaceManager.java:222)
at oracle.sysman.oii.oiic.OiicSessionInterfaceManager.createInterfaceManager(OiicSessionInterfaceManager.java:193)
at oracle.sysman.oii.oiic.OiicSessionInterfaceManager.getInterfaceManager(OiicSessionInterfaceManager.java:202)
at oracle.sysman.oii.oiic.OiicInstaller.getInterfaceManager(OiicInstaller.java:436)
at oracle.sysman.oii.oiic.OiicInstaller.runInstaller(OiicInstaller.java:926)
at oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.java:866)
Exception in thread "main" java.lang.NoClassDefFoundError
at oracle.sysman.oii.oiif.oiifm.OiifmGraphicInterfaceManager.(OiifmGraphicInterfaceMa
nager.java:222)
at oracle.sysman.oii.oiic.OiicSessionInterfaceManager.createInterfaceManager(OiicSessionInterfaceManager.java:193)
at oracle.sysman.oii.oiic.OiicSessionInterfaceManager.getInterfaceManager(OiicSessionInterfaceManager.java:202)
at oracle.sysman.oii.oiif.oiifm.OiifmAlert.(OiifmAlert.java:151)
at oracle.sysman.oii.oiic.OiicInstaller.runInstaller(OiicInstaller.java:984)
at oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.java:866)


Solution:
Install libXpm-devel-3.5.5-3.i386.rpm from CD 2 Linux Distribution CD.
rpm -Uvh libXpm-devel-3.5.5-3.i386.rpm

Start Installation Again

Thursday, December 31, 2009

Start Jboss Console with Jboss server listen to Ethernet Interface

By Default, the JBOSS admin console will not start with ./run.bat. Enter the following command to start JBoss admin console and listen to Ethernet interface

run $JBOSS_HOME/bin/run.sh -c all -b 0.0.0.0

test the server
http://jboss_server:8080
Test the admin console
http://jboss_server/admin-console with username admin password admin

Sunday, December 27, 2009

How do I change my Webmin password if I can't login?

Webmin distribution includes a program called changepass.pl to change the password of webmin account. Run the below command

/usr/local/src/webmin-1.441/changepass.pl /etc/webmin admin admin123
where "admin" is the existing webmin user and "admin123" is the new password
You can find the list of webmin users in /etc/webmin/miniserv.users

Saturday, December 26, 2009

Change DHCP to Static IP in Ubuntu

sudo vi /etc/network/interfaces

Change

auto eth0
iface eth0 inet dhcp

To

iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Accessing a VM from the host over IP

You have configured the Virtual machine ethernet is configured for "Bridged" mode and you are not connected to a network. When accessing the virtual machine you realize that the VM does not get an IP address but you still want to access the VM over IP.

Solution:
Edit "Virtual Machine Settings"
Change Ethernet from "Bridged" to "Host Only"
The VM will get an IP.
Type ifconfig or ipconfig on the virtual machine.
You now have an ip address in range of 192.168.X.X

Ubuntu stops listning on eth0 in VMWARE

 After copying or cloning the working VM, I started ubuntu and found that the eth0 is no more getting an IP address.
Follow the below steps to fix it.
1. Edit the .vmx file of the virtual machine.
2. check the MAC address at ethernet0.generatedAddress = "00:00:00:00:d2:2b"
3. Edit /etc/udev/rules.d/70-persistent-net.rules on ubuntu and change the MAC to the above.
4. restart network by /etc/init.d/networking restart OR restart ubuntu.
5. On restart, ubuntu should bind the eth MAC correctly and the server should enable the ethernet adapter.

Monday, September 28, 2009

Vulnerability Assessment using OpenVAS

finally an alternate to Nessus has arrived.