EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff
Hacker's Home Page

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Articles



Return to Category Selection

highlight_file to full system compromise - Submitted By: xor 2011-07-01 17:10:23
The highlight_file function in PHP is very useful, both for open source platforms and for someone seeking a way into a website. The goal of this article is to give a little advice on how to go about executing this attack without giving script kiddies the ability to troll google defacing websites that are vulerable.

0) Disclaimer:
   Please do not be a complete moron with this information, just because you CAN deface a site does not mean you should. All information in this article I found out by myself so if it looks like an article you read somewhere  else,  I apologize, I do not mean to steal credit for anything.

1) Why the pages are vulnerable
   Quite a few pages that use the highlight_file function take the file input from either a GET or a POST variable, either way it is coming from the user and it should be sanitized just like all other data coming from the user. However, that is a lot more work than a lot of webmasters are willing to put into their pages, so they decide to "lock" it to a directory. Many of them do it like this.
Code: [Select]

<?php
$file $_REQUEST['file']; //can be $_GET or $_POST too
$file "code/$file";
highlight_file($file);
?>



2) Exploiting the code
   How would you go about exploiting the above code? Let's say you had a URL that looked like this.
Code: [Select]
http://example.com/vuln.php?file=reader
It would probably then display the output of something like
Code: [Select]
http://example.com/code/readable/reader.php
Which could be
Code: [Select]
<?php echo "Hello world!"?>
Well what you could do is use LFI (Local File Inclusion) to do something like
Code: [Select]
http://example.com/vuln.php?file=../../index.php

3) What you can do with it
   It all depends on how securely the admin thinks in terms of passwords. You may find the database password which may be the same as a shell password or an FTP password or their email password. You can honestly do just about anything, I found the CEO's SSN using this technique because their database password and their cPanel password were the same, like I said, you can do almost anything with it.

4) How to find a page that is vulnerable.
   Yeah, like I'd come out and say that ;)

Anyway, hope you liked this article and maybe even learned something from it.

thanks
xor

Return to Category Selection
If you wish to submit a comment, you must be a registered member and logged in.

Login or Register.



Return to Category Selection

 

Who Visited EnigmaGroup Today?

1396 Guests, 223 Users (217 Spiders)
famous0123, Galagatron, sickmind, cat1vo, mjneat, dark_void, CJ_Omaha, plex, tgm001, Edika, junaid_junaid59, JohnJohnJohn, ssmaslov, psychomarine, Dregoon, Patrickk, Aska, Beat_Slayer, M0rdak, Ausome1, Imre, TheCheeseDemon, rockcraft, Vreality2007, mmndglxuwn, m0rt, unholyblood, iterrumzz, VurbTrurb, Mayonoula, MAMWOURBROR, mutabor, gobinda, cossyDrybrich, Razin, zaCruBumas8, hunja, johny34, pantoufle, bagy, arctica, hackarchives, UsedDeteKef, Peculator, Fadhilat606, TheTrueMonarch, Pascall01, hackaday, Tjm, arndevil, flairvelocity, lol, alphbond, kdivanov, elizbethallis6, Rik, bn11, BorgBot, SHASHANK101hello, 4poc4lyptic, ksajxai, nbmorri1, electro-technic, saraf, شمالي عرعر, lamb, AutobotPrime, Underleaf, The End, tomtombomb, killobyte, snowgirlx, so_saucey, zerolife, Althor, Cramps, Hekser, Hyperborn, cyber-guard, jhgrunn, cobra, Partisan, MAZI_, cyborg, GenbreedX, moel77, cliptoX, pwnpwnlolz, letshavepie, Mrwormz, yshiau, mirmo, roozyoppomo, soft_devil, cls777, scoobywan, Reiversed, joshua, st3alth, Afrika, PaiffDryday, venter, Anthony12796, sh3llcod3, 8FIGURE, Rannim, Evil1, maloaboy, BACanON, SlayingDragons, Repuhlsive, IvanDimitriev, lolzsec, 1RiB, mzungudo, Micro_Geek, iMaxx, aciboummamymn, k0unterkulcher, somebody777, m14m16, GoododotAlcob, negasora, Rastii, UninueMem, Swifsolja, ad.conquest, ngolatkar, Infinity8, Jigoku, thesupervisor, p0is0n5ting, kernel_mod, AKL, GothicLogic, themastersinner, dnatrixene135, ChewBigRed, kalak55, sejem, cve916, pollolololo, triecturn, Violatedsmurf, Ops, jmp, xsiemich, generalisimo, strudels, ga3ttpom, KingOfBritains, epoch_qwert, suten, FriskyKat, Ryuske, Adonis Achilles, ubqbcdzzhf, 3vil, Nightraven, US£RNAM£, Weindittewcon, Batesheelocot, GSmyrlis, MaxMeier, Elite.America, rabbidmind, Psiber_Syn, phoenix22, imittyerrotte, peewster, cyberturtle, ctb, dexgeda, sdw, Pizza, White_widdow, devarian, finesse, Nature112091777, Danc7171, Alphadragon, Estadagause, 53QR10U5, Xargos, Alkomage, hardlock, Barry Gonzoles, MineDweller, Gkjt, N4g4c3N, [I]nfectedbug, wimsteege, aqr5zdcw, xin214, Bugshuppy, SnoopSky, Hessesian, voodooKobra, sKcarr, IROverRated, W1F1G3NJU75U, Baddy, ziadmosaan, gamble86, realzs, CruelDemon, Shinju, aVoid, aquiredanonymity, kukumumu, web_request, callmeneon, KissMyDAFFODIL, Feld Grau, Abhinav2107, prabhataditya, mbuyiselo, shumer, phenom216, princennamdi, huskyboiza, ninety-nine, lucca65
 
Enigma Group