Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Javascript support #12

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion lib/rex/random_identifier/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,42 @@ class ExhaustedSpaceError < StandardError; end
).uniq.freeze
)

JavaScriptOpts = JavaOpts.merge(
forbidden: (
JavaOpts[:forbidden] +
# JavaScript Reserved Words + JavaScript Objects, Properties, and Methods + Java Reserved Words + Other Reserved Words + HTML Event Handlers
# https://www.w3schools.com/js/js_reserved.asp
smcintyre-r7 marked this conversation as resolved.
Show resolved Hide resolved
%w[
arguments await debugger delete eval export function in let typeof var with yield

Array Date eval function hasOwnProperty Infinity isFinite isNaN
isPrototypeOf length Math NaN name Number Object prototype
String toString undefined valueOf

getClass java JavaArray javaClass JavaObject JavaPackage

alert all anchor anchors area assign blur button checkbox clearInterval clearTimeout clientInformation
close closed confirm constructor crypto decodeURI decodeURIComponent defaultStatus
document element elements embed embeds encodeURI encodeURIComponent escape
event fileUpload focus form forms frame innerHeight innerWidth
layer layers link location mimeTypes navigate navigator frames
frameRate hidden history image images offscreenBuffering open opener
option outerHeight outerWidth packages pageXOffset pageYOffset parent parseFloat
parseInt password pkcs11 plugin prompt propertyIsEnum radio reset
screenX screenY scroll secure select self setInterval setTimeout
status submit taint text textarea top unescape untaint window

onblur onclick onerror onfocus onkeydown onkeypress onkeyup onmouseover
onload onmouseup onmousedown onsubmit
smcintyre-r7 marked this conversation as resolved.
Show resolved Hide resolved
]
).uniq.freeze
)

Opts = {
default: DefaultOpts,
java: JavaOpts,
jsp: JSPOpts
jsp: JSPOpts,
javascript: JavaScriptOpts
}

# @param opts [Hash] Options, see {DefaultOpts} for default values
Expand Down