Re: [Hampshire] obfuscated code

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] obfuscated code

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x57e27100.hantslug.org.uk.27293': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Sun Mar 13 17:33:10 2011 GMT
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Sun, Mar 13, 2011 at 05:19:50PM +0000, Hugo Mills wrote:
> On Sun, Mar 13, 2011 at 05:16:42PM +0000, John Lewis wrote:
> > One bit of the Kingsclere History website is a list of surnames people
> > have an interest in and contact addresses for other people to use but
> > the email addresses are encrypted.
> >
> > part of the html code looks like this:
> >
> > <td><p class="bodytext">HAYWARD</td>
> >     <td><p class="bodytext"><a
> > href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#106;&#111;&#121;&#115;&#103;&#101;&#110;&#101;&#97;&#64;&#115;&#104;&#97;&#119;&#46;&#99;&#97;&#46;">&#74;&#111;&#121;&#32;&#70;&#114;&#101;&#110;&#99;&#104;</a><br><a
> > href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#66;&#97;&#114;&#98;&#97;&#114;&#97;&#77;&#97;&#108;&#108;&#121;&#111;&#110;&#64;&#108;&#101;&#119;&#109;&#97;&#108;&#46;&#99;&#111;&#46;&#117;&#107;">&#66;&#97;&#114;&#98;&#97;&#114;&#97;&#32;&#77;&#97;&#108;&#108;&#121;&#111;&#110;</a></td> 

> >
> > I don't know what software was used to set it up, probably some windows
> > based gui website design tool.
> >
> > Does anyone have a clue as to how I can decode the page so I can edit?
> > it. The original webmaster is unavailable for the moment so cannot ask
> > what software he used.
>
>    They're ASCII codes (actually, probably UTF-8, but since there's
> nothing over 127, it's much the same thing). You can either decode
> manually (for small quantities), or view in a web browser and
> cut-and-paste the resulting characters.


Or run this sed script on the files, with:

$ sed -f script.sed <source_file.html >source_file_fixed.html

--8<-- file starts --8<--
s/&#32;/ /g
s/&#33;/!/g
s/&#34;/"/g
s/&#35;/#/g
s/&#36;/$/g
s/&#37;/%/g
s/&#39;/'/g
s/&#40;/(/g
s/&#41;/)/g
s/&#42;/*/g
s/&#43;/+/g
s/&#44;/,/g
s/&#45;/-/g
s/&#46;/./g
s/&#47;/\//g
s/&#48;/0/g
s/&#49;/1/g
s/&#50;/2/g
s/&#51;/3/g
s/&#52;/4/g
s/&#53;/5/g
s/&#54;/6/g
s/&#55;/7/g
s/&#56;/8/g
s/&#57;/9/g
s/&#58;/:/g
s/&#59;/;/g
s/&#61;/=/g
s/&#63;/?/g
s/&#64;/@/g
s/&#65;/A/g
s/&#66;/B/g
s/&#67;/C/g
s/&#68;/D/g
s/&#69;/E/g
s/&#70;/F/g
s/&#71;/G/g
s/&#72;/H/g
s/&#73;/I/g
s/&#74;/J/g
s/&#75;/K/g
s/&#76;/L/g
s/&#77;/M/g
s/&#78;/N/g
s/&#79;/O/g
s/&#80;/P/g
s/&#81;/Q/g
s/&#82;/R/g
s/&#83;/S/g
s/&#84;/T/g
s/&#85;/U/g
s/&#86;/V/g
s/&#87;/W/g
s/&#88;/X/g
s/&#89;/Y/g
s/&#90;/Z/g
s/&#91;/[/g
s/&#92;/\\/g
s/&#93;/]/g
s/&#94;/\^/g
s/&#95;/_/g
s/&#96;/`/g
s/&#97;/a/g
s/&#98;/b/g
s/&#99;/c/g
s/&#100;/d/g
s/&#101;/e/g
s/&#102;/f/g
s/&#103;/g/g
s/&#104;/h/g
s/&#105;/i/g
s/&#106;/j/g
s/&#107;/k/g
s/&#108;/l/g
s/&#109;/m/g
s/&#110;/n/g
s/&#111;/o/g
s/&#112;/p/g
s/&#113;/q/g
s/&#114;/r/g
s/&#115;/s/g
s/&#116;/t/g
s/&#117;/u/g
s/&#118;/v/g
s/&#119;/w/g
s/&#120;/x/g
s/&#121;/y/g
s/&#122;/z/g
s/&#123;/{/g
s/&#124;/|/g
s/&#125;/}/g
s/&#126;/~/g
--8<-- file ends --8<--

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
                    --- UNIX:  Italian pen maker. ---