Skip to content

Commit

Permalink
Add pointer payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisiswant0 committed Jul 6, 2021
1 parent 06e6128 commit d2f06ce
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions src/builder/payload.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
static PROTO: &str = "__proto__";

pub fn get() -> Vec<String> {
let mut payload = vec![];

let object = get_object();
let pointer = get_pointer();

payload.extend(object);
payload.extend(pointer);

payload
}

fn get_object() -> Vec<String> {
const PREFIX: &str = "__proto__";
let suffixes = [
".ppfuzz",
"[ppfuzz]"
];

suffixes
.iter()
.map(|suffix| PROTO.to_owned() + suffix)
.map(|suffix| PREFIX.to_owned() + suffix)
.collect()
}

fn get_pointer() -> Vec<String> {
const PREFIX: &str = "constructor";
let suffixes = [
".prototype.ppfuzz",
"[prototype][ppfuzz]"
];

suffixes
.iter()
.map(|suffix| PREFIX.to_owned() + suffix)
.collect()
}

0 comments on commit d2f06ce

Please sign in to comment.