linux poison RSS
linux poison Email
0

How to list Open Files and Network Connections

Lsof is a Unix-specific diagnostic tool. Its name stands for LiSt Open Files, and it does just that. It lists information about any files that are open by processes currently running on the system. It can also list communications open by each process.

One evident advantage this capability is security. For example, if a spyware or other malware program was sending information from your computer to the Internet or to a file on your hard disk, it would show up in the output of these commands.

lsof – list open files
This simple command often ran with no arguments, and does just what it says: lists every single open file by every program running at the time. The output of lsof typically looks like this:

 
In this case the output is too large, so the better way to redirect the output to some file for further analysis, use this command to redirect the output: lsof > output.txt and or filter it using various pipe commands.
Another example, if one wants to see if the special file (application) firefox is open by any processes, we run the following command: lsof | grep /usr/lib/firefox/firefox

list open network sockets (connections)
In addition to listing open files, lsof can list open network sockets (connections) when given the -i switch.

  
If you observe the output you can see the list of open connections made by different process/application to/from you local box
Read more
2

Linux Market Share Passes 2%

W3Counter.com just releasted their April market share stats and linux passed 2.16% for the first time ever.

 
Read more
0

Setting the SUID/SGID bits

SetUID bit, the executable which has the SUID set runs with the ownership of the program owner. That is, if you own an executable, and another person issues the executable, then it runs with your permission and not his. The default is that a program runs with the ownership of the person executing the binary.

The SGID bit is the same as of SUID, only the case is that it runs with the permission of the group. Another use is it can be set on folders,making files or folders created inside the SGID set folder to have a common group ownership.

Note : Making SUID and SGID programs completely safe is very difficult (or maybe impossible) thus in case you are a system administrator it is best to consult some professionals before giving access rights to root owned applications by setting the SUID bit. As a home user (where you are both the normal user and the superuser) the SUID bit helps you do a lot of things easily without having to log in as the superuser every now and then

Setting SUID bits on the file:
Suppose I got the executable called "killprocess" and I need to set the suid bit on this file, go to command prompt and issue command: chmod u+s killprocess

Now check permission on the file with command ls -l killprocess, observe "s" that has been added for suid bit

-rwsr-xr-x 1 root root 6 Jun  7 12:16 killprocess

Setting GUID bits on the file:
go to command prompt and issue command: chmod g+s killprocess
This will set the GUID bit on the same file, check the permission on this file using command: ls -l killprocess
 
-rwsr-sr-x 1 root root 6 Jun  7 12:16 killprocess
Read more
1

OpenSUSE 11.1: Documentations

openSUSE 11.1 provides all the tools and resources you need for effective home computing and computing on the go. It includes a complete, intuitive Linux desktop with a Web browser, instant messenger, e-mail client, photo catalog, word processor, spreadsheet, graphics tools, multimedia software, games and more. Its office suite is 100-percent compatible with Microsoft Office, and it also features the latest software for home networking, wireless support, Web hosting, virtualization, application security and software development.

Getting Started:
    * openSUSE 11.1 Start-Up
    * KDE Quick Start
    * GNOME Quick Start

User Guides:
    * KDE User Guide
    * GNOME User Guide

Administration:
    * openSUSE 11.1 Reference Guide
    * Security Guide
    * AppArmor 2.3.1 Quick Start
Read more
0

Secure alternative to telnet

Telnet is a protocol allowing you to connect to a remote system and run programs and commands on that system. It is very old and still very much in use today.

Unfortunately, Telnet, by default, does not encrypt any data sent over the connection (including passwords), and so it is often practical to eavesdrop on the communications and use the password later for malicious purposes; anybody who has access to a router, switch, hub or gateway located on the network between the two hosts where Telnet is being used can intercept the packets passing by and obtain login and password information (and whatever else is typed) with any of several common utilities like tcpdump and Wireshark.

On the other hand, a program called ssh exists that can replace both telnet and ftp in a secure, encrypted way.

Ssh stands for Secure Shell. It will encrypt each connection with a random key, so that it is impossible or at least very hard for a third party to decrypt the connection and find the password, or spy on you.

Use putty (Here)  if you are on windows or use "ssh" command (example shown below) from Linux/UNIX box to connect to the remote server.

# ssh 192.168.0.2
The authenticity of host '192.168.0.2 (192.168.0.2)' can't be established.
RSA key fingerprint is 2b:91:9b:c1:a7:57:91:dc:93:b3:04:50:c0:b9:bd:ba.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.2' (RSA) to the list of known hosts.
Password:
Read more
Related Posts with Thumbnails