Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class massFakeEmailGenerator
- {
- private $timeout = 0.5; // timeout in seconds
- private $emailName = "";
- private $domainName = "";
- private $fetchSwitch = true;
- private $mailServices = array(
- "fakemailgenerator" => array(
- "armyspy.com",
- "cuvox.de",
- "dayrep.com",
- "einrot.com",
- "fleckens.hu",
- "gustr.com",
- "jourrapide.com",
- "rhyta.com",
- "superrito.com",
- "teleworm.us"
- ),
- "guerrillamail" => array(
- "guerrillamail.com",
- "guerrillamailblock.com",
- "sharklasers.com",
- "guerrillamail.net",
- "guerrillamail.org",
- "guerrillamail.biz",
- "spam4.me",
- "grr.la",
- "guerrillamail.de"
- )
- );
- public $httpUserAgent = array(
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
- );
- public $currentEmail = null;
- public $currentEmailInfo = array(
- "to"=>null,
- "from"=>null,
- "subject"=>null,
- "received"=>null,
- "expires"=>null
- );
- public $currentEmailContent = null;
- public $savedHeaders = [];
- public function fetch($email)
- {
- $this->currentEmail = $email;
- $email_parts = explode("@", $email);
- $this->emailName = $email_parts[0];
- $this->domainName = $email_parts[1];
- $function_name = "";
- foreach ($this->mailServices as $key => $value) {
- if (in_array($this->domainName, $value)) {
- return $this->$key();
- break;
- }
- }
- return 'no such domains found in our class';
- }
- public function getUrl($url,$headers='')
- {
- $ctx = stream_context_create(
- array('http'=>
- array(
- 'timeout' => $this->timeout,
- 'user_agent' => $this->httpUserAgent[array_rand($this->httpUserAgent)],
- 'header' => $headers."\r\n"
- )
- )
- );
- $result = file_get_contents($url, false, $ctx);
- if(empty($headers)) {
- $this->savedHeaders[] = $http_response_header;
- }
- return $result;
- }
- public function postUrl($url,$data,$headers='')
- {
- $postdata = http_build_query($data);
- $ctx = stream_context_create(
- array('http' =>
- array(
- 'method' => 'POST',
- 'header' => 'Content-type: application/x-www-form-urlencoded'."\r\n".$headers,
- 'content' => $postdata
- )
- )
- );
- $result = file_get_contents($url, false, $ctx);
- if(empty($headers)) {
- $this->savedHeaders[] = $http_response_header;
- }
- return $result;
- }
- public function arrayContains($array=array(),$count=0) {
- }
- public function fakemailgenerator()
- {
- if ($this->fetchSwitch) {
- $result = $this->getUrl('http://www.fakemailgenerator.com/?u='.$this->emailName.'&d='.$this->domainName);
- $this->fetchSwitch = false;
- $this->fakemailgenerator();
- } else {
- $result = $this->getUrl('http://www.fakemailgenerator.com/inbox/'.$this->domainName.'/'.$this->emailName.'/');
- header('Content-Type: text/plain');
- //email info
- preg_match("'<dl class=\"info-list\">(.*?)</dl>'si", $result, $match);
- if ($match) {
- $dom = new DOMDocument;
- $dom->loadHTML($match[0]);
- foreach ($dom->getElementsByTagName('dd') as $node) {
- $tmpEmailarray[] = strip_tags($dom->saveHTML($node));
- }
- $this->currentEmailInfo = array(
- "to"=>$tmpEmailarray[0],
- "from"=>$tmpEmailarray[1],
- "subject"=>$tmpEmailarray[2],
- "received"=>$tmpEmailarray[3],
- "expires"=>$tmpEmailarray[4],
- "message"=>null
- );
- }
- //email body
- $pattern = preg_quote('id="emailFrame"', '/');
- $pattern = "/^.*$pattern.*\$/m";
- if (preg_match_all($pattern, $result, $matches)) {
- preg_match('/src="([^"]+)"/', implode("\n", $matches[0]), $match);
- header('Content-Type: text/html');
- $this->currentEmailContent = $this->getUrl($match[1]);
- } else {
- $this->currentEmailContent = false;
- }
- header('Content-Type: text/html');
- }
- }
- public function guerrillamail()
- {
- if ($this->fetchSwitch) {
- $result = $this->postUrl('https://www.guerrillamail.com/ajax.php?f=set_email_user', array(
- 'email_user' => $this->emailName,
- 'lang' => 'en',
- 'domain' => 'guerrillamail.com'
- ),$resultheaders);
- $this->fetchSwitch = false;
- $this->guerrillamail();
- } else {
- $resultheaders = $this->searchArrayForAndReturnValue($this->savedHeaders[0],"PHPSESSID");
- $result = $this->getUrl('https://www.guerrillamail.com/ajax.php?f=check_email&seq=1&domain=guerrillamail.com',str_replace("Set-Cookie", "Cookie", $resultheaders));
- $result = $this->getUrl('https://www.guerrillamail.com/ajax.php?f=fetch_email&email_id=mr_'.json_decode($result)->list[0]->mail_id.'&domain=guerrillamail.com',str_replace("Set-Cookie", "Cookie", $resultheaders));
- $this->currentEmailInfo = array(
- "to"=>$this->currentEmail,
- "from"=>json_decode($result)->mail_from,
- "subject"=>json_decode($result)->mail_subject,
- "received"=>null,
- "expires"=>null,
- "message"=>null
- );
- $this->currentEmailContent = json_decode($result)->mail_body;
- }
- }
- public function searchArrayForAndReturnValue($array,$string) {
- $tmpValue = "";
- if(is_array($array)) {
- foreach($array as $value) {
- if (strpos($value,$string) !== false) {
- $tmpValue .= $value."\r\n";
- }
- }
- }
- return $tmpValue;
- }
- public function emailMessage() {
- return $this->currentEmailContent;
- }
- }
- $email = new massFakeEmailGenerator();
- echo "Email: ".$email->currentEmail."\r\n";
- if ($email->emailMessage()) {
- foreach($email->currentEmailInfo as $key => $value) {
- echo $key.": ".$value."\r\n";
- }
- echo $email->emailMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment