Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add platform fingerprinting #331

Closed
user021 opened this issue Apr 23, 2013 · 50 comments
Closed

Add platform fingerprinting #331

user021 opened this issue Apr 23, 2013 · 50 comments

Comments

@user021
Copy link
Contributor

user021 commented Apr 23, 2013

It would reduce scan time when the path_traversal module is used if could specify the operating system type (unix or windows)
I thought at something like " --modules=path_traversal:os=unix "
Implementing some thing that can automatically detect os type (some lite version of nmap or idk) would be more effective for people who prefer fire-and-forget.
Either way, i thought it would be nice if we could specify os manually, would spare time and bandwidth of useless requests, looking forward to hear your opinion.

@Zapotek
Copy link
Member

Zapotek commented Apr 23, 2013

Individual modules can't receive options like plugins do, not yet (but there is planned support for it).
That being said, I thing this should be a system wide option, asking the user to provide platform information would severely decrease scan time as it would cut the audit in half -- probably more.

Can't believe this didn't occur to anyone before, two thumbs up! 👍 👍

@user021
Copy link
Contributor Author

user021 commented Apr 25, 2013

Later went through my mind that that maybe a option separately from modules should be made (e.g.--os=windows/unix and maybe --technology=PHP/Ruby/Python/JSP/ASP/NET) since there are 2 modules who deppend on os type (looking through arachni files i noticed that os_cmd_injection_timing have only "sleep TIME" as payload so i don't think is included here) as for web technology would have impact over code_injection module and maybe code_injection_timing / xpath ? if i'm not mistaken.

@Zapotek
Copy link
Member

Zapotek commented Apr 25, 2013

Yeah that was my point.

@Zapotek
Copy link
Member

Zapotek commented May 1, 2013

Jotting some thoughts down:

  • Each page should be fingerprinted to decide which platforms are in play based on:
  • Headers
    • X-Powered-By
    • Server -- Be wary of reverse proxies.
  • Cookie names
    • JSESSIONID
    • PHPSESSID
    • ASPSESSIONID
    • more...
  • Parameters
    • jsessionid
    • phpsessid
    • aspsessionid
    • more...
  • URL file extension
    • .php
    • .jsp
    • .asp
    • more...
  • More...
  • Pages should expose a platform object like:
    • page.platform.unix?, page.platform.linux?, page.platform.windows?, page.platform.php?, page.platform.java?, etc.
    • page.platform.list -- Listing all applicable platforms, like [ :unix, :linux, :php ], [ :windows, :asp ], etc.
  • Modules should adapt at run-time to only send payloads for the platforms of the page they're auditing.
  • Users should be allowed to:
    • Disable the fingerprinter and have Arachni audit everything.
    • Specify extra global platforms.

That should do it. :)

@user021
Copy link
Contributor Author

user021 commented May 1, 2013

Let me get this straight, "Each page should be fingerprinted" means that it will analyzes each page even after os type is detected as well as technology, isn't that an increase on CPU as well memory without point ? isn't a better idea if arachni sends some requests before the scan starts in order to detect this and then the fingerpinter should be shut down

Also, what exactly you mean with "Specify extra global platforms" ?
And in our case, if we have platform unix and linux, will the audit react different in each case ? if so, what exactly will be audited different

@Zapotek
Copy link
Member

Zapotek commented May 1, 2013

No not after, that analysis will be the one that counts. And there won't be any performance overhead since it will take place during the page parse that is being performed anyway. Plus, there's no guarantee that each page you see will be served from the same server so it makes more sense.

If the user wants to make sure that the correct platform will be globally used he can explicitly let us know instead of relying on the fingerprinter.

Lastly, Linux is Unix but Unix is not Linux -- which won't make much difference to the existing payloads but I'm a stickler for that sort of thing and could be a useful distinction in the future.

@user021
Copy link
Contributor Author

user021 commented May 1, 2013

Fair enough, as long as there will be an option to specify both os and page type, ill be pleased.

@user021
Copy link
Contributor Author

user021 commented May 1, 2013

Btw have you thought about around what successful rate we shall expect from the fingerprinter system that detects os type, i think users should know that and not rely on it if the % is too low

@Zapotek
Copy link
Member

Zapotek commented May 1, 2013

No idea, that's pretty much impossible to know beforehand.

@user021
Copy link
Contributor Author

user021 commented May 1, 2013

I have a question, if for example on a website that have as base technology html, there are pages which have the .html extension on end and there are pages which simply don't have any extension, if i will run the scanner with fingerprinter disabled and specify platform as html, auditing the pages which don't have .html at end will make any sense or in this situation, with the fingerprinter activated will have more benefit? also if users could only be able to disable half of fingerprinter, more exactly, specifiy page type only without os detection

@Zapotek
Copy link
Member

Zapotek commented May 1, 2013

Well... html is not a technology, if the only data the fingerprinter has is an .html extension then it has no data and the modules will send all payloads as they do now -- same as if there's no extension and no other data.
The fingerprinter will always err on the side of caution, no data doesn't mean don't send anything, it means send everything.

Providing your own platforms with an enabled fingerprinter would cause the modules to use these for pages for which the fingerprinter failed.
Providing your own platforms with a disabled fingerprinter would cause the modules to use your data for every page.

Those are just initial ideas btw, no guarantee that that will be the final behavior.

Does that answer your question?

@user021
Copy link
Contributor Author

user021 commented May 1, 2013

Yeah, and my bad, i meant php not html. But on the same website, it can't be made by using two different technologies, it have to be one and good i suppose. Sorry for my newbish questions, i don't have many knowledges relayed to that.

@Zapotek
Copy link
Member

Zapotek commented May 1, 2013

Well, that can very well happen but there are more reasons for the fingerprinting to be per page. It's because that will enable the fingerprinter to work even when people are using the framework as a library to perform custom audits for pretty much anything they fancy. In this case there will be no single website to have as a reference.

@user021
Copy link
Contributor Author

user021 commented May 1, 2013

One more thing, whenever the fingerprinter will fail to determine the platform type, will display this as a message on console when running it as -v or only under --debug

@Zapotek
Copy link
Member

Zapotek commented May 1, 2013

I'd actually like to show it as an info message, displayed by default.

@user021
Copy link
Contributor Author

user021 commented May 1, 2013

Yeah, that would be nice : )

@cclements
Copy link

might be handy to have the fingerprint warn if what it detects doesn't match the use specified flavor.

@Zapotek
Copy link
Member

Zapotek commented May 1, 2013

Good idea.
Also, I thought of an example of where unix vs linux might matter. We may be able to narrow down the platform to unix but not be able to determine the flavor, that would at least allow us to skip windows payloads and send linux, bsd, solaris etc.

Zapotek added a commit that referenced this issue May 22, 2013
[Issue #331]

Holds applicable platforms for a given WWW resource.
Zapotek added a commit that referenced this issue May 22, 2013
Zapotek added a commit that referenced this issue May 22, 2013
Zapotek added a commit that referenced this issue May 22, 2013
Zapotek added a commit that referenced this issue May 22, 2013
Zapotek added a commit that referenced this issue May 22, 2013
Zapotek added a commit that referenced this issue May 22, 2013
@user021
Copy link
Contributor Author

user021 commented Jun 27, 2013

Idk how the addon finds it but an nmap scan confirms, is IIS (80/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP))

@Zapotek
Copy link
Member

Zapotek commented Jun 27, 2013

That may be so, but it doesn't change the fact that PassiveRecon is probably guessing as
it does passive recon while nmap actively probes the remote service to gage its behavior
and gain a more accurate picture.

On 06/27/2013 09:24 PM, user021 wrote:

Idk how the addon finds it but an nmap scan confirms, is IIS (80/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP))


Reply to this email directly or view it on GitHub #331 (comment).

Zapotek added a commit that referenced this issue Jun 27, 2013
@user021
Copy link
Contributor Author

user021 commented Jun 28, 2013

backbox x64-2013-06-28-13-45-27

Used the --lsplat command a while ago with the same build and it worked, now however i get this error, i did not try to restart OS in order to reproduce it again since have a scan goin on, same thing with --lsplug but beside that, i can run scans, any idea what's goin on ?
update: weird, if i run scan with trainer module, works, if i use sqli module, i get similar error.

@user021
Copy link
Contributor Author

user021 commented Jun 28, 2013

  1. for some reason, it fails to detect PHP language for this website http://wasmitbuechern.de/

  2. same as 1 just another site http://adevarul.ro/continut/stiri/mit

  3. another website, not sure here if the addon from Mantra is guessing or not, it reports Java as programming language
    http://videolectures.net/

  4. again, not sure if guessing or not but just to let you know,

    Mantra: ASP.NET, IIS, Windows
    Arachni: JSP

http://www.henkel.ro/dezvoltare-durabila/mit-initiative-6174.htm

Zapotek added a commit that referenced this issue Jun 28, 2013
@user021
Copy link
Contributor Author

user021 commented Jun 28, 2013

Btw, the addon who gathers this information in browser is Wappalyzer http://wappalyzer.com/download

https://addons.mozilla.org/en-us/firefox/files/browse/207426/file/content/apps.json#top

@Zapotek
Copy link
Member

Zapotek commented Jun 28, 2013

Cool! I though it was PassiveRecon. This is has the code on GitHub and here are the signatures:
https://github.com/ElbertF/Wappalyzer/blob/master/share/apps.json

I'll updated Arachni's signatures with that data and we should be good to go! :)

@user021
Copy link
Contributor Author

user021 commented Jun 28, 2013

Nice, what about that error i reported up there, any idea what's goin on? ill restart my OS soon but still is weird

@Zapotek
Copy link
Member

Zapotek commented Jun 28, 2013

Oh yeah sorry about that, I saw it as soon as I woke up and then forgot about it. Did you mess with that file? Looks like it may have been corrupted.

Could you put that file (sqli.rb) in a gist so I can have a look?

@user021
Copy link
Contributor Author

user021 commented Jun 28, 2013

OSHIT, actually, i did not mess with it but some1 else did lol, i did open that file today in order to make sure that the fingerprinting have no effect over sqli module. i can see only one way, when the file was open, my bird was on my keyboard and pressed the 0 key without me noticing and that was enough to mess it up, sorry xD

@Zapotek
Copy link
Member

Zapotek commented Jun 28, 2013

ROFL! Fair enough.

Zapotek added a commit that referenced this issue Jun 28, 2013
Zapotek added a commit that referenced this issue Jun 28, 2013
Zapotek added a commit that referenced this issue Jun 28, 2013
Zapotek added a commit that referenced this issue Jun 28, 2013
Zapotek added a commit that referenced this issue Jun 28, 2013
@user021
Copy link
Contributor Author

user021 commented Jun 29, 2013

Downloaded latest build but i see no changes over my previous post, more exactly on points 1, 2, 3 and 4
So, is the addon guessing or how menages to find it out while Arachni can't, on the same page

@Zapotek
Copy link
Member

Zapotek commented Jun 29, 2013

That's because the builds haven't been updated since the 19th. I'm having some issues with my line/ISP.
But even so, 1 shows no indication that it is PHP. Same as for 2, and although it does set a PHPSESSID cookie it's for a different subdomain. Same goes for 3. Finally, 4 is indeed JSP.

@user021
Copy link
Contributor Author

user021 commented Jun 29, 2013

Im trying to get in touch with dev from the addon because id like to see in real time or logs debug info about how exactly it identify them, if is just because the subdomain thing then it makes perfect sense why Arachni sees something else

@user021
Copy link
Contributor Author

user021 commented Jun 30, 2013

Alright, so is the subdomain thing on 1 and 2 so the addon's fault, but on 4, here's what he told me :

"OpenText CMS is detected which implies ASP.NET (and
Java) and thus IIS and Windows Server."

Could you implement that on Arachni too ? or that kind of guessing is not 100% accurate

@Zapotek
Copy link
Member

Zapotek commented Jun 30, 2013

Well, I figured that some day I may add application specific fingerprints but I'd like to think about it a bit more.

@user021
Copy link
Contributor Author

user021 commented Jul 24, 2013

[*] Spider: [HTTP: 200] http://www.burlingtoncoatfactory.com/burlingtoncoatfactory/Women/Pants-Leggings-53141.aspx
[~] Identified as: windows, iis, asp, aspx

how could a single page be asp and aspx at the same time ? addon from browser sees it as aspx only

@Zapotek
Copy link
Member

Zapotek commented Jul 24, 2013

Doesn't matter, the audit payloads work on both aspx and asp so a generic check is enough. This is not about accuracy or recon, this is about having enough info to not send non-applicable payloads during the audit.

@beunwa
Copy link

beunwa commented Sep 6, 2013

I agree with user021 the ability to fingerprint applications would be really really apreciate.

Maybe you could rely on whatweb have done who use a plugin system https://github.com/urbanadventurer/WhatWeb/tree/master/plugins

@Zapotek
Copy link
Member

Zapotek commented Sep 6, 2013

That'd be a huge amount of effort for something that doesn't really fit the nature of the project. It's supposed to be a dynamic scanner, the fingerprinting parts are here purely as an optimization.

I may get around to implement this in the future but at the time there are many more and much more important things that need attention.

@beunwa
Copy link

beunwa commented Sep 6, 2013

Maybe the good solution is a simple tutorial on how to write an arachni fingerprinter plugin ? So everyone could be able to write is own and share it

@Zapotek
Copy link
Member

Zapotek commented Sep 6, 2013

You won't be able to affect the fingerprinter components, because they only care about platforms that have auditable payloads. But if you want to simply log that piece of information you can write a normal plugin and then a plugin formatter for the reports you want to use.

See: http://support.arachni-scanner.com/kb/writing-plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants