Maltego transform samples I'm playing around with Maltego for target recon and investigation, and have started writing my own transforms in Python. Unfortunately, the current developer documentation is a little light on details, and I'm having to guess a lot of it.

Are there any decent resources on writing Maltego transforms, or any useful sample transforms that do more than a "Hello world" example? I'm especially interested in samples that demonstrate the various data types on entity parameters, since I just spent an hour trying to figure out how datetime was meant to be formatted.

You might want to take a look at the Canari Framework (https://www.canariproject.com/4-3-transform-development-quick-start/). It's an awesomely simple transform development framework that let's you do some pretty rad things ;).

UPDATE 1:

Canari now has some additional support for complex field types. So far we've added datetime, timespan, color, and date. You can design an entity like so:

@EntityField(name='mydate', type=EntityFieldType.Date)
@EntityField(name='mydatetime', type=EntityFieldType.DateTime)
@EntityField(name='mytimespan', type=EntityFieldType.TimeSpan)
@EntityField(name='mycolor', type=EntityFieldType.Color)
class MyEntity(Entity):
    pass

And use it like so:

import datetime
e = MyEntity('value')
e.mydate = datetime.date.today()
# ... etc.

Hope this helps! Support for array types and other things coming soon. Also, if you are curious how to format things, simply design an Entity in Maltego with the various field types and see how it renders the property values in the property editor once you drag your entity onto the graph.


When is phishing education going too far? I currently work on the IT security team at my workplace in a senior role. Recently, I assisted management in designing the phishing / social engineering training campaigns, by which IT security will send out phishing "test" emails to see how aware the company employees are to spotting such emails.

We have adopted a highly targeted strategy based not only on the user's job role but also on the content such employees are likely to see. The content have been varied to include emails asking for sensitive content (e.g: updating a password) to fake social media posts, to targeted advertising.

We have been getting push back from end users that they have no way of distinguishing a legitimate email that they would receive day to day from truly malicious phishing emails. They have been requests to scale back the difficulty of these tests from our team.

Edit to address some comments that say spear phishing simulations are too extreme / bad design of simulations

In analyzing the past results of phishing simulations, the users who clicked tended to show certain patterns. Also, one particular successful phish that resulted in financial loss (unnecessary online purchase) was pretending to be a member of senior management.

To respond to comments on depth of targeting / GDPR, methods of customization are based on public company data (i.e: job function), rather than private user data known to that person only. The "content that users are likey to see" is based on "typical scenarios", not what content users at our workplace see specifically

Questions

When is phishing education going too far?
Is pushback from the end users demonstrative that their awareness is still lacking and need further training, specifically the inability to recognize legitimate from malicious emails?

I think there is an underlying problem that you will need to address. Why do the users care that they are failing?

Phishing simulations should, first and foremost, be an education tool not a testing tool.

If there are negative consequences to failing, then yes, your users are going to complain if the tests are more difficult than you have prepared them for. You would complain, too.

So, your response should be:

educate them more (or differently) so that they can pass the tests (or rather, the comprehension tests, which is what they should be)
remove negative consequences to failing

This might not require any content changes to your education material, but might only require a re-framing of the phishing simulations for users, management, and your security team.

Another tactic to try is to graduate the phishing simulations so that they get harder as the users are successful in responding to phishing. I have done this with my custom programmes. It's more complex on the back end, but the payoffs are huge if you can do it.

Your focus needs to be the evolving maturity of your organisation's ability to resist phishing attacks, not getting everyone to be perfect on tests. Once you take this perspective, the culture around these tests and the complaints will change.

Do it right, and your users will ask for the phishing simulations to be harder not easier. If you aim for that end result, you will have a much more resilient organisation.


Does the “post/redirect/get" pattern create security problems? My understanding of Post-Redirect-Get so far is not very deep.  I've used it a couple of times now.  What I notice, though, is that when I use it, I am sending a rather private token of some sort to the last page in the GET request. It is a token that allows the server to respond with information about the just-completed transaction.  The way I'm using it is:
[Page 1        ]        [Page 2       ]         [Page 3                     ]
[Form to submit] =====> [Processes Trx] ======> [Has querystring parameter  ]
[              ]  POST  [             ]  REDIR  [that gets a plot of the Trx]

So the Querystring sent to Page 3 has info that causes the server to plot information about the transaction.  Worse, the Querystring is shown out in the open in a browser.  It seems someone can pretty easily get my Querystring parameters and then go look at my transaction at any later time.

Is my understanding of the exposure correct?  Does SSL hide it from all?
Do you implement it differently than I'm doing?
Is there perhaps a P-R-"P" pattern that posts to Page 3, so at least the information about accessing the transaction is not in full view?  (We would not want Page 3 to have a side effect, just get info, but I'm trying not to expose a private token.)
Does that help at all, or is it just as insecure?

It seems someone can pretty easily get my Querystring parameters and then go look at my transaction at any later time.

Maybe it is like this, maybe not. The actual implementation is not known. But one can prevent the behavior you describe by

Having a short expiration on the string, so it can only be used within the very short time the redirect is expected to be processed by the client. This way it cannot be used later.
Clearing the validity of the string after first use (i.e. after successful redirect) so it cannot be used again.
Binding the string to the current session of the client, i.e. session cookie or similar, so that it cannot be used without also having access to the session information.

It should also be used with TLS so that the attacker cannot just capture the request and use it before the client does, since the request contains the string and also the session information. But this is actually not only true for this kind of pattern but for all kind of actions which include the session information - these could otherwise be simply hijacked and changed to cause different things.


Secure multiserver authentication I was reading answers in How to split login and game logic when writing servers?. Read that first.

Now, I want to know whenever this method will work and how can it be broken. I think there might be better ways to do this but client-gameserver connection (in my case) will have to start in an unsecure channel. But the connection to the Login Server is secure. And the Game Server has a shared secret with the Login Server. But the connection to the gameserver is insecure.

So what are better ways of doing this? Hashing the IP in there seems to be secure, but I am not sure. Also, this will have to work fast, very fast.

This is authentication only. There is no need for secure channel between gameserver and client.

If communications between the game server and client are insecure then the only thing you are protecting is the information sent over the secure channel to the login server. An attacker can still take over the session on the game server and hence exploit the identity without the credentials.

  Hashing the IP

While it is true that IP spoofing is hard, it's not impossible. Also this would only have some value as an indicator of identity if IP addresses were not shared and did not change mid-session, neither of which is true.

Without TLS on the game server you have no security. Good security needs lots more things.

  this will have to work fast, very fast.

TLS does add a performance overhead, but there is scope to influence this significantly and it's just one component of your performance budget.

BTW the question you linked to is predicated on combining authentication and function of a service scaling poorly when combined. This is nonsense. There are good reasons for separating authentication to a dedicated service - it has very specific and exacting security requirements, hence using an off the shelf product has attractions, also the concomitant isolation makes reuse of the authentication service easier.


Securely Connect Employee PC to Business Private Network I've recently become the "tech guy" at a startup, and am tasked with standardizing our hardware infrastructure. Further more, I choose how employees working from home will connect to business hardware. I am not a security expert, although I do know some things here and there through life experience as a developer and computer nerd. I would like to validate (or invalidate) some ideas with your community.
I'm thinking that business hardware can be considered secure in a private network behind a firewall, whereby all incoming/outgoing connections are done via VPN. I'm under the impression that this is in general sufficient for a private network's safekeeping.
What I'm more worried about though, are employee PCs. I'm currently considering a VNC client that connects through an ssh tunnel (while also connected to the vpn). I'm not really sure this is sufficient though. Will a VPN protect the ssh connection from malice? Do I need an employee-pc firewall in addition to VPN to keep it hidden? Do I need to even care who can see the ssh tunnel if its accessed by public/private key? These are questions I have gut feelings about, but can't answer with certainty.
Maybe better worded: how would you connect an employee PC to business hardware securely such that business hardware/software/data are safe and hidden?
Any guidance would be appreciated.

I'm thinking that business hardware can be considered secure in a private network behind a firewall, whereby all incoming/outgoing connections are done via VPN.

The assumption that the business hardware has no connectivity apart from the VPN cannot be made in all environments. In some cases there is some form of captive portal which require non-VPN access first. There might also be polluted DNS caches or use of local DNS server. See this talk (presentation and white paper) from Blackhat 2020 for more.

What I'm more worried about though, are employee PCs. I'm currently considering a VNC client ...

This is even more tricky and there are a variety of approaches with different risks.
The most secure version is probably to temporarily take full control of the computer, i.e. essentially make it "business hardware". This can be achieved by booting an alternative OS from an external medium, typically a USB stick. To do this often some pre-configured Linux system is used. There are also companies which offer products based on this idea.
Mostly secure is also some kind of remote desktop, i.e. virtually sharing screen, keyboard and mouse (and maybe audio and local printers) with some remote computer or VM in the company, for example with protocols/applications like VNC, RDP, NX or even from within a web browser. One commonly exploited weakness here is the access control, i.e. such systems or often accessible from the internet with either no or weak passwords or the credentials can be retrieved with the help of very common phishing mails or if the access is used from a compromised system. Thus it is strongly recommended to have some kind of 2FA/MFA in this case.
Tunneling the remote desktop protocol inside some VPN and/or SSH can reduce the weaknesses of the protocol itself (like no or bad encryption, or bugs like this) and can also add additional authentication on top. It does not by itself reduce the risk of compromised credentials, so 2FA/MFA is still recommended.
Additional weaknesses with this approach occur if the client system is somehow compromised. Apart from grabbing the login credentials it can also do screenshots, hijack keyboard and mouse, make use of weaknesses in the sharing implementation for example by attacking channels for sharing audio or printing.
Less secure is the option to simply install a VPN client on the users system. Assuming that the users system is compromised this essentially allows an attacker an easy way into the company network.
And then there is the option to providing only limited access to specific applications, instead of to the full computer and network in case of RDP or VPN. For example it might be possible to limit access only to mail and to some specific business applications. Apart from access to applications which are in the cloud anyway (i.e. Microsoft 365, Google Workspace etc) various companies (like ZScaler, Cloudflare, Akamai) also offer limited connectivity to company-internal applications this way and also offer protection of the web traffic. To prevent credential phishing 2FA/MFA is recommended here too.


Practical usage of CRL(Certificate Revocation List) Does the CA need to mandatorily publish the new CRL file even though there are no new certificates that have been compromised since the last CRL published?
If CA needs to publish the CRL's periodically, how do I identity whether there are new records added to the revocation list or not?
If there are no new records added to the CRL, do I need to update my existing CRL file with the new one?
Is timestamping the CRL file a mandate or an optional feature?
Do All CA certificates need to use EKU(Extended Key Usage) set to CRLSign for the purposes of issuing the CRL's in the future?
Also, If the CRL validity is a week and published every Sunday, what would be implications on security if a certificate is compromised on Tuesday. As an end device, the next CRL will be only looked at after Sunday and so I would have accepted the connection from the compromised party for the last 5 days.

Does the CA need to mandatorily publish the new CRL file even though there are no new certificates that have been compromised since the last CRL published?

yes. CRL has fixed validity period determined by ThisUpdate and NextUpdate fields. After NextUpdate timestamp, CRL is considered expired and client application will return RevocationOffline chain validation status.

If CA needs to publish the CRL's periodically, how do I identity whether there are new records added to the revocation list or not?

by periodically checking for new CRLs and examining them.

Is timestamping the CRL file a mandate or an optional feature?

in practice -- mandatory requirement.

Do All CA certificates need to use EKU(Extended Key Usage) set to CRLSign for the purposes of issuing the CRL's in the future?

yes.

Also, If the CRL validity is a week and published every Sunday, what would be implications on security if a certificate is compromised on Tuesday

then this will be detected by clients no later than upcoming Sunday.

As an end device, the next CRL will be only looked at after Sunday and so I would have accepted the connection from the compromised party for the last 5 days.

it highly depends on client implementation. Most clients will cache once downloaded CRL for the CRL validity duration and won't download it again until it expires. Some clients, such as Microsoft CryptAPI client implements E-tag and Max-age HTTP headers that allow HTTP CDP endpoint polling without having to download CRL if it wasn't changed on HTTP server. Once new CRL is published to HTTP endpoint, E-tag will change and CryptoAPI client will forcibly re-download CRL, so detection of newly revoked certificates occurs faster. It is
Another option is to use Delta CRLs that include only revoked certificates since last Base CRL was published. Delta CRLs are meant to be smaller in size and can be published frequently, say every day.
Depending on use case, clients may utilize OCSP stapling (when we talk about online TLS connections), when TLS server obtains OCSP response for its own certificate and staple in response during handshake. But this vary between certificate usage scenarios (hence certificates are not only TLS, there are miriads of other usages).


Is it safe to handle trusted data in an insecure way? I recently found out that in java it can be very dangerous to deserialize data. See https://github.com/frohoff/ysoserial

In my application I'm saving the current configuration using serialization and deserialization. I did a test and modified the config file, and it indeed was able to start a process upon reading the config.

That config file is created by my application on the users harddrive. Can I consider it safe? I mean, it's trusted data because it was created by me. Why should a user hack him/herself?

So do I need to change my deserialization code, or can I leave it as it is?

The meaning of trust
The meaning of trusted is strange in computer security. If something is trusted, then by definition it cannot be harmful in any way. What you are probably asking is instead if data you create should be considered trusted or untrusted. Answering this would depend heavily on your particular situation. Specifically, what matters is not whether or not you would "hack yourself", but whether or not there is anything an attacker can gain by compromising the process that is insecurely processing the data.
One way to think about it is, would it be safe if your configuration file had an exec=some_command option that would automatically execute the command on application startup (which is not particularly uncommon)? If it would be safe, then there is no immediate security reason to safely handle input.
Read up, write down
There is a security model called the Biba Integrity Model. It is characterized by the phrase read up, write down. This means that a lower integrity level (lower privilege) should not be able to modify data that has a higher integrity level. In other words, you can read more privileged data, but you can only write to data that is less privileged than you already are. This integrity model is specifically designed to prevent a privileged process from trusting data that a less privileged process may be able to modify. Through this, you can see that the model permits a given user to modify configuration files of applications run by the same user, but it would not allow a lower user from modifying files operated on by a more privileged user. If data is considered trusted, it is exempt from restrictions. According to this integrity model, is your data trusted? Is there the potential for any undesired write up?
There are three properties governed by the Biba Integrity model. Taken from Wikipedia:

The Simple Integrity Property states that a subject at a given level of integrity must not read data at a lower integrity level (read up).

The * (star) Integrity Property states that a subject at a given level of integrity must not write to data at a higher level of integrity (write down).

Invocation Property states that a process from below cannot request higher access; only with subjects at an equal or lower level.

In other words, is the program parsing your data any more privileged than a program would need to be in order to modify the "trusted" data? If it is no more privileged, than an attacker cannot modify the data to elevate their privileges. The most they can do is get the privileges that they already have. This is why /etc/passwd is not owned by your user, but your media player configs are!
Caveats
There are a few other things you should think about before declaring that this is a fine idea. You must ask yourself if, philosophically and practically, writing knowingly insecure code is a good idea. If it is not excessively difficult to process securely, you must ask yourself a few things.

Will you remember, in the future, that your codebase is insecure, or might you re-purpose it?
Will anyone else use your code? Will they have the exact same threat model as you?
Will you ever run the application privileged, with configuration files writable by lower privileges?
Could the insecurely handled data result in confusing bugs if it is accidentally corrupted?
Do you feel comfortable getting used to writing insecure code? Is it a good habit to get into?


How can a web application protect users when the browser doesn't support HSTS? HTTP Strict Transport Security (HSTS) is a very useful feature at preventing OWASP a9 violations and attacks like SSLStrip which try and prevent the client from making a secure connection. This technology however isn't in older versions of web browsers(most notibly IE). In June 2015 Microsoft finally added support for HTTP Strict Transport Security to IE 11 on Windows 7, 8.1, and 10. Microsoft Edge supports it as well. Both of those will do HSTS pre-load for sites that are on the Chromium pre-load list. However not all users use the latest web browsers.

So how do you protect users with browsers that don't support HSTS?  What is the "best" level of transport security that a web application can provide despite serving content to an insecure client?

(Shout out to Tylerl for bringing up this question.)

You can't.

The best you can do is to use SSL sitewide.  Have all HTTP connections immediately redirect the user over to HTTPS (redirect over to the front page via HTTPS, e.g., http://www.example.com/anything.html should redirect to https://www.example.com/).  Don't serve any content over HTTP (other than an immediate redirect to your front page, over HTTPS).  Set the secure flag on all cookies (obviously).

This isn't going to stop a man-in-the-middle attack that downgrades the user to HTTP.  Without HSTS, you can't prevent that kind of attack.

You just can't do any better than that.  Oh well.  That's just how it goes with IE.

See also Options when defending against SSLstrip?.


Whitelist Simulated phishing landing page We are running a simulated phishing campaign and one of the landing pages has been blacklisted by google. If you try to visit it in chrome you get the big, red warning page "Deceptive site ahead" (works OK in other browsers).

I assume one of our users reported it, thinking it was a real phishing page (kudos for that!) but now we have the problem that other users who are clicking the links in the emails we send are seeing the warning and not continuing, so we are not collecting data on them, or testing to see if they would go further and enter their credentials. Most importantly, we are missing the opportunity to train users who need that training!

I followed the "report a detection problem" link last week but the domains are still blacklisted. This is my question:

  Is there a way to whitelist our landing pages with google and the other browser makers, so even though they look like phishing pages, they don't get blacklisted in the future?

Is there a way to whitelist our landing pages with google and the other browser makers, so even though they look like phishing pages, they don't get blacklisted in the future?

I think this would be a pretty bad idea. Just imagine if hackers could white list their public phishing pages this way.

If your control the way your users go into the internet you might use an internal DNS server which returns a different (local) IP address for the phishing domain for internal users. This internal site can then serve the phishing stuff while the external site is innocent. To make even more sure that it does not get blocked you might also try to use a top level domain which does not exist externally and is only resolved by your internal DNS server.


How can a website verify that my phone number belongs to me? I was signing into a Capital One credit card website that I hadn't used in a long time, and once I entered my user name and password, it requested my mobile phone number for additional verification.

I entered my number, and I was given a short, < 10 second waiting screen that said "We are contacting your carrier to verify your phone number".  It passed whatever that validation was and then sent me a typical text-message verification code that I had to enter to continue.

So, my question is, did they really contact my mobile phone carrier to verify my name or address (the only thing they know about me) based on my phone number?  Is this just security theater, or is there an API or database available where I can verify that a phone number does indeed have a certain name attached to it?

I've never seen this before and would like to understand how this system works, and how it's protected from abuse.

Is this just security theater

No.

  or is there an API or database available where I can verify that a phone number does indeed have a certain name attached to it?

The phone companies (ed: didn't used to, but apparently now they do per @ceejayoz) make this information public (caller registry is not reliable, esp. in cases where the name on the bill isn't the owner of the phone), but given the wealth of information marketing agencies and credit bureaus hoard, the information is absolutely out there-- it's just a question of whether anybody is selling it yet. Hell, even Facebook could offer such a service if they were so inclined.

But given what I've dealt with in this space in years past, it's more likely they're checking to verify the carrier itself. Fraudsters using burner phones to abuse OTP systems was a massive, massive problem that had yet to be solved while I was still there and we didn't have a reliable way to filter them out at the time-- yet simply knowing if we were dealing with a Verizon or Boost Mobile customer and performing additional verification for the latter before sending out texts would have eliminated a significant amount of fraud.


which encryption is used in this JS Variables Which encryption method is used for these variable names:

var g_license_info
var g_server_time_obj

Respectfully encrypted to:

var ago05b4e111efe149737a67a177f00ffad2
var agj54c415d499dcb6fb35b5fbb324ccaa6f

Both are 35 digits but I cant find which encryption is used.

The "encrypted" variable name is:

"a" + first char of original var name + last char of original var name + md5sum(var name)

so, given g_license_info:

$ echo -n g_license_info | md5sum
05b4e111efe149737a67a177f00ffad2  -
$

gives you "ago05b4e111efe149737a67a177f00ffad2".

Likewise, g_server_time_obj results in "agj54c415d499dcb6fb35b5fbb324ccaa6f"


Strange flood of requests to my web server About an hour ago, strange requests began showing up in my access logs. They are coming in at a rate of ca. 400 req/s and appear to come from IPs all over the place. It started out at a lover rate and has been increasing, which worries me. The requests look like this:

63.141.242.51 - - [17/Aug/2014:19:10:50 +0000]  "GET http://anx.batanga.net/tt?id=3011996&cb=[CACHEBUSTER]&referrer=[REFERRER_URL]&pubclick=[INSERT_CLICK_TAG] HTTP/1.0" http 200 0.000 612 "http://www.youdaoqii.com/news/014082324453123443.html" "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/4.0.211.0 Safari/532.0"
107.151.241.5 - - [17/Aug/2014:19:10:50 +0000]  "GET http://ib.adnxs.com/tt?id=3351132&referrer=yesshealth.com HTTP/1.0" http 200 0.000 612 "http://wwww.yesshealth.com" "Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.5; AOLBuild 4337.43; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618)"
67.198.137.236 - - [17/Aug/2014:19:10:50 +0000]  "GET http://anx.batanga.net/ttj?id=3289594&cb=[CACHEBUSTER]&referrer=[REFERRER_URL]&pubclick=[INSERT_CLICK_TAG] HTTP/1.0" http 200 0.000 612 "http://www.formerfinance.com/?p=1363" "Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.6; AOLBuild 4340.27; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
198.204.227.19 - - [17/Aug/2014:19:10:50 +0000]  "GET http://anx.batanga.net/tt?id=3087276&cb=[CACHEBUSTER]&referrer=[REFERRER_URL]&pubclick=[INSERT_CLICK_TAG] HTTP/1.0" http 200 0.000 612 "htp://www.canyouqq.com/news/2014/34457v0947608250480.html" "Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.6; AOLBuild 4340.17; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
198.204.231.173 - - [17/Aug/2014:19:10:50 +0000]  "GET http://anx.batanga.net/tt?id=3087276&cb=[CACHEBUSTER]&referrer=[REFERRER_URL]&pubclick=[INSERT_CLICK_TAG] HTTP/1.0" http 200 0.000 612 "htp://www.canyouqq.com/news/2014/344570947608250480.html" "Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.6; AOLBuild 4340.17; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
67.229.227.59 - - [17/Aug/2014:19:10:50 +0000]  "GET http://anx.batanga.net/tt?id=3253370&cb=[CACHEBUSTER]&referrer=[REFERRER_URL]&pubclick=[INSERT_CLICK_TAG] HTTP/1.0" http 200 0.000 612 "http://www.selfisheducation.com/walmart-scholarships-provides-students-with-millions-for-college/feed/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; 001|Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)"
107.151.233.52 - - [17/Aug/2014:19:10:50 +0000]  "GET http://ib.adnxs.com/tt?id=3351132&referrer=yesshealth.com HTTP/1.0" http 200 0.000 612 "http://wwww.yesshealth.com" "Mozilla/4.0 (compatible; MSIE 6.0; AOL 8.0; Windows NT 5.1; SV1)"

I found another question where someone seems to be getting the same kind of traffic:
Strange Apache access logs The conclusion seems to be that it is a scan for open proxies. But if this is a scan, shouldn't it come from a single (or a few) IPs? This appears to be something else, in my limited knowledge.

Can anyone confirm that this is just a scan or perhaps tell me what is going on?

I'm running nginx and while the traffic is quite a lot, it's not currently causing any problems.

I found this article, which seems to explain what's going on: https://wiki.apache.org/httpd/ProxyAbuse

I have modified the default host config to return http 444 now. Hopefully the culprits will realise that this is not an open proxy and just go away at some point.

E.g.:

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /usr/share/nginx/html;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;

        location / {
                return 444;
        }
}

Seems to work. 10 minutes after I inserted this, the traffic dropped considerably. I assume that the fact that nginx was responding with http 200 to the proxy requests, meant that the culprit thought it worked as a proxy (Even though it was just serving the default server page). Responding with an error must have tipped them off.


Does a PCI DSS category 2x device require the same physical security as a 1a/b? I am trying to further understand the scope of my environment.

I have a group of category 2x devices that are used to manage a category 1b device through a category 2a device.

I understand my group of 2x devices are required to comply with the controls 1.4, 2, 5 and 6.1

Does this group require the same physical security (Cameras, carded entry systems, etc)?

Disclaimer: IANAQSA

Question: Are group 2x devices required to comply to all PCI in-scope controls?

Short version: Not necessarily, but they could be... it's really up to the assessor.  The use of categories is a way to make more persuasive arguments to your assessor when you want to determine if a device needs to comply to specific controls or not.

Long version:

The category classification system that you're using - the Open PCI DSS Scoping Toolkit - clearly states:

We believe the Toolkit to be consistent with the spirit and intent of the PCI DSS.
However, the Toolkit is not endorsed by the PCI Security Standards Council in any way,
nor is it the product of an official Special Interest Group.

The PCI DSS itself has no concept of categories 1-3 or "infection"*.  This paradigm got thrown out there by people who were sick of dealing with the incredibly ambiguous "connected" definition of scope the DSS actually uses.  As far as the DSS is concerned, everything is either in- or out- of scope.  And if it's in scope, "...PCI DSS security requirements apply..."

So in pure PCI DSS terms, if it's in scope, all requirements apply.

And if you look at the table in section 6.4 of the Open PCI DSS Scoping Toolkit, you'll see that 1a through 2x are all "in scope":

But wait! If you go on to read the "Frequently Asked Questions" in Appendix B of the Toolkit, it directly addresses your question (but might not answer it):

10.6 The Toolkit repeatedly states that for Category 2x system components, such as administrative workstations, not all PCI DSS controls are applicable or necessary. How does one determine which controls are required?

The answer: if you look at the access a 2x device has, its limitations, and its compensating controls, then you can make reasonable arguments that certain DSS requirements don't need to be applied.  And if you can convince your assessor that you've got a good case, then you're all set.  (This is true of any category device, by the way, but you'll never convince your assessor that a 1a device should be exempt from DSS 3.4)

I encourage you to read through the Open PCI DSS Scoping Toolkit, especially 5.5, 5.7, 6, and 10 ("Appendix B").  The same message is repeated throughout:

Use the Toolkit to fine-grain scope,
Use fine-grained scope to reach reasonable agreements with your assessor.

For example:

10.3 Why doesn’t the Toolkit specify which PCI DSS control requirements apply for each sub-category?

The Toolkit states that all applicable PCI DSS controls are required for Category 1 and
2a system components and that no PCI DSS controls are required for Category 3
system components.

However, because every organization and CDE is unique, it would impossible to provide
more specific guidance on which PCI DSS controls are required for every type of
Category 2b, 2c and 2x system component. The Toolkit does provide the basis for an
organization and its assessor to discuss what the relevant risks are and the controls
required to mitigate them.

* Personally, I believe that the choice of the word "infection" to describe scope transition among connected systems was a mistake; I don't know all the politics involved, but I'm reasonably confident that the PCI Security Standards Council will never put their stamp of approval on a document that makes PCI sound like a virus.


Track specific IP over BitTorrent trackers I am wondering whether is possible to track specific IPs over some torrent trackers without collecting information about the whole tracker.

For example: http://iknowwhatyoudownload.com/en/peer/

They are parsing torrent sites to get torrent hashes, but it is possible to force tracker to send you torrent metadata the specific IP is seeding.

No this is not possible. You can only do the same thing as the site you linked and request peers for as much torrent hashes as you can and filter the results you get.

If you try to query trackers this way beware that some of them add random IPs into the peer list to prevent these kind of things. A tracker just returning an IP is no proof for that IP actually seeding / leeching that torrent.

Also a little side note about the link you posted: they do not only query torrent trackers or indexers but also the DHT, a distributed alternative to trackers.


Key length greater than block size I am new to infosec and am recently study cryptography. In AES, if i have 192-bit key to encrypt 128-bit block size, won't it only be using the first 128-bit of my 192-bit key?? So what's that extra 64-bit key used for and how does that increase security?

The key is first put through an algorithm called a key schedule, which splits it up and expands it into a number of 128-bit round keys. These round keys are always 128 bits in length, regardless of the size of the AES key itself. Each of these round keys are fed into the end of each single round of the block cipher using the XOR operation. AES128 expands a 128-bit key into 11 round keys, AES192 expands a 192-bit key into 13 round keys, and AES256 expands a 256-bit key into 15 round keys.

The internals of the AES algorithm are described excellently in A Stick Figure Guide to AES.


DDoS attacks targeting Android I am currently studying some Android topics and I've been having difficulties finding answers regarding DDoS attacks.

My question is:
Are Android devices vulnerable to DDoS attacks or does Android provide some kind of protection for this?

I understand that there is very little gain in doing such attacks, but I just want to know if it is possible.

Android devices are vulnerable to DDOS attacks. The Android Operating system does not contain any special protection against DDOS attacks. (However, DDOS attacks are typically aimed at web servers with the intent of preventing legit users from accessing them and Android OS is not used as a web server, so you are unlikely to find a DDOS against it)

In general, DDOS attacks cannot be blocked by the targeted device. DDOS protection for a website or network tends to be in the form a robust network to handle the increased burden of the attack while maintaining normal functions.


Generate public key from private key Can we generate a public key from a private key?

By default, a user’s SSH keys are stored in that user’s ~/.ssh directory. You can check if your private key is in that directory by listing the contents:

$ cd ~/.ssh
$ ls
authorized_keys2  id_dsa       known_hosts
config            id_dsa.pub

The private key is usually something like id_dsa or id_rsa. To regenerate the public key part with just a private key, use the -y switch to the ssh-keygen application and write the output to a corresponding .pub file:

ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub

From the 'man ssh-keygen' description:

 -y      This option will read a private OpenSSH format file and print an
         OpenSSH public key to stdout.

If you don't know whether your private key is Digital Signature Algorithm (DSA) or Rivest Shamir Adleman (RSA), you will have to use the ssh-keygen application with the -f switch. Make sure the name of your new public key matches the name of your private key.


Shared vs unique credentials for remote support vendor accounts I have a situation where my employer has a support contract with a vendor for an application we use. This application runs on a (Windows 2008 R2) server that does not store or have access to any information that I would consider to be business confidential or requiring strict security such as credit card, PII, or health-related records. This vendor has support personnel who support hundreds of customers with this type of system.

The question relates to whether or not to force each vendor support contact to have their own credentials for accessing this system via VPN and RDP, or to allow them to share a single generic vendor support account. So far we have created individual user accounts for two of their support contacts.

The vendor is requesting a shared generic account for VPN and remote desktop access instead of individual accounts to help expedite support. Our IT security department understandably does not like this because it makes auditing access and actions difficult if we cannot tie it back to a specific person. On the other hand, I can see the vendor's point of view where they have hundreds of customers and many different people doing support. If each support associate needs an account on every customer's system that is a huge credentials management headache for them.

I can also see situations where remote support is going to be delayed with inevitable password expirations, account lock outs, and so on because a specific vendor support associate only logs on to systems rarely.

Are there best practices for addressing this type of situation?

Does the answer change if other systems in the enterprise, unrelated to this particular system, do contain data which must be kept highly secure?

Yep.  My compensating control of choice would be to modify your SOW so your vendor needs to maintain netflow or other logs capable of identifying which of their people initiated a connection to your network, and maintain those logs for a period of X, which matches your security group's log retention policy.  Require this log to be available upon request.

You maintain the audit trail while dealing with the business need of simplifying vendor account management.  And you don't add any work on your side of the contract.


Is + as an alternative to %20 an attack vector? I was reading a Q&A on enabling + characters in URLs for Sitecore CMS, and the answer states:

  ASPNET application does not allow using “+” from the security point of view e.g. preventing SQL or JScript attack via URLs.

Essentially a url such as http://example.com/foo%20bar is allowed in the system, while http://example.com/foo+bar is not.

I have never heard of + characters being used as any sort of attack vector for SQL injection or XSS, but that doesn't mean that there isn't one.

Is + as an alternative to %20 an attack vector of any sort?

NOTE: I've tagged XSS and sql-injection because they were called out explicitly in the article

Just for reference: http://host/path?query

The + symbol is somewhat problematic in URIs, this is because it is interpreted differently by different URI encoder/decoders. It is always interpreted as a space if it occurs in the query part of the URI (everything after the ?), however whether it is interpreted as a space if it occurs in the path part of the URI is down the the decoder used.

Your example uses the path section, and the answer will depend upon precisely what decoder you are using. Most of them will not decode + to space when it occurs in path, but you don't know until you try with your specific decoder. This is exactly the type of nasty sanitisation-bypass that can bite you :P


How to inject executable, malicious code into PDF, JPEG, MP3, etc.? I wanted to know if its generally possible to inject executable code into files like PDFs or JPEGs etc., or must there be some kind of security hole in the application?
And if so, how would one do that?

I often hear that people get infected by opening PDFs that contain malicious code, that's why I ask.

There must be some security hole in the application.

Think like any very-simple-and-common .txt file: if you open it with an hex viewer, or with a well-designed textpad editor, it should only display the file content, and ok.

Then think about of processing the file, somehow, instead of just showing the contents. For example, reading the file and interpreting it's values. If it isn't done correctly, this could lead to execution of the bytes that are inside the file.

For example: if you have designed your app to load the whole file and show it, but somehow you have a variable inside your program that only holds 256 bytes. This could make you read (and write to memory) more bytes than your app expected. And, imagine, inside your app there would be any command to jump to position NNNN in memory and execute what is there, but since that memory position was written with data your program didn't expect, then you'll execute some code that shouldn't be there, and was loaded from your file...

That was a buffer overflow attack.

The same could happen with pdf, jpg, mp3, etc, if the app didn't load the data correctly.

Another possibility: for any other reason, the app (or some DLL it loads to read your data) executes some part of the data, instead of reading it. If you know what would be the command (or the data) that would trigger this behavior, you put those commands inside the data file (like the pdf file) so that the app executes it.

PDF virus: read this site: http://lwn.net/2001/0809/a/adobe-pdf-vul.php3 to know a bit about one virus that spread using PDF files.


Identify if a certain domain is using Office 365 or Google Mail I have a list of e-mail domains that i wanted to confirm if they're using Office 365 or Google Mail for mail. Checking MX using Nslookup can do the job but I noted that a few companies will use an anti spam service as their DNS MX and then redirect to the Mail service MX, obfuscating the Email server itself. Anyone know any way to identify what is behind the Mail exchanger and also if its Office 365 or Google?

If you have access to email sent from those domains, the headers will contain a wealth of information that will help you determine where they're hosted.  The downside is that, unlike poking at their public MX records, you'll need to get actual email from someone there in order to get headers to examine.

The Received header of is prepended to the message by each mail server to handle your message.  If you find entries like this, that's an indication it comes from an Office365 user:

Received: from BY2FFO11FD003.protection.gbl (2a01:111:f400:7c0c::150) by
 DM2PR07CA0012.outlook.office365.com (2a01:111:e400:2414::12) with Microsoft
 SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Mon, 15 Feb 2016
 07:05:08 +0000

(Remember that Received: headers are prepended... the ones closest to the top are your mail server; the ones farthest down in the header block are closest to the sender)

Also, Microsoft tends to be verbose in their use of X- headers:

X-MS-Office365-Filtering-Correlation-Id: 1d91711e-ed71-457b-940d-08d335d6569e
X-Microsoft-Antispam-PRVS: <CO1PR07MB9408BD5A137BB4D0DD62AD9F6AC0@CO1PR07MB940.namprd07.prod.outlook.com>

Gmail users, on the other hand, are going to route through Google.com mail servers:

Received: by mail-qk0-f174.google.com with SMTP id c73so160486949qkg.2
        for <gowenfawr@example.com>; Mon, 20 Jun 2016 06:09:04 -0700 (PDT)

And there are other headers you can expect will indicate Gmail:

X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-transfer-encoding:mime-version
         :subject:message-id:date:to;
        bh=r/jgn896D9B3/dGqTvjA6Oypoq6NXeS9bZtz6pRcJVM=;
        b=V7bSJBRm/pZEAA3eYQ+6bRouRLOReIPeLxHuweA7vk0/nFs+qW8NCOC5Cm3SfYBFXH
         IcYgRDWaxu4ckR3K5Nd6MGRxil2Rdcf/mSoJp2ODgrdIPqwS9KQl3lA/1VsngRk1VE0I
         in/g1XY/z08KOMZHjJlD8X7TXNSxvtBC/CpfaXsll1AZ690qvuvF1oV5JfZrxv3TflHb
         TFWpkxkRVlKXD9uMsKkyNUiOhP654NMtRDAEhZL8ZlrytYX654OtoqkxblGGhUtcnvap
         9vEliKWJzZ4WnzZ9lPbqDmffEJ52R4pYFCfkPzlycZ3qQd/AyXz3qGFfKYQG/s1qFyr2
         MEug==
X-Gm-Message-State: ALyK8tKapGupKvgAgZijc99P8ZvHpBqDPU3gNZLUw+bow15vQEcL4HYQNx19EMxYLRHKBQ==

Now, if a domain is sending their email to an anti-spam service which then forwards it to Google, then presumably the Google mail servers will accept mail for that domain even though the MX records do not point to it.  You can test for this by connecting to the Google mail exchangers on port 25 (SMTP) and testing if they'll accept email for the domain in question using simple SMTP commands (helo, mail from, rcpt to, quit).

I don't know a domain which follows this pattern (MX=anti-spam then -> Google) but here's an SMTP transaction that will show Google willing to accept email for the domain 'stackexchange.com' (which is truly hosted at Google):

$ telnet aspmx.l.google.com 25
Trying 74.125.28.26...
Connected to aspmx.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP e14si35146749pap.172 - gsmtp
helo pool-10-1-2-3.bstnma.fios.verizon.net
250 mx.google.com at your service
mail from: <yourname@pool-10-1-2-3.bstnma.fios.verizon.net>
250 2.1.0 OK k9si37945038pfj.91 - gsmtp
rcpt to: <postmaster@stackexchange.com>
250 2.1.5 OK k9si37945038pfj.91 - gsmtp
quit
221 2.0.0 closing connection k9si37945038pfj.91 - gsmtp
Connection closed by foreign host.
$

The "250" response after the "rcpt to: " tells you that Google is willing to accept mail for example.net.

In contrast, here's the same sort of test with a domain that Google doesn't manage mail for, 'play4kd.com':

$ telnet aspmx.l.google.com 25
Trying 74.125.28.27...
Connected to aspmx.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP xi11si6702300pac.134 - gsmtp
helo pool-10-1-2-3.bstnma.fios.verizon.net
250 mx.google.com at your service
mail from: <yourname@pool-10-1-2-3.bstnma.fios.verizon.net>
250 2.1.0 OK xi11si6702300pac.134 - gsmtp
rcpt to: <postmaster@play4kd.com>
550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1  https://support.google.com/mail/answer/6596 xi11si6702300pac.134 - gsmtp
quit
221 2.0.0 closing connection xi11si6702300pac.134 - gsmtp
Connection closed by foreign host.
$

In this case, the "rcpt to: " command was followed by a "550" failure code, indicating that Google will not accept mail for this domain.

Now, this isn't a perfect test.  In my testing some domains that are presumably not hosted at Google, like microsoft.com, would have been accepted by Google.com.  But it might be better than nothing.


When is it worthwhile to pursue a hacker? With respect to "interactive" attacks by individuals, wherein an attacker gains access to a remote system and an IP address is necessarily exposed to the target system, is it at reasonable to pursue the attacker by contacting the IP-owner's ISP?

Should I feel significantly impeded in my pursuit by the possibilities that ...

It may be less expensive to perform damage control and try to plug the hole.
The attack probably comes from a country that wouldn't cooperate with an investigation.
Attack proxies simply that bulletproof!
Attackers tend to avoid attacking from home.

Is there a damage/cost threshold that would make pursuit worthwhile?

Is there a relatively standard or productive manner in which companies (or individuals) deal with attacks on a legal level?

is it at reasonable to pursue the attacker by contacting the
  IP-owner's ISP?

Most likely not. Any moderately skilled attacker would simply steal someone else's wifi or use a proxy. You can then contact that proxy's ISP which is probably located somewhere in Togo and you will never get a reply. If the attacker sets up servers for backdoors and alike, they will be either temporarily or also hosted abroad.

  Is there a damage/cost threshold that would make pursuit worthwhile?

Yes but that threshold is really high. Even when the damage is staggering, pursuing someone over the internet is neither really effective nor is there any hope to get for example stolen assets back. One big reason why cybercrime is so profit-yielding is the fact that it's hard to track down the attackers.

If the source of the attack is from another country (Russia, China), you have absolutely no chance to catch the attacker. Of course, the same applies many other countries.

  Is there a relatively standard or productive manner in which companies
  (or individuals) deal with attacks on a legal level?

Yes, at least in Germany. This is highly depending on the respective national framework of course. Here, critical infrastructures have a central office to report cyber crimes to and get external help, but pursuing the attacker is usually beyond the scope of the investigation. Companies even have to report certain attacks to the police.

As a private individual however, you will most likely only be able to complain to the police. And the police is completely incompetent in that regard.

Almost all methods against cybercriminals are mitigation and prevention, since tracking someone down who attacked from abroad is borderline impossible.


Question About HTTPS Security I recently read about how HTTPS work and I have some questions to clarify. Pardon me if this sounds silly but I just need to get this clear. Correct me if I am wrong.

I got to know that as part of the beginning of TLS handshake there is a asymmetric encryption where public key from the Certificate is used to encrypt the client generated key before it is sent to the server and only server can decrypt it using its private key.

But subsequent messages (HTTP requests) use symmetric encryption with the client generated key and both client and server use this key to encrypt and decrypt application data.

There is a famous theory in cryptography saying "Repetition is not good" where if a single message is repeated in a encrypted message it is easy to crack it. If this is true all messages encrypted using client generated key will have HTTP/1.x in it as it is part of both HTTP request and response.

So in theoretically a Man in the middle with this knowledge can possibly find patterns in encrypted HTTP requests and responses and find out HTTP/1.x string in those and brute force to generate the client key which was used to encrypt these messages.

Am I correct or is this utter non sense, any answer or guiding would be highly appreciated.

First, a couple of points.

In any cryptographic system that does not provide information-theoretic perfect secrecy, the key can always be brute-forced.  One of the key components of determining whether a cipher is secure is whether or not it is feasible to brute-force keys, and if it is, the cipher is not secure.  So, brute-forcing the key isn't an issue.
Leaked information about the plaintext does not necessarily compromise the key.  It compromises security for sure, but knowing that the ciphertext of two messages does not mean that you learn anything about the key.  So, while brute-forcing the key is still always possible, this doesn't give you any advantage. It's still just as hard to determine the correct key as if there were no duplicate ciphertexts.

The canonical example of this flaw can be found in using a block cipher in ECB (electronic code book) mode.  In this mode, each block of plaintext is directly encrypted using the key, so if there are multiple blocks of plaintext that contain the same data, they will result in identical blocks of ciphertext. It's easy to tell that they're duplicates, which is exactly what you're concerned about.

The way that we fix this (and the mechanism that is also implemented in TLS (HTTPS) block ciphers) is to add an additional component of randomness, called an initialization vector.  This is a non-secret random value that is introduced into the encryption process, and is different for every encrypted message.  Because the key and IV are now unique for each message, the ciphertext will also be unique, even in the case of two identical messages.  As long as you never reuse an IV with the same key, there will be no pattern to detect, and an attacker will never be able to determine that two messages are the same.


Two-factor authentication Without Mobile Phone Two-factor authentication is based on the notion of “something you know” and “something you have”. Is it absolutely necessary for having your mobile phone involved in two-factor authentication, which is used by all the big companies, like Google etc.?

Instead of relying on a third-party device, why can't the existing alphanumeric text password be modified so as to provide increased security. What if a single factor authentication would provide the security as a two factor would do.

I have developed such system, which basically combines a simple image-based challenge and normal text password in one step.

Update from comments:

The system locks the account if the text password is correct but the image number is wrong for 3 attempts. The account remains locked until original user unlocks it. In real-time, I will add a link where the original user can unlock the account by using a secondary email or mobile.

The image number is a 2-digit number. On an average if the normal password length is 8 digits, then the total length would become 10 digits, making highly time consuming for brute force attack. Also I'm using a grid of 4x7, total 28 images, so user wont have any problem in finding his image

The images are NOT same for different users, they are randomly selected by the system from large database of images while creation of account and the system requires the normal password to be at least 8 characters.

Would this idea be acceptable in real-time situations?

First off, the solution you describe in your blog post is not two factor authentication. You have two 'something you know' factors: your password and your special image.

(edited with updates to answer the extended question, 'can single factor authentication provide the security of multifactor authentication.'

Second, there appears to be some confusion about what authentication factors are. Authentication factors are 'something you know,' 'something you have', and 'something you are'.  Something you know is something that you store in your brain.  Passwords are the most common example, but it includes anything and everything that relies on your memory to know.  You use your brain to remember your password. You use your brain to remember what image you selected.

Something you are refers to stuff about you that is inherent to you being you. Biometrics Are the most common example here.  Your retina shape, your finger print, etc.

Something you have is a physical object in your possession.  Examples include mobile phones, hardware tokens, certificates, printed challenge response 'bingo' cards, your car, etc.

You only get multi-factor authentication when you combine something you know, something you have, and something you are.  You do not get multifactor authentication when you combine multiple elements of the same factor.  A password and securid token combined make for multifactor authentication, because you know one and have the other. Two passwords combined makes single factor authentication because you know both. A password and pre-selected image combined is single factor authentication because you know both.

Third, no, single factor authentication does not provide the same security as multifactor authentication, no matter how hard you try. Different factor, by their very nature, provide different assurances.

Something you know is easy to remember - it must be in order to scale across many users. This makes it easy to provision. You don't have to physically distribute anything like a hardware fob, just ask people to remember a password. It's easy to forget a password and require reprovisioning. It's also somewhat hard to steal, since you can't dig into someone's brain and just take their memory, but theft does not require proximity (monitoring network traffic is enough to steal a password), key loggers work against it, and it's hard to detect that it's stolen. It's also easy to replace - just set a new password and be done.

Something you have is something you carry with you. This makes it harder to provision, since you now have to physically distribute a piece of hardware to everyone (or the equivalent with certificates), though this may be possible with mail or trusted courier. It typically requires expensive infrastructure, though cell phones carried by everyone mitigates that cost. It's easy to forget your hardware device at home, or at the main office during travel, etc, which requires backup infrastructure for temporary provisioning. Something you have is easier to physically steal, though now it requires physical proximity to take your hardware device out of your pocket.  It's easy to detect that tit's stolen, since it is no longer in your possession. It's hard to replace, since you must re-provision with that expensive process.

Something you are is hard to provision - you need special, often expensive equipment to collect biometrics from your users. Your users may find that creepy, and might resist collection. You need physical proximity to collect samples. It's impossible to forget to bring biometrics with you - they are you! Depending upon the biometric, it can be difficult or easy to steal, but it's never secret.  Your dna is left everywhere, fingerprints are left everywhere, retina is temporarily anywhere you look.  Something you are is impossible to replace. You have two eyes, 5fingers (unless you have a birth defect or lost one or more fingers in an injury) and can never get new ones, so if they are compromised you cannot be reprovisioned new credentials. Nor can you get new credentials of the same type if you lose them all - if you lose both hands, you have no more finger prints.

You get strength by combining multiple factors, because this offsets the weaknesses of one factor. With only something(s) you know, you only get the strengths of what you know.  Add some hardware that you have, and now theft becomes obvious at the expense of cost and usability.

Fourth, Yes, you can use things other than your mobile phone for multi-factor authentication. Phones are just used a lot because they are with everyone and don't require carrying a separate physical object, like a watch, hardware token, cardboard challenge card, etc.

Fifth, your solution sounds very much like passkey (based on your blog; I was not willing to provide my email to sign up for your service). I believe I've heard of this solution in another product as well. Are you sure you haven't recreated someone else's work? Are you sure your solution is devoid of patent challenges?

Sixth, your solution may well have many issues. Just off the top of my head, in about 10 minutes, here's a starting list...

If you do not always show the same set of images, the attacker can simply try to authenticate many times and watch what images don't change.  One of them must be the right one.
If you do always show the same set of images, the attacker can try them one at a time
If you show too many images, it will reduce usability. If you don't show enough images, the picture effectively adds no security.
If the real image is located in the same location for every user, or in s predictable location for each authentication (like using rand() to choose the location), the attacker won't even need to know the image, they will just need to predict the next location and enter the location id.
The images are 'public' in that they are always shown pre-authentication, after being shown an email address.  If a user uses the same image at multiple sites, so s/he can remember it, and those sits show different images on the challenge page, this helps the attacker - only the images common to both sites are likely to be the correct one.
A naïve solution following your description allows the attacker to enumerate all valid accounts by presenting the challenge if the email is entered. What happens if the account doesn't exist? Are random images shown every time? Just like number 1 of this list, if all images rotate off the selection list at some point, the attacker will know that the account doesn't exist.  You need to do the math to demonstrate that the performance is low enough compared to the size of the userbase that a system-wide brute force attack will not be successful in a reasonable amount of time, or you need to not leak logins.  Since your solution doesn't exist on s system yet, and is meant as s general purposes solution, you cannot predict the performance of the target server which makes your solution very difficult to prove username enumeration happens to be safe.
Because you are using images, you cannot prevent shoulder surfing on the set of images. This needs to be evaluated for impact to your solution.
Are you preventing shoulder surfing against the selected image entry field?
If you lock out accounts due to bad authentications, you present a denial of service attack against the system. You also only slow down an attack, not prevent it. Once you unlock the account, the attack can begin again.
I saw no mathematical proof of the strength of your visual-password solution. Without such proof (which is not hard to do, given the attack optimizations herein) your solution is be default not trustworthy.
What prevents the user from selecting a password that represents the image? For example, the password "trees" for an image of trees? Not addressing this will make for a new and interesting optimization for the attacker.


What does Technical Constraint and Organisational Constraint mean in terms of Internet Security Management I am on an essay with regards to the following topic:

  Information security management involves challenges that are
  essentially unique due to the combination of technical and
  organisational constraints. Identify two such challenges and discuss
  in depth how these can affect the way information security management
  is performed within an organisation.

I am uncertain of the items that I will need to include.

May I request for some examples of technical and organisational constraints?

Thank you

A technical limitation could be lack of processing power to perform a specific task, for example if you work for Yahoo Mail and you can't digitally sign every email then this can be seen as a technical limitation.

An organisational limitation could be not being able to use smart cards because the company culture does not allow such an authentication mechanism


SSLv3 or SSL Certificate Version 2? Below is the SSLScan output, what does it mean with SSL Cerficate Version 2?
Aren't SSLv3 and SSL Certificate Version 2 the same?

=======================================================================
Prefered Server Cipher(s):
SSLv3 256 bits AES256-SHA
TLSv1 256 bits AES256-SHA

SSL Certificate:
Version: 2
Serial Number: -4294967295
Signature Algorithm: sha1WithRSAEncryption
Issuer: /O=VMware Installer
Not valid before: Apr 18 09:21:53 2011 GMT
Not valid after: Oct 17 09:21:53 2022 GMT
Subject: /C=US/ST=California/L=Palo Alto/O=VMware, Inc/OU=VMware ESX Server Default Certificate/emailAddress=ssl-certificate...
Public Key Algorithm: rsaEncryption
RSA Public Key: (2048 bit)
Modulus (2048 bit):
****************************************...
****************************************...
Exponent: 65537 (0x10001)
X509v3 Extensions:
X509v3 Basic Constraints:
CA:FALSE
X509v3 Key Usage:
Digital Signature, Key Encipherment, Data Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Subject Alternative Name:
DNS:localhost.test.com.sg
Verify Certificate:
unable to get local issuer certificate

If I interpret your answer correctly you mean this part of the output:

SSL Certificate:
Version: 2

This version string is not the same as the SSL version. It shows which version of X.509 is used. SSL certificates use X.509. There are three different versions of X.509. The certificate has to claim what version it uses. So you'll find this Version: field in the certificate. The most recent version is 3 and this is the most used version. X.509 version 3 defines extensions. So for example, they are used for certificate chains. See the Wikipedia page on X.509 for some further explanations on the format.


What is the difference between a payload and shellcode? I am new to penetration testing and I would like to know the differences between these two things:

Payload (reverse TCP vs. bind shell)
Shell vs. Shellcode

Any help?

When exploiting an application, the payload is the code that the attacker actually wants to execute. It's the part that not just serves the purpose of leveraging the vulnerability itself, but does whatever the attacker considers useful.

When choosing a payload, an attacker typically wants code that starts them a shell. A shell is the program you interact with on the command line to control your OS (on Linux you might be familiar with the Bourne shell or Bash).

A payload that starts a shell is referred to as shellcode. But note that you will eventually find payloads that don't start a shell sloppily called shellcode, too.

A bind shell is a program that binds itself to a port and listens for incoming connections. Since opening a port attracts attention and because the attacker might often not be able to reach the port from outside the network, there is an opposite concept: A reverse shell doesn't wait for incoming connections but connects to a specified address and port itself. That is, the attacker waits for an incoming connection by the compromised server instead of initiating the connection themself.


Erasing encryption (LUKS) keys before suspend-to-RAM? I recently had been wondering if there is a way to erase my LUKS keys from RAM before I suspend my device (usually a laptop) to S3 mode. I am interested in a solution that would work for my / partition. The way I imagine this, I'd like my system to ask me for password again when I resume it.

If such a solution does not exist, I'm wondering if a VM-based one would work. Before suspend, the VM would also be suspended (on in some other way paused), a debugger would look for the LUKS private key, save it to some secure location, wipe all its occurrences from RAM and on power resumption, decrypt the secret using the user's password and restore it to all saved offsets. The same could probably be done with GPG/SSH/Bitcoin keys. Would this be a secure approach? If not, why?

The solution is called "Hibernate" or suspend to disk.

By design, suspend to RAM wakes instantly, and is intended more as a power-saving mode than a version of "switched off".

Software can get notifications that suspend-to-ram is about to occur, and things like Password Safe programs should - and typically do - automatically clear their keys. You could readily alter e.g. SSH clients to do the same, if they don't already.

However disk encryption programmes cannot necessarily do this, as files open on those disks may need to be accessed as part of the resume process.


Root The Box - easy CTF framework I am planning to host a CTF contest in a few months at my local university. While searching for some hints I met this wonderful tool called Root The Box.

It basically gives you all you need to host a CTF, including scoreboard, bots, flags and integrates all boxes and databases. Since it is designed for begginers, it should be no hard to use.

Well, I followed the wiki 2 and everything seemed to be working, until I tried to authenticate. It keeps telling me the game has not started yet.

Everything is set to localhost, including server and database (just want to try it first).

Still, it seems to be pretty interesting. Has anyone ever tried it? Any hints on what am I doing wrong?

Got it working a little after asking here (shame on me). Root The Box is configured to devel mode by default. So, after configuring your files you have to set it to production mode.

./rootthebox.py --setup=prod

And yes, you do have to be an admin user so you can start the game after loggin into your account. Damn, I lost so much time with it! Hope it can help someone someday.


Does "heartbeat extension disabled" mean that the site was previously vulnerable? One of the services I use is saying they were unaffected by heartbleed. But when I check their site with the tool at http://possible.lv/tools/hb/, this is what it says:

Looking for TLS extensions on https://xxxxxxxxxx

ext 65281 (renegotiation info, length=1)
TLS extension 15 (heartbeat) seems disabled, so your server is probably unaffected.

I was under the impression that heartbeat was previously considered benign, and people have only been disabling it in the past couple of days if they didn't want to upgrade OpenSSL. Is there any reason a server might have had it disabled all along?

Alternately, is it possible that the tool could be returning this response if they're using different SSL software that never had heartbeat available? Is there a way I can get more complete information on this?

No. "Disabled" means here that the client announced support of the heartbeat extension, and the server failed to respond with "hey, I know that one too ! Let's heartbeat together !".

This term does not mean that the heartbeat extension was supported, but then removed in some way. This information is not accessible from the outside. All that can be known is whether the server currently appears to handle heartbeats, or not.

Since Linux distributions promptly pushed fixes through normal security update mechanisms (as befits the case), it is expected that any decently managed server has been fixed by now, or soon will be. Servers which have the bug and keep on having it are servers which are poorly maintained, meaning that they quite probably already have bigger security holes.


No handshake recorded from airodump-ng I've just started to attempt this by following the guide from lewiscomputerhowto. I've seen other people ask similar questions, but they all seem to be older threads. The steps I've taken are shown below.

// Disconnect from all wireless networks.
sudo airmon-ng
// This will show all devices available for monitor
sudo airmon-ng start wlan0mon
// Should state that your wireless device has monitor mode enabled)
// if not use the following steps
sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode monitor
sudo ifconfig wlan0 up
// end of troubleshoot
sudo airodump-ng wlan0
// Identify desired network from the ESSID. Copy the BSSID of target.
sudo airodump-ng -c 6 --bssid AP_MAC -w /home/luke/Desktop/airodump/ wlan0
// Identify bssid and associate which is marked under station
sudo aireplay-ng –0 2 –a AP_MAC –c CLIENT_MAC wlan0

This results in this feedback without mentioning a handshake has been recorded.

21:22:43  Waiting for beacon frame (BSSID: AP_MAC) on channel 6
21:22:44  Sending 64 directed DeAuth. STMAC: [CLIENT_MAC] [ 4|10 ACKs]
21:22:45  Sending 64 directed DeAuth. STMAC: [CLIENT_MAC] [ 1|11 ACKs]

Am I doing this incorrectly, or any advice on how this can be accomplished.

Use a wireless sniffer or protocol analyzer (WireShark or airmon-ng) to capture wireless packets. Sniffing this way is similar to how attackers sniff wired networks to eavesdrop and capture information sent across a network.
Wait for a wireless client to authenticate. WPA wireless clients authenticate with WAPs using a four-way handshake where they exchange information. Essentially, the client needs to prove to the WAP that it knows the passphrase. However, the client doesn’t send the passphrase in cleartext. Instead, the four-way handshake allows the client to encrypt the passphrase in such a way that the WAP can decrypt it and verify that the client has the correct passphrase.
Use a brute force attack. Once attackers have the encrypted passphrase from the captured four-way handshake, they can launch an offline brute force attack. Automated tools such as Aircrack-ng compare the encrypted password in the capture against passwords in one or more password files. When successful, it gives the attacker the actual passphrase used by the WLAN.

The first thing we need to do is to turn our network adapter (wifi network adapter) into monitor mode, this will enable us to see wireless beacons sent across the airwaves even though it’s not actually associated with any access point.

Now, to know what is the adapter we have just type ‘iwconfig’ on the terminal. The image below shows us that we have wlan1 as our wifi adapter. There’s no associations as of now.

To make wlan1 as our monitor mode we execute this command on the terminal ‘airmon-ng start wlan1’ (refer to the image below)

Check it if it is now on monitor mode. ‘iwconfig’

Now, we’re going to dump all the SSIDs found by our monitoring adapter. We use ‘airodump-ng mon0’, what this does it will look for those SSIDs that are being broadcast and dump those information on our terminal.

Sample Output:

Look for the ENC tab and see if there are WPA encryption.

Note: WPA2 is more stronger than WPA and it might take years to crack those things.

Look for your targeted Wi-Fi.

Do this code below.

-c -> this one is for the channel (in this case it’s 1)

-w -> write (in our case we dump it to wpa2 file)

–bssid -> our target’s bssid

mon0 -> monitor adapter

Now that we have completed the 1st step (Sniffing). We’ll proceed to the 2nd step (Wait for a wireless client to authenticate).

Well, there’s an automated way to do that otherwise you’ll just be waiting for a miracle.

We use ‘aireplay-ng’ which is an injection attack. This forces a re-authentication packet into the wire.

‘aireplay-ng -0 10 -a [BSSID’s MAC Address] -c [Client’s MAC Address] mon0 [optional]’

-0 10 -> it’s going to try 10 times; 0 it will not limit the deauthentication attempts

-a -> BSSID’s MAC Address (Wi-Fi)

-c -> Client’s Mac Address (You may find this one on a packet capture -> Wireshark.) If you know someone’s MAC you can try it just make sure it’s associated with the AP, or if you can’t it’s ok, it’s just more effective if you have a Client’s MAC.

mon0 – monitor adapter.

Wait for a ‘WPA Handshake’ to pop up on our airodump.

Notice it? on the upper right corner of the image? Yeah!  Now, cancel all the dump and deauth, we’re ready to CRACK!

Now, navigate your way to the file we written earlier, the ‘wpa2’ one.

See the highlighted one?

Now we will run ‘aircrack-ng’ against the dump file we gathered earlier.

‘wpa2-01.cap’-> is the file

-w -> this is going to point to our passwords file (A Dictionary of Passwords).

Now press Enter.

This is step 3 people (Use a brute force attack.). We’re trying to crack the password now. It runs through the dictionary for a match.

Sample Output:


How should we set up domain administrators? We're a small company that is growing pretty fast. For a long time there were 2 of us that were domain administrators. But over the past 2 years this has increased to 6 people and this strikes me as a bad idea as we grow further.

The direct cause of my query is this question. That solution requires that the domain admins that set access rights are fully trustworthy. And that only those trustworthy people can set the policy that restricts setting these access rights to the 2 people.

So, assume we have 2 people that are 100% trustworthy that have full domain admin rights. But these 2 people will rarely be doing the actual domain admin work, just the things we specifically want to restrict to just them.

For a company of 50 - 200 people, is there a common/recommended way to set this up? How best to do this and what rights are generally restricted to the 2 fully trusted people?

A possible solution:

have two administrative accounts

one of them has a random password which is written down, sealed and stored in a safe place outside of the reach of the admins
the other one can be used only though two-factor authentication, one of the admins gets the password and the other one - the certificate

set up privileged accounts for normal administrative operations, shared between these admins (and more, if needed) together with strong auditing.

You now have a situation where

normal admin tasks are handled by selected people, what they do is tracked and they cannot modify these logs
exceptional admin tasks are handled by the two admins at the same time, when they are together
in extra exceptional cases you can get to the safe/bank, get the sealed enveloppe and access a full-fledged admin account.

You need to account for disasters (someone, or some people are not available) and for conspiracy scenarios (the two admins work together against you)


In a TOTP implementation, does there need to be an expiration policy for the user's secret key? Background

We're starting a project to add an additional authentication factor to our web application.
This involves the creation of a TOTP (Time-Based One-Time Password) token that conforms to RFC 6238 (http://tools.ietf.org/html/rfc6238).
This token will be delivered to the user via SMS or email.

I'm aware this approach is not ideal from a security standpoint (eg. Eurograbber, Sandroid, Emmental).
I'm hoping to steer our organization to evaluate other options, but in the meantime I'm researching best practices for this approach.

Overview

a user authenticates to our web application using their username and password
user initiates some action which triggers a risk assessment
if risky:

pull user's encrypted secret key from database (or generate new random key if it's not there)
use secret key and current timestamp to generate TOTP
TOTP is delivered to user's cell number via SMS (or delivered via email)
Display TOTP input screen

User receives and inputs TOTP

Pull secret key from database and generate TOTP(s)
validate provided TOTP against generated TOTP

if valid, carry on with original action

Question

Does there need to be an expiration policy for the user's secret key?

Logically the secret key is even more secure than the user's password (which never expires).
It never leaves our systems (the application server and database).

I could make it expire (and generate a new one) say once a month, or once every 10 uses.
But this really only seems to give value if our database (and the encryption key) has been compromised (in which case we've got bigger problems).

Are there any best practices here?

Notes / Assumptions

The secret key will be generated using a Java's SecureRandom class (with reseeding)
The secret key will be encrypted when stored on the database
We will ensure the one-time only use of a valid token.
A second attempt of a valid token (within the same time window) will not be accepted.
The time window the token is valid for will be kept as small as possible.
But it needs to be big enough for the token to be delivered (sms/email) and for the user to receive and enter token.
We'll probably start with 90 seconds and adjust as needed.
The small time window should prevent brute force attacks?
But adding a user lockout after say 10 invalid token attempts is probably a good idea.
Once the user has authenticated with a valid token, it's valid for the duration of their session.
There will be no need for the user to re-authenticate again later.

EDIT
Re: Sebastion

I considered your "KISS" approach a few weeks ago, but I was planning on going the TOTP route because it would provide greater flexibility for the future.  If we ever want to use Google Authenticator (or partner with RSA, or Authy, etc.) then we're halfway there.  It also simplifies our development a little since the expiration is built into the algorithm.

But ... now that I take a step back, I think your approach is probably the correct one.  Over-designing and over-complicating now for a future that may never happen is a code-smell.

One thing I hadn't mentioned above was that I'd probably use something like 3 thirty second windows.  So on your last point, the time frame would be 90 seconds max, or a minimum of 60 seconds, if the token was generated at the end of a window.

I would say: You should not have a secret key at all. As you are intending to SMS or E-mail out these tokens, this means theres no need for a secret key at all.

Instead, I would suggest just random up a token, save it in database with a expiry time (like 90 seconds from now), and then send it out. Each attempt at entering the token should invalidate the token and ask the user for the opportunity to send out a new token, so each token are always "1 attempt, successful or not".
Also add a Captcha to prevent someone from launching a random attack in the hope of "hitting the right code first time by just luck".

Theres no need to use TOTP protocol at all, if you are not intending to allow the user to save the seed into their own device and then generate codes "offline".

If you however allow the user to save down their seed "offline", for example to provision Google Authenticator, then it can be a good idea, but it is not industry practice, to reprovision token sometimes.

If you are going to still use a "seed" or "secret key", I would suggest using HOTP instead, eg event-based codes.
Because with TOTP you will have the issue of sometimes sending out already expired tokens, because TOTP works like a clock that "ticks" each X seconds, in your case, 90 seconds. If the clock is at lets say "85 seconds" and you send it out, it will have already expired when it arrives to the user, both adding unneccessary cost to you, and also adding frustation to the user.


Protecting against cross-subdomain cookie attacks I have been reading about cross-subdomain cookie attacks here.

A quick overview of how it works (from Wikipedia):

A web site www.example.com hands out subdomains to untrusted third parties
One such party, Mallory, who now controls evil.example.com, lures Alice to her site
A visit to evil.example.com sets a session cookie with the domain .example.com on Alice's browser
When Alice visits www.example.com, this cookie will be sent with the request, as the specs for cookies states, and Alice will have the session specified by Mallory's cookie.
If Alice now logs on, Mallory can use her account.

We are building a web app where customers will have their own subdomains: subdomain.ourapp.com.

Each customer will be able to upload template files which can contain javascript (for client side interaction).

Since javascript can be used to read/write cookies, how can we prevent the session fixation attack above? Note that we are only storing the session id in the cookie.

Sites like squarespace.com also allows users to inject their own javascript into their on pages on their own subdomain. Since it would be next to impossible to try and filter out javascript statements that set/read cookies in uploaded template files, how can we mitigate this attack vector?

The specific scenario can be prevented easily: Create a new sessionid on login.

Please note that the issues exists across domains, if the sessionid is an url-parameter.

Generating a new sesionid, however, not be sufficient to prevent other kinds of attack: Once Alice is logged in and visits Mallory's subdomain, will the cookie be transmitted?

It is common practice to use a completely different domain for all trusted activity. For example Google uses google.com for trusted activities and *.googleusercontent.com for untrusted sites.


Does using Google DNS make extensions like AdBlock Plus useless? As many of you probably do, I am not using my ISP DNS because of very low performance, and I am using Google's primary and secondary DNS (8.8.8.8 and 8.8.4.4) which are good speed-wise but, knowing Google's ethics, probably not so much privacy-wise.

So my question is: if somebody uses Google's DNS, do extensions like AdBlock Plus, Ghostery etc. become immediately useless, since you are specifically sending Google your browsing information?

No. Of course not.

The privacy-specific purpose of adblock, ghostery, etc., is to prevent your identity on one site from being easily associated with your identity on another site, by the use of cookies, page widgets, referrer identification, etc. Whether or not this protects your actual real-world privacy in any meaningful way is seriously suspect, especially given the fact that people are more than willing to do things like log in to Spotify using their Facebook account, completely undermining the whole point of these plugins.

The privacy-specific threat of DNS is a bit more general an nonspecific: A person at IP address X visited both Facebook and Spotify early Friday evening. It doesn't really tell you a whole heap unless you actually have Facebook's and Spotify's logs to try to do some correlation. And of course if you have that, then the DNS information is redundant and completely unnecessary.

But more importantly, the real threat here is your ISP, not Google. Your ISP traditionally runs your DNS servers, and can view, intercept, and modify your DNS queries and responses no matter whom you send them to. But your ISP also is in a position to log all of your traffic patterns; what sites you visit and when, how much data you transfer from each, and if you're not encrypting everything, then the full contents of .. everything.

And in real-world cases that actually mattered, Google has consistently taken the site of protecting the privacy of its users, while many ISPs have consistently betrayed the trust of their users.

In other words, you're taking extraordinary action to protect yourself from Google even though Google is typically trustworthy, while you're not taking any action to protect yourself from your ISP, even though your ISP is typically not trustworthy.


Key Generation on FIPS device or using SW with FIPS generator I would like to understand the difference between these two options how to generate AES key.

AES key is generated directly in FIPS 140-2 Level 3 device with validated AES
algorithm
AES key is generated using BouncyCastle library and
SecureRandom source is provided from FIPS 140-2 Level 3 device with
validated RNG.

Are these two options equivalent in terms of security?

From a technical standpoint, not really. If you want to adhere to FIPS 140-2 Level 3 requirements, absolutely not.

FIPS 140-2 Level 3 has very specific requirements, including resistance to information leakage when an attacker has some restricted level of physical access to the device. This means that a certified implementation must ensure that the implementation of key generation and the cipher itself is resistant to side-channel attacks such as power analysis and electromagnetic emissions. Level 3 devices undergo rigorous EMC testing above and beyond that of normal electronic products. By taking key material from a FIPS 140-2 Level 3 device and transforming it needlessly on a non-compliant device (e.g. a general purpose computer) you nullify the EMC protection that the device offers, and potentially offer up other side-channels in the process.


Is there a benefit to changing a password everytime it is used? I have a script that connects to Azure Key Vault obtains credentials, and then uses those to login to Azure.

These credentials are only ever used by the scripts, and Key Vault is the only repository they're saved in.

Part of the script has a function to change the password periodically. I have been considering the period of change. It occurred to me that it would be perfectly feasible to use the credentials to perform an operation, and then immediately change the password associated with them.

Is there any benefit / issue with this that I am overlooking?

Edited to add a little context!

The theory for it is to allow for credentials to be available to multiple machines, and for key vault to provide a single source of truth. It allows an encrypted script / config file to be carried around on a usb stick, and to log in from anywhere knowing that whatever password is used it could be changed immediately after it is used.

To keep the actual password change mechanism secret it could be fun from serverless computing, and invoked with a webhook. (meaning that the password could be truly long and random)

Just by pure mathematics as long as you can implement  it securely and you're using strong long random passwords then yes there is benefit because the window of opportunity for a stolen password to be abused is shortened.

The big caveat is can you implement it securely or are you exposing yourself more via your password changing process.


Administrative recovery control mentions antivirus - error? I am reading through Version 7 of the CISSP study guide and stumbled on a possible error. It mentions - in the administrative controls section - that Recovery is a subset/alternate version of corrective controls and include (various), but also antivirus.

I am not sure that is actually correct, however the errata page on Wiley (publisher link) does not mention this as an error. Would anyone in the hive on InfoSec give me an explanation as to why it is not an error?

Since no one came ahead I tried to leverage another tome in the library.
The "official isc2 guide to the cissp cbk" states that a Recovery Control is intended to reinstate any changes in the access control environment that is caused by an incident, or to offer compensating control in order to return to normal operations.

I argue that antivirus is actually neither, which must mean that an error is to be reported. Sorry for any inconvenience.


Imagine I found a fast algorithm for prime factorization. What to do? Who to contact? I'm often playing around with prime numbers, just for fun. Imagine, I found an algorithm by accident that factorizes numbers into their prime parts exactly as fast as multiplicating them in the first place. I know this is extremly unlikely. But imagine I did. Imagine also, that it's easy to proof having some new kind of "mathematical paradigm" I found that's valid.

Now, as far as I understand that, that would have many consequences in cryptography.

So, what to do then? Just release the information in a mathematical journal and risks many many businesses worldwide who are suddenly open to attack? Or contact the NSA?

Who would be responsible for any action? And if anyone at all, which actions will they do?

First Steps

If you're worried about your work being stolen, I'd recommend publishing the hash of your findings in a few public places to ensure that you can prove that you were the original finder of the issue.  If you're just worried about the impact of your findings, you should be able to proceed with the advice below.

Then what?

I would start by contacting a mathematician to verify my findings.  Obviously you'd want one you trust, such as one that teaches at a university near you.  Alternatively, reach out to a well-known mathematics institute such as The Clay Mathematics Institute [1], or a well known cryptographer who may be able to ensure that your findings are legitimate.

I would then work with whoever you pick, possibly in conjunction with the IETF to figure out a repair and disclosure timeline.

[1] - no affiliation, I just know them from the Millennium Problems


Access based on type of information requested and access grant The simple solution to access restriction when number of users are small is Access Control Matrix. Here the rows are the users and columns are different types of asset.

In my case, I have a document which I need to serve which have different attributes. So my columns will be different attributes. So now it is simple 2-D matrix.

But I have requirements which also depend on the information inside document. So lets say I have two types of documents, one with X attribute and other without X attribute.

As far as I have got, this will increase the dimension of my matrix to 3-D,
where in Z axis I will have two entries, "X Attr Doc", "Without X Attr Doc".

My requirements are such that it also depends upon the information i am serving.

Only Solution I have come up till now is to have a 2-d matrix and in each cell of the matrix have a certain rule.

Looks like this:

Here the ClientIDs are different users, and Public, Core, Private, Default are different categories (set of attributes) of which they are granted access or not.

You can see in one cell, the access is granted only if certain condition is met which depends on the document.

Also, I want in future this table to be configurable, for eg, whenever a new client register, we can add one new row. Or we can have new column if we have new category which need to be served.

Is there any better solution?
If not, can any one suggest the most performance efficient way to implement it in JAVA. I was thinking of expression language like SPEL, but I have no idea.

Disclaimer: I work for Axiomatics, the leading fine-grained authorization vendor.

Hi Prakharjain,

What you are describing is the basis for Attribute-Based Access Control (abac). With ABAC you define access based on user attributes as you would in RBAC (e.g. user identity, role, group) but also other user attributes (department, date of birth, location...) as well as resource attributes, action attributes, and environment attributes (IP address, time, device).

In your case, you want to control access to assets e.g. a document. You state that your document has different attributes. In ABAC, you can define a document owner, whitelist, blacklist, type, sensitivity, department, etc... You can have as many attributes as you like.

Once you've defined your attributes (essentially your information model), you can start defining your authorization policies. This is the key here. Rather than define permissions in a table or matrix (which are hard to define, maintain, keep up-to-date, and audit), you define authorization entitlements using policies. A policy looks like the following:

  A user can view a document in their department.

This is the baseline Permit policy. It grants access provided the user and the document are in the same department. A rewritten (broken down) version would look like:

  A user can do action == "view" on asset of type == "document" if user.department == asset.department

And you can add more policies to the baseline one. For instance, you could state that

  If the user is not the owner and the document is private, then deny access.
  If the user.clearance < document.classification, then deny access.
  If the user is in the whitelist, then allow access.

You can choose how policies get combined together.

In addition to defining attributes and a policy model, ABAC also defines an architecture:

the Policy Decision Point (PDP): the core of the architecture where policies are evaluated and decisions are reached. The PDP is to XACML what the Supreme Court is to US law.
the Policy Enforcement Point (PEP): the integration items which can be anywhere in an application architecture. PEPs are extremely versatile depending on where they enforce access control. The PEP is to XACML and the PDP what police officers and judges are to courts and the law
The Policy Information Point (PIP): in ABAC and XACML, there is a need for attributes. Attributes are there to describe users, services, resources, actions, and the environment. Policy Information Points are attribute stores. They can be any format and located anywhere. PIPs are to XACML what the DVLA, the set of police records, the census bureau, etc… are to a nation and its citizens.
The Policy Administration Point (PAP): this is where you manage your policies.

There is one major standard which implements ABAC and that is XACML (eXtensible Access Control Markup Language). What you need is a XACML implementation such as Axiomatics Policy Server.

Also have a look at this question I replied to.

HTH,
David.