开发者

How to read this php code?

How to decode this string in php?

$x = "h\164tp\163\072\057\057\x70r\157\x64\x75\x63t-\x73\x65a\x72\143\150\056\x61\160i\x2e\x63\x6a\x2ec\x6f\x6d\057v\062/\160\x72\157\x64\165\x63t\x2ds\x65\141\162\143\x68\x3f";

It looks like a regex URL, but how to read what it is?

Than开发者_如何转开发ks.


just echo it out.

<?
$x = "h\164tp\163\072\057\057\x70r\157\x64\x75\x63t-\x73\x65a\x72\143\150\056\x61\160i\x2e\x63\x6a\x2ec\x6f\x6d\057v\062/\160\x72\157\x64\165\x63t\x2ds\x65\141\162\143\x68\x3f";
echo $x;

It outputs:

https://product-search.api.cj.com/v2/product-search?


Print it!

% cat test.php 
#!/usr/bin/env php

<?php
$x = "h\164tp\163\072\057\057\x70r\157\x64\x75\x63t-\x73\x65a\x72\143\150\056\x61\160i\x2e\x63\x6a\x2ec\x6f\x6d\057v\062/\160\x72\157\x64\165\x63t\x2ds\x65\141\162\143\x68\x3f";
print $x;
?>

% ./test.php
https://product-search.api.cj.com/v2/product-search?


It is actually a string with some characters specified in hexadecimal and octal notation. Just echo it.


just print it, its a url

https://product-search.api.cj.com/v2/product-search?


Well, I created a PHP page as follows:

<?php
$x = "h\164tp\163\072\057\057\x70r\157\x64\x75\x63t-\x73\x65a\x72\143\150\056\x61\160i\x2e\x63\x6a\x2ec\x6f\x6d\057v\062/\160\x72\157\x64\165\x63t\x2ds\x65\141\162\143\x68\x3f";

print $x;
?>

and ran it.

And I got the following:

https://product-search.api.cj.com/v2/product-search?

Which means nothing to me, except that cj.com is part of Commission Junction, which is an online advertising network.

It's been deliberately obfuscated, so clearly the person who wrote it intended that you didn't notice it or understand it, and would leave it alone. I don't know the context of the question, why you're asking about it, but my guess would be that you've been hacked and someone has inserted this code (and more) into your site.

If that's the case, their aim would clearly be to gain some advertising revenue by freeloading on your site. Not particularly malicious as hacks go, but not something you'd want to be happening (especially if you don't know what kind of ads would be shown).


Simple:

utf8_decode();

http://www.php.net/manual/en/function.utf8-decode.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜