Is it okay to make the public key plainly visible in an asymmetric encryption? This software generates asymmetric encryption using private/public keys portable.licensing. The document states:

  Store the private key securely and distribute the public key with your product.

Is there any harm in embedding the public key in the licence itself as an attribute so it's plainly visible to the licence holder?

I'm assuming that anyone who has a copy of the application can easily find any embedded public keys but just wanted to check if there were any drawbacks to making it plainly visible.

Eg:

<License>
  <Id>43946aa3-71ee-498c-a6a3-ffa6f42f6122</Id>
  <Type>Trial</Type>
  <LicenseAttributes>
    <Attribute name="PublicKey">MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkCipKSjvVZxSa6s1oLJn4A+TP8e9XL2PQmymJiBwR+yi02ZDvVO5YejnWNokyrzg06owL7ErfVh9p71EB8DEMw==</Attribute>
  </LicenseAttributes>
  <Expiration>Wed, 04 May 2016 23:59:59 GMT</Expiration>
  <Customer>
    <Email>email@emailprovider.com</Email>
  </Customer>
  <Signature>MEYCIQDzmcdYdHiT/6mCh33DoNxlFxMgLwxUoKC1HDVTZwdhyQIhAPzgTdh0jQ76zbH3EYzIIAaRjuvIyFqcZZ1tv/G2Kch8</Signature>
</License>

Sure, public key is included quite frequently as a part of challenge (for example HDCP2). Also there can be a problem to trust of the public key, so it's usually signed with a trusted authority. As public key is used during of the beginning of authentication phase, symmetric keys are not ready at this point.


Can a certificate have multiple chains and multiple self-signed roots? The following MSFT document has this paragraph:

  All possible certificate chains are built using locally cached certificates. If none of the certificate chains ends in a self-signed
  certificate, CryptoAPI then selects the best possible chain and
  attempt to retrieve issuer certificates specified in the authority
  information access extension to complete the chain. This process is
  repeated until a chain to a self-signed certificate is built.
  For each chain that ends in a self-signed certificate in the trusted root store, revocation checking is performed.

Does this imply that a single certificate can have multiple "chains".  What would this look like, and where would it be used?

Multiple roots are created when

A certificate is renewed  or
A certificate is re-keyed

This applies to every certificate in the CA hierarchy.

Just to make things more interesting, the revocation list itself (CRL/OCSP) is signed and may have it's own PKI.  They may also have their own set of keys. (To verify the verifier?)

In other words,

The chains discovered while verifying the CRL, Deltas, and OCSP responses also count towards a CA root that is discovered.  (note that OCSP verification can be suppressed via id-pkix-ocsp-nocheck )

The CA architecture has an effect on the chain-building process. Before a distinct certificate chain is considered valid, the chaining engine builds all chains that are possible with the certificate that is being verified. If an end-entity certificate was generated by a freshly set up CA, the certificate chain is straightforward. However, a certificate that was issued by a renewed CA or where a cross-certification exists between the issuing CA and another CA, multiple certificate chains might exist.

The entire graph of certificate chains is constructed and then ordered by the “quality” of the chain. The best quality chain for a given end certificate is returned to the calling application as the default chain.

Below are illustrations of validation processes in a Single, N-Tier, Cross, and Bridge PKI

Single CA

N Tier

Cross Trust CA

Bridge CA

More information on PKI topology and cert renewals is at the bottom of this article


Malicious PDF Analysis I have been analyzing a PDF I suspect to contain malicious content. For the most part, I've always trusted automated tools to determine if a PDF was safe to open. However, my eyes have been opened to all the encryption and obfuscation techniques in the wild today. So I've started reviewing my PDFs manually using tools like these, and PDFStreamDumper. I have looked at the PDF specifications located here.

Everywhere I look, no one seems to explain the purpose of the /<Abbreviation> directives. For example, the excerpt found in the header.

I can't find what /JT references. Or why the /GoTo does not specify a location.

The second object specifies /Cn and /V but I can't find these either.

The third object /Dt and /JTM, have no reference in the PDF specification. Can someone give me some direction. I'm willing to do the research but I'm not sure what I'm looking at besides abbreviated commands contained in an object. Is there a cheat sheet with these directives listed and their purpose?

Header

<<

    /JT 2 0 R
    /OpenAction
    <<

        /D [ 9 0 R /Fit ]
        /S /GoTo

    >>

    /Outlines 8683 0 R
    /PageLabels 8875 0 R
    /PageLayout /SinglePage
    /PageMode /UseOutlines
    /Pages 5437 0 R
    /Type /Catalog
>>

Second Object

<<

    /A [ 3 0 R ]
    /Cn [ 4 0 R ]
    /V 1.1
>>

Third Object

<<

    /Dt (D:20101223094432)
    /JTM (Distiller)
>>

Note: I did run the file through Virus Total with just a few red flags. The pdf conforms with the 1.7 specs.

This link is for PDF-aware developer tools:
http://www.adobe.com/devnet/pdf.html
Specifically, the 1.7 reference that DarkLighting mentions is:
http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf

Section 3.2.4 of the document seems to address your question:

   3.2.4Name Objects
   A name object is an atomic symbol uniquely defined by a sequence of characters.
Uniquely defined means that any two name objects made up of the same sequence of characters
are identically the same object. Atomic means that a name has no internal structure;
although it is defined by a sequence of characters, those characters are not considered
elements of the name.

        A slash character (/) introduces a name. The slash is not part of the name but is
a prefix indicating that the following sequence of characters constitutes a name.
There can be no white-space characters between the slash and the first character in
the name. The name may include any regular characters, but not delimiter or white-space
characters (see Section 3.1, “Lexical Conventions”). Uppercase and lowercase letters are
considered distinct: /A and /a are different names. The following examples are valid
literal names:
    /Name1
    /ASomewhatLongerName
    /A;Name_With−Various***Characters?
    /1 . 2
    /$$
    /@pattern
    /. notdef

So it would seem that /JT /Cn /V and so-on are named objects within a PDF Dictionary Object (identified by double angled brackets << ...  >>). In your examples, all of these "unidentified" elements are contained within dictionary objects. See section 3.2.6 for a more detailed description of this element.

It's also conceivable that these are part of the PDF extensibility options described in 2.2.8:

Additionally, PDF provides means for applications to store their own private
information in a PDF file. This information can be recovered when the file is
imported by the same application, but it is ignored by other applications.
Therefore, PDF can serve as an application’s native file format while its
documents can be viewed and printed by other applications. Application-specific
data can be stored either as marked content annotating the graphics objects in
a PDF content stream or as entirely separate objects unconnected with the PDF content.

Basically, it's hard to tell what all the various non-standard objects are defined as without going through each one and decoding it (either through a self-developed automation tool or manually).

I non-concur with DarkLighting regarding the /GoTo comment. PDF renderers should read the entire contents of the dictionary before taking any action. The PDF specification does not state that order is important - only that both the "/S /GoTo" and "/D <[some kinda destination]>" are declared. In your example it says go to Page 9, Location 0.


Store database access password in PHP class const? I have PHP project and I need to store MySQL access information.

I have a config.php file outside public directory and in the file I have:

class Config
{
    const host = "dbserver";
    const name = "dbname";
    const user = "dbuser";
    const pass = "dbpass";
}

Then in init.php (also outside public directory) I have helper functions and other stuff:

include "config.php";
$db = MySQLWrapper(Config::host, Config::name, Config::user, Config::pass);
//... init sessions, spl_autoloads, class maps and other stuff

Now in public www directory, I have index.php:

require_once "full path to init.php"
create page

Is this a good, safe design? Or is there any problem with class const's?

I dont want to use directly variables or array, because if someone accidentally allow error logs on server, passwords in variables could leak in error log via variables debug print.

Step one is to never store the password in the webroot. You allready got that covered. Good!

Step two is to not store the password in PHP code. Your code base should be free of secrets, be it in class constants or anything else. That let's you commit it to version control, make backups, share it, etc., without second thought.

Keeping the secrets out of the source code is not just good for security, but also good software development practice. Your source should not be dependent on the environment the application is running it.

So how do you solve this? Consider using an environment variable, a configuration file or php_value in httpd.conf. For all these cases you'll have to think about what processes has access to the value and how you restrict that.


Is replacing all apostrophes with two apostrophes sufficient to prevent SQL-injection on MSSQL? I'm working in a web site that doesn't use parameters on SQL queries.
All the queries are adhoc and the way they are doing the input validation seems good to me, I'm not able to break it to do SQL Injection.

They are validating the numeric input and if it's string they are doing this (e.g):

sanitizedInput = "'" & Replace(input, "'", "''") & "'"

In others SGBD it's easy to break, but in MSSQL I'm not finding a way to do it.
How can I break this? I just want to show them that this isn't enough.

No. This will certainly not handle string concatenation that is not delimited by quotes. e.g. a numeric field.

Consider

sql= "select username from users where id=" + id

if id is provided as 1 or 1=1 then all rows from the database can be returned. Obviously this can example could be extended to union select attacks or even entire nested queries.

Just use bound parameters and avoid the entire problem of SQLi.


How secure is bitlocker with a pin when whole machine is stolen? I assume if I use Bitlocker on Windows 10 on a laptop with a TPM chip without a password, then if the laptop gets stolen, then the attacker can simply turn the machine on and then he gets to the windows logon screen without any problems.

To prevent this I assume I need the preboot pin, but how secure is that (with a 9 character numerical pin)?

The scenario I want to protect myself against:

A simple thief steals the notebook
They want to access the data by basic "googling around" hacking skills, like using a tool or typing in random passwords.

Meanwhile I will have time to change all the passwords of the online services, disable VPN accounts, etc. that were used on that notebook, so even if they eventually gain access, our systems will stay secure.

The scenario I want to protect myself against: 1. A simple thief steals the notebook 2. They want to access the data by basic "googling around" hacking skills, like using a tool or typing in random passwords.

A 9 digit PIN should be sufficient to protect against an attacker of this level of sophistication for long enough for you to change the passwords on all your online services. A TPM will ensure that only a trusted computer can unseal it, in combination with your PIN. Since the attacker has the whole computer, all that is needed is the PIN. What matters now is several factors:

How motivated your attacker is (are you a random victim of this attacker, one of 100 others?).
How clever he is (one person's "basic Googling skills" is another person's advanced Google-fu).
How long it will take you to notice the theft and to change your passwords.

Both defenders and attackers need to do cost-benefit analysis. You have to determine how much of your time and effort your assets are worth, but the attacker has to do the same. If it takes them two weeks to gain access to your computer, that is two weeks of lost opportunities for theft. Why spend all that time on your computer if it would be more profitable to steal three more computers in that time?


is copy pasting sudo password from opened document a possible vulnerability? During setup of my ubuntu systems after installing the system offline i open a textfile and change my sudo password by typing it into a textfile and paste it after so that i don't lock myself out by accident.
My passwords are 20 characters long and have special character and everything.
So my question is if this behaviour is a vulnerability as soon as the system goes online.
Because of the password lenght i use to fail quite often when typing it in blind so i type it into a textfile and then paste it into the terminal also when i am online.

I was thinking that if someone would have gained acsess to my system it would make no difference if i type the password in by keyboard or first type it into a text document and then copy paste it please correct me if i am wrong.

You're correct that if you were compromised an attacker could potentially still capture your password regardless of whether you typed it into a notepad or just into the password prompt. The issue here is that writing it into a text program may write it to disk, allowing it to be retrieved later. Writing it into the prompt should only write it into memory.

For ease of use I'd suggest using a password management tool such as Keepass or 1Password. There are many out there, but they can save your passwords and also generate random passwords for you.


is it secure to use sha256 to hash 64 cryptographically random byte data with 12 byte salt? I read from a lot of sources that sha256 is not secure because it is fast. Most links that I read suggested bcrypt. However, I just want to know that if data is  64 cryptographically random byte, will attacker be able to find original string somehow?

Scenerio

secret string is 64 cryptographically random byte data

User download secret string, we store hashed version of it. He will upload this data to site when he wants to get access to some information. (work process can not be modified, it is stable system we just need to secure it)

System has 1 trillion secret string and all of them should be protected by some hash algorithm.

Is it possible that attacker will get even one of the secret string if he got access to all hashes?

You're confusing cryptographic hashes with password hashes. A cryptographic hash takes an input and gives a random looking output. A password hash takes a password and a salt and very slowly gives a random looking output.

What you are worried about here is preimage attacks. You want to ensure that, knowing a hash y, the attacker cannot find a value x such that h(x) = y. 80 bits of complexity is still generally considered "good" (though not "great", and possibly vulnerable to a well funded attacker such as a nation-state). What this means is that you want a hash where the best preimage attack has a complexity of over 80 bits.

Analysis

Let's start with MD5 since it's something of a poster child for outdated crypto. The best known preimage attack on MD5 is 116.9 bits, well above 80. But you want to protect 1 trillion secrets, which lets the attacker do some optimizations.

Let's assume the attacker is able to use a hash table (and many terabytes of RAM) to check if a hash matches any of the 1 trillion in O(1). With 1 trillion secrets this reduces the complexity to break a single secret by log2(1012) ≈ 40 bits, which brings MD5 down to around 76 bits. Still not terrible, but worrying if you're facing a nation-state or want to keep these secret for many years.

But you're doing the right thing and using SHA256. The best preimage attack I could find on SHA256 was for reduced steps, and still had complexity over 250 bits, so you're looking at over 210 bits of complexity there. In this case an attacker will be running into some issues with physics.


How to check if a website is sending out a virus? I'm a webmaster at a company without much knowledge of IT Security. We are running 6 computers connected to a central server that also hosts our website.

3 out of 6 people in the office have gotten viruses in the last week. Our IT consultant assures us that the virus would not be on the central server and that we all must have got it from the same website. Does that sound legitimate?

We now want to investigate to see if our website could be the source of the infection. What are the first steps into investigating the possibility that our website is infected?

The best thing you can do is have a known clean copy of your site that you can compare the server's files against. Most hacked webservers that serve virus infections come from changing the content of scripting files that server is offering to clients. Look for files with different checksums or new files.

There are also cases with forums type sites where the infection will come through XSS. In an effort to hide infections from site owners, sometimes infections are only served up if the visitor has a referrer tag from a search engine in their request.

You can also run 3rd party scanners against your website. http://www.antihacksecurity.com/scan-a-website-for-virus-malware lists some of those options.

Since you're talking about your machines connected to the same server, I'm assuming you mean a LAN environment where that server also offers file sharing. Among other things, it's often very good practice to split servers that offer external facing services from those offering internal facing services. Further, that poses the idea that the server may have been compromised and then used as a launching point to infect your machines.

Identifying the particular infection will also allow you to research the most common way that it is transmitted. Most virus packages are full packages that an attacker can drop & move on. That means they'll behave the same way.

Ultimately, verification breaks down into two possible areas: scan try to find "bad stuff" or authoritatively certify that everything on your server is "good stuff." The second one is more secure, but requires the right type of environment and planning.


Is it safe to disable SSH host key checking if key-based authentication is used? I have some tasks that go like so:

Spin up some new EC2 instances (Amazon Web Services)
Get them to execute a task
Kill them

The problem is that they're (seemingly) randomly assigned an IP address, and by chance a new machine reused an address that had previously been used.

This obviously lead to the following error, and my script failed:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /home/ec2-user/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/ec2-user/.ssh/known_hosts:595
RSA host key for 127.0.0.1 has changed and you have requested strict checking.
Host key verification failed.

I'm using a keypair when connecting to these machines, rather than using password authentication. Would this prevent a man-in-the-middle attack, since an attacker would not have the same keypair?

Am I safe to disable SSH host key checking?

Short answer: Yes and no.

First of all, let's get things straight. How does key-based authentication work in SSH anyway? Once the SSH connection reaches the authentication phase, the client signs a bunch of data (this includes the session identifier) with its private key, then sends the signature to the server to verify it.

Signature verification pass -> Authentication successful.

How does a MiTM attack in this case then? The attacker sits between you and the server. For a successful attack he needs you to start a session with him, and he needs to start a session with the server. Whatever you send to the server, will actually go to him and he has the ability to modify it and send it to the server, and whatever the server sends you will actually go to the attacker and the attacker can modify it and send it to you.

Have you noticed something interesting? There are two sessions here (keep this in your mind). Each session is going to have its own session identifier because the generation of the session identifier isn't determined by the server or the client alone. In other words, the signature you use to authentication to the attacker will be different from the signature the attacker has to use to authenticate to the real server.

The attacker doesn't have the client's private key, meaning it won't be able to come up with a signature that the real server will accept. That's why this kind of full MiTM will not be possible.

So it's safe to disable host key/fingerprint checking, right? Not exactly. It's true that because the attacker won't be able to authenticate to the server, he won't be able to execute malicious commands on it. BUT

Remember when I told you about the two sessions? The attacker won't be able to establish session with the real server, but he can easily make you establish a session with him. The attacker will simply accept whatever signature you give him and trick you into thinking that you're now connected to the real server. You'll send him commands (and possibly some process-specific passwords) and he'll happily reply with whatever makes you happy.

Granted, there's no real danger to the server here since those commands aren't really reaching the server. It's just that there's no telling what you'll actually be sending the server (now the attacker). You might send keys, passwords (think, when you modify your password the server will ask you for the current password), and other sensitive information.

Bottom line is: If you're willing to accept the risk of connecting to a fake server that will know what you're sending to the real server, then disable host key/fingerprint checking. Otherwise, keep it enabled.

References:

RFC 4252 7. Public Key Authentication Method
RFC 4251 9.3.4. Man-in-the-middle


How can a user defend against session hijacking? Given a website with various security flaws, one of them is session hijacking, session token continuously being sent as an argument over unsecured HTTP. In my field it's not surprising that others sniff networks I use, so I contacted the owner of this site and notified them of the vulnerabilities and suggested that they should use TLS encryption. Some arrogant guy replied that they know it better and it's not my business anyways.

Since it's not always possible for me to use VPN when I access this site, my question as a regular user is, are there other reliable ways to defend against people stealing my session?

Here are some suggestions. None of this will give you the same level of security as TLS would, though.

Don't use the site unless you really have to. But since you ask, I assume you do.
If you visit it, use a VPN (or Tor) as often as possible. An attacker would have to get in the middle of your VPN exit and the server in question, which is harder than getting in the middle of you and the server (but not impossible, especially not for a governmnet - or the provider of the VPN/Tor exit node...).
If you don't use a VPN, at least don't use it over Wi-Fi. That is so much easier to sniff than a cable network.
Stay logged in for as short periods of time as possible, and always logg out when you are done. Don't check the "remember me" box.
Unless the login page is over HTTPS, you should be more worried about your password then your session ID... If the login page is over HTTPS, always check that you have a secure connection so you don't become a victim of SSL-strip.

Depending on how likely you think it is that you will be the target of an attack this may or may not be enough. I am afraid there is not much else you can do.


When using HTTPS, which part of domain is revealed to ISP? Let's say you are visiting https://57vdyr6tyuibgyoihp.blogspot.com. Does the ISP only see the blogspot.com part, or the entire 57vdyr6tyuibgyoihp.blogspot.com?

I think you are referring to the hostname as given in clear text in the SNI extension in the ClientHello message as part of the TLS handshake. Since this extension is used to tell the server what certificate to provide as part of the TLS handshake and the server might have different certificates for different subdomains, the SNI extension must contain the full hostname like foo.bar.example.org and not only part of it like example.org.


How to tell my HTTPS connection to a site uses PFS? Does the browser have a UI for displaying the details about the TLS connection to the website, besides the "secure/insecure" icon?

In Google Chrome:

click on the padlock icon:

click on "Details":

click on reload:

In the Security Panel, click on the URL under "Main Origin":

look at value of "Key Exchange" under the "Connection" section:

If the key exchange begins with "ECDHE" or "CECPQ1"1 then you have PFS.

In Mozilla Firefox:

click on the padlock icon:

click on the expander thingy on the right side of the popup:

click on "More Information" on the bottom side of the popup:

look at name of cipher suite in Page Info popup window:

If the name of the cipher suite begins with TLS_DHE_ or TLS_ECDHE then you have PFS.

I did not find a way to get Microsoft Edge to divulge the used TLS cipher suite in the UI - you need to sniff the traffic with wireShark or equivalent.

I don't have a Safari available right now, but I'll add that later if I find a way to the Safari to display the cipher suite.

1 - https://security.googleblog.com/2016/07/experimenting-with-post-quantum.html


TLS with non-repudiation; what happened with 'TLS Sign'? TLS Sign was proposed as an IETF Draft in June 2007.

I have not found further information, besides that the draft expired in November 2007. Can someone tell me what happened with this extension or can someone point me to an extension, or a mechanism that provides non-repudiation for TLS connections.

I don't find any draft beyond the last one (expired since June 2008). I am not aware of any existing implementation. Anyway, the draft is incomplete and inconsistent (e.g. the ContentFormat type is defined twice, with distinct incompatible values; the tls_sign value is undefined) and quite poorly explained (from what I can see, it says nowhere what is actually signed).

Anyway, non-repudiation is a legal concept. It may rely on some technological elements, such as cryptographic signatures and certificates, but these elements cannot ensure non-repudiation alone. To really get non-repudiation, you need to follow what the local legal system says about non-repudiation. When such laws exist, they invariably insist on the idea that whoever is signing must be aware of what he is signing. Thus, signatures for non-repudiation cannot really exist as an application-independent feature -- which was the goal of that draft and its raison d'être as a TLS extension. In that sense, the draft was useless, which explains why it did not result in a complete RFC.

(Uselessness cannot always prevent features from becoming RFC, but it may still siphon out the motivation of who is doing the writing. Writing a publishable RFC is a lot of work, in particular editorial work, which won't happen unless the author is really convinced that it is worth the effort.)


If domain admin account's NTLM hash is compromised, can it be used to access any machine in network If a hacker able to get local admin rights and then from there local domain admin's NTLM hash.

Can he use this hash without cracking, to access shared folders in the network and the default C drive share on all network machines ?

I know he himself using local account he compromised can become domain admin by several ways. But would that be detectable ?

What would be the most passive way to move forward for him ?

Yes, this is called the Pass the Hash attack.

Microsoft has not issued any solution to mitigate (except for some vague general security advice), until Windows 10 where the hash is stored in a special vault.

An example of exploit (via Metasploit) can be found at Offensive Security.


Does too long a salt reduce the security of a stored password hash? Suppose we have passwords that are statistically 7-8 characters long. Is appending a 200 character long salt less secure than a 5 character salt, because of the similar hash function inputs?

I was wondering: what if someone tries to guess the salt by brute forcing the salt with for example the password "123456", or another popular password that can be found in the system or even on a known password from the hacker's own account?

As Mike and Gumbo have mentioned in comments, a salt isn't intended to add protection to bad passwords. It's meant to keep the attackers from breaking the whole database at once. The length of the salt isn't meant to add difficulty to breaking the stored passwords. It's meant to ensure that your salt is reasonably unique compared to others on the Internet, and (if you're doing it right) no two of your users will have the same salt.

Imagine you have 20 users who all have "god" as their password. Consider the following scenarios:

Passwords are unsalted
The attacker can use a precomputed table to break one user's password in very short order. On top of that, once he has the first of the 20, he'll also have the other 19 since their hashes would be identical.
Passwords are salted. Salt used is fairly short. Same salt is used for all users.
The attacker might have to look for a bit, but could possibly come across a precomputed table made specifically for your configuration. After that point, see scenario 1.
Passwords are salted. Salt used is reasonably strong. Same salt is used for all users.
Chances are, the attacker won't find a pre-computed table for your system on the Internet. He'll have to make one of his own. This will take a bit of extra time. However, after that's done, we're back to scenario 1 again.
Passwords are salted. Salt used is reasonably strong. Each user has a unique salt.
This is what you should be doing. Not only will the attacker not be able to find a precomputed table for your system, it's not even worth his time to make his own. Any pre-processing he might do would only work against one user. Even if he hits one of the 20 users mentioned earlier, he won't know the other 19 because the hashes will all be different. Each password must thus be individually attacked, and that's going to take awhile if you're also using a strong and slow hashing algorithm like you should be. Chances are, the weak passwords will still end up compromised eventually. It's just going to take the attacker a good bit more time to get through them all, and you won't have chunks of your users getting compromised at once just because they have the same password.

So, use long salts and make them unique per-user. But don't count on that to help individual users much if they're using "god" as their password.


Account lockout with human interaction required to unlock I just got locked out yet again from my university's system for typing the wrong password twice, then mistyping the correct one by accident. Now I have to call the helpdesk or go there myself to reset it.

Now my question, is there really any value in doing this? I could understand a 5-15 minute lockout, but I simply do not see any value in a hard account lockdown from a security point of view. From my point of view as a user of this system, it has been nothing but trouble, frustration, and lots and lots of lost time.

If anything, this looks like a huge sign saying "lock this user's account FOR FREE!" simply by knowing their username, enabling mass denial of service with little effort. But I could be missing something.

Of course, I am obviously biased, so does anyone see an advantage in doing this? To me it looks like overzeal, and their other password policies - I will spare you the horror - really don't do a good job at making me feel good about giving them passwords, but I unfortunately have zero authority over this.

I agree - the hard account lockout can be used by malicious users to DoS (Denial of service) legitimate user accounts. Depending on the sensitivity of the user accounts a time based lockout may be more appropriate. For similar applications our company uses a time-based incrementing approach.

For example, the first time it locks out after 3 incorrect passwords it locks for 10 minutes. If it is locked again it locks for 20 minutes. The third time 40 minutes. And so on, this incrementing time makes it time consuming for automated brute force attempts and will give significant time to the sys admin / security team to identify an attack. Without the time based lockout a brute force attack would be possible in a number of minutes, and with the hard account lockout it would cause a headache for the support team.

One question would be can you easily enumerate usernames of the application. If you can then point this out to the support / development team as a malicious attacker could easily do the same and lock out every account in the system.


Are there any free, premade penetration testing labs? I've already assembled a lab consisting of Kali, Metasploitable, and a Windows XP machine, but are they're any premade lab solutions available that offer up a bit more complexity or even predesignated goals? I am aware of different services that will allow you to VPN into a network, but is there a free/cheap alternative?

Honestly, the best solution I have used is Core Impact, but it doesn't come cheap. Of course there is always BackTrack, which includes most of the tools you'll need and is completely free.

However, I would say that in almost all cases a one stop solution will not fit all situations and its best to have a wide and varied tool set.

I would suggest always having a good intercepting proxy, like OWASP ZAP or WebScarab.

In some cases you'll also find that these tools are just not good enough and you have to create your own tool to exploit a vulnerability.


How is "Touch Jacking" prevented on iOS, Android, and Win 10 - touch? I'm looking at the security of both iOS and Android from a Touch-jacking security perspective.  In other words, I expect that an application can be in a secure state to ensure that no overlays, screen capture, or other way of leaking screen data to an unauthorized app.

For example, I want to ensure that the PIN entry of Goodlink Secure Email is deployed on an OS that supports reasonable protection against such malware.

Does the architecture of iOS allow for such security?
Does the architecture of Android allow for such security?
Does the architecture of Windows Mobile (Windows 10) allow for such security?

Since I'm allowed only one accepted answer, if anyone adds information regarding the other operating systems, and the accepted answer misses this,  I will return and award a sizable bounty for each answer.

Here is a StackOverflow answer for Android:

The tapjacking attack has been blocked at the OS level since Android 4.0. For such devices, you do not need to do anything to prevent tapjacking attacks.
android:filterTouchesWhenObscured="true" helps on API Levels 9-13. It did not exist prior to that, and so that attribute will be ignored on older devices, if you are supporting those.

This newer article (English translation provided at bottom of link) states that setting these parameters on a window:

– LayoutParams.FLAG_NOT_FOCUSABLE (the window can’t receive the focus)
– LayoutParams.FLAG_NOT_TOUCHABLE (touch events will never be transmitted to this window)
– LayoutParams.FLAG_NOT_TOUCH_MODAL (touch
events will automatically be transmitted to the underlying activity)

will allow touchjacking. They claim they have tested this on Android 4.3 and 4.4. If this is correct (I've not tested it) then Android is susceptible to touchjacking. (If you test this, let me know in the comments what your results are and I'll add them to this answer.)


Should I change all my passwords due to heartbleed Should I change all of my online passwords due to the heartbleed bug?

Edit:

I found a list of vulnerable sites on GitHub and checked all my critical sites. Everything I was really concerned with was not vulnerable according to the list.

Short answer: Yes, all passwords.

Long answer: At first sight, you only need to change the secret key of the certificate. But due to several reasons, all passwords are affected. Here's why:

Reason 1: Chained attack

Someone captured the secret key of the certificate. From that time on, he could decrypt all the traffic to that site.
If you logged on for whatever service on that website, your password was revealed. Probably the most common service is Webmail, so let's use that as an example.
Reading your emails, the attacker found out which other services you are using.
Using the password reset mechanism, the attacker simply reset all the passwords, confirmed the reset emails and deleted those emails of course.
The attacker now has access to all your services.
The website owner (whose secret key was stolen) became aware of the security leak and fixes it. The service (we assumed Webmail) is no longer vulnerable.
The website owner informs you about the leak and asks you to change your password.
The attacker can still use all the other services as long as you don't notice that you cannot login anymore (because he changed the password). This means: For services which you use often, it's more likely to detect that it was misused. For services you don't use often, you'll not notice.

Therefore you at least have to check each single password, whether it is affected or not.

Good thing on this attack vector: You'll be aware of the issue.

Reason 2: Access to database

Someone captured the secret key of the certificate. From that time on he could decrypt all the traffic to that site.
If the admin of the website logged on to do some administration, moderation or whatever, the attacker now has the password of the admin.
With that password, the attacker gets access to the database.
Depending on the security of the database, the attacker can read

the usernames
the passwords in plaintext (worst case)
vulnerable password hashes (e.g. MD5 hash, unsalted) (bad case)
secure salted hashes (best case)

The attacker calculates the password from the hash
The website owner fixes the problem
You are informed by the website owner to change the password.

Since you as the user cannot know how securely the password was stored in the database, you need to consider that the attacker has the password (and username). This is a problem, if you reused the password for other services.

Bad thing: You don't know whether you are affected, because logging in to other services still works (for you and for the attacker).

Only solution: Change all passwords.

Reason 3: not only secrets certificate keys are leaked

 I looked at some of the data dumps
 from vulnerable sites,
 and it was ... bad.
 I saw emails, passwords, password hints.

As posted by XKCD #1353:

So the attacker could already have your password in plain text even without access to the database and without chained attack.

Notes

The second problem, described by @Iszy, still remains: Wait to change your password until the service has fixed the Heartbleed issue. This is a critical hen-and-egg issue, because you can only reliably change all the passwords, when all services you use are updated.


What prevents a coder from brute forcing a wifi? I know that a coder is able to connect to a wifi through code so my question is: Is there anything that will make it difficult to brute force a wifi password?

What makes WiFi encryption harder to brute force?

First, a strong password, preferably not set to the router default. The best password is set using a cryptographically secure random number generator (CSRNG), to the full 63 ASCII or 64 Hex chars. You can also use WPA-802.1X mode, however, this requires a Authentication server, and therefore is generally used for large networks.

However, a password built from five and more words would be far easier to remember, without significantly compromising the security of the key.

Another issue is WiFi Protected Setup, specifically, the PIN method significantly reduces the entropy for an attacker. The PIN is a 8 digit number checked in two chunks. This reduces the entropy from around 50 bits (5 word password) to less than 15 bits (2 times a 4 digit PIN), a factor of more than 34 billion. Turn that off, and you'll be relatively safe.


SSLStrip not working on custom ports I have been using sslstrip for a while and it works fine on websites on which HSTS is not enabled. However when the SSL server is running on some custom ports sslstrip fails. eg: For links like https://example.com:400 the striping doesnt seem to work even though the site doesnot implement HSTS. How to get around this problem?

I suppose the sslstrip breaks the bridge between the http and https. One of the cases where the tool works is the case of redirection. The tool checks the 'Location' header and strips off the HTTPS from it. It then embeds the HTTP URL for the client so that the browser should not go for SSL handshake. In short, the SSLStrip intercepts the traffic before it gets negotiated to secure tunnel. The url you mentioned is the https URL is a direct https url where the http->https transition will not happen. Hence the tool [sslstrip] will not give you the expected output even though HSTS is not enabled.
I hope this is useful.


How does WEP wireless security work? I want to know more about how WEP (Wired Equivalent Privacy) protocol for wireless security. From this Wikipedia article I have got a basic Idea. But what is the initialize vector? Is some kind of token sent for each request? Or is the connecting device authenticated only once in the beginning or some kind of token sent for each request (equivalent to cookies for authentication in Gmail, Yahoo, etc.)?

I have tried to set up WEP security for my Wi-Fi. As per instructions from my ISP, I did the following:

Network Authentication - Open
WEP Encryption         - Enabled
Current Network Key    -1
Encryption Key         -64 bit
Network Key 1          -abcdefghij (10 characters)
Network Key 2          -
Network Key 3          -
Network Key 4          -

What are these network keys?

The initialization vector in WEP is a 24-bit random value that is used to seed the RC4 algorithm.

RC4 is a stream cipher. This means that for each bit of plaintext, it produces one bit of keystream and xors the two, to generate the ciphertext. The keystream is simply a stream of random numbers, generated from the RC4 algorithm.

In the most basic operation of a stream cipher, the algorithm is seeded with a key, such that the same key will always produce the same stream of random numbers. Since both the client and server know the key, they can produce the same keysteam. This allows the client to xor the plaintext with the keystream to produce the ciphertext, and the server to xor the ciphertext with the keystream to produce the plaintext again.

The problem with this is that a key is only a few tens of bits long, but the plaintext may be gigabytes. After a large number of bits have been produced by RC4, the random numbers become predictable, and may even loop back round to the start. This is obviously undesirable, because a known plaintext attack would be able to compute the keystream (c1 xor c2 = k) and use it to decrypt new messages.

In order to solve this problem, an IV was introduced to complement the seed. The IV is a random 24-bit value that changed periodically, in an attempt to prevent re-use of the keystream. Unfortunately, 24 bits is quite small, and the IV often wasn't generated in an unpredictable way, allowing attackers to guess future IVs and use them to deduce the key.

Further attacks involved actively injecting packets into the network, tricking the access point into issuing lots of new IVs, which allowed attackers to crack WEP in minutes or seconds.

Further reading:

Fluhrer, Mantin and Shamir attack
WEP Flaws
How WEP cracking works (PDF)


Is using attack tools from a compromised host considered "pivoting"? I would like to get a better understanding of pivoting in pentesting.
If I install attack tools (nmap, ...) on a compromised host and use them to attack other hosts on the network, is that considered pivoting?

Your assumption in the term pivoting is correct - routing the attack traffic through an already compromised host for the purposes of accessing a resource you otherwise would not be able to access. I would, however, recommend not installing software on compromised hosts if it can be avoided. The more stealth you employ the better.

You could utilize an already compromised host with the usage of the route command in Metasploit if you have a meterpreter shell, or proxychains. These commands will allow your compromised host to act as a "forwarder" of traffic to whichever host you specify.

This is not to be confused with lateral movement, which is using attacks such as pass-the-hash or using cracked password hashes to log in to another resource than the one originally compromised.


Why is this SSL handshake failing with iPad? I do have a tomcat server that listen on an SSL socket with TLS protocol. When connecting with all desktop browser everything work right. When connecting with Safari on iPad, the SSL handshake fails.

I sniffed what happens but I am unable to understand what is going on. This is the ssldump output. As you may see iPad client try three times using different client_versions and ciphers, but the server always reply handshake_failure.

The latest try is this one (the complete handshake is in the above link).

New TCP connection #3: host35-105-static.24-87-b.business.telecomitalia.it(59123) <-> 192.168.1.55(8443)
3 1  0.0898 (0.0898)  C>S  Handshake
  ClientHello
    Version 3.0
    cipher suites
    Unknown value 0xff
    Unknown value 0x3d
    Unknown value 0x3c
    SSL_RSA_WITH_AES_128_CBC_SHA
    SSL_RSA_WITH_RC4_128_SHA
    SSL_RSA_WITH_RC4_128_MD5
    SSL_RSA_WITH_AES_256_CBC_SHA
    SSL_RSA_WITH_3DES_EDE_CBC_SHA
    SSL_DHE_DSS_WITH_NULL_SHA
    Unknown value 0x6b
    SSL_DHE_RSA_WITH_AES_128_CBC_SHA
    SSL_DHE_RSA_WITH_AES_256_CBC_SHA
    SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
    Unknown value 0x3b
    SSL_RSA_WITH_NULL_SHA
    SSL_RSA_WITH_NULL_MD5
    compression methods
              NULL
3 2  0.0906 (0.0008)  S>C  Alert
  level           fatal
  value           handshake_failure
3    0.0907 (0.0000)  S>C  TCP FIN
3    0.1772 (0.0865)  C>S  TCP FIN

What may be the problem? How can I better investigate it?

I thank you very much

Update: Enabling SSL logging in java (logging server side), I get this, so I really thing this is cipher related:

Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
http-192.168.1.55-8443-1, setSoTimeout(60000) called
[Raw read]: length = 5
0000: 16 03 00 00 4B                                     ....K
[Raw read]: length = 75
0000: 01 00 00 47 03 00 51 1E   33 5C CB 56 A8 58 4B 4D  ...G..Q.3\.V.XKM
0010: 34 86 04 4C CC 4E 00 A0   A8 7B 60 4E 6A 17 28 2F  4..L.N....`Nj.(/
0020: DB 51 1C 17 AE 9C 00 00   20 00 FF 00 3D 00 3C 00  .Q...... ...=.<.
0030: 2F 00 05 00 04 00 35 00   0A 00 67 00 6B 00 33 00  /.....5...g.k.3.
0040: 39 00 16 00 3B 00 02 00   01 01 00                 9...;......
http-192.168.1.55-8443-1, READ: SSLv3 Handshake, length = 75
*** ClientHello, SSLv3
RandomCookie:  GMT: 1360933724 bytes = { 203, 86, 168, 88, 75, 77, 52, 134, 4, 76, 204, 78, 0, 160, 168, 123, 96, 78, 106, 23, 40, 47, 219, 81, 28, 23, 174,  156 }
Session ID:  {}
Cipher Suites: [TLS_EMPTY_RENEGOTIATION_INFO_SCSV, Unknown 0x0:0x3d, Unknown 0x0:0x3c, TLS_RSA_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, Unknown 0x0:0x67, Unknown 0x0:0x6b, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, Unknown 0x0:0x3b, SSL_RSA_WITH_NULL_SHA, SSL_RSA_WITH_NULL_MD5]
Compression Methods:  { 0 }
***
[read] MD5 and SHA1 hashes:  len = 75
0000: 01 00 00 47 03 00 51 1E   33 5C CB 56 A8 58 4B 4D  ...G..Q.3\.V.XKM
0010: 34 86 04 4C CC 4E 00 A0   A8 7B 60 4E 6A 17 28 2F  4..L.N....`Nj.(/
0020: DB 51 1C 17 AE 9C 00 00   20 00 FF 00 3D 00 3C 00  .Q...... ...=.<.
0030: 2F 00 05 00 04 00 35 00   0A 00 67 00 6B 00 33 00  /.....5...g.k.3.
0040: 39 00 16 00 3B 00 02 00   01 01 00                 9...;......
http-192.168.1.55-8443-1, SEND SSLv3 ALERT:  fatal, description = handshake_failure
http-192.168.1.55-8443-1, WRITE: SSLv3 Alert, length = 2
[Raw write]: length = 7
0000: 15 03 00 00 02 02 28                               ......(
http-192.168.1.55-8443-1, called closeSocket()
http-192.168.1.55-8443-1, handling exception: javax.net.ssl.SSLHandshakeException: no cipher suites in common
http-192.168.1.55-8443-1, called close()
http-192.168.1.55-8443-1, called closeInternal(true)
Finalizer, called close()
Finalizer, called closeInternal(true)
Finalizer, called close()
Finalizer, called closeInternal(true)
Finalizer, called close()
Finalizer, called closeInternal(true)

You should try a ssldump to see what happens for a successful connection from a browser, in particular what ciphers were announced by the client and which one was chosen by the server. This tool can also be used to see what the server supports.

Another possibility is the use of extensions. In SSL/TLS, the ClientHello message can contain extensions, which servers are supposed to skip when they don't understand them. Some (buggy) servers instead refuse the connection when they see extensions that they do not support.

To see exactly what the iPad sends, down to the last byte, use tcpdump or one of these nifty graphical wrappers like Wireshark. Then you may make a small program which opens a TCP connection to the server, writes a ClientHello, and see if the server responds with an alert message or a ServerHello. By trying variants, you should be able to pinpoint what exactly makes the server unhappy with what the iPad sends (diagnosis is not healing, but that's a step in the right direction). You could use TestSSLServer's source code as basis for this program.


Are there any known cases of antivirus software intentionally sending false alarms? First things first, I'm not asking this question because of any specific alarm on my PC that I suspect to be false.

It's just that from the perspective of the software industry, it would make some sense to implement false alarms every now and then, give paying users the wrong feeling that they really do need the antivirus software, and thereby keeping them paying for updates, even if there never was an actual threat on the system.

Are there any known cases of something like this happening?

I have not seen false alarms, but I have seen an excessive amount of warnings/notifications, with Avast, for example. You could receive warnings about how vulnerable you 'might' be, and how you could fix it by buying another product or an upgrade (e.g. a VPN solution or web shield), every time you go on a bank website, pull up a login form, or click yes on any "18 or older" boxes. I'm sure there is a way to turn them off, but I believe that's one way they try to make the user feel like they need this software.

So it's not really false alarms, but a lot of warnings that might get non-tech-savy people to buy a license or another solution. Not a big fan of it, but it does help with awareness to some degree.


How can malware be hidden in a non-executable file you have downloaded? For sake of example, let's say you were given an MP3 file, and you downloaded and played it? Could you get a virus from this?

I'm also interested in other types of files such as .iso, etc. (.exe files excluded)

It's possible to get infected with malware that sits in mp3s, jpgs, avis etc, but unlikely.

In order to get infected, the malicious code must be executed. So the audio, image or video player (specifically, the decompressor function which decompresses the data or the code which takes the decompressed data and plays/displays it) must be tricked into executing the data instead.
This can happen, for example if the code reserves a fixed amount of space for the data which, if well-formed, will never take up more space. But if it does, maybe because a bad person made sure it would, it can overwrite part of the memory that follows the memory reserved for the data, and sometimes that memory contains an instruction on where to find the next instructions to run after the ones currently being carried out. If the attacker can adjust this "return address" to point into his own malicious code, he wins.

If you're interested in the technical details, google "buffer overflows" and "stack smashing".

So... it's not  the audio/video file itself that's dangerous. It's the combination of the file and a specific audio/video player.If you don't watch the infected file with the target player, nothing will happen.


Can't detect hash type even if I have the password? I can't found the hash type used in a database hosted in a VM.

My hash is c39e02416d974229752c28d7fcefe6e1, and my password is "azerty123456". I noticed that the user table has a column called password_type. It hold the value "default". Also the username is "aya".

I tried to use hash-identifier to detect the hash. This is the result:

 HASH: c39e02416d974229752c28d7fcefe6e1

Possible Hashs:
[+]  MD5
[+]  Domain Cached Credentials - MD4(MD4(($pass)).(strtolower($username)))

Least Possible Hashs:
[+]  RAdmin v2.x
[+]  NTLM
[+]  MD4
[+]  MD2
[+]  MD5(HMAC)
[+]  MD4(HMAC)
[+]  MD2(HMAC)
[+]  MD5(HMAC(Wordpress))
[+]  Haval-128
[+]  Haval-128(HMAC)
[+]  RipeMD-128
[+]  RipeMD-128(HMAC)
[+]  SNEFRU-128
[+]  SNEFRU-128(HMAC)
[+]  Tiger-128
[+]  Tiger-128(HMAC)
[+]  md5($pass.$salt)
[+]  md5($salt.$pass)
[+]  md5($salt.$pass.$salt)
[+]  md5($salt.$pass.$username)
[+]  md5($salt.md5($pass))
[+]  md5($salt.md5($pass))
[+]  md5($salt.md5($pass.$salt))
[+]  md5($salt.md5($pass.$salt))
[+]  md5($salt.md5($salt.$pass))
[+]  md5($salt.md5(md5($pass).$salt))
[+]  md5($username.0.$pass)
[+]  md5($username.LF.$pass)
[+]  md5($username.md5($pass).$salt)
[+]  md5(md5($pass))
[+]  md5(md5($pass).$salt)
[+]  md5(md5($pass).md5($salt))
[+]  md5(md5($salt).$pass)
[+]  md5(md5($salt).md5($pass))
[+]  md5(md5($username.$pass).$salt)
[+]  md5(md5(md5($pass)))
[+]  md5(md5(md5(md5($pass))))
[+]  md5(md5(md5(md5(md5($pass)))))
[+]  md5(sha1($pass))
[+]  md5(sha1(md5($pass)))
[+]  md5(sha1(md5(sha1($pass))))
[+]  md5(strtoupper(md5($pass)))

I tried to generate the hash using my password "azerty123456" and salted it with either my username or the value of the password_type column, but I don't get the same hash.

There's not a lot of information to work with here, as your hash-identifier tool has already pointed out.

Things we know:

c39e02416d974229752c28d7fcefe6e1 is 16 bytes (or 128 bits). There are no modern hash functions with an output this short, so that suggests that it's likely MD5. (unless its something like SHA1 truncated to 128 bits, but who would do that??)
Your hash-identifier tool could not figure it out, which means they're doing some obfuscation; adding the username as a salt in a weird way, or using an application-wide salt, or using a MAC with an application-wide secret key, or iterating the hash some number of times, or some combination.

Unfortunately, unless you can find some more information in the database that gives you some hints (or if you can get access to the source code of the php application), then you are faced with a hard reverse-engineering problem :(


I want to be a cybersecurity professional, but it feels as if I am so far behind. What do I need to do to catch up? At the moment, I am going into my Sophomore year majoring in Cybersecurity at a state university. Overall, the learning process has felt comparatively slow with others my age. While the courses I am taking at college are teaching me many of the fundamentals of infosec, such as networking and data organization, it seems like I am missing out on the element of real-world experience that so many people my age seem to have.

For example, three years back, I met a guy at a Cybersecurity Camp who was already well versed in subjects like vulnerability testing and cryptology, or at least for his age. I had asked him how he had already acquired so much skill by just his senior year in high school, and he recommended that I go to as many "competitions" as possible. The problem is, most of these "competitions" seem to have some sort of prerequisite skillset needed for entrance.

Another example is the NSA's requirements for employment on their website. They allude to only accepting the "best and the brightest." For a summer program they offer, the description reads:

  The Cyber Summer Program (CSP) is the National Security Agency's (NSA) premier outreach effort to the very best undergraduate and graduate computer science, engineering, mathematics, network security and information assurance students in the country. Each summer we invite up to 24 exceptional students to participate in a 12-week program where they work together, and in teams, directly with NSA technical professionals on mission-critical cyber-related problems.

Where on earth do these people get the experience necessary for something like that? I understand that I have a lot more to learn in my college career, but it just feels like I am stuck in a rut compared with so many others out there.

Getting the skills in an area like this is 90% personal effort. My courses in Computer Science gave me a basis, networks, coding, databases, virtual machines, setting up simple web services etc.

Coming to security-specific approaches, we had some mentions or some tasks we had to do over some assignments (sql prepared statements, ssl certs, learn how to apply a rule in iptables, etc.). Those little things could give someone a kick-start, but becoming more than a hobbyist needs more. I needed a challenge, something to make me start thinking "how do I use all these?"

I found sites with security challenges and live machines I could attack. I tried. I was failing, googling, failing again, googling again until at some point, I found a solution! 1, 2, 3 times you learn a few tools and create a methodology. You keep on playing and expand it and learn something new all the time. And someone could say "yeah, its a ctf challenge, you don't see those things in real life". True (you usually see even worse). But it's the way to get a grasp on things, so when you join a team or a company you can have a basis to get learning even more technical stuff.

Make yourself a lab, join a few CTF sites and learn how it works.


Can antiviruses scan /var I was wondering if antiviruses could scan /var or if it was off limits i am trying to understand how antiviruses work and there impact on the file system and any limitations imposed on scanning ability

First, you must understand what /var is. It's not a different kind of file system, but a location in the Filesystem Hierarchy Standard (FHS) for storing...

  Variable files—files whose content is expected to continually change
  during normal operation of the system—such as logs, spool files, and
  temporary e-mail files.

/var
    |- log/ - System log files
    |- mail ->spool/mail/
    |- run/
    +- spool/ - for programs in which data files are stored
        |- at/
        |- cron/
        |- mail/
    |- tmp/

There's no limitations preventing an antivirus from scanning in /var, but it would not be wise to scan log files etc. On the other hand there might be several locations that could be meaningful to scan, e.g.

If the mail spool is Maildir based, it's possible to scan mail for viruses on filesystem level and take immediate action. On the other hand removing viruses from mbox based system might break something.
If there are public web sites stored in /var/www, scanning that location might prevent a web server from distributing malware.


.Net WebClient - self signed certificate I have two applications (.net) on two web-servers.
The first application will need to do a request (via WebClient) to the second and get results.

I need to ensure Encryption, data integrity, and authentication.

Let's say I create a self signed certificate. I bind it to the 2nd application and also add it to the certificate storage of my first application (and also add it on my webclient).

Will this be enough (security wise)?

In using a self-signed certificate, you essentially face the same risks as a certificate authority. Mainly, you need to make sure your private key is kept secure. This is ensured using a number of methods.

Firsty, use a HSM (hardware security module) to store your private keys and perform encryption. Your cloud hosting provider may provide this service.

Secondly, the certificate you use for TLS encryption will typically be at the third level in a certificate chain. This stackexchange page, for example has a certificate chain like this:

DigiCert Root CA (25 years before expiry)
    |
    DigiCert Server CA (15 years before expiry)
        |
        *.stackexchange.com (1 year before expiry)

This makes it easy to rotate keys, before they get leaked or cracked, without having to regularly update the certificate store. Of course, since you have control over the certificate store, you can change the certificates as often as you like without need for such a chain.

Thirdly, I once read somewhere that you should change the system time to a random value when generating the private key, since system time is used as part of the seed for random generation. The system time is 'leaked' in the valid from field of the certificate to the nearest second, causing a small loss of entropy. Though I think you'll still have plenty of entropy left over, so maybe skip this step. :)

Also, make sure you're always using the latest version of TLS.


EU-GDPR and what I need to conciser when developing a CRM hosted on a Virtual Machine I read about the new EU-General Data Protection Regulation and I know nothing about encryption. I am going to host SuiteCRM on a cloud based VM running CentOS7.

In relation to the EU-GDPR do I need to encrypt my entire hard drive? Is this enough? Do I encrypt my database as well? Is this overkill?

A person mentioned a form of encryption in which you enter a key on initalising the device. The key is stored in RAM, and they key is used to encrypt and decrypt all the info that the programs running on the VM use. They didn't mention the name of this technology but knew that I would be using CentOS7. What is this technology and would there be a massive computational overhead in using it? Would this method be sufficient to provide EU-GDPR compliance for the CRM?

Yes. You should "maintain measures to encrypt personal data" per article 32 Security of processing which states "Integrate data privacy into an information security policy". I would say that this includes in transit and storage level encryption. The tools you can use to achieve this depend on your overall technology stack.


When should I use the word hacker, cracker, or black hat? Everybody seems to have their own meaning of the word "hacker".  To some, it's the good-guy vigilante  with some non-professional characteristics.

To others, it's the aggressor, bad-guy, cracker, or black hat that exploits for personal gain (money, pride, or other motivations)

Question:

What are different meanings of these words to different audiences?  For example, what word should be used to describe the "bad guy" to:

The general public
Management / Clients
Skilled colleagues
This IT Security site

In general I'd suggest avoiding use of the word, because it's meaning in general English is completely opposite to the meaning of the original jargon word, which means that sooner or later you're going to confuse or irritate someone.

See the New Hackers Dictionary, for example, specifically sense 8.

(Warning: that's the kind of document you'll get sucked into and spend days reading the whole thing!)

In it's place, I like to use something vague like "attacker" with non-technical people, and to get very precise and say things like "threat actor" when talking to security professionals.


Sharing of Wireless Security and Encryption Settings Frequently I try to connect to various wireless networks and spend more time trying to determine the correct settings (WPA or WPA2? Personal or Enterprise? and so on) than anything else.

Why isn't this information automatically broadcast when connecting to a network for the first time?

This is pretty much status by design- if broadcast is turned off it is to reduce the number of connection attempts.

If broadcast is turned on your computer will pick these settings up automatically.


Why would Keepass2 decrease the password quality after adding another character? In Keepass2 I was typing in a password and noticed the number of bits went down. Why would this be? I was using two words and mixed them up by replacing certain letters with numbers.

I haven't reviewed keepass2 source code, but entropy calculations are very dependent on the model used.  My guess is your change, causes keepass2 to jump between different models for how its doing the underlying calculation.  Any entropy calculation for a given password is necessarily inexact if the method that generated the password is not being used.

For example a very naive way to model a given password like P@s$w0rd would be assumed to be assume this was 8 random characters chosen with from a set 96 possible printable ASCII characters, with an entropy of lg(96^8) ~ 52.7 bits -- a somewhat reasonable password (against online attacks or against a hash like bcrypt with suitable number of rounds).  Randomly choosing 8 characters from printable ASCII is as likely to produce P@s$w0rd as any other password (even ones that look random 9MD10]'e)..

However, you can really see that there's an lower-entropy way to generate this password.  It's based off a very common base word (password) -- slightly modified with on average maybe four ~4 possible mutations (4 = 2^2 so 2 bits) for each letter.  So by being one of the say 1000 most popular base-words (10-bits of entropy) plus 2 bits for each letter, so a total of about 26 bits of entropy -- which is very weak.

Therefore, some password calculators will search for recognizable patterns to discount for this effect.  They may recognize a pattern in a longer password or a password with a larger character set, that they did not recognize earlier.  E.g., they may not realize that d@s$w0rd is based off of password (with a repeating d being a rotated p and not using any capital letters) and may give it a higher score than P@s$w0rd.


Can there still be SQL injection when storing the password as a hash? Could there be any SQL injection vulnerability in the code below since it only queries the database for username and bcrypt hash?

Would the vulnerability of this code be more on the bcrypt hashing algorithm, SQL injection or both?

Also can anybody give me some tips on how to sanitize code  and explain how bcrypt's algorithm works?

    <!Doctype html>

    <title>password validation</title>

    <fieldset>
    <legend>enter password</legend>
    <form action =passval.php method = "post">

    Email:	<input type="id" name ="id" />

    Password:	<input type = "password" name="password" />

      <input type = "submit" name ="submit" value ="insert" />
       </form>
         </fieldset>

         <?php
     // connect to the server

      $conn = new mysqli('localhost', 'root', '', 'social');

      // check connection
    if(mysqli_connect_errno()) {
    exit("connection failed" . mysqli_connect_error());
     } else {
      echo "connection established";
      }

        if($_POST && isset($_POST['submit'], $_POST['password'], $_POST['id'])) {
         $pass = ($_POST["password"]);
      $id =($_POST["id"]);
      echo $pass;
    //$hash = $bcrypt->hash($pass['password']);
    $bcrypt = password_hash($pass, PASSWORD_BCRYPT, array('cost' => 12));
      $input = $pass;
      $query = "SELECT pass FROM social WHERE   email = '$id'";
       $result = $conn->query($query);

    while($row = mysqli_fetch_array($result))
    {
    //echo $row['pass'];
    //echo "
";
    echo "success";

   if (password_verify($input, $row['pass'])) {
    echo "matching pass" . header("Location: inserh.php");
   } else{
    echo "not a  mathch";
    }
    }
    }

    $conn->close();         // close the connection

Is this SQL injection?

Yes.

Why?

Let's look at what's happening here.

$query = "SELECT pass FROM social WHERE   email = '$id'";

This passes $id directly to the query. If $id is not sanitized, SQL injection will occur.

if($_POST && isset($_POST['submit'], $_POST['password'], $_POST['id'])) {
     $pass = ($_POST["password"]);
  $id =($_POST["id"]);
  echo $pass;

So we see here that $id is not sanitized when it is assigned the value of the user-supplied email address. When this $id is passed in to the query, the attacker can inject on the query.

Are there any other vulnerabilities?

Actually, the concern isn't bcrypt, but how users create passwords and interact with bcrypt. Ensure that you limit the size of passwords to 4096. Additional details here.

Secondly, currently, users can execute XSS:

echo $pass;

While this is intended for debugging purposes, take care to not leave debugging statements when you are ready to deploy your code.

Okay, but how do I fix this?

Parameterized queries.

If this is a brand new project, I would recommend using an ORM like Doctrine. It will automatically do parameterized queries for you. If that doesn't work for your needs, at minimum use PDO, which supports parameterized queries instead of mysqli which does not. You can read more here.

For more general information, OWASP is a good place to go for web application vulnerabilities: SQL Injection Prevention Cheat Sheet.


When SSL detect a replay attack? Suppose an attacker records all messages of a SSL handshake (RSA one-way), and starts a replay attack. When (after which message) can the server possibly detect the attack?

Now suppose the attacker changes strategy, and sends the first three phases (up to the session key exchange), but sends this sequence many times. Why would an attacker do this, and what would be the impact on the server?

If an attacker replays old handshake messages, the trickery will become apparent with the Finished message from the attacker, because the message previously recorded was encrypted and MACed with distinct keys, and its contents won't match either:

The derivation from the master secret (resulting from the key exchange mechanism, e.g. RSA) into symmetric encryption and MAC keys involves the client_random and server_random from the two "hello" messages; the attacker replayed one of these values (e.g. the client_random if the attacker is replaying the client messages) but the other is from the peer, and is distinct from what was recorded.
The contents of the Finished messages are a hash computed over all the previous handshake messages, including the two "hello" messages, and thus, again, one of the "randoms" has changed and the hash won't match.

Note: if the server requires certificate-based client authentication, and the attacker is replaying the client part of the exchange, then the replay will get detected earlier, at the CertificateVerify message: the recorded handshake message is a signature (by the genuine client) computed over a hash of all previous handshake messages, including, again, the two "randoms". However, SSL server who ask for client certificates are relatively rare.

An attacker who begins but never finishes handshakes is doing a Denial-of-Service attack: he makes the server allocate resources and spend CPU cycles for nothing. Typically, the attacker would send a ClientHello claiming support of only "DHE" cipher suites; then, the server must respond with a sequence of messages, including a ServerKeyExchange message which necessarily involves a newly computed signature. The CPU cost for the attacker is minimal (only the effort of opening a TCP connection and sending a few bytes) while the server must do some cryptography.

Since that kind of DoS requires doing an actual TCP connection, the attacker's IP address is revealed; also, signatures are not that expensive: a PC can do thousands of signatures per second. Therefore, SSL-based DoS are usually done by botnets.


Can Captive Portal links open browser/apps? I'm aware the risks of connecting to a public AP poses as well as how MITMish is the hotspot approach.

I wonder if there is anything in the OS layer (iOS, Android) that prohibit the execution of applications installed in the device such as browser or Facebook app inside Captive Portal.

The scenario I have in mind is some cool button that appears in the screen after user is authenticated in the hotspot that has a nifty "whatsapp://", "googlechrome://" or even URL' s that are "app-aware" like Messenger "m.me/coolPage" that open in the browser and than closes opening the Messenger application, if installed.

If there are these controls in place for this kind of attack, can they be circunvented by any means?

Thanks in advance!

In a browser can a captive portal page do everything what another page can. So the only additional danger is that you open it without clicking on it. But that's true for many pages in the modern web, everywhere is stuff loaded in invisible iframes and similar.

There were exploits to do operation system level stuff, e.g. calling costly numbers via tel:// URLs, which was possible from all websites. Modern phones only show you the dialer with the number, but at this time they started dialing automatically. Running other URL intents like whatsapp:// and similar is possible as well, but the apps providing such intents should be secure to do nothing dangerous without more user interaction.

The other less common aspect is, that apps which try to load resources before the portal is detected on the OS level (if there is such a detection) get the portal instead of their resources. Here the security is the same as in an insecure network, where someone can spoof the API endpoints and more.

So the captive portal page is just a hijacked HTTP request with the same consequences as in other hijacking scenarios.


How danger to install APk from outside google play? Sometimes becuase some packages are not available in your region google play you download the APK file and install it on your android, is there way to confirm that the installed package is orginal and not injected with trojan? How danger to your security to install package from outside the google play?

When installing apps from the Google Play Store, you're fairly safe since apps are verified by Google before being made available. Google also has a feature called Google Play Protect, which scans your device for malicious apps, including third party apps, and malicious activity.

Of course, there are a few exceptions to this rule, like the recent indicident where hundreds of malicious apps infected the Google Play Store.

When installing an app directly from the APK, there is a higher risk of the APK containing malware since you give Android permission to install any third party application. Some things to consider to make sure the APK is safe:

VirusTotal

Upload the APK to VirusTotal and scan it for issues including malware.

NViso ApkScan

Scan the APK with NViso ApkScan and get a detailed report of the file.

Decompile Java

Decompile the Java source code and examine exactly what it's doing. There's a guide on how you can do this here.

Permissions

Look at the permissions the app is asking for and determine whether they look suspicious. Here are some permissions which may raise suspicions (taken from here):

READ_CALENDAR
WRITE_CALENDAR
CAMERA
READ_CONTACTS
WRITE_CONTACTS
GET_ACCOUNTS
ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION
RECORD_AUDIO
READ_PHONE_STATE
CALL_PHONE
READ_CALL_LOG
WRITE_CALL_LOG
ADD_VOICEMAIL
USE_SIP
PROCESS_OUTGOING_CALLS
BODY_SENSORS
SEND_SMS
RECEIVE_SMS
READ_SMS
RECEIVE_WAP_PUSH
RECEIVE_MMS
READ_EXTERNAL_STORAGE
WRITE_EXTERNAL_STORAGE

See more on permissions here.

App Signature

Make sure the app signature is valid. There's already an answer on Stack Exchange which explains how to make sure the signature is valid.

Avoid Third Parties

Don't install apps from third parties at all. It's much safer to get apps from genuine sources like Google Play Store where the apps are already scanned.

Available Updates

If there is a version of the app on the Play Store, after installing the APK you can check the app on the Play Store and if there is an option to update the app due to the APK being old, this would suggest that the APK is genuine.


Pursuing a career in Malware Analysis When I was a kid, I want to become a Malware Analyst and work in a Antivirus company. At that time, I love to try out different antivirus solutions and did a research project on Computer virus/antivirus back in High school.  I'm interested in knowing how malwares got into my system and malware removal.

Today, I'm unemployed again and looking for a new career and this thought came to my mind.  I suddenly have the urge to pursue my childhood dream as a malware analyst. I don't have much computer programming job experience before (only couple of months in a game company) and my previous job was an accountant. (Not related to computer programming).

I got my computer science degree 5 years ago and currently taking some part-time courses in Software QA/Testing in College. (Because I'm also considering to change career into Software QA field)
I also know that in order to work in a security field, you must be an expert in that field first. Do you think working as a Software QA/Tester would be a good starting point for the career path as a Malware Analyst? Or it's totally unrelated?

Would appreciate if anyone can provide some guidance as to pursuing a career in malware analysis.

edit

I heard about Security+, CISSP, CISA, CEH, SSCP etc. But don't know which one is related to malware analysis.

Thanks

There's surely a lot of relationship between Software Quality and Testing and Malware analyst. The basic principals of looking into how something works, testing out it's boundaries of operation, and delving into the extent of its functions are common to both. That being said, it would also depend on the type of software you are looking for.

I know of several people who left college and went out into the 'malware' (perhaps not that specific.. but general computer protection/analysis) field straight out of college, so that is a possibility too.

If you want a leg up, look into colleges that offer Information Assurance, or Computer Forensics degrees. (Perhaps a master's program).


Would a large prime service be useful? The target users would be portable/embedded devices or resource limited code (i.e. javascript). The idea being that the devices could poll the service for validated primes and use them for encryption functions.

Probably not. If I need large prime numbers, I will want to pull them from a trusted source using a secure method. To do that, I'll either need pre-shared keys or I'll have to use something like SSL. If I'm using SSL, I'm probably consuming a fair bit of CPU...

A chicken and egg problem at the very least, and trust issues after that.


Sqlmap testing HTTP headers I was wondering whether sqlmap is able to test HTTP headers for SQL vulnerabilities. I know that if I use --level>=3 then it will automatically check for User-Agent and Referrer HTTP headers, but I would also like to check for others.

I've found the --header options, which I can use to specify the headers that will be sent in requests, but I have no idea whether sqlmap will actually test those headers. Let's say I want to add a header:

CustomHeader: testing

to the http request. I would add the --headers="CustomHeader: testing" to the sqlmap command line and then I could specifically tell sqlmap to test for the SQL vulnerabilities in CustomHeader HTTP header with the -p option, like this:

Testable parameter(s)

Switch: -p

By default sqlmap tests all GET parameters and POST parameters. When the value of --level is >= 2 it tests also HTTP Cookie header values. When this value is >= 3 it tests also HTTP User-Agent and HTTP Referer header value for SQL injections. It is however possible to manually specify a comma-separated list of parameter(s) that you want sqlmap to test. This will bypass the dependence on the value of --level too.

For instance, to test for GET parameter id and for HTTP User-Agent only, provide -p id,user-agent.

So the command could be:

-p customheader

Does anybody know how to actually test custom HTTP headers with sqlmap?

Below is a snippet of code from ./sqlmap/lib/controller.py that defines the --level behavior:

It appears custom header injection is supported (as of just a week ago - so do a git pull):

  now it's possible to do something like this:
  --user-agent="sqlmap*"
  or
  --referer="target.com*"
  or
  --headers="User-Agent:test*\nReferer:bla"
  or
  --headers="Foo:bar*"
  or (mark with asterisk character * inside request file):
  -r request.txt
  or
  ..


How can I carry out SQL insert injection when there's a select statement beforehand So here's the deal. I've been working on an SQL injection challenge and here's what comes up.
There's a registration page where you input your Username, password and confirm password. It's vulnerable to INSERT SQL injection, I'm basically trying to insert my own data and make myself and admin (admin=1). However, there is a SELECT statement before the INSERT statement that checks if the username exists in the database. The problem is, if I try inserting data with SQL injection, the SELECT statement will fail and will generate an error, and the INSERT statement will never be executed.
I've made an in-a-nutshell PHP code to show you how it works.
<?php
    $username = $_POST['username'];
    $password = md5($_POST['password']);

    $sql = mysqli_query("SELECT * FROM users WHERE username = '$username';");
    if(mysqli_num_rows($sql) > 0 || !$sql) {
        // this code will be run if the username already exists OR an SQL error in the query above.
    }
    else {
        $sql = mysqli_query("INSERT INTO users (`id`,`username`,`password`,`admin`) VALUES (NULL,'$username','$password',0);");
    }
?>

So the thing is, if I tried signing up with the username "admintest','password',1);-- " which should in theory INSERT myself into the database as an admin, here comes the problems.
The problem, is the SELECT query. Watch what happens.
SELECT * FROM users WHERE username = 'admintest','password',1);-- ';

This of course is a syntax-error, and as we saw by the code I provided above, an IF statement will confirm that the SQL query was a syntax error, and the INSERT statement will NEVER run.
In an ideal world, this should happen in the INSERT statement, which will insert me as an ADMIN.
INSERT INTO users (`id`,`username`,`password`,`admin`) VALUES (NULL,'admintest','password',1);-- ','password',0);

I've tried to work out something that doesn't generate a syntax error on the SELECT, and also INSERTs the data I want to insert. Would be appreciated if anyone could help out :)

You don't need to enter into the else branch. What do you think will happen for someone whose name is
doesntexist' UNION SELECT 1, 'Charlie','a744e1091c25babd36b50e40fb8d311a','1"

?


What identifies an entity in PGP? When a person A signs a PGP key whose uid is: "Max Anderson < max.anderson@example.com > ", so he is assuring that this key really belongs to the person whose name is Max Anderson and whose email address is max.anderson@example.com, so that all other people who trust A can later make sure as well that this key really belongs to Max Anderson.

Okay, very clear and simple so far.

But the question is, is there only one person on the earth who is called Max Anderson?

There are many Max Andersons and all are real and authentic and have signed keys on the keyservers!

So signing the key of one of the Andersons with his name and email makes sure that it belongs to Max Anderson (if we supposed that the web of trust is really trustful) but how can actually be distinguished which Anderson exactly is meant?

This is what the Web of Trust is for. You aren't supposed to identify the person based on the name (anyone can choose any name), but based on the fingerprint. The idea is that you may have met, in person, someone who themselves has met, in person, and so on. It's like the six degrees of separation, but using cryptography to establish trust. When people go to keysigning parties, or just happen to meet someone at an event, they often sign this person's keys to testify that they trust that they are really who they say they are. After all, if you meet someone in person and they tell you their fingerprint, you can be far more sure that it is legit than if you get the key off of a keyserver.

Hopefully, someone in your web of trust has met and signed a key for someone who, through any level of indirection, has met Max Anderson, leading you to trust him by proxy. This website explains this in more detail. Note however that many people do not use the web of trust and instead rely entirely on the principal of TOFU, or Trust on First Use. This provides a lesser amount of protection, but it does not require getting yourself involved in the web of trust.

So what does this look like? Let's say you and I meet at some event and we sign each other's keys. A few years ago, I met Alice at a keysigning party. Naturally, Alice also knows Bob. Bob used to work for Max Anderson's boss, so he is also in the web of trust. Through this web, even though you only know me and not Alice, Bob, or Max Anderson's boss, you still know that the public key you have is owned by the real Max Anderson. Now of course a real web of trust has redundant links (hence web), letting you know more reliably that the public key you see is the real Max Anderson's.

Here are some other questions and answers which may be enlightening:

Is it okay to sign a PGP key without an IRL meeting?
What are you saying when you sign a PGP key?
What is the web of trust?
How can I verify if a person is in my web of trust?


javascript eval() clarification I've read this article about eval security issues.

I need a clarification about this particular situations:

  For example, imagine we had a web app with a text field input that we were running eval() on. An attacker could easily run a script into your input field in order to perform a DOM Based XSS (cross site scripting) attack. This is an attack where malicious code is used to make the client-side DOM behave in an unexpected way, and therefore executes code differently within a user’s browser. This can be a route to render a malicious form into the page or redirect the user.

If i'm an attacker i could send my form with a malicious script as a value for that text field. The eval() call is in the javascript() on my browser. It isn't executed server side, how can it change internal application state?

I'm so confused :)

With XSS (no matter if DOM based or reflected or stored, and no matter if done using eval or in other ways) attacker controlled Javascript is called inside the browser of the victim within the context of the victims current session.

This script can thus interact with the server through the browser the same way the user could interact with the server through the browser: fill in fields, press buttons, click links ... . While this directly only changes the state of the application on the client side it typically results also in requests from the browser to the server, which then change the application state server side.

While this kind of activity might be visible to the victim an attacker could also do it within some hidden iframe, in which case the state still gets changed (iframe shares the session) but is not that obvious to the victim.


Why is the term "nation state" used to refer to a government-sponsored effort in infosec, and is it accurate? I work in infosec and as such, have read many whitepapers and been to many conference talks. I hear all the time, especially in conversation and literature about malware, the term "nation state" used to refer to a government entity or government-sponsored activity. The term "state actor" is also used.

My question is, why? According to Wikipedia:

  A nation state is a state in which a great majority shares the same culture and is conscious of it. The nation state is an ideal in which cultural boundaries match up with political boundaries.1 According to one definition, "a nation state is a sovereign state of which most of its subjects are united also by factors which defined a nation such as language or common descent." It is a more precise concept than "country", since a country does not need to have a predominant ethnic group.

According to Merriam-Webster, the definition is:

  a form of political organization under which a relatively homogeneous people inhabits a sovereign state

Is there some inherent need for the government sponsor to be primarily of one ethnic background in infosec literature? I just don't understand why this term in particular is so frequently used, when there are many forms of states, such as a federated state, multinational state, or even more general terms such as "government" or "country," all of whom would likely be capable of and do participate in infosec activities.

The answer to your question is listed in the Wikipedia article and dictionary definition. Yes, most people associate a Nation State with an ethnicity, but if it is used in a general sense it is just a large group of like minded individuals:

Wikipedia:

  In a more general sense, a nation state is simply a large, politically sovereign country or administrative territory.

and as you noted the Merriam-Webster, the definition is:

  a form of political organization under which a relatively homogeneous people inhabits a sovereign state

The Merriam-Webster, defines homogeneous as:

  of the same or a similar kind or nature.

A homogeneous population could refer to ethnicity as you pointed out, but not necessarily. It could also just be people of a similar nature who share the same political views. Which is in opposition to a Country, in which its people may have diverse political ideals.

We know that the "Nation States" involved in malicious activities, have multiple actors. These actors co-ordinate in order to achieve some form of agenda. As these individuals are all attempting to ultimately achieve the same thing, we know that they must all share a common goal and hence their homogeneous nature.

I think the term Advanced Persistent Threat (APT), might be less confusing, but it is ultimately the same as a "Nation State". Using terms such as Federated State, Multinational State, Government, or Country, would be incorrect, as some APTs may not necessarily be in one central location, or sponsored by a Federation, they might be sponsored by a private equity, we don't really know.


Will "protecting" my certificate require me to enter a password every time I sign an email? I typically use my ECA certificate to sign my emails. I used to have a Symantec certificate but am now switching to an IdenTrust certificate. I am in the installation process and it is suggesting that I "protect" my certificate with a password (see screen shot below). If I do this will I have to enter a password every time I send an email?

I ended up calling their customer support and got the following answers:

The password needs to be entered the first time an email is sent signed after Outlook opens. Outlook caches the password, so that if a password is associated with the certificate then it only needs to be entered once per session. Whenever Outlook is restarted then the first email sent will require entry of the password.
Without the password a person could potentially copy the certificate off the computer and use it freely to impersonate me.


Separate Auth DB for Increased Security I'm a dev working on an app that has a monolith DB (PostgreSQL). We are using a third party provider for AUTH and MFA, but want to move MFA back into our control.  The plan was to move the encrypted MFA secrets into our monolith DB, but there was concern voiced by members of the team about storing something like an encrypted 2fa secret that could be potentially associated to a username if the DB was ever compromised.  The suggestion was to create a second DB for our MFA tokens, so that the association cannot be made between usernames and 2fa codes if one of the DB's was ever compromised.  I haven't heard of this approach being used, but I understand the logic.

I'm curious if this sounds like it actually solves a legitimate security concern (or if it's overkill), and if there are any best security practices for handling this sort of situation.

tldr: The approach you outline fails do address the actual problem, use a separate application and a secure authentication scheme.

While you are right that keeping account credential information with the rest of the lot (i.e. whatever your application actually uses when it's not authenticating users) is a bad idea (tm), the approach to just have a second database falls short to solve this problem and here's why:

The threat you are trying to mitigate is either:

compromise of the database or
compromise of the application

If (1), depending on what information is inside the database and how it's used (i.e. what the trust level of the application regarding the db is), I am quite confident that (2) will be possible to achieve.

If (2), having a separate database your application connects to will be useless at this point; the attacker has access to the applications credentials and thus access to both databases and can dump and use them, effectively as if they were a single database.

So, from that point of view, your proposed sollution seems like overkill because the cost outweighs the benefits. Yet, there are viable ways to doing this:

Authentication is petty known task for applications to do. This is the reason software exists that takes care of only that task.

The idea would be to have an abstracted web service (or the like) that only processes authentication and responds with a token that the actual application accepts (because it trusts the service to authenticate users, that's it's job).

One example of such a scheme would be OAuth2; you have one service for authentication and another one to serve your actual business needs. Hence you can abstract from sensitive data where you do not need it, only using the user handle your authentication platform provides.

This is independent of using multi factor or not, by the way; even if you're just using username/password auth, you gain benefits (for example, you do not leak all your customers credentials when the application gets exploited).


Metasploit Exim4 String Format Overflow The string format exploit affecting versions of Exim <= 4.69 cannot be used when Exim is running on port 465, considering authentication is required to relay messages through the mail server, correct?

I would be extremely reluctant to make that assumption.  Lacking strong evidence that running the vulnerable version of Exim in this way is safe, I think you should assume it is unsafe.  In particular, I have not seen any analysis of the vulnerability to support your suggested interpretation.

I have seen a statement that the vulnerability "may permit anyone who can send you email to cause code to be executed as the Exim run-time user".  If this characterization is accurate, then it sounds like merely running the server on port 465 will not be enough to protect you.  Even if the attacker doesn't have the ability to authenticate to Exim, and even if we assume that there is no way to exploit the format string vulnerability before authentication (something that I'm not aware of any evidence for), there are still many ways that an attacker could send you email.  (There are also many ways that an attacker may be able to influence one of your legitimate users into unknowingly sending an email with contents of the attacker's choosing.)  Thus, it sounds like even if you took your steps, it may still be possible to exploit the vulnerability.

Bottom line: I suggest that you stop using the vulnerable version of Exim and just patch the sucker already.

P.S. For the future, if you want better answers: I suggest you link to the vulnerability report for the particular vulnerability you are curious about in your question.


Securely tell the user his password in new WHM/Cpanel account creation? I understand it's not safe to send passwords via email but when accounts are created via WHM/Cpanel, I have to let the user know what password I created for them. How can I relay the password safely?

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

Benefits of this scheme:

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