Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Malicious Code Injection
jglw22
post May 20 2008, 04:11 PM
Post #1


Newbie
*

Group: Members
Posts: 5
Joined: 20-May 08
Member No.: 62,415



Hi everyone!
This is my first post, so be kind! Basically, I'm trying to get a free host together so am writing some posts. Here's a little summin' summin' about malicious code injection with PHP applications.

Basically, this security exploit is one of the oldest tricks in the books and all comes down to the fact that PHP allows execution of both local and remote scripts with the SAME function... dur. Anyway, this is how it works. Image you've just employed a young go getter, straight outta uni, who has found becoming a Jack of all trades a sinch. You place him on web site design duty and after flicking through a PHP manual is on his way. Thinking it a good idea to keep separate database connection scripts, headers and whatnot, they may have something along the lines of this...

include($_GET['page'] . ".php");

This line of PHP code, is then used in URLs like the following example:

http://www.STD_sufferers_annonymous.com/in...hp?page=archive

Because the $page variable is not specifically defined, an attacker can insert the location of a malicious file into the URL and execute it on the target server as in this example:

www.STD_sufferers_annonymous.com/in.../delete_all.php[/url]?

This then makes the include function call and execute a remote script from the nosey_bastard domain, which could do all sorts of nasty, even delete the entire content of the website.

You have been warned!

JGLW
Go to the top of the page
 
+Quote Post
galexcd
post May 20 2008, 07:16 PM
Post #2


Define:EVIL PROGRAMMER (ē'vəl prō'grăm'ər)- n. An organism that converts caffeine into evil software.
***********

Group: [HOSTED]
Posts: 1,074
Joined: 25-September 05
From: Los Angeles, California
Member No.: 12,251



Anybody who first of all puts a user modifiable variable into anything that isn't being parsed out, and then puts a pointless delete_all.php page in the same directory deserves to have their website removed. That is just plain stupidity.
Go to the top of the page
 
+Quote Post
rayzoredge
post May 20 2008, 08:30 PM
Post #3


Privileged Member
*********

Group: Members
Posts: 504
Joined: 26-January 06
From: New Durham, NH
Member No.: 17,651



Haha... but that's why programmers get paid to surf through their own code and test, test, and test again for loopholes, vulnerabilities, and code injection attacks like these.

In all reality, I would promote code injection just to be able to learn from the experience. You get to figure out if your exploit works, why it works, introduce yourself to a little bit of PHP and how it works, and if you're a white hat hacker, you might even score some attention, potential, and a job as a network/Internet security specialist. wink.gif

I for one like to try various code injections into the all-infamous wall that is MySpace, since a lot of the things you do is entangled into a nightmare of code all within a ColdFusion file (index.cfm) and the various JavaScript files it calls on. There might be some PHP in MySpace's design now... I'm not that sure now because it's been a while since I've poked around.
Go to the top of the page
 
+Quote Post
Framp
post May 26 2008, 02:10 PM
Post #4


Newbie [Level 2]
**

Group: [HOSTED]
Posts: 39
Joined: 26-May 08
Member No.: 62,700



That's also called RFI, Remote File Inclusion, if the vuln let you load a remote page or LFI, Local File Inclusion, if the vuln let you load a page on the same server.

It was a quite common vulnerability some time ago.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How do you test your php code(80)
  2. Php Clock(7)
  3. Change Permission With Php Code(3)
  4. Adapting Html Code Embed To Work On Phpnuke(7)
  5. Dynamic Image / Signature Generator(12)
  6. Wap Source Code Viewer(4)
  7. You Want It, I Can Make It(49)
  8. Protecting My Code(5)
  9. More Dynamic ?id=browsing With Php (associative Array)(1)
  10. Display The Current Date/time(3)
  11. Use Bb Code On Your Site!(7)
  12. Some Basic Php Code Snippets For All Levels Of Experience(3)
  13. My Code Doesnt Resize Large Images, Please Help.(2)
  14. Php Education Class (first Code)(0)
  15. How To Make A Random 7 Number Code?(2)
  1. Whats Wrong>?(9)
  2. Awesome Source Code Viewer Script(7)
  3. Html Code Tester. Online Script(15)
  4. I Need Some Proof Reading For My Code Please! [resolved](7)
  5. Will This Code Work(5)
  6. Use Rss In Php Code(3)
  7. Php Code(15)
  8. Php Code Needed(5)
  9. Php Code?(12)
  10. Php Code Needed Iii(10)
  11. Php And Mysql Programming(2)
  12. Php Source Code Unveiled In Browser?(7)
  13. Create Table - Mysql Code - Help(1)


 



- Lo-Fi Version Time is now: 11th October 2008 - 11:23 AM