JavaScript For Hackers
JavaScript For Hackers
JOAS ANTONIO
Details
This pdf is based on content from PenTest Academy and other professionals,
credits will be placed on the respective pages.
LinkedIn: https://www.linkedin.com/in/joas-antonio-dos-santos
Courses JavaScript for PenTest
https://www.pentesteracademy.com/course?id=11
https://www.youtube.com/watch?v=FTeE3OrTNoA
https://www.youtube.com/watch?v=HptfL5WRYF8
https://www.youtube.com/watch?v=-UPRQBQV5Lo
https://www.youtube.com/watch?v=mG0Sm0GQ6ck&list=PL9w1Wxb9TxnO4_0
j5NJ7zYG0WBpM8UDLs
https://www.udemy.com/course/ethical-hacking-with-python-javascript-and-kali-
linux/
XSS for PenTest – Boku7
Github: https://github.com/boku7
The codes shown in the next slides were created by boku7
XHR-formHarvester.js
https://github.com/boku7/XSS-Clientside-Attacks/blob/master/XHR-formHarvester.js
XSS-XHR-CSRF-
UploadFile-
PHPwebshell.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/XS
S-XHR-CSRF-
UploadFile-
PHPwebshell.js
XSS-XHR-
WebShellUpload.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/XS
S-XHR-
WebShellUpload.js
XSS-XHR.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/XS
S-XHR.js
alert-cookie.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/aler
t-cookie.js
autoComplete-
Harvester.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/aut
oComplete-Harvester.js
bannerMod-
deface.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/ban
nerMod-deface.js
bannerMod-
deface.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/ban
nerMod-deface.js
changeAllLinks.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/cha
ngeAllLinks.js
clickJacker.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/clic
kJacker.js
cookieHarvester
.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/clic
kJacker.js
eventListener-
alert.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/eve
ntListener-alert.js
formHijack-
credHarverter.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/for
mHijack-credHarverter.js
js2remoteScript
Source.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/js2r
emoteScriptSource.js
keylogger-
keyHarvester.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/key
logger-keyHarvester.js
remote-
alertCookie.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/re
mote-alertCookie.js
remote-
onSubmit-
FormJack-XHR.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/re
mote-onSubmit-
FormJack-XHR.js
remoteScriptS
ource.js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/re
moteScriptSource.js
replaceImage.
js
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/rep
laceImage.js
Urlencoder.py
https://github.com/boku
7/XSS-Clientside-
Attacks/blob/master/url
encoder.py
JavaScript Collection
https://github.com/bupt007/pentester-for-javascript-
https://github.com/pownjs/pown
https://github.com/gabemarshall/Brosec
https://github.com/roccomuso/netcat
https://github.com/Shmakov/Honeypot
https://github.com/silverwind/default-gateway
https://github.com/cybersecurity-acmgmrit/Javascript-Pentesting
https://github.com/HynekPetrak/javascript-malware-collection
https://github.com/geeksonsecurity/js-malicious-dataset
https://github.com/CapacitorSet/box-js
https://github.com/koto/owasp-malicious-javascript
JavaScript Doom XSS
Source: An input that could be controlled by an external (untrusted) source.
JavaScript
Doom XSS
Sink: A potentially
dangerous method that
could lead to a
vulnerability. In this case
a DOM Based XSS.
Awesome
Payloads
Awesome
Payloads
Some less detected event handlers
Awesome
Payloads
Some HTML Tags that you will be using
https://github.com/s0md3v/AwesomeXSS
Awesome
Payloads
Some HTML Tags that you will be using
https://github.com/s0md3v/AwesomeXSS
JSHacking – Ankur8931
Github: https://github.com/ankur8931
The codes shown in the next slides were created by Ankur8931
JSHacking – Ankur8931
1.form-submit.js - Hijacking form submit 11.xmlhttpreq-fetch.js - Fetch email from provided URL using XML http
request
2.social-engg.js - Social Engineering exploit to hijack form submit and redirect
to different page 12.data-exfil.js - Exfiltration of Credit card information to the attacker server
3.mouse-click.js - Capturing mouse click events and redirecting to different 13.csrf-token.js - Extract CSRF token and submit to web
page
14.csrf-token-uid.js - Extract the email using UID, and CSRF token. Display the
4.keylogger.js - loggin keystrokes to SimpleHTTPServer running on port 9000 email address on the page.
5.event-listener.js - Listen to form submit event and show password in the 15.html-parsing.js - Parse HTML response by exploiting xss and insert addess
pop up alert box into div result
6.external.js - running external js from script source to bypass any code 16.multi-level-html.js - Extract credit card number via multi-level HTML
limitation checks documents and post to the server
7.external-noscript.js - include external javascript without using script tags 17.multi-json.js - Multi level JSON parsing and displaying information in the
div element result
8.replace-img.js - replace old image by new image in JS
18.multi-xml.js - Multi level XML parsing and displaying information in div
9.autocomplete-timer.js - wait for 10s and submit the form to the attacker element result
server