Techniques for Hiding JavaScript in Web Source

JavaScript is a customer side programming dialect, along these lines it chips away at the customer's machine, so you can't really conceal anything from the customer.

Jumbling your code is a decent arrangement, yet it's insufficient, on the grounds that, in spite of the fact that it is hard, somebody could unravel your code and "take" your script.


1. Hiding Via Programming Language Like PHP

This is the only working way to completely hide your JavaScript code from the client just like PHP or ASP code.
Here we'll need the help of PHP. Here is the code:
index.php


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
<title>Hide Javascript Code</title>
<!--Here we call our Javascript page the first time it'll provide us with our javascript code -->
<script language="javascript" src="./javascript.php"></script>
<!--
We call the same page again AND THIS IS SECOND PART OF THE TRICK.
because after we called it the first time it will set the session value to FALSE which mean it will print NOTHING
-->
<script language="javascript" src="./javascript.php"></script>
</head>
    Try to save this page or go straight from your browser to the (javascript.php) page<br>
    and see if you can get my javascript code.<br>
    YOU'LL NEVER CAN.
<body>
</body>
</html>
 /javascript.php


<?php
/*
     ___________________________________________________________
    |                                                                                                        |
    |    Script name: Hide Javascript Code.                                                        |
    |    Script date: 16/12/2007                                                                    |
    |    Script author: Mahr Bakr                                                                        |
    |                        admin@SOLAV.com                                                        |
    |    Script goal: Hiding the javascript code from the client like PHP & ASP        |
    |    Script license: Free for personal and commercial.                                    |
    |    *******************************************************    |
    |    Keep this note or at least point to me as the author of the script            |
    |    *******************************************************    |
    /___________________________________________________________\

*/
    @session_start(); //Start our session.
    header("Cache-Control: no-store, no-cache"); //Tell the browser to not cache this page (don't store it in the internet temp folder).
    header("Content-type: text/javascript"); //Let the browser think that this is a Javascript page.
    //If the session value is TRUE that means the client has opened the main page (which creates our session and sets its value to TRUE).
    if ($_SESSION["PrintTheJavaScript"] == true){
        //Now we can print our javascript code using PHP's echo command.
        echo '
        // Here is our hidden javascript source.
        var Something="This is a real hidden Javascript code";
        alert(Something);
        // End of our hidden javascript source.
        ';
    }else{
        //If the client tried to open the page straight from the browser (he is trying to see our hidden code).
        // Print some fake code or don't print anything.
    }
    //Set the session value to false AND THIS IS FIRST PART OF THE TRICK.
    //because we are going to call this page again and it'll print nothing (because $_SESSION["PrintTheJavaScript"] <> TRUE)
    //so even if the client tried to SAVE the page this page will be saved empty.
    $_SESSION["PrintTheJavaScript"] = false;
?>
 2.   Use Html Encrypter The part of the Head which has 
 <link rel="stylesheet" href="styles/css.css" type="text/css" media="screen" /> <script type="text/javascript" src="script/js.js" language="javascript"></script>  copy and paste it to HTML Encrypter and the Result will goes like this and paste it the location where you cut the above sample  <Script Language='Javascript'> <!-- HTML Encryption provided by iWEBTOOL.com --> <!-- document.write(unescape('%3C%6C%69%6E%6B%20%72%65%6C%3D%22%73%74%79%6C%65%73%68%65%65%74%22%20%68%72%65%66%3D%22%73%74%79%6C%65%73%2F%63%73%73%2E%63%73%73%22%20%74%79%70%65%3D%22%74%65%78%74%2F%63%73%73%22%20%6D%65%64%69%61%3D%22%73%63%72%65%65%6E%22%20%2F%3E%0A%3C%73%63%72%69%70%74%20%74%79%70%65%3D%22%74%65%78%74%2F%6A%61%76%61%73%63%72%69%70%74%22%20%73%72%63%3D%22%73%63%72%69%70%74%2F%6A%73%2E%6A%73%22%20%6C%61%6E%67%75%61%67%65%3D%22%6A%61%76%61%73%63%72%69%70%74%22%3E%3C%2F%73%63%72%69%70%74%3E%0A')); //-->

HTML ENCRYPTER Note: on the off chance that you have a java script in your page attempt to fare to .js document and make it like as the case above.

And Furthermore this Encrypter is not continually working in some code that will make ur site fouled up... Select the best part you need to shroud like for instance in <form> </form>

This can be turn around by propel client yet not all noob like me knows it.

3. This is the code of invisible.html

<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="invisible_debut.js" ></script>
<body>
</body>
$(document).ready(function () {
var ga = document.createElement("script"); //ga is to remember Google Analytics ;-)
ga.type = 'text/javascript';
ga.src = 'invisible.js';
ga.id = 'invisible';
document.body.appendChild(ga);
$('#invisible').remove();});

$(document).ready(function(){
    alert('try to find in the source the js script which did this alert!');
    document.write('It disappeared, my dear!');});

invisible.js doesn't show up in the reassure, in light of the fact that it has been evacuated and never in the source code on the grounds that made by JavaScript.

Concerning invisible_debut.js, I jumbled it, which implies that it is exceptionally confounded to discover the url of invisible.js. Not immaculate, but rather enough hard for an ordinary programmer.

C# : Call Class Method Using Name From String


Hello, Today i am going to share a code snippet for how to call a method using string name. Its very simple technique you can easily achieve it using following code Snippet.

Please note hat i have considered the return type of calling function to be string
public string calldynamicMethods(string mehtod, string Parameters)
        {
            try
            {
                Type thisType = this.GetType();
                MethodInfo theMethod = thisType.GetMethod(mehtod);
                object[] a = { (object)Parameters };
                string re = theMethod.Invoke(this, a).ToString();
                return re;
            }
            catch
            {
                return "Internal Server Error";
            }
        }

Thanks and Visit agian.

#Jassie



Environmental Science eBook for Universities and Colleges India



The importance of environmental science and environmental studies cannot be disputed. The need for sustainable development is a key to the future of mankind. Continuing problems of pollution, loss of forget, solid waste disposal, degradation of environment, issues like economic productivity and national security, Global warming, the depletion of ozone layer and loss of biodiversity have made everyone aware of environmental issues.



How to Modify (Delete or Edit) and Send Cookies To Website With Proxy

Today i am going to share with you a great software that can be easily used to interpret website requests modify and forward it again. Burp Suite is the leading software for web security testing Thousands of organizations use Burp Suite to find security exposures before it’s too late.















Burp Suite Coverage of over 100 generic vulnerabilities,like SQL injection and cross website scripting (XSS), with great performance against all vulnerabilities in the OWASP/

The Proxy tool lies at the heart of Burp's user-driven workflow, and gives you a direct view into how your target application works "under the hood". It operates as a web proxy server, and sits as a man-in-the-middle between your browser and destination web servers. This lets you intercept, inspect and modify the raw traffic passing in both directions.
If the application employs HTTPS, Burp breaks the SSL connection between your browser and the server, so that even encrypted data can be viewed and modified within the Proxy.

Read more Features here.

You can follow Setups for proxy here
Read here

For firefox Configuring of website you ca read here
read here


[New Link] Download All Chapters The 8088 and 8086 Microprocessors 4th Ed. by Walter A. Triebel and Avtar Singh

Hello friends, today i would like to share Best Notes of all chapters from the only book  The 8088 and 8086 Microprocessors - Programming, Interfacing, Software, Hardware, and Applications" 4th Ed. by Walter A. Triebel and Avtar Singh.

Thanks to the Original author Prof. Ta-te Lin http://www.bime.ntu.edu.tw/~ttlin/ for sharing such wonderful Notes helping us in our course.

[The materials of these lecture notes are based on the textbook entitled "The 8088 and 8086 Microprocessors - Programming, Interfacing, Software, Hardware, and Applications" 4th Ed. by Walter A. Triebel and Avtar Singh, published by Prentice Hall, Inc.
Here is All Chanters form]

-----------------------------------------
NEW LINKS UPDATED

Chapter 2  Software Architecture of the 8088 and 8086 Microprocessors
Chapter 8 The 8088 and 8086 Microprocessors and Their Memory and Input/output Interfaces
Chapter 9 Memory Devices, Circuits, and Subsystem Design

I working to find out other chapters as well
_______________________________________________


































































































Removing HTML tags from string C# ASP


Here is the simple C# program that is used to remove HTML tags from a string, with very simple while and if else statement.
Here is code (C# function):
public static string RemoveHtmlTags(string content){
            char[] array = new char[content.Length];
            int arrayIndex = 0;
            bool inside = false;

            for (int i = 0; i < content.Length; i++)
            {
                char let = content[i];
                if (let == '<')
                {
                    inside = true;
                    continue;
                }
                if (let == '>')
                {
                    inside = false;
                    continue;
                }
                if (!inside)
                {
                    array[arrayIndex] = let;
                    arrayIndex++;
                }
            }
            return new string(array, 0, arrayIndex);
}
thanks g.
:)

C# Dynamic Streaming Video via Handler (.ashx) with Range Downloader ASP MVC

This tutorial is to show that how video playing is possible via a dynamic URL and hiding obsolete base URL. We have added to basic programs in it one is ProcessRequest() used to get file and process data o the file via streamer, second is RangeDownload(), which is required to download video http-range.

here is the full source class in .ashx file i used.

with following mysite.com/watch.ashx?id=1039 returns a video file.


public class Video : IHttpHandler {

    public void RangeDownload(int id, HttpContext context)
    {

        //connecton to database
        VideosDB db = new VideosDB();
        //Entity
        var get = db.MyvideosDB.FirstOrDefault(p => p.Video == id);
        //path to video ile
        string fullpath = context.Server.MapPath("~/cdn_users/" + get.Postedby + "/" + get.VideoURL);
        long size, start, end, length, fp = 0;
        using (StreamReader reader = new StreamReader(fullpath))
        {

            size = reader.BaseStream.Length;
            start = 0;
            end = size - 1;
            length = size;

            context.Response.AddHeader("Accept-Ranges", "0-" + size);

            if (!String.IsNullOrEmpty(context.Request.ServerVariables["HTTP_RANGE"]))
            {
                long anotherStart = start;
                long anotherEnd = end;
                string[] arr_split = context.Request.ServerVariables["HTTP_RANGE"].Split(new char[] { Convert.ToChar("=") });
                string range = arr_split[1];

                if (range.IndexOf(",") > -1)
                {
                    context.Response.AddHeader("Content-Range", "bytes " + start + "-" + end + "/" + size);
                    throw new HttpException(416, "Requested Range Not Satisfiable");

                }

                if (range.StartsWith("-"))
                {
                    anotherStart = size - Convert.ToInt64(range.Substring(1));
                }
                else
                {
                    arr_split = range.Split(new char[] { Convert.ToChar("-") });
                    anotherStart = Convert.ToInt64(arr_split[0]);
                    long temp = 0;
                    anotherEnd = (arr_split.Length > 1 && Int64.TryParse(arr_split[1].ToString(), out temp)) ? Convert.ToInt64(arr_split[1]) : size;
                }
                anotherEnd = (anotherEnd > end) ? end : anotherEnd;
                if (anotherStart > anotherEnd || anotherStart > size - 1 || anotherEnd >= size)
                {

                    context.Response.AddHeader("Content-Range", "bytes " + start + "-" + end + "/" + size);
                    throw new HttpException(416, "Requested Range Not Satisfiable");
                }
                start = anotherStart;
                end = anotherEnd;

                length = end - start + 1;
                fp = reader.BaseStream.Seek(start, SeekOrigin.Begin);
                context.Response.StatusCode = 206;
            }
        }
        context.Response.AddHeader("Content-Range", "bytes " + start + "-" + end + "/" + size);
        context.Response.AddHeader("Content-Length", length.ToString());
        context.Response.WriteFile(fullpath, fp, length);
        context.Response.End();

    }

    public void ProcessRequest(HttpContext context)
    {
        string id = context.Request["id"];
        int newid;
        int.TryParse(id, out newid);

       
        VideosDB db = new VideosDB();

        var get = db.MyvideosDB.FirstOrDefault(p => p.Video == newid);

        string mimetype = "video/mp4";
        string fullpath=context.Server.MapPath("/cdn_users/"+get.Postedby+"/"+get.VideoURL);       
        if (System.IO.File.Exists(fullpath))
        {
           
            context.Response.ContentType = mimetype;
            if (!String.IsNullOrEmpty(context.Request.ServerVariables["HTTP_RANGE"]))
            {
                RangeDownload(newid, context);
            }
            else
            {
                long fileLength = File.OpenRead(fullpath).Length;
                context.Response.AddHeader("Content-Length", fileLength.ToString());
                context.Response.WriteFile(fullpath);            
            }
        }
        else
        {
            throw new HttpException(404, "Video Not Found Path:"+fullpath);
        }
    }
   
    public bool IsReusable {
        get {
            return false;
        }
    }

}

Thanks g . Keep Visiting.

Program to implement Linked List using Struct in C/C++

Today i am going to show you how to implement linked list  type data array using structure. Linked ist is type of data structure in which dynamic memory allocation takes place, in short it is a type of flexible data array

Lets see:

#include "stdafx.h"
#include <iostream>
using namespace std;

struct Node
{
    int info;
    Node *next;

}*HEAD, *TPTR, *NEWN;

void case1(){
    int getinfo;
    cin >> getinfo;
    NEWN = new Node;
    NEWN->info = getinfo;
    NEWN->next = NULL;
    if (HEAD == NULL){
        HEAD = NEWN;
        cout << "Node added";
    }
    else
    {
        TPTR->next = NEWN;
    }

}
void case2(){
    int getinfo, found = 0;
    cout << "Elemnt to serach" << endl;
    cin >> getinfo;
    if (HEAD != NULL){

        TPTR = HEAD;
        while (TPTR->next != NULL)
        {
            if (TPTR->info == getinfo){
                cout << "Elemnt found" << endl;
                found = 1;
            }
            TPTR = TPTR->next;
        }
        if (TPTR->info == getinfo){
            cout << "Elemnt found" << endl;
        }
        else if (found == 0){
            cout << "not found" << endl;
        }
    }

    else {
        cout << "linked List empty" << endl;
    }
}
void case3(){
    if (HEAD != NULL){
        TPTR = HEAD;
        while (TPTR->next != NULL)
        {
            cout << " ELemnt is " << TPTR->info <<endl;
            TPTR = TPTR->next;
        }
        cout << " ELemnt is " << TPTR->info<<endl;
    }
    else
    {
        cout << "Empty" << endl;
    }
}


void main(){
    int opt = 0, getinfo, found = 0;
    while (opt != 4)
    {
        if (HEAD != NULL){
            TPTR = HEAD;

            while (TPTR->next != NULL)
            {
                TPTR = TPTR->next;//tptr points to last
            }
        }
        cout << "Choose an option " << endl << "1. Insert element" << endl << "2. Find Element" <<endl<<"3. List all"<< endl<<"4. Exit";
        cin >> getinfo;
        opt = getinfo;
        switch(opt){
        case 1:
            case1();
            break;
        case 2:
            case2();
            break;
        case 3:
            case3();
            break;
        case 4:
            opt = 4;
            break;
        default:
            cout << "error";
            break;
        }
        opt = 0;
    }

}