Showing posts with label hack. Show all posts
Showing posts with label hack. Show all posts

Cisco Protected Port

October 29, 2014
I can see in my network any customer can communicate to any one on the same VLAN. Basically when ever any unknown packets ingress into the switch. Switch found no record in CAM table, so that frame flood every port of the respected VLAN, except the frame received port. Such a communication can very dangerous for the service provider and its customer. Because any one can sniff or send information to other customer in same VLAN. 

Broadcast packet also flooded into the network that can bottleneck our network. The way to protect such a bottleneck of the network we can configure switch port as protected port thus no port can directly communicated in a same broadcast domain.

Command:
interface fa0/2
switchchport mode access
switchport access vlan 30
switchport protected

This way we can protect the user in same VLAN. Protected port only be configured in edge port not the trunk port or L3 connected port. Now the protected port prevent any unicast, broadcast or multicast packet entering to the same switch interface. But traffic forwarded to same domain can be communicated through L3 device like router. 

Ubuntu Password Reset

February 18, 2014

Often I've forgotten Ubuntu password, this is the most occurring issue with me. Every-time I have to search Google how to reset the password on Ubuntu. So I decide to make notes for myself.

Here is the step how I reset the password.

First of all reboot Ubuntu and choose recovery mode from console. After that you may see "Recovery menu", just choose "root Drop to root shell prompt".

Now you are in a shell prompt, then use following command to change the password.


 #ls /home (this will show your home directory's username)
#mount -rw -o remount /
#passwd (username)
Enter new UNIX password:
Retype new UNIX password:
passwd Password updated successfully
#reboot

After wards you can use new password to login to ubuntu. Tested in Ubuntu server 14.04.

Remove Old Kernel packages Debian linux

October 17, 2013
Removing old kernels in Linux can be beneficial for several reasons:

  1. Free Up Disk Space: Each kernel version, along with its associated modules and headers, takes up disk space. Over time, multiple kernel versions can accumulate and consume a significant amount of storage. Removing old kernels helps free up valuable disk space.
  2. Clean Boot Menu: When you have multiple kernel versions installed, each one appears as an option in the boot menu. This can clutter the menu and make it harder to select the desired kernel. Removing old kernels simplifies the boot menu, making it easier to manage.
  3. Simplify System Maintenance: Managing fewer kernels can make system maintenance and updates easier. It reduces the complexity of keeping track of which kernels are installed and ensures that you are using the most up-to-date and secure versions1.
  4. Improve Security: Older kernels may contain vulnerabilities that have been patched in newer versions. By removing old kernels and keeping your system updated with the latest kernel releases, you ensure that security patches are applied promptly, reducing the risk of exploitation.
  5. Enhance Performance: Although old kernels don't directly affect running performance, having a streamlined system with fewer kernels can improve boot times and overall system efficiency.

Overall, removing old kernels helps maintain a clean, efficient, and secure Linux system.

 
root@kali:~# dpkg --purge linux-image-xxxx

Remove xxxx with your image version, revision number

Find and replace text in Linux Command

July 08, 2013
Most of you encounter a situation where you need to replace the text in Linux file. Recently  I need to do this in Ubuntu server for changing repo "US"  to "local" repo. Therefore here is the process how to change it.

You can use vi and vim text editor comes with every Linux OS, if your Linux don't have full function text editor then use this link to install it.

In my case I use it for replace international repo to local repo, you can use for any text replacement.

So I use word "US" to replace with "NP", Which is local for me.
Now use the following command to edit repo source

#sudo vi /etc/apt/sources.list


You can see  repo source list file is opened, then just use the following syntax to replace the text: In my case I use "us" and "np" word, please replace these with your desire word.

:%s/us/np/g

or if you need to conformation then you us this command, mean if you don't need to replace whole text.

:%s/us/np/gc

following command can be used for current line only
:s/us/np/g

Adobe flash player install ubuntu and kali linux

May 10, 2013
Recently I fresh install Ubuntu 13.04. Then I install chromium browser, after that I'm facing youtube video streaming. Chromium doesn't have inbuilt flash player like in Chrome. I tried to install adobe flash player searching from internet but no avail.

But I found this command which worked. Make sure you install chromium browser. After that use following command to install flash

(I already download tar.gz file from adobe site and extracted, you can use below command to get flash)

sudo apt-get install flashplugin-nonfree

Then you need to copy libflashplayer.so file into /usr/lib/chromium-browser/plugins directory
(I already extracted and copy from extracted folder to following folder, you can use below command)

sudo cp /usr/lib/flashplugin-installer/libflashplayer.so /usr/lib/chromium-brower/plugins

For kali linux

cp/usr/lib/flashplugin-installer/libflashplayer.so /usr/lib/mozilla/lougins

To run the browser just run the following command from terminal

chromium-browser -- enable-plugins


Enjoy!

Install LibreOffice in BackTrack 5 r3 and Kali

March 17, 2013
Install LibreOffice Backtrack 5 r3 and Kali

Sometime I need office to prepare document of the project and some other office work, So I decide to install office in BT or Kali rather switch back window. 

I'm going to download 64 bit version of office. You can download of your choice of office.
From the command console just type

root@bt:~# cd /tmp

root@bt:/tmp# wget wget http://download.documentfoundation.org/libreoffice/stable/4.0.1/deb/x86_64/LibreOffice_4.0.1_Linux_x86-64_deb.tar.gz

or Click here to choose of your choice of Libre

Now untar the file using following command
root@bt:/tmp# tar -zxvf LibreOffice_4.0.1_Linux_x86-64_deb.tar

 Enter to folder


root@bt:/tmp# cd LibreOffice_4.0.1.2_Linux_x86-64_deb/

root@bt:/tmp/LibreOffice_4.0.1.2_Linux_x86-64_deb# dpkg -i *.deb

deb package is found under DEBS directory

root@kali:~/Desktop/LibreOffice_4.1.1.2_Linux_x86_deb/DEBS# dpkg -i *.deb

(Libre version for Kali is different because its new)

Output look like these

Setting up libobasis4.0-javafilter (4.0.1.2-2) ...
Setting up libobasis4.0-kde-integration (4.0.1.2-2) ...
Setting up libobasis4.0-librelogo (4.0.1.2-2) ...
Setting up libobasis4.0-math (4.0.1.2-2) ...

Setting up libobasis4.0-ogltrans (4.0.1.2-2) ...
Setting up libobasis4.0-onlineupdate (4.0.1.2-2) ...
Setting up libobasis4.0-ooofonts (4.0.1.2-2) ...
Setting up libobasis4.0-ooolinguistic (4.0.1.2-2) ...
Setting up libobasis4.0-pyuno (4.0.1.2-2) ...
Setting up libobasis4.0-writer (4.0.1.2-2) ...

Setting up libobasis4.0-xsltfilter (4.0.1.2-2) ...
Setting up libreoffice4.0 (4.0.1.2-2) ...
Setting up libreoffice4.0-dict-en (4.0.1.2-2) ...
Setting up libreoffice4.0-dict-es (4.0.1.2-2) ...
Setting up libreoffice4.0-dict-fr (4.0.1.2-2) ...
Setting up libreoffice4.0-draw (4.0.1.2-2) ...
Setting up libreoffice4.0-en-us (4.0.1.2-2) ...
Setting up libreoffice4.0-impress (4.0.1.2-2) ...
Setting up libreoffice4.0-math (4.0.1.2-2) ...
Setting up libreoffice4.0-writer (4.0.1.2-2) ...
Setting up libobasis4.0-base (4.0.1.2-2) ...

Setting up libobasis4.0-calc (4.0.1.2-2) ...

Setting up libobasis4.0-postgresql-sdbc (4.0.1.2-2) ...
Setting up libreoffice4.0-base (4.0.1.2-2) ...
Setting up libreoffice4.0-calc (4.0.1.2-2) ...
Processing triggers for menu ...


You can found the installed file here

root@bt:/opt/libreoffice4.0/program#

To run the program of your choice, just type

root@bt:/opt/libreoffice4.0/program# ./soffice

Or on kali linux you can found your Apps under Application>Office>




Backtrack

November 15, 2012


Running Chrome as root @ BackTrack 5 R3

1.  Open console:

vi /usr/bin/google-chrome

2. Go to the last line and add "exec -a " --user-data-dir" :

then after your line look like this

exec -a "$0" "$HERE/chrome" "$@" --user-data-dir

3. save ":wq!"