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 sanitizeJSONValues(obj){ | |
| for (var k in obj){ | |
| if (typeof obj[k] == "object" && obj[k] !== null){ | |
| sanitizeJSON(obj[k]); | |
| } | |
| else{ | |
| if(typeof obj[k]=="string"){ | |
| obj[k] = escapeHtml(obj[k]); | |
| } | |
| } |
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
| import java.io.BufferedReader; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.nio.file.Files; | |
| import java.nio.file.Paths; | |
| import java.nio.file.attribute.PosixFilePermission; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.HashSet; |
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
| <html> | |
| <!-- all tags that should match --> | |
| <link href="www.external.com"> | |
| <script type="text/javascript"> | |
| xhr1.open("POST","http://external.com"); | |
| xhr2.open("POST","www.external.com"); | |
| xhr2.open("POST","www.external-co-ul.co.uk"); | |
| xhr3.open("POST","//external.com"); | |
| xhr4.open("POST","http://gist.githubusercontent.com/testlocal"); | |
| </script> |
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
| @import 'fonts.googleapis.com/css?family=Advent+Pro:400,200,700'); | |
| @import "www.fonts.googleapis.com/css?family=Advent+Pro:400,200,700"); | |
| @import "https://www.fonts.googleapis.com/css?family=Advent+Pro:400,200,700"); | |
| @import url("http://fonts.googleapis.com/css?family=Raleway+Dots"); | |
| @import url('//weloveiconfonts.com/api/?family=entypo'); | |
| @import url("weloveiconfonts.com/api/?family=entypo"); | |
| html{ | |
| } |
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
| xhr1.open("POST","http://external2.com"); | |
| xhr2.open("POST","www.external2.com"); | |
| xhr3.open("POST","//external2.com"); | |
| xhr4.open("POST","http://gist.githubusercontent.com/testrlocal"); | |
| xhr4.open("POST","gist.githubusercontent.com/testrlocal"); |
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
| public static String removeSubdomains(String url, ArrayList<String> secondLevelDomains) { | |
| // We need our URL in three parts, protocol - domain - path | |
| String protocol= getProtocol(url); | |
| url = url.substring(protocol.length()); | |
| String urlDomain=url; | |
| String path=""; | |
| if(urlDomain.contains("/")) { | |
| int slashPos = urlDomain.indexOf("/"); | |
| path=urlDomain.substring(slashPos); | |
| urlDomain=urlDomain.substring(0, slashPos); |
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
| openssl s_client -showcerts -servername {{URL}} -connect {{URL}}:443 2>/dev/null |
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
| $ echo "f00 bar 123 f00 foo" | awk -F"f00" '{ print NF-1}' | |
| 2 |
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
| res=$(curl "https://zgheb.com" -i -sS -w "\r\n%{http_code}") | |
| responseCode=$(echo "$res" | tail -1) | |
| headersAndBody=$(echo "$res" | head -n -1) | |
| headers=$(echo "$headersAndBody" | awk '{if($0=="\r")exit;print}') | |
| body=$(echo "$headersAndBody" | awk '{if(body)print;if($0=="\r")body=1}') | |
| powered=$(echo "$res" | grep -Fi "X-Powered-By" | cut -d ":" -f2 | awk '{$1=$1};1') | |
| echo "Response Code:" |
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
| public static void main(String[] args) { | |
| String input = "werewräüèö"; | |
| String result = fixDoubleUTF8Encoding(input); | |
| System.out.println(result); // werewräüèö | |
| input = "üäöé"; | |
| result = fixDoubleUTF8Encoding(input); | |
| System.out.println(result); // üäöé | |
| } |