Skip to content

Instantly share code, notes, and snippets.

View pimterry's full-sized avatar
👶
50% parental leave, not going to be very responsive for a while

Tim Perry pimterry

👶
50% parental leave, not going to be very responsive for a while
View GitHub Profile
it("Can open main page", () => {
return client
.url(extensionPage("main.html"))
.pause(500)
.hasDrawnPixels(".city > canvas").should.eventually.equal(true,
"Canvas should have an image drawn on it");
});
it("Can open main page", function () {
return driver.get(extensionPage("main.html")).then(function () {
return driver.wait(sw.until.elementLocated({
css: ".city > canvas"
}), 1000);
}).then(function (cityCanvas) {
return sw.promise.delayed(200).then(function () {
return cityCanvas;
});
}).then(function (cityCanvas) {
<html lang="en">
<head>
<meta http-equiv="refresh" content="0">
<meta http-equiv="set-cookie" content="cf_use_ob=443; expires=Mon, 21-Jul-14 08:14:52 GMT; path=/">
<meta http-equiv="set-cookie" content="cf_ob_info=504:14d5f112c31d087a:IAD; expires=Mon, 21-Jul-14 08:14:52 GMT; path=/">
@pimterry
pimterry / Example vulnerable PHP code
Created April 13, 2014 13:55
Stop your web stack sabotaging your security - exploit snippets
$loginOk = (crypt($passwordInput, $salt) == $previouslyCryptedPassword));
This talk is on XML attacks, which are very easy to become vulnerable to, because XML is insane, and
extremely dangerous especially if you're running web services or similar.
First up, Billion Laughs. Essentially you can do text substitutions in XML, because obviously it can
rewrite itself as you parse it. And you do them like this.
So, you define a whole load of rules, and then at the bottom &lol9 gets replaced by 10 &lol8s, which
each then get replaced by 10 &lol9's [n.b. should be &lol7], and eventually gives you one billion lols.
Byte for each character, 3 bytes for a lol, gives you 3GB of string. Parsing that will take a long
time and will probably break things when you write it anywhere.