File Manager
Upload
Current Directory: /home/lartcid/public_html/journal.lartc.id
[Back]
..
[Open]
Hapus
Rename
.htaccess
[Edit]
Hapus
Rename
.well-known
[Open]
Hapus
Rename
README.md
[Edit]
Hapus
Rename
api
[Open]
Hapus
Rename
cache
[Open]
Hapus
Rename
cgi-bin
[Open]
Hapus
Rename
classes
[Open]
Hapus
Rename
config.TEMPLATE.inc.php
[Edit]
Hapus
Rename
config.inc.php
[Edit]
Hapus
Rename
controllers
[Open]
Hapus
Rename
cypress.json
[Edit]
Hapus
Rename
dbscripts
[Open]
Hapus
Rename
docs
[Open]
Hapus
Rename
error_log
[Edit]
Hapus
Rename
favicon.ico
[Edit]
Hapus
Rename
index.php
[Edit]
Hapus
Rename
js
[Open]
Hapus
Rename
lib
[Open]
Hapus
Rename
locale
[Open]
Hapus
Rename
mini.php
[Edit]
Hapus
Rename
pages
[Open]
Hapus
Rename
php.ini
[Edit]
Hapus
Rename
plugins
[Open]
Hapus
Rename
public
[Open]
Hapus
Rename
registry
[Open]
Hapus
Rename
scheduledTaskLogs
[Open]
Hapus
Rename
schemas
[Open]
Hapus
Rename
styles
[Open]
Hapus
Rename
templates
[Open]
Hapus
Rename
tools
[Open]
Hapus
Rename
Edit File
function file_exists(name) local f=io.open(name,"r") if f~=nil then io.close(f) return true else return false end end function check_scan_enabled() local f = io.open("/etc/sysconfig/imunify360/imunify360-merged.config","rb") -- new config path if f == nil then -- fallback to the old config path f = io.open("/etc/sysconfig/imunify360/imunify360.config","rb") if f == nil then -- no config found, exit as before this change return false end end if f ~= nil then local content = f:read("*all") io.close(f) if string.match(content, 'enable_scan_modsec:%strue') then return true end else return false end return false end function main(filename) local scan_script -- Check if modsec scan enabled in config file if not check_scan_enabled() then return nil end -- Check if scan script exist, if not - do nothing if file_exists("/usr/share/imunify360/scripts/modsec_scan_real.py") then scan_script = "/usr/share/imunify360/scripts/modsec_scan_real.py" elseif file_exists("/opt/alt/python35/share/imunify360/scripts/modsec_scan_real.py") then scan_script = "/opt/alt/python35/share/imunify360/scripts/modsec_scan_real.py" else return nil end -- Execute scan script and get a output as a result local handle = io.popen(scan_script .. " " .. filename) local scan_result = handle:read("*a") handle:close() -- Check if scan script return something useful -- 1 OK - means OK, no malware found -- 0 Attempt to upload malware - means harmful file -- empty string or any other output means error or execution failure, and do nothing if string.match(scan_result, '0 Attempt to upload malware') then return 1 elseif string.match(scan_result, '1 OK') then return nil end return nil end
Simpan