If I accidentally agree for new WhatsApp's terms and conditions, How to revert that? WhatsApp team updates their policy and it will be from Feb 8. I accidentally agreed with the policy. Later I realized the policy is not good.
How can I revert my agreement with the WhatsApp team?
We have alternatives like Signal and telegram but I like to use WhatsApp. I am thinking if most of us not agree with WhatsApp's policy then they will change their decision.

This question is asked on Law here

As a general rule of thumb with these things, the only way to disagree with the terms of use is by not using it.
If you're expecting that you can "revert" your agreement and only be subject to the previous terms, then I'm afraid you will be disappointed.  While a company may decide to allow that, it's highly unlikely that Facebook does in this case.  In all cases that I am aware of, abiding by terms and conditions is a requirement for using their services.
So how do you revert your agreement?  Simple.
Stop using WhatsApp


Where to store a pepper? Assuming you're using a pepper in your password hashing, where should it be stored? I know you shouldn't store it in the database since it can easily be found there during a dump and the idea is to have something stored outside the database, but can't you make a similar case for storing it in your source code? My instinct would be to store it on a different place than where your code and your hashes are, so that an attacker who compromises both of those has less chance of compromising the pepper as well.
My first thoughts on where to store it:
Windows

In the registry;
Using DPAPI;

Linux

??? (I'm not familiar with Linux systems)

Cross-platform

on an external server, presumably as a consumable service that receives a password and returns a hash;
on special hardware like a security peripheral or a secure enclave that works similar as the external server.

You could probably come up with a reason for every one of these methods, as well as a reason against each of them. Where do you store the pepper?

If you have a HSM then the pepper should be in that HSM, because that's the whole point of having a HSM.

Otherwise, the pepper is a key which should be handled as such. Having a key involves key management; it should not (and, really, must not) be hardcoded in the source. The source code is copied in multiple places: developer's machine, versioning systems, many backups... The key really is a property of the server instance (lone server or set of servers that use the same set of registered users) while the source is, conceptually, shared between many server instances.

On Windows, the DPAPI is what will make auditors most happy, although one may say that the extra protection offered by DPAPI is not, in fact, that big. If you reboot your server, it starts automatically; this means that regardless of where you put the pepper, the cold storage of the server (harddisk contents) is enough to recover the pepper. The pepper is meant to resist partial read accesses by attackers (which is why you do not put it in the database), but if the attacker can read the registry, then he has a lot of control over the machine and probably won't be much hindered by DPAPI either. If you use the registry, adjust access rights on that specific key so that only relevant users may read it (typically, the user account under which the server runs).

Using a file incurs the risk of read access through a poorly developed PHP script that ends up dumping contents of attacker-chosen file names.

On Linux there is no registry and no DPAPI, so use a configuration file. A case could be made of running the pepper processing in a distinct process accessed through some inter-process communication mechanism (say, Unix-level sockets), and run the actual server code in a chroot.

In all cases, using a pepper has its own costs: you have a key to manage, i.e. to generate securely, and keep safe. If you lose that key, then you lose the ability to verify user passwords, which can be very inconvenient. In that sense, the pepper is more critical than the server private key for its SSL certificate.


Solutions for backing-up my codebase I have a codebase that I've been keeping on Github that I don't want to worry about losing. I've intermittently backed up all the repos to an S3 instance, but this doesn't feel secure. If my Github and AWS accounts, or just my machine, were compromised then our entire codebase & its backups could be deleted.

What can I do to protect against this? I'm having a difficult time finding solutions which guarantee that I won't have to worry about an account being compromised and everything being subsequently deleted.

You might want to consider running an SSH server on the machine where the files that need to be backed up are stored (the source machine), then running a cron job on another machine (the backup machine), which connects to the source machine and copies (or rsync's) the files that need to be backed up.  You might also want to include a job on the backup machine that preserves changed files for versioning purposes (hard links are good for this).

By allowing connections from the backup machine to the source machine, but not vice-versa - this addresses the security concern that you described in your question.  Even if an attacker gains access to your source machine, he would not be able to connect to the backup machine to destroy your backups.  Versioning on the backup machine provides another layer of protection, in case backed-up files on the backup machine are overwritten by files copied over from the source machine which had been modified by an attacker.  Also, you can make the solution more secure by only allowing SSH connections from the backup machine's IP address, and requiring key-based authentication by the backup machine.


Choose a sentence, a number, and the name as password I would like to have your point of view about something I found on internet.

The goal here is to help people to use stronger passwords, it's not perfect, but I believe that asking people to use passwords like "4*k#j56$Nbq!\l;)" is too much, but using "MyName1979NameOfDog" is too weak. So, let's try to find something a bit better, in the middle.

I am not the author of this "idea" ! Here is it :

  Choose the first letter of each word of a sentence (and use a capital in the beginning and a point at the end)
  Write down the first and the last letter of the website/application
  Choose a favorite number

Example :
"Life was like a box of chocolates you never know what you're gonna get facebook 42." = "Lwlabocynkwyggfk42."

If "crackers/hackers/whatever" find the "rule", they might have access to everything else... Remember that the goal is to help people to have a better password not the perfect one.

Do you think it will be a bit harder to find it by the usual "hacking techniques" ?

Let's try to find something useful together ! :)

The only way you can make people choose strong password is to not let them choose a password.

Instead, encourage the user to use password manager, let the password manager generates their passwords, and never reuse passwords. The passwords generated by these generators are usually random strings that looks like censored curse words and aren't memorable, but it doesn't really matter because you never have to remember or type them.

Then tell them to use a human-friendly password generator for their password manager's master password, which is the only password that they'll ever have to memorize.

This reduces the problem to securing that master password generator in way that are also human friendly and secure. IMO, the best way to do this is the Diceware passphrase scheme using EFF's wordlist. It's provably secure (2**77 strength with 6-words passphrase using standard-size diceware wordlist) and quantifably secure because the password are randomly generated rather than chosen by the user, and it is easy to type and memorize (they are just common english words).


Is Content Security Policy an approach that is worth to support? Mozilla Firefox 4.0 supports something called Content Security Policy that disables the interpretation of embedded Java Script. Only external Java Script files that are referenced using a script tag and that are on a whitelisted domain are executed.

Currently only Mozilla Firefox 4.0 support it, but it is an W3C draft.

Given that rewriting an existing web application to stop using on-attributes is a lot of work, the question arises, if it is worth the trouble.

Is it likely that other browsers will support it? Are there known ways to circumvent the protection (assuming the .js files are static)?

CSP, along with the HTTP cookie secure flag, HSTS, and X-FRAME-OPTIONS, will forever remain my favorite HTTP response headers for improving the security of users for all time.

Also see -- Enabling Browser Security in Web Applications


API which does not allow to invalidate session on server side - how to make it more secure? I'm writing an app around a REST API which does not allow the server to invalidate a session - i.e. there's no endpoint like logout which will make the cookie my app is using be invalid from now on.

So I see that if a hacker intercepts that cookie, then a user logs out (which means for me - remove the cookie) and then the hacker is able to make calls to API despite the user thinking it's not possible anymore.

Can I do something else other than just remove the cookie?

Cookie has a timeout - 24h. This timeout is renewed every call to API.

This is actually not that uncommon a setup.  Typically where an application uses stateless cookies, there's no way apart from timeout to invalidate the session.

The advantage of this appraoch is that the server doesn't need to maintain a list of valid cookies, which is handy for scaling, the downside is (as you've noticed) if the application has a long timeout there are risks relating to stolen sessions.

What you could do assuming the flow is

customer <--> your app <--> API

is if you give your customers a token created by your application and then maintain a mapping table so you effectively proxy all traffic between the customer and the API, you could then implement a logout function for your app which removed the token that the custoemr has on logout.

The API token would still be valid of course, but assuming that you can secure the link between your app and the API the main risk would be in the compromise of your app, which likely has more serious consequences that individual customers losing control of their session tokens.


Does disclosing server local time to users cause any security risks? I need to implement a number of web pages for resetting an API access key:

user must be logged in first
user gets to "confirmation" page that has a "confirmation" link with a time token inserted
user follows a "confirmation" link
server gets the token from the followed link and decides whether it's fresh enough (say at most five minutes fresh is considered good)
if the token is fresh enough the server resets the API access key, otherwise it refuses to do so and asks the user to go back and obtain a link with a new token

This is intended to prevent users from accidentally reusing the link and resetting API keys unintentionally.

So the problem is the time token. The easiest way it to just get server local time and insert it into the hyperlink. Time represented as number of "ticks" (similar to Unix time) is just fine. This discloses the server local time to the user because the user needs to have a hyperlink before he can follow it.

Maybe it's no good to disclose local time to the user - maybe it facilitates some clever attacks against the server.

Does disclosing server time introduce any extra security risks?

I cannot see how disclosing the server localtime could help in attacks. I assume that most production server use synchronization so their UTC time is accurate and is the same on any server.

More for me the notion of localtime in only local to one environment: different processes on the same server could use different local times. At most it could help an attacker to locate where the server could be on the planet. But even this information has a limited value because in some large organization the servers and applications internally run on UTC time to allow easy backups between servers on different continents.


what are the risks associated with an incomplete certificate chain What are the actual risks associated with an incomplete certificate chain
I read about certificate chains and I think I understand the concept but I seem to not understand the potential risks, for instance SSLLabs checks and states if a certificate chain is incomplete but still rates certificates with incomplete chains very highly (A) so this implies to me that the chain doesn't seem to be that important, whereas my understanding is that the chain is a trust issue and so that should be very important.
What security loops can effect me if I do not have a complete certificate chain?
Update:
Reviewing my source this morning, I find that the certificate chain issue has been resolved; prevously it stated:

Certificates provided     2 (2936 bytes)
Chain issues      Incomplete Chain

But this morning it states:

Certificates provided     3 (4716 bytes)
Chain issues       None

This maybe because I told the company about this, or maybe that it's simply a fix on the cloudhosting, or some other thrd party issue.

Missing chain certificates are not a security problem by itself. That means just because chain certificates are missing an attacker cannot mount attacks he could not do when these certificates were present. But, missing chain certificates can indirectly cause problems which are security relevant.

Missing chain certificates often means that the peer cannot verify the certificate and thus fails to establish the HTTPS connection. While several desktop browser try to work around such problems by using cached chain certificates or downloading the certificates such behavior is usually only restricted to these browser. Most other applications will just fail to connect. In most cases failing to connect is just annoying. But in some environments this can be a serious problems if important data do not get exchanged because of this.

Also, some developers try to work around such kind of problems by disabling certificate validation. Unfortunately there are way too many answers and comments on stackoverflow.com which suggest simply disabling validation in such cases without pointing out the security problems this causes. Because, while this seems to fix the current problem in that the TLS connection works, it also makes simple man in the middle attacks possible and thus creates a huge security problem.


Arduino buffer overflow and arbitrary code execution Is it possible to overflow a buffer on an Arduino Uno R3 ? The following code is vulnerable on modern computers:

#include <stdio.h>
#include <string.h>
int main(void)
{
    char buff[15];
    int pass = 0;

    printf("\n Enter the password : \n");
    gets(buff);

    if(strcmp(buff, "supersecret"))
    {
        printf ("\n Wrong Password \n");
    }
    else
    {
        printf ("\n Correct Password \n");
        pass = 1;
    }

    if(pass)
    {
        setLed(1);
    }

    return 0;
}

If I use a serial connection to input the string, is it also vulnerable on an Arduino Uno? Can an attacker run arbitrary code or just toggle the led on or off?

The answer to this question will be heavily dependent on several factors including the toolchain used, and the target architecture. For simplicity's sake I'll limit this answer to the Arduino Uno and the ATMega328 AVR microcontroller.

tl;dr: Yes, it is possible, but only if you include WriteFlashByte(), or WriteFlashPage() in your source, and if the attacker has access to your source, or physical access to your device.

Buffer Overflow Exploits

Buffer overflow exploits are fairly straightforward. The general idea is to write a shellcode payload to a known location on the stack, and overwrite the return address to point at that shellcode. This works because the x86 architecture allows execution from ram. This is not the only exploit of this type, but it is very common.

Why the architecture is important

The AVR8 architecture (the one used by the ATMega micro on the Arduino) is what is known as a Harvard Architecture. The important part to note here is that in the Harvard Architecture the "instruction memory", or "program memory" is completely independent from "data memory". In the AVR8 architecture the program memory is implemented in Flash, the data memory is implemented in SRAM, and instructions can only be fetched and executed from Flash memory. What this means is that the buffer overflow exploit outlined above won't work. You can override the return address, but the address you change will be read from Flash, and not from SRAM. Now, you might think that this would make a buffer overflow exploit impossible, but it does not.

AVR8 buffer overflow exploits

Since the only way to execute code on an ATMega328 is to execute from Flash memory, we will have to put our shellcode into Flash memory. Here, you will find an appnote with the requisite information about reading/writing to flash memory. So, now we know that it is actually possible to write a payload to program memory during runtime, but there is an issue. The only way we can write data to flash is by using either WriteFlashByte(), or WriteFlashPage(), and the only way to use those functions is for them to already be in the Flash memory for that device. However, not only does the device need to be programmed with one of these functions, you must also know the address where that function resides in memory. There are two ways of discovering this information:

Compile the source using the exact same flags, then use avr-objdump to determine if these functions are present, and what address they reside at.
Read the contents of the Flash memory present on the micro, then use avr-objdump  to determine if these functions are present, and what address they reside at. Note that if the lock bits are set, you may not be able to read the contents of the Flash memory.

If you do not have access to the source, or you can't read the flash memory to dump it, a buffer overflow exploit of this type would be nigh on impossible.


Email code authentication I'd like to replace passwords with a temporary code that's emailed to the user. The login flow would go like this:

User enters their email address. "If that email belongs to a user, a code will be sent" message to prevent disclosure of valid emails.
User is emailed an alpha numeric code (lets say 8 digits long and valid for 1 hour).
User enters that code as their "password".

The good:

No passwords are stored in the database.
No need for password resets.
Much of the security burden is shifted to the email provider.

The bad:

An email address is required. If you lose access to it you lose access to your account.
If you forget your email address you lose access to your account.
It's inconvenient to check your email each time you log in. This would not be an issue on mobile, where an API token can be stored after the first login.

Are there any other issues, especially security related? As far as I can tell, this should be as secure as a password reset. In both situations you're emailed something that allows full access to the account.

Here are similar questions but with more focus on cookies, or without solid answers. I'm more interested in the positives and negatives, especially any security issues.

How to implement non-password authentication in a web site
Password-less authentication in web apps - How safe it is?

Clarity/Goals edit:
The goals are to limit the amount of sensitive data stored in the database (even if that data is hashed), be accessible to average users (remotely with an internet connection), and not depend on a different device for authentication. Additionally, be as simple (UX) and secure as possible given those constraints.

tl;dr: It all comes down to how good the users are at keeping their mails safe. But that are post cards rather than letters. Do not exclusively offer that option. Also, seems like an xy problem.
Here are some things to be considered about this:

You said

User is emailed an alpha numeric code (lets say 8 digits long and valid for 1 hour).

Let's rather say 20 bytes, valid for 10 minutes. Brute force of an 8 digit password is absolutely feasible.
This can be passed to the application/web app via a get request from a link in the email to make the life of the user easier.
That's what Slack is doing with it's "magic link" feature, by the way.

You listed as a negative

An email address is required. If you lose access to it you lose access to your account.

and

If you forget your email address you lose access to your account.

This is usually the case, at least with password resets.

You may still use session cookies in the web app to keep the user logged in longer - same as storing that token in a mobile application.
Hence this problem

It's inconvenient to check your email each time you log in.

is gone.

You list as a positive

Much of the security burden is shifted to the email provider.

while in fact a lot of the security burden is shifted to the user, too.
How sure are you that your users only check their mails through secure connections, without chances of eavesdropping? (Think: Open WiFi, regular POP on mobile. Happens every day.)
This makes the user's mail box a single point of failure.
Additionally, while have I been pwned is known by most IT-affine people, there are a lot of people out there that do not know their email is already breached because of password reuse.
Yet, the last point is also true for password reset emails - only do they occurr less often and usually trigger additional security measures.

For whatever reason you are trying to use mails and short lived passwords, there are better ways - for example UBS security tokens that do add a "somethis only you have" part to the equation, not removing a "something only you know" part.
I'd also advise you to think about if this might be an instance of a xy problem and ask a new question with the actual problem you are trying to solve.

Update for the modified question:
If the passwords are hashed correctly, there is nothing wrong with storing them in your database.
Yet, if we accept as a UX decission to have the user not have passwords, using email and requesting the users GPG key and/or S/MIME certificate and sending out short-lived password links to the user using mail on request would be fine.


Is it best practice to setup a VPN for remote users to use even if there are no services hosted internally? I am curious as to when a VPN should be implemented in a workplace. VPNs of course provide privacy/security in general, but is there really a point in setting one up for a workplace if there are no services running on internal networks at the company?

I've used them when I need to access internal servers, but if everything is hosted by 3rd party services, is there a need for a VPN setup?

It seems like a waste of resources since users can still easily do their work without connecting so most will probably not choose to use it.

Despite not having services for users, some other potential justifications for a VPN would be:

Network and admin teams access to L2/L3 devices like switches and routers
RDP access to workstations

Besides those, if you're not actually hosting any services on an internal network for users to VPN in for, then no there is no reason to have a VPN. In fact, doing so would simply result in +1 more port (1194 for OpenVPN for example) being open on your perimeter, and therefore to the public. This would, albeit mostly negligible, increase the attack surface of your company, but with nothing to gain, because you'd have an extra port just sitting open.

EDIT 1:

If you are talking about accessing outside resources like other corporate networks or simply browsing the internet, doing so over a VPN offers several benefits in terms of security and privacy. As user vidarlo pointed out, the benefits in this case would reduce the chance of MiTM attacks, and also provide traffic inspection for roaming devices. To add to that, you would also have better privacy since your actual public ip would be replaced with one from the VPN provider, thereby shrouding your true public ip to the sites you visit.


Why does Safari still support SSL 3? The "POODLE" attack was made public in October, 2014. Why does Safari still support SSL 3.0 after POODLE showed it to be insecure?

Apple has released the Security Update 2014-005, disabling the CBC mode with SSLv3:

  Security Update 2014-005

  Secure Transport

  Available for: OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.5

  Impact: An attacker may be able to decrypt data
  protected by SSL

  Description: There are known attacks on the
  confidentiality of SSL 3.0 when a cipher suite uses a block cipher in
  CBC mode. An attacker could force the use of SSL 3.0, even when the
  server would support a better TLS version, by blocking TLS 1.0 and
  higher connection attempts. This issue was addressed by disabling CBC
  cipher suites when TLS connection attempts fail.

  CVE-ID

  CVE-2014-3566: Bodo Moeller, Thai Duong, and Krzysztof Kotowicz of Google Security
  Team

(Emphases are mine)

Therefore, even if Safari still support SSLv3, it is not vulnerable to the POODLE attack.


Generate John the Ripper rule This question asks for pointers about generating JtR rulesets, but the OP states

  I understand how to use it to make various permutations from a given wordlist

Could someone please explain that? From the documentation, it seems as though REGEX mode, MASK mode, and Wordlist mode all permit this.

But how to generate a rule that contains permutations of a certain word (suffixes, prefixes, 1337speak)?

This is a solution for suffixes and prefixes for a given fixed, without 1337speak.

Using MASK mode, you give parameters on the command line. If the known word part is barquux and you need to suffix 3 characters and prefix 2, all of them digits, use

john -mask=?d?dbarquux?d?d?d -min-len=9 -max-len=14 file_to_crack

For mask options, see the MASK mode documentation file.


Is it safe to let a user type a regex as a search input? I was in a mall a few days ago and I searched for a shop on an indication panel.

Out of curiosity, I tried a search with (.+) and was a bit surprised to get the list of all the shops in the mall.

I've read a bit about evil regexes but it seems that this kind of attack can only happen when the attacker has both control of the entry to search and the search input (the regex).

Can we consider the mall indication panel safe from DOS considering that the attacker only has control of the search input? (Leaving aside the possibility that a shop might be called some weird name like aaaaaaaaaaaa.)

I would compare accepting user supplied regular expressions to parsing most sorts of structured user input, such as date strings or markdown, in terms of risk of code execution. Regular expressions are much more complex than date strings or markdown (although safely producing html from untrusted markdown has its own risks) and so represents more room for exploitation, but the basic principle is the same: exploitation involves finding unexpected side effects of the parsing/compilation/matching process.

Most regex libraries are mature and part of the standard library in many languages, which is a pretty good (but not certain) indicator that it's free of major issues leading to code execution.That is to say, it does increase your attack surface, but it's not unreasonable to make the measured decision to accept that relatively minor risk.

Denial of service attacks are a little trickier. I think most regular expression libraries are designed with performance in mind but do not count mitigation of intentionally slow input among their core design goals. The appropriateness of accepting user supplied regular expressions from the DoS perspective is more library dependent.For example, the .NET regex library accepts a timeout which could be used to mitigate DoS attacks.RE2 guarantees execution in time linear to input size which may be acceptable if you know your search corpus falls within some reasonable size limit.

In situations where availability is absolutely critical or you're trying to minimize your attack surface as much as possible it makes sense to avoid accepting user regex, but I think it's a defensible practice.


Same session cookies for a user logging from different browser/machine I am new to web application security and have a few doubts regarding session cookies.

Which of these is considered more vulnerable:

Having the same session cookies for a user logging in from different machine/browser

or

Having different session cookies for a user logging in from different machine/browser

If it's possible could you provide a quick scenario of how each can be exploited?

Thank you.

Having the session cookie specific to the machine or browser offers at least the possibility to associate machine/browser specific information with the cookie (like some kind of browser fingerprint). Such associated information might then be used to better detect if the cookie was used on a different machine, i.e. impersonation done via cookie theft.

Note that this cookie protection is purely optional, i.e. just because the cookie is machine/browser specific does not mean that such information will be definitely associated with the cookie but only that this could be done.

If the session cookie is instead machine/browser independent such protection is not possible at all, but instead a stolen cookie could easily be used from other systems. This means the risk of impersonation would be higher.

  Which is more vulnerable ...

None of this actually presents a vulnerability. A vulnerability would be if some attacker could steal the session cookie, for example using XSS or by sniffing unprotected connections. The options you present only offer more or less ways to mitigate the impact of the vulnerability by making it harder or easier for the attacker to misuse the stolen cookie.


Does forwarding email result in an extra "persistence" of it's copy? I understand that when an email is sent from point A to B, it can persist in other locations while in transit from A to B.

When forwarding email, can this increase the extra locations where one's email can persist?

For example:

Situation 1: Someone sends me an email from their address (A) to my address (B).

Situation 2: Someone sends me an email from their address (A) to my forwarding address (C), which is setup to forward emails to my address (B).

Does situation 2 result in more locations where the email persists on servers that situation 1?

In some cases, yes.

Client

It depends on the MUA/client, but forwarding a message will cause a copy to be stored in that person's sent items.  That counts as a copy, as does the copy in the inbox.

Outlook/Exchange can store these copies either on a local PST, on the Server, or both in the form of an OST

Server

Every MTA (server that touches the message) can store the message, and copy it into a monitoring / compliance queue, and still send the message on to the next destination.

This may be required to maintain compliance with certain federally mandated record retention laws.

Bottom line, if you forward a message, and it's routed to a network, the quantity of servers it touches increases.  Any server can be configured to transparently archive a message.


What does the CSP require-sri-for directive protect against? According to Mozilla:

  The HTTP Content-Security-Policy require-sri-for directive instructs the client to require the use of Subresource Integrity for scripts or styles on the page.

I fail to see the benefit. The SCP is designed to protect me from someone injecting scripts into my page. If an attacker is able to inject a script tag, wouldn't she also be able to inject an appropriate integrity attribute?

What attack is possible without this directive, but fails with it?

The HTTP Content-Security-Policy require-sri-for only aims to protect against developpers who would forget to add the integrity tag.

Frederik Braun, who claims to be the author of subressource integrity wrote on his blog :

  GitHub is one of the first big websites using Subresource Integrity and can thus defend against potentially bad Content Delivery Networks (CDNs). The tricky thing with SRI is that you have to include it for every HTML tag that points to a CDN if you want the security benefit. And then, of course, it happend that someone forgot to add this and people were sad.


Securely obtain information from a USB Flash Drive /Thumb Drive avoiding viruses I have just been passed some data in a thumb drive (which I was expecting). While I'm not too sure exactly what format the data will be in, it should be a mixture of numbers and text, possibly in one of the Microsoft office document formats.

My concern now is how to (1) access the files safely without receiving any virus or passing any virus to the drive, and (2) eliminating any virus if there exists any in the drive.

I'm using a Macbook still running El Capitan 10.11.5, and while it seems like most viruses target windows, I'm not taking any chances. I'm concerned about the kind that just activate and replicate automatically the moment I plug my drive in.

One idea I have is to just purchase a cheap new laptop, be it a mac or windows, and plug the drive into it while making sure its disconnected from the internet. Then I'll run some antivirus scans to discinfect the drive, and once I'm sure about that, to extract out the data files and store them into another flash drive, and use the other flash drive from then on.

It seems like I'm being paranoid, but I think there is good reason to be suspicious here, because the files contained in the drive are confidential information.

Any suggestions will be greatly appreciated! Thank you very much!

EDIT
I couldn't really find any other questions that had answers for mine, because in my case, I really need to do analytics on the data files contained in the drive, so beyond just ensuring safety when plugging in the drive, I need to know someway to cleanly transfer all the data to my local system so that I can do data analysis.

FURTHER EDIT
Appreciate the links to possible duplicate questions, but on examining the answers there, I still couldn't find a definitive answer. The best answers I could find were the following, but they still lead to more questions rather than an actionable solution that I am comfortable trusting to be safe:

(1) The answer by @mostlyinformed on Is there any way to safely examine the contents of a USB memory stick? did help by suggesting the use of a new cheap tablet that one is willing to sacrifice, but offered no answers on how one could extract out all that data. Supposing I am able to access all the data as a one time use on that cheap tablet. Then what next? I really need to pull all that data, which is going to be about a few hundred objects...

(2) Otherwise, most of the other answers like the one by @Andre Borie on I have a virus in my USB drive. I haven't inserted it on my PC yet. How should I proceed? don't really help in making me feel like there's any fully safe way. Is there always going to be some risk that I cannot eliminate????

I would greatly appreciate it if someone could answer my questions. Please pardon my "noob-ness" but I'm a total non-expert, but really need to extract out all the data from the thumbdrive and analyze it. I'm not fooling around with a thumbdrive that I just picked up from the ground in a carpark or something. This is a serious drive that contains serious data associated with IP/trade secrets. While I received the drive from a trusted party (I'm not involved in some secret operation that just stole some trade secret off a firm or something, what I'm doing here is legit accessing of confidential data), I'm not sure if the data was written to the drive on an infected machine or not, and whether the person who prepared that drive (who is different from the person who passed me the drive) had a malicious intent or not, so I'm being careful to be safe. Everyone's situation is unique, so please understand that my situation is not well addressed by many existing answers.

Just boot from a Linux live CD and remove your internal hard drive, if you are that concerned about malware inside the USB. You can turn off your wifi adapter manually as well, if you need that level of security. I think at that point, short of it writing to the BIOS (which only one current piece malware in the wild exploits), it is almost impossible for it to infect your computer. I would suggest that you do not transfer any files off of the USB at any point, as anti-malware utilities are nearly useless against unique/new malware due to signature based detection.

I should really emphasize the point of not transferring the data to anything else you might be concerned about infecting and keeping it isolated while in use, as any file within the drive could theoretically contain some type of malware, and you do not want that at all.


Can a corporate proxy intercept HTTPS traffic if it doesn't control the certificate store? I sometimes connect my personal devices through the corporate wifi. But besides that, there's not any corporate software on my system that a proxy could use, and Firefox's certificate store is the original one that came with it and receives updates directly from Mozilla.

Does this mean I can trust HTTPS traffic while connecting to the corporate wifi? I don't see any weird mitm certs when I view the details of a connection through Firefox.

Is the original server's private key absolutely needed to fake the cert properties window? Or could the proxy simulate a pristine connection?

I assume it can't, given that this involves robbing the private key somehow by a malicious party, or having a powerful enough quantum computer, heheh.

In general no they can't. If they could then your ISP (and anyone else in the middle) could intercept your HTTPS traffic making it entirely pointless.

They can intercept the traffic but your device should detect the invalid cert and notify you. In theory a corporate with their own CA could MitM you seeing as you would likely have their root cert in your device. But this would risk their CA trust being revoked.

You also need to be careful if ever asked to install corporate provided software on personal devices.


Microsoft Bitlocker Decryption interrupted. Cannot decrypt again I've locked on of my USB drive with BitLocker. When I was decrypting(removing BitLocker), my PC went off due to power cut in the halfway of decryption. Now, when I'm trying again to decrypt using password as well as decryption key, it says password invalid or key not valid.

How could I decrypt it? Or did I lost my USB? It has important data as well.

Any help is appreciated.
Thanks!

If you have recovery key for the bitlocker volume, try using that. It is possible the header was damaged. If you don't, there is no simple way to recover the data and it is likely gone.


Binary Exploitation - How to set GID of a SUID binary using shellcode? I have a binary that is SUID which I can currently use a buffer overflow exploit to obtain an elevated EUID shell.

However I haven't worked much with changing IDs through shellcode, and the file I need to access requires me to have a GID equal to the EUID I have obtained. However, after obtaining my shell, my GID stays the same as previously.

My question: What system calls or shellcode do I need to execute to elevate my GID to be equal to my EUID when the shell is spawned?

Also: So far I have tried setregid and setegid system calls in shellcode before spawning the shell, however both return "-1" when using a GID that is not already my unprivileged GID.

Thank you.

According to setgid(2), the syscall will fail unless the calling process is privileged:

   EPERM  The calling process is not privileged (does not have the
          CAP_SETGID capability), and gid does not match the real group
          ID or saved set-group-ID of the calling process.

Unless you are running with the correct capabilities (specifically CAP_SETGID, provided by root), you cannot change your GID to a value which is not your real or saved GID. This limitation applies to any syscall that changes the GID. The manual page on credentials(7) is extremely helpful.
You can actually see where this is done in the kernel:

SYSCALL_DEFINE1(setgid, gid_t, gid)
{
    struct user_namespace *ns = current_user_ns();
    const struct cred *old;
    struct cred *new;
    int retval;
    kgid_t kgid;

    kgid = make_kgid(ns, gid);
    if (!gid_valid(kgid))
        return -EINVAL;

    new = prepare_creds();
    if (!new)
        return -ENOMEM;
    old = current_cred();

    retval = -EPERM;
    if (ns_capable(old->user_ns, CAP_SETGID))
        new->gid = new->egid = new->sgid = new->fsgid = kgid;
    else if (gid_eq(kgid, old->gid) || gid_eq(kgid, old->sgid))
        new->egid = new->fsgid = kgid;
    else
        goto error;

    return commit_creds(new);

error:
    abort_creds(new);
    return retval;
}


Websites that fill back button history with questionable pages Occasionally I see links like the following (don't visit this on your main computer) that I am redirected to on Google. The back button will either redirect back to the page, or some other questionable content. These pages are almost always some scam or phishing attempt, and I wonder how exactly do they "disable" the back button functionality? I can long press the back button to view a long list of the same exact link (this is a screenshot on Imgur), and eventually the search page is listed at the bottom (omitted for my privacy).

How do websites pull this back button hijacking off? And why does it not appear on actual search history? Is there any way to recognize this happening in the browser backend?

They do not "disable" back button functionality, there is HTML5 API to manipulate the browser history. The specified site uses this functionality as could be seen in https://your-luckychance.com/media/gambling/backbutton_gmb.js

Security-wise, there are certain limitations to this API, notably you can only add entries redirecting to the same origin.

As far as I know, there is no way to recognize this happening in the browser.


How safe is using JWT-based web application on shared computer? Considering I have JWT-based web application, which does not check JWT against some database (which would, to my understanding, made JWT usage void since any random string would make the same). The JWT timeout is long enough, so that it will last at least a few minutes after I 'logout'.

The computer is shared, but it is sure it has no keyloggers, sniffers or browser modifications installed (which, say, can be proofed, or the system is well protected and has only monitored internet connection, no peripherals, or simply all is monitored). The JWT is stored in the JavaScript memory, or in localStorage, which is cleaned after pressing 'logout' button. The tab in which the application is closed. After I leave, anybody can sit and use the same browser.

How safe is my web application then? If someone get the token, they will still, for a few minutes, be able to work as they were me. The local storage was purged. The browser debugger was inactive or was purged. Is there any other place anyone can access where the token could be read?

The JWT has about as much protection as a cookie, except you're relying on the ability of the developer to handle the management of the token correctly. Putting the token is localStorage means it can persist across browser closes unless something is explicitly done to remove it (e.g. logout button, hook the close event to clear it). Alternatively sessionStorage works in a similar manner, but will automatically clear values when the browser is closed (the trade off being you can't share the token across browser tabs/windows).

Additionally, the ability to prevent things like XSS token stealing is reduced considerably because any JavaScript can query localStorage/sessionStorage, whereas the browser has built-in defenses to prevent JavaScript from reading cookies. On the other hand, you potentially get some inherent defenses against CSRF because the token must be added to the request manually.

So like all things, this all depends on your security requirements. Given all your caveats, it seems like it might be fine such that it's on par with cookie-based sessions. On the other hand, it doesn't necessarily protect against someone seriously interested in stealing your token. With that said, a browser isn't going to do much to help you in that regard anyway, so you might consider requiring all sessions be launched in a private browsing session/incognito/etc.


Difference between certificate and digital signature What is the difference between a digital certificate and a digital signature?

Read on the internet that the digital signature is the result of encrypting with a private key, the 'hash' of the message to be sent. As for the digital certificate it is not very clear to me.

A digital signature is a type of cryptographic code that can be attached to a digital document to prove that it comes from a specific party and hasn't been altered or forged. It works by using asymmetric cryptography, which means there is a key pair consisting of a private key that the signer (the party that protects the document) uses to produce the digital signature, and a public key that the verifiers use to verify the document matches the signature and thus hasn't been adulterated.

A public key certificate is a digital document that includes four elements:

A description of a party called the issuer
A description of a party called the subject
A public key that the issuer certifies belongs to the subject
A digital signature by the issuer that protects the previous items from tampering or forgery

Certificates address one of the practical problems of using digital signatures: verifiers need to have the signer's public key, but how can they know they've got an authentic key instead of a malicious third-party forgery?  The solution certificates implement is to delegate the job of authenticating keys to an issuer that the verifiers already trust.  So the signer presents you not just with their public key (item #3), but with a certificate that includes that key and that you can verify to convince yourself that they really are who they say they are and that the enclosed public key really is theirs.

Note this kicks the problem back because now you have to obtain an authentic copy of the issuer's key, but the idea is that a few issuers can issue thousands of certificates and thus save you the work of verifying lots of individual subjects' keys.

Note that what you read in the internet that signatures "encrypt" a hash is a common misconception.


What is an excessive amount of SYN requests for port scanning? I have a slow internet connection - about 12Mb/s. In 10 minutes I have detected a distributed port scan on the router from different IPs. I have counted these SYN packets at in 600 seconds (10 minutes there is a total of 1119 SYN packets).

Why would this happen and what port are they looking for? ICMP packets are dropped as are all SYN packets to all ports. There is a stateful UDP filter for a few other services. What are they looking for? The ASNs come from all over the world.

You can safely assume that they are looking for whatever they can find. Port scanning is a step in "Information Gathering" which is one of the attack phases. You can't attack unless you know what there is to hit.

"Excessive" is defined by your normal traffic and how much load your systems can handle. For Google.com, "excessive" is defined very differently from your personal site hosted on a VPS.


Where to find the security hardened docker images Is there any service that provides certified, security hardened Docker images for common platforms like Python, PHP, Node, Java, etc. with 0 major/critical CVEs.

Currently, we are using the ones from RedHat but the problem is, even If I scan the RedHat provided image with A level (means clean), through Docker trusted registry CVE database, I found at least 50 critical and more than 50 major CVEs in them; therefore, I can't establish a baseline on top of which I can scan the user added apps for CVEs and could decide to fail the security scanning test.

We need that kind of service to establish a secure image build pipeline, so that we don't start overlooking at the application level CVEs , once we fix all the CVEs in base images , or get base images in which all the CVEs are being fixed regularly then we will be able to clearly decide automatically that the CVE is due to application and stop promoting the image in the pipeline.

I would consider the Center For Internet Security (CIS) Benchmarks the current gold standard for hardening.
I'd caution against a pre-hardened image and instead recommend that you harden it yourself using an open source script that can be reviewed/approved to ensure you are not introducing malicious/purposeful flaws into your environment.

CIS Benchmarks for Docker can be found here.

An open source hardening example (there are many out there) can be found here.

Docker then offers the following script to check that the changes have been made successfully.


X509 Certificate Thumbprint Does an issued X509 certificate have a thumbprint (hash) included as one of the items in
the X509 certificate?

No, an X.509 certificate does not include it's own fingerprint.  The X.509 fingerprint values used are a hash of the entire certificate.  For the obvious reason, you can't include the result of a hash operation into the source of the hashed data without invalidating the hash.

Other fingerprints may be included in the certificate; see What is the actual value of a certificate fingerprint for a good answer on this topic.


Is emulated SQL query preparation less secure? I have been looking at PDO attributes, specifically at resources (some are linked at the end of this post) saying that emulated query preparation is less secure than using real prepared statements, such that you should disable emulation with this:

$dbConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, FALSE);

But I don't see any examples on why, and the argument comes down to "it may be possible, so do it this way."

Is there any known SQL injection that has happened or other proof of concept to show that this is the case, that one way is more secure than the other?

Related from Stack Overflow:

How can I prevent SQL injection in PHP?
PDO MySQL: Use PDO::ATTR_EMULATE_PREPARES or not?

PDO can be used to connect to more than one type of database, so this question is not restricted to MySQL.

The only currently known SQL injection vulnerability in PDO parameterized prepared statements using the default of emulating prepared statements is if the client's and server's locale is out of sync.

Since locale is negotiated during the initial connection setup, and persists for that connection even if the server's default is changed, in order to get the locale out of sync, you need to have a successful Man-in-the-Middle attack.  And if you do have a MitM attack, then the emulated prepared statements mode is the least of your worries, as the attacker can send any arbitrary commands and responses, without needing to go through the trouble of SQL injections.

While theoretically, there may be a slight decrease in security from using emulated prepared statements, there is no practical difference since exploiting the emulated mode requires pwning the connection anyways.

Still, there is very little practical benefit from leaving the emulated mode on, and if you ever get to a point where that tradeoff matters, your site will have already faced several other scaling issues, and you'll know how to do the necessary research to make the best choice for your system.  It won't hurt to turn emulated mode off, in the sake of security... but it won't help either, and anyone who tells you one way or another without a thorough understanding is engaging in cargo cult programming.

Also, if you're still paranoid (which the people here who answer security questions tend to see as the only sane state of mind), know that the PDO emulation of prepared statements only applies to the MySQL client engine.  Other database client engines in PDO, such as PostgreSQL, never emulate prepared statements.


What is UDP port 56183 We seen suspicious probing from source port 53 to destination port 56183. May I know what services use port 56183 (udp)?

The range 49152–65535 (215+214 to 216−1) contains dynamic or private ports that cannot be registered with IANA.[310] This range is used for private, or customized services or temporary purposes and for automatic allocation of ephemeral ports.

Likewise, UDP 56183 does not appear on the official IANA port listing source document:
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt

As Steffen Ullrich correctly points out it's most likely a DNS reply, especially given the source port, but there is a small likelihood that you are catching someone doing part of a slow but full UDP port scan of your systems. There are a few research projects like scans.io that routinely scan the entire Internet and it's not unlikely that some organization may want to collect full UDP data. That said, those scans would not be likely to use UDP/53 unless they were potentially probing firewall rules.

Do you by chance have a packet capture with more information or a source address? Sometimes that can tell you a lot more. For example, did this come from a DNS server or an IP owned by a something like a large scanning project. My guess is that Steffen Ullrich is correct and it's simply a DNS reply packet.


Which tier to apply security In my organization we have database as backend, application servers then web servers and then proxy servers.

I know it is usually best to have security implemented closest as possible to the data and if it is possible to do it in the database it is ideal. Can add the other layers as well as layers of security but that would be in addition.

Can you tell me if I am correct and refer to a credible source that says the same?

best to have security implemented closest as possible to the data (...) in the database it is ideal.

Why?  What?  Where?  How?

No, the idea that you want to safeguard data has nothing to do with the data layer (e.g. database) in a layered application.  In the vast majority of cases that would a terribly bad thing to do.

The idea that you want to safeguard the data is the reasoning where you place the safeguards where the data is kept and processed in each layer of the application (including the database layer if the given data to be safeguarded lies there).  If any layer of your application that can perform data requests is compromised then it will bypass the safeguards in the lower layers.

For a simple example: if you have an application where the database access is protected with a password and the application layer stores and reuses that password on connections, then compromising your application layer is all it takes.

Addendum

A scenario where the idea that safeguards shall be close to the database  makes some sense is an application layer that can process encrypted data.  For example, where the data is stored encrypted in the database and operations that use this data are performed externally (e.g. in an HSM).


Smart Token Security Test I have a question. One of my colleague gave me a Smart Token which consists of public/private key inside and asked me if I can test its security. I said it should be tested in a equipped lab for passing FIPS standard tests. However I was wondering if I can test this token with some tools and check if it's secure. I searched the web but I couldn't find anything useful. Does anybody here have any experience in this area? Any help would be greatly appreciated.

EDIT: Since my question may not be clear as I think, I put it in some practical approach, if I gave you some PKI token and show you some certificates which it has like FIPS-140, PKCS11, ... whould you use this PKI token in your secure applications? In other words, you trust a secure device by certificates which producer claims to have?? What if there is a hardware Torjan or backdoor implemented into device?

I think your approach will depend on what requirements your colleague has for the system's security. The token itself performs a very simple job as part of the authentication architecture. What you'll really be testing is the behavior of the software on the server which, presumably, is provided to you by a vendor. To that end, here are a few tests that must pass, at minimum, for you to know that the system is functioning:

Authentication. Provide the correct credentials for the user
associated with the token, along with the possession factor (the
token's code), and ensure that you are able to access the system.
User-factor pairing. Provide the correct credentials for a different
user, along with the possession factor, and ensure that
authentication fails.
Factor invalidation. Provide the same possession factor twice in
succession, along with valid credentials, and ensure that
authentication fails the second time.
Factor expiration. Provide a sufficiently old possession factor
along with valid credentials and ensure that authentication fails.

Edit: My answer assumes that you are dealing with a disconnected, multi-factor authentication token. Most commonly, these are time-synchronized. Forgive me for not prodding further if you are dealing with a connected token like a smart card.


Any browsers where I could escape the URL with certain characters? On this website, you can specify your YouTube channel URL and it makes a button on the profile page that will go to that URL. This text entry has no restrictions other than that it has to be less than 200 characters and that it has to start with youtube.com/user/, but it allows any characters after the /user/.

Are there any browsers that will treat certain characters in the URL specially and escape the URL? The only reason I ask is because as I said I can use any characters, so if I could escape the URL and run my own code with data URIs it could pose a threat.

Not sure exactly what you mean by "escape the URL", but I can think of three sneaky things related to URL:s to try in a situation like this:

XSS: If there is no escaping at all, you might try an URL like " onClick="alert('XSS');. However, basic XSS filtering or just URL encoding the URL will make this hack impossible.
Change protocol or scheme: You mention data://. An other popular trick is javascript: or vbscript:. All these have in common that they have to be at the beginning of the URL to do anything. If the URL starts with a hardcoded part, like youtube.com, you're out of luck.
Open redirects: If YouTube has an open redirect, you could create a link that takes the user anywhere on the internet. If the user expects to end up on YouTube, but instead ends up on a site you control, you could use that for phishing. I'll admit that this isn't exactly the most powerful attack, but it shouldn't be ignored either.


CEH & Comptia Pentest+ I'm currently studying for the Comptia Security+ exam

In few months from now, I will have the opportunity to attend a 4 months preparation course for CEH without paying! But I will not try to get the CEH exam because of the price of the voucher a little too high for my pocket.

I read that CEH and Pentest+ are similar certifications, but I did not find much that dug deep on program differences.

Can any of you that have tried both or know someone that has, tell me if the study of the CEH program could put me in a position to face the (cheaper) Comptia Pentest+ exam instead?

I have a CEH certification and attended the official training for it. The course material is sub-par in my opinion.
Video Material
The CEH training has quite a lot of video material, which you can consider to be akin to a lecture over the topic. Positive about the video material was that it was spoken in consistent English with an understandable accent, so it should be easy to follow for non-native speakers. My only gripes with the video material is that the instructor seems to repeatedly try to "impress" the viewer with "cool hacker things", while not going into enough technical details to be useful.
Slides
The slides during the video and available separately are unimpressive at best and absolutely horrible at worst. There are slides, which I have shown to penetration testers with years and years of experience, and all I got from them was looks of confusion.
One slide in particular seemed to have been a conflation of two completely different attacks, which was completely non-sensical. Even the instructor was very confused by the slide and just handwaved it away (akin to "So yeah...and as you can see, then the attack succeeds")
For most of the slides, you already needed to have an understanding of the concept in question for the slide to make sense. And if knowing what Cross-Site Request Forgery is and how it works is a prerequisite to understanding a slide aimed to teach what Cross-Site Request Forgery is and how it works - then that slide is not very good.
The practice questions
EC Council offers a 50 question "CEH assessment", which you can find here. I went through a handful of questions, but I had to stop halfway through because I didn't want to subject myself to it any longer.
A some of questions involve "name dropping", such as talking about Spectre and Meltdown, which insinuate that CEH would go into details about these vulnerabilities, how they came to be and how they can be exploited - however, CEH is an entry level exam and not technical by any means. These questions are irrelevant at best and deceptive at worst.
Furthermore, EC Council loves to provide questions where none of the answers are correct, and you are supposed to find the least wrong answer. An example:

In the Permanent Denial-of-service, the attacker will uses the ‘Bricking a system’ method, in order to ________

Send fraudulent hardware updates to the victims
Launch a massive denial of service attacks and compromise websites
Exploit weaknesses in programming source code
Send malicious email attached to the victim

The correct answer is "3. Exploit a weakness in the programming source code". So the question claims that an attacker will permanently destroy a device, in order to exploit it. This makes no sense whatsoever. A lot of the questions are like this, and it's infuriating.
When the questions aren't nonsensical, they're questions about specific flags in specific programs, like "Which flag do you need to pass to hping3 to send an ICMP packet?" - you know, the stuff you look up in 10 seconds in a man page. While tangentially related to "ethical hacking", it doesn't check whether or not the student understood anything, but only asks if they are able to remember meaningless details.
The Exam
The exam is a multiple choice exam with 125 questions. It's advertised as lasting 4 hours, but I took my time and finished in 45 minutes and still passed easily. I'd say 1-2 hours is more realistic.
The exam question were more of the same really, but the amount of nonsensical questions was greatly reduced. There was one question which was completely unrelated to ethical hacking, and I assume that question was supposed to go to a different exam altogether.
The Summary
Should you do the CEH? I would say, if you work for a company that has too much money to burn and requires you to have some certification, then go for the CEH. If you're a pentester, then the test should be a breeze for you. The only questions you need to study for are the "which flag do you use to..."-questions.
In any other case, don't go for it. Do the OSCP or Pentest+ instead.


Why doesn't the PIN become part of the encryption key in bitlocker with TPM? I have read here that if you choose TPM + PIN protection the PIN does not become part of the key, it is simply used by the TPM as an additional security measure. It doesn't make sense to me, it would have been much safer and much easier to implement by encrypting the key stored in the TPM with the hash of the PIN. Since the TPM is only a physical solution, attacks have been made against it and the fact that it is protected by a PIN or not is irrelevant. While with the implementation I said before, which is apparently the most logical (correct me if I'm wrong), there is a protection based on mathematics plus TPM help for keyloggers and rootkits. So why was this choice made?
Are there alternatives to bitlocker that use the method described by me? I have seen that LUKS and veracrypt still have very limited support for the chip, therefore still far from using the PIN at the same time.

There's no known reason other than Microsoft just not deeming it necessary. A common theme in cryptographic design is to keep the system as simple as possible, to avoid problems later on.
If they'd have added a scheme to combine the PIN and the TPM key, they'd need to come up with a way to combine those keys. That likely means something like hashing the two values together, or using a HMAC. If that scheme was later discovered to use a primitive (e.g. hash algorithm) that was insecure, that's a problem. They'd likely have included a way to indicate which algorithm was used, for future-proofing, but that's more code, which means more attack surface, which means more validation and testing and potential issues in the future.
It's also more complex for situations where the disk is unlocked by something other than a PIN, such as a smart card. There needs to be additional consideration as to whether the same scheme can be used there, or whether there needs to be even more code and a different cryptographic approach for that scenario.
In this case it's absolutely reasonable to argue that the additional cryptographic functionality and code is worth it. Hinging the security of your FDE solution solely on the security of the TPM does not seem like a particularly good move in the face of modern attacks on TPMs and Intel CSME (which implements the fTPM). However, when BitLocker was initially conceived, these attacks were purely theorised, so it's also easy to see how Microsoft made the choice that they did.
I definitely agree with your concerns, and I have argued before that the next version of BitLocker should utilise the PIN itself as part of the header key derivation, in order to at least partially mitigate the threat of TPM attacks.


Using LetsEncrypt certificates for WiFi network authentication I am helping my school IT set up a RADIUS authentication system using PEAP/EAP-TTLS. We are able to achieve successful connection with the user devices, but the users need to accept a "Not trusted" self-signed certificate.

I am considering using the free LetsEncrypt to generate such a certificate. However, LetsEncrypt uses domain validation, which is not possible at this moment. I have a personal website that uses LetsEncrypt.

I copied the fullchain.pem, privkey.pem and cert.pem, and import all of them(privkey.pem failed to get imported). We are using a Windows 7 system, and is using TekRadius as server. Although the fullchain and cert are imported successfully, I can only see the client-authentication cert in the dropdown list. I need Server-Authentication to contain the cert so that I can add it to the users.

Pardon my limited knowledge as I am basically trying out possibilities without fully understanding the technology(I am helping my IT department due to my technical knowledge, though it is not my main job to set up network).

Is it even possible to "recycle" my valid personal certificate to be used in the RADIUS server?

Is it even possible to "recycle" my valid personal certificate to be used in the RADIUS server?

A certificate is valid only for the domains listed in the certificate. Since your private domain is likely not the domain of the radius server you cannot reuse your certificate there. Apart from that it is a bad idea to give your secret key to the school, since this is what you would need to do in order to use your existing certificate on their radius server. But see  Use Let’s Encrypt Certificates with FreeRADIUS how you could proceed.


Is there proof that a cloned SIM is usable and can receive calls & SMS? SIM cloning is often pointed out when suspecting someone may have captured an SMS with an one time password or authentication code, without proof.

I find it hard to believe that the phone network would allow two phones to register with the same IMSI & ICCID and actually deliver calls or messages to both of them. To me, that would either trigger some red flags, automatically ban the IMSI/ICCID to protect the customer or thwart abuse (like using two devices simultaneously on the same mobile plan) or at the very least make the second device not working because the network doesn't know how to handle this undefined behavior and can't register the second device.

Now, assuming the SIM itself was compromised and its secret key is out, does anyone have some proof on whether it's actually possible to use the second clone SIM to eavesdrop on the real SIM's communications ?

You can find some information on this StackOverflow thread.

There cannot be two IMSI active at the same time, and the operator will not fork the communication to the two phones. So not eavesdrop.

Depending on the operator and contract, when a second phone shows up with the same IMSI, it may either be refused to connected the cell phone network, or be allowed but in this case it will be the previous one which will be disconnected (allowing to switch a single line over several SIM cards, for instance one for the cellphone and another for a phone installed in a car).


How do I capture Wifi traffic in the wifi channel spectrum? How could I capture traffic from every AP near me? For example using tcpdump or tshark and a channel hopping script(Channel 1-11). Is this possible?
I have tried with tcpdump and a channel hopping script, but I couldn't capture any "actual data".
However when I used a fixed channel I could capture HTTP/TCP requests from devices on an AP in that channel.

Thank you for reading.

I'm assuming you want to sniff 802.11 traffic, right?

Use Wireshark in Monitor Mode. When you're the menu, there should be a cog. Tick the box near Monitor, then start sniffing. You should see beacon frames and things. Also, I've written a little guide below to help you decrypt the traffic.

[Disclaimer: Please use this for educational purposes. I am not responsible for any damage you use this for. Sniffing 802.11 packets is legal as long as it has no criminal intent.]

To decrypt the traffic, you must have an 4 way handshake (EAPOL) and the WiFi password. See some things below.

Tip: Preferences > Protocols > IEEE 802.11 > Decryption Keys > (+)
The key type would be WPA2 or WEP for example. The key would have the SSID and the password.

For example, you would have it in the format of PASSWORD:SSID. Make sure to enable decryption!


Is it possible to crack a PIN / PUK code on a phone SIM card? When deploying a mobile phone best practices policy, one of the points which were raised was the requirement for the user to protect his SIM card with a PIN. The theory is that three failed attempts to input the right PIN switches the SIM card into PUK mode, and 10 failed attempts to input the PUK make the card unusable.

What is the reality of this assumption? One of the uses of a stolen mobile phone is to robot-call specific numbers and drain the user account:

is it practically possible* to crack the PIN code, either directly or by cloning the SIM and testing the 10,000 possible codes?
is it practically possible* to crack the PUK code? This one is longer but since it can be recovered by the carrier it means that a SIM ID can be used to generate such a code.

*) "practically possible" means doing it quickly enough to use the SIM before it is blocked (say, an hour)

I am interested in the technical aspects of the question (there are legal as well, when it comes to a policy ; there is also the possibility of fraud with the help of a carrier operator who would generate a PUK)

Karsten Nohl had a nice presentation at Blackhat 2013 (https://www.blackhat.com/us-13/briefings.html#Nohl) claiming that many SIM cards are rootable.

The crux of his attack is based on the Over-The-Air (OTA) software updates for these cards, which are typically sent via "secure" binary SMS directly to the SIM.  He claims that in ~25% of the cases, the SIM will respond with a signed error message to an invalid attempt to update its code, and that for about 50% of the SIMs on the market, the signature will be encrypted with the very old and crackable Digital Encryption Standard (DES).  Worse yet, the signature is signed with the same key as is used to sign code, so that once it is broken offline it can be used to send a software update to the SIM.

This software update does not, in itself, provide access to the PUK, but by utilizing an unspecified memory vulnerability, Nohl claims to have been able to break out of the SIMs Java sandbox and get access to this key.

If you believe Nohl (and I have no reason not to), this demonstrates that:

It is possible to get the PUK for many SIMs on the market,
especially old ones.
It is not something that an average user can do right now.


Can I access my own account logs at Godaddy without a subpoena? I have some evidence that our Godaddy domain account has been tampered with, by a former administrator with access to the account credentials.
To prove that the account was accessed, I need, at the very least, the timestamps of successful account login.
Godaddy refused to process my request for access logs to my own account, and responded

Thank you for your email  We would be un able to provide logs with out a subpoena.  Please review the subpoena policy below.
https://my.godaddy.com/agreements/showdoc.aspx?pageid=CIVIL_SUBPOENA

Wikipedia's ariticle on subpoena states that:

Subpoenas are usually issued by the clerk of the court in the name of the judge presiding over the case

This implies that there is a court case. But we have no court case yet, as I am still in the process of gathering information to support the case.
Questions:

Is Godaddy entitled to refuse access to my own account information, except under legal compulsion?

Are there other ways of accessing this information?

As others have already said, this is more a legal question not a security question. But to be blunt the answers aren't so long:

Yes they have full rights to deny anything you are not entitled to by the contract you agreed to when you signed up. Think of it this way, you host a server and you have users that can log in. do they have rights to your back-end logs? probably not. nor would you want them to. Do they have rights to their profile information? Maybe, depends on your TOS.
Privacy policy is the only other way. privacy policy throughout history has been the best way to get information or hold accountable a company that states one. since not adhering to it can be deemed fraud. I don't know go-daddy's PP, nor do i know if it would help you. but if for nothing else, give it a look through and see if you can leverage any part of it to come back to them without having to go through a legal process.

That pretty much sums it up i think.


Serving image from outside web server root Is storing an image outside of the webserver root with a new name and extension (e.g. using move_uploaded_file($_FILES['userfile']['tmp_name'],'../uploads/'.date('U').'png') - not exactly this, obviously, since date('U') is not unique, and the uploading file would have to be run from the webserver root) and loading it with readfile() sufficient for securing an image upload form? If not, what kinds of attacks could get past this (e.g. running arbitrary php code, running javascript on the client etc...)?

Yes, saving the files outside of the web root will reduce your attack surface for direct object references.   I would also recommend doing the following:

Validate the file when uploading - Check the mime-type of the file
against a whitelist of valid image types.  Also, check the mime-type
of the bytes uploaded.  Don't rely on what the browser told you the
file was.
Give the file a random name -  You can append a
    timestamp to the end of the filename if you're concerned about
    uniqueness.  If the user is able to upload a malicious file, a
    random name will make it harder for them to reference that file and
    have some webserver process execute it.
Don't search for the file based on user-controlled input.  This can leave you open to path traversal/more direct object reference (specifying another file, which they should not have access to.) issues.

The major attack vector that having a file upload can enable is local file inclusion aka. running arbitrary code on your sever.  This could include running arbitrary php code and updating the javascript files.  It could even result in the server itself being compromised depending on the permissions of the user account that your webserver is running under.


Risks in open POP3/IMAP ports? I found a domain with open POP3 (110) and IMAP (143) ports. I was able to use TELNET to connect to them successfully, but beyond this is there any common vulnerability/exploit I should test on them, or is this even a security problem to have them open like this?

I've tried using USER and PASS and some common default user/password combinations, and they're not using a generic/default username/password from what I can tell.

Also I get the word "Fenix" on both of those ports. Is this the company hosting their IMAP/POP3 servers? I couldn't find any companies named Fenix that host these.

There is no generic POP3 or IMAP vulnerability. In fact, you'll find open ports for this on many servers in the internet since these protocols are used to retrieve e-mail - hopefully in combination with TLS, i.e. after upgrading the initially plain connection to TLS using the STLS/STARTTLS commands.

There are though bugs in POP3 and IMAP servers too and probably more likely with IMAP since this is a way more complex protocol compared to POP3. A quick search for IMAP or POP3 on cvedetails.com will show numerous known vulnerabilities from the past.

  Also I get the word "Fenix" on both of those ports. Is this the company hosting their IMAP/POP3 servers?

I'm not sure what exactly you are referring to but my guess is that you've seen this string in the first line you've got when connecting to these ports. Both IMAP and POP3 (and SMTP and FTP...) send after the connection a greeting from the server to the client and this greeting often contains a hostname or server type or whatever the admins liked to have there. Looking for fenix imap at shodan returns something like this:

* OK [CAPABILITY IMAP4rev1 ... AUTH=PLAIN] Fenix ready.
* CAPABILITY IMAP4rev1 UNSELECT ID CHILDREN NAMESPACE IDLE UIDPLUS AUTH=PLAIN
A001 OK Pre-login capabilities listed, post-login capabilities have more.
* ID ("name" "Dovecot")
A002 OK ID completed.

So according to the ID this is a Dovecot server, one of the major IMAP/POP3 server implemtations out there (and open source). It has a setting to set the greeting, i.e. a simple

login_greeting = Fenix ready

In the dovecot.conf will result in the same kind of response you see. So somebody decided that this might be a useful greeting and from the shodan query it looks like GoDaddy is behind at least many of such systems.


What is the benefit of using lastpass authenticator on android compared to other similar applications? Lastpass recently (march 2016) released a new app called lastpass authenticator. Reading their blog post and the description of the app features, it looks like to me that the app does nothing more than TOTP.

Now the algorithm for TOTP is well documented: on linux you can roll your own implementation or use a ready made solution in a shell script, and on android you have choices such as google authenticator or the excellent FreeOTP (and maybe others).

My question is then what is the added value of lastpass authenticator? Why should I use their app instead of FreeOTP, which is opensource and does exactly the same job?

They already supported google authenticator, so I do not believe that they would go through the trouble of building and releasing another app, while there are already other good implementations that do exactly the same thing. There are problably extra security features, or major usability improvement that I missed.

What did I miss? Or is there no actual improvement offered by the app?

I am copying here the answer I got on their blog:

  At the moment, the main advantage is being able to log into your LastPass account with one tap instead of having to fire up Google Authenticator (or another authenticator app) and type in a 6-digit code. Also the ability to get codes by SMS, which Google Authenticator does not support. There will be additional features rolling out in future releases.

It is actually great, I guess the OTP transits directly from your phone over the network, which is faster than typing it. Not so great when your phone does not have internet, but then you can fall back to typing the code.


How secure is the use of fingerprints (like Apple's TouchID) for authentication in banking apps? We are working on the development of a banking app and for customers. We need to implement TouchID in Apple's iOS and a fingerprint check in Android.

Firstly, what are the possible security risks and considerations related to this technology? Secondly, how can I secure the app/use the technologies in a safe way?

The problem is that the server cannot store a hash of the fingerprint, because the fingerprint can come with slight variations that would give a completely different hash. And if your fingerprint is compromised (either by taking it on a object you have touched or directly from the server) you can hardly change it - ok you can use up to ten fingers.

But a fingerprint can be a correct way to unlock a private key, because it become close to a 2FA authentication: something you have (the private key) and something you are (the fingerprint). And in case of compromission, you can always revoke the key. That means that to securely use fingerprint for authentication, you should combine it with X509 certificates.


App permissions to access hardware "at any time without your confirmation" On Android applications now some applications say that they want access to things such as speaker or camera "at any time without your confirmation".

I wasn't sure if this meant that it does not require your overt permission each time to access that resource, or if it meant that it can literally access that resource whenever it wants.

I'm not quite sure what to make of it and it seems like a clear security violation if apps can be given such access. What are peoples thoughts on this issue or does anyone know exactly what these permissions actually mean?

the eprmission means just as what you think it means.
it may use the systems at anytime it wants to, so it can activate the camera anytime it wants too.

what i think of it? well, here in europe, privacydoesnt get as violated as in the USA when it comes to telecomunication and technology.

not saying we dont get it, but the USA laws on that area are not only smoother, but also more unfair


How secure is WD MyPassport lock I have a WD My Passport hard drive.
There is an option that allows you to lock your hard drive with a password.
How secure is this lock?
They don't give details about the encryption algorith or the way the hard drive is beeing locked.

What isn't documented, is not documented. All we can do is infer.

From the documentation, we see that the password must be re-entered in a number of conditions (drive unplugged, computer shut down, computer put to sleep...) which boil down to: the drive was not powered at some time. This hints at a security feature done on the drive itself, not in software on the host computer. Page 27, we also see that a locked drive can still be used on a machine where the WD software is not installed, provided that you still use the software for a one-time unlock operation (this application is shown by the hard drive to the computer as a virtual CD-ROM emulated by the USB firmware on the drive). This reinforces the idea that everything occurs on the drive.

The screenshot page 26 shows a warning to the effect that WD themselves won't be able to recover the data when a password is lost, so it is probable that:

The locking uses encryption.
The encryption uses a key which is derived more or less directly from the user password.

Since the user password can be changed (page 28) without implying a complete re-encryption of the disk (it would take some non-negligible time, e.g. one hour), one can surmise that the drive data is encrypted with a drive-specific key K, which never changes, and that key is stored somewhere on the disk (possibly in some EEPROM) encrypted with a password-derived key. When the disk is unlocked, K is decrypted with the password, and kept in some RAM on the disk (disks have RAM, several megabytes, if only for caching). This is lost when the power is cut. When the user changes his password, K is decrypted with the old password and re-encrypted with the new. When the password is removed, it is actually replaced with a convention password (i.e. the data is always encrypted with K).

This is about the amount of what can be deduced from the information. Then we can make some guesses:

The encryption with K does not include checked integrity (i.e. no MAC). I assume this because a MAC requires some extra space (just a few bytes) which would destroy the nice powers-of-two sizes of individual sectors. Adding a MAC would likely increase development costs or decrease performance or both; since they don't boast about it, chances are that there is no MAC.
The derivation from the password to the key which encrypts K is probably weak, because:

Strong derivation would use a random salt, which then requires a source of randomness, and there is no reason otherwise to have a dedicated chip for randomness on the drive. Economics being what they are, chances are that there is no random salt.
The hashing process cannot include many iterations because they would have to be computed by the CPU embedded in the drive, which is not nearly as efficient for number crunching as a basic PC (again, economics).
Despite repeated pedagogical efforts, nobody in the industry seems to be able to do password hashing properly. I shall soon have to resort to threats; they just don't want to learn.

Encryption itself is probably based on AES, because there now are disks with flaunted AES-based encryption, so disk manufacturers have the dedicated chips and know-how. Using another encryption algorithm would just be more expensive for them, so chances are that they abstain (there, economics induce the vendors into doing the right thing).

But nothing guarantees that AES was used properly. Good hard disk encryption needs some specific encryption modes (the arguments against extra storage for a MAC and against the presence of a hardware RNG also apply here: encryption is probably not CBC with a random IV). If the manufacturer just used ECB (a really bad idea in this case), you would not know it.

Conclusion: the locking feature may be good, but there is a high probability that at least parts of the system are weak (probably the password derivation feature, and the encryption mode). You cannot build a reasonable security strategy on unknowns, so a cautious should prefer a software-based solution where the involved algorithms are known and are applied properly (e.g. TrueCrypt).

Also, note that the software used to unlock the drive does not appear to have a Linux version, so this may reduce interoperability.


Is HTTPS (and other asymmetric security protocols) still secure when using a VPN? When I am on "public networks" that I don't trust much (for instance in my school) I use a VPN to ensure my privacy.
From what I understand, any non-HTTPS connection could be read by the VPN company, but are other secured services still secure ?
For instance, would logging in to PayPal or my iCloud account still secure (unreadable by the VPN company) as long as I have a certified HTTPS connection to those services/websites ?

Thank you.

EDIT : By the way, from what I understand, any man-in-the-middle attack would be impossible to do if the connection is signed by a trusted certificate authority, but I am still wondering if I could have missed something.

Yes, a https connection (TLS/SSL) will be secure against snooping by your VPN provider, although they will know the IP address of the website you're connected to, so they will be able to run reverse DNS and likely at least figure out what domain you went to.


MSTG-ARCH-7: All security controls have a centralized implementation In the OWASP Mobile Application Security Checklist there is a requirement MSTG-ARCH-7 which reads: "All security controls have a centralized implementation".
Now I'm struggling a bit by what is meant with "centralized implementation" in this respect. Of course, I would imagine that you would want to have one component with a well defined interface to take care of any security controls. However, such components may still be initialized at various locations or may use external resources to actually implement the security. It seems that the requirement precludes the latter.
The OWASP site seems to just define the requirement without any additional information. Searching the internet for a more precise explanation did not give me any results. Does anybody have good insights or references to what is meant with this requirement? Maybe it was lifted from a another OWASP field where this requirement was better explained?

In my understanding this means, that the security relevant implementations should be centralized or included as isolated plugins/libraries. This ensures, that security relevant functionalities can be easily maintained and updated. E.g. when you have your crypto methods distributed all over the app, it is much harder to keep an overview and update them accordingly, if you encounter problems with your configuration etc.


What are the names of software vulnerabilities? In web apps there are vulnerabilities like SQLi or XSS and many more. I heard that for hackers to hack a computer they have to find a vulnerability in a software that is running on an open port.

What are the names of software vulnerabilities, just like web apps have SQLi or XSS? What is the equivalent for computer software, or where can I learn about it?

There are many different classes of vulnerabilities that affect software. A comprehensive list would be huge, but some common classes are:

Memory corruption (stack/heap buffer overflows, misused format strings, use-after-free, double-free, etc.)
Broken authentication (complete bypass, manufacturer hardcoded password, etc)
Injection (SQL/SMTP/LDAP/etc. injection, command injection, etc. Just like web.)
Race conditions (TOCTOU)
Logic errors (business logic flaws, lack of validation, etc.)
Privilege escalation
Broken/weak cryptography
Many others


How to avoid using System.String with Rfc2898DeriveBytes in C# I am creating a .NET core webapp in C# that takes in a user password and hashes it to be stored on a server. I'm using Rfc2898DeriveBytes along with a randomly generated salt. I've read, however, that I should avoid using strings in the entire process since strings cannot be removed from memory. I know that .NET core has a PasswordBox that keeps the password as a SecureString, but SecureStrings cannot be converted to a byte array to be passed to Rfc2898DeriveBytes's constructor without a great deal of shenanigans.

Since the webapp is only going to run on my server, can I just convert the SecureString back to a string as soon as it has been passed into my webapp? If an attacker manages to access the server's RAM to search for an undeleted string, there's probably very little I can do to protect anything to begin with.

If I should still go through with using SecureStrings, what are the best practices for hashing it to be stored?

The .NET Core team specifically recommends against using SecureString for new development. See the SecureString documentation:

  We don't recommend that you use the SecureString class for new development. For more information, see SecureString shouldn't be used on GitHub.

as well as the team's reasoning on GitHub:

  Motivation

  The purpose of SecureString is to avoid having secrets stored in the process
  memory as plain text.
  However, even on Windows, SecureString doesn't exist as an OS concept.

  It just makes the window getting the plain text shorter; it doesn't fully
  prevent it as .NET still has to convert the string to a plain text
  representation.
  The benefit is that the plain text representation doesn't hang around
  as an instance of System.String -- the lifetime of the native buffer is
  shorter.

  The contents of the array is unencrypted except on .NET Framework.

  In .NET Framework, the contents of the internal char array is encrypted.
  .NET doesn't support encryption in all environments, either
  due to missing APIs or key management issues.


Makecab.exe at boot. Is it malicious? I am trying to find out why this process appeared during 2 boot occasions. Autoruns does not show it anywhere. It appeared when I uninstalled google chrome and malwarebytes.
The prefetch file for makecab.exe (makecab is an official microsoft process) showed it was created yesterday, and modified today (it ran once today and yesterday very briefly - no more than 10 seconds at boot.
I've uninstalled the 2 programs before at the same time in the past multiple times, and have never seen this pb.exerocess.
However, usually I delete EVERY file associated with those programs including registry when I did uninstall them.

Is there any reason why makecab.exe would run? I've used process explorer, but the process starts and ends too quickly for me to see what starts it. However, its only twice I've seen it appear, and thats after uninstalling chrome and mbam, both times I did not have process explorer ready.

Should I be worried about this? Or has it a legit reason for running?

I've noticed it begins around the same time as the windows module installer (comparing prefetch file to event viewer).

I haven't added any programs; I only saw this after uninstalling these programs, but as I said I usually delete the files manually. I've uploaded the versions of makecab onto virustotal and they're all clean.

I couldn't find anything in the registry other than a value which listed various system processes, however exporting it as a text file shows it hasn't been edited for years.

How can I find out what is starting it? I've rebooted various times with process explorer and nothing happened, I installed malwarebytes to scan, I did a full scan and found nothing, and installed chrome again. After the scan,  I uninstalled the 2, and then while NOT using process explorer,   but the normal task manager, I saw it again after I rebooted.

Is there a way I can make process explorer extend the time it shows killed processes?

We cannot help you if you don't post more info about the file.

First you will need the md5 signature of that file. You can use a tiny tool called winmd5 for that.
Secondly either search that md5 sig online and try to find relevant information about the process/file or submit it to md5 malware databases such: https://isc.sans.edu/tools/hashsearch.html


What information should be scrubbed before posting email headers in public? To figure out a problem, I need to post mail headers on a public forum, I read What information can be gained from an Email Header? but I'm not sure what information can identify me personally from the headers. Just removing the email address is enough?

You can try using an email analyzer tool like this one to get a better sense of what kind of data is in the header. (ex. http://mxtoolbox.com/EmailHeaders.aspx) Note that when you use a tool like this that you are giving the provider of the service your header information so you will need to trust mxtoolbox.com if you decide to use the service.

Mask all URLs (x.xxxx.com) and the first three octets of any IP addresses (x.x.x.13). You can also mask, say half of the message ID and any other ID strings. Message IDs aren't going to be very useful to anyone unless a.) they know what mail server to look for, b.) they have access to the mail server, or c.) they know someone that has access to the server.

Depending on the issue, you could also try duplicating the problem using an email address and email server that is not attributed to you.

If the IP addresses and URLs are key to solving the issue then you will need to post them. In that case just simply mask any IPs and URLs that are directly attributed to you. (e.g. your email server, your company IP, etc.)

Also make sure that names and/or any other identifiable information is masked from the message content if you plan on posting that as well.


Is this PayPal e-mail a scam? I just received this e-mail (where the blacked out parts are my e-mail address):

To me it looks like a scam for the following reasons:

First of all, I do not have a Paypal account.
It is written in english, which is not my native language.
It asks me to click a link, to insert right away my credentials and to change them right after.

Now I am trying to understand what is going on. I just checked my bank account and no unauthorized transaction has been done. I have not clicked that link yet of course, but should I get worried or just mark it off as a scam?

... or just mark it off as a scam?

I would recommend this option, i.e. simply ignore this mail. There is a lot of Paypal phishing mails out there because Paypal accounts are a lucrative target. But given that you don't have a Paypal account in the first place this mail is obviously a scam.

You still should learn from this mail that such mails can happen with sites and services where you have real accounts too. Similar phishing mails are sent also for example to get access to Apple, Netflix, Amazon and various bank  and mail accounts.