API to facilitate running of SQL queries through client web server rather than them having to share credentials to Elatus Cabal Admin tool.
- Web server with PHP version 5.6 or above configured to run.
- PHP Sqlsrv PDO drivers installed and activated.
- Full API is in the single file and hence easy to move to different location when needed.
- URL key based security system so that only an application with the right key can access it's features.
- SQL query type based permission system.
Hence if you wish to give permission to only view data all queries except
SELECT
can be denied from being executed. - Logging of each and every SQL query execute request into date-wise log files for future reference.
- Download the latest code from here.
- Unzip the archive and copy
api.php
file to your web server root directory or a sub-directory under root directory. - Update the database configuration and key.
Updating the constant
API_KEY
at line number 8 ofapi.php
is very important for the security of your API. - Test by visiting either
http://{server name or IP}/api.php?key={key}
orhttp://{server name or IP}/{sub-folder}/api.php?key={key}
depending uponapi.php
file location. If installation is successful then you should something like{"success":true,"msg":"Running Elatus Cabal API","version":1.1}
in your browser. - Visit Elatus Cabal Admin Configure page and enter API URL i.e.
http://{server name or IP}/api.php
orhttp://{server name or IP}/{sub-folder}/api.php
as well as API key to save your API configuration at Elatus Cabal Admin tool.
- Download and install XAMPP with PHP 7.2.
- Download and install ODBC Drivers.
- Download PHP 7.2 MSSQL Drivers.
and copy
php_pdo_sqlsrv_72_ts.dll
as well asphp_sqlsrv_72_ts.dll
found insidex64
folder of the downloaded zip file toXamppInstallationDrive:\xampp\php\ext
folder. - Open the file
XamppInstallationDrive:\xampp\php\php.ini
and append the following config into it
extension=php_sqlsrv_72_ts.dll
extension=php_pdo_sqlsrv_72_ts.dll
- Restart Apache web server using XAMPP control panel.
- Copy
api.php
toXamppInstallationDrive:\xampp\htdocs
which is the root directory of your web server. - Follow the remaining steps mentioned in the
Running the API
section.
- Install Apache + PHP by referring this guide.
- Install PHP Sqlsrv PDO drivers by running following commands:
sudo su
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo
exit
sudo ACCEPT_EULA=Y yum install msodbcsql
sudo yum install unixODBC-devel
yum groupinstall "Development Tools"
sudo pecl install sqlsrv pdo_sqlsrv
sudo echo "extension= pdo_sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
sudo echo "extension= sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
- Copy
api.php
to/var/www/html
which is the root directory of your web server. - Follow the remaining steps mentioned in the
Running the API
section.
For further help on installation, configuration and running please contact cyberinferno#8771
in Discord!