Saturday, December 17, 2011

Choking Up Windows Firewall with C Program

It all started when I had to give a presentation over Operating System Security. I had decided to give some demonstrations too. It was one of them. Though I won’t say that it was some kind of hacking because seriously I do not believe and term registry editing as hacking. Yes. Windows stores all of the settings in the Windows Registry as a database of settings.  So, basically, you just need the right key and obviously a tool to edit/create/modify these settings and BANG, you computer can be in serious trouble. So here is the program.
It is not recommended to use the SYSTEM command defined in DOS.H header file, this function is basically used to run the commands as we generally run in Windows Command Prompt. If you are a fan of Turbo C++, I seriously doubt that you will be able to see this function working. I use CodeBlock IDE to code/execute/test/debug the C programs.
 
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
int main()
{
system("reg add HKLM\\system\\currentcontrolset\\
Services\\SharedAccess\\parameters\\firewallpolicy\\
standardprofile /v EnableFirewall /t reg_dword /d 0 /f");
system("reg add HKLM\\system\\currentcontrolset\\
Services\\SharedAccess\\parameters\\firewallpolicy\\
publicprofile /v EnableFirewall /t reg_dword /d 0 /f");
return 0;
}

If you are using Windows 7, you will require Elevated Execution privileges to run this program correctly, Just compile it, make the EXE file and run it as the administrator and on restart you will see that your favorite Windows Firewall has been choked Up.
Surprisingly, Windows 7 needs a reboot to do this, whereas in Widows XP on my machine, Firewall got choked up as soon as the program ran.
Please do not mind the Formatting of the program. Just copy it and paste it your IDE window, and then try to analyse it.
have a TRY.

Super Hide the files Using Command Prompt

All of us want to hide some files, movies and the stuff we want from others. Many of us make the attributes of the file as hidden and make it invisible through the folder options. But every computer user knows it. I know on using other’s computer almost all of us enable showing hidden files to see what secret content he has, Don’t you ? But there exists a trick with which you can hide your content from others.  Let me give you that……….

Well, If you are a command line lover, then I do not need to tell you about this. If you are not, you are welcome here. There is a command called attrib in the Command Prompt in Windows. Operation of this command is to show the attributes of the file  like read only, system file ,hidden and many more. With this command you can set and change the attributes of the complete folder and the file too.
You need to traverse to the directory where your content is saved, say it is the folder A.
Then,
I will type “attrib A +s +h +a” to make it super hidden.
For, accessing A there are two methods,
1st- reset the attributes of the file/folder by the command  ”attrib A -a -s -h”
2nd – Traverse to the directory where the your file /folder is located, in the explorer address click, if you are using Windows 7 you will see that the address has changed to older WIndows style path, here you only need to extend the address by \A where A is the name of the folder. If it is a file, enter its name with its extension.
I prefer using second as after 1st time, your manually entered address gets into the history and you can use it when you want. You can also create the batch file to automate the 1st step.
Now, comes the explanation, by apping these attributes, you actully change the file/folder into a system folder having special securoty apart form the hidden files.
Remmeber, If someone enables viewing system files, you will be caught….
But, not everyone likes to see the system files to temper with it, specially in Windows.
So, Try IT.