拼写论坛的电子邮件地址 [英] Spell email address for forums

查看:123
本文介绍了拼写论坛的电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将其放入html中时,如何使邮件的代码拼写并且无法检测论坛

How can I make the code of the mail to spell it and undetectable for forum when I try to put it in html

感谢预期

喜欢这个!但更复杂

<h>mariaburkke76</h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h><h>@<h><h><h><h><h>g<h><h><h><h><h><h><h><h><h><h><h>m<h><h><h>a<h><h>i<h><h><h><h><h><h><h><h><h><h><h><h><h><h><h>l<h><h><h><h>.<h>com<h><h><h><h><h><h><h><h><h>


推荐答案

你可以使用 XOR (带随机密钥)和base64 / atob。

You could use a combination of XOR (w/ random key) and base64/atob.

虽然它不会停止专门用于刮擦论坛的机器人,但请参见下文。

<?php
$email = '<a href="mailto:mariaburkke76@gmail.com">mariaburkke76@gmail.com</a>';

function xor_email($str) {
    $key = mt_rand(1, 192);
    for ($i = 0; $i < strlen($str); $i++) {
        $str[$i] = chr(ord($str[$i]) ^ $key);
    }
    return $key.'.'.base64_encode($str);
}
$enc = xor_email($email);
?>

<e data-enc='<?= $enc ?>'/>

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>

<script>
var decode = function(key, hash) {
    var salt = parseInt(key);
    var result = '';
    for (var i=0; i<hash.length; i++) {
        result += String.fromCharCode(salt ^ hash.charCodeAt(i));
    }
    return result;
}
$(document).find('e').each(function(){
    var data = $(this).data('enc').split(".");
    $(this).replaceWith(decode(data[0], atob(data[1])));
});
</script>

会生成以下内容。

<e data-enc='102.WgdGDhQDAFtECwcPChIJXAsHFA8HBBMUDQ0DUVAmAQsHDwpIBQkLRFgLBxQPBwQTFA0NA1FQJgELBw8KSAUJC1pJB1g='/>

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>

<script>
var decode = function(key, hash) {
    var salt = parseInt(key);
    var result = '';
    for (var i=0; i<hash.length; i++) {
        result += String.fromCharCode(salt ^ hash.charCodeAt(i));
    }
    return result;
}
$(document).find('e').each(function(){
    var data = $(this).data('enc').split(".");
    $(this).replaceWith(decode(data[0], atob(data[1])));
});
</script>

从收割机的角度来看,一旦确定了保护方法,就可以轻松地抓取电子邮件,如下所示。因此,您不会幻想通过默默无闻的安全措施无法保护您免受定制的电子邮件机器人/刮刀/收割机的侵害。

From a harvesters point of view, once determined the method of protection one could easily scrape out the email as followed. Just so you're under no illusions that security through obscurity will not protect you from a custom-made email bot/scraper/harvester.

<?php
$html = '<e data-enc=\'102.WgdGDhQDAFtECwcPChIJXAsHFA8HBBMUDQ0DUVAmAQsHDwpIBQkLRFgLBxQPBwQTFA0NA1FQJgELBw8KSAUJC1pJB1g=\'/>

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>

<script>
var decode = function(key, hash) {
    var salt = parseInt(key);
    var result = \'\';
    for (var i=0; i<hash.length; i++) {
        result += String.fromCharCode(salt ^ hash.charCodeAt(i));
    }
    return result;
}
$(document).find(\'e\').each(function(){
    var data = $(this).data(\'enc\').split("-");
    $(this).replaceWith(decode(data[0], atob(data[1])));
});
</script>';

function xor_email($str, $key) {
    for ($i = 0; $i < strlen($str); $i++) {
        $str[$i] = chr(ord($str[$i]) ^ $key);
    }
    return $str;
}

$doc = new DOMDocument();
libxml_use_internal_errors(true);
$doc->loadHTML($html);

//
foreach ($doc->getElementsByTagName('e') as $e) {
    // parse out XORed string
    $enc = $e->getAttribute('data-enc');
    $enc = explode('.', $enc);
    $decoded = xor_email(base64_decode($enc[1]), $enc[0]);

    // parse out email
    $sub_doc = new DOMDocument();
    $sub_doc->loadHTML($decoded);
    foreach ($sub_doc->getElementsByTagName('a') as $a) {
        echo $a->nodeValue;
    }
}

https://3v4l.org/T0mlp

这篇关于拼写论坛的电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆