This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/ | |
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c | |
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit: | |
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1 | |
# New function naming schema: | |
# Verbs: | |
# Get : retrieve full raw data sets | |
# Find : ‘find’ specific data entries in a data set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function truthCheck(collection, pre) { | |
for (let i in collection) { | |
if (collection[i].hasOwnProperty(pre)) { | |
if(!collection[i][pre]) { | |
return false; | |
} | |
} else if (!collection[i].hasOwnProperty(pre)) { | |
return false; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function binaryAgent(str) { | |
return str.split(" ").map(value => { | |
return String.fromCharCode(parseInt(value, 2)); | |
}).join(""); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sumPrimes(num) { | |
let sum = 0; | |
const isPrime = n => ![...Array(n).keys()].slice(2).map(i => !(n%i)).includes(true) && ![0,1].includes(n) | |
for (let i=0; i<=num; i++) { | |
if (isPrime(i)) { | |
sum += i; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertHTML(str) { | |
let signs = {'&': '&', | |
'<': '<', | |
'>': '>', | |
'\"': '"', | |
'\'': '''}; | |
let signKeys = Object.keys(signs); | |
console.log(signKeys); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function uniteUnique(arr) { | |
let newArr = []; | |
for (let i=0; i<arguments.length; i++) { | |
for (let j=0; j<arguments[i].length; j++) { | |
if (!newArr.includes(arguments[i][j])) { | |
newArr.push(arguments[i][j]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fearNotLetter(str) { | |
let letters = str.split(""); | |
let alph = 'abcdefghijklmnopqrstuvwxyz'.split(""); | |
let range = alph.slice(alph.indexOf(letters[0]), alph.indexOf(letters[0])+letters.length+1); | |
console.log("Original range: " + range); | |
for (let i in str) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function diffArray(arr1, arr2) { | |
let newArr1 = arr1.filter(val => { | |
return arr2.indexOf(val) == -1; | |
}) | |
let newArr2 = arr2.filter(val => { | |
return arr1.indexOf(val) == -1; | |
}) | |
return newArr1.concat(newArr2); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function urlSlug(title) { | |
return title.split(/\W/).filter(item => item).map(item => item.toLowerCase()).join("-") | |
} |