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