Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

data-port attribute in <span> tag

Hello guys !

I'm not sure this is the right forum for my question, but here goes.

In my web scraping journey I recently found something that I have not seen before:

<td><span class="port" data-port="5652045C"></span></td>

I know a little HTML & CSS, but have never stumbled upon the data-port attribute before. The above line outputs: 3128 (yes its a port number), but I cant seem to figure out how it does it. Browsers aren't that clever that the above shouldn't be something that we can decode quite easily, but I'm stuck .. I have looked for traces of JS and such, but have not found anything..

So, do any of you guys have an idea what this sorcery is or knows what "encryption" this is?

Cheers
the 'data-SOMEVAR' attribute is often used in combination with JS to store information. It can be anything really (data-user=, data-myData=, data-klatzen=, etc).
[Image: AAjOYL.gif]
https://developer.mozilla.org/en-US/docs...butes/data-*
(Mar 13, 2017 05:51 PM)Yani Wrote:  Yep, I'm 99% sure it'll be javascript that decrypts it.
Post the website and we could help you.

Hey m8,

The source is: view-source:http://proxyservers.pro/proxy/list/order/updated/order_dir/desc/page

All ports is encoded that way, I have tried to briefly look over the JS, but cant find anything.. I hope that you will be more lucky :)


(Mar 13, 2017 02:26 PM)Ganja Wrote:  the 'data-SOMEVAR' attribute is often used in combination with JS to store information. It can be anything really (data-user=, data-myData=, data-klatzen=, etc).

Thank you! Thats why I couldnt find anything on google since I searched for "Data-port" :)
(Mar 14, 2017 08:06 AM)Yani Wrote:  This is the javascript function that gets ran over the port data:

Code
function decode(e, t) {
    for (var n = [], i = 0, r = 0; i < e.length - 1; i += 2, r++) n[r] = parseInt(e.substr(i, 2), 16);
    for (var a = [], i = 0; i < t.length; i++) a[i] = t.charCodeAt(i);
    for (var i = 0; i < n.length; i++) n[i] = n[i] ^ a[i % a.length];
    for (var i = 0; i < n.length; i++) n[i] = String.fromCharCode(n[i]);
    return n = n.join("")
}

The port data always seems to decode to the same port, so if you can't figure out how to do it you can simply create a list for the most used ports.

Thank you for your findings! I will try to see if I can turn this into something usable for me :)

Edit: Might be a noobish question, but any idea how this function would look like in c#? :)
(Mar 14, 2017 10:52 AM)Yani Wrote:  Yeah kind of, but it would take too much time for me to write it out for you. Good luck though 🤝

Okay, thanks anyway though ! :-)


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Makaveli.Sep 7, 2016 05:58 AM 1 175 Sep 7, 2016 05:58 AM
Last Post: Sakuto
[Wordpress] by hamahemJun 29, 2016 08:52 PM 1 235 Jun 29, 2016 08:52 PM
Last Post: SIM-545076
by clark.dllAug 18, 2014 01:59 PM 6 135 Aug 18, 2014 01:59 PM
Last Post: clark.dll