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
1. 普通筛法 | |
n = 1000000 | |
arr=[1]*(n+1) | |
arr[0]=arr[1]=0 | |
s = 2 | |
for i in xrange(2,int(n**0.5)+1): | |
if arr[i] == 1: | |
for j in xrange(i*i, n+1,i): | |
arr[j] = 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
#include <algorithm> | |
#include <cstdio> | |
#include <queue> | |
#include <vector> | |
#include <cstring> | |
using namespace std; | |
//3个瓶子的大小 | |
int ga[3] = {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
#include <algorithm> | |
#include <cstdio> | |
#include <queue> | |
#include <vector> | |
#include <cstring> | |
#include <set> | |
using namespace std; | |
class State { | |
public: |
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
#include <cstdio> | |
#include <vector> | |
#include <bitset> | |
#include <climits> | |
#include <iostream> | |
using namespace std; | |
#define MAX 15 | |
vector<bitset<MAX> > vec; |
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
#!/usr/bin/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
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
/* | |
* CVE-2014-0160 heartbleed OpenSSL information leak exploit | |
* ========================================================= | |
* This exploit uses OpenSSL to create an encrypted connection | |
* and trigger the heartbleed leak. The leaked information is | |
* returned encrypted and is then decrypted, decompressed and | |
* wrote to a file to annoy IDS/forensics. The exploit can set | |
* the heatbeart payload length arbitrarily or use two preset | |
* values for 0x00 and MAX length. The vulnerability occurs due | |
* to bounds checking not being performed on a heap value which |
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
#!/usr/bin/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# Modified by Derek Callaway ([email protected]) to add STARTTLS protocols | |
# The authors disclaim copyright to this source code. | |
import sys | |
import struct |
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
/* | |
* CVE-2014-0160 heartbleed OpenSSL information leak exploit | |
* ========================================================= | |
* This exploit uses OpenSSL to create an encrypted connection | |
* and trigger the heartbleed leak. The leaked information is | |
* returned encrypted and is then decrypted, decompressed and | |
* wrote to a file to annoy IDS/forensics. | |
* | |
* https://github.com/HackerFantastic/Public/blob/master/exploits/heartbleed.c | |
* https://raw.githubusercontent.com/decal/ssltest-stls/master/ssltest-stls.py |
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
I wasn't first to get the key. Nor was I second, third, or even fourth. I'm probably not even the | |
10th to get it (ok, looks like I was the 7th.) But I'm happy that I was able to prove to myself | |
that I too could do it. | |
First, I have to admit I was a skeptic. Like the handful of other dissenters, I had initially | |
believed that it would be highly improbable under normal conditions to obtain the private key | |
through exploiting Heartbleed. So this was my motivation for participating in Cloudflare's | |
challenge. I had extracted a lot of other things with Heartbleed, but I hadn't actually set out to | |
extract private keys. So I wanted to see first-hand if it was possible or not. |
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
#!/usr/bin/env python2 | |
""" | |
Author: takeshix <[email protected]> | |
PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]). | |
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP. | |
""" | |
import sys,struct,socket | |
from argparse import ArgumentParser |
OlderNewer