RSS

Tag Archives: linux tips and tricks

Wired Network Device not managed Ubuntu 11.04

This is a common problem in Ubuntu 11.04, I tried to connect via a wired cable and was stunned to find that there was no auto Etho 🙂

After Googling for a while, I came across the solution below, hope it helps you guys

Solution is as follows
Step 1. Open the Network manager conf file

sudo gedit /etc/NetworkManager/NetworkManager.conf  

Step 2
Change the below line to true

managed=false

Step 3
Reboot your System

Visit blogadda.com to discover Indian blogs

 
1 Comment

Posted by on October 25, 2011 in Linux, Ubuntu

 

Tags: , , , , ,

Dual boot ubuntu 10.10 and fedora 14

So it’s been a long time since I have added a post but I decided to take time off and add one on this interesting topic.

I already had Ubuntu installed on my toshiba satellite laptop and now I decided to install fedora 14.

Once I installed Fedora it did not detect ubuntu and after a lot of Googling I found that I had to first recover ubuntu grub2 and then do
an update-grub to get the option of installing both.

I booted the system via live usb and installed the grub via the below command into the MBR

grub-install /dev/sda


Reboot

Then I ran ‘update-grub’ and did a reboot again but it did not detect fedora 14 and booted straight into ubuntu.
Again after a lot of googling I realized that since fedora was installed on the extended partition it was not detected.

So Now what? Well the solution was simple but it tool me a long time to find out.
All you need to do is install startup manager

sudo apt-get install startupmanager

run by typing

sudo startupmanager

and thats it it wil create the grub file along with the option to boot fedora

 
Leave a comment

Posted by on January 8, 2011 in Fedora, Linux, Ubuntu

 

Tags: , ,

Tcpdump to capture passwords

To skip straight to capture password click here

TCPdump is a very powerful command line interface packet sniffer. –

1. Install tcpdump
Ubuntu

sudo apt-get install tcpdump 

Fedora/Centos/Red hat

sudo yum install tcpdump

2. TCPDUMP USE
To display the Standard TCPdump output:

tcpdump

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

Network interfaces available for the capture:

 tcpdump -D

1.eth1
2.any (Pseudo-device that captures on all interfaces)
3.lo

– Capture the traffic of a particular interface:

 tcpdump -i eth0

– To capture the UDP traffic:

tcpdump udp

– To capture the TCP port 80 traffic:

 tcpdump port http

– To capture the traffic from a filter stored in a file:

 tcpdump -F file_name

To create a file where the filter is configured (here the TCP 80 port)

vim file_name

port 80

– To send the capture output in a file instead of directly on the screen:

tcpdump -w capture.log

– To read a capture file:

tcpdump -r capture.log

– To display the packets having “wordpress.com” as their source or destination address:

tcpdump host wordpress.com

– To display the FTP packets coming from 192.168.1.100 to 192.168.1.2:

tcpdump src 192.168.1.100 and dst 192.168.1.2 and port ftp

-And Finally to capture the password click here
Packets capture during a FTP connection. The FTP password can be easily intercepted because it is sent in clear text to the server.
We see in this capture the FTP username (amateur) and password (hosting).
You can use this incase you forget your ftp password and have stored it in your ftp client

Please note that this should not be used for any illegal and this blog will not be responsible for any actions that lead to illegal use

 
4 Comments

Posted by on November 8, 2010 in Centos, Fedora, Linux, Red hat, tools, Ubuntu

 

Tags: , , , , ,

Linux tips and tricks

Uncompress multiple .zip .gz or .bz2

.zip

for file in *.zip; do unzip “${file}”; done

.gz

gunzip *.gz

.bz2

bunzip2 *.bz2

tar.gz

for file in *.tar.gz; do tar zxf “${file}”; done

tar.bz2

for file in *.tar.bz2; do tar jxf “${file}”; done

Shell script usage

If you use one of the snippets that uses a for loop in a script with an arbitrary number of archives, you may want to set the shell to use “nullglobs”. For instance, normally *.tar.gz will evaluate to *.tar.gz when no files were found that match this wildcard, rather than evaluating to an empty string. As a result ‘tar’ is executed with this string as a parameter. To avoid this, you can request that the shell uses nullglobs with:

shopt -s nullglob

If no matches were found, the shell will return an empty string, and the for loop is terminated.

Search and Replace in multiple files.

Example: Replace every instance of yourdomain with mydomain in all .html files in current path using Perl.

perl -pi -e “s/yourdomain/mydomain/g;” *.html

Same as above but make a copy of original file for backup.

perl -pi -e.bak “s/yourdomain/mydomain/g;” *.html

Or, if you prefer a lightweight solution, you can use sed:

sed -i ‘s/yourdomain/mydomain/g’ *.html

(Add -r if you want to use extended regular expressions with sed.)

This Tips & Trix will cover banners for SSH and the console prompt.

About legal issues

An often forgotten area in system protection is an well formed banner text.

Since the publication of the “Computer Misuse Act 1990” it has been strongly recommended that computers display a banner before allowing users to log in. The Act stipulates that an offense of unauthorized access can only be committed if the offender knew at the time that the access he intended to obtain was unauthorized. Login banners are the best way to achieve this. The “Regulation of Investigatory Powers Act 2000” also requires information to be given to computer users: login banners may also be a good way to do this dissemination.

/etc/motd

Console login The content of this file is shown after the user has logged in, and immediately before the shell is started.

/etc/issue.net

Network login

OBS By default is this disabled in ssh!

The content of this file is shown when a ssh session is connected and before the authorization.

To enable this in ssh you have to follow this simple steps:

1. Create a /etc/issue.net file and fill it with the desired context

2. Edit /etc/ssh/sshd_config, to look like this Banner /etc/issue.net

3. Restart sshd, service sshd restart

FTP Greeting Banner

This topic is covered in the “Deployment Guide” for CentOS 5.1 in section 43.2.6.1. “FTP Greeting Banner”

*

[javascript:void(0);/*1234255103621*/ http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-server-ftp-gbanner.html%5D

TCP Wrappers and Connection Banners

This topic is covered in the Deployment Guide” for CentOS 5.1 in section 43.2.1.1.1. “TCP Wrappers and Connection Banners”

*

[javascript:void(0);/*1234255117465*/ http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-server-tcp-banner.html%5D

Sample banner texts

Example #1

Unauthorized access to this machine is prohibited
Press if you are not an authorized user

Example #2

********************************************************************
* *
* This system is for the use of authorized users only. Usage of *
* this system may be monitored and recorded by system personnel. *
* *
* Anyone using this system expressly consents to such monitoring *
* and is advised that if such monitoring reveals possible *
* evidence of criminal activity, system personnel may provide the *
* evidence from such monitoring to law enforcement officials. *
* *
********************************************************************

Fancy banners

linux_logo

“Create nice ASCII Art logos”

linux_logon is a tool that creates ASCII Art banners. The default ASCII art can be seen in the example below or other created from a template file. It does also add system stats like kernel version, CPU version, RAM and utilization values.

Example

#####
#######
@ ##O#O##
###### @@# #VVVVV#
## # ## VVV ##
## @@@ ### #### ### ### ##### ###### # ##
## @ @# ### ## ## ## ### ## # ##
## @ @# ## ## ## ## ### # ###
## @@# ## ## ## ## ### QQ# ##Q
## # @@# ## ## ## ## ## ## QQQQQQ# #QQQQQQ
## ## @@# # ## ## ### ### ## ## QQQQQQQ# #QQQQQQQ
############ ### #### #### #### ### ##### ###### QQQQQ#######QQQQQ
Linux Version 2.6.18-53.1.4.el5, Compiled #1 SMP Fri Nov 30 00:45:16 EST 2007
One 2.19GHz AMD AMD Turion(tm) 64 Mobile ML-40 Processor, 256M RAM, 4394.20 Bogomips Total
localhost.localdomain

An alternative to linux_logo is FIGlet.

Programs that could be used to create ASCII/ANSI logos

http://dag.wieers.com/rpm/packages/linux_logo/
http://www.deater.net/weave/vmwprod/linux_logo/

 
Leave a comment

Posted by on July 2, 2010 in Centos, Fedora, Hosting, Linux, Red hat

 

Tags: ,

 
%d bloggers like this: