Search This Blog

Tuesday, November 27, 2012

Adjusting resolution on ubuntu

I have a problem with my Ubuntu display resolution which everytime I switch between my KVM machines, my Ubuntu's resolution will be set back to the default one( lower resolution than the one I wanted). To fix this problem, I will have to forcing Ubuntu to pre-set a custom resolution every time Ubuntu detects my montior is being connected.

Step1:
Show all possilbe resolution:

$xrandr

then you will see something like this as a result:

Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 8192 x 8192
DIN disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
VGA-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 433mm x 271mm
   1680x1050      60.0*+
   1280x1024      75.0     60.0  
   1280x960       60.0  
   1152x864       75.0  
   1024x768       75.1     70.1     60.0  
   832x624        74.6  
   800x600        72.2     75.0     60.3     56.2  
   640x480        72.8     75.0     66.7     60.0  
   720x400        70.1  

Step2:
Find out what values are required for creating a new profile for ur custom setting

$cvf [resolution] [Frequency]

for example, I want to use the highest possible resolution,

$cvf 1680x1050 60

Then I will get an output looking like this:

# 1696x60 51.40 Hz (CVT) hsync: 3.91 kHz; pclk: 8.25 MHz
Modeline "1696x60_60.00"    8.25  1696 1744 1904 2112  60 63 73 76 -hsync +vsync

Step3:
Testing new resolution settings

xrandr --newmode [new resolution profile name] [copying the result of the setting from the previous output]
xrandr --addmode [output channel] [new resolution profile name]
xrandr --output [output channel]  --mode [new resolution profile name]

Here is an example:
xrandr --newmode "1696x60_60.00"    8.25  1696 1744 1904 2112  60 63 73 76 -hsync +vsync
xrandr --addmode DVI-0 "1696x60_60.00"
xrandr --output DVI-0 --mode "1696x60_60.00"

Step4:
Create/Append your previous commands as setting to the autorun script at ~/.xprofile

gedit ~/.xprofile

Paste the following line to the file

xrandr --newmode "1696x60_60.00"    8.25  1696 1744 1904 2112  60 63 73 76 -hsync +vsync
xrandr --addmode DVI-0 "1696x60_60.00"
xrandr --output DVI-0 --mode "1696x60_60.00"

Save and restart Ubuntu to verify if it works.


Friday, November 9, 2012

Setting up network for BT and TargetOS for Pen testing

Assume that you want to have 2 machine with IP like this setup on different Vbox on ur system:
BackTrack: 192.168.20.11
Target OS( e.g. Win XP sp2) : 192.168.11.27
 =================== Back Track ===================  
Network adapter setting: 
Adapter 1:
Attached to: Internal network
Name: [make up something]
Promiscuous mode: Allow VM

Adapter 2:
Attached to: NAT

Start BT 2 without network and type the following commands to setup up the internet 
$ifconfig eth0 192.168.20.11/19 
$dhclient eth1
$/etc/init.d/networking start 
$/etc/init.d/apache2 start 
 =================== Targeted System ===================
Network adapter setting: 
Adapter 1:
Attached to: Internal network
Name: [make up something]
Promiscuous mode: Allow VM

Set static IP in windows 
IP: 192.168.11.27
Mask:255.255.224.0
-------------------------------------------------------
Validate the settings
1. use the target system 's internet browse 192.168.20.11 and you should expect to see the "It works" page
2. the BackTrack system should be able to ping www.google.com

Wednesday, October 31, 2012

Setting Tor Proxy on Virtual Box for anonymous browsing


Requirement:
Tor VM - http://www.janusvm.com/tor_vm/
BackTrack 5 live distro - http://www.backtrack-linux.org/
VirtualBox - https://www.virtualbox.org/

1. Install VirtualBox
2. Create a VM with Tor VM with little virtual Hard drive. Change the network setting of the virtual machine to "Bridged". Disable Audio and USB.
3. Create another VM with no virtual hard drive. Boot into the Stealth Version of Backtrack and change the network setting to "Bridged".
4.
vi /etc/resolv.conf
    nameserver [IP of the Tor VM]

5. change eth0 IP and boot up
   ifconfig eth0 [an used IP on the same network]/24 up
6. set gateway to the tor proxy
  route add default gw [IP of the Tor VM]

Thursday, October 18, 2012

Shellcode Quote Notes(1)

The following are some intuitive experiment to help understanding how the quote system works in shell code.

Asterisk (*)

* means "for any"

1. Create 3 file with filename : *testing *testing* testing* test*ing

$touch *testing
$touch "*testing*"
// won't work without the quote because of the starting with a meta-character " *"
$touch testing*
$touch test*ing
2. Test with "ls"

Case 1: 

Type:
$ls *

Meaning:
list anything

Result: 
*testing *testing* testing* test*ing

Case 2: 

Type:
$ls *\*

Meaning:
list anything that ends with a *

Result: 
*testing* testing* 

Case 3: 

Type:
$ls *\**

Meaning:
list anything (including nothing) that follows with a * and then follows by anything (including nothing)

Result: 
*testing *testing* testing* test*ing

Case 4: 

Type:
$ls \**

Meaning:
list something that starts with a * and then follow by anything (including nothing)

Result: 
*testing *testing*


Thursday, October 11, 2012

Resetting/Setting "adminstrative" password on ubuntu

If you just installed Ubuntu server edition, the root password is not set by default. you will have to use the following command to trigger a prompt to reset the "administrative" or "root" password

sudo passwd root
 

Wednesday, October 3, 2012

Making an ISO file from DVD with no protection

Just as simple as this:

dd if=/dev/dvd of=output.iso

Tried it on Windows XP installation disk and works. VirtualBox has no problem booting it up.

Thursday, August 2, 2012

How to say good bye to hot-corner in OpenSuse

I believe I am not the only person on this planet who find hot-corner to be an ignoring feature in Gnome3. This is how you can disable hot-corner without install compuiz.


Use root access to this file /usr/share/gnome-shell/js/ui/layout.js and change the following place to false.

su
vim /usr/share/gnome-shell/js/ui/layout.js


 The logout and log back in again.

Friday, June 22, 2012

Installing .bundle Files

sudo bash ./XXXXXX.bundle

or

gksudo bash ./XXXXXX.bundle

Check Linux Mint version

If you forget what version of linux mint u have installed (32-bitor 64-bit), here is the command:



cat /etc/linuxmint/info

Friday, June 15, 2012

Mounting SMB filesystem on Linux Mint

After numerous Googling..this is what had worked for me on Linux Mint 13 Maya.

$ sudo mount -t smbfs [DESTLOCATION] [LocalStorage] -o user=[username],password=[password]
Example:


$ sudo mount -t smbfs //X.X.X.X/srcfolder ~/tempStorage/ -o user=janedoe,password=****


If it is successful, Linux Mint to give a notification on the top left indicating a new removable drive is mounted.

If it is not successful, try replace "user" and "password"  with "username" or "pass" as the field names.