Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: un obfuscate logfiles with xor

by Laurent_R (Canon)
on Jun 25, 2013 at 21:16 UTC ( [id://1040659]=note: print w/replies, xml ) Need Help??


in reply to un obfuscate logfiles with xor

Hmm, I don't quite understand you problem. If you file is encoded with a xor 255 (or a xor anything, for that matter), and if I understood your problem correctly, you should just need to apply the same xor to retrieve the original value.

Or did I understand you wrongly?

Replies are listed 'Best First'.
Re^2: un obfuscate logfiles with xor
by golgiapparatus (Novice) on Jun 25, 2013 at 21:34 UTC
    Here is an example ÃÎÌËÁßÍÏÎÌÐÏÊÐÎÌßÏËÒÏÇÒÊÆßÓœž“ÏÑ–‘™Áß‘ŠÆÌÇÌÑ‘ŠŒ–šÑœ’ß™ Thank you

      use strict; use warnings; my $s = q<ÃÎÌËÁßÍÏÎÌÐÏÊÐÎÌßÏËÒÏÇÒÊÆßÓœž“ÏÑ–‘™Áß‘ŠÆÌÇÌÑ‘ŠŒ–šÑœ’ß +™>; print pack "C*", map { $_ ^ 255 } unpack "C*", $s;
      <134> 2013/05/13 04-08-59 <local0.info> nu9383.nuspire.com pf

      This only works if I run the code in an ASCII encoded file, there doesn't seem to be utf-8 involded here.

      unpack "C*", $s; returns a list consisting of the value of each byte in $s. pack with "C*" takes a list of bytes and turns it into a string. Read perlpacktut for more information on that.

      Is that an example of raw input, or the output from the current iteration of your script? It would be helpful to know we have a clean fragment of raw logfile data

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1040659]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found