Monday, August 11, 2014

How to hack Remote PC with Metasploits (Windows 2003 server)

Read full details here: How to hack Remote PC with Metasploits (Windows 2003 server)

This is a a detailed step by step guide on How to hack Remote PC with Metasploits (Windows 2003 server). I’ve used BackTrack 5 and Windows 2003 server in a virtual environment. The ease of hacking is scary and readers, sysadmins are advised to update their Windows 2003 server to the latest patch/service pack and use additional antivirus, firewalls to protect them from similar situation. Exactly same commands can be used on Kali Linux, Ubuntu, Debian or any Linux that got Metasploits installed. In fact you can just do the whole thing from a Virtual Machine or USB and leave no trace whatsoever.



The author takes no responsibility on how this tutorial is being used by readers and this is for educational purpose only.

  1. Contents
  2. Introduction
  3. Metasploit quick guide
    • search
    • show exploits
    • show payloads
    • show options
    • info
    • use
    • set RHOST
    • set RPORT
    • set PAYLOAD
    • set LPORT
    • exploit
    • help
  4. Lab Setup
  5. Objective
  6. Detailed Steps
    • Step 1 – Scan with nmap for open ports
    • Step 2 – Open msfconsole
    • Step 3 – Search RPC exploit in Metasploit
    • Step 4 – Gather info about target exploit
    • Step 5 – Activate exploit
    • Step 6 – Configure exploit
    • Step 7 – Set payload for exploit
    • Step 8 – Launch exploit and establish connection
    • Step 9 – Perform an action on pentested server

Introduction

Metasploit is simple to use and is designed with ease-of-use in mind to aid Penetration Testers.
I will be taking you through this demo in BackTrack 5 R3, so go ahead and download that if you don’t already have it:
http://www.backtrack-linux.org/downloads/
The reason for using BackTrack 5 R3 is because it has the correct Ruby Libraries.
Metasploit framework has three work environments,
  1. The msfconsole,
  2. The msfcli interface and
  3. The msfweb interface.
However, the primary and the most preferred work area is the ‘msfconsole’. It is an efficient command-line interface that has its own command set and environment system.
Metasploit quick guide
Before executing your exploit, it is useful to understand what some Metasploit commands do. Below are some of the commands that you will use most. Graphical explanation of their outputs would be given as and when we use them while exploiting some boxes in later part of the article.
  1. search : Typing in the command ‘search’ along with the keyword lists out the various possible exploits that have that keyword pattern.
  2. show exploits : Typing in the command ‘show exploits‘ lists out the currently available exploits. There are remote exploits for various platforms and applications including Windows, Linux, IIS, Apache, and so on, which help to test the flexibility and understand the working of Metasploit.
  3. show payloads : With the same ‘show‘ command, we can also list the payloads available. We can use a ‘show payloads’ to list the payloads.
  4. show options : Typing in the command ‘show options‘ will show you options that you have set and possibly ones that you might have forgotten to set. Each exploit and payload comes with its own options that you can set.
  5. info : If you want specific information on an exploit or payload, you are able to use the ‘info’ command. Let’s say we want to get complete info of the payload ‘winbind’. We can use ‘info payload winbind‘.
  6. use : This command tells Metasploit to use the exploit with the specified name
  7. set RHOST : This command will instruct Metasploit to target the specified remote host.
  8. set RPORT : This command sets the port that Metasploit will connect to on the remote host.
  9. set PAYLOAD : This command sets the payload that is used to a generic payload that will give you a shell when a service is exploited.
  10. set LPORT : This command sets the port number that the payload will open on the server when an exploit is exploited. It is important that this port number be a port that can be opened on the server (i.e.it is not in use by another service and not reserved for administrative use), so set it to a random 4 digit number greater than 1024, and you should be fine. You’ll have to change the number each time you successfully exploit a service as well.
  11. exploit : Actually exploits the service. Another version of exploit, rexploit reloads your exploit code and then executes the exploit. This allows you to try minor changes to your exploit code without restarting the console
  12. help : The ‘help’ command will give you basic information of all the commands that are not listed out here.
Now that you are ready with all the basic commands you need to launch your exploit. Let’s choose a couple of scenarios to get control of a remotely connected machine.

Lab Setup:

Victim Machine
OS: Microsoft Windows Server 2003
IP: IP: 192.168.42.128
Attacker (Our) Machine
OS: BackTrack 5 R3
Kernel version: Linux bt 2.6.38 #1 SMP Thu Mar 17 20:52:18 EDT 2011 i686 GNU/Linux
Metasploit Version: Built in version of metasploit 3.8.0-dev
IP: 192.168.42.128

Objective

The only information provided to us about the remote server is that it is a Windows 2003 Server and the Objective is to gain shell access of this remote server.

Detailed Steps

Step 1 – Scan with nmap for open ports

Perform an nmap scan of the remote server 192.168.42.129.
The output of the nmap scan shows us a range of ports open which can be seen below in Figure 1.

Read the rest of it here: How to hack Remote PC with Metasploits (Windows 2003 server)

Saturday, August 9, 2014

Cracking Wifi WPA/WPA2 passwords using Reaver-WPS

Read full details here: Cracking Wifi WPA/WPA2 passwords using Reaver-WPS

Overview:

Reaver-wps performs a brute force attack against an access point’s WiFi Protected Setup pin number. Once the WPS pin is found, the WPA PSK can be recovered and alternately the AP’s wireless settings can be reconfigured. This post outlines the steps and command that helps cracking Wifi WPA/WPA2 passwords using Reaver-WPS.
While Reaver-wps does not support reconfiguring the AP, this can be accomplished with wpa_supplicant once the WPS pin is known.


Readers, note that I’ve since written another post where I could crack a password in 14.21 seconds. using pyrit cowpatty and WiFite combination attack with dictionary.The whole process takes less than 10 minutes.
Those who would like to try more ways of cracking Wifi WPA WPA2 passwords, you can also use HashCat or cudaHashcat or oclHashcat to crack your unknown Wifi WPA WPA2 passwords. The benefit of using Hashcat is, you can create your own rule to match a pattern and do a Brute-force attack. This is an alternative to using dictionary attack where dictionary can contain only certain amount of words but a brute-force attack will allow you to test every possible combinations of given charsets. Hashcat can crack Wifi WPA/WPA2 passwords and you can also use it to crack MD5, phpBB, MySQL and SHA1 passwords. Using Hashcat is an good option as if you can guess 1 or 2 characters in a password, it only takes few minutes. For example: if you know 3 characters in a password, it takes 12 minutes to crack it. If you know 4 characters in a password, it takes 3 minutes. You can make rules to only try letters and numbers to crack a completely unknown password if you know a certain Router’s default password contains only those. Possibilities of cracking is a lot higher in this way.
Important Note: Many users try to capture with network cards that are not supported. You should purchase a card that supports Kali Linux including injection and monitor mode etc. A list can be found in 802.11 Recommended USB Wireless Cards for Kali Linux. It is very important that you have a supported card, otherwise you’ll be just wasting time and effort on something that just won’t do the job.




Read the rest of it here: Cracking Wifi WPA/WPA2 passwords using Reaver-WPS

Tuesday, August 5, 2014

World Live DDoS attack maps - Live DDoS Monitoring

Read full details here: World Live DDoS attack maps - Live DDoS Monitoring

So you read newspapers? You know DDoS happened last year? What about right now at this instance?

Watch in Awe the multi Gigabit DDoS attacks happening worldwide right now!!! .. Truly amazing and scary. See DDOS attacks maps live on this world  #LiveDDoS attack maps.  Very interesting interactions between USA and China.

In time I will add more monitoring (there are quite a few more but they are not Live). Before we go in and see the maps lets go over the basics first.

Note: These maps are severely CPU and memory(RAM) intensive.

If you’re behind a proxy server,  NORSE maps wont work.

You will possibly need Flash and Java on your Linux machines to view these maps live.

I’ve edited the maps to allow you to view on any screen size. (i.e. mobile or large LCD)





Read the rest of it here: World Live DDoS attack maps - Live DDoS Monitoring

Sunday, August 3, 2014

Download accelerator manager for Linux - Flareget

Read full details here: Download accelerator manager for Linux - Flareget

Before many started using Linux, we used Windows. One thing Windows gives you is plenty of softwares (well call them shareware’s if you want). In Windows did you use a download accelerator manager to download large files? Did you use FlashGet? or Internet Download Manager? Well, in Linux you can use wget but sometimes you just want to grab a link from Browser, start downloading and keep on browsing. Opening a terminal, typing in the wget command and specifying an output filename is the way of the past (here comes flames!). But the way I think, if I can just do something using my mouse buttons, I will possibly opt for that instead of using a command line tool. Yes command line tools are more powerful but at the same time it takes some time to get used to it. So if you are switching from Windows to Linux, then Flareget is the perfect download accelerator manager software for you. And it gets better, you can download videos with a single click.




What is Flareget?

FlareGet is a full featured, multi-threaded download manager and accelerator for Windows and Linux. The best part? they provide a free to use software for Linux and it provides a nice browser extension for Linux users which makes grabbing links more easier. Browser integration extension allows you to grab and download Youtube videos.

FlareGet for Linux System Requirements:

FlareGet is a native Linux application written in C++, using Qt framework. FlareGet will run on almost all desktop environments – GNOME, KDE, Unity, Cinnamon etc. To run FlareGet following minimum dependencies should be met:
  • Qt libraries with version >=4.8.1
  • glibc (C library) with version >=2.13

FlareGet features and issues


Dynamic File Segmentation

It uses a robust dynamic file segmentation algorithm to speed up the download. The download is split into segments to increase the speed. In addition to dynamic file segmentation, it uses Http-Pipelining which further accelerates each segment.
small_image

Enhanced Browser Integration

It integrates with all the browsers to replace their default download manager and start the download by itself. It supports almost all the browsers – firefox, internet explorer, google chrome, chromium, opera etc.
small_image

Intelligent File Management

It uses an intelligent file management system to automatically categorize your files based on their extensions. All the downloads are grouped in different folders as per their categories.
small_image

Resume Support

It can resume unfinished downloads even on power failures or system crash. It also automatically retries when a segment or download fails. Currently there is no resume support for FTP downloads
small_image

Multi-Protocol Support

It supports HTTP, HTTPS and FTP protocols to let you download files from internet. It also has full Metalink support.
small_image

Mirror Support

It supports segmented download of a file from multiple mirror sites with automatic link checking of expired URLs.
small_image

Speed Limits

You can limit the download speed to prevent usage of whole bandwidth.
small_image

Add or Remove Segments

You can add or remove download segments dynamically without interrupting the download.
small_image

Limit Downloads

You can limit the number of simultaneous downloads, when one download ends, another starts automatically.
small_image

Youtube Grabber

One click flash video download from Youtube is supported for all the browsers.
small_image

Smart Scheduler

You can easily schedule flareGet to download files automatically. It allows you to start and pause downloading files at the set time.
small_image

Clipboard Monitoring

No need to copy paste your download links, it monitors your clipboard.
small_image

Batch Downloads

You can simply import urls from a text file (each link in separate line) or an html file and download them all.
small_image

Multi Language Support

FlareGet is available in 17 different languages, currently English, Arabic, Farsi, Italian, Chinese(Simplified), French, Czech, Bengali, Spanish, Brazilian Portuguese, Russian, Polski, Turkish, Russian, Nederlands, German and Indonesian are available.
To see a complete list of features go the this page http://flareget.com/features

FTP support is limited. Only single threaded download is supported, with no resume and proxy support.

Browser Integration Extensions

FlareGet supports browser integration for all the browsers – firefox, google-chrome, chromium and opera. To provide browser integration for all browsers, FlareGet uses Browser Plugin which is packaged with FlareGet only. Flaremonitor makes sure that plugin always works.
Now, Flaremonitor has been replaced with browser extensions available for google-chrome & chromium in Chrome Web Store and for firefox at following link:
https://addons.mozilla.org/en-US/firefox/addon/flareget-integration/
The extensions make sure that FlareGet Browser Plugin provides close to perfect browser integration, with more control. Just press hold “F” key in case you don’t want FlareGet to take over the download (provided flaremonitor is uninstalled).
Opera users still need flaremonitor till Opera 15+ is released for Linux, after which flaremonitor will be completely discontinued.

Download Flareget package

You can download Flareget package from their download page:
Based on your system, download a 32-bit or 64-bit package
  • Download .deb packages for for Ubuntu, Linux Mint and other Debian based Linux distributions.
  • Download .rpm packages for Fedora, OpenSuse and other RPM based Linux distributions.
  • Download .pac packages for Arch Linux, Chakra Linux and other Pacman based Linux distributions.
Assuming you downloaded the correct package, move to the installation section.
Read the rest of it here: Download accelerator manager for Linux - Flareget

Friday, August 1, 2014

View compressed .gz files without uncompressing using Z commands in Linux

Read full details here: View compressed .gz files without uncompressing using Z commands in Linux

How often you bumped into a .gz file where you need to check the contents? I know I do quite often. A gz file is a compressed file created with gzip and I didn't knew better, I would copy the file into another folder, uncompress it and then look into the contents. Is there a way to avoid these unnecessary decompression and waste time? Of course there is. In Linux, you can view contents of a compressed .gz file without uncompressing (uncompress on the fly actually or in temp directory) which makes perfect sense for those who deal with large log files and does forensic stuffs. The way it's done is by using Z commands.



Z commands for example: zcat allows you to view contents of a compressed file, zless or zmore allows you to do paging (page by page viewing of a file), zgrep or zegrep allows you to search within a compressed file, zdiff or zcmp allows you to compare two files… Sounds good? I bet it does. Welcome to Z commands that you can use to view, search, compare and page compressed files without wasting time uncompressing.

First of all, lets find some compressed files to see what it actually looks like.

Compressed files:

Open a terminal and browse to /var/log. /var/log is where most of your logs files will go by default unless otherwise specified by an application/system. Perform a list (ls) command to see contents of that directory. As you can see, many .gz files in there.
root@kali:~# cd /var/log
root@kali:/var/log# ls
alternatives.log    debug           kern.log.1      mysql.log.4.gz      syslog.6.gz
alternatives.log.1  debug.1         kern.log.2.gz   mysql.log.5.gz      syslog.7.gz
apache2             debug.2.gz      kern.log.3.gz   mysql.log.6.gz      sysstat
apt                 debug.3.gz      kern.log.4.gz   mysql.log.7.gz      tor
aptitude            dmesg           lastlog         news                unattended-upgrades
aptitude.1.gz       dmesg.0         lpr.log         nginx               user.log
auth.log            dmesg.1.gz      mail.err        ntpstats            user.log.1
auth.log.1          dmesg.2.gz      mail.info       openvas             user.log.2.gz
auth.log.2.gz       dmesg.3.gz      mail.log        pm-powersave.log    user.log.3.gz
auth.log.3.gz       dmesg.4.gz      mail.warn       pm-powersave.log.1  user.log.4.gz
auth.log.4.gz       dpkg.log        messages        postgresql          wtmp
bootstrap.log       dpkg.log.1      messages.1      pycentral.log       wtmp.1
btmp                dradis          messages.2.gz   samba               wvdialconf.log
btmp.1              exim4           messages.3.gz   speech-dispatcher   Xorg.0.log
chkrootkit          faillog         messages.4.gz   stunnel4            Xorg.0.log.old
ConsoleKit          fontconfig.log  mysql           syslog              Xorg.1.log
daemon.log          fsck            mysql.err       syslog.1            Xorg.1.log.old
daemon.log.1        gdm3            mysql.log       syslog.2.gz
daemon.log.2.gz     inetsim         mysql.log.1.gz  syslog.3.gz
daemon.log.3.gz     installer       mysql.log.2.gz  syslog.4.gz
daemon.log.4.gz     kern.log        mysql.log.3.gz  syslog.5.gz
I will use dmesg and dmesg.1.gz files for this exercise.
Now normally if you want to see the contents of dmesg file, you would use cat command and pipe it to either more or less for pagination:
root@kali:/var/log# cat dmesg | more
(output - truncated)
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.14-kali1-amd64 (debian-kernel@lists.debian.org) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Debian 3.14.5-1kali1 (2014-06-07)
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.14-kali1-amd64 root=UUID=9f174fa5-0c59-4024-b307-463b7bc1752d ro initrd=/install/gtk/initrd.gz quiet nouveau.modeset=0
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009f000-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000e4000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000bd77ffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bd780000-0x00000000bd78dfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000bd78e000-0x00000000bd7cffff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000bd7d0000-0x00000000bd7dffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000bd7ed000-0x00000000bdffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed20000-0x00000000fed3ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000ffb00000-0x00000000ffffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000023fffffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] SMBIOS 2.6 present.
[    0.000000] DMI: Acer Veriton S680G      /Veriton S680G, BIOS P01-B0C2       03/25/2011
[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] No AGP bridge found
--More--

root@kali:/var/log# cat dmesg | less

But what happens when you try to view contents of a compressed file such as dmesg.1.gz
root@kali:/var/log# cat dmesg.1.gz | more
j_�S  dmesg.0��$�,�ה8�&e�~9��4j�q��~��F�Y��QH�.U;O� ^L*� �8�K7��k;tI���G��� ��I�ft�q E���5�ճ�hVG�d��P$�����X8��d ȉ�K�ˏ~�fv |\fO �g��w���g     ��3�7�u�2X�K�..3e    � ��:q =�.sI�zM}�CB�vܫ
3q���˚���M��:�G �<�+٤�"`'�Y^ ��`    �'yf�IpLm�y��.\���5U�4�`�����阸vf���xû�uv �� �}�ꀗ�u8��+�1W�
I��1� Ǹ��
         �[4��wO�6w���p�fw���l��9�����I�    ���9 �� �����6�� D��@^Lr�Y�N2��{�ﰄ�� ? :�M�����ʳ
    >'2�h�J�9
--More--


Well, that wasn't helpful, wasn't it? It's in non-human readable format. This is where Z commands comes to rescue.

Use zcat to view compressed files

What you do is pretty much add z infront of your cat command. See example below:
root@kali:/var/log# zcat dmesg.1.gz | more
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.14-kali1-amd64 (debian-kernel@lists.debian.org) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Debian 3.14.5-1kali1 (2014-06-07)
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.14-kali1-amd64 root=UUID=9f174fa5-0c59-4024-b307-463b7bc1752d ro initrd=/install/gtk/initrd.gz quiet nouveau.modeset=0
[    0.000000] e820: BIOS-provided physical RAM map:


That is so easy…

Using zcat to view files instead of cat

By this time, you are already getting the hang of it. But what happens if you want to view a regular (uncompressed file) using zcat?
root@kali:/var/log# zcat dmesg

gzip: dmesg: not in gzip format

Well, that wasn’t very helpful. But there’s a way around that, just use a -f flag which will allow you to view any file compressed or not uzing zcat.
root@kali:/var/log# zcat -f dmesg | more
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.14-kali1-amd64 (debian-kernel@lists.debian.org) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Debian 3.14.5-1kali1 (2014-06-07)
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.14-kali1-amd64 root=UUID=9f174fa5-0c59-4024-b307-463b7bc1752d ro initrd=/install/gtk/initrd.gz quiet nouveau.modeset=0


Read the rest of it here: View compressed .gz files without uncompressing using Z commands in Linux

Thursday, July 31, 2014

Install fonts on Linux - Debian, Ubuntu, Kali, Mint - Microsoft TrueType core and many more

Read full details here: Install fonts on Linux - Debian, Ubuntu, Kali, Mint - Microsoft TrueType core and many more

Installing fonts is important for those who are multilingual or want to spice up their screen. Many websites uses different fonts and without having to install fonts on Linux, you wont see those, you will see a flat boring default font. I will also show how to reconfigure your fontconfig so that it looks better on your CRT or LCD screen.
This posts shows how you can install fonts and configure them on the following Linux Operating systems:
  1. Debian Linux
  2. Ubuntu Linux
  3. Linux Mint
  4. Kali Linux
  5. Any Debian or Ubuntu Variant such as Elementary OS

The basic – Microsoft TrueType core Fonts

This package allows for easy installation of the Microsoft True Type Core Fonts for the Web including:
  Andale Mono
  Arial Black
  Arial (Bold, Italic, Bold Italic)
  Comic Sans MS (Bold)
  Courier New (Bold, Italic, Bold Italic)
  Georgia (Bold, Italic, Bold Italic)
  Impact
  Times New Roman (Bold, Italic, Bold Italic)
  Trebuchet (Bold, Italic, Bold Italic)
  Verdana (Bold, Italic, Bold Italic)
  Webdings
You will need an Internet connection to download these fonts if you don’t already have them.

NOTE: the package ttf-liberation contains free variants of the Times, Arial and Courier fonts. It’s better to use those instead unless you specifically need one of the other fonts from this package.

Install instructions:

First of all let’s check if we even have those fonts in our repositories. I use Kali Linux which is a variant of Debian Linux. If you’re using Kali, you need to add the default official repositories.
Let’s do an apt-cache search:
root@kali:~# apt-cache search ttf-mscorefonts-installer 
ttf-mscorefonts-installer - Installer for Microsoft TrueType core fonts
 
 
Read the rest of it here: Install fonts on Linux - Debian, Ubuntu, Kali, Mint - Microsoft TrueType core and many more

Monday, July 28, 2014

Conky Manager on Debian and Kali Linux

Read full details here: Conky Manager on Debian and Kali Linux

Conky Manager is a graphical front-end for managing Conky config files. It provides options to start/stop, browse and edit Conky themes installed on the system. Packages are currently available in Launchpad for Ubuntu and derivatives (Linux Mint, etc).


Release info

Latest Version: 2.0 (2014-06-17)
Platform: Linux (Debian/Ubuntu)
Language: Vala & GTK3

Features

  • Start/Stop, Browse and Edit Conky themes
  • Run Conky on system startup
  • Options to change location, transparency and size of Conky widget window
  • Options to change time and network interface

Installation

Well of course you must install Conky first. Easy to do:
root@kali:~# apt-get install conky-all

Read the rest of it here: Conky Manager on Debian and Kali Linux