Latest News

Showing posts with label XSS. Show all posts
Showing posts with label XSS. Show all posts

Website hacking Methods.......


I gonna teach you some basic of website hacking so first We gonna learn about website defacement


1) What is Website defacement ?




A website defacement is an attack on a website that changes the visual appearance of the site. These are typically the work of system crackers,who break into a web server and replace the hosted website with one of their own.




A high-profile website defacement was carried out on the website of the company SCO Group following its assertion that Linux contained stolen code. The title of the page was changed from "Red Hat vs SCO" to "SCO vsWorld," with various satirical content following




2) Terms to be used ---->




[SQL] - Structured Query Language


[LFI] - Local File Include


[RFI] - Remote File Include


[XSS] - Cross Site Scripting


[RCE] - Remote Code Execution


[AFD] - Arbitrary File Download


[SCD] - Source Code Disclosure


[PCI] - PHP Code Injection




3) Defacement techniques ?




I). DNS hijacking


II).FTP Protocol


III).Apache Vulnerable


IV).Script, Cookie, XSS


V).Social Engineering.


VI).SQL Injection


VII).RFI.


  

Now :-



I) What is Domain Hacking ?




A Domain hacking is a process to transfer domain(yahoo.com) without owner permission with help of phishing, sniffing,spoofing.




A domain hack is an unconventional domain name that combines domain levels, especially the top-level domain (TLD), to spell out the full "name" or title of the domain, making a kind of fun.






------->Domain Hacking process :--->




a) See who.is record of Slave(XXABCXX.net) DNS record and note


down admin email (xxabcxx@gmail/ymail/hotmail/live/[whatever apply this exception if possible admin(name)@XXABCXX.net] )


b) Send spoof mail to Slave admin email for password.


c) after open domain registrar ---->(my.india s.com)




their domain control panel (click forget password)


d) After you get a password in Slave email address of Slave domain.


e) Just login on domain control panel.


f) and get ECCP code and create new account on hosting company


and choose Domain transfer (all submit all details)


g) You will get all rights on this domain for lifetime.



  

II) What is FTP Protocol ?




The File Transfer Protocol (FTP) provides the basic elements of file sharing between hosts. FTP uses TCP to create a virtual connection for control information and then creates a separate TCP connection for data transfers. The control connection uses an image of the TELNET protocol to exchange commands and messages between hosts.


for detail check this Detail about FTP




III) What is XSS ?




XSS is a type of computer security vulnerability typically found in web applications which allow code injection by malicious web users into the web pages viewed by other users.


Cross Site Scripting is a technique used to add script to a trusted site that will be executed


on other users browsers. A key element to XSS is that one user can submit data to a


website that will later be displayed for other users. It is nessesary that the bad guy NOT


mess up the HTML structure, otherwise the result will be web defacement rather then


attacking other users.




IV) What is Social Engineering ?




Social engineering is the act of manipulating people into doing actions or exposing confidential information. It's trickery or deception to gather information, fraud, or computer system access


where in the hacker never comes face-to-face with the Slave. Here are


I don't want to make my thread so big in size so i helped myself by


LINK



V) What is SQL injection ?



SQL injection is a type of security exploit in which the attacker


injects Structured Query Language (SQL) code through a web form input box, to gain access to resources, or make changes to data.


It is a technique of injecting SQL commands to exploit non-validated input vulnerabilities in a web application database.




-------------->Preventing SQL Injection


To protect against SQL injection, user input must not directly be embedded in SQL statements. Instead, parameterized statements must be used (preferred), or user input must be carefully escaped or filtered.



VI) What is RFI ?

  

Remote File Inclusion attacks allow malicious users to run their own PHPcode on a vulnerable website. The attacker is allowed to include his own (malicious) code in the space provided for PHP programs on a web page. 

Introducing Evil In Your Website With Untrusted Third Party Scripts


This is a small case study, where my aim is to explain why you shouldn't use untrusted third party scripts on your website. Htmlcommentbox is a third part script that could be embedded into any webpage would bring a place where users can comment and interact with each, I feel it is poorly coded from both user's perspective and security perspective as it could introduce lots of spam in your website.

Let's talk about what else could it do else than introducing spam from security perspective. We [Me and Pepe Vila] have found two attack vectors with the HtmlCommentBox as Does not sanitise the user input's properly resulting in a stored xss and also a reflected xss, which obviously leaves wide variety of attack vectors from the attacker's perspective.

Stored XSS POC

The POC is very simple, Seems like that you can inject any thing as long as you don't close the tag:

Example:

<img src=x onerror=prompt(0);
<iframe/onload=prompt(0);
<svg/onload=prompt(0);

Let's see a demonstration of this on their live website where they themselves have hosted their htmlcommentbox making their website vulnerable to the stored XSS too.




The following page is where, users can request for additional features, as you can clearly see from the picture that it is using the htmlcommentbox. All, i did was to inject the following payload into the messagebox:

<img src=x onerror=prompt(0);


Second Issue - Reflected XSS

Well, this is not it, We have more for you, Implementing HTMLCommentBox also makes your website vulnerable to a non persistent xss.

Let's take a closer look at their script that users would implement on their page:

(function(){var s=document.createElement("script"),l=(""+window.location || hcb_user.PAGE),h="//www.htmlcommentbox.com";s.setAttribute("type","text/javascript");s.setAttribute("src",h+"/jread?page="+encodeURIComponent(l).replace("+","%2B")+"&opts=16862&num=10");if(typeof s!="undefined")document.getElementsByTagName("head")[0].appendChild(s);})()
If you closely look at the window.location portion, you would find that encodeURIComponent allows single quotes. If we just replace window.location with our alert statement, it would triggered under the script context, Hence making the website vulnerable to a xss. And the /jread?page='-prompt(1)-'&opt=x&num=y, this would be reflected under the page context.
So the POC would be as follows:

http://www.htmlcommentbox.com/?'-prompt(1)-'



Again, I am very thankful to @pepevila for pointing the second issue. 

The lesson to be learned is business that rely on or use third part scripts on their website, Should use well known scripts and make sure that they are not vulnerable to any attacks or atleast research if their haven't been any issues with them in past, because often times these third party scripts are responsible for the security breaches.

Take an example from this case study, Where using a third party script to host comments introduced High risk security vulnerabilities. Any one using this script on their websites are requested to immediately remove it.

DOM Based XSS In AVG


Lately, i have been researching on DOM based XSS a bit, Recently i found a DOM based XSS in AVG, DOM based XSS is caused due to lack of input filtering inside client side javascripts, since most of the code is moving towards client side, therefore DOM based xss have been very common now a days, It is predicted by the experts that the DOM based xss mostly occurs in the websites that heavily rely upon javascripts.

With that being said, let's take a look at the DOM based XSS POC:




The vulnerability is the result of lack of escaping done in "js_stdfull.js". The following is the screen shot of the vulnerable code causing the DOM based XSS:


Vulnerable code:

 //display the correct tab based on the url (#name) var pathname = $(location).attr('href');var urlparts = pathname.split("#");

I would like to give full credits to David Vieira-Kurz from Majorsecurity.com (@secalert), for helping me sort out the vulnerable code.

Yet another security researcher, David Sopas also found the same issue but on the English version of the site:

http://labs.davidsopas.com/2013/01/avg-vulnerable-to-dom-xss.html

ifixit.com Stored XSS Vulnerability


Well, it has been a long time, since i haven't posted any thing, i was a bit busy with my university exams, However, finally i managed to get some time to write something, Today i am sharing some of the vulnerabilites i found inside a popular website named "ifixit".

I found two XSS one was a Stored XSS and a second one was a Self XSS, However the Self-XSS could have been easily exploited by Clickjacking techniques as the page did not contain X-Frame options, Therefore the Self-XSS was also considered.
I have created a short POC of the Stored Cross Site Scripting vulnerability (XSS), I hope you enjoy it:

iFixit Stored Cross Site Scritping [Video POC]:

iFixit Self-XSS POC


For the above vulnerabilities, i was listed inside ifixit.com's responsible disclosure page:


Along with it, they also sent me two T-Shirts, some stickers and a 54 bit driver toolkit:

Contact Us

24x7 online , we happy to answer you
tamilcypc@gmail.com

Disclaimer

This Blog and its TUT's are intended for educational purposes only, no-one involved in the creation of this TuT may be held responsible for any illegal acts brought about by this Blog or TuT.



Featured Post

Custom Domains And HTTPS Redirection Code