Showing posts with label Linux Hacking. Show all posts
Showing posts with label Linux Hacking. Show all posts

Friday, 20 September 2013

How To Secure Your Linux Servers???


The free, open-source GNU/Linux operating system is getting better each year for desktop use, but it's been a major contender for server use since the late 1990s. With popularity, however, it has become profitable for thieves to break into Linux servers and use them for spamming, scams, and serving pornography, among other things. Here are some ways you can protect your server from such a fate.

Steps

  1. Learn to use Linux from the shell (command line). Every layer of software added on to make your system administration "easier" actually adds more methods for crackers to gain access to your machine and also reduces performance. All the further steps will assume your familiarity with using a shell.



  • Using lsof or a similar tool, find out on which ports your computer is listening for connections:

    ns003:~# lsof -i
    COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
    named 17829 root 4u IPv6 12689530 UDP *:34327
    named 17829 root 6u IPv4 12689531 UDP *:34329
    named 17829 root 20u IPv4 12689526 UDP ns003.unternet.net:domain
    named 17829 root 21u IPv4 12689527 TCP ns003.unternet.net:domain (LISTEN)
    named 17829 root 22u IPv4 12689528 UDP 209.40.205.146:domain
    named 17829 root 23u IPv4 12689529 TCP 209.40.205.146:domain (LISTEN)
    lighttpd 17841 www-data 4u IPv4 12689564 TCP *:www (LISTEN)
    sshd 17860 root 3u IPv6 12689580 TCP *:ssh (LISTEN)
    sshd 17880 root 3u IPv6 12689629 TCP *:8899 (LISTEN)
    sshd 30435 root 4u IPv6 74368139 TCP 209.40.205.146:8899->dsl-189-130-12-20.prod-infinitum.com.mx:3262 (ESTABLISHED)




  • If in doubt, hack it out! Shut down any unknown or unneeded services, using the appropriate tools for your Linux distribution, such as update-rc.d on Debian systems, or in some cases editing the /etc/inetd.conf or/etc/xinetd.d/* files. Along with this, get rid of any tools your server provider added for system administration, such as Plesk.




  • Don't allow root logins on your primary sshd port 22 (set PermitRootLogin to "no"); many automated tools run brute-force attacks on that. Set up a secondary port for root access that only works by shared keys, disallowing passwords:
    • Copy the sshd_config file to root_sshd_config, and change the following items in the new file:
      • Port from 22 to some other number, say 8899 (don't use this! make up your own!)
      • PermitRootLogin from "no" (you were supposed to set it to "no" for port 22, remember?) to "yes"
      • AllowUsers root add this line, or if it exists, change it to allow only root logins on this port
      • ChallengeResponseAuthentication no uncomment this line if it's commented out, and make sure it says "no" instead of "yes"
    • Test this command: 

      sshd -D -f /etc/ssh/root_sshd_config
      and see if it works correctly -- try logging in from another computer (you must have already set up shared-key authentication between the two computers) using: 

      ssh -p8899 root@my.remote.server
      and if so, control-C at the above (sshd) command to stop the sshd daemon, then add this to the end of /etc/inittab: 

      rssh:2345:respawn:sshd -D -f /etc/ssh/root_sshd_config
    • Restart the init task: # init q This will run your "root ssh daemon" as a background task, automatically restarting it in case of failure.

    Video


    • Tips

      • Check your log files regularly to see what types of attacks are being run against your server./var/log/auth or /var/log/auth.log is a typical place to find attempted logins: 
        Jan 18 10:48:46 ns003 sshd[23829]: Illegal user rosa from ::ffff:58.29.238.252
        Jan 18 10:48:49 ns003 sshd[23833]: Illegal user rosemarie from ::ffff:58.29.238.252
        Jan 18 10:48:51 ns003 sshd[23838]: Illegal user ruth from ::ffff:58.29.238.252
        Jan 18 10:48:54 ns003 sshd[23840]: Illegal user sabine from ::ffff:58.29.238.252
        Jan 18 10:48:57 ns003 sshd[23845]: Illegal user sandra from ::ffff:58.29.238.252
      • Regularly upgrade your operating system to add security fixes. On Debian: apt-get upgrade
      • Monitor news on vulnerabilities at http://www.securityfocus.com/ and related websites.
      • Try installing grsecurity and/or SELinux and/or AppArmour and/or PaX.

      Warnings

      • Nothing you can do will make your server completely secure. Have backups of all important files, and a backup plan in place in case the worst happens.
      • Never trust a server that has been cracked. A cracker has access to 100% of the system once they have root access.

      Tuesday, 10 September 2013

      How to Install Skype on Ubuntu Linux


      Many People feel unsecured while chatting on Skype in windows platform due to the FUD (Fully Undetectable Viruses) threat. Hence today in this tutorial i will tell you how you can run Skype in Linux Platform which is almost 98% secure from RAT and other malicious viruses.


      Here we Have two methods of installing Skype in Ubuntu Linux

      1. Through Ubuntu Software Center
      2. Manual Method 

      Skype Through Ubuntu Software Center 
      For this just  go to Ubuntu Software Center and in search type Skype , Ubuntu 11.10 Support Skype 2.0 Version for Linux. Click on install and in few minutes you are ready to use the Skype.

      Installing Skype Through Manual MethodThis is the easiest method to install from the command line. There are three commands that you must use to install Skype correctly.
      Open your terminal and copy paste this commands 
      sudo apt-get install libqt4-gui

      wget -c -O /tmp/skype.deb http://www.skype.com/go/getskype-linux-ubuntu
      sudo dpkg -i /tmp/skype.deb



      Now you can see the Skype on your menu bar and you are ready to use Skype no need to worry about RAT and other trojan.

      Monday, 9 September 2013

      Hacking Windows Using Linux





      Friends on net I found out that many of you are asking for hacking windows using Linux or other operating systems.

      So here i m writing the trick which allows you to hack the admin password of windows using linux.

      Firstly,Windows is installed on you computer and then you need a live CD of linux,here we will use a live CD of UBHUNTU.

      Boot from the Live CD and perform the 7 easy step to hack the windows Admin password.
      Steps:

      1: Install a program called chntpw
      Command is: $ sudo apt-get install chntpw

      The rpm pakage installed is the packege to change password.

      2: After successfully installing chntpw, you have to access the Windows NTFS partition by mounting it and allowing read/write support.
      Use Mount system Call.

      3: After that, navigate to WINDOWS/system32/config

      use cd command to navigate.

      4: Once inside the config directory, issue this command:

      $ sudo chntpw SAM

      Command to reset admin password.

      As you are in Linux the security of windows is bypassed and the password can be changed easily.

      5: A long display of information will follow.

      Just ignore them.

      6: Once you are prompted to reset the password, it is recommended to leave the password blank with an asterisk (*).

      7: Reboot, with windows and you can now login to Windows with full administrative access.

      Hacking Linux ssh






      Friend i found a trick which is most demanded by you.

      Most of us need to remotely run utilities on other machines using remote login. ssh allows you to execute code on remote machine.

      However in normal usage it prompts you for password which makes it hard to use in unattended processes.

      We need to authenticate to the server or the remote machine.

      So here is the solution to bypass the authenticity chack and execute remotely without password.

      If want to connect to remote machine named machineX as user named user.

      Perform the following steps and you are done with it.

      1) Generate a private-public keypair using ssh-keygen as follows:

      ssh-keygen -t dsa

      This will create a private and public keypair which is stored in ~/.ssh directory.
      2) Next run the following command once for every machine you want to remotely login without specifying password:

      Now you can login to the machine using ssh without requiring to specify any password.

      Your public key, which you copied to the remote machine, is checked (not directly) against your private key to verify your authenticity.

      Thus authenticity is bypassed and you can do your work.