Is Google using canvas fingerprinting for their ads? Given the fact that canvas fingerprinting is a hype, I raise my eyebrows whenever I see fillText or strokeText in JavaScript code executing on websites. I noticed that Google uses some of these eye raising codes in their ad delivery code. For example:

https://s0.2mdn.net/ads/studio/cached_libs/createjs_2015.11.26_54e1c3722102182bb133912ad4442e19_min.js
https://tpc.googlesyndication.com/sadbundle/1253442454509157695/libs/easeljs-0.8.1.min.js

Both contain fillText and strokeText. What is going on here? Why would Google need to draw text strings? This is a massive document and my JavaScript knowledge is too poor to analyze it all.

If they are, those files aren't really evidence of it, they are just minified bundles of some of the CreateJS libraries.

  Both contain fillText and strokeText. What is going on here?

The CreateJS libraries are mainly used for canvas drawing, and there is a "private" function which will draw text, _drawTextLine. Those are the instances of fillText/strokeText you see.

  Why would Google need to draw text strings?

There are many possible reasons to draw text to a canvas. I don't know what you found these files being used with, but I suspect it is something that makes heavy use of canvas drawing. Perhaps some HTML5 ads?

If anyone competent were going to use fillText/strokeText for fingerprinting, I don't think they would load up a full canvas drawing library to draw some text, as I can't see it being very helpful for the actual difficult part of the image recognition code.


Java Applet - Need Code Signing Certificate vs SSL Certificate I'm working on a Java Applet that used to be self-signed.  Now that java 7u51 is being used, I am working to get the jar for the Applet signed.

I used the certificate/key used for the apache2 ssl to sign the jar.  In order to do this I had to create a new keystore using the key/certificate, and the Not Yet Commons SSL library.

If I run jarsigner -verify on the applet jar, i get:

This jar contains entries whose signer certificate's ExtendedKeyUsage extension
doesn't allow code signing.

The applet is still getting an invalid certificate error.  I can view the certificate, and it is the same certificate used for SSL.  The error message says that it was blocked due to being self-signed, but this is not a self-signed certificate!

I can run the applet when I move the security settings down to "medium", but this is unacceptable for this project.

The certificate I used to sign this is part of a chain (about 4 long).  Is there a way I need sign the jar using the whole chain? Do I need to use a Code Signing certificate?

If jarsigner -verify tells you that there is a problem, then chances are that the JVM will refuse your applet, for the same reason, since they use the same code base.

The Extended Key Usage is a standard certificate extension which indicates the exhaustive list of "usages" for which the certificate is allowed. In this case, it appears that jarsigner (and thus, presumably, the JVM) is adamant on the certificate containing that extension with the specific OID which says "code signing". It is up to your CA to write the relevant extension; a certificate for a SSL server will not contain such an extension by default (if it has an "extended key usage", it will contains OID for things like "server authentication", not for "code signing").

You will have to obtain a specific code signing certificate. Not all CA sell this sort of thing.


Wireshark Packet Capture I need to capture/analyse the packets of another system connected to same network, is it possible with Wireshark? I have Wireshark installed on my system; what options do I need to capture packets of the other machine ?

You need network access to the other machine ...

This can be accomplished in a few ways (port mirroring on the switch, flooding the switch's MAC table so it becomes a hub, ARP spoofing the target, etc.), but the real answer is that you either need to install Wireshark (or tshark) on the target machine, or get a machine with Wireshark closer to your target's traffic.


stay anonymous in wireless network even if you are part of it Even though router knows you are always there, what are some other things we can do rather than changing MAC address

Ok the thing is there is wireless access point(router) and a user(owner of router) and another person who knows password and SSID of AP.

Is their any way to remain uncaught.

Can we clear router logs
what if use same MAC as client

Will Who Is Using My WIFI-like tools uncover the attacker to client

Remaining anonymous on a wireless network doesn't mean the operators won't detect your existence in the network. It's essential to understand the core concept of what is going on here: you're asking the access point (AP) to give you data, the AP will give you said data, it will be possible to detect that someone is using the connection.

To remain anonymous you should either constantly change your MAC address; IP address; and clear your cookies (Captive Portal software can identify you using a cookie in your browser), or you can impersonate a legitimate client by using their MAC address; IP address (in case it was assigned statically); and the identifying cookie in the browser.

Please note that it's not common for the regular access points to have Captive Portal software, especially in a home or small office environment. So it's relatively safe to ignore the cookie part.


Is it preferable to wipe device first and then upgrade firmware, or vice versa? *For the purposes of this post, Software OS Update == Firmware Upgrade. For instance when the device notifies you that there is a OS Software Update, this could also modify the firmware of the device.

QUESTION: I have been given an untrusted Android device recently which may or may not have malware of any type on it. Let's be clear, there is no suspicious activity, but I cannot personally confirm its history. Let's assume the worst case scenario, and that the device is infected with some sort of unknown sophisticated malware. Under these circumstances, is it:

Preferable to first wipe the device in order to remove any malware that may interfere with the firmware upgrade?
Or it is preferable to first upgrade the firmware and then wipe the device to prevent any malicious firmware with interfering with either the wiping of the device or the upgrading of its firmware?

*POSTNOTE: I know many will suggest it won't make a difference. Please pick the best option, and explain why. Also, I would like this question to pertain to more than just Android, to avoid posting duplicate Windows/Linux based questions. If possible please address any differences if the OS and firmware will affect the answer. Thank you.

Get recovery tool from original website or trusted source. Grab a memory card, scan it properly using antivirus tool using your laptop. Later flash the firmware from memory card, along with it wipe all data of mobile ( custom options are available in recovery). After the firmware is installed, remove memory card (before booting for first time). Factory reset it once it is booted for first time...

Note: Download original firmware from trusted site. Avoid using custom Rom's made by non-experienced user. You can use apps like "Netstat plus" to monitor your  device activity while you are connected to internet.

I have a personal experience, I have seen some custom ROM's tracking all my activity.


LDAP Authentication and Sessions Given a Web Application with Form-based login and a central directory: using LDAP (fast) bind in an application with the actual user has a number of advantages (opposed to using a service user and doing a password check). It especially means the directory server will evaluate if the login is actually permitted. It can then audit the logins and count failed attempts and the application does not need to know how to compare password hashes or check for account-locks/expires/time restrictions.

However there is the question, on what to do if a login session (for example powered by an http session cookie) persists for a longer time, and the user was meanwhile deleted or locked out.

The simplest approach would be to bind regularly again. This has however the problem that it either annoys the user (as she has to give the password again) or it means I have to keep the password in the users session, so I can re-authenticate for it. Is there another (widely supported) method?

If not, what would be done? Using a service bind to look up the DN and check if it is modified (any attributes changed)? I guess this will not cover "valid-until" type of restrictions.

Is there (if GSSAPI is not used) a way to have a session representing token which can be validated against the LDAP server (and if yes, can I access it from a LDAP client in Java?)

My software product supports all kinds of other alternative methods like SSO with SAML or SiteMinder, Kerberos and so on. But the LDAP method is there for some customers and I want to optimize specifically that part.

From what could perceive, your problem is not Active Directory-specific. You would still have this issue if it were SQL-based or any other kind of authentication backend. What we have to solve is: how do we keep awareness about the logged-in user account status without remembering the account credentials or asking for re-authenticating AND not forsaking security?

The answer is simple: We can't. The only way to make sure the user is still valid is re-checking back at the auth service.

Your only option should be longer timeouts (I think that we do not need to get on the topic of why we should not keep the user's credential, do we?), but that is exactly why you are facing this status-consistency problem.

That is the reason we have a proper vulnerability category for that kind of problem. You simply should NOT enable long session-timeout periods or (in some people's opinion) long-lived sessions.

You may try something about that SSO mentioned by @Abu. But that opens up to another problem about the way Windows authenticates because NTLM is broken and so do default Kerberos configuration, as explained the previous link. Of course, it is possible to configure Kerberos properly so that it does not use the affected crypto, but that also comes with the need for a tight infrastructure management plan (and i'm not even sure that it would invalidate the session at the moment the account gets deleted, blocked, etc.).

Security always come at the expense of usability. Talk with your manager, explain the situation to him and do whatever he chooses to. One way or the other, he will be aware of the pros and cons of his decision, be it lesser security (some hacked or wiped-out servers?) or some emails complaining about reauthenticating (depending on the chosen timeout).

From where i look at the matter, the impact of lesser security in this case far supersedes the impact of the second option.

But only you may tell where it hurts the most.


How to synchronize a laptop with mobile phone so as to rack the login details of laptop if laptop is not connected to network? I want to detect where my stolen laptop is. If I synchronize the laptop with mobile phone using bluetooth so that when I login to my system it sends an alert message to my phone. f Now the issue is if the laptop is stolen and if the culprit already knows the login credentials of the laptop and the bluetooth range is not enough to work, how will i be able to get the alert message to the phone?

Well Bluetooth implies that you are close enough (within no more than around 30m line-of-sight) to your stolen laptop that you can make a connection. That doesn't seem very robust as an anti-theft process.

The way it is normally done is that the laptop runs code that reports it's IP address regularly to a central location.

If you want to create your own code, it isn't difficult to do with Node.JS or Python and an Internet facing MQTT broker. MQTT is a pubsub service so you can have a simple client on your phone or indeed a monitor service on a server somewhere that will check for IP address changes and alert you. There are many other ways of course to do the same thing.

An IP address is not that reliable a measure of location of course so there are still significant limitations in this approach.

You could further improve things by finding things on you main networks (the ones where your PC will normally be found) that the service can ping to check that it is where it thinks it should be.

UPDATE: If the PC is not connected to a network, certainly Bluetooth would be better than nothing. But it is very unreliable. Having some kind of Bluetooth device permanently on in fixed locations might help (though please update your Q with more details so we can better help), perhaps a Raspberry Pi with a Bluetooth dongle. You certainly can't do that with a mobile phone because the phone will likely turn off BT when on standby (e.g. most of the time) to save battery.

The other issue with BT is that it doesn't cope well with multiple connections. So a fixed BT monitor would work OK maybe for a single PC but not for many.

What you should do is set up a local Wi-Fi network with the PC's connected to it and have a central monitor watching for PC's dropping off. But how do you differentiate between a theft and someone leaving the office?

I suspect you really need something to monitor for when a PC appears on an unknown network and that was the focus of my original answer.


Why are Wikipedia's listed DES semi-weak key pairs 16 bytes? I'm trying to complete an encryption based CTF and am testing for the use of DES encryption with weak or semi-weak key pairs by taking the keys listed on wikipedia (https://en.wikipedia.org/wiki/Weak_key#Weak_keys_in_DES) and encrypting the given cipher text with said keys to see if it yields any plaintext. The listed semi-weak key pairs on the page though are 16 bytes long, when surely a DES key is 8 bytes? How can such keys be used in DES encryption operations?

A weak key pair is just that, a pair of keys. So a pair of 8 byte keys is 16 bytes.

For their example weak keys:

0x011F011F010E010E and 0x1F011F010E010E01

This can be broken down into:

01 1F 01 1F 01 0E 01 0E and 1F 01 1F 01 0E 01 0E 01

The first byte of the first key is 01, the second byte of the first key is 1F, etc.


SSL cipher suite: what does "export" mean? I saw a cipher suite EXP-EDH-RSA-DES-CBC-SHA, EXP stands for export, How do I explain the "export"? What is the different between "EXP-EDH-RSA-DES-CBC-SHA" and "EDH-RSA-DES-CBC-SHA"?

"Export" means ciphersuites that were designed to be sufficiently weak they could legally be exported from the US back in the 1990s when there were much stricter legal limits on exporting encryption from the US (and some other countries, but Netscape was in the US). See Which SSL/TLS ciphers can be considered secure? for a summary, various sections of TLSv1 for the gory details, and TLSv1.1 for a vestige. TLSv1.2 deleted it altogether except for a reserved alert code.

The difference between EXP-EDH-RSA-DES-CBC-SHA and EDH-RSA-DES-CBC-SHA is that the first uses export-limited ephemeral Diffie-Hellman key exchange with RSA authentication (EDH-RSA) and 40-bit DES in CBC mode symmetric encryption with HMAC-SHA1 integrity (DES-CBC-SHA); the second uses export-limited RSA key exchange and authentication (RSA) (which possibly/usually uses a temporary RSA key for key exchange) and the same symmetric encryption and integrity.

The similarities are that both use a special variant key-derivation function, and both should not be or have been used for any security purpose after about 2002.


Can Google authenticator be used to link all my accounts together? For example, if I add two accounts from different non-Google services, can Google (or maybe those services) because of that link them both together with my gmail account?

Not at all.
Google Authenticator is just an application to generate TOTP. It's easy to install, easy to use, so most people equals TOTP to Google Authenticator. The tokens you add are not tied to anything, not your email, nor your phone, nor anything.
It does not send any data anywhere. You can test it by putting your phone on Airplane Mode and opening it. All tokens for all your accounts will be updated every 30 seconds as always.
I usually don't recommended using Google Authenticator because it lacked a way to export your tokens, so if you lost your phone, all your 2FA tokens were lost and you had to log into every site using a backup code to recreate the token. And if you replaced the phone you had to log on every site and do the same.
So you can use it without worrying about anything leaking about your accounts.


Does HTTPS provide availability? The paper On the Security of the TLS Protocol suggests HTTPS provides availability,
but I couldn't find the explanation. Is it provided because HTTP supports load balancers etc.? Or is it something special about HTTPS that helps with availability?

The paper On the Security of the TLS Protocol suggests HTTPS provides availability

No, it doesn't.

Quote of the relevant section of the paper:

  II. Security Goals

  ...

  The primary goal of TLS, defined in its specification, is
  “Cryptographic security” [3]. This goal already refers to the
  Confidentiality corner of the CIA triad. The CIA triad describes the
  most necessary security goals a secure application has to fulfill in
  order to provide data security. The following three enumeration items
  describe the corners of the CIA triad [2].

The paper claims that TLS's first security goal "Cryptographic Security" matches Confidentiality in the CIA triad. The paper doesn't claim that TLS fulfills the other two corner of the triad.

  Does HTTPS provide availability?

No it doesn't.

If we refer to RFC 5246, TLS has four goals:

  2.  Goals

  The goals of the TLS protocol, in order of priority, are as follows:

  Cryptographic security: TLS should be used to establish a secure connection between two parties.
  Interoperability: Independent programmers should be able to develop applications utilizing TLS that can successfully exchange
  cryptographic parameters without knowledge of one another's code.
  Extensibility: TLS seeks to provide a framework into which new public key and bulk encryption methods can be incorporated as
  necessary. This will also accomplish two sub-goals: preventing the
  need to create a new protocol (and risking the introduction of
  possible new weaknesses) and avoiding the need to implement an entire
  new security library.
  Relative efficiency: Cryptographic operations tend to be highly CPU intensive, particularly public key operations. For this reason, the
  TLS protocol has incorporated an optional session caching scheme to
  reduce the number of connections that need to be established from
  scratch. Additionally, care has been taken to reduce network activity.

While the paper didn't make a claim about Integrity, TLS together with the associated x509 certificate actually also fulfills the Integrity criteria, provided that you trust the CA system. Confidentiality in TLS is achieved by cryptographic signing and MAC of each packets transferred in the connection, which prevents data traveling through the connection from being altered without being noticed.

TLS doesn't directly improve Availability, although it can improve availability in some scenarios, such as when used with client certificate, a TLS Terminator can be configured to reject unauthenticated/improperly authenticated connections before proxying it to the real server, which could reduce the impact of abuse on a scarce resource on the real server.


Are old, unused Java SE JRE files insecure? We have an agent application deployed to some internal web servers that runs on java, and installs a specific JRE to use. The agent updates regularly and installs updated JRE versions to use, but doesn't remove the old files.

Our security team gets a notification that this in insecure even if secure versions are installed and in use - specifically: https://www.tenable.com/plugins/nessus/92517

What kind of risks are there to having old JREs installed, even if not in use by any application?

To clarify: my understanding is that Java exploits target running processes, applications or the jre/jdk installers, and that the JRE files aren't more or less insecure than any other programming language's source files. Is there an attack vector in which having JRE files on a box is more dangerous than having bash installed?

If it's literally code that's sitting on the server, but is never executed, the risks are mostly one of miss-configuration.  Unless the java code has some special privileges assigned to it, or special location, I don't see how it's any different from any other executable that shouldn't be running.  If the attacker can execute this exploitable java code, can they, as you say, execute bash?  If they can do that, it's not java's fault, it's the attack vector that lead to code being executed that shouldn't be.

I wouldn't dismiss the miss-config issue however.  If you've got 10 versions of Java sitting around, and 8 of which are compromised in some way, it's possible that someone could miss configure the server to use the old exploitable code.  It might be an emergency situation where they tried a different jvm, or just an honest mistake.

But if I were making the call, I'd classify it as "high", not critical.  I'd also make sure it gets fixed, or mitigated.


Are the GET values also encrypted/secured by SSL? For example we submit a form on the following site:

https://example.com (SSL Encrypted)

Then the form is submitted as GET method, so it becomes like this:

https://example.com/form_action.php?user=ANYTHING

If user is using VPN Connection or if the ISP is tracking the user, can they see this "ANYTHING"?

  I know posted forms are secured when using SSL, But can't they just see the FULL URL user is visiting and get the "ANYTHING" value from it?

Yes, any value in a GET statement or POST data (e.g. ?user=ANYTHING), is encrypted once the SSL/TLS sessions are negotiated.

During an TLS connection, the first thing that happens is a "Client Hello" messages that begins negotiating the encryption ciphers/hashing ciphers to establish a connection.  On some browsers, the hostname is sent using the SNI protocol prior to establishing the session.  Also, if using an explicit HTTP proxy (configured by browser settings, group policy) the plain hostname submitted via a CONNECT statement transmitted in plaintext. However, it's only the hostname that is sent in the most verbose scenario, never the page being requested or POST data.

After the session is negotiated, the traditional HTTP GET command is then issued.  This command is sent over a TLS session, so the data is encrypted and not vulnerable to easy eavesdropping.

You can take a look here for a bit more detail.


Is a random number secure (enough) for card numbers and pins? I've been given the task of generating some gift tokens which comprise a serial number and a pin number, analagous to a pre-paid credit card. The serial and pin will be printed on a card, with the pin behind a scratch panel.

My first thought is for both numbers to be randomly generated with the serial number being unique. Is this secure against guessing?

To my simple mind, adding any kind of logic would make the numbers more gussable as there'd then be something to figure out and understand, whereas random is without reason (ignoring implementation details for now), and so while being simple using pure random gives the attacker less to work with.

Is this a flawed assumption? Are there known "good" ways of doing this?

If the numbers are random, the attacker has nothing to work with, and you can trivially calculate his probability of guessing a correct combination.

If you have some kind of brute-force prevention triggering well below the level where a random guess has a reasonable chance of success, you should be good.

I would agree that any kind of logic would give the attacker more to work with. If you create a large number of such tokens, you might want to add some extra processing to ensure that no two randomly generated numbers are too close to each other (to eliminate typos, maybe even to allow one typo as a convenience - all depends on the length, etc.). With a low number of tokens, I wouldn't bother unless their value is very high.


Does bcrypt compare the hashes in "length-constant" time? I saw this function slowEquals() while reading Salted Password Hashing - Doing it Right, which uses a byte-level xor comparison to avoid timing attacks. I was wondering whether this is what Bcrypt also does to avoid timing attacks. I use Openwall PHPass which has its own CheckPassword() method which doesn’t seem to xor. How does it avoid timing attack?

The cool thing about hashing is that even a one-bit change to the input will completely change the output. Keep this in your mind! How does that relate to your question? Well, bear with me a little.

In the vast majority of cases, access to the salt implies access to the password hash. This is especially true in the case of Bcrypt since almost all implementations store the salt, the hash, and the iteration count in the same string with delimiters. Also keep this in your mind!

Since the comparison is happening on the password's hash, and any change to the input password will completely change resulting hash (remember?),  the yield of the timing attack will be information about the hash itself at best. However, that's only true if the attacker has access to the salt. Remember what we said? An access to the salt implies access to the hash. This means that the timing attack in this case is irrelevant.

If the attacker doesn't have access to the salt, then the timing attack will give (practically speaking) zero information. Thus it will give the attacker zero advantage.

Bottom line: For hashing schemes such as Bcrypt, Scrypt, etc., timing attacks are irrelevant. Using comparisons such as == and === isn't a problem. Having that said, using constant time comparison is a good practice as part of a defence-in-depth policy. In fact, many Bcrypt implementations already used timing-safe comparison just in case (timingsafe_bcmp.c in py-bcrypt, for example).

Update:

There is indeed a way to extract some information about the hash without knowledge of any of its components (salt, iterations, or plaintext value). It's described in a comment by Oasiscircle

  This can still leak parts of the hash using the early-exit byte
  comparison. Example: Attacker computes tons of hashes and stores them
  looking for a hash that starts with 0x00. Upon finding a plaintext
  with that value, send that plaintext, listen for timing on response.
  Do this for 255 more values until one value takes slightly longer.
  That's the first byte value of the hash created from the plaintext.

Having that said, I still hold the same opinion expressed in the original answer about the irrelevance of the timing attack when using a hashing scheme such as Bcrypt. While there's indeed a possibility of such attack, it's extremely infeasible. The computation and storage requirements for such attack are enormous, and they keep grown exponentially with every bit discovered from the hash.


Are there any disadvantages to encrypting the password hash? Is encrypting the password hash in database more secure than storing only the hash?

Suppose we store encrypted SHA-256 result with AES instead of hash directly. Is this a good protection from a situation in the future when someone will break one of the algorithms?

First of all, every stored password should be hashed with a different pseudo-random salt.  Second, SHA-256 is not appropriate for storing passwords; instead, you want to use a key stretching algorithm, as has already been mentioned.  There is a lot more detail at Crackstation.

An encrypted hash is also called a keyed hash, and the key is sometimes called a "pepper."  There need not be a separate encryption step.  Instead, the secret key is part of the input to the hash function.  That can improve security somewhat.  There are two ways attackers can get a copy of your password hashes.  One is to compromise the storage mechanism, as with SQL injection.  In that case, a keyed hash can make it effectively impossible to retrieve plaintext passwords from the hashes because the key can be compiled in to a program or otherwise kept outside the password storage mechanism.  The other way is to compromise the OS itself.  In that case, the key is compromised, and is no longer an impediment against attempts to attack the passwords.

So, the short answer is yes, but you have to do the underlying work right, first.


How do automated systems store their keys securely? As with many systems (primarily websites) there are automatic components that run on a server and are not user based (such as crons) that don't have the opportunity for a real person to input a secret password to decrypt the secrets that are used. Bearing that in mind, without a secret stored in a humans head, how can an automated system secure the keys it uses so that it protects the secrets from access by anyone (hacker or authorized user) browsing the server source?

The best method I can come up with is for the system to only use temporary access keys that get cleared when the process is complete, with the resulting data stored using asymmetric encryption for the user. Aside from that, are there any other methods for allowing secure automated processing on encrypted data?

There are a large number of ways to do this. Simplest is this:

A key thing you need to remember is that you don't need to store authentication keys or tokens where an attacker can get them!

On a well configured webserver you have public and private environments, and they can be well segregated.


How can I use ECC 163? I will be working with a Sentinel dongle. In the 3rd tab, it says it supports ECC 163. I will be both encrypting and decrypting with the dongle, as well as on a server. The server uses PHP but I can wrap any binary as needed or shell_exec them.

I don't want to implement ECC 163 myself of course. I'm looking into proper existing implementations made by experts but I find it hard to find information about it. It seems like Elliptic curve Diffie–Hellman (ECDH) is the "usual" implementation but honestly I have no idea. According to OpenSSL's wiki, OpenSSL supports ECDH, but is it compatible with ECC 163?

And so my question is: what should I use on the server to encrypt/decrypt with ECC 163 ?

"ECC 163" is not an encryption scheme.

There are some algorithms that work with elliptic curves. One of them is Elliptic Curve Diffie-Hellman (ECDH) which is a key agreement scheme. ECDH can be used as the basis for an asymmetric encryption scheme by coupling it with a symmetric encryption algorithm: to encrypt a piece of data, you run an ECDH instance with the ECDH public key of the intended recipient, and use the resulting shared secret as key in some symmetric encryption system such as AES.

While the principle is clear enough, saying "ECC 163" is nowhere sufficient to actually specify what the dongle is doing in practice. It is more a declaration of intent than anything else.

ECDH works in some elliptic curve. While generating random elliptic curve for cryptography is doable, it is complex and expensive, so (almost) nobody does that. Instead, systems that use elliptic curve (for ECDH, ECDSA...) rely on a handful of standard curves that have been generated once and for all. NIST has defined 15 standard curves, two of which having "163" in their name: B-163 and K-163. It is conceivable that by using the terminology "ECC 163", the vendor for your dongle really means to say that his hardware supports some EC-related cryptographic algorithm using one of these two curves.

If you want to interoperate with that dongle, then you need much more detailed information about what it does. Such information is obtained through documentation from the vendor, and/or analysis and trials, a process known as "reverse engineering" (there can be legal subtleties with regards to reverse engineering, depending on context and jurisdiction, so using vendor documentation is normally preferred; also, reverse engineering can be very time consuming, and may fail, especially for a physically hardened dongle).


Are encryption keys wiped from RAM before hibernate, or how to do it (Luks and Truecrypt) Using Linux, I have system and swap/hibernation partitions encrypted with LUKS, and data partitions encrypted with Truecrypt, and I am wondering when I put my laptop to hibernation if the encryption keys are wiped from the RAM before the computer is shutdown, or if I have to wait a few minutes to be quite immune against cold boot attacks.

Technically I guess it is complicated for the encryption software to do that even if it detects that the laptop is going to hibernate, because if it alters the memory before it is copied to the disk then the encrypted volumes won't be restored on resume.

Probably only the kernel can safely alter the memory and not the memory image on the disk, but it would not know about the encryption keys, and would have to wipe the whole RAM, which is probably not done by default.

But maybe there is a kernel option to do that?

Or maybe it is possible to run some pm-utils script after the hibernation has completed but before the computer shuts down?

Or there is another way to run some program after hibernate but before shutdown?

Or maybe the kernel could have a more advanced option, allowing software to publish to the kernel some memory address ranges that need to be wiped after hibernate but before shutdown?

EDIT

Apparently it is possible to create a shutdownramfs that gets executed after shutdown (see here for an implementation in systemd), so it would become possible to wipe the RAM there for shutdown. However it does not seem to be called for hibernation, and setup seems tricky, at least when not using systemd.

I am wondering when I put my laptop to hibernation if the encryption keys are wiped from the RAM before the computer is shutdown?

No because the because the master decryption keys are kept in DRAM whatever the encryption tool you use.

  or if I have to wait a few minutes to be quite immune against cold boot attacks?

Some authors stated that hibernation during 5 minutes or more makes the machine immune but more authors proved the opposite, including from the article I mentioned below, there is an answer to this question that confirms the no:

  Our results show that simply locking the screen of a computer (i.e.,
  keeping the system running but requiring entry of a password before
  the system will interact with the user) does not protect the con-
  tents of memory. Suspending a laptop’s state (“sleeping”) is also
  ineffective, even if the machine enters screen-lock on awakening,
  since an adversary could simply awaken the laptop, power-cycle it, and
  then extract its memory state. Suspending-to-disk (“hibernating”) may
  also be ineffective unless an externally-held secret is required to
  resume normal operations

An other quotation says hibernation is even more vulnerable since other methods than cold boot attacks:

  If people use hibernate or sleep mode, or lock the keyboard, they are
  potentially vulnerable in other ways. Just bring the computer back up
  to the login prompt, and start attacking the ports looking for an
  unpatched vulnerability. So a computer that is not completely shut
  down effectively bypasses the protection of full disk encryption --
  even without the cold boot memory attack.

You said:

  Technically I guess it is complicated for the encryption software to
  do that even if it detects that the laptop is going to hibernate,
  because if it alters the memory before it is copied to the disk then
  the encrypted volumes won't be restored on resume.

Yes, because there are other processes that continue to run.

The rest of your question are subject to more efforts and analysis. I can not answer them.

It is proven that:

  Ordinary DRAMs typically lose their contents gradually over a period
  of seconds, even at standard oper- ating temperatures and even if the
  chips are removed from the motherboard, and data will persist for
  minutes or even hours if the chips are kept at low temperatures

So unless the RAM of your machine is old, you have not to worry about this issue.

This is for the short answer. As the posts of StackExchange websites are intended to last, I forward you to read a more detailed answer to your question that I do not want to reproduce here.

Always quoting from the answer I linked to, you can shut down your machine safely:

- Keep secure data in True Crypt cascade algorithm encrypeted file
-  Use Serpent

- Create a script to handle shutdown:

           truecrypt /wipecache
           shutdown -h now

  /wipecache ensures that no vulnerable data remains in RAM after
  shutdown. If someone will perform Cold Boot Attack they will have
  access to your System at best. They will not have data stored in a
  separately encrypted file.


Alternative to "web of trust" Let's say I have an SMIME platform where I want to easily establish trust across the entire world for a particular purpose, for example for sharing valid financial information. I think that a distributed trust environment is best because I don't want to dictate communities's certificate policies and practices and I especially don't want to be involved in the CA / RA process. This means that little communities can evolve and create their own practices. But this process hasn't even started yet, how do I facilitate this trust model?

Here are some options that I can think of:

1) One option would be to create a list of valid communities and have a link to their anchor certificate.

2) Another would be to create an anchor myself and I only allow valid and trustworthy communities to create anchors created off of my own anchor. But that's a lot of work and I'd prefer not to do that.

3) Another option is the PGP web of trust model where I try to cross-certify trustworthy anchors. But again, that's a lot of work and per wikipedia, that model never actually took off: http://en.wikipedia.org/wiki/Pretty_Good_Privacy#Web_of_trust.

4) A further option is kind of like #1, but is more like Reddit / Stack Exchange where I just provide a platform for these communities to update pages and vote up trustworthy communities.

5) Don't do anything but allow the active community members to share their anchors out of band and establish trust out of band.

6) Some other method outside of PKI though I'd prefer to stick with the PKI option because I already have some SMIME infrastructure in place.

Which option is best? Do I have any other options at my disposal and what are their potential upsides and downsides?

Web of Trust does not allow you not to be "involved in the CA / RA process". It is quite the opposite: with a Web of Trust, everybody is involved in the CA / RA process. That's the point of WoT: any single user can act as a CA+RA, by verifying the physical identity of other users (the RA part) and then signing their public key (the CA part).

An often overlooked aspect of Webs of Trust is the need for redundancy. To understand it, consider the certificate validation process. User A (let's call him Akhenaton) has a copy of a public key which is purported to be owned by user B (Burna-Buriash). But he wants to make sure of it before using that key for encrypting some diplomatic letters. Fortunately, Burna-Buriash's key was certified by Suppiluliumas: the latter signed (with his own private key) a document containing both Burna-Buriash's key and name. Akhenaton does not know Suppiluliumas' key either, but this key was in turn certified by Tushratta, and Tushratta is Akhenaton's friend and Akhenaton knows Tushratta's key. This allows Akhenaton to verify the signature on Suppiluliumas' certificate, and thus Akhenaton gains some trust in Suppiluliumas' key. He can then proceed to verify the certificate issued by Suppiluliumas to Burna-Buriash, and thus gain some confidence in the key which was alleged to be owned by Burna-Buriash.

Now we see that in the certificate validation process, Akhenaton had to trust both Tushratta and Suppiluliumas to do their job correctly. Indeed, while Akhenaton has first-hand knowledge of Tushratta's key, he must still somehow believe that Tushratta will not try to deceive him by issuing a fake certificate, one containing Suppiluliumas' name, but a key which is, in fact, controlled by Tushratta himself. Tushratta's signature protects the process from interference from third parties (like that never-do-well scheming Aziru), but they do not provide protection against treason by the participants themselves, or even gullibility: Tushratta might have drunk a bit too much of imported Mycenian wine that day, and might have been himself deceived by Aziru, wearing a fake Hittite beard and claiming to be Suppiluliumas.

Things are worse at the next step, because while Tushratta is a personal friend of Akhenaton, Suppiluliumas is unknown to him. Akhenaton has no way to assess the trustworthiness of Suppiluliumas; even if Akhenaton supposes that Tushratta is friendly and sober and that the key which is purported to be Suppiluliumas' is indeed owned by Suppiluliumas, this says to him nothing about whether Suppiluliumas will truthfully do the same RA job with Burna-Buriash.

To state things simply: trust degrades sharply when transferred.

Hierarchical PKI (like what X.509 was designed to support) and Web of Trust PKI (the normal model for OpenPGP) deal with this issue in distinct ways:

In a hierarchical PKI, the structure is pyramidal, with few CA compared to the user base; say, one hundred CA for one million users. Each CA is bound to the upper CA (which certified it) by contractual and legal requirements, so that any mistake or fraud will imply heavy retaliation on the faulty CA. CA are thus "guaranteed" to stay in line and be trustworthy by threatening them with all the Might of the Law. This can work as long as there are not too many CA, and the whole structure is properly centralized.
In a Web of Trust, every user is a potential CA. A WoT relies on the following assumption: there may be some black sheep in the lot, but the majority of users are honest and will not try to cheat, and (possibly) most of them will be cautious enough not to sign each other key after the third pint of Guinness. There is a bit of wishful thinking in that assumption, but let's believe it for a moment. In WoT, you cannot gain enough confidence in a key by verifying a single certificate path; instead, you must verify many paths going through distinct intermediates. This ensures safety to some extent because while some paths may go through cheaters, not all users are corrupt. That's the redundancy I was talking about.

Since redundancy is important for WoT, then user software involved in WoT-based validation MUST support it. The software must build several paths, check that they do not intersect, and verify them all. That's where S/MIME fails at doing WoT: although nothing prevents X.509 certificates from implementing a WoT model, X.509 was not designed for that, and, correspondingly, software which does S/MIME (i.e. email applications like Outlook or Thunderbird) just assume that they are in a hierarchical PKI model and declare themselves to be happy with a single verified path.

That's the important lesson here: the PKI model you choose must be implemented by the verifiers, i.e. the users' applications. If you want a Web of Trust, users must use applications which actively support it, and, currently, this means OpenPGP format (with, e.g., GnuPG).

In the end, Akhenaton trusted everybody. This did not turn well for the Egyptian empire.


Issues with using Usernames as PC Names Our organization is looking on changing the naming conventions on our Admin PCs to make it easier for tech staff to remote into user machines.

A current favorite idea is to pair user names with the machines they are assigned to. Since we are a smaller operation (~30 Workstations), we figured it would be the best option.

Questions about security of the new naming conventions have arisen, and I was looking for feedback on the risks with going with this convention. Also the risks associated with using any part of a user's name such as (Companyname)JD for John Doe

X Y Problem Challenge: A better long term solution is to create a mapping of PCs to user and physical location. This is actually a CIS Top 20 Recommendation and gives you a lot of opportunities to build off of as you mature your process. Asset matrices are crucial to a lot of security processes.

That being out of the way - for your specific question:

The real question is 'how sensitive do we consider our usernames?". If they're shared publicly elsewhere, it might be worth the efficiency trade off to use the proposed naming scheme. At the end of the day, we're trying to facilitate business without exposing the organization to undue risk. If you don't consider usernames sensitive, then it doesn't really cost you very much to expose them in device names, and you might gain a lot in response time when you need to remote to a system.

For what it's worth, usernames are typically not treated as sensitive, and you can probably expect a hacker with any type of foothold into your environment to have a pretty good idea of what usernames are out there. Heck, if you ever send emails outside of the company and have any type of employee listing, you're probably leaking dozens of usernames already.

This is a good example of a risk vs reward trade off in security. It's not an obviously bad idea, and there are perks to implementing it, but there are also trade offs to consider. Your best bet is to sit down and write out a little risk analysis and decide if this scheme is worth the downsides.


How is Google Chrome managing authentication to sites? In Chrome, every tab is its own process. Yet, logging in to a site, say, Facebook, persists across tabs. For that matter, in many cases, it persists across OS reboots. This seems inherently very very insecure, but I'm just wondering, how is Chrome implementing this? The reboot thing in particular means it is storing something like a session token even after the process is terminated, which allows seamlessly reconnecting, already authenticated, with secure sites.

With a cookie!

Chrome, like any other browser, is storing a cookie in your file system. Those cookies are what enable you to reconnect automatically to some site. Since it's in your file system, even if you reboot they will still be there. Multiple processes or not is irrelevant here.

Then you might wonder, if the cookies are in my file system, does it mean that any page can access them?

No. Only the page for which the cookie was created can access it. The one that enforces this policy is your browser. If your browser is doing its job correctly then you are ok since it will only send the cookie to the right site (server).

You can also access the cookies directly by looking at the file system, but for that you need to have access to the operating system. Webpages don't have access to that hence the browser is doing that job for them and only gives them the cookies they should be able to read.

Fun thing

You need to protect your cookies. Stealing your cookies is nearly the same as stealing your password/username. If someone or something, like a virus, steals the cookies residing on your computer, it can impersonate you on that website if you are currently logged in.

You can check, edit and add cookie with tool like firebug. So, if you want to mount a fake attack you can :

log in on a website using chrome
read the cookie in chrome using the developer tool
open firefox with firebug and add the authentication cookie that you found in chrome

You will then be logged into that website in firefox as well as in chrome. This is a simplistic version of the hack session hijacking. You could transfer the cookie onto another computer if you want to.


Is non-executed content still considered XSS? I'm working through an OWASP Zap report that has flagged several URLs on the domain as being vulnerable to XSS, but the vulnerability is never output in a context that is executable by the browser. For instance, the report is showing

path/contacts.php?search=John%3Balert%281%29

decoded: path/contacts.php?search=John;alert(1)

as a vulnerable URL.

The application does reflect this particular content in the response to the user:

var search = "John;alert(1)";

which I think is what triggers the Alert as an XSS attack in the application.

The XSS here is that an attacker could introduce whatever arbitrary code they wanted to in this context and have it reflected to the user's browser, but this code is never executed.

Testing the vulnerability manually, the application is converting characters in the attempted attack before outputting in the response (using PHP's htmlentities function), so something like

?search=John";alert(1);

gets returned as:

var search = "John&quot;;alert(1);";

So the question is, does this still qualify as an active XSS vulnerability?

Note: I have noted that there is still opportunity for proper validation of the input parameters, but my concern is the security implications here.

This is very common for automated scanning tools.  They can only be so smart, and so false positives can always happen (as can false-negatives for that matter).  As a result any flagged vulnerability should be manually verified.  This is why, for instance, bug bounty programs always have notices like "Results from automated scanners will not be considered" - it's easy to run a scanner and report a vulnerability, but security teams probably already do that anyway, so 99% of times it is a waste of time.  However that leads to the next question:

Is this particular script handling this input properly?

That's a much trickier question to answer.  You've already checked for the most obvious work around (injecting a double quote), but there are more options.  The two that come to the top of my head is the mangling of character encoding and testing out backslashes.  The former is a bit of a long-shot so I'll just focus on the latter:

Try injecting a backslash at the end of your input ?search=whatever\
If the application doesn't escape your backslash the javascript will be: var search = "whatever\";
This will break the javascript.  If you're lucky it will also let you inject XSS via a second parameter.

The last step could use an example.  Imagine the full javascript was something like this:

var a="[search input]";var b="[name input]";

To be clear the code has been minimized to save bandwidth.  This will be important.  Also, neither escapes backslashes.  Therefore you could put together a payload like this:

?search=\&name=;alert(1)//

You'll end up with this javascript:

var a="\";var b=";alert(1)//";

Which is a valid XSS payload.  Your backslash escapes the closing double quote for the var a = " statement and so the starting double quote for the second variable ends up being a closing double quote.  As a result your input for the second input ends up executing as plain javascript - you just need to end with a semi colon and then a comment character to get rid of the final closing double quote.

Now you probably won't have any luck getting this to work.  If they also handle backslashes properly then you won't have any luck.  If these lines are split into separate lines then you also won't have any luck (in most versions of javascript a line continuation character is required, but there are some non-standard browser behaviors here sometimes).  However if they forgot to escape backslashes and you can find two inputs on the same line, then you have an easy XSS vulnerability.

Summary

Really though this highlights the main take away, which is why these things are so tricky: the kind of exploit required varies strongly on the context that the data gets injected into, and it is effectively impossible for automated scanners to test everything.  Therefore as a penetration tester you have to be familiar with all your options, which is quite tricky!  Fortunately though this is also why XSS is so common - programmers are equally bad at understanding all the ways in which they must be careful to protect against XSS vulnerabilities.


SSO - What should happen when the user clicks "Log out" We are adding the ability for enterprises to configure login to our web application via external single-sign-on providers (initially via WS-FED, however, future versions will support additional protocols). Username/password authentication will also be available for customers that don't have/want to configure an external SSO provider, and also as a fall-back in cases where there is some problem with the SSO provider.

What should happen when users click the "Log out" button in our application?

They are logged out of our application only so that other applications that authenticate via the SSO provider are still available.
As above, but we additionally request re-authentication with the SSO provider.
They are completely logged out of their SSO provider

This is one of those places usability and security cause radically different answers.

From a usability standpoint I have observed the following arguments:

When I logout on Site a I only logout form here and I can keep on using the other locations I am still logged into.
When I press logout on Site a I actually only get redirected to Site b (the portal) and only when I log out form there I am actually logged out. (mostly used in the context of an intranet or similar environment)

From a security standpoint I have observed the following arguments:

When a user does a Logout, immediately invalidate ALL sessions for this user and log him/her/it out from any and all systems part of the SSO.
When a user does a logout, inform the SSO provider and do not allow any new sessions and logout of the current application. but there is no implicit logout to all systems in the SSO. (usually mitigated with short session times / cookie lifetimes). This can be a technical limitation due to the technologies involved (and/or licenses)


Comparing the 2FA Vendors If we need to choose a vendor for the 2FA in our environment, what are the features that we should look for?
Our selection process depends on the functionality and usability they provide. But when I went deeper, I got confused!

So, when you want to choose a 2FA vendor, What should we look for, and why? given the following constraints:

Authentication methods [products]
Token [Types, license, battery life and way to renew it]
Supported environments [Windows, Linux...]
Supported VMs [Hyper-V, VMware, Xen ..]
Out-of-Band delivery [SMS, Email , phone call]
Flexibility and Usability

What else?

Authentication methods

Are you only authenticating or also other stuff? You might also need smartcards.
Are you sure you only need SMS or do you also need to choose from a vast variety of tokens?

Token

You might want to choose a solution, which is not provided by a token vendor. The thing behind this is: You can keep the software system but easily mix and switch tokens (no vendor lock).
In theory you could do this with all OATH tokens... But you know theory and real life.

Supported environment

Where to install the authentication system?
The other question is, what are the applications or operating systems where you want to authenticate.
Easy API?
Credential Provider?
PAM module?

Supported VMs

No solution should be restricted in this way, that it can not be virtualized!

Out of band delivery

You might think this is cute at the moment. But you may realize in a year, that it is total crap and unsecure. You may also need to extend the usage scenarios. So do not only look for out of band but also look for a system with maximum token support and extensibality.

Flexibility & Usability

API API API.
Can it be easily automated.
E.g. Can it be integrated into your existing customer portal?
Do you get the Source Code? I.e. can you ask s.o. to enhance it more quickly than the vendor would respond to a feature request?
Can you still use it, when the successful vendor is merged with a bigger shark and the old product is ceased end of life?
Especially in the IT Security we saw this often during the last years!


How to decide software flow / business process is secure enough Most of the time when we develop a software flow to implement a business logic often we are giving some decision that effecting safe and comfortable usage of the system and maybe success of the business.

For example to validate a member that is trying to update important data on the system (like credit card data etc.) we may decide to ask confirmation by SMS with OTP. So we may send 4 digit code and ask for confirmation. But first of all how can we sure that OTP over SMS is secure enough for our process? How long OTP we should send, 4 digit enough? Is it enough secure to use only numbers instead of letters too? We are of course always trying to make it easy for members so it will be comfortable to them and not to decide stop using our systems. Otherwise we may do it as hard as we can so it would be more secure.

Of course this is not a specific question and answer would not be clear on this but I am asking this question to understand if there is methodology or statistical method to decide business process or software flow statistically secure? Because mostly we are deciding according to ours and some of the colleagues opinion nothing else which is not measurable. There must be a way to handle such questions?

So any idea?

Basically you need to perform a Risk Assessment, and the company needs to define their limits.

Risk assessment

Is performed to identify risk to a company. In Information Security these risks come in the forms of breechs/ social engineering /etc. Risk has a defined description which is

Risk = Potential Loss X Probability that something will happen

Risk assessment use two form of was to apply value to an assessment.

Quantitative

Quantitative is an assessment of value which typically numeric value to it. You could for instance measure the numeric value of your incoming data lines and compare it to the losses your company would suffer (in terms of dollars) if those line we're to go down

Qualitative

Qualitative is an assessment of value which can't be typically measured in numeric forms. For example, how easy would it be for an attacker to Social Engineer his way into change account information.

As some words of advice, if you have never done a risk assessment before, I would highly recommend you hire a company to do a small assessment with you. There is a lot that can go into these and while the internet has great resources on what it is and what you are trying to accomplish with it. It's kind of all over the map on executing one. Learn how someone else does it, see what goes into it, and than take that knowledge and improve upon it.


Overwriting only Free Space with rubbish data to prevent data recovery? I am aware of tools which write zeros or other useless data to fill up your harddrive, however so far all of the tools I have come across must fill up the entire harddrrive.

My understanding of the tools filling up the hard drive is so that when forensics attempt to recover, they only get the zero/useless data.

I am wondering if its possible to just fill up a part of the hard disk instead of the whole thing - This free space I want to fill was used space which contained my important files, so filling up only this part seems adequate.

I also have the problem that my OS files are on this same disk, so filling the whole disk with zero/useless data will cause me to lose my OS.

Does a tool exist?
Is this a bad strategy?

Yes, it is a good strategy if a disk has held sensitive data and may be accessible by others.  A Google search for "wipe disk free space" finds numerous such tools.

There are a couple of other considerations.  One is "slack space."  That's the unused space in the last cluster of a file.  It's not part of free space, so it won't get wiped by many disk wiping utilities, but it will contain whatever was there before.  If your operating system uses 32K clusters, on the average, each file will have 16K of "old" data at the end.

The other consideration is the directory structure.  Deleting a file releases its space, but often the directory entry is just marked rather than overwritten; it depends on the operating system.  So, if I delete "breakingbad.dat" some or all of the file name is likely to remain in the directory structure.  It can be even worse for NTFS.  Very small files are stored entirely within the master file table (MFT) so a file of size less than about 1K may not get wiped when you clear free space.  That's the file contents, not just the directory entry.

What this means is that you will want to choose your wiping tool carefully.  For general cleanup, just clearing the free space may be enough.  For sensitive data, you need to clear slack space and directory entries, too.


Fixing security issues without boss/client's authorisation I have a fair number of security concerns with a client's operation and it made me think about all the security concerns I've observed and noticed throughout the years with different clients/jobs. Raising concerns with management was met with "too much time/money/resource" unless the security issue in question was exploited and, in those cases, was met with "why didn't you fix that!?".

Over time employees/contractors end up not mentioning security issues due to the responses from management and these security concerns are left behind. Of course this doesn't happen everywhere but certainly the majority. The flip side to this is management/decision makers who are paranoid about security and spend millions on worthless stuff because it says "secure" on the box/in the name.

My question therefore is this- is it ethically correct to ignore a security issue because a boss/ client has told you not to fix it due of time/money concerns? Is it ethically correct TO fix it after an express order not to fix it.

Part of the biggest problems I've experienced in spotting security issues isn't always the response but more the time taken during the decision making process. During that time we could be leaking a lot of data or even worse - a lot of user data that's almost always sensitive.

Sort of a side note but how on earth can we train staff, decision makers and users (yes there's a difference!) that these issues exist and should be fixed but without them jumping too far in the deep end.

Edit
Just to clarify - this isn't about going against management decisions or not realising you're creating a bigger security issue than what was previously there. I'm talking about a definite security flaw that you've spotted, can fix and don't have client authorisation.

Every fix is a business decision. The business needs to make the call. You, as the one with the knowledge, need to properly inform and guide the business through the matrix of needs and costs. Optimally, there are policies and procedures in place to identify and incorporate fixes over time based on cost and priority, but unfortunately, not all do.

As for fixing a problem without oversight, what happens if you cause an even greater security problem? What if you expose the business to costs and damage as a result of unintended consequences? Oversight exists for a reason, to protect both you and the business.

As for ethical concerns, there is open debate of the ethics of information. In a situation where life and health are threatened, there are clearer and more defined ethical lines. Threats against information are more difficult to understand ethically. I have had discussions with some in the health care industry who have proposed the idea that a human's information is worth more even than a human's life (because it can effect the life and health of untold numbers of other humans).

Educate, inform, guide, encourage, and talk in terms that make sense to the business. These things you must do ethically and with passion.


How to only let end user to access data in a web app I've been read a lot about common encryption methods used in a django app.

However, my requirements are very different. I am looking for a way to encrypt my web app data so only the owner of the data is able to access them. That means, even us won't be able to access them.

This means each different document owner will need to have a different decryption key, and obviously we can't store this key on server, otherwise we can also open the documents. Does that mean every time when a user needs to access their document, they will need to input the decryption key? I don't like this, because this makes the web app almost unusable. Are there better alternatives?

The only way to do this is to deliver the data encrypted to the users browser and have browser code decrypt it.

To achieve that, you must also provide a mechanism for the user to enter some form of key that only they know.

You can simply present that to them as a passcode however and set suitable minimum length/complexity requirements.

It is possible though to cache the security information locally so that the user does not need to keep entering it. Obviously though, the longer you cache it, the more exposed it becomes. But then again, unusable security is every bit as bad as no security.

You could combine the use of your authentication login with local code to create a user owned key by passing the hashed password to the backend for authentication but also running through an algorithm to provide local encryption. This would be reasonably safe since the back end will never know the actual password. Typical passwords do not however contain enough entropy for encryption so you should at least salt the password and probably run through multiple encryption rounds.

I'm afraid I have no idea whether any of this is feasible in Django as I don't use it. Though a quick Google search suggested some hopeful lines of enquiry.


How to enable a http post form penetration test? I don't get the correct results and I'm not sure what I'm doing wrong:

$ ./hydra -l admin -x 3:9:a http://localhost http-post-form "/admin/login:j_username=^USER^&j_password=^PASS^:failed" -s 8088             Hydra v7.5 (c)2013 by van Hauser/THC & David Maciejak - for legal purposes only

Hydra (http://www.thc.org/thc-hydra) starting at 2014-01-09 11:24:35
[WARNING] The service http has been replaced with http-head and http-get, using by default GET method. Same for https.
[WARNING] You must supply the web page as an additional option or via -m, default path set to /
[DATA] 16 tasks, 1 server, 5646683825432 login tries (l:1/p:5646683825432), ~352917739089 tries per task
[DATA] attacking service http-get on port 80
[ERROR] Child with pid 3320 terminating, can not connect
[ERROR] Child with pid 6620 terminating, can not connect
[ERROR] Child with pid 8496 terminating, can not connect
[ERROR] Child with pid 9260 terminating, can not connect
[ERROR] Child with pid 7440 terminating, can not connect
[ERROR] Child with pid 6012 terminating, can not connect
[ERROR] Child with pid 5368 terminating, can not connect
[ERROR] Child with pid 6228 terminating, can not connect
[ERROR] Child with pid 8104 terminating, can not connect
[ERROR] Child with pid 7644 terminating, can not connect
[ERROR] Child with pid 10152 terminating, can not connect
[ERROR] Child with pid 2484 terminating, can not connect
[ERROR] Child with pid 4788 terminating, can not connect
[ERROR] Child with pid 7948 terminating, can not connect
[ERROR] Child with pid 9040 terminating, can not connect
[ERROR] Child with pid 2648 terminating, can not connect
[ERROR] Child with pid 6116 terminating, can not connect
[ERROR] Child with pid 2684 terminating, can not connect
[ERROR] Too many connect errors to target, disabling http-get://localhost:80
0 of 1 target completed, 0 valid passwords found
[ERROR] 1 target did not resolve or could not be connected
Hydra (http://www.thc.org/thc-hydra) finished at 2014-01-09 11:24:47

Can you tell me what is wrong with my test? My form at http://localhost:8088/admin/login looks like:

  <form name='f' class="marg-left" id="inputForm" method="post" action="j_spring_security_check" >

                       Login failed

                   Login

                       Username
                       <input id="id1" class="textInput" type="text" name="j_username" />

                       Password
                       <input class="textInput" type="password" name="j_password" />

                       <button type="submit" >Login</button>
                       <button type="reset" >Reset</button>

                   </form>

it looks like you've put the port option (-s) after the HTTP Post form URL and as a result Hydra is ignoring that option.

If you look at the error message you can see it's trying to connect to port 80 (the default)

[ERROR] Too many connect errors to target, disabling http-get://localhost:80

I'd try moving that -s option to earlier in the command line, that'll probably sort it.


Is this url verification with startsWith secure? I would like to know if this code is secure to validate that a url is from my domain before loading it a webview in android :

if (!url.startsWith("https://www.example.com/test/")){
   // don't load the url
   dontload = true;
}

It looks secure but do you know if there is any way to bypass it ? Maybe with URL encoding ?

I use this code in onPreExecute to set the boolean that is checked before loading the url.

I get the url from url = getIntent().getDataString()

Such check is safe.

A similar check might be error prone. For instance, if you used

url.startsWith("https://www.example.com")

it could give an unexpected result, if you had a URL like

https://www.example.com@www.google.com

The part before @ would be interpreted as a user+password. But it user+password cannot contain unescaped /. The URL you test includes / (...com/...), thus your against such attacks.

I don't see any weaknesses in your check.


What makes it difficult for Facebook to implement restriction/ACL for accessing uploaded photo? Facebook claims to allow restrict sharing to friends, certain network, or even custom when I upload photos.

But it appears that this security is only in effect for the page where the photo is hosted. One can use the "Copy image URL" or the equivalent in one's browser, and you can forward this URL to anyone, who will be able to see it without even logging in to Facebook.

This looks weird, because I've seen companies without a superstar IT security team be able to restrict their images/resources with LDAP or something similar. Why can't Facebook do this?

Images are available through a CDN. This promotes faster loading and lower system load. It's also rather crucial for anything that's marked as public content.

Since users can still copy and reupload images (to Facebook or elsewhere), the value of preventing CDN access to a known URL is very low. The technical complexity to add ACL rules is not immense, but it does increase complexity while providing little-to-no value, require remote caching and code evaluation (probably not the kind of thing you want a 3rd to handle or have access to), and increases hardware costs.

Thus, the benefit is next-to-nothing and the cost, though not immense, is substantial.


Possible SQL injection vulnerability? I'm a developer and I'm creating a script to interface with game servers to update player stats. I was sending a POST request with multipart form data and on the last boundary accidentally had the wrong boundary.

Content-Type: multipart/form-data; boundary=--------484554302

But one character was missing ----------48455430-- which triggered this response from the server:

MySQL error 1064 (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\r\n----------48455430-- = '' WHERE id = '463413'' at line 1)

I don't know too much about SQL but this seems like a potential vulnerability. Any advice?

Looks like you're passing whatever is supposed to be in the preceded set of data to MySQL without proper encoding or the use of prepared statements. As a result, MySQL is interpreting the boundary as SQL code, and throwing an error that it's not valid SQL.

At the very least, you need to encode any data which is included in SQL queries. Better yet, force the data to a specific type - if you're expecting an integer, ensure that only integers are allowed through, rejecting anything that isn't an integer before it hits the database. Even better, do that, and use prepared statements.

Prepared statements enforce the separation between executable SQL and data you're using within the SQL, so even if unexpected data makes it through, the database won't treat it as part of the SQL statement, but instead attempt to use it as data. They are available for most commonly used web languages with most common databases. They aren't perfect (see Are prepared statements 100% safe against SQL injection?) but they are a lot better than including raw data.


OAuth2 Implicit Flow: Possible Attack Vectors of Refreshing Token via CORS? We are currently implementing a Single Page Application (Angular2) and thus have run into the standard "how do we secure our backend API" problem.

The standard solution to this apparently to use the OAuth2 Implicit Grant Flow, which is all fine. We are implementing an custom Authorization Server which authenticates using our Web SSO Solution (Open AM/SAML), checks for licenses, and then issues Access Tokens via the API Gateway (Mashape Kong).

The Access Token is (as specified in the OAuth2 Implicit Flow) passed back to the SPA using a redirect, giving the access token in the fragment (https://my.spa.com/#access_token=asdfasdf&token_type=bearer&expires_in=1800).

So far, no specialties. Now: The access token is only valid for a short period of time, and there is no refresh token; we do not want the end user to actually be redirected to the Authorization Server again (it would look bad/flicker/...). Our idea was to use the existing session with the Authorization Server (which we implemented, see above) to refresh the access token (create a new one) via a CORS call to a special end point of the Authorization Server (let's call it /heartbeat).

Obviously, this requires a couple of things to be done:

The Origin needs to be exactly the calling application's host, and the Auth Server needs to verify and reflect that in the preflight response
The client application needs to do the CORS call with activated withCredentials: true (using XMLHttpRequest, credentials: include for Fetch)

We did a test implementation of this, and it seems to work quite nicely, but I still want to ask you guys as experts on this: Are there (additional) attack vectors when enabling this kind of refresh? In addition to the usual suspects for the implicit grant, that is.

Best regards, Martin

Instead of going with a completely different approach that as you mentioned would warrant a more thorough review from a security standpoint I would suggest leveraging what's already specified in OpenID Connect - the support of an immediate authentication mode through the use of prompt=none.

  While SPAs cannot use refresh tokens, they can take advantage of other mechanics that provide the same function. A workaround to improve user experience is to use prompt=none when you invoke the /authorize endpoint. This will not display the login dialog or the consent dialog. In addition to that if you call /authorize from a hidden iframe and extract the new access token from the parent frame, then the user will not see the redirects happening.

(source: Auth0 - Which OAuth 2.0 flow should I use?; emphasis is mine)

Your authorization server will need to support this additional request parameter and also support auto-approval for requests/scopes that were already authorized by the user.

The main benefit of this approach is that it's leveraging most of what already existed so it does not significantly increase the attack surface as it would be the case for a completely new and different approach.

Check the Auth0.js library for a reference implementation in how this type of silent authentication could be accomplished.


How can a phishing page know my account information? I clicked on a phishing website. I was surprised to find that this website looked exactly like google and had my information displayed. The information displayed were my email and my profile picture. I quickly left the website without knowing what to do. Can someone access my google account even if I changed the password?
I use the same password for a lot of websites. (more than 150)
Do I have to change that password for all the websites?

To answer the top-level question, lots of possibilities here:

It was an actual Google login page, aiming to get you to do something (like grant access to a malicious service) other than steal your credentials.
The picture was the same HTML img tag that Google uses on their own login page, which naturally retrieved your picture when used with your browser (cross-domain loading of images is normal and generally allowed).
It was content overlaid on the Google page, probably using an iframe. This is probably not the case, as Google blocks iframes on most sensitive pages.
You had shared information (including name, picture, email address, etc.) with a third-party site (such as a forum, social media, or so on) and that information was used to create the phishing page.
You had communicated with, or at least allowed communication with, the attacker over some network (such as Google Hangouts or Skype or something) that displays an image and your email address.
The attacker guessed your information on the basis of your email address and/or name, if they had that from elsewhere or were just able to guess it.

Several of these can be combined (for example, the second bullet - using Google's usual image link - might combine with knowing your email address from a third-party site).

I use the same password for a lot of websites. (more than 150)
Do I have to change that password for all the websites?

YES!
I cannot stress strongly enough how terrible an idea it is to repeat the same password across so many sites! That is ESPECIALLY true if it includes sensitive sites (like your email account, which can usually be used to reset the password for anything else) and also casual, low-sensitivity ones (which, if you have over 100, it almost certainly does)!
To be clear, this isn't because you visited a phishing page. Just clicking the link, but leaving before you entered anything, is usually not a disaster. It's not even because the page had your account info; that's concerning but not hugely so (see the first part of the answer). This is because re-using passwords is never a good idea.
What happens if one of the sites gets compromised? Have you checked https://haveibeenpwned.com/ to see if your account was ever breached? If so, they got all your sites!
What happens if one of the sites you used has an untrustworthy administrator or is straight-up malicious? Allow XKCD to illustrate this for me: https://xkcd.com/792/
So... how do you avoid password reuse, when you've got so many sites?
Use a password manager
There are multiple good ones out there. LastPass and 1Password are probably the best known, but there are others (this site discourages recommending specific products). Password managers have all kinds of good properties:

They remember, and can auto-fill, any number of unique passwords (even multiple passwords for one site, if needed).
They can generate random passwords (humans are terrible at this).
They keep a record of all your accounts so you never have to wonder whether you have one, or what its info was.
They can store other info beyond just passwords, like usernames and those BS "security question" answers.
They can even store payment card info and other secrets like that.
They can report when passwords are re-used across sites (again: THIS IS VERY BAD).
They can securely share passwords (or other items) between users, if you need to e.g. share your password to a particular account with your spouse.

One last thing:
Turn on multi-factor authentication
Many sites - especially security-conscious ones - let you use multiple factors (not just a password) when you log in. This means that even if somebody gets your password they still can't log in as you! Very important. There are lots of choices for the second factor (passwords are still usually the first). The better forms of MFA can even protect against phishing pages.
In order of increasing quality:

SMS or phone call - weak (it's easy to hijack phone numbers), but better than nothing.
TOTP (Google Authenticator and the like) - can be kind of a hassle but decently secure and widely supported.
One-time codes from an external device (like a Yubikey or RSA authenticator) - sometimes more convenient than TOTP apps, possibly harder to steal.
Push notification to an app - not widely supported, but more convenient and pretty secure.
U2F / FIDO2 from the browser/machine - can protect against phishing attacks, very convenient if you always use the same device (or small number of devices) and they support it.
U2F / FIDO2 from an external device (Yubikey or similar) - protects against phishing, very secure, usually pretty convenient, not super common yet but getting better.


What is the fight-back mechanism in OSPF? I want to know more about the fight-back security mechanism in OSPF routing protocol.

When is the mechanism activated and how does it work?

I found the source description of OSPF fight-back, but the description is vague.

OSPF is a routing protocol in which the various routers involved in the process periodically shout: they broadcast "Link State Advertisements" which tell the other routers how things look like in their own vicinity. The fight-back mechanism is the following: when a router observes a LSA which states falsehoods about itself, the router is allowed (and actually encouraged) to immediately send another LSA which sets the record right. It is a metaphor of the antique Agora: to counter liars, just stand in the Agora yourself and whenever you hear a lie about yourself, shout "this is not true".

This is not a very effective security mechanism. It is not officially a security mechanism either; the behemoth OSPFv2 specification does not contain the word "fight". Actually the specification deals very little with security (the "Security Considerations" section is only half a page, for a 244-page specification). This draft is a more thorough security analysis of OSPF; see in particular sections 4.1.3 and 4.1.4 which explain how to circumvent the fight-back mechanism or even turn it into a tool for disruption (in the Agora metaphor, you may use the fight-back to create an ear-shattering shout contest which drowns normal conversation).


unable to locate package Arpspoof Can not find the tool arpspoof by using the apt-get install on Kali.
After checking by typing apt-cache search there is no result either.

Does this mean the tool is not available anymore?
Thanks.

I found out that arpspoof is a tool from the dsniff package. As long as you install it, then the arpspoof is ready to be used.

  The tool used here is called arpspoof and is distributed in the dsniff
  package.


Does hashing a file from an unsigned website give a false sense of security? Consider this.  Many websites with software downloads also make available MD5 or SHA1 hashes, for users to verify the integrity of the downloaded files.  However, few of these sites actually use HTTPS encryption or digital signatures on the website itself.

So, if you're downloading a file from what is effectively an unauthenticated source, and validating it with a hash from the same source (or even another unauthenticated source), what is the real value of hashing the file?  Does this not establish a false sense of security, since (in the absence of a digital signature) both the download and the hash could have been tampered with, without the user's knowledge?

So, if you're downloading a file from what is effectively an unauthenticated source, and validating it with a hash from the same source (or even another unauthenticated source), what is the real value of hashing the file?

The provided hash lets you double-check that the file you downloaded was not corrupted accidentally in transit, or that the file you downloaded from another source (a faster mirror) is the same as the file available for download at this website.

However, there is not really much additional security. A sufficiently skilled cracker can replace the file with a maliciously modified version and the hash with one that matches the modified file; or he can MITM the requests over the network and replace both the file requested with his own and the hash with his own.


Is it safe to browse tor on a virtual machine using a non root user BUT the vm is using the host device's network card/adapter? Sorry for the long title.

I've been following this online course on ethical hacking and there was a part on how to set up VirtualBox and installing Kali Linux, as well as creating a USB Passthrough for the usb adapter so that Kali can use it. I have successfully followed on this tutorial however, the tutorial recommended that I use a network adapter whose chipset fell under the categories of aircrack-ng (I think it was for sending special/custom packets or something to that effect). Seeing that I might not need to perform operations on packets yet, I figured that I might be able to make do with a realtek rtl8188cus usb adapter we had lying around, then I'll just get the real thing when the lecture calls for it.

However, the next lesson on the lecture was browsing tor and I found the realtek usb adapter to be a bit inconsistent with it's performance. I'd get varying download speeds (and I'm the only one using the WiFi in our house) and sometimes it would disconnect, and I wouldn't see our WiFi network in the list of available networks. However my laptop - Macbook Pro - did NOT disconnect and can see our home network just fine. Kindly note that I didn't change the position of the usb adapter, and I even placed it on a usb extension cable so it can be closer to the router (note that I'm just 7-10ft away from our router).

I wrote this off as an inconsistency of the usb adapter and decided to change the network setting of the virtual machine to use NAT for the moment instead of "Not Attached" in order to download the tor browser.

Now, my question is, is it safe to browse tor on a virtual machine that uses the host device's network adapter? Kindly note that I made another non-root user for tor browsing purposes.

I feel like it's supposed to be safe and I'm just letting my caution/paranoia get to me.

Any help is very much appreciated.

When someone compromises your virtual machine and you're using the host's network adapter, he might learn the host machine's mac address. This might compromise your anonymity. I think the FBI used an attack against Tor users using Tor for illegal purposes a few years ago that recorded the MAC address of the user's computer, so it's not just a theoretical danger.

You could change your MAC address using software on the kali installation. However, this is just a first line of defense; the hardwired MAC address can always be recovered if the attacker gains root access to your virtual machine. Virtualbox might support spoofing of the MAC address, but again, this is just another layer of defense.

An attacker might also be able to listen to your host's traffic and, depending on the network adapter, to all the wireless traffic in your vincinity (but this is also possible using a dedicated network adapter).

Then again, he might also break out of the virtual machine alltogether. There are a few working attacks that break out of VMWare on Youtube; I'm sure there are some for virtualbox too.

But I'm not sure I understand your fears: Ethical hacking is, by definition, ethical, so why would your anonymity matter?


How to make sqlmap exploit an SQLi vulnerability I have found a simple boolean blind SQL vulnerability and want to let sqlmap do the iterating for me but it doesn't seem to work, I have the impression it tries to start at a point that I'm far beyond.
Here are the details. The vulnerability is like this

http://host/path?param=123

and I can query like this

http://host/path?param=123' or 10 = (select len(system_user()));--

(URL encoded of course). If the second or condition is true I'll get somewhere in the response "Found 1000 hits". If it is false there will be "Found 0 hits". So now I can easily do a binary search with

http://host/path?param=123' or 100 < (select ascii(substring(system_user(), 1, 1));--

character per character (it is MS SQL Server in case you haven't noticed). This looks so bloody easy I cannot understand that sqlmap keeps telling me "param doesn't seem to be injectable". Here is the sqlmap call I've tried:

sqlmap -u "http://host/path?param=123" -p param --current-user --dbms mssql --prefix="123' or " --suffix=";--" --risk 3 --level 2

I've played with --risk, --level and --technique=B and also --string="Found 1000 hits". Nothing helps. How can I tell sqlmap to not search for anything but just do this silly iteration?

Since you mentioned that you found a boolean based blind SQli, you will require a sqlmap input such as the one below:

#sqlmap -u "http://host/path?param=123" --technique=B --level=5 --risk=3 --random-agent --dbms=MSSQL

--technique switch will force only Blind SQLi Attacks
--random-agent will ensure you use a legit user agent, most of the vulnerabilties fail to get exploited if you don't provide this since
the site may lock you out seeing an unknown agent
Increase the level
Also, your query doesnt have any other parameter so skip providing
the parameter part and suffix and prefixes


How can a client validate a OCSP Responders Delegate Certificate and how does it obtain it? In RFC 6960 4.2.2.3.  Basic Response the response components are defined. This list does not contain the OCSP Responders certificate. If the responder is a delegate, the requester does not have a copy of the responders certificate up-front. How can it be able to validate the response and check for id-kp-OCSPSigning in the OCSP response signer's certificate?

Actually, the bullet list does not contain the certs. But directly underneath it is mentioned:

  The responder MAY include certificates in the certs field of
  BasicOCSPResponse that help the OCSP client verify the responder's
  signature.

And in B.1.  OCSP in ASN.1 - 1998 Syntax

BasicOCSPResponse ::= SEQUENCE {
  tbsResponseData          ResponseData,
  signatureAlgorithm       AlgorithmIdentifier,
  signature                BIT STRING,
  certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }

Thus the answer to my question is: The client looks for a certificate in the certs list of the response that matches the ResponderID in either name or key hash:

  o  either the name of the responder or a hash of the responder's
        public key as the ResponderID;

Then it validates the chain to verify that the response was signed by a trusted or authorized responder.

I found it helpful to review the Verify existing OCSP Basic Response implementation in PKI.js


Would you go with SSD or Disk Hard Drive? I haven't really heard anything on how the Soild State Drives are doing out in the real world and I was wondering if they are better than traditional hard drives. Is a SSD more secure or less secure than the traditional hard drives.

Summary thoughts:

Bad: SSD model that has a lousy secure erase mechanism.
Good: Any standard HDD; SSD model that is known to be good.
Best: SSD or HDD with hardware encryption. Any medium when using full disk encryption.

Detail:

Some background answers from other questions that will help out:

SSD (Flash Memory) security when data is encrypted in place

How can files be deleted in a HIPAA-compliant way?

I think the only security difference between SSD and HDD technology comes when you discuss repurposing a drive. If you're in an environment where storage is repurposed, you need to make sure that the SSD drive you select can be reliably cleared. There are many models that don't do that properly. See SSDs prove difficult to securely erase for some info on it.


Is this CORS exploitable? So i was able to upload a html file on a server i'm allowed to test. The file is uploaded on a subdomain of the main server. Knowing that they allow CORS for anything.domain.com, is it possible to exploit this CORS by uploading a POC html page and send the CORS data to my external server?

This site is vulnerable, if the following assumptions are correct:

example.com has something to attack (data you want to retrieve that only other users can see, or actions you want to take that only other users can take).
example.com uses cookies (without the samesite flag) or HTTP authentication (basic or digest) for session management, instead of using something like tokens stored in local/session storage.
CORS requests from subdomain.example.com sent to example.com receive a response with Access-Control-Allow-Origin: subdomain.example.com and Access-Control-Allow-Credentials: true.
The requests you want to make (in somebody else's session) to example.com are simple requests (they use content types that could be sent from HTML forms and no custom headers) or else example.com allows subdomain.example.com to specify those content types and/or headers in CORS requests.

Assuming all of the above points are true, you could write a page that makes malicious CORS requests to example.com (stealing other users' data, or stealing CSRF tokens and using them to launch CSRF attacks to take actions as other users) and (if relevant) passes the responses somewhere you can retrieve them, upload that page so it's served from subdomain.example.com, and trick victims into visiting your malicious page while signed into example.com.


How can an attacker eavesdrop on users in public WIFI? I want know why it's said that public WIFI is not safe for banking transactions or entering password for online accounts etc. I want to imitate an attacker and try to harvest as much information as I can from my local wireless network in my home with a couple users. I have a background on working with hacking tools included in Kali linux or Owasp on Microsoft Windows.

In order to imitate a controlled attack and to know how much information can be gathered and how it's done, I'm looking for a way to sniff in my local network and find out what data other devices are transmitting over the network, like passwords, keywords transmitted over the network (HTTP and if possible also HTTPS websites). these are the things that come to my mind when I think about an unsafe public WIFI and what nefarious things an attacker can do to obtain data.

I have a second question regarding this, because I have access to my home wireless router, can I setup a local DNS server on my Windows or Linux (VM) and it work as a relay DNS server (i.e doesn't contain any DNS data, only be used to direct the data being transmitted over the network to my computer so that I can see the data) ? is it possible, and if yes then please point to the right direction and how can it be done. if not, please explain why and what other options do I have for my purpose? or what an attacker with enough motication actually would do in a situation like this?

When accessing a public wifi an attacker might use applications such as wire shark to capture packet information (the data of users), if encrypted the attacker will most likely attempt some kind of MitM

MitM ARP poison, this will essentially tell the victims machine "Yo, Im the next hop I swear". with this the traffic could be directed through the attackers machine.

how would the attacker deal with this? well thats tricky because an attacker could either redirect all 443 traffic to 80 but alot of websites patched that common easy problem years ago.

The attacker could DNS steal and send the user to his own custom webpage (which could be a spoof of a common website and it would appear ligit)

being within a network as well gives you in depth sight to those on a network and their activity, some times people even broadcast their files to the world. Also not just this but you can also try more attacks out which firewalls may be strengthen from.

There are many more possibilities of what an attacker could do but this is a few points!


Security Controls Categorization I'm doing research about Information Security Controls. Considering that the topic is very wide, I would like to organize in macro categories the security controls that can be adopted by an enterprise to reduce the risk of attack.

For example:

Control Category 1: Vulnerability Assessment
Control Category 2: Patching
Control Category 3: Firewall & IPS

Is there any list of security controls or any categorization like this?

There are several models already designed for you not to think precisely on categorisation of threats, but to create a safe architecture. The worldwide known entity about this is called NIST, who provides a Policy Framework about cibersecurity.

You can check out on the official site but not before getting an intro about NIST here and here (Wikipedia).

FYI, NIST is recognised worldwide, but it is still a national entity in the USA.

If you find it a little bit heavy, another alternative can be the Ishikawa model which categorises threats by kind and I’m not sure if provides strategical solutions for each sector.

Ishikawa diagram

I think there is no official site for this, but there is plenty of information about it anywhere.