Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- variant/CompoundCookies.js - An input vector script that handles splitting of compound cookies (Issue 6582).
- active/corsair.py > An active scan script to check for CORS related issues.)
- payloadgenerator/securerandom.js > A fuzzer payload generator script that uses Java's SecureRandom as it's source (related to issue 6892).

## [13] - 2021-10-14
### Fixed
Expand Down
31 changes: 31 additions & 0 deletions payloadgenerator/securerandom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Auxiliary variables/constants for payload generation.
var SecureRandom = Java.type("java.security.SecureRandom");
var random = new SecureRandom();
var NUMBER_OF_PAYLOADS = 10;
var INITIAL_VALUE = 1;
var count = INITIAL_VALUE;

function getNumberOfPayloads() {
return NUMBER_OF_PAYLOADS;
}

function hasNext() {
return (count <= NUMBER_OF_PAYLOADS);
}

function next() {
count++;
// There are other data type options offered by SecureRandom
// https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/security/SecureRandom.html
// If you don't want leading negative signs on ints you could use Math.abs
// If you want to pad to a certain length you could do something like:
// String.format("%010d", random.nextint());'
return random.nextInt();
}

function reset() {
count = INITIAL_VALUE;
}

function close() {
}