Recovery possibilities with Zero knowledge encryption I have some encryption understanding however I fail to get my head around following scenarios. I would like to know if they are possible with a zero knowledge encryption system.
What the system can or can't do can be added to the answer.
Example:

The system needs to keep a encrypted copy of the key.
The user has to have the key on a USB stick.

In the end, all scenarios ask the same questions.

Can the user access his data?
Does the system know about his data?

Scenario 1:
User logs in on a new computer.
Does not have the key with him.
Scenario 2:
User logs in on a new computer.
Does have the key with him (e.g. USB stick).
Scenario 3:
User lost his password. His identity has been verified and approved.
Scenario 4:
New sub-users are assigned to the same resource.

The main approach of the Zero knowledge is to derive a standard key from a password (using dedicated algo like PBKDF2).
With this approach, you can consider the following :

The system does not need to keep an encrypted version of the key, as the key is regenerated, when needed, from the user password.
The user does not need to have the key on a USB stick. As the key is derived from the password, only the password has to be stored (in the brain of the user).

All the beauty of the ZK model is about decrypting at the client side so the cleartext data are never located on the server side.
So, yes the user can access his data and No, the server does not have to know the data.
I didn't use the formulation "the server cannot know the data" because the ZK model is not perfect as the client side gets the code to execute from the server.
So, a compromised server could send malicious client side code crafted to send back cleartext data after they are decrypted by the user.
About the fact that we use a password instead of a key. You could think that is weak because, as the key is derived in a deterministic way from the password, the entropy of the key is finally the entropy of the password.
But, algorithms like PBKDF2 are designed to be robust against bruteforce (with many rounds of hash function). So, even if the password entropy is 80 bits (instead of 128 bits for a key), the attacker cannot test many passwords per second. But with a direct usage of a 128 bits key, he could try billion of keys per second.
This is why it is considered acceptable to use a password instead of a key as long as the password is not too easy to find.
Designing a architecture where the server does have zero knowledge but can let the user recover its data, if he lost his password, is difficult (at least).
Most of the solutions assume that your data are definitely lost if your forget your password and it is a assurance of security.
One possible solution is to give the user a recovery key when he sets its password and warn him to keep this key somewhere physically protected (but this key is not stored by the server as he never accesses it, only the client side).
Sharing data between users can be achieved by using an unique key which is dedicated to encrypt the data and then, this key is encrypted by the key of each user.


How os fingerprinting works and how to prevent it in browser? For privacy I always changed my useragent of browser regularly and it used to work. But lately changing useragent alone in browser dosen't prevent os fingerprinting. Tools like https://browserleaks.com can correctly guess my os eventhough I have used private mode with vpn, changed my useragent, disabled javascript and flash, added adblocker and other types of privacy extensions and manually hardened the browser. Even after this  browserleaks knows my os.

How does os fingerprinting works in browsers and how to prevent it?

Probably you need to combine two methods:

At application level, for example HTTP, by changing the User-Agent and probably other fields.
At network level, changing IP TTL, TCP window sizes, and so on

Probably with that should be enough but may be I'm missing some of them


Preventing fraudulent access to restriced resource on the web? I'm working on a web application along with a web API and I've been warned against what seems to be a basic vulnerability: not checking that the user making an action has sufficient privileges on the resource being accessed. I can't find resources or any best practices.

Here's a scenario:
The URI to access a bank account details is domain.com/details/1234, with 1234 being the user ID. A malicious user can see the URI pattern and try to access domain.com/details/1230. If nothing is done, since he's logged in, he'll see the details for another user.

First, does this kind of vulnerability and related attack have a name? Second, what are the best practices to prevent this? On the web that seems fairly simple, we can simply check the session/ID cookie to compare with the owner of the requested resource. But the API will be used by a mobile app, where cookies are not available. What would be a good way to protect the API?

Are you sure that there aren't any cookies available by a mobile app, often this is the case. Also this is known as horizontal privilege escalation. If you can only see details of other users I would also add user enumeration.

If you want to check how these requests are performed you can put a proxy between your phone and the internet (like ZAP or Burp)to see what it actually passes on to the server.

The best practice is to NEVER EVER put session IDs in GET requests. There is a reason why we have cookies and mobile apps support cookies just like any other application. Most mobile banking applications I have seen use a REST API with JSON which doesn't necessarily use cookies (but can although than it's not completely stateless). Often the queries are signed with a type of private key or token.


RBAC: how to separately scope two resources that have a many-to-many relationship I'm working on an application that needs access control. Basically, the problem I'm facing is this (heavily simplified):

The application has two main sections:

Files = File[]
Contacts = Contact[]

A File resource can have many contacts assigned to it. Conversely, a Contact resource can be assigned to many files.

What I want to do is create three roles:

  Clerk:

  has create, read, and update permissions, scoped to the    Files section.
  does not have access to Contacts section (i.e. can't create, read, update, or destroy)

  Contact manager:

  has create, read, update, and destroy permissions, scoped to the Contacts section
  does not have access to Files section (i.e. can't create, read, update, or destroy)

  Admin:

  has create, read, update, and destroy permissions, scoped to Files and Contacts section.

For the third role (Admin), I see no conflicts. The first issue arises when a Contact Manager wants to destroy a Contact resource that is linked to a File resource (that, as a Contact Manager, he/she doesn't have access to).

In addition, I'd like to take the roles one step further, and for example give them certain CRUD permissions for Files as well as Contacts, but have a scope within Files and within Contact (e.g. permissions apply to Files of type X, and Contacts of type Y).

Then other issues start arising: what if a certain role destroys a Contact, that is linked to a File that the role does not have access to? What if a role has access to a subset of Files, and a subset of Contacts, but one of the Files the role has access to, has Contacts linked to it that the role does not have access to?

Is there an elegant way to solve this using the RBAC model? I've also looked into ARBAC, but it seems like overkill for a relatively simple application. To me, it seems that the root of all the issues is the many-to-many relationship between Files and Contacts.

Are there specific ways to deal with a situation like this? I'm fairly new to this, and these permissions just landed in my lap for this project. I've looked into several Access Control models (even OrBAC), but none seem to be able to address this issue.

Any help or hints in to the right direction would be greatly appreciated.

Your data model looks like a graph. Contact --- assigned to --- File, and vice versa. So the assignments are links (edges) in the graph.

I am assuming that there can also be multiple contacts assigned to a single file or multiple files assigned to a contact. How would you handle deleting a contact that is assigned to a file which is assigned to another contact? If you delete a contact which would delete a linked file, then that would leave the other contact "hanging".

I would suggest to treat the assignments i.e. the links (edges) as a scope as well that could have create, destroy, update permissions. Give roles permissions to assignments as well.

You need to make sure that for a contact or file to be destroyed, it should not have any links (assignments) to other file or contact. This will prevent the "hanging" situations described above. So a node can be destroyed only if it does not have any edges.

If a user tries to destroy an object which has links to other object, then throw an error such as "Cannot delete contact which has assignments to other files. Delete the assignments first".

Now, you can assign the CRUD permissions for assignment scope to the Clerk and Contact Manager roles. If a Contact Manager tries to delete a contact with a file assigned to it, then they need to destroy the assignment first (for which they have the destroy permission). Once all the file assignments to that contact are destroyed, the contact can be destroyed. The responsibility of deleting files is anyways with the Clerk which can be deleted provided it does not have any contact assigned.


Does the haystack theory work The haystack theory is the recommendation to put repeated characters in your password in order to make it harder for brute force to reveal.

Does this have any mathematical basis? Or is it snake oil?

The "haystack" is just a metaphoric way to describe brute force. The idea of "repeated characters" in passwords is a poor one.

The whole password game is that the defender (i.e. the user) will draw his password from a "set of potential passwords", and the attacker will walk this set until he finds the right one. Larger sets imply more work for the attacker, but also for the defender because that's more choices to remember.

If users were robots, then "repeated characters" would be as good an idea as anything else: like love, entropy is blind, and does not mind how you achieve the set of possible passwords as long as there are sufficiently many. However, if users were robots, then they would use random 128-bit keys as "passwords" and the whole discussion would be moot. In practice, human users are human and this implies that human brains will have to do the remembering. The point here is that the "memory resources" spent on remembering a specific password feature do not equate at all with a fixed number of extra entropy bits.

If you take a password as a "normal word" and then double one letter (e.g. "passwword") then the effort needed to remember that this specific letter is doubled is quite big compared to the actual gain (for an 8-character source password, you get 3 bits of entropy out of the choice of the letter to double -- in fact a bit less because many people would elect to double the "o", because "Google", not "goggle"). That's the whole idea behind the famous comic which was discussed in this question: to get the most entropy out of human-remembered password, you must generate passwords in ways which map well to the best abilities of the human brain. Humans are very good at talking and are highly trained at reading and writing (through years of toil), so you should use words for passwords. Most "password improvement" tricks like including digits and punctuation signs or, for the case at hand, repeating letters, are at odds with the mind. They are therefore counterproductive.

In less words: instead of doubling a letter, add another word. This will be a much better use of your brain cells: it will give you more security for less effort.


Can a Slow Post HTTP attack be done from a single client? Can a Slow Post HTTP attack be done from a single client?
The following source cites this line:
https://medium.com/fantageek/understanding-socket-and-port-in-tcp-2213dc2e9b0c

Ports are 16-bit numbers, therefore the maximum number of connections
any given client can have to any given host port is 64K.

But since the max. number of connections a server can handle is usually much greater than the above limit (around ~300k but scalable), I assume that the Slow Post HTTP attack can only be done as a DDoS attack (using more than 1 client).
But I can also see descriptions about Slow Post HTTP attack as DoS attack.
For eg. https://blog.qualys.com/securitylabs/2011/11/02/how-to-protect-against-slow-http-attacks states

Slow HTTP attacks are denial-of-service (DoS) attacks in which the
attacker sends HTTP requests in pieces slowly, one at a time to a Web
server.

Please let me know if I am missing something.

Yes it can, in fact basically that type of attack tries to consume the internal memory that is handling the buffering of the post operation. In general the backends have parameters for handle this type of situations.


Scan my network externally So I'm about to undertake Cyber Essentials as our first step towards nailing as best as we can our security. I have done quite a lot of work on locking down our network, however, I would like audit the internal network externally to see if anything is exposed or public accessible (Printers, Routers etc). I use OpenVAS within the network to run scans but is there anything I can use (OpenVas or otherwise) to check the network externally?

Any help would be appreciated

I would recommend having a look at cloud based vulnerability scanners. You can also find a number of web based nmap scanners that will scan your public facing IPs for some common ports. (usually for free)

If you are UK based (and since you are going for cyber essentials I assume you are) I would also recommend joining the NCSC Cyber Security Information Sharing Partnership (CiSP). One of the services they offer is “access to free network monitoring reports tailored to your organisations”. Basically these are reports that will highlight any services on you pubic addresses that look risky.  This is a free service offered to all member organisations.

This will likely allow you pass this section of the Cyber Essential + audit.


Can TLS provide integrity/authentication without confidentiality It was a bit surprising that Wikipedia has switched to TLS because we all know it's public information available to anyone, but I suppose that the real purpose for that is to provide authentication/integrity so that no one can tamper with the articles in transit like Chinese or other governments. Looking at the certificate information in Chrome browser I see that they use AES for encryption. Why is that needed, since it is possible to provide only integrity without confidentiality which will save a lot of resources.

Is it a problem with TLS that it does not allow selecting None or something as ciphersuite?

Or is there some other consideration that I did not think of?

There are a couple of cipher suites that provide integrity and server authentication but no encryption (e.g. TLS_RSA_WITH_NULL_SHA256). However, no browser supports them, precisely because they do not offer encryption, thus requiring some sort of user interface to let the user decide whether the site he wants to reach requires encryption or not. From a usability point of view, this would be inconvenient; also, users are notoriously bad at making informed security decisions.

For these reasons, browsers only support cipher suites with strong encryption. This is not a problem in practice, because the computational cost of encryption in that context is mostly negligible (even an anemic smartphone can encrypt data ten times faster than it can download it).


Biometric versus other Two Factor Authentication Mechanisms Over the years biometrics is the go-to movie authentication mechanism, but in the real world I'm getting conflicting opinions about it.  Everything I've learned shows that biometrics are flawed because of two main reasons: they are non-revokable credentials, and they can easily be forged.

So what is the state of the nation when it comes to biometrics usage compared to other mechanisms like smart cards or OTP?

There's a few other reasons:

Error rate - false accepts and false rejects are still unacceptably high for many types of biometrics.
User acceptance - still not widely trusted by users - the various privacy concerns are still quite high, and the idea that a part of your body is now a security mechanism is somewhat freaky for some folks.

Security best practices these days (like the CISSP certification's baseline for security practices) don't point towards Biometrics being the end-all, be-all for security.  The best practice is to build a system with a collection of authentication mechanisms that are appropriate for the system, the information in it, the expected threats and vulnerabilities, and the ways that the system must be used.

I don't know that anyone could say beyond doubt what the "state of the nation" is - that's a pretty broad assertion.  But I can say that common best practices don't currently force biometrics as a one size fits all solution.  I'd say, at best, they are something that is still under development and treated with a certain amount of dubiousness.


Metasploit through webshell I was able to get a php reverse shell on a webserver, say X that is behind all sorts of perimeter security stuff.

Now I want to target a machine on the same LAN with X, how do I setup metasploit for that and set LHOST etc?

Try to forward that host and target port with reverse proxy and then set the reserve proxy address and port pointed to target as LHOST and LPORT.


How to secure JSON data that is shown on web service page? I have an iOS app that uses a web service to get data from my server. It grabs the data and echoes a JSON feed to the web page, and the iOS app interprets it. I have SSL so I am not worried about the data not being secure in transit.

My problem is that anybody can access the web service page and read the JSON data. It would not be hard for someone to build a program that interprets this data and the data includes sensitive user information.

I want to know how I can either make sure people can't just type in the URL and view the data, or some way to encrypt the JSON feed that prints out securely so that you need the keys to read it.

It simply sounds like you need to add authentication to the web service.

From your description it appears that the request goes like follows:

App --> Web site --> Web service

If users have to register for your service, then when they log into the app it should authenticate with the web service and retrieve an authentication token. Ensure that the web service authenticates and authorises the user before any date is returned.

App [Auth Token] --> Web site [Auth Token] --> Web service [Auth token]

Then if anyone goes to the web service endpoint directly, they won't retrieve any data as they won't have a valid auth token.


AES Key Generation Strategy/Algorithm For Offline System Let say I have several application that aren't connected to any network, and I have one requirement that says each application could produce a token from an input that other application could validate the token provided the same input is given to it.

For example, a person accessing application 1, input a string and get a token, then he/she travels to application 2, input the string and the token to it, then application 2 tells to the person if the token is valid or not. Even thought the token is exposed to users, it should be safe enough that no one could fake it.

In prototype phase, I simply encrypt the input using AES with a hard coded 128 AES Key and then obfuscate the cipher text a little to generate the token. But I still have some worries as I get an impression that using same static key for symmetric are vulnerable and easy to compromise.

Because there's no means for these application to talk to each other and which application will validate the token generated by which application, I'm planning to use some kind of AES Key generation to renew AES key periodically for all applications. I was hoping that the key will be different from time to time, but all the application will be using the same key at anytime.

Is there exist an open standard algorithm or strategy to generate AES Key that meets my need above? Maybe I haven't look enough, but I can't seems to find it.

Thanks in advanced!

The most secure method is to use digital signatures.  Generate a public/private keypair.  Application 1 gets a copy of the signing key (private key).  Application 2 gets a copy of the verification key (public key).  A token is now a signed string, signed by Application 1.

When Application 1 wants to generate a token, it can simply sign the string; the token consists of the string and the signature.  Application 2 can verify the token by verifying the signature.

Note that this approach does not prevent replay.  If a person gets a token from Application 1, he can provide it to Application 2 as many times as he wants, and it will appear to be valid each time.

If you want to prevent replay, one way to defend against replay is to ensure that the string being signed contains all details of the request, and to ensure that the request is idempotent (performing it multiple times has the same effect as performing it once).  If you do that, replay becomes irrelevant.

Alternatively, another simple method is to have Application 1 include the current time and a random 64-bit number (a nonce) in the string.  Application 2 can check that the time is reasonably recent (say, no more than 24 hours old), and check the nonce is not on its list of recently-accepted nonces; if both checks pass, Application 2 accepts the token and adds the nonce to its list of recently-accepted nonces.  (You can garbage-collect this list periodically: there is no point retaining a nonce from a token that is more than 24 hours old, as the time check will ensure that token will not be accepted as valid.)

If you try digital signatures and find that they cause performance problems, another suitable replacement is to use a message authentication code with a symmetric key (instead of a public-key signature algorithm).  When using a message authentication code (MAC), there is only one key, and both applications will need a copy of the key.  In principle, MAC-based tokens are slightly less secure, because now you have more copies of the secret key floating around.  That said, in practice in most situations MAC-based tokens are probably acceptable.  The difference between MAC-based tokens and signature-based tokens is unlikely to make a big difference to the security of the overall system, as most likely the weakest link in your system will be something else.


How to (temporarily) disable McAfee Endpoint Security on an enterprise workstation? I need to temporarily disable McAfee Endpoint Security on an enterprise workstation after having obtained local administrative privileges. The McAfee Endpoint Security settings are protected by a password.

I've tried to stop the McAfee service and attaching a debugger to various McAfee components, but every attempt results in "Access Denied" (also for Local System). The reason is probably a low-level McAfee driver running on the system.

Also, I've searched the registry for a password hash, suggested by old articles, but I cannot find anything under HKLM\SOFTWARE\McAfee.

Finally, I tried to change several McAfee services from "auto" to "disabled", which resulted in Windows unable to boot (bluescreen) until repaired.

Anyone with suggestions or experience on the issue?

McAfee Agent 5.5.1.342
McAfee Endpoint Security 10.6

I will address the administrative, not technical aspect of this question, because you have specified an Enterprise setting, and you do not seem to be an Enterprise Admin.

You are obviously working in Windows, so I will assume an Active-Directory managed infrastructure, and I will suppose that your McAfee workstation clients are centrally managed.

You should talk to your security people and to your own supervisor.  If you are in security, this should be that much simpler.  You should either be working from a service request or similar, which if assigned to you should cover your butt.  If not, you should get written permission from your supervisor to go about disabling things, and your supervisor in turn should have written permission from security.

If these things cannot be had, then I respectfully submit that you are engaged in a certainly dangerous (to security and to your career) and potentially rogue activity.  None of this means malicious -- I also presume that you are acting in good faith.

Taking the most positive case, let us assume that you are working as directed, and are struggling to get something done which the company agrees needs to be done.  But the implications of cowboying around with security settings can still compromise your environment, and of course your own position.  You may appreciate a piece of advice which I came up with the hard way -- "it is fatal to care more than the company does."

If the company cannot or will not provide you with top-cover and approved tools to accomplish changes, your efforts will likely lead to worse results, not better.

Back to the technical merits of the question: how?  Ask your security people.  They will know whether the clients are centrally managed, and what it takes to disable the service on a particular client.

More likely than not (I boldly surmise), this will involve moving the machine to a different OU (or GPO group, or similar) in Active Directory, or a similar process in your central management tool specific to the endpoint client.

Finally, if I knew how to do this on a per-machine basis, I still wouldn't post it here.


Is it possible to execute metasploit exploits from Meterpreter? I have an attack scenario, first I send a malicious pdf to my victim, then I have a reverse tcp shell (Meterpreter session) on his computer then I want to exploit a samba server (which is already exploitable) on my victim network which is not accessible from outside, on this part can I use metasploit to exploit that server from inside of my first victim computer? (all of these computers are in my lab and under control of myself)

Certainly. If you are using a Metasploit module for the exploit you simply need to add a route. Background your Meterpreter session and type route -h it will help you, but basically you just need to add route 192.168.1.0/24 1. The 1 at the end being the session ID number for which you want to route traffic (the exploit module) over and to whichever network you want. In this case I'm specifying the 192.168.1.0/24 range.


Is is possilbe to create and sign a single domain cert with a wildcard cert? Given a CA signed SSl wildcard cert for say *.example.com, is it possible to create a single domain cert for say foo.example.com and sign that with the wildcard cert?

If so, how? (Linux tools preferred.)

It does not matter if the certificate you use for signing is wildcard or not. What matters is that the CA flag of the certificate is true, which means that it can be used for signing other certificates.

You usually cannot buy certificates with CA flag true (at least unless you have lots of money and security). But if you are building your own certificate hierarchy there are enough resources out there which will help you.


Where does tamper data extract the password string from? I tried to login into Gmail account keeping the tamper data on. I just want to know from where does the tamper data get these field values. Is it stored anywhere in the cookies temp data. Where is the form POST data stored?

For example, the encrypted password string is shown in the tamper data field fldpassword. So from where does the tamper data get this field value. where is it stored on the computer.

Tamperdata intercepts POST and GET traffic. If this is a POST request, then it is stored in a form as hidden attribute, or it is generated with an XHR request. Either way the client initiates the action, and tamperdata hook in on the calls.


Clicking web page taking me to adware/malware! Recently I have observed strange behaviour. At certain times, on certain web pages, if I click anywhere in the page a tab/popup opens with ads.

First I thought some Chrome extension might be doing it. Then I observed the same behaviour once or twice in the iPhone Safari browser, connected to the same WiFi network.

I couldn't figure out what might be the source of this malware.

Following is the screenshot of such an adware. I am one of the developers of this site and there is no code which pops up this ad! I have also observed the same adware on the https://underscorejs.org/ website few months ago.

EDIT 10 Aug 2018:

I found a few more details. I observed chrome dev tools that some special cookies are being set which tracks of add details.

Here are cookies details

Name: GL_GI2
Content: eJw9i80KgkAYRafRLI2CC75GhiG67mcjymx8AJn0Q4bEGdRFvn2Z0e6ew7mMMe574MpgH4ZJcI6SIIyDKIbVkAZPBZyeGqU78OyC3bLLSteEdSqOH2dXapywyWT%2FlK2EO%2BMSeHPw05YaDOxrIXK4HY3lYIhquDf5aOl0L3Ic%2FvZ7dlbYqqE0vX5NDnsDnrkt2g%3D%3D
Domain: decademical.com
Expire: 2018-08-11T10:54:54.734Z

Name: GL_UI
Content: eJw9jb1ugzAYRYkJhDYK0pV4AB4hiesGxqpz1aFLN%2FSB7YQW%2BCLb%2FXv7Wh263HuGI50kSUS1RfpBCvWpsaRlK4%2BtHqy06mibZuhJ3Slr5EG1uBl9F6ifTFgj6x0teodsZm2mHTa94y9vXJVivdBskD9eHMfPZnpjB3F%2FijguEVd7CPZVWuYonmion1%2Fq17KAOOzL27gS2%2BtEwbKbu1HnAtnZkTZYPaAYKJgzux9stPHvga8AT7r79%2F%2FKKftv5Np8jkPMc7gY9wvOET7Q
Domain: decademical.com

Name: glx_pp_6922_201813106
Content: {"unload_time":1533898446,"loaded_time":1533898494,"click_num":1,"last_fired_time":1533898502,"last_fired_click_num":1,"pop_count":1}
Domain: actual server

On second ad run
{"unload_time":1533898845,"loaded_time":1533898494,"click_num":2,"last_fired_time":1533898811,"last_fired_click_num":2,"pop_count":2}

Ad link: http://eyelk.asikol.space/AwGN4beM8OWuzuKSlBpN9O-NZYk3UlcNaezbNeYqCieDHrHC_pbybl-LDimE9wNvfVGvWLLrDwMcjtoVTQbXswcsFIqiAn54oKkEVWFJndHO1A==?fgpymyn=AwHhIO8IaCOI49EVKpE8ks7a2hgiHREIaZ0kBxaUVREVagW40G9Zf-CoJ49EkB7rfkji4Vy2bFVx7vekUCU5lxGUO8cZaExCqtiXjJQZB9ri-McX3CKOthishYn_FgfwpanP9uYIPZEcvEcwKufTgD-xZigeUw1EvV5_Q_bJ6J7anbSK2uK3d11CKurZQlDNQeG0uuZDDBQ6q9JJOw58MOCZ8CiKYlcgI44UTOeAaDtIZnsTaKFi9pTzD3R1NTbO4s7Lhji55sL0Mo65qRKD7XBG

I would suggest to look into your network configuration. That sounds like someon is intercepting your traffic. Maybe your DNS entry was changed by another user of the wifi. Check this by going into your router configuration and look if your DNS Server isn't the router or your hosting Provider. If you are not sure what´s your DNS name use 8.8.8.8 for testing purposes. This is the google DNS server

It seems that another PC or device routes you to this sites. Is the same behavior on https sites or are you always routed to http?


End-to-end encryption for localtunnel/ngrok setup This is what I am trying to do:

local                    web                  local
Recipient <--- local tunnel host server <--- Sender
server1            ngrok or other            device1

My goal is to securely transmit a string from device1 to server1. server1 is not accessible from the internet, thus starting a tunnel via ngrok or similar. However, I do not want to/can trust the tunnel server in the middle. If I understand correctly, the tunnel server could become compromised (as in MITM listening to the tcp socket/proxy).

What options do I have to securely transmit data from let's say a mobile phone to an app running behind a firewall if you can't trust the infrastructure in the middle?

I am researching https://signal.org/docs/ right now, but don't quite understand how it could work in a local tunnel context.

EDIT: Asymmetric keys seems to be what I am looking for.

It would be possible to use ngrok or some other un-trusted source as long as you encrypt the traffic before you send it.  This isnt to say that ngrok is a bad service, simply that it is an unknown and thus un-trusted.

To encrypt this traffic you would need to setup your own key exchange ... both the Sender and the Recipient would need to create a pub/priv key pair and share the public keys with each other.  Once the public keys have been shared one or both parties can randomly generate a binary string to be used as the symmetric key for further communication.  If you want both parties to contribute to the key you can hash the binary strings together to create the final key. (it should be noted that these symmetric keys should be encrypted with the opposing parties public key before being exchanged).  Once the symmetric keys have been exchanged something like aes256 could be used to encrypt all further traffic.

This is a high level overview of how things like SSH handle key exchange and setup a secure tunnel. see also: https://security.stackexchange.com/a/73132/92213


What would be good resources to conduct Technical Impact Analysis? As continuing research in Secure Software Development, I found the OWASP Top 10 project list Technical Impact such as:

https://www.owasp.org/index.php/Top_10_2010-A1

Similarly, CAPEC list impact in terms of CIA:
http://capec.mitre.org/data/definitions/66.html

For further details on technical impacts of various threats, are there any resources which offer detailed analysis including possible case studies?

This question is too broad, as the answer is going to depend upon the particular vulnerability/attack.  Pretty much any description of a vulnerability or attack will describe its potential impact (= technical impact, in the OWASP terminology).  So, if there's a particular vulnerability you want to know about, you should be able to go read any primer on that vulnerability and find out more about the (technical) impact of the vulnerability.

For instance, buffer overflow vulnerabilities allow code injection, so allow the attacker to inject malicious code into the vulnerable program and execute it with all of the program's privileges.  SQL injection vulnerabilities allow the attacker to execute arbitrary SQL queries (and thus read or write to the database) and possibly -- depending upon how the database is configured -- execute malicious code with all of the database program's privileges.  And so on.


Reading magnetic stripe on a credit/debit card with an EMV chip Is there any way of knowing is a credit/debit card has an EMV Chip, by reading the magnetic stripe. This way I could deny the payment via magnetic stripe and ask to the customer to insert the card via EMV.

How would it be possible or why it can't be done?

The service code on the stripe data will notify you it is a chip capable card and you should use this to prompt for card insertion. US is using the first digit of 2 or 6 to signify a chip card.
Magnet Strip Card:

Service code values common in financial cards:
First digit
1: International interchange OK
2: International interchange, use IC (chip) where feasible
5: National interchange only except under bilateral agreement
6: National interchange only except under bilateral agreement, use IC (chip) where feasible
7: No interchange except under bilateral agreement (closed loop)
9: Test


Tor detection in network After I read this link, I tried to understand how they manage detect Tor traffic

The most understandable source for me was this paper

He is saying Tor traffic can be detected by port, cipher suite length , extensions and validity duration of certificate can be use. I tried to implement that and I saw Tor corrected all their weaknesses which are pointed in the document.

According to my experiences it is not possible to detect Tor users in network, but how are companies able to detect Tor? I am extremely curious. Does Tor have any TLS abnormalities?

Blocking Tor at a network level is difficult, and anyone trying to do so will face a constant battle with the Tor developers. It's similar to the red queen effect between malware developers and AV researchers; every time an improved technique comes out to block Tor the developers will change the way it works.

I see Tor use as more of an endpoint control issue, and a user behavior issue rather than a network blocking issue. If you want to stop Tor then prevent it from being installed, and let users know the penalties for using it (providing you have an applicable AUP which says so).


Is it possible to stay anonymous on Windows 10? After reading some information on anonymity, I noticed that almost all sites stated that Windows 10 does not really allow you to stay hidden online,
even when using services like Tor.

I would like to stay anonymous, but I would also like to use Windows 10

Is it possible to surf the web completely anonymously on Windows 10?
If so, what must I do to achieve this goal?

I think much of that "Tor on Windows 10 is no good" is hyperbole.

It's true that Windows 10 sends an awful lot of data home to Redmond. But this is completely independent of Tor. If you use the Tor Browser to browse the net, I don't see how Windows 10's tendency to phone home would negatively affect your anonymity in Tor, since it will phone home in the clear, while your browsing will happen over the Tor network, so the two data streams have nothing to do with each other.

There are risks, most notably the following:

The large number of installed Windows platforms makes Windows an interesting target for attacks. So zero-day attacks which target the mozilla browser variants on windows will often work against the Tor browser bundle, too. Once the Tor Browser is compromised, you really are in trouble because it then becomes possible to deanonymize you. I think the FBI did exactly that a few years ago to identify visitors of illegal services provided through the Tor network.

There's another problem if your computer is stolen. It might be possible, maybe even easy, to find out what you've been browsing in the Tor Browser due to Windows's less than ideal handling of user privacy while you're working with your computer. For example, parts of your browsing history may find their way onto permanent storage, maybe via the paging system or as deleted files etc. Its harder to counter this in windows than in, say, Linux or even a live distribution such as Tails.

But basically, if you're not trying to stay hidden from organizations with very large budgets, I'd say Tor on Windows works just as advertised. And if you do want to stay hidden from said organizations, you should think much deeper about opsec than just use Tor.


How to use Wireshark to capture HTTP data for a device on the same network as me I've setup a wifi router and connect my Kali Linux laptop and my Android mobile phone to it.
I do know the password already (I've set it up) and I want to sniff all the data coming and going to the Android device. Wireshark is going to be run through my kali Linux box and my WiFi device is set on monitor mode already.

When I create a .cap file using airodump-ng I do see that data is captured. When I try to browse the cap file using Wireshark I don't see any HTTP traffic in it.

So I have two questions:

Is it possible to capture HTTP traffic when you are on the same WiFi network as your target device but you are running Wireshark (or airodump) from the source device?
If so, how can I do this?

You should check this man page, but as far as I understand it you need to be in promiscuous mode and not monitor mode to be able to inspect the packets payload.

Monitor mode of your WiFi card will allow you to capture packets outside your SSID but I suppose at this point it's useless since you're anyway already on the same network.


Aren't the current implementations for multi-factor authentication heavily dependent on a single point of failure? A lot of 2-factor authentication methods seem to rely on either a text message, email or a one-time password like Google's Authenticator as the second step in authentication.

It seems like these methods all rely on the security of a user's phone. For example if you stole someone's phone, you could go to their web browser, log on if you know the password or use their saved password, then perform the second step by opening their authentication app, email or text messages.

Is this not a big point of weakness in the whole system? Has this concern ever been expressed before and are there any alternatives that are more secure?

It all depends on what you want to secure yourself from. Typically, 2FA is meant to protect you from remote threats. Ones that cannot get access to your phone (99% of the planet).

If your phone becomes a single point of failure, then you need to secure that point using all the recommended features, like strong passwords, remote wipe, and encrypting the device.


How actually is Tor hidden service hidden from public? Let's suppose I have a web server X, listening on port N for instance and configured as a Tor hidden service.

How and where is implemented its' hiddenness from public access?

Since you found my comment helpful, I'll just write it as an answer.

The concept is pretty simple. You bind your webserver to your localhost only, so it won't accept connections from outside your computer. Then you configure Tor to connect to this server. Since Tor is installed in your computer, it will be able to connect to your webserver, but others can't. This way, your webserver will only accept connections from inside the Tor network.

For more information, have a look at how to configure a Tor hidden service.


Is it possible to send HTTP packet via spoofed IP? I have the following PHP code that writes accepted to a file named text.txt only if the IP is equal to 127.0.0.1 (loopback). If the IP doesn't match it writes denied.

<?php
$file = fopen('text.txt' , 'a');
if($_SERVER['REMOTE_ADDR'] === '127.0.0.1') {
$request = $_GET['output'];
if($request === '123') {
fwrite($file, "\x0D\x0A".'accepted - ' .$_SERVER['REMOTE_ADDR']);

}

}
else {
    fwrite($file, "\x0D\x0A".'denied - ' .$_SERVER['REMOTE_ADDR']);
}
?>

Can I send the get request (www.example.com/get.php?output=123) from an external network with a spoofed IP of 127.0.0.1? If it is possible, how can I do it? If not, why?

Is it possible to send HTTP packet via spoofed IP?

No you can't.

HTTP is a protocol on top of TCP and doing IP spoofing with TCP is nearly impossible due to the internals of the protocol. You would not only need to send a single spoofed packet like in UDP but you would actually need to reply the packets of the peer with the matching sequence numbers without being able to watch the peers packets which contains this sequence number you need to match. And this reply must happen just to establish the connection, i.e. before even sending your HTTP payload.

Apart from that many systems will simply drop packets which do not fit the routes, i.e. a packet claiming to be from 127.0.0.1 (localhost) should never come in at the network card connected with the local network.

if($_SERVER['REMOTE_ADDR'] === '127.0.0.1') {

But given your code you might actually be more interested if the value in $_SERVER['REMOTE_ADDR'] could be spoofed. While most assume that this is the source IP address of the client it can actually be different from the real source IP of the HTTP connection and it might even be manipulable by an attacker.

In case of a reverse proxy (or load balancer) in front of the web server the real IP of the client is not known to the web server because the connection from the client actually terminates at the reverse proxy. Therefore it is not uncommon for the reverse proxy to propagate the original clients source IP by inserting a HTTP header, typically X-Forwarded-For. Some web servers are setup to put the value from this header into $_SERVER['REMOTE_ADDR'] instead of the real source IP. And in some situations this is actually exploitable by the attacker to bypass IP based access control like employed in your case.

For a specific example of this kind of bypass see Anatomy of an Attack: How I Hacked StackOverflow.


Base64 decode possible payload? I was innocently looking at the source code of a page, minding my own business when I stumbled upon this: (this is only part since it exceeds the 30,000 character limit)

data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYW...

Is this a payload? That's a lot of text cranked into a image. I decoded it to what looked like hex. Can this be decoded to reveal a message?

While anything might be malicious, I see no reason to think it is anything other than what it claims to be: an inline image encoded with base64. This is part of the HTML spec and is done for a number of reasons, typically having to do with performance (although I'm dubious about the wisdom of using this technique on larger files).

Most likely your browser already decoded it to reveal a message in the form of a JPEG image. If you find this tag on the actual page I'm sure you will find your browser is displaying an image.


How can I report PCI-DSS violations? A large supermarket chain in the UK, are storing their passwords in plaintext. Apparently, Mastercard's security department are already involved. I'd like to report them for violating PCI-DSS, since the lack of session security and unhashed passwords represent serious security problems.

I can't see anything about reporting violations on the PCI website - any idea if there's a contact for or contact email for this kind of thing?

First of all, thank you for sharing this very interesting and revealing post by Troy Hunt.
As for your question, after doing some serious Google searching and after consulting with PCI DDS professionals the best answer I can give you is:

If the entity is compliant and still a violation of one of the requirements is discovered by a client or another outside agent, he/she should be able to report the issue to the company support or contact as there is no direct or formal reference or procedure required to that by PCI.

In other words: "Go fish"


Full packet capture vs SIEM Instead of collecting various logs into the SIEM, can a full packet capture solution be better in terms of having to manage so many log sources?

Just by capturing the full traffic the task does not magically gets less complex. The traffic still needs to be processed and the information extracted. In contrary, capturing all traffic inside a huge network and processing it in real-time is a huge task: there is lots of bandwidth needed to collect all traffic in the first place and huge processing power needed to process it.
It scales much better to extract the relevant information as soon as possible from the network and only feed the pre-processed information into the SIEM. Apart from that SIEM usually not only get information from the network traffic, but also include information from the endpoints, like which applications are running and what they are doing, authentication errors etc. This is the kind of information which cannot be directly derived from the network traffic.


Most robust encryption schema I'm a bit lost here as I've never had this issue before. One of our clients wants to have our source code in case we dissapear for whatever reason. We are eager to comply but the source code is our only asset in our company.
They agreed to accept the source code encrypted and once every year check that the "whatever method we choose" works and that the file we are uploading to their server works. We will use a third party that will hold the key or password to the files in case we disappear.

Is it safe to use Public/Private key approach?
Or are there other methods that could improve our safety?

EDIT:
After reading comments and Luis Casillas answer I'd like to improve my question by adding some info. Even though we trust some bit the client, we do not trust "others" IT security. We're looking into worse case scenario they're hacked and our source code is leaked. I know it sounds paranoiac but this software is our only asset.
I think the ceremony approach is what we're looking for here and specifically my question is about step 6.
Let's say we gather in a room with the escrow agent and my client. They agree that the source code is legit. What's the safest way to encrypt it? Will a public key encryption work against brute-force attack? How can I reduce the chances of the code being decrypted without the "secret password".
Thanks for all the comments, this is our first time doing this and all the comments are greatly appreciated.

In any case, your whole scenario seems to make a number of assumptions that sound rather magical.  For example:

  They agreed to accept the source code encrypted and once every year check that the "whatever method we choose" works and that the file we are uploading to their server works.

How can they check whether the file you upload to their server "works," if not by decrypting it?  If they can decrypt it once a year, why can't they decrypt it any time they want?  And even if (somehow!) they truly can only decrypt it once a year, why can't they then hold on to the decrypted source forever?

Once you consider these questions it sounds to me like what you're proposing to do has to be way more complex than you're making it sound:

You absolutely need to show your source code to the client to get any scheme to work, because otherwise they can't know that the encrypted file you give them is actually your source code.
The method for showing them the source code cannot be giving them a plaintext copy of the code base, because then there's no point to giving them the encrypted file.
You need them to sign off that they are satisfied with your claim that what you showed them is indeed your source code and that the encrypted file you're giving them decrypts to the same as what you showed them.

So to make what you're describing truly work, you need a complicated ceremony, perhaps something along these lines:

The client, the key escrow agent and you get together in one room.
Either you provide a computer with a fresh operating system installation, installation of the tools needed to carry out the ceremony, no network connectivity, and the ability to read removable media.
The client examines the computer and it installed software at length to satisfy themselves that the software installed in it is not malicious in any way.
You copy your source code from removable media into the computer's hard drive.
The client gets to examine the source code to satisfy themselves that it is authentic, but they're not allowed to copy it into external media.
With the client witnessing, you run the commands to archive the source tree, generate a key, encrypt the archive, and copy the encrypted file into the client's choice of external media, that is then given to client.
With the client witnessing, you run the commands to copy the key into the client's choice of external media, which is then given to the escrow agent.
You now all have to sign off that the ceremony was carried out to your satisfaction, or otherwise it's invalid.

And I bet I'm oversimplifying this by quite a bit.  Take-home message: doing what you propose securely with parties that really do not trust each other, is much more complicated than you think.  If you think this paranoid approach is excessive, then you are implicitly trusting your client, and perhaps it's best to codify that trust into contractual conditions than to pile on technical security stuff.

  Is it safe to use Public/Private key approach?

The use of public key cryptography doesn't gain you anything here, because from the point of view of the client, you're just giving them an encrypted file and withholding the key that can decrypt it.  So that key might as well be a symmetric one.

  Or are there other methods that could improve our safety?

Secret sharing comes to mind, but it might be impractical with a very large file.


Is there any good (or less bad) way to handle a web portal or website with awful security? Background:

I'm facing a situation with an online site I must (for the immediate time being) use for financial and HR-related matters that just sucks.  In every sense, but security in particular.  As much as I'd like to, I can't ditch this site immediately, but am definitely moving towards doing so ASAP (within a few months at the outside, I hope).  It is a very large portal in the US for accessing highly sensitive information over web - HR, financials, accounting and the like.

Problem:

Their security Sucks.  A screenshot below, and note that the password is limit to 12 characters long.  7 to 12 character password, no special character set, and subverted by security[-eliminating] questions that are mostly answerable with a few public records searches and/or some decent Google-Fu.  No checks to make sure the PC accessing it isn't infected with something nasty or anything like that, either, naturally.

Again, this is a very large, US-based portal for HR and financial information.  If I wasn't so used to appalling security on the web, I'd be really pissed off, instead of just moderately angry and concerned.  So far as I can tell, there is also no alternate authentication method, such as two-factor auth, the ability to disable the security questions, or use a password that might actually hold out for more than a few minutes against an attacker who knows what he's doing.

I don't have visibility into their behind-the-scenes security (password hashing, salting, penetration testing, vulnerabilities, etc.), but based on what I've seen so far, I bet that pulling back the curtain would only be more cause for concern/alarm.

Question:

What can I do to best secure myself while I have to tolerate this abomination?
What should I do regarding the fact that all this sensitive information for so many people is being guarded by such poor security polices?  How should I notify, and what do I do when I get the canned we take security seriously, eff off response I know I'll get?

As theorized, pulling back the curtain would probably reveal some true horrors, but that seems like a bad idea.

I'm going to apply an answer to what I've done thus far to handle this from the standpoint of my personal security, but I'm not sure if I've done enough or missed anything I could be doing (given that I have to use this PoS) and would welcome your feedback.

I have no idea what to do regarding (2).  My experience has been testing my own systems and fixing them, not stumbling across systems like this with worse security than my phone, backed by a massive corporation that will move slower than molasses uphill in winter (unless I do something stupid/out of line and they decide to sue me, in which case I bet they'll move really quick).

Self protection:

What you list in your answer sounds pretty good.  About my only thought would be to change your long ranty fake security question answers to truly fake answers.  Either sentences or more pseudo-random characters.  But assuming you get somewhere with trying to change the system, I don't think you want those in there when some guy who is investigating and trying to help sees them.  I never really suggest the strategy of "hope the admin has a sense of humor".

I'd also suggest a manual double check - it sounds like an an actual human accesses this account to look stuff up.  Have the human make a physical log of when the account is accessed - start time/end time, and if you are really anal - work done.  So that if an inappropriate access issue comes up, you have a separate list of what your activity has been.  Best is something that provide an automated time stamp - for example, mail a mail to yourself through the company mail server - so you mail hits the logs and has a (slightly) well-documented time stamp (sent time/date).  Yeah, it's fudgeable, but here's a limit to the number of reasonable checks a process can handle.

Long term protection:

OK, so I get that your pissed, but venting, ranting and otherwise sounding off at the site owners, on the web or to upper management in your own company is likely not to get you very far.  When a pissed off guy comes storming onto the scene demanding everything be fixed Right This Minute, the people who might actually respond in a productive way will probably batten down the hatches and try to figure out how to get you out of their office, email thread, or website and spend more time eliminating you than eliminating the problem.

Try to stay blame-free and focus on the problem at hand.

I'd start with the risks:

Risk to people - exposure of the HR/financial data linked to individuals - can violate laws, cause harm and result in fiscally damaging lawsuits.
Risk to company reputation - both your company and the provider of the service.
Risk to users - of being accused of inappropriate data access

Have an estimate on likeliness of risk, level of impact, etc.

Then start following up with concerned parties, starting with your company.

You may also follow up with the data provider - if this hosting site is not internal to the company providing the HR/finance data, find the data provider's security organization and start talking the risks with them.

Chances are, if either company does not have a CSO or CISO, they have a CTO or a CFO - I'd honestly start with whatever the highest level of risk management is - a security risk is a business risk, and the people most likely to respond are those tasks with mitigating risks.

The trick is to sound sane, write well, speak convincingly and generally make the case that you are a smart, trustworthy person.

For job protection, I'd start internal, get approvals before going to outside groups, and keep my manager in the loop at all times.

If that didn't yield results, it's worth researching personal information protection laws in your country/region and verifying what the expectations of due diligence are, legally.  This can get hairy, as the jurisdiction may be the state that hosts the service, the state of the people who's data is being violated, or something even broader.  Blowing the whistle on inappropriate data handling is not where I'd start - I'd start internal and work outward - helping prevent loss, reputation damage and better security practices makes you a hero.  Blowing the whistle may get you press coverage and it may save much data loss, but you won't be a universal hero, as the companies involved will almost certainly loose face, and they won't be so thrilled with that.

This comes strongly into the softer side of security - finding the key stakeholders who can actually affect organizational change, and getting them onboard.  Knowing how to present the problem and ask questions to generate actual thinking is really important here.  Walking in and telling them they have screwed up is unlikely to actually get you the results you want - you have to get them to convince themselves that there is a problem to be fixed here.

In all honesty, I couldn't even tell you if I would listen if you came to me... I'm just as happy in a public forum to NOT know exactly what data is at risk here, but it'll take a really serious dig into EXACTLY what information is private or public, specific or generalized before you can make the case.


How could ISPs "clean up their act" to protect against Mirai? In the forum post in which Mirai source code was released, the author wrote

  With Mirai, I usually pull max 380k bots from telnet alone. However,
  after the Kreb DDoS, ISPs been slowly shutting down and cleaning up
  their act. Today, max pull is about 300k bots, and dropping.

What measures could he have been referring to when he talked about ISPs "cleaning up their act"? My understanding is that Mirai just tries to telnet into random IPs with default credentials. What can ISPs do (and what do they actually do) to try to prevent that behavior?

Blocking telnet to the routers. It should be blocked anyway as one of the most basic security configurations (hence the phrase, "cleaning up their act").

Telnet used to be the standard method to get shell access on remote computers. The only problem was that there was zero security in the protocol. Then ssh was created to do the same thing, but using secure channels.

SSH is such a common and standardised tool now that there should be no reason to ever need telnet. The fact that the routers are even designed to respond to telnet requests is surprising (and troubling).

If a device uses telnet, an ISP can protect the device by simply blocking traffic to it on the standard telnet port: 23.

I doubt ISPs would do it (too resource intensive), but one could also inspect traffic to the routers to look for the default password strings and block those packets. It's more of a technique for local networks than for ISPs, but it's another route for protection.

What makes this problem so big for these routers is that both the credentials and the telnet service are hardcoded into the firmware. You can't change it and can't turn it off. The only way to protect yourself is to block traffic to the device on the port it is configured to listen to (telnet port 23).


Should an access token reflect the current user roles? A user with role "A" requests an access token at time t, which expires in 12 hours; after 6 hours, role "B" is granted to the user in addition to role "A".

Should the token grant the user role "B", even if the role wasn't granted at the time the token was requested?

UPDATE Like Mike Scott noticed in his answer, change on user roles should take effect immediately. I'd like to make my question more specific: when user roles change, should active tokens reflect the change granting the updated roles of should them be invalidate/revoked?

In other words: should the authorities granted by a token be immutable?

There is not necessarily a right answer to the question. It is really easy to say "of course they should" and somewhat harder to make it happen.

Given that you set a token with claims rather than just an identifier there is an assumption that you do not want to contact the authorization server every time the token is received. This means you have to respect the validity / expiry of the token.

If you don't mind contacting the authorization server with every request then you don't need to set the claims in the token, you can get them from the server every time and they will always be up to date.

OAuth is usually used between multiple parties and you might control between 1 and all of them. How many you control may affect what you can and can't do. Token revocation is not possible without an additional request to the auth server


What are the advantages of paying for a VPN service as opposed to hosting your own? For a person looking to use a VPN solution for personal use, what are the pros and cons of paying for a VPN service as opposed to just hosting a VPN on your own rented, in the cloud server, except for the obvious managed vs unmanaged argument?

VPNs are designed around the concept of trust between 2 or more parties, and were intended for corporate/enterprise use.

The popularity of offering "Free VPN" or "Hosted VPN" solutions to the consumer market has dramatically increased. A lot of people seem to forget there has to be a "trust" involved. You wouldn't want to have some random person on your home network, so why would you tolerate that on a virtual up scale of that idea?

Hosting your own private VPN solution has a key distinct advantage, you trust yourself. You know how data is handled, you know who can view VPN data as it's relayed, you can ensure it's quality, reliability, and anonymity. Most people will use a VPS (Virtual Private Server) for hosting a VPN.

Using a third-party hosted solution does come at a cost of some trust, corporations are legally bound entities which may be required to hand over subscriber information. Some self-hosted solutions over come this with payments by bitcoins (for the virtual private server or physical hardware). In some countries, a corporation may also be required to log usage by their clients. Beyond this, you will have to address each company's privacy policy and terms of use.

Tor was the answer for the consumer's idea of anonymity on the internet. This again has some issues with trust, mainly that entry/exit nodes have full implicit trust. It is not made apparent if a "rogue" node was to log your connections, or pass your information in the clear.

If you are not overly concerned about "trust", here are some bullet points to think about:

Self-Hosted

Security and anonymity to your standards
Can be faster, as you are the only one using the service
Must keep up to date with patches/security of software
Your information is known to the hoster, which could be a third-party
Only your hosting platform is aware of your IP address

Out Sourced Hosting

Cheaper, and generally more reliable/constant service
Don't have to worry about patches/security of software
Simple payment plans, and generally cheaper
What happens to your data in between is anyone's guess
Your data/connections might be logged for legal reasons
Your data might be altered on the fly for advertisement revenues

Tor

Easy, usable by the general population
Free, no real costs
What entry/exit points do with your data, is anyone's guess
Slow, due to the number of relays, and non-profit architecture


Pfsense security issues? I have used pfsense before as the main gateway, load balancer, traffic shaping, proxy, firewall, virus/malware protection, enterprise wifi solution for an entire office of 50+ users. Yet I have received criticism from top IT companies who have done an audit on our IT infrastructure calling this solution immature and insecure. While top security experts I have consulted with have told me "using pfsense for everything is of poor quality and most likely cannot handle all of these tasks efficiently".

Yet these same companies that made such claims have been attacked with viruses such as WannaCry, while our infrastructure was maintained without incident.

My reasoning for choosing pfsense are due to the following points:

No Cost due to open source free software.
Large community support.
Capability of handling many services at once.
No subscription costs for anti-virus and/or other services.

The setup consisted of the following hardware:

Quad Core Intel Pentium Processor
8GB of DDR3 RAM
500GB HDD
4 x 1Gbps NICs

Services used:

Anti-Virus protection: ClamAV
Proxy & Caching: Squid Proxy
Enterprise Wifi Management & Authentication: FreeRADIUS

This firewall has handled security very well and load balancing/traffic shaping without any drop-outs. All the services mentioned above were running without straining the CPU while also having MAC Address routing enabled which is known to be CPU intensive.

I have read articles where some of these mentioned IT consultants actually discourage the use of open source firewalls due to the fact that they have contracts with large providers like Fortinet and Cisco. I'm sure that with proper configuration pfsense can be as secure as commercial offering if not maybe even more secure.

Questions:

Is this setup truly insecure as mentioned by other IT companies and
what are best practices for securing such a setup?
Are large security companies truly afraid of such solutions rendering their products obsolete, looking at the most used servers
and firewall operating systems world wide Linux is used over
commercial offerings like Microsoft?

Is this setup truly insecure as mentioned by other IT companies and what are best practices for securing such a setup?

The quality of both open source and commercial solutions differ widely. There are commercial firewalls which more or less do what pfSense does and there are firewalls which do a lot more. From what you mention as security features of your firewall the only one is actually "ClamAV", neither a squid proxy nor a radius authentication are security features by themselves: it does not matter if the authentication uses radius if the passwords are weak and it does not matter if you use squid if it allows unlimited access to all websites.

ClamAV is definitely a weak option compared to many commercial AV. Commercial solutions for example are often backed by cloud services which allow dynamic code analysis for suspicious files and thus can react faster to new threats. But commercial AV don't provide 100% security either. Relying for security only on an AV in a perimeter firewall is a bad idea from start.

A secure setup would not just put some firewall at the perimeter and then forget about it. For a secure setup one would first analyze the actual risks and threats and then decide how these can be mitigated best using the time and money available. This usually does not only involve using firewalls but also endpoint security and maybe segmenting the local network further. In some cases free firewalls are sufficient, in other cases commercial firewalls are better since they often allow a more granular addressing of the risks, more visibility into what's going on and have a faster reaction to new threats. But again, the actual advantage depends on which firewall is used since the quality, capabilities (and price) vary a lot.

  This firewall has handled security very well and load balancing/traffic shaping without any drop-outs.

What you address here is mainly availability and performance and not actual security. From this statement it is not really clear what your installation does better in terms of security than a simple network cable - which is even cheaper.

  Are large security companies truly afraid of such solutions rendering their products obsolete, looking at the most used servers and firewall operating systems world wide Linux is used over commercial offerings like Microsoft?

Not really. Commercial companies today use open software a lot themselves. For example Microsoft is actually a very large user of Linux itself and not only in Azure. Open source software is also often used in commercial firewalls and security companies also contribute to open source themselves.

Also, open source does not magically address all the needs: while one can use Linux to build a firewall (and many commercial firewalls are based on Linux) it takes lots of time and lots of specialized knowledge to create and maintain a solution which does more then just filling basic needs.

  Yet these same companies that made such claims have been attacked with viruses such as WannaCry, while our infrastructure was maintained without incident.

Such Anecdotal evidence is pretty useless for comparing security solutions. It comes down to picking the aspects which support your claims and ignoring the others. See also Cherry picking and Confirmation bias.


Why does Mark Zuckerberg cover his headphone jack with tape? I can understand covering the camera or microphone but why the audio jack?

Mark Zuckerberg have shared a photo to his Facebook account and celebrating the growing user base of Instagram which is owned by Facebook.

Image Source - fb

This is a useless question but still interesting one :)

and that is not audio jack

He is a security freak like me, not real freak but there are some people who really care for their device security and of course a CEO will have some serious data inside his laptop, I am sure you understand that covering mic and cam is so that even an un-authorised access to his cam will not reveal his face or sounds of the surroundings. Mark really cares for security, like he doesn't want to leave a single loop hole or any kind of vulnerability in his system that's why he even released a sort of security contest where you will get awarded with money if you can find a vulnerability in his Facebook System.

As I did search for his laptop, I found about the laptop, it's MacBook Air (and I precisely got the image of left side of that laptop) and you can see here in the image that before headphone's jack comes an inbuilt microphone, and of course it's not a microphone jack, it's an actual inbuilt microphone as jacks aren't that small. So you see, he is again covering his microphone so that hackers can't access sound even if they got access to his Macbook's microphone

so in summary:-

He covered his top cam and then covered his left side inbuilt mic so that no un authorised access can harm him, basically doing the best to stay from hackers and getting hacked or any kind of personal audio/video from getting hacked & released. So even if hackers hack his laptop successfully, they won't be able to use his webcam or mic


Firefox Sync, end-to-end encryption I'd like to sync my browsing data with multiple devices but I'm sure as hell I don't want to share my data with 3rd parties (whatever they claim). I've read in past that data saved via Firefox Sync are encrypted in a way that prevents Mozilla from decrypting it. I've read few[1] articles[2] about Firefox Sync but I'm still confused as to what prevents Mozilla from decrypting the data.

When I created the account on firefox.com, I entered my password (twice). This password could've been sent to Mozilla's servers. Of course, best practice would be to hash it in JavaScript first, but I haven't checked. The page could do anything so as layman I'm assuming the worst.

Now I'm using this same password to login to Firefox Sync in my browser. So the only secret for Sync is shared with Mozilla. If there was an additional secret on local PC, then loss of the PC would mean I wouldn't be able to decrypt my data, so the password must be the only secret.

So what actually prevents Mozilla from data mining on my private data?

[1] https://blog.mozilla.org/services/2014/04/30/firefox-syncs-new-security-model/

[2] https://medium.com/mozilla-tech/how-firefox-sync-keeps-your-secrets-if-tls-fails-14420d45885c

There's a really good explanation of the crypto/auth for FxA.  Looking at it, it shows that both the authentication key and the private data wrapping key are independently derived from the password in a manner in which it's not possible to derive the wrapping key from the authentication key.  So nothing stored on their servers would ever allow them to retrieve kB, which is the key used to store the "Class B" sensitive data, including all sync data.


How to patch "keyless entry" car keys? The German automobile club ADAC did a test with several cars which open doors and start the engine with a "keyless entry" system. You don't have to push a button on your car key. If you get near your car, key and car will recognise each other. If you pull the door handle the car will open. Inside the car your push the ignition button and the engine starts.

The security relies on the distance between key and car. Car thieves have built a repeater to tunnel the radio signals over long distances. One thief stands near the key and the other near the car. Then the car will open. The distance between car and key can easily be several hundreds of meters. Lots of cars are stolen this way.

How could car manufacturers solve this problem or is this an
unpatchable design flaw?
Are there any mitigations a car owner could
take in place?
How should wireless physical access control look like for cars?

From a layman point, Yes its a design flaw and yes the signals are boosted to unlock the cars from far far away. This is knows as Relay Station Attack(RSA). Some of the ways to mitigate such attacks are:

measuring Group delay time to detect illegal high values
measuring Third-order intercept point to detect illegal
Intermodulation products
measuring Field strength of the Electric field
measuring response time of 125 kHz LC circuit
using a more complex Modulation (i.e. Quadrature amplitude
modulation) which can't be demodulated and modulated by a simple
relay station
putting a physical on/off switch on the key

I don't think these mitigations can be used by the car owner themselves as there is quite technical detail behind it.

Taken from wikipedia. Smart keys and Security requirements


Clarification about IV in PBKDF2 to generate encryption key I've realized that the following implementation isn't truly safe:

$pb = pbkdf2('sha256', $_POST['pass'], "enc_salt", 100, 100);
$d = openssl_decrypt ($data['container'],'aes-192-cbc', $pb, true, $data['iv']);

In fact, I should use a unique salt for $pb instead of "enc_salt", shouldn't I?

Furthermore, can I simply use the same IV to PBKDF-generate the key and to actually encrypt the content?

The salt is here to prevent cost sharing by attackers. If two passwords are hashed with the same salt, then an attacker could hash a potential password using that salt value, and compare the output with the hashed versions of the two passwords; in other words, the attacker can attack the two hashed passwords for the cost of attacking one. This scales up: if there are 1000 hashed passwords, all with the same salt, then the attacker gets 999 of them "for free".

This kind of cost sharing can take several forms, one of them being precomputed tables (and one specific kind of table is called "rainbow table"). In all generality, cost sharing is an instance of parallelism (with the appropriate space-time warp).

You should strive to reuse salt values as rarely as possible; if possible, never. In your case, you would store the salt along with the encrypted file; and each file would have its own salt value (even if two files use the same password, each should have its own salt).

If each file has its own salt value, then you could do any of the following for the IV:

Select a random IV and add it to the file header (along with the salt).
Use PBKDF2 to generate the key and the IV in one go (e.g. ask for 256 bits of output, 128 for the key and 128 for the IV).
Use a fixed IV.

The second and third option are safe only if you are really generating a new salt for each file, in a big enough space that collisions don't occur in practice. Otherwise, you may end up with IV reuse, which is a sin. Specifically, what is Really BadTM is using twice the same IV with the same key. If each file has its own key (because the key comes from processing the password with the salt and each file has its own salt) then a fixed IV is fine.

Anyway, if you need encryption then chances are that you need checked integrity as well, which calls for a MAC. Assembling encryption and a MAC properly is tricky. The proper way is to use an encryption mode that already does the job in a way that makes cryptographers happy. In practice, use 'aes-192-gcm', not 'aes-192-cbc' (or 'aes-128-gcm': 128 bits are already good enough, and it will be slightly faster).

Note that the actual IV length for GCM is 12 bytes.


How do I make sure it is actually authenticated user performing an action? In my app (and website) a user logs in with their email to perform actions like making a comment on the website under their name. Obviously it is important that malicious people cannot pretend to be this user and send comments on their behalf.

I read that any state changing actions should never be performed by a GET request. What is to stop someone from creating a POST request using the authenticated user's email address? Is it possible for someone to tell my website to perform a POST request and spoof the inputs?

In my database I am thinking of storing some kind of token to validate a user (lets call the token authentication_token). For example, every time a user logs in, authentication_token is updated in the database for the user and sent back to be stored in a SESSION on the website or in the app. Now everytime a request is made (for example making a comment), the stored SESSION is checked in the database to make sure it matches before proceeding to make the comment.

User presses "Submit comment" button on website or in app
POST request is sent with inputs user_email, comment, and authentication_token
SELECT authentication_token FROM Users_Table WHERE email=user_email
Proceed to step 5 only if the retrieved authentication_token matches authentication_token that was sent in the POST request.
Create the comment.

Is this a secure way to validate an action? Is transfer of authentication_token safe over https? Thank you for any help.

In my app (and website) a user logs in with their email to perform actions like making a comment on the website under their name. Obviously it is important that malicious people cannot pretend to be this user and send comments on their behalf.

  I read that any state changing actions should never be performed by a GET request. What is to stop someone from creating a POST request using the authenticated user's email address? Is it possible for someone to tell my website to perform a POST request and spoof the inputs?

Yes, an attacker can certainly craft any request they want.

You are on the right track, but what you've done is reinvent sessions. The user provides authentication information (generally a username and password), you create a session and send it back to them as a cookie value, and then every subsequent request comes with the session id and you verify it against your session database to know who the request came from.

  Is transfer of authentication_token safe over https?

This is a session stealing attack, popularized by Firesheep. Using https is the generally accepted mitigation. Attacks tend to try to avoid https, eg via sslstrip, so you should abide by https best practices, like HSTS.


Is is possible to intercept Guest VM traffic on the host machine's Burpsuite I'm running Kali on Windows 7 via VMWare, and would like to be able to access private network websites, which i can't seem to be able to do. So I tried to forward the system traffic to the host machine and on the host machine, configured burp to listen to a specific port on all interfaces, but that didn't work. So I have two questions:

How to intercept guest machine's traffic on host machine
Any other way to visit host machine's private network websites on the guest machine

It is not a security question. It depends of how to configure your vm networking. Is a bridged machine? is a NAT vm? is host-only?

Host-only: you can't access to the host network from the vm... as name says, you can reach only the host, and not its network.
Bridged: If vm is bridged it will be another "independent" machine on your network, so you already are on the same network as your host machine is.
NAT: You can access to your host's network through host.

I guess you have a DHCP in your host's network, so setting vm as bridged is the easiest solution I think because you must do "nothing". If you have DHCP on your host's network, your vm is going to get an automatic IP and that's all. You can reach the same as your host machine. So you can set up Burp on your Kali vm and configure your browser (inside Kali vm too) to use the Burp's proxy (usually http://127.0.0.1 on port 8080 by default). Don't forget to install Burp's certificate to reach https pages. To do this is easy, enter with your browser (inside Kali vm too) to the page http://127.0.0.1:8080 , download the certificate and import it to your browser as truted authority, as simple as that.

Not sure what you are doing wrong, is not complicated. Can't help more without more data.

Good luck.


Is it bad practice to accept phone number or email as username? On a website in which all of users' information (line Username, Email and Phone Number) are stored safe and hidden (from other users and public world), is it bad practice to accept email address or phone number or username itself as username with a password and a Captcha?

On this question, it has been told that main risk is that email might be used with same password so compromising the account may lead to getting into user's email account. If user's email is being displayed on his/her resisted profile, it doesn't matter what method is used by hacker to crack the account, s/he'll know the email and password by the way.

If those information kept secure and hidden, is it bad practice to use this kind of implementation? If so, what are the cons and concerns?

Not on security side, but people are less likely to be willing to provide their phone number or they will just enter a fake one. So I suggest you to use phone number only if your application really needs that info.

I wouldn't care about people reusing their passwords, it's not your problem. This only weakens your security if the email service is compromised and the password is leaked. In almost every case users will use giants like gmail, which use various extra security measures to prevent hackers getting access to the account password. Just a simple and strong hashing algorithm would be enough on their side.

It is the same thing on your side. If you care about your users, you store their passwords hashed, as you probably already do. If you become the victim of a breach, and somehow the attacker gets to know the raw passwords of your users, it's absolutely their responsibility and stupidity if the attacker gets into their email account with the same credentials. But let that not be the case, store everything safely :)


Is there any Security issue if we not used SSL between AWS Cloudfront and AWS ALB? I have an application that is hosted on AWS. It has an Application Load Balancer in its front and it is also attached to the Cloudfront to handle a heavy load. In my case, I have enabled SSL only on Cloudfront and haven't had SSL on ALB. Now the application works fine without any issue. It is showing a secured lock symbol on all browsers. But I had a feeling that the communication between the CloudFront and ALB is not secure. Anyone who tries to intercept the traffic between them can achieve it.

Is there any security risk like that? Can anybody intercept the traffic or all communications inside AWS are secured?

I heard about the SSL offloading feature of AWS ALB where we are not enabling SSL between ALB and EC2 servers behind it. I thought this case is also applicable between Cloudfront and its origin ALB. Is that correct or is there any security issue if we doesn't enable SSL between Cloudfront and ALB.

I would say the short answer is: a compromise is possible.

It would seem that defense-in-depth applies here. Not using SSL assumes that the environment is completely trustworthy and secure, and always will be. Such an assumption has lead to many incidents.

Put another way - there is no risk assuming that all of the following is always true:

you do - and always will - fully control and trust the VPC that hosts it;
that you do - and always will- fully control and trust all the instances involved (and new ones that may be introduced);
that you do - and always will - fully control and trust all the traffic that will ever traverse the VPC;
that you will never have an incorrectly - or maliciously - configured perimeter control;
that there will never be a vulnerability in any of the components that could lead to man-in-the-middle or other types of compromise;
that the environment will never be exposed to any malicious actor (individual or software);
that there is little-to-no potential loss if the systems or information involved are compromised, damaged, or lost.

Since it would be unlikely that one could say with certainty that all of the above will always be true, it is usually wise to use encrypted communications at all times. Given that the functionality is readily available, and the overhead impact is negligible, it would seem best to simply use it.


Does Tor Hidden Service Protocol provide more threat protection than a standard HTTPS session? DuckDuckGo is a search engine that has a Tor Exit Enclave and hidden service.  This site is focused on the safe, secure searching of its users.

Since DNS is not used in Tor, it appears that HTTPS is less secure due to its reliance on DNS
Considering that the Tor Hidden Service protocol encrypts traffic end-to-end, does that remove any threats that exist when compared to a HTTPS session?
Is MITM risk reduced?
Is name resolution more secure than DNS?  (protection from spoofers)
Are there additional risks?

Please provide additional details and information.  For example, how does Tor HSP compare to HTTPS + IPSEC + DNSSec  (or the lack of the latter two)?

makerofthings7 wrote:

  it seems TOR is better/more secure since it doesn't use DNS, and it doesn't rely on CAs

Just as it's ultimately the user's responsibility to verify a TLS certificate before accepting it, it's the user's responsibility to verify that an onion address is the intended address. By starting with

(a) I know an onion address
(b) I know a regular domain name (f.ex. "google.com")

you are stating, by hypothesis:

(a) I have solved a tricky problem
(b) I have yet to solve a tricky problem

and (a) directly implies more security than (b) because of the stronger hypothesis.

But stating (a) actually means "I know how to solve tricky problems" so you should be able to also solve (b). IOW, if you can reliably obtain an onion address (f.ex. over the phone from someone whose voice you know), you should be able to reliably obtain a TLS certificate fingerprint of the website by the same provider.

But you are probably relying on some Internet resource (website, Usenet message, email...) to learn the onion address:

(1) do you trust the claimed author of the message?
(2) do you trust that the message was really written by this author?

Maybe the message was found on an HTTPS website, and you are back with:

(a) verifying that the owner of the website is the person you trust
(b) the website you see is the real website, IOW that the TLS certificate is valid.

Maybe the message was found in an email, and you have to check the PGP/GPG (or S/MIME) signature. Then you are back with: who owns this PGP/GPG/S/MIME signature? In any case, you need a trust anchor.

No cryptographic protocol or tool alone solves this problem, because it isn't an algorithmic matter, it's a matter of fact checking, facts like "this key really belongs to this person", and in most cases trusting others to do the fact checking, unless you can meet the guy in person and ask him his key fingerprint, which honestly is rarely the case (I tried with my bank and they had no idea what the fingerprint of the key was).


Consequence of using SSH when Fingerprint has Changed? I got the following error connecting to my server via ssh:

The authenticity of host '[ip address]:port ([ip address]:port)' can't be established.
ECDSA key fingerprint is SHA256:[thefingerprintwhichichanged].

I connected anyway and am reasonably confident I know the reason for the changed fingerprint.

But suppose I was being MitM'd...

Scenario

I usually use key pair to connect to my with password login disabled. I connected via SSH, fingerprint did not match but I used the previously used key pair to connect. While connected over SSH I logged into database and changed some entries. I then logged out.

Questions

How would that attack work and what could the attacker learn or do?
Can he read data sent to server, can he read data sent by server?
Can he change any data?
Can he perform commands on server that I did not?
Can he ever login again?
Can he ever redo the actions I performed while I was being MitM'd?

Well, there is a lot of things the "bad server" can do to you:

  How would that attack work and what could the attacker learn or do?

The attacker makes you connect to his server instead of your by modifying DNS answers or other mangling with packets. I you would use passwords, he would get your password and could connect to a real server anytime (and do the bad things there). If you are using only keys, there is possibility to forward the original server challenge to you and let you sign it, which will grant the "bad server" access to your real server. All this can be made transparent so you would also do the stuff on the real server to minimize your suspicion.

  Can he read data sent to server, can he read data sent by server?

Yes

  Can he change any data?

Yes

  Can he perform commands on server that I did not?

Yes

  Can he ever login again?

Only if you send a password. The private keys prevents this use case.

  Can he ever redo the actions I performed while I was being MitM'd?

If he does not close the connection, he can do the actions later.

The other chapter is what the "bad server" can do with your client:

If you are using X11 forwarding by default, the "bad server" has (usually) full access to your X server -- he can take a screenshots of your desktop, listen to all keystrokes, and so on.
Id you didn't patch out Roaming feature from your OpenSSH client, the server can basically force you to send some of the private keys (in some cases).
probably others ...


Known risks with the old IPSEC Cisco VPN client? I have a couple of customers who still use the old discontinued/obsolete IPSEC based Cisco VPN client.

Obviously it is not a good idea to use software that is no longer supported, but that aside: what are the known risks with this client app, the hardware backing it, and the tunnel tech itself? I have been looking for CVEs, but haven't found anything 'interesting' yet.

I have recommended that they upgrade to something more modern (and supported), but I would like to have concrete examples of what problems and risks are associated with it, and be able to provide my customers with some real reasons why they should upgrade to use e.g. AnyConnect instead of the old vpn client.

It is hard to tell what problems a specific unsupported software will cause in detail. But, if you look at the list of past CVE for this product you'll see regular problems  and even problems reported after the product was already end of life. This can be used as a base to extrapolate what kind of problems might still be lurking in the software.


Is FileVault 2 HIPAA compliant? It looks to me like FileVault 2 uses AES 256 bit encryption for the desk. Does that mean that it meets the HIPAA "data at rest" standard? Is there something else I need to check about it?

Yes, full-disk encryption using AES-256 would be considered HIPAA compliant encryption.  It is so because it is a FIPS 140-2 compliant cipher, and data encrypted with FIPS 140-2 cipers is considered "encrypted" under the HIPAA Security Rule.

As to whether this qualifies as good enough for "data at rest," that is up to your organization's interpretation of this seemingly ambiguous section of the HIPAA act.

Full disk encryption is a measure to help physical security.   "Data at rest" can be interpreted to  mean both the physical layer (in this case, if someone steals the Mac, the data would not be available as it's encrypted) as well as the availability of the actual data files sitting on a disk.

For example some organizations might consider databases backups sitting idle on a disk "data at rest" and would choose to encrypt these files with a password, e.g. using 7zip with AES-256.  Some organizations might consider full-disk encryption enough for the "data at rest" standard.

This is an area of much debate when it comes to the HIPAA security rule.  If you're concerned having files on a computer not encrypted with a password or PGP key etc might be a risk, it is best to err on the side of encryption.  Under HIPAA, if encrypted data is compromised this need not trigger reporting/breach disclosure requirements, since the data could be assumed inaccessible to third parties.  If non-encrypted data is compromised, and this includes hackers with malware taking files off an online computer that does have full disk encryption enabled; then this will trigger reporting requirements.  It's up to you to weigh the risk.