exploit the possibilities

phpTrafficA 2.3 SQL Injection

phpTrafficA 2.3 SQL Injection
Posted Dec 9, 2014
Authored by Daniel Geerts

phpTrafficA versions 2.3 and below suffer from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
advisories | CVE-2014-8340
SHA-256 | 35cf42f536241e5b5165723fb326796ec0832be49a1a2e5d66ecf66411871ea8

phpTrafficA 2.3 SQL Injection

Change Mirror Download

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Product: phpTrafficA
Product page: http://soft.zoneo.net/phpTrafficA/
Affected versions: Up to and including 2.3 (latest as of writing).

Description:
An SQL injection exists in Php/Functions/log_function.php, line 933:
$sql3 ="INSERT INTO `${table}_host` SET date='$date', host='',
hostname='', page='$page', ref='$cleanref', agent='$agent',
longIP='$iplong'";

The $agent variable comes directly from $_SERVER['HTTP_USER_AGENT'],
without any escaping. This makes SQL injection possible. Even if
multiple statements in one query has been turned off, the contents of
the database can still be read by manipulating the last parameter of the
query (the IPv4-address stored as an integer). For example, the
following spoofed user agent will store the ASCII-value of the second
character of the admin hash as its IP:
Firefox', longIP=(SELECT ASCII(SUBSTRING(value,2,1)) FROM
phpTrafficA_conf WHERE variable='adminpassword') #
This will be displayed in the "Latest visitors > Details" section, and
by repeating this procedure multiple times, the entire admin hash (or
any other database content) can be retrieved.

Partial mitigations:
- - Turn off "multiple statements in one query".
- - Hide "Latest visitors > Details" section from view. This prevents
the attacker from obtaining the output of the manipulated query.
- - Apply this quick fix to line 933:
$sql3 ="INSERT INTO `${table}_host` SET date='$date', host='',
hostname='', page='$page', ref='$cleanref',
agent='".mysql_real_escape_string($agent)."', longIP='$iplong'";

The code-fix does not resolve the SQL injection for all server
configurations, but should be sufficient for most. A proper fix would be
a version of phpTrafficA that uses PDO with prepared statements.


Best regards,
Daniel Geerts
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iQIcBAEBAgAGBQJUhwA8AAoJEHn1bVIKHk5NxhYQAMiEbr06K7UQxXEZv0+3KTr6
LTA+65vVdmu0mTPQrTEjNeW46bv5tpnOuZc0q8Nprwbko2V/ANVXnD2NC4nBdYE8
J+7XonQq7CnsM//C504D2Vms3ylQhkthycCBc1OXaaEEIF2lmFrLPFsLLNkjaEAr
A5hDZJE7tSjDoq4/a3Psl1DLC+oblYbAA/JJxcSx5Abdnt47i9HMs9xWxN5Jn9oj
OwXoF31YrMxbMoqrENQqnc5lVvfxM+ki/t5sCZV4jk1kRX7Ivf7sEMbhiN0sKqnM
UeNwVSgi5308rAYdyg5zpUurvwIlKYtU9kA4N1sIVJCIGzeZXYCIOVAJZNglZ/NB
bX9EoLoxeU1R7RS2SWHLEneriiyj0nCyS1X+HSkov9p1gYemxqivgmBKsV3A4LxG
Crz7kHpcpYSn15u7vploGOki/G0sqpMVL9UwkK/F5vxRkMWxBjqvCzXudDXBvYVJ
gnSJGw0QB6roJqHx3yf3x91YE8m69axiFTE8dAUz1IfTsbEgc2oUfnO+crWPyWh7
IHx8gIfN/3Uck/6gLPse63rtKB+jI7/i4xJbm0FIbOnodzkJP1GDy9U3UsEbleSW
kKV884YFogi1iyfuOhrqCGWatQybpHlM/VyycH3NvzpsDFwVCYrnaQ/jpfKS1rlz
dWvSYp6b43Nui30hm+kv
=PZkK
-----END PGP SIGNATURE-----
Login or Register to add favorites

File Archive:

May 2022

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    0 Files
  • 2
    May 2nd
    15 Files
  • 3
    May 3rd
    19 Files
  • 4
    May 4th
    24 Files
  • 5
    May 5th
    15 Files
  • 6
    May 6th
    14 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    13 Files
  • 10
    May 10th
    7 Files
  • 11
    May 11th
    99 Files
  • 12
    May 12th
    45 Files
  • 13
    May 13th
    7 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    26 Files
  • 18
    May 18th
    4 Files
  • 19
    May 19th
    17 Files
  • 20
    May 20th
    2 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close