ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:24.88 GB of 70.42 GB (35.33%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ distr/ Shinobi/ plugins/ openalpr/ - drwxr-xr-x

Directory:
Viewing file:     shinobi-openalpr.js (3.39 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
//
// Shinobi - OpenALPR Plugin
// Copyright (C) 2016-2025 Moe Alam, moeiscool
//
// # Donate
//
// If you like what I am doing here and want me to continue please consider donating :)
// PayPal : paypal@m03.ca
//
// Base Init >>
var fs = require('fs');
var config = require('./conf.json')
var exec = require('child_process').exec;
var openalpr = {
    us: require ("node-openalpr-shinobi"),
    eu: require ("node-openalpr-shinobi"),
};
var s
const {
  workerData
} = require('worker_threads');
if(workerData && workerData.ok === true){
    try{
        s = require('../pluginWorkerBase.js')(__dirname,config)
    }catch(err){
        console.log(err)
        try{
            s = require('./pluginWorkerBase.js')(__dirname,config)
        }catch(err){
            console.log(err)
            return console.log(config.plug,'WORKER : Plugin start has failed. pluginBase.js was not found.')
        }
    }
}else{
    try{
        s = require('../pluginBase.js')(__dirname,config)
    }catch(err){
        console.log(err)
        try{
            s = require('./pluginBase.js')(__dirname,config)
        }catch(err){
            console.log(err)
            return console.log(config.plug,'Plugin start has failed. pluginBase.js was not found.')
        }
    }
}
// Base Init />>
// OpenALPR Init >>
if(config.alprConfig === undefined){
    config.alprConfig = __dirname + '/openalpr.conf'
}
Object.keys(openalpr).forEach(function(region){
    openalpr[region].Start(config.alprConfig, null, null, true, region)
})
var convertResultsToMatrices = function(results){
    var mats = []
    var plates = []
    results.forEach(function(v){
        v.candidates.forEach(function(g,n){
            if(v.candidates[n].matches_template){
                delete(v.candidates[n].matches_template)
            }
        })
        plates.push({
            coordinates: v.coordinates,
            candidates: v.candidates,
            confidence: v.confidence,
            plate: v.plate
        })
        var width = Math.sqrt( Math.pow(v.coordinates[1].x - v.coordinates[0].x, 2) + Math.pow(v.coordinates[1].y - v.coordinates[0].y, 2));
        var height = Math.sqrt( Math.pow(v.coordinates[2].x - v.coordinates[1].x, 2) + Math.pow(v.coordinates[2].y - v.coordinates[1].y, 2))
        mats.push({
            x: v.coordinates[0].x,
            y: v.coordinates[0].y,
            width: width,
            height: height,
            tag: v.plate
        })
    })
    return mats
}
// OpenALPR Init />>
s.detectObject = function(buffer,d,tx,frameLocation,callback){
    try{
        var region = d.mon.detector_lisence_plate_country || 'us'
        openalpr[region].IdentifyLicense(buffer, {}, function (error, output){
            var results = output.results
            if(results.length > 0){
                var matrices = convertResultsToMatrices(results)
                tx({
                    f: 'trigger',
                    id:  d.id,
                    ke: d.ke,
                    details: {
                        plug: config.plug,
                        name: 'licensePlate',
                        reason: 'object',
                        matrices: matrices,
                        imgHeight: d.mon.detector_scale_y,
                        imgWidth: d.mon.detector_scale_x,
                    },
                    frame: buffer
                })
            }
            callback()
        })
    }catch(err){
        console.log(err)
    }
}
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.2105 seconds