Certificate and key abuse I made a mistake several years ago by uploading OpenSSL certificate key (.pem and .pk8) into a blog post. The key was used to sign Android apk using SignApk.jar tool. Someone took it and used the key to sign malware apps and the bad story was i put my email address when created that certificate. This raised issues because people accused me as the creator of those apps.

The question is, how can i recover this situation? some people suggest key revocation, but i don't quite understand it. As far as read from arround the net, the revocation needs to be uploaded to a CA, what CA?

Certificates in general
Certificates are complicated, I don't blame you. By far, the most common use-case for certificates is for TLS websites where you need to submit a Certificate Signing Request (CSR) to a publicly-trusted CA in order to obtain a certificate that browsers will accept. In that case you revoke your certificate by contacting the CA who originally issued it. This does not apply to you.

Certificates in Android / Google Play
My understanding of the Android / Play Store code signing model is that you generate a private "app signing" key using the wizard in Android Studio. This key is then used by Android Studio to sign your APK files, and in order to upload your app to the Play Store, you need to also upload your public key and associate it with your Play Developer Account. From here there are two models: A) that key is publicly-visible an your Play Developer account and end-users's devices verify that the app has been signed by that key, or B) the key generated by Android Studio is used as the "upload key", and Google generates a second "signing key" in your cloud account to re-sign your APK with. Option B is probably more secure since compromise of your laptop does not mean compromise of the signing key (assuming malicious uploads to the Play Store can be rolled back).

In your case someone else has access to your private key, so they can write any software they want and publish it with a cryptographic signature linked to your Play Developer Account (bad news for you).

What to do?
It doesn't seem like Google has a model for "revoking" app signing keys, but you can remove a key from your Play Developer account if you contact support. Google has a help article Manage your app signing keys, and at the bottom is:

Lost or compromised private keys
If you're enrolled in Google Play App Signing, you can reset your upload key if:

You lost your private key, or
Your private key has been compromised

Note: Resetting your upload key will not affect the app signing key that Google Play uses to re-sign APKs before delivering to users.
Reset your upload key

Step 1: Generate a new private key and upload certificate

Step 2: Contact our support team

Since you need to contact the Google Support team anyway as part of this process, I would just contact them right away for advice.


Can we restrict cipher suites using server certificate? Can we restrict cipher suites (such as RC4) using server certificate?

A TLS cipher consists of a part defining the authentication of the certificate (i.e. ECDSA, RSA...), a part defining the key exchange (ECDHE, DHE...) and a part about the kind of symmetric encryption and the associated HMAC, i.e. RC4+SHA1, AES128+SHA256 etc.

From these parts only the authentication part depends on the type of certificate and everything else is independent. This means that you are not able to restrict the use of specific symmetric encryption within the certificate, like denying RC4. This can only be done by configuring either client or server to not include such ciphers in their SSL configuration.


ENCASE Forensic: Detect if someone ran CCleaner or CleanUp software I have Encase. and I'd like to know where can I find if someone ran CCleaner Or CleanUp software to erase evidence.

You could look through either the UserAssist registry entries for each user (located in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist), or check the prefetch files (located at %SystemRoot%\Prefetch).

Both maintain a list of run programs on the machine including the last time they were run and the number of times said program was run.

Further reading:

Prefetch
UserAssist


Desktop API Security I have a Desktop API written in C++. Within this API I call a REST API to register with my service (using typical email user validation). The REST API is protected with a ID and SECRET; the requests, including the ID, are HMAC'ed with the secret, in a typical  manner.

Storing an ID and SECRET in a desktop app is obviously a vulnerability waiting to be exploited. what are other options or best practices in this scenario?

If access to your REST API needs to be restricted, you should treat it like any web application. Using a fixed secret token is a security through obscurity technique, which runs counter to accepted security principles such as Kerckhoffs's principle and Shannon's maxim.

The standard mechanism for authentication in REST APIs is an API key, which is a long random token given to users. The API key acts as both a username and password, in that it is unique and secret.

There are two ways to provide this kind of authentication:

Send the API key with every request, and validate it each time. This requires less code, but means you have to send your secret in every request, which creates more risk.
Send the API key as part of a "login" request, then return a session ID. That session ID becomes the security mechanism for the rest of the session, so you don't have the problem of sending the API key every time. After the session times out, the API key must me sent again. Unfortunately this results in more code and more potential for errors.

Since you should be using HTTPS for both methods anyway, I'd go with the first option. Transport security allows you to prevent modification of payloads, and keeps your API key secret.


Is `curl {something} | sudo bash -` a reasonably safe installation method? The most straightforward way to install NodeJS on Ubuntu or Debian seems to be Nodesource, whose installation instructions say to run:

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

This clashes with some basic security rules I learned long ago, such as "be suspicious of downloads" and "be cautious with sudo". However, I learned those rules long ago, and nowadays it seems like everyone is doing this...well, at least it has 350 upvotes on askubuntu.com.

As I read various opinions on other sites, I'm finding that some people also think curl-pipe-sudo-bash is unsafe:

Phil. (idontplaydarts.com, 2016-04-19) Detecting the use of "curl | bash" server side
Stemm, Mark. (Sysdig.com, 2016-06-13) Friends don't let friends Curl | Bash.
Stackoverflow.com. (2015-04-01 and onward) Why using curl | sudo sh is not advised? (also linked from askubuntu)

while some people think it's just as safe as any other practical installation method:

McLellan, Bryan. (Github.com/btm, 2013-09-25) Why curl | sudo bash is good.
YCombinator.com. (2016-10-22 and onward) "Curl Bash piping" wall of shame.
Varda, Kenton. (Sandstorm.io, 2015-09-24) Is curl|bash insecure?.

There are also some that explore the problem without giving a decisive opinion:

Granquist, Lamont. (Chef.io, 2015-07-16) 5 Ways to Deal With the install.sh Curl Pipe Bash problem.

Since there's no clear consensus from other sites, I'm asking here: Is curl-pipe-sudo-bash a reasonably safe installation method, or does it carry unnecessary risks that can be avoided by some other method?

It it's about as safe as any other standard1 installation method as long as you:

Use HTTPS (and reject certificate errors)
Are confident in your certificate trust store
Trust the server you're downloading from

You can, and should, separate the steps out -- download the script2, inspect it, and see if it's doing anything fishy before running the script you downloaded3. This is a good idea. It won't hurt anything if you do it and you might catch a compromise, which you can report to the source and the community at large. Be prepared to dig through quite a lot of Bash, if my experience with such things is any indicator. You can also try 'expanding' it, downloading any scripts that it would separately and tweaking the script to call those, if you're particularly worried about evil servers, but at some point you have to decide to just use a different server if you trust the first one so little.

Be aware that if the server (deb.nodesource.com) is compromised, you basically have no recourse. Many package managers offer to verify GPG signatures on packages, and even though a fundamental part of the keysigning architecture is broken, this does still by and large work. You can manually specify the CA for wget and curl, though this only proves you're really connecting to that server, not that the server is serving safe code or that it's legitimate code from the creators.4

If you're worried about arbitrary code execution, APT definitely allows that, and I'm fairly confident both Homebrew and Yum do as well. So comparatively, it's not unsafe. This method allows greater visibility; you know precisely what's happening: A file is being downloaded, and then interpreted by Bash as a script. Odds are good you have enough knowledge already to start investigating the script. At worst, the Bash may call another language you don't know, or download and run a compiled executable, but even those actions can be noticed beforehand and, if you're so inclined, investigated.

As a side note, given that a lot of the time you need to install things with sudo, I don't see its use here as any special concern. It's mildly disconcerting, yes, but no moreso than sudo apt install ....

1: There are significantly safer package managers, of course -- I'm only talking about standard ones like APT and yum.

2: ...while being careful with your copy/pastes, naturally. If you don't know why you should be careful with your copy/pastes, consider this HTML: Use this command: echo 'Hello, Evil!'. To be safe, try pasting into a (GUI) text editor, and ensure you copied what you think you did. If you didn't, then stop trusting that server immediately.

3: You can actually detect whether the script is just being downloaded or being downloaded-and-executed, because interpreting a script with Bash takes a different amount of time than saving it to a file, and Linux's pipe system can "back up", which can make those timing differences visible to the server. If you ran the exact curl | sudo bash command they gave, your examination is (at least if it's a malicious server...) meaningless.

4: Then again, it looks like NodeSource is creating some sort of custom installer, which wouldn't be signed by the Node team anyway, so... I'm not convinced that it's less safe in this particular case.


Decrypting intercepted wpa2 traffic If you have the wpa2 network key/password how difficult/time-consuming is it to decrypt the trrafic.

It is very simple wireshark has a feature were you select a packet dump. You can then enter a wpa-psk key the second you enter that all data will be decrypted in packet capture.

Reference/Tutorial: https://wiki.wireshark.org/HowToDecrypt802.11


List of good security podcast one should listen to I'm a hard core dyslectic who wants to read up on all things security without the reading part. So I want to know what good high quality security podcasts are there? I'm interested in almost everything ranging from crypto to the latest scam.

I was listening to Security Now for a while but it was becoming repetitive and only focusing on the latest windows bugs (but for people like me then I have to recommend episode 1-50, they are very interesting a bit old but good). And that's why I want a new source of information.

EDIT!

I did not know this at he time of my post but Steve Gibson - one of the co hosts and the "expert" on Security Now - is also on attrition.org

As someone who spends a lot of time listening to podcasts I'll rattle off a few I've found to be very enjoyable.

Eurotrash Security Podcast

Probably my favourite podcast as it's European albeit a bit light on technical content. News and chat based mainly. They cover a lot of the conferences which is good if you can't get to many (like me). The European slant on the news is particularly good as there is quite a difference between US data privacy law and European so often there are considerations which don't get covered on the other podcasts I'll now list.

I also enjoy their MicroTrash podcasts. Short interviews with people, typically regarding their talks at conferences.

Pauldotcom Security Weekly

Almost the de facto security podcast. Despite the advertising and the stick they get for being corporate I still rate this as just about the best podcast all round (if it weren't for my European bias it would be my favourite). The show provides regular segments of news, interviews and technical stuff.  Lots of in jokes so I suggest you download the back catalogue (I did, took me about six months to get through it, they've been going five years).

Exotic Liability

What can you say about this one? If you're looking for pound-for-pound security content then EL is perhaps a bit lighter than the others but what you do get is the unique view of the world shared by Chris Nickerson and Ryan Jones. Be prepared for lots of swearing, outrageous, completely inappropriate jokes that will leave you crying with laughter in the car (or wherever you listen) grateful that no-one knows what you were laughing at. You're going to hell if you listen. ;-)

In between the laughs what you will get is straight-talking, no nonsense opinion on the state of information security today. Chris and Ryan's qualification to discuss security is beyond question (for me anyway) and sometimes you can learn an awful lot from a throw-away comment from one of those guys. They get your brain thinking about security in the right way imho. Nickerson focuses on security from a perspective of business impact. CEO's don't care if you got "root". They do care if you got their data.

Social Engineer Podcast

This is another excellent podcast focused, as you might imagine from the name, on the human element of security. The guys behind it include Muts and Chris from Offensive Security (think BackTrack) and Rel1k (Dave Kennedy) who wrote the Social Engineering Toolkit (SET).

The thing I like about it is they have a guest interview each month who is nothing to do with security, typically. They try to interview people who use social engineering skills, such as framing, micro-expressions or plain acting, in their day-to-day jobs in order to get a much broader view of the world of human manipulation. If you enjoy human psychology like me it's fascinating.

Southern Fried Security Podcast

Only listened to a couple of episodes of this but I enjoyed the short, news focused format. They tend to keep it to half an hour.

Infosec Daily Podcast

Literally it's daily. I've got a massive stack to listen to and again, I've only managed to listen to a couple but again, the guys behind it are well regarded in the industry so got to be worth a listen.

Security Justice is also supposed to be good although I've not listened to any of those yet. This is co-hosted by Jack Daniel, someone again who is well regarded in the industry.

All of these are easy to find in iTunes, if I can work out how to extract a link from iTunes to each I'll try and post them on here later.


FTP access instead of SFTP We want to provide access to upload files on a FTP server.
How to provide the access for the same?

What is difference between a FTP and SFTP server?

In simple terms, both do the same thing, but SFTP sets up an encrypted tunnel first. This is important because without it, the username and password people use to log in can be read by anyone who can see the traffic.

SFTP is recommended if you care about the files staying private.


If I enter a password on the wrong site, should I consider it compromised? I have recently started to make use of a password manager and good password practices.  I have a different password for each site that I use.

If I accidentally use the password from another site when logging in to a webpage, should I consider the password compromised and change it?

E.g.

If my password for www.example.com was passwordOne
And my password for www.ejemplo.com was contraseñaUno
And I accidentally try to log into www.example.com with password contraseñaUno

Would I need to update the password for www.ejemplo.com?

I can see a similar but different question here, but that relates to the password being entered into the username field.

Just to play the devil advocate...

You are as likely to be compromised as if you were using the same password on both site*.

As most people have pointed, you probably don't have to worry. Not so much because a website cannot make the difference between a good or wrong password but rather because most websites that you will visit will likely not log your password. The reason is simply that it provides no value to them. Most websites are there to do legitimate business and hence see no value in being malicious by recording every password entered.

Still, if I had evil intention and wanted to gather many possible passwords, hosting a service online to gather passwords would probably be a better alternative than trying to brute force every possible combinations. Catching all passwords, even bad ones, is not a bad idea if you are hosting that kind of "service". Users that have multiple passwords are very likely to enter the wrong passwords on the wrong site, hence logging bad attempts as well as good attempt is a good attack plan.

For example consider this quote from https://howsecureismypassword.net/

  This site could be stealing your password… it's not, but it easily could be.
  Be careful where you type your password.

It put things in perspective. Also, is such evil "service" so unlikely? It's hard to say but for sure it's nothing new: https://xkcd.com/792/

Note*: Well, I did say "as likely" but it's not exactly true. By using the same password on many sites you are not only vulnerable to malicious sites but also to the incompetence of site owners. Many websites still store your password in plaintext in their database or use weak hashing, which means that if an attacker is able to steal their database your password is compromised.


Legal website to practice using hydra I am trying to learn how to use hydra to crack login passwords.

Does anybody know a legal website I can crack and if so the information needed or the code needed to enter the form into hydra?

There are numerous options. VMs designed to be hacked (DVWA, metasploitable, etc.), hacking websites where attacks are permitted, or creating your own service.

But don't overlook the obvious: your own router. The login web page is simple, and you know the password. Give it a shot.


How could the content of an e-mail get leaked? My Mother received an e-mail, from some unknown mail adress. The content of the mail, was:
"Hello you should look at this: ... " After this there was an old email correspondence with her lawyer, not really sensitive data, but still. There was a .zip file attached, the file name beeing some long number. She didn't try to open it or anything.
She is confident with computers, so she would not click on suspicious links in mails and not enter her passwords somewhere easily (of course you can always fall for something, but i don't belief she did). She also uses a password manager with good passwords for every account.
How could the content of the mails have been leaked? And what are steps to take now?

How could the content of the mails have been leaked?

This is a known strategy of the Emotet malware campaign, see Emotet is back, it spreads reusing stolen email content. The lawyers system was likely compromised by the malware and details of a previous mail exchange were used to bypass filters and gain trust of the victim.

And what are steps to take now?

Consider the lawyers system compromised and thus communication with the lawyer and shared personal information compromised too. How relevant this is and which steps need to be taken for further protection depends on the sensitivity of the data shared with the lawyer. Depending on where you live this kind of compromise might also be relevant in the scope of data protection laws, i.e. GDPR etc.


Business Partner Information Leaking I just went through a penetration test, and what was wierd was we had a comment back about a potential data leak via DNS snooping (I realise this is boiler plate, and also this is an internal only DNS, which adds complexity):

  For instance, if an attacker was interested in whether your company
  utilizes the online services of a particular financial institution,
  they would be able to use this attack to build a statistical model
  regarding company usage of that financial institution. Of course, the
  attack can also be used to find B2B partners, web-surfing patterns,
  external mail servers, and more.

I'm not asking why DNS snooping is or isn't a vulnerability

Similarly, there are occasions where the penetration testers return comments like "its possible to guess the OS you're using"...

This seems incredibly weird for me, because we often, publicly, talk about our partners and technology solutions:

We do public talks about various topics and highlight our customers, projects, and partners to show off our technical ability
we attend conferences about particular technologies, and help the communities in moving forwards to better solutions.
We publish recruitment with a list of technologies that we use
Our partners often publish that they use our services
We sometimes publish (by law/regulation, as we're listed) significant contracts so our partners are a list

Is there a case that sometimes we are being over zealous in our analysis of the systems, where the information is easier come by elsewhere, or should we become a black box company where nobody says anything, and we recruit via vague statements, maybe via shell organisations so nobody knows what we do.

Basically: How do we balance time and effort spent looking and finding 'data leakage' about things vs being able to operate as a company, where is the line for our people what they can and can't talk about, how do we monitor and control that?

You are in the same boat as many, many other technology companies. If the pentest company did not factor in all of your points above into some context for the risks they identified, you might want to consider changing companies.

Information disclosure presents a risk. You need to assess that risk and determine if the impacts are high enough to require that you mitigate that risk.

You may determine that the risks are simply not high enough to worry about it, in which case you accept this risk.

You may accept that there is a risk, and instead of plugging all the leaks, you use other, cheaper, methods to reduce the risk to an acceptable level. For example, if someone can know what OS and version you are running, then when a vulnerability is announced, you must be faster to patch or block access to that vulnerability than you might be otherwise. If you can do that, then that's a better way forward.

Another term that is gaining traction is "digital footprint". What info is out there about you? What do you disclose? Once you understand that, you then need to decide what to do if a malicious actor had all that info. What would you need to do differently? The big one is not to trust a someone just because they happen to know something internal to the company. Trust must be formalised and cannot be based on knowledge or familiarity. For instance, someone saying that they are from your bank should never be enough to trust them. There needs to be established ways to determine trust beforehand (approved phone numbers, 2FA, etc.)

So, how do you move forward as a company? The best case is to assume that everyone knows everything and mitigate what that means for you.


Confidentiality with digital signatures Recently I have been working with digital signatures. Some common reasons for applying a digital signature in communication are authenticity, integrity and non-repudiation.

Do digital signatures also provide confidentiality?

No it does not. You can reference Wikipedia:

https://en.wikipedia.org/wiki/Digital_signature

  "A digital signature is a mathematical scheme for demonstrating the
  authenticity of a digital message or document. A valid digital
  signature gives a recipient reason to believe that the message was
  created by a known sender, that the sender cannot deny having sent the
  message (authentication and non-repudiation), and that the message was
  not altered in transit (integrity)."

A digital signature alone does not provide confidentiality since it does not prevent disclosure of information you would want to keep secret. Encryption would be an example of a mechanism to provide confidentiality.


Open-Source Hardware Security Modules (HSM) Are there any Open-Source Hardware Security Modules (meeting OSHWA requirements)?
I've worked with Utimaco HSMs, but I'm not a big fan of closed-source hardware -- especially when it comes to security but also out of principle.
Moreover, I was shocked that Utimaco didn't ship with any anti-interdiction services. I can't place much trust in a black box that was mailed to me without anti-interdiction services and no way to verify the integrity of the hardware.
Are there any Open-Source, Programmable Hardware Security Modules available on the market?

I am not aware of any. Developing an HSM is a lot of work, especially if you are complying with FIPS level 3 / 4 physical tampering and side-channel resistance. I could imagine a world where a group of tech giants get fed up with specialty HSM vendors and decide to come together to develop an open hardware standard and jointly invest the money and time to get it certified, but I don't think that's the world we're in today.


4096 Bit RSA Encryption Cracked I'm new to encryption and still learning about it; I overheard someone this weekend mentioning that 4096 bit encryption was "cracked" by listening to the CPU and searched for this to confirm it because it sounded a little hard to believe.  However, at least if this article is legitimate, it appears to be true.

According to the article, the individual cracking it would need the ability to listen to the CPU that could decrypt the encryption, and it looks like that individual couldn't be too far away either:

  The researchers successfully extracted decryption keys over a distance
  of four meters (13 feet) with a high-quality parabolic microphone.
  Perhaps more intriguingly, though, they also managed to pull of this
  attack with a smartphone placed 30 centimeters (12 inches) away from
  the target laptop. The researchers performed the attack on different
  laptops and desktops, with varying levels of success. For what it’s
  worth, the same kind of electrical data can also be divined from many
  other sources — the power socket on the wall, the remote end of an
  Ethernet cable, or merely by touching the computer (while measuring
  your body’s potential relative to the room’s ground potential)

From a security standpoint, are there any safeguards to protect against this outside what the article mentions ("heavy duty security and physical security")?  I realize that to a certain degree some people will always try to break encryption, regardless of how many bits it is, but from someone on the protection side of things, what best practices do we have to prevent this type of encryption-hacking from occurring?

I forgot to add: one reason for this concern is that businesses/governments/powers-that-be could put a microphone by a CPU without users being aware so that they could obtain encryption information, and from there it's only a matter of hackers finding ways to get that information, as business/government/powers-that-be data are not always the most secure.

In secret government agencies there is defence also against other side-channel attacks (e.g., electromagnetic).
These protection mechanisms are usually physical: for example, they do not (or at least should not) use drywalls.

Other defences might be in re-implementing the algorithm, probably with some overhead.

Additionally, the attack is Chosen-Ciphertext-Attack. So you can just try to prevent your system from decrypting irrelevant messages (see in their paper how they did they CCA attack).

To conclude: Breaking cryptography by side channels is not something new. You can protect your self by adding physical protection or re-write the code (change the implementation) in order to prevent the side-channels.


Methods to detect calls being routed through Stingray devices? Are there any methods for a non-jail broken Apple iPhone to detect rogue cellular towers? Such as the "Stingray" device that mimics cellular towers.

From the Apple iPhone user's endpoint side, is there any way to detect you are being routed through a rogue cellular tower?

Can't see anything for iOS but there is an app for Android that claims to be able to do this. However, it only works with a specific chipset and only on a rooted phone. So it is very unlikely that you could do this on an Apple phone. Another app is in early development.

There are also dedicated systems for trying to track stingray use. A "homemade" example is here.

In theory, you might be able to track use at a static location by knowing the ID's of the local stations so that you can spot when a new station ID appears.


What's the weakness of keyed-MD5 for message authentication? I've seen public web API's using keyed-MD5 to generate message authentication code rather than adopting the HMAC algorithm. People wouldn't just invent HMAC for fun, so it must have some advantages over keyed-MD5. (However, we do have a keyed MD5 authentication standard described in RFC 1828.) Are there any known vulnerabilities of keyed-MD5 as a MAC algorithm compared to HMAC?

From RFC 1828 - IP Authentication using Keyed MD5:

   The form of the authenticated message is

            key, keyfill, datagram, key, MD5fill

The "keyed MD5" described in RFC 1828 can be summarized as follows: for key K and data D, the MAC value is MD5(K||D||K) (in the RFC, K is first padded to a length multiple of 512 bits, but it does not substantially change things here). To my knowledge, there is no known weakness to that construction, but there is not much security analysis either.

HMAC has been designed to provide security when used with a hash function that relies on the Merkle–Damgård construction. It has been proven that IF the inner "compression function" of the hash function acts like a pseudorandom function family, then HMAC is secure. We do not know of any similar security proof for the "keyed hash" construction. In that sense, we believe more in the security of HMAC than in the security of the "keyed hash".

If hash functions were "perfect" in a sense that relates to the notion of random oracles, then the keyed hash would be "obviously" secure, like a number of other constructions, e.g. h(K||D). This latter example falls to the length extension attack when the hash function uses the MD construction (which is the case for MD5 but also SHA-1, SHA-256...); this does not directly impact the "keyed hash" from RFC 1828, but is sufficient to demonstrate that MD-based hash functions are not perfect in the sense alluded to above, and thus security of any MAC construction cannot be simply assumed. We need some more details, and with HMAC we have these details.

Some extra notes:

The "length extension attack" does not contradict the classical security of the hash function, namely resistance to preimages, second preimages and collisions. In particular, SHA-256 and SHA-512 are "believed secure" and yet fall under the scope of the length extension attack.
Collisions are not an issue here, and, more generally, are not an issue in constructions that use inputs unknown to the attacker (as is customary for MAC, because of the key). We know how to produce collisions for MD5 very efficiently; but we do not know how to attack HMAC/MD5 or even the "keyed MD5". (It is possible to design a contrived MAC that uses MD5 and is weak because of MD5 collisions, but that's not the case for HMAC nor for the "keyed MD5" we are discussing here.)
Conversely, while collisions do not apply to HMAC, the mere existence of efficient methods to compute MD5 collisions demonstrates that the inner compression function of MD5 is not a PRF, and thus the HMAC security proof does not apply to HMAC/MD5. This is a pity since the whole point of using HMAC and not the "keyed hash" is to benefit from the security proof. Take care to note, though, that lack of security proof does not mean that attacks are possible; only that if an attack is found, then it would not contradict the generic HMAC security proof.


VPN tunnel inside other VPN tunnel This question is kind of asked already but it was asked with different context:

VPN tunnel in VPN tunnel
Connect through two VPN clients
https://superuser.com/questions/763433/tunnel-in-a-tunnel-multi-vpn

Say I am using DD-WRT flashed router which connects as a client to VPN server #1.

If I setup my machine that's behind the DD-WRT router, using a software VPN client to connect to VPN server #2, will I get 'doubled' anonymity (i.e it's harder to get logs from several VPN providers)? Will such a setup work?

Can I chain this (VPN-1 router behind VPN-2 router ... behind VPN-N) assuming that speed and latency is of no concern?

UPDATE: just to clarify my question: did anyone try this setup? I would like to have some confirmation from the person who used such setup or something similar.

I've had this working on my home router for a few months with no issues. DD-WRT is configured as an openVPN client to a PrivateInternetAccess account so that all PCs are forced to use it for Internet traffic. Then I tunnel each PC using openVPN to a different service. Performance definitely takes a hit but it's still quite usable and there are no routing problems.


What security requirements should implement a L2L VPN in order to protect one end from the other? I would like to create a L2L VPN between two organizations. Due to the hyphotesis that WannaCry was propagated in great part using these kind of connections, I would like to implement security measures to protect one end from the other.

What security requirements should be implemented?

Edit: From NIST "Guide to IPsec VPNs" a gateway-to-gateway or L2L VPN "is done tipically by deploying a VPN gateway onto each network and establishing a VPN connection between the two gateways. Traffic between the two networks that needs to be secured passes within the established VPN connection between the two VPN gateways. The VPN gateway may be a dedicated device that only performs VPN functions, or it may be part of another network device, such as a firewall or router."

Some security measure I have gathered:

The remote site should have connectivity only to what is needed (internal IP ranges should be restricted).
The remote site should have connectivity only to the ports and services that are needed.
Only authorized remote sites should be able to connect.
There should be an Intrusion Prevention System (IPS) between the remote site and us.
Communications should be encrypted.
Communications should be allowed to initiate only from the remote site to us, not the other way.


Generating a Certificate Signing Request for an Apache webserver on a sub domain? I'm reading the instructions for generating a CSR, and it reads that:

  "Replace yourdomain with the domain name you're securing. For example,
  if your domain name is coolexample.com, you would type coolexample.key
  and coolexample.csr."

I realize that this is all just filenames that will be read by my server, but to stick to the convension, if I'm securing a single server and not an entire domain, then would I include the hostname in the name of the private key and the csr?

For what it's worth:
Here's what I do:
The chain of trust for https://example.com/ including end-entity certificate and root CA certificate has 3 certs. And I would name them as such:

0.example.com.cer
1.intermediate.cer
2.root.cer

Why? Because then a directory listing gives them in the correct order straight away. And .cer is the default Windows file extension.
And for the key:

0.example.com.key

And for the request:

0.example.com.req

Now why not .csr? Because Windows CA wants .req and Unix/Linux CAs don't care either way. So REQ it is.
Subdomain in name or not?
Include what makes it easier for you to remember. "example.com" is actually not the CommonName for that cert. That would have been www.example.org. And I still chose to go with the example.com name, because that is what I remember that site as best.
So if it matters to you, if that helps you keep things apart, then include it.


Signal: contact people, or have people contact me, without revealing phone number? Is it possible to use Signal without revealing my phone number to others?

I'm personally using the Signal app on Android, but of course it applies to all versions, desktop and mobile.

With Telegram for example, I can pick a username and then share that username. And people can contact me with just that username. No phone numbers involved. Is something like that possible with Signal as well? Or do I have to give my phone number when asking someone to contact me on Signal?

I realize I have to use my phone at least once to register with Signal itself, and setup an account. But once I've done that, I wish to contact other Signal users, or have other Signal users contact me, without revealing my phone number to them.

The addresses in Signal is the phone number. It's specifically designed to use the phone number to address message, to be a drop in replacement for SMS, and offer opportunistic encryption for text messages and calls between phones.

If this is not fine in your situation, then Signal is (sadly) the wrong system for you. As you say, Telegram (and many others) allow you to use a chosen username.


Can a website detect my local WIFI network I am in? I have two computers, both of them locate at the same local WIFI network ( ie: connected to the same router).

I use VPN on a computer to visit a website, and don't use VPN on another to visit the same website. Can this website know that both computer are located within the same local WIFI network?

In theory, yes, the webrtc standard let's a website determine your local ip address, so it can create a direct connection for you to a another web-browser, allowing direct connections between browsers to set up video streaming for example.

This website has a proof of concept showing you your internal and external ip address:
https://www.privacytools.io/webrtc.html

Once the website has both internal ip addresses, it can use javascript to try to set up a connection over the internal ip's from pc1 to pc2, if this succeeds, it knows these 2 pc's are in the same local network.

remark: Chrome on iOS, Internet Explorer and Safari do not implement WebRTC yet, see https://www.privacytools.io/#webrtc for more info.

Update 23/08/2018:
Another possible attack vector has come to my attention lately:

DNS rebinding, from wikipedia:

  In this attack, a malicious web page causes visitors to run a client-side script that attacks machines elsewhere on the network. In
  theory, the same-origin policy prevents this from happening:
  client-side scripts are only allowed to access content on the same
  host that served the script. Comparing domain names is an essential
  part of enforcing this policy, so DNS rebinding circumvents this
  protection by abusing the Domain Name System (DNS).

  This attack can be used to breach a private network by causing the victim's web browser to access machines at private IP addresses and
  return the results to the attacker. It can also be employed to use the
  victim machine for spamming, distributed denial-of-service attacks or
  other malicious activities.

This works by having a malicious website/dns server setting a very low ttl for it's dns requests, and then having javascript running scripts on the original website's address.
Half of the time the dns will respond with the correct external ip, so the website will load, but after a few minutes when the javascript kicks in and tries to access the website again the dns will respond with a local ip adres (e.g. 192.168.0.1, this can change every few minutes) and the browser will run the javascript and connect to devices on the local network!


Best practices for setting up client connections to a server with app credentials The question title is... ugly to say the least. Here's an overview of what I've got:

I work on an online tool. Data is sent to it, it processes the data (an intensive task) and sends results back.
The tool is sold to organisations who want to include the functionality in their public websites and apps for their customers to use. The tool remains on our servers (no client has access to the code or binaries)
I need to stop unauthorised organisations using the tool in their sites and apps.

Inside a browser, authorisation is easy; I simply check the ORIGIN header when requests are made and all is good (individual users hacking their headers isn't important).

In apps it's a different story. First, I need to prevent applications simply using the browser interface (or rather, make the browser interface the same as the app interface), then I need to use keys or similar to authorise allowed clients.

I realise that no matter what authorisation I put into the apps, it can always be hacked out because they're public, but this can't be a unique situation, so I'm wondering what solutions have already been developed. (Since I have limited knowledge of security terminology it's proven hard to search for!)

Your question is essentially one about DRM.

I can't really make out one important fact about the tool. Is this tool hosted on your own servers or your clients servers?

If the tool is hosted on your own servers, this makes the situation a lot easier. Setup a authorization system based on API keys and only allow clients to use the tool if an accepted API key is sent in the request. In this scenario, you have to ensure that none of the relevant (data processing) portion of the code is in the hands of the client.

If the tool is hosted on your clients servers, the API key system still works. Have a functionality that allows the clients to generate and revoke API keys to allow them access into that particular instance of the tool.

If your question is how to prevent unauthorized organizations on installing your tool in their own servers, this problem is probably difficult to solve technically. You might want to rely on legal contracts to prevent authorized organizations from leaking your code.


How to MiTM SSL on a device with no proxy settings I'm trying to MiTM a device on my network and having some problems.

SSLstrip doesn't work because the URL is https://, and I can't use something like Fiddler because the device has no configurable proxy settings for me to direct traffic with.

What other attack vectors do I have?

I believe there must be some sort of confusion here. You seem to think that Fiddler is some attack/hack/magical tool. To decrypt SSL traffic with Fiddler you either need to possess the session key or you need to install Fiddler's certificate on the device.

Asking for an attack vector and talking about using Fiddler in the same question sounds silly. You're saying you already have access to the traffic, you're already an MiTM. All you need to do is use the session key and or get the device to trust your fake certificate.

I highly recommend that you read up on the topic.


Digital Signature and man-in-the-middle While reading this page about Public-Private key encryption, I asked myself a question about digital signature:

Alice wants to sign a message for Bob; she uses her private key to sign the message. Bob receives it and uses Alice's public key to generate the signature and checks that it's the same as the one that Alice attached to the message.

If I'm a pirate, I can intercept Alice message, and use Alice's public key to generate the signature too, no? If I'm right, it means that I can change Alice message, uses Alice's public key to generate the new signature and send this one to Bob, instead of the original one, no ?

There must be something wrong in this logic, but I don't see where...

Bob does not "generate" the signature with Alice's public key. Signature generation requires the private key. What Bob does is verifying the signature; verification needs only the public key.

Indeed, the public key can safely be made public precisely because knowing the public key is not sufficient to generate signatures.

(You may have been confused by some explanation about how a signature is "encryption with the private key". This is a very widespread but also flawed and confusing explanation, that is best ignored.)


How do I correctly use CORS with OpenID Connect? There seems to be a number of questions on several blogs, Q&A sites, and comments that ask variants of the question:

  How do I correctly use CORS with OpenID Connect?

The context of these questions are usually applied to one of these roles:

The issuer such as Facebook, Azure AD (This is the "OP" or "OpenID Provider" in the Specification)
A relying party such as StackExchange, or FB Connect Auth (The website "client" in the Specification)

While reviewing the questions, sometimes the asker or answerer is referencing some specific profile, while not explicitly mapping the use case to the relevant OpenID Connect Flow

Web browser authentication with redirects, or Javascript
A single page application (SPA)
An active client (Flash, Browser Plugin, native phone app)
Device flow (Activating AppleTV)

I'm looking for one or more correct answers that describe how and when CORS is appropriate for a given role or usage profile.    Since the quantity of correct usages of CORS w.r.t. OpenID Connect are finite, I think it's possible to have several correct answers.

Question (rephrased)

What CORS policies should be used on the OP, or Client servers?
What CORS policies should be used for:

Implicit
Authorization code
Hybrid
Client credentials
Resource owner password
Refresh tokens
Extension grants

When is CORS not applicable, or specifically a threat to security?

When is CORS a risk to security

CORS can override the default rules, so an overly permissive CORS policy can be worse than no policy.

How permissive should CORS be

CORS should be as restrictive as possible while still allowing the use cases you wish to enable. CORS can help prevent CSRF attacks, so care should be taken to not weaken this defence too much.

Where does CORS apply

CORS only applies within the browser, so it does not apply to the options outside of the browser, such as native apps and device login.

Web browser authentication with redirects, or Javascript

CORS applies

A single page application (SPA)

CORS applies

An active client (Flash, Browser Plugin, native phone app)

CORS does not apply - not inside of a browser

Device flow (Activating AppleTV)

CORS does not apply - not inside of a browser


Is haveibeenpwned (HIBP) free and reliable? I have just started to explore HIBP to check whether we can use HIBP in our public facing interfaces.

AS per my read I have 3 options to check out.

Download the password dictionary and implement my own breached password checker
call HIBP api to check whether the given password is already breached
Use one of the password managers to perform the task (as you mentioned in Troy Hunt's blogs: 1Password manager)

As a developer I prefer to choose either the 1st or 2nd option as I don't have to pay for it.

I wanted to check with you how reliable to use 1st or 2nd option: How often the password dictionary get updated?

What about the availability of the password dictionary/api? are there any policies covering this? If so, Do I need to pay for anything?

The HaveIBeenPwned API is safe to check for leaked passwords as the password or the hash is never transmitted via API. Here is how the API works,

You hash the password to be checked
Send the first 5 characters of the hash to the HIBP API.
The API returns hashes of used passwords that matches the hash's starting characters.
You check locally in your server whether the password hash is among the list.

To address your other points,

The service is free.
Yes, there is a policy about accepted usage.
In the homepage of HIBP there is a section called recently Added Breaches. At the time of writing, the most recent breach added is Dec 2018, the data was leaked on internet on Feb 2019 and added into the site in Apr 2019. You can aslo find the details on the twitter account. On average it would seem that 10 data breachs is added per month.

Other options

Option 3 is more or less the same as it uses the same service in the background.

Among your options, I will choose either option 2 or 3 as they will be updated more regularly.


Does an established HTTPS connection mean a line is really secure? From the view of somebody offering a web application, when somebody connects with TLS (https) to our service and submits the correct authentication data, is it safe to transmit all sensitive data over this line, or can it be that there is still eavesdropping?

  This question was IT Security Question of the Week.
  Read the Jul 29, 2011 blog entry for more details or submit your own Question of the Week.

It's important to understand what SSL does and does not do, especially since this is a very common source of misunderstanding.

It encrypts the channel
It applies integrity checking
It provides authentication

So, the quick answer should be: "yes, it is secure enough to transmit sensitive data". However, things are not that simple.

The newest versions of SSL - version 3, or better yet: TLS, even TLS 1.2, are definitely better than previous versions. E.g. SSL 2 was relatively easy to MITM (Man in the middle). So, first it depends on protocol version.
Both the channel encryption and the integrity checking are configurable in the protocol, i.e. you can choose which algorithms to use (cipher suite). Obviously, if you're using RSA1024/SHA512 you're much better off... However, SSL even support a mode of NULL encryption - i.e. no encryption at all, just wrapping the requests up to tunnel over SSL protocol. I.e., no protection. (This is configurable both at the client and the server, the selected cipher suite is the first matching set according to the configured order).
Authentication in SSL has two modes: server-authentication only, and mutual authentication (client certificates). In both cases, the security ensured by the cryptographic certificates is definitely strong enough, however the validity of the actual authentication is only as good as your validity checks: Do you even bother checking the certificate? Do you ensure its validity? Trust chain? Who issued it? Etc.
This last point re authentication is a lot easier in web applications, wherein the client can easily view the servers certificate, the lock icon is easily viewable, etc. With Web Services, you usually need to be more explicit in checking its validity (depending on your choice of platform). Note that this same point has tripped up so many mobile apps - even if the app developer remembered to use only TLS between the phone and the server, if the app doesn't explicitly verify the certificates then the TLS is broken.
While there are some mostly theoretical attacks on the cryptography of SSL, from my PoV its still plenty strong enough for almost all purposes, and will be for a long time.
What is actually done with the data at the other end? E.g. if its super-sensitive, or even credit card data, you dont want that in the browsers cache, or history, etc.
Cookies (and thus authentication) can be shared between a secure, SSL channel, and a non-secure HTTP channel - unless explicitly marked with the "secure" attribute.

So, shorter answer? Yes, SSL can be secure enough, but (as with most things) it depends how you use it. :)


Are there any known MD5 hash collisions of messages of different length? All the examples of MD5 hash collisions I've come across comprise two different messages (inputs) of the same length. The first and second messages have different values for a number of bits and the resulting MD5's are equal.
Does the theory of finding an MD5 hash collision (exploiting the weakness in the algorithm) prescribe that the lengths of the messages be the same? In other words, would the theory be unusable to find a collision of two messages of different lengths? Has such a collision ever been found?

Does the theory of finding an MD5 hash collision (exploiting the weakness in the algorithm) prescribe that the lengths of the messages be the same? In other words, would the theory be unusable to find a collision of two messages of different lengths?

MD5 includes the length of the message in the final block. This means that from an attackers point of view, for reasonable sized messages*, a difference in message length* is effectively equivalent to a distinct chosen suffix.
There have been attacks on MD5 that have allowed for distinct chosen prefixes, but afaik none that allow for distinct chosen suffixes.
* Technically you could find a collision between two messages whose size differed by 2^64 bits, but actually storing and transmitting the larger of the two messages may pose a challenge.


Could Intel SGX be dangerous under Linux? Question Background

This morning, by accident I have found, that there is basically a backdoor in a dormant state in my Dell laptop: Computrace, which comes from Absolute Software - link to their Web, link to Wikipedia.

Actual Question

Since I read some UEFI/BIOS setting can't be changed once set already, I wonder if such practice is also the case in Intel SGX technology (SGX Intel, SGX Wikipedia), which I probably would like to disable too since I've seen from this Linux shell script that SGX is Enabled in my system configuration and then proved by looking into UEFI/BIOS, where it's currently set to Software Controlled, I would like to ask if having SGX enabled or software-controlled is a bad practice, or worse - Could Intel SGX be dangerous under Linux?

Personal Background

I'm a security amateur at home. I'm primarily interested in VPN topics, and I don't even know what SGX really does yet.

SGX can be used to protect critical operations (like cryptography using secret keys) against inspection from outside the SGX enclave. It can also be used by an attacker already on the system to hide his activities against inspection. Thus, unsurprisingly there is no absolutely good or absolutely bad - it depends a lot on your specific (and unknown to us) environment and risk profile.

And the same is true for Computrace too. The control it allows a remote party can be used for good and bad, where the intention is actually to be used for good: track down stolen notebooks. And to make this possible it is actually necessary that it can not be simply disabled by an attacker.


Can I add other key holders to an existing PGP file? If I have a file that I encrypted with PGP and I'd like to allow other people to view the file after I performed the original encryption can I simply add them to the PGP payload?  Since PGP creates a symmetric encryption key that is used to encrypt the file's content, and encrypts that symmetric key with each user's public key then it seems like I could add or remove people from the file by modifying the header and not re-encrypting the entire file again.  Is that possible with PGP tools?

While this would theoretically be possible, the common tools do not support it. PGP has --export-session-key and GnuPG has --show-session-key & --override-session-key, but the latter is only used for decryption. For encryption, a new random session key is generated every time.

--show-session-key
Display the session key used for one message. See
--override-session-key for the counterpart of this option.
We think that Key-Escrow is a Bad Thing; however the user should have
the freedom to decide whether to go to prison or to reveal the content
of one specific message without compromising all messages ever
encrypted for one secret key. DON'T USE IT UNLESS YOU ARE REALLY
FORCED TO DO SO.
--override-session-key string
Don't use the public key but the session key string. The format of
this string is the same as the one printed by --show-session-key.
This option is normally not used but comes handy in case someone
forces you to reveal the content of an encrypted message; using this
option you can do this without handing out the secret key.


What do I do if I find XSS on my website? I found reflected XSS on my website. And its fixed now. There are a lot of websites which tell how a XSS can be detected or what can be compromised but I could not find what measures should be taken after a XSS has been found. I know what an attacker can do using an XSS. Basically, all the cookies and session info can be compromised.

How do I find out what was compromised? (I suppose there is no way to find this out but I want to be sure if there is a way.)
What should I do mitigate the damage done to my website, if any?

The first step is to patch the vulnerability by escaping any HTML entities or removing any dangerous characters all together.

Reflected XSS is a client-side attack method, caused by a server side vulnerability. I wouldn't worry too much about any damages if you didn't catch an XSS worm in action or actually saw anyone using the exploit to attack other users. Just because you found a vulnerability in your code doesn't necessarily mean it has been exploited.

Most often XSS bugs aren't looked for as quickly as something like SQL injection or server side code executing has a way more devastating impact as it hits the server rather than the client. You could try looking in your web server's logs, or query your database for any strange characters such as < or > which are often required to perform XSS based attacks.

Any other way to prevent stolen cookies from being re-used is by forcing all your users to re-authenticate.


Is a properly configured server secure against unauthorized data access? Take for example a game. Typically, when you buy or download a game that can be played offline, all of the data required to run the game is shipped with the executable. In order to protect these resources, developers use various protection methods such as passwords, encryption, compression, file archives, anti-debuggers, and so on. Of course, most (if not all) of these can be reverse engineered if someone was to spend enough time and effort on it.

I've been looking at different online games and have found that browser-based games tend to be much more secure when it comes to unauthorized data access. This is because (when feasible) a resource is only sent to the client when it is requested, and an ideal URI typically uses a random string that is both unfeasible to guess and impossible to reverse engineer.

For example, suppose I have an image called "duck.png". I then rename it to a random 64-character string, perhaps randomly pounding away at the keyboard. Unless you are incredibly lucky, you won't be able to guess that. You could add additional security measures, such as making it so that if an IP attempts to request an invalid resource more than, say, 100 times, the server automatically suspends them for some period of time.

Assuming security is properly set up on a server (proper access control, secured API's that properly checks requests before processing them, consistent use of the random strings), can I be confident that the only way an outsider would be able to access this resource is through legitimate means, such as playing the game?

Or are there techniques that adversaries can use to gain access (easily) to the resources that I'm trying to protect? I'm assuming that gaining unauthorized access to a server is not an easy task because the server is secured.

Assuming security is properly set up on a server (proper access control, secured API's that properly checks requests before processing them, consistent use of the random strings), can I be confident that the only way an outsider would be able to access this resource is through legitimate means, such as playing the game?

No.

Is a properly built (and secured) house/building secure against unauthorized access? No!

There are no absolutes.


How can a userspace linux process refer to a kernel address? I would like help understanding a particular aspect of meltdown.

My understanding is that the meltdown bug can be used for a userspace linux process to access kernel memory (indirectly, through a timing side channel). Listing 2 in the meltdown paper is:

1 ; rcx = kernel address
2 ; rbx = probe array
3 retry:
4 mov al, byte [rcx]
5 shl rax, 0xc
6 jz retry
7 mov rbx, qword [rbx + rax]

What I am confused about is how a "kernel address" can exist inside a userspace process. Wouldn't a userspace process have its own address space and memory mapping, different to the kernel? My expectation is that in a userspace process the address inside rcx would be translate to something other than what it would be translated to inside the kernel. Probably just an error/segmentation fault.

How is it possible for a userspace process in linux to refer to a kernel address?

As a performance optimization, the kernel memory was mapped within the memory space of the application.  The pages are protected, but the page tables were (before KPTI) mapped in so they did not have to load them from memory on each system call.  Now each system call incurs additional overhead to load the kernel page tables.


HIDS that can detect attacks, take immediate action locally, and then report to a central service for re-broadcasting to other systems? I've been researching this for a bit now and cannot find what I want. So I'm to the point where I'm weighing my options as to how I can proceed.

Background

I'd like to setup a HIDS that has the ability to use rules to monitor web server logs for known patterns of attacks. I'm thinking something along the lines of how fail2ban works here. Regex is OK but it would be even better if the "rules engine/scanning tool" had some context of how the logs were structured for servers such as Nginx and/or Apache so that the rules could be matched against the log entry contextually, vs. just being a regex.

Sample Apache log entry

  192.168.1.6 - - [25/Sep/2014:15:54:01 -0400] "GET /blog/wp-content/themes/atahualpa/images/icons/trackback.gif HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible;)"

Regex example (I don't necessarily want this):

^%(_apache_error_client)s (AH01618: )?user .*? not found(: )?\S*(, referer: \S+)?\s*$

Contextual rule (I'd like this instead):

sourcetype=http
requestpath=/w00tw00t

Evasive maneuvers

I'd like this capability to be deployed with the web server nodes so that they can take immediate actions when a threat is perceived via iptables & ipset. In addition to taking immediate actions, I'd like to report the mis-behaving IP address back to a central server, which will have the ability to re-broadcast this IP out to my other nodes, so that they too can add it to their firewalls too.

Central control

I'd like the central management to keep track of what IPs are currently being blacklisted, and to relay these to the other nodes so that they can incorporate the blacklisted IPs into their firewalls too.

After a time the offending IPs would expire out of the central node, and it would report to the nodes that this IP is no longer being blacklisted.

UPDATE #1 - regarding the potential use of OSSEC

A comment was left as follows:

  Just want a little clarification. The thing you can't find a solution
  for is the centralized part, right? As far as I can tell from your
  question, other than the centralized IP blocking, OSSEC can perform
  all of these functions

To which I replied:

  You're correct, I didn't realize that OSSEC had active responses that
  could take actions locally on the agents end. It's described here:
  New to ossec - what does active response do out of the box So the collecting of the
  banned IPs and re-broadcast would seem to be the only thing that's not
  available within OSSEC.

But it's still unclear to me whether the agents can act autonomously and take an active response when a particular log message is seen or not. This comment in the FAQ makes me think that they cannot, Do the rules get pushed to the agents automatically?. So what happens when the OSSEC central server is down? The agents will queue up logs, but will they be able to take any active response on their own to a perceived attack?

References

ossec.conf: Active Response Options
Welcome to OSSEC’s documentation!
OSSEC FAQ's

To put this a little more officially as an answer, I believe OSSEC has the options you're looking for. You can create custom rules, configure it to watch specific log files (such as your web server logs), and trigger alarms if certain regex matches or strings are detected. Active response can actually run more or less any command, you just have to place it in the active-response bin directory which is /var/ossec/active-response/bin by default.

With Active Response you could trigger a script that pushed the IP somewhere centrally and that could be used to derive a list of bad IPs. Active Response has a timeout mechanism to "reverse" the response as well using add or delete. You can view sample scripts in the Active Response bin directory. I will caution you that iptables is not very scalable with a large number of rules, so you will want to test this pretty thoroughly no matter which direction you go with this. Odds are the number of IPs you will block are pretty low, but you never know. Here are a couple of links that may be helpful to you.

http://ossec-docs.readthedocs.org/en/latest/syntax/head_ossec_config.active-response.html
http://sgros.blogspot.com/2012/08/about-active-responses-in-ossec.html


Can a kernel exploit compromise an OpenVZ host? As OpenVZ runs on a lot of virtual servers, I would like to know how kernel exploits would affect the whole system. Would it be possible to break out of an OpenVZ container (virtuozzo, etc) with a kernel exploit?

OpenVZ containers do not have their own kernels. In OpenVZ, there is only one kernel for the host OS and all of the containers. Successfully exploiting that kernel from within a container means potential impact to the OpenVZ host and all of its containers. If you want to avoid this vulnerability, you need a real hypervisor that boots in independent kernel for each virtual machine.


Investigate an unknown device connected to router On my router(Virgin Media) I found a device labelled as "unknown" I often see the router not assigning the device name but I do have a clue about which device is.

However this specific device got me curious because in the port forwarding section, a UDP port has been assigned to the IP address of this unknown device

My question is, what steps and methods can I implement to find as much information as possible from this device?

What I did so far is this On Mac, I run a port scanner, which found port 41800 open On the terminal I run

sudo nmap -sS -T4 -A -p- <IP>

The above found port 9295 open The router has assigned UDP port 9308 to this IP address

If I do telnet on 41800,9295, it connects but I can't do anything else I can't do telnet on 9308 but I get success by running

nc -z -v -u <IP> 9308

However, I'm not being able to do anything more than this, not a clue about what kind of device it could be or anything else

What else can I do?

Thank you

There are many free utilities that will do this. On windows I like wireless network watcher from NIRsoft. On mac, try FING
https://www.makeuseof.com/tag/check-wi-fi-network-suspicious-devices/


Global variables and information security I get the impression that it is a programming best practice to create variables in specific scopes (like a function scope) and avoid global scope to make things more modular and better organized.  However I'm not sure if there is also a security issue.

Here is an example of global variables in Bash that worked for me fine more than a year:

cat <<-EOF >> "$HOME"/.profile
    set -x
    complete -r
    export war="/var/www/html" # Web Application Root;
    export dmp="phpminiadmin" # Database Management Program;

    export -f war
    war() {
        cd $war/
    }
EOF

source "$HOME"/.profile 2>/dev/null

I have never had a problem with global variables in Bash or JavaScript, most likely because I only wrote small scripts for personal usage on minimalist environments.

Why do many programmers avoid using global variables and are there any examples of security breaches caused by using global variables?

Boycott Globals!
I'm stealing from Steffen Ullrich's comment, but the main issue with global variables is that they make it difficult to keep code well organized and maintainable.  His link is a fine one, but you won't have any trouble finding countless articles about the problems with global variables online.
When you use global variables, it becomes easy to lose track of where in your program the variable gets modified, especially if you don't have a simple linear flow.  As a result global variables can work perfectly fine in small scripts, but can cause massive headaches as an application begins to scale.
The main reason why I would avoid globals is because they make automated unit/integration testing a nightmare.  Small applications can survive without tests, but trying to manage a larger application without good tests is just a nightmare (trust me, I tried in my young-and-foolish days).
This might leave you with the impression that globals are fine in very small applications, but since applications usually only grow over time, and things that start off temporary become permanent, it's really just a bad idea to use them at all.  Why start on the wrong foot, when it is so easy to use properly scoped variables?
Security
Using global variables doesn't have any direct implications for security, but they do make it easier to end up with security issues, because it disconnects the source of data from it's usage. I have even seen actual vulnerabilities introduced in such a way:
Imagine you have a variable which is used in an SQL query. Initially you set it from a safe value and so inject it directly into the query. However, it is a global (or becomes a global!) and later on use-cases change and it gets set from user input. The developer who sets it from user input doesn't realize that it is injected directly into a query (perhaps because it happens in a completely different file and only in a specific flow) and so doesn't bother with strict input checking, nor do they update the query it is used in for more secure usage. All of a sudden a very hard-to-find vulnerability has been introduced, because global variables hid the connection between the source and usage of a variable!
Global Variables == death
I don't know of any breaches that happened specifically because of global variables, but it's easy to argue that the use of global variables has literally killed people, so I think it's reasonable to just never use them.


Hard-wired vs relative addresses in shellcode This question is primarily in the context of arbitrary command execution in a buffer (e.g. stack) overflow.

I read somewhere recently that hard-wired (absolute) addresses are not good for shellcode e.g. using /bin/sh for example. The problem is that it means the code isn't position independent.

However, I don't understand why hard-wired addresses wouldn't be preferable to relative ones. Wouldn't hard-wired addresses mean the desired libraries/calls used in the attack are accessible from wherever the code (i.e. it is position independent) where relative addresses mean that the code has to be in the correct place relative to the call?

There's two types of issues that I think you might be conflating.  One is the address of functions called by your shellcode that are provided by the vulnerable application or by libraries loaded, and the other is absolute versus relative jumps within your shellcode.

Library Calls

Let's assume, for a second, that you're attempting a return-to-libc style exploit on a simple binary.  So you want the address of system for a lot of such exploits.  Let's build a small binary that prints the address of system.

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv) {
  printf("system @%p\n", system);
  return 0;
}

Compile and run this a few times:

% gcc -o getsystem getsystem.c
% ./getsystem
system @0x7fdc54419d40
% ./getsystem
system @0x7fbc15b61d40
% ./getsystem
system @0x7fbeacfb6d40

Notice that each time it is run, the address of system has changed.  This is due to a modern security mitigation called ASLR: the C library is loaded at a different base address, so system will be loaded at a different address.  Consequently, your shellcode needs to first locate libc, then call system at an address relative to the start of the library.  (Called the "base address".)

Jumps

In more complex shellcode, you may need to make a jmp or call within the payload itself.  In such cases, you must have relative jumps and calls, because you do not know the exact address where your shellcode will be loaded.  Instead of saying "jump to 0x0804abcd", you should have "jump 5 bytes forward".  This is what is meant by "Position-Independent Code": it can operate when loaded at any position, and not just at some fixed starting address.

Because shellcode is usually loaded on the stack or heap, both of which are subject to various manipulations (ASLR, other data using the stack/heap, threading, etc.), it's impossible to predict an absolute address where your shellcode will land.


good books for learning network and web security? I am reading "Hacking The Art of Exploitation" book . i have read till chapter 2 programming but most of it has gone above my head . I want to learn basically cryptography , network security and web security . Which book should i read or should i just skip the first four chapters and go to the chapter 4 network security ?

I know that i am a noob in this field but i am eager to learn and prefer to learn it without joining any course.

Cryptography basics
Coursera.org offers a great course on cryptography. You can check it here: https://www.coursera.org/course/cryptography
Not only you will be able to learn a lot, Coursera will also help you to test your learning by giving you some tests.

Web Security/Network Security Basics
Coming down some books, there is one good book called Gray Hat Hacking, The Ethical Hackers Handbook, 3rd Edition by Allen Harper. This book is recommended for newbies and is easily available in almost every bookstore.

Another book on web security is Web Application Security, A Beginner's - by Bryan Sullivan

However, I will not suggest you to buy and start reading these books without any prior knowledge. You must first work on improving your programming skills, learning C/C++. PHP, Python, Java and Ruby will help you a lot, and networking skills, basic knowledge of TCP/IP will help you a lot.

You might also want to learn ASM (Assembly language) for developing exploits and reverse engineering.

There is a website called http://opensecuritytraining.info/, which provides free tutorial on various aspects of the information security. You can try that also.


What are the risks of a Certificate Authority hack for 'the average user'? Recently the DigiNotar CA was hacked, and rogue certificates were issued. Since they also issue certificates on behalf of the Dutch government, the government made a statement about it as well, basically claiming: 'don't visit the website if you get a security warning from your browser'. Good advice in itself, and better than DigiNotar itself which claims 'ignoring that warning is 99.9% safe', but it ignores browsers with CA trust stores which have not been updated yet.

Assuming a non-updated browser (trust store), isn't a user vulnerable for Man-In-The-Middle attacks on any website, not just the ones which had a valid DigiNotar certificate?
I know you can check the certificate chain on a website, but I never do, and I know for sure my parents never do.

Is SSL-trust really only as strong as the weakest CA, and is there a way to fix that?

Update 2011-09-06: An independent report by Fox-IT on the DigiNotar hack was made public

Concrete case of DigiNotar

For the concrete case that depends on how deep the vulnerability was:

If the attackers were only able to access a program (web frontend) that signs any SSL server certificate, then only those sites are affected. Proper logging mechanisms would allow them to produce a complete list of all affected domains.

If they got access to the private key or the program allowed to create certificate with the CA bit set, then the attacker can create certificates for any site.

General case

For the general case: Yes, the CA model in its current form depends on the trust of the weakest CA.

There are a number of CAs in the default list of the common browsers that are known to have issued bogus certificates for their respective governments in the past (most notable the BlackBerry Interception update in the United Arab Emirates) or got their lawful interception advertisement material leaked (most notable in the United States of America).

As far as I know DigiNotar is the only case in which a complete CA was removed from the browser list. In the other cases only the bogus server or software certificates have been revoked.

Jeff Ferland posted an excellent article on the security blog, A Risk-Based Look at Fixing the Certificate Authority Problem.

Other approaches

Convergence tries to mitigate the issue by recording server certificates from many different angles of the Internet. This assumes that the attacker is relatively close to the victim so that other notaries see the real certificate.

Instead of using a CA to sign server certificates, the certificates could be included in DNS, assuming that DNSSEC is widely adapted, which is not the case, yet.

Google hard codes the valid hashes into the source code of their Chrome browser calling it public key pinning. This approach obviously does not scale, they can only put a limited number high traffic sites in there.


When And How To Generate Nonce For URL I have a url with a $_GET parameter that allows deleting of a record in my database, eg. localhost/app/delete.php?id=4843.

The delete.php page only checks to see if the user is signed in and that they own the db record. Obviously, this creates the perfect opening for a CSRF attack. Should I generate the nonce when the page loads, or do I somehow do it only when the user clicks the URL? How would I?

Here's my code so far:

function nonce_create() {
   $_SESSION["nonce"] = random_bytes(12);
   $_SESSION["nonce_time"] = time();
}

function nonce_verify() {
   $time = time() - 90; /* give browser 90 seconds to load */
   if (isset($_SESSON["nonce"]) && strlen($_SESSION["nonce"]) == 7 && $_SESSION["nonce_time"] > $time) {
      $_SESSION["nonce"] = null;
   }
   else {
      header("location: index.php");
   }
}

The nonce_create() function above would be called when loading the page where there are links to the delete.php page, and the nonce_verify() function would be called when the nonce needs to be verified and removed on delete.php.

I'm not sure I understand how your code could work. You set a nonce in the session, and then you check that it is still there? That will always be the case!

Just using the session does not help, since the session is kept together with the help of a cookie. And cookies are sent on all requests, so the sesion cookie would be included in the CSRF reqeusts. You can not use sessions alone to tell CSRF attacks and legitimate reqeustst apart.

Proper CSRF protection requires that the client put the nonce (or the token as it is commonly called) somewhere else, such as in a HTTP header, where the victims browser would not automatically include it. And then you can check that that value corresponds to the value you have stored in the session.

As for when to generate the token, I would say that one token per session is enough. Every time you get a request from a session that does not have a token, generate a new one for them and keep it for the duration of the session.

There are a lot of details to how to implement this, and it is not possible to include everything in here. Instead, I will recommend you to do this:

Don't write your own code, instead use an existing framework that has been thoroughly tested.
If you want to write your own code anyway, read the OWASP guide on CSRF protection.


Certificate validation with 802.1x PEAP I recently learned about how WPA-PSK works. If I understand correctly, the 4-way handshake enables the protocol to ensure mutual possession of the PMK (and therefor, the PSK) without sending the PMK/PSK over. This way it's not susceptible to a man-in-the-middle attack.

My question is, how is mutual authentication ensured in case of WPA-Enterprise? I'm running 802.1x with FreeRadius and PEAP at my home network (just as a hobby project) and it works, but I'm not sure if I understand how it works.

I'm using PEAP, so clients are authenticated with usernames and passwords. But do clients make sure that the WiFi network they're talking to is not a man-in-the-middle? The authentication server has a SSL/TLS certificate, but it is self-signed. Shouldn't the root CA certificate used to sign the server certificate be installed at the clients for this to work? This is not the case in my setup, but all my Android clients connect just fine.

If my aforementioned understanding is correct, that would mean WPA-Enterprise with PEAP is less secure than WPA-PSK because a man-in-the-middle attack is possible to intercept the passwords. This seems weird to me. Is there a flaw in my understanding?

EDIT:

I found a partial answer in this article. However, I still have questions unanswered.

Does this really mean that my WPA2-Enterprise PEAP setup is less secure than plain WPA2-PSK? Seems really counter-intuitive because WPA2-PSK is so much simpler and only requires one shared secret. How is is possible that WPA2-PSK is able to ensure mutual authentication with just a shared secret while WPA2-Enterprise is not?
Should I be worried about it (and proceed to improve/secure my setup) or is it not likely that this can be exploited?
How can I make the clients validate the server's certificate? Is the only way to install the certificates manually on all the clients? (In that case, if I need to distribute certificates anyway, I can better switch to EAP-TLS)
Or is it possible to use a public certificate just like with HTTPS? How would that work? With HTTPS, your certificate is 'anchored' to your domain, which you've proven to the CA that is yours. How does this work with RADIUS servers?

EDIT:

Found more answers.

  EAP-MS-CHAP-V2 (Microsoft Challenge-Handshake Authentication Protocol version 2) is a mutual authentication method that supports password-based user or computer authentication. During the EAP-MS-CHAP v2 authentication process, both the client and the RADIUS server must prove that they have knowledge of the user's password for authentication to succeed. Mutual authentication is provided by including an authenticator packet returned to the client after a successful server authentication.

(I can't post more than 2 links, so I won't be able to provide a source for this quote)

Here is explained that the second stage / inner authentication protocol, MS-CHAPv2, is a mutual authentication protocol too. It makes sense now.

However, this article suggest that MS-CHAPv2 isn't safe anymore. Since I rely on MS-CHAPv2's mutual authentication properties in my WPA2-Enterprise setup, are there any alternatives to MS-CHAPv2 that are more secure?

EDIT:

I just found out about EAP-PWD, a new single-stage EAP authentication protocol which is supposed to be stronger than PEAPv0/EAP-MSCHAPv2, provides mutual authentication, and doesn't need SSL/TLS certificates at all.

  EAP-PWD is highly secure (the password is never transmitted, even in encrypted form), and does not require PKI certificates, and also requires only 3 authentication round-trips. So it is considered efficient to roll out in eg Eduroam and other environments. Requires that the Radiator user database has access to the correct plaintext password.

The only problem seems to be that it isn't widely adopted yet. Android (> 4.0) does support it however, which is nice. But I still couldn't find much information about it and by the looks of it, Windows doesn't support it.

If my aforementioned understanding is correct, that would mean WPA-Enterprise with PEAP is less secure than WPA-PSK because a man-in-the-middle attack is possible to intercept the passwords. This seems weird to me. Is there a flaw in my understanding?

Yes, there was a flaw in my understanding. PEAP encapsulates the inner authentication method, EAP-MSCHAPv2 in my case, in TLS. If used correctly, TLS provides server authentication. In my case it wasn't used correctly because the server's public certificate isn't verified.

However, MS-CHAPv2 provides mutual authentication too. To answer my own questions:

  Does this really mean that my WPA2-Enterprise PEAP setup is less secure than plain WPA2-PSK? Seems really counter-intuitive because WPA2-PSK is so much simpler and only requires one shared secret. How is is possible that WPA2-PSK is able to ensure mutual authentication with just a shared secret while WPA2-Enterprise is not?

Not really. Both ensure mutual authentication without transmitting the password in plain text. The only problem with MS-CHAPv2 however is that it is quite old and depends on DES, which is not that strong anymore. It can be cracked.

  How can I make the clients validate the server's certificate? Is the only way to install the certificates manually on all the clients? (In that case, if I need to distribute certificates anyway, I can better switch to EAP-TLS)

I can't answer this one yet. Verifying the server's certificate would certainly enhance security (because MS-CHAPv2 can be cracked) but I have no idea how to do this on Android. I tried installing the CA certificate on my Android device, which went without problems, but I still couldn't select it in the WiFi settings.

  Or is it possible to use a public certificate just like with HTTPS? How would that work? With HTTPS, your certificate is 'anchored' to your domain, which you've proven to the CA that is yours. How does this work with RADIUS servers?

No clue on this one.

Alternatives

Well, since MS-CHAPv2 isn't that safe anymore, it would be nice to have some alternatives. A really promising EAP method is EAP-PWD. I would really like to implement it but there isn't much to find about it. Android supports it, but FreeRADIUS only does in the 3.x (unstable) branch. And of course, the stable branch (2.x) is in Debian. I guess I have to wait some time for this one.


Can we prevent users from generating a QR code with edited information Currently there is this design of two apps that work together:

Proof app: On customers phone, takes in a textcode and creates a QR code
Scanner app: On hosts phone, Scans the QR code and displays some information like birthday, initial and valid date. Does not connect to the internet for this.

Both applications will be open source.
My question:
Is there a fundamentally solid way to avoid people from generating a false QR code, for instance with a different birthday, initial or valid date?
We may assume that the consumer can build a new app based on the source code of both apps. However, we may also assume they do not have access to a textcode that would give the normal app the desired QR code.

My thoughts so far:

Obviously we cannot prevent the user from altering the QR code, but perhaps we can make sure he cannot alter it into something useful.
To deter brute forcing, presumably the QR code should contain one 'output' which gets translated in the scanner app to the various pieces of information. (Opposed to having each individual property translated separately).
I don't think this is possible: perhaps if the QR code and text code are complex enough then even with full knowledge of the code brute forcing approaches would be impractical, but how can you prevent general reverse engineering?

If it is not possible to avoid this for a single individual who is willing to make an effort, would it conceptually still be possible to prevent at least a cracked app which is distributed to the public easily?

Both applications will be open source.

If it is not possible to avoid this for a single individual who is willing to make an effort, would it conceptually still be possible to prevent at least a cracked app which is distributed to the public easily?

These two sentences are mutually exclusive. If it's open source it's trivial to create an alternate version of it that does something else than what you envision. Furthermore, why are you focusing on integrity of the application and not the data?
Sign the data that is provided in the QR-code. This way, it doesn't matter what app people use; the data in the QR code is signed by you. You'll obviously have to verify information before signing, but after it's signed, it's trivial to verify that it is not changed.
The numbered ideas you provide is mainly security through obscurity. Don't bother. It's trivially bypassed in much less time than you think.


Why is KRACK a protocol error and not implementation error? I don't quite understand how KRACK is considered a protocol weakness rather than an implementation error.

From reading about KRACK, I found following facts:

There are more vulnerable implementation of WPA.
KRACK can be patch in a backward compatible manner.

If the there exist an implementation that is not vulnerable to KRACK, but is compatible with current WPA2 protocol, shouldn't KRACK be considered an implementation error?

It's considered a protocol error rather than an implementation error because the behavior that causes the problem is specifically required by the protocol.

How do you recover when the third step of the four-way handshake gets lost?  The standard specifies that it should be done by re-transmission of the packet in question.  A system that recovers by re-starting from the beginning would interoperate* with a system that expects recovery by re-transmission, but it wouldn't be compliant with the standard

* A system expecting a re-transmission of a missing packet is going to hold on to the resources for negotiating the connection.  If the other system recovers by re-starting, then in a noisy environment there will be many partially-built connections hanging around, with the consequent potential for resource starvation.


What does "windows_view" attribute of registry object in OVAL? I've seen somewhere that in 32-bit and 64-bit Windows registry structure is different so you need to use flag windows_view="32_bit" in registry object behaviors tag. But i forgot about it and tested my files with OVALdi on 32-bit Windows and then on 64-bit Windows. In both cases i used 32-bit app, so on 64-bit systems i checked WOW6432Node instead of just Software. And OVALdi done scanning just fine. So now i can not understand this attribute.

I've managed to understand what was wrong in my vision of this tag. OVALdi uses system architecture by default to read the registry. So it is expected behavior that my configs worked well and i saw no difference between x32 and x64 Windows. You will understand why in a moment.

In 64-bit Windows there is two registries. One for 64-bit keys (regedit.exe) and one for 32-bit keys (%systemroot%\syswow64\regedit.exe or C:\Windows\SysWOW64\regedit.exe for me). WOW6432Node is a mirror for x32 registry in x64 registry. So if you add key in SOFTWARE through x32 registry, you will see it in x64 registry in SOFTWARE\WOW6432Node (you may actually add key in WOW6432Node in x64 registry and see it in SOFTWARE of x32 registry afterwards which is pretty useful but i do not know if it is can actually break your registry somehow).

But what about OVAL and OVALdi?

If you use behavior windows_view="64_bit" you can read all keys in SOFTWARE (which is 64-bit on Windows x64) and all keys in WOW6432Node, so it is pretty much universal thing.

If you use behavior windows_view="32_bit" you can read all 32-bit keys in SOFTWARE (this is pretty much the content of WOW6432Node if you read it in 64-bit regedit). But you CAN NOT read x64 keys in this mode. Folder WOW6432Node in 32-bit registry contains the same 32-bit keys, not 64-bit keys.

And i have big example of usage here. There if four objects:

<objects>
    <registry_object xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#windows" comment="x32 key" id="oval:d.u.ru-registry:obj:2019011" version="1">
        <behaviors windows_view="32_bit"/>
        <hive>HKEY_LOCAL_MACHINE</hive>
        <key>SOFTWARE\X32Application</key>
        <name>DisplayName</name>
    </registry_object>

    <registry_object xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#windows" comment="x64 key" id="oval:d.u.ru-registry:obj:2019012" version="1">
        <behaviors windows_view="64_bit"/>
        <hive>HKEY_LOCAL_MACHINE</hive>
        <key>SOFTWARE\X64Application</key>
        <name>DisplayName</name>
    </registry_object>

    <registry_object xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#windows" comment="x32 key trough x64 view" id="oval:d.u.ru-registry:obj:2019013" version="1">
        <behaviors windows_view="64_bit"/>
        <hive>HKEY_LOCAL_MACHINE</hive>
        <key>SOFTWARE\Wow6432Node\X32Application</key>
        <name>DisplayName</name>
    </registry_object>

    <registry_object xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#windows" comment="x64 key trough x32 view (will not work)" id="oval:d.u.ru-registry:obj:2019014" version="1">
        <behaviors windows_view="32_bit"/>
        <hive>HKEY_LOCAL_MACHINE</hive>
        <key>SOFTWARE\Wow6432Node\X64Application</key>
        <name>DisplayName</name>
    </registry_object>
</objects>

And there is the output of OVALdi:

          <registry_item xmlns="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#windows" id="1">
            <hive>HKEY_LOCAL_MACHINE</hive>
            <key>SOFTWARE\X32Application</key>
            <name>DisplayName</name>
            <last_write_time datatype="int">132125660223754243</last_write_time>
            <type>reg_sz</type>
            <value>Application with x32 arch</value>
            <windows_view>32_bit</windows_view>
          </registry_item>

          <registry_item xmlns="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#windows" id="2">
            <hive>HKEY_LOCAL_MACHINE</hive>
            <key>SOFTWARE\X64Application</key>
            <name>DisplayName</name>
            <last_write_time datatype="int">132125651956984961</last_write_time>
            <type>reg_sz</type>
            <value>Application with x64 arch</value>
            <windows_view>64_bit</windows_view>
          </registry_item>

          <registry_item xmlns="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#windows" id="3">
            <hive>HKEY_LOCAL_MACHINE</hive>
            <key>SOFTWARE\Wow6432Node\X32Application</key>
            <name>DisplayName</name>
            <last_write_time datatype="int">132125660223754243</last_write_time>
            <type>reg_sz</type>
            <value>Application with x32 arch</value>
            <windows_view>64_bit</windows_view>
          </registry_item>

          <registry_item xmlns="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#windows" id="4" status="does not exist">
            <hive>HKEY_LOCAL_MACHINE</hive>
            <key status="does not exist"></key>
            <windows_view>32_bit</windows_view>
          </registry_item>

And for the last. What if i do not use behavior tag? There is no need to give additional outputs here. I will only collect the two results with <windows_view>64_bit</windows_view> tag.


Can MDM on an iPhone restrict custom keyboard usage? I have an iPhone that runs 13.3.1 (latest at this time). It's a corporate phone and has an MDM profile installed. I've been using the phone for almost 2 years now with a custom keyboard (Google Keyboard). However, after recently traveling to the States, I noticed that my phone is forcing me to use the default Apple keyboard every time I try to type something. It's been happening since 3 weeks now and this change was not caused by a system upgrade, I remember not changing/installing anything around the time when this started. It's almost like my iPhone woke up one day and did not want me to use another keyboard, even after I had been using one for years now (jealous much?).
The MDM profile installed doesn't mention having control over keyboard. The moment I start typing, I get force switched to the Apple keyboard (without suggestions). And while I can switch to the Apple keyboard with suggestions, I can't use my other keyboard even though it's set as default.

This behavior began very randomly and at this point I wonder if it's just paranoia or legit. I work in this field and so it probably isn't irrational paranoia but I'm just looking for a logical answer. Does anyone know what this is about or has experienced similar?

Yes! iOS MDM can limit custom keyboard for managed corporate apps.

  Custom Keyboard extensions provide keyboards beyond the ones already
  built into iOS. Managed Open In can prevent unauthorized keyboards from
  appearing in your corporate apps.

  see page 7 of https://www.apple.com/business/docs/resources/Managing_Devices_and_Corporate_Data_on_iOS.pdf