Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

mornlee http://www.neokeen.com/mornlee

« Newer Snippets
Older Snippets »
Showing 11-18 of 18 total

image packing

<img src="data:image/gif;base64,R0lGODdhEAAQAPcBAAAAAP///wAA/93d3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAEAAQAAcIWAADCBwoUIDBgwYFAlg4ECHCAAAGRgzg8CBEggUrCriIUePGiRw9KmSYsSLGhhoXqlQ5oKXLlitXwlzoMibLAQBgzrSpE+fOmDtr2szps+hQokh/ynzpMiAAOw==" width="16" height="16">

collabrank firefox searchengine code

// collabrank firefox searchengine code

# Search plugin for Collaborative Rank [collabrank.org]
# by Soon Van <cog@randomecho.com> - www.randomecho.com
#
# This file is released into the public domain.
#
# Version: 1.0.0 (2005-10-24)
# Country: WW
# Language: en
#
# Note: Appears with several domains pointing to one spot

<search
	version="7.1"
	name="Collaborative Rank"
	description="Collaborative Rank - del.icio.us search engine"
	sourceTextEncoding="0"
	method="GET"
	action="http://collabrank.web.cse.unsw.edu.au/del.icio.us/"
	queryCharset="UTF-8"
	queryEncoding='UTF-8'
	searchForm="http://collabrank.web.cse.unsw.edu.au/del.icio.us/"
>

<input name="query" user>
<input name="cmd" value="search">
<input name="sourceid" value="mozilla-search">


<interpret
	browserResultType="result"
	charset="UTF-8"
	language="en"
#	resultListStart=""
#	resultListEnd=""
#	resultItemStart=""
#	resultItemEnd=""
>

</search>

<browser
	update="http://mycroft.mozdev.org/update.php/id0/collabrank.src"
	updateIcon="http://mycroft.mozdev.org/update.php/id0/collabrank.gif"
	updateCheckDays="7"
>

MSN Messenger Password Decrypter for Windows XP & 2003

// MSN Messenger Password Decrypter for Windows XP & 2003

 /*
 *  MSN Messenger Password Decrypter for Windows XP & 2003
 *  (Compiled-VC++ 7.0, tested on WinXP SP2, MSN Messenger 7.0)
 *      - Gregory R. Panakkal
 *        http://www.crapware.tk/
 *        http://www.infogreg.com/
 */

#include <windows.h>
#include <wincrypt.h>
#include <stdio.h>

#pragma comment(lib, "Crypt32.lib")


//Following definitions taken from wincred.h
//[available only in Oct 2002 MS Platform SDK / LCC-Win32 Includes]

typedef struct _CREDENTIAL_ATTRIBUTEA {
    LPSTR Keyword;
    DWORD Flags;
    DWORD ValueSize;
    LPBYTE Value;
}
CREDENTIAL_ATTRIBUTEA,*PCREDENTIAL_ATTRIBUTEA;

typedef struct _CREDENTIALA {
    DWORD Flags;
    DWORD Type;
    LPSTR TargetName;
    LPSTR Comment;
    FILETIME LastWritten;
    DWORD CredentialBlobSize;
    LPBYTE CredentialBlob;
    DWORD Persist;
    DWORD AttributeCount;
    PCREDENTIAL_ATTRIBUTEA Attributes;
    LPSTR TargetAlias;
    LPSTR UserName;
} CREDENTIALA,*PCREDENTIALA;

typedef CREDENTIALA CREDENTIAL;
typedef PCREDENTIALA PCREDENTIAL;

////////////////////////////////////////////////////////////////////

typedef BOOL (WINAPI *typeCredEnumerateA)(LPCTSTR, DWORD, DWORD *, PCREDENTIALA **);
typedef BOOL (WINAPI *typeCredReadA)(LPCTSTR, DWORD, DWORD, PCREDENTIALA *);
typedef VOID (WINAPI *typeCredFree)(PVOID);

typeCredEnumerateA pfCredEnumerateA;
typeCredReadA pfCredReadA;
typeCredFree pfCredFree;

////////////////////////////////////////////////////////////////////

void showBanner()
{
    printf("MSN Messenger Password Decrypter for Windows XP/2003\n");
    printf("   - Gregory R. Panakkal, http://www.infogreg.com \n\n");
}

////////////////////////////////////////////////////////////////////
int main()
{
    PCREDENTIAL *CredentialCollection = NULL;
    DATA_BLOB blobCrypt, blobPlainText, blobEntropy;

    //used for filling up blobEntropy
    char szEntropyStringSeed[37] = "82BD0E67-9FEA-4748-8672-D5EFE5B779B0"; //credui.dll
    short int EntropyData[37];
    short int tmp;

    HMODULE hDLL;
    DWORD Count, i;

    showBanner();

    //Locate CredEnumerate, CredRead, CredFree from advapi32.dll
    if( hDLL = LoadLibrary("advapi32.dll") )
    {
        pfCredEnumerateA = (typeCredEnumerateA)GetProcAddress(hDLL, "CredEnumerateA");
        pfCredReadA = (typeCredReadA)GetProcAddress(hDLL, "CredReadA");
        pfCredFree = (typeCredFree)GetProcAddress(hDLL, "CredFree");

        if( pfCredEnumerateA == NULL||
            pfCredReadA == NULL ||
            pfCredFree == NULL )
        {
            printf("error!\n");
            return -1;
        }
    }
    

    //Get an array of 'credential', satisfying the filter
    pfCredEnumerateA("Passport.Net\\*", 0, &Count, &CredentialCollection);


    if( Count ) //usually this value is only 1
    {

        //Calculate Entropy Data
        for(i=0; i<37; i++) // strlen(szEntropyStringSeed) = 37
        {
            tmp = (short int)szEntropyStringSeed[i];
            tmp <<= 2;
            EntropyData[i] = tmp;
        }

        for(i=0; i<Count; i++)
        {
            blobEntropy.pbData = (BYTE *)&EntropyData;
            blobEntropy.cbData = 74; //sizeof(EntropyData)

            blobCrypt.pbData = CredentialCollection[i]->CredentialBlob;
            blobCrypt.cbData = CredentialCollection[i]->CredentialBlobSize;

            CryptUnprotectData(&blobCrypt, NULL, &blobEntropy, NULL, NULL, 1, &blobPlainText);
            
            printf("Username : %s\n", CredentialCollection[i]->UserName);
            printf("Password : %ls\n\n", blobPlainText.pbData);
        }
    }

    pfCredFree(CredentialCollection);
}

group select box

// description of your code here

<p>
<label for="">Select</label>
<select name="">
<option selected label="none" value="none">Selected Option</option>

<optgroup label="Group 1">
<option label="label" value="value">Option 1</option>
<option label="label" value="value">Option 2</option>
<option label="label" value="value">Option 3</option>
</optgroup>

<optgroup label="Group 2">
<option label="label" value="value">Option 1</option>
<option label="label" value="value">Option 2</option>
<option label="label" value="value">Option 3</option>
</optgroup>

<optgroup label="Group 3">
<option label="label" value="value">Option 1</option>
<option label="label" value="value">Option 2</option>
<option label="label" value="value">Option 3</option>
</optgroup>
</select>
</p>

unique random array

// 无���机数组

import java.util.Random;
public class Util
{
 private static Random rd = null;
 
  public static int[] random(int[] src)
 {
    if(src == null){
   return null; 
  }
  
  rd = new Random();
   int[] tmp = new int[src.length];
  
  int num = src.length;
  
 
  int index;

  for(int i = 0;i < src.length;i++)
  {
  
   index = Math.abs(rd.nextInt()) % num;
    tmp[i] = src[index];
      src[index] = src[num - 1];
      num--;
  }
  return tmp;
 }
 
 public static void main(String[] args)
 {
  int[] test = {1,2,3,4,5,6,7,8,9};
  int a[] = random(test);
  
  for(int i = 0;i < a.length;i++){
   System.out.println(a[i]); 
  } 
 }

www.example.com => example.com in apache configuration

// www.example.com => example.com

RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

webshell dos html homepage

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>.com</title>
</head>
<style>
html { height:100%; }
body {
height:100%;
border:0px;
margin:0px;
background-color:#000000;
color:#CCCCCC;
font-family:FixedSys, Terminal, system, verdana, arial;
font-size:12px;
/*font-weight:bold;*/
}

a {
text-decoration:none;
color:#CCCCCC;
}

a:hover {
text-decoration:none;
color:#CCCCCC;
}

b {
font-weight:normal;
}

strong {
font-weight:normal;
}

.entryBox {
position:absolute;
bottom:0px;
left:-300px;
}
</style>


<script language="javascript" src="js/js.js"></script>

<body onLoad="setFocusToEntryBox();" onFocus="setFocusToEntryBox();">
<table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%">
<tr>
<td height="100%" width="100%" onClick="setFocusToEntryBox();" valign="top">
<div style="width:750px;">
<div id="outputContainer">Welcome to 20-GOTO-10.com
Type help to begin.

</div>
<div style="position:relative;">
<span id="commandPrompt"></span>&nbsp;<span id="commandContainer"></span><img src="images/cursor.gif" align="absbottom" />
<input type="text" id="entryBox" class="entryBox" onKeyDown="keyCode=(event.which)? event.which: event.keyCode;if(keyCode==55 && event.shiftKey){alert('Sorry the use of \'&\' is not allowed.');return false;}" onKeyUp="handleKeyPress((event.which)? event.which: event.keyCode, this);">
</div>
</div>
</td>
</tr>
</table>
</body>
</html>

<script language="javascript">
document.getElementById('commandPrompt').innerHTML = 'C:\\>';

//Preload the image to avoid the scroll thingy
var oImg = new Image();
oImg.src = '/dos3/images/Me.gif';
</script>

20-GOTO-10 webshell dos javascript

var arrCommandHistory = new Array();
var iCommandHistoryIndex = 0;
var isContactMode = false;
var contactPrompt = '';

function handleKeyPress(keyCode, obj) {
switch(keyCode)
{
case 13:
handleReturn(obj);
break;
case 38:
if(iCommandHistoryIndex > 0) {
iCommandHistoryIndex --;
document.getElementById('commandContainer').innerHTML = arrCommandHistory[iCommandHistoryIndex];
document.getElementById('entryBox').value = arrCommandHistory[iCommandHistoryIndex];
}
break;
case 40:
if(iCommandHistoryIndex < arrCommandHistory.length) {
if(iCommandHistoryIndex < arrCommandHistory.length-1) {
iCommandHistoryIndex ++;
}
document.getElementById('commandContainer').innerHTML = arrCommandHistory[iCommandHistoryIndex];
document.getElementById('entryBox').value = arrCommandHistory[iCommandHistoryIndex];
}
break;
default:
document.getElementById('commandContainer').innerHTML = obj.value.replace(/ /g, '&nbsp;');
}
}

function handleReturn(obj) {
arrCommandHistory[arrCommandHistory.length] = obj.value;
iCommandHistoryIndex = arrCommandHistory.length;
var head=document.getElementsByTagName('head').item(0);
var old=document.getElementById('lastScript');
if(old)head.removeChild(old);
script=document.createElement('script');
script.src='RPC-Executer.aspx?command='+obj.value+'&random='+(Math.round((Math.random()*1000)+1));
script.type='text/javascript'; script.defer=true;
script.id='lastScript';
void(head.appendChild(script));
}

function RPCCallback(sHTML) {
sHTML = sHTML.replace(/&lt;/g, '<');
var obj = document.getElementById('entryBox');
var sOutput = '';
if(!isContactMode) {
sOutput += '<div style="padding-bottom:15px;">C:\\> '+obj.value+'
';
setPromptToNormal();
} else {
sOutput += '<div style="padding-bottom:15px;">'+document.getElementById('commandPrompt').innerHTML+'&nbsp;'+obj.value+'
';
document.getElementById('commandPrompt').innerHTML = contactPrompt+': ';
}
sOutput += sHTML;sOutput += '</div>';
document.getElementById('outputContainer').innerHTML += sOutput;
obj.value = '';
document.getElementById('commandContainer').innerHTML = '';
window.scrollBy(0,10000);
}

function RPCCallbackClearScreen() {
document.getElementById('entryBox').value = '';
document.getElementById('outputContainer').innerHTML = '
';
document.getElementById('commandContainer').innerHTML = '';
window.scrollBy(0,-10000);
}

function setPromptToNormal() {
document.getElementById('commandPrompt').innerHTML = 'C:\\>';
}

function popUp(sURL) {
var oWin = window.open(sURL, '', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1');
if (oWin==null || typeof(oWin)=="undefined") {
alert("It seems that you have a popup blocker enabled. Please disable it and try again.");
}
}

function setFocusToEntryBox() {
var o = document.getElementById('entryBox');
o.focus();
o.value = o.value;
}
« Newer Snippets
Older Snippets »
Showing 11-18 of 18 total