Sunday, March 28, 2010

Running Windows Applications in Linux

Transitioning from Windows to Linux is often quite difficult for Linux beginners. There are plenty of solutions available in the market today which will provide you a platform to install a window software in Linux.
Wine
in one of the them. Many Linux OS have already started providing wine by default like linux Mint, Kubuntu etc.

Wine is a compatibility layer for running Windows programs. It is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code.

Before you get started, you may want to check and confirm that the Windows program you want to install is in fact supported by Wine. Visit the Wine Application Database for a list of all the programs known to work in Wine, and at what level (fully supported, needs some tweaking, etc).



There is another software called Crossover
which requires registration. Visit this site http://www.howtogeek.com/howto/linux/how-to-install-windows-applications-on-linux-using-crossover/ for further information


If you don't want any hassle of installing packages in linux like Wine & Crossover, I suggest these alternatives.

1> Search for open source alternatives. There are plenty of alternatives available in market like gimp instead of Photoshop, openoffice instead of Microsoft office, BriscCad instead of Autocad.
I feel like, you are not satisfied yet. Goto www.osalt.com.
On that site, you can enter the name of the Windows application and it will list the open source alternatives that provide similar functionality.

2> Run windows in a virtual machines. Some of the solutions available are VmWare & VirtualBox. Install windows inside linux & work in it.

Citrix
3> Run application in remote windows system. Ofcourse, this require extra resources. Most preferred application used are rdesktop & Citrix.


If you want it other way round i.e. running linux software in windows,
check this out -->http://hacks-tweaks-security.blogspot.com/2010/04/creating-linux-environment-installing.html





Saturday, March 20, 2010

OS-Fingerprinting.

No firewalls can block icmp packets since its the basic way of communication & talking with the alive hosts. Many tools in linux use this protocol for OS fingerprinting such as sing & hping2. First we need to know the alive hosts in a subnet.
>for i in {1..254}; do ping -c1 192.168.0.$i; done |grep "ttl"
This command will print all reply summary from alive hosts
In this command, I'm using shell programming to ping all hosts in my subnet 192.168.0.0/24 .
We can also use another application called fping.
install fping by executing command
>sudo apt-get install fping
    To query the network for alive hosts in the subnet 192.168.1.0/24 give the command.
>fping -g 192.168.1.0/24 | grep "alive"
            or
>fping -g 192.168.1.0 192.168.1.255 | grep "alive"  


Now as we have found the alive ips we can continue to OS fingerprinting
Install sing by command > sudo apt-get install sing
For OS fingerprinting type sing -O ip_address 


There is another well known tool called NMAP, its glamourised in movies like MATRIX & Swordfish. It has varied options for playing around with the packets being send.
>nmap -v -sP 172.17.191.0/24 |grep "up"  // scanning a subnet for alive ips
>nmap -v -v -A 172.17.191.203            // scanning a pc
If this command don't works try "nmap -v -v -A -PN 172.17.191.203" forcing icmp packets.
Zenmap is another tool, which is GUI version of nmap. GFI languard is another famous tool. 
Watch this video on OS fingerprinting using Zenmap



Further reading .
http://nmap.org/book/osdetect.html
http://nostromo.joeh.org/osf.pdf

Fork BomB -- FIRE IN THE HOLE!

Here comes the fork bomb, it will explode & crash your system within minutes.
$ :(){ :|: & };:

It’s actually a shell function;  :() denotes unnamed function with the body enclosed in {}. The statement ‘:|:’ makes a call to the function itself and pipes the output to another function call—which is the same function & puts all processes in the background and hence you can’t kill any process. Finally ‘;’ completes the function definition and the last ‘:’ initiates a call to this unnamed function. So it recursively creates processes and eventually your system will hang. This is one of the most dangerous Linux commands and may cause your computer to crash!

 Solution : How to avoid a fork bomb? Of course, by limiting the process limit; you need to edit /etc/security/limits.conf. Edit the variable nproc to user_name hard nproc 100. You require root privileges to modify this file.

Above code is same as ->
forkbomb(){forkbomb|forkbomb&}; forkbomb

Check out this video from youtube about fork bomb prank.