Can we define a single immutant state of a device (modern computers at least) to derive a key from? Please be open and bear with me, I read a lot about encryption, but practiced very little.

I want to write a simple application that uses common encryption algorithms, but based on a derived key without the users choice. I know this has many drawbacks, but this is for experiment. I will point what is the most clear drawback later on.

For this, the only practical option that appears to me, is to derive the key with a deterministic function from im-mutant information (hardware state including ROM), like bios serial number for example; But also from other information if possible and with other hidden choices, to add some kind of salt, that is hard to reproduce.

Why is this ? Because it would be practical for easier encryption, if it happens that data use is only relevant to that particular state. If state changes, encrypted state is lost.

Soft state neighboring the -to be encrypted data- is also an option. For example:
data to be encrypted is a piece of Python code to hide, if this code is to be executed only when Python compiler is there, Pip is there, Pandas is there, then their targeted versions would compose the soft state of the key. If anything changes to a newer version, data would be lost forever.

Another practical option, would be paid games, the game only runs on one personal computer, it can't be decrypted elsewhere.

At the other hand, the main drawback, probably the first aim of encryption is to hide communicated date through network. This is not our case.

If this is possible, what are possible flaws ?

The question that you have to ask yourself is, why do you want to use encryption? In security, all measures are means to counter a specific threat. You did not state your threat, so it will be difficult to know what you are trying to protect yourself against.
You did however mention video games, and asked if it was possible to encrypt the game data with a machine-specific key, so that it can't simply be copied to a different system. I will base my answer off this specific threat model, but I am open to more suggestions.

Why do you want to use encryption?
Encryption should protect the confidentiality of the data you encrypt. Only those who know the key to decrypt the data should be able to read the data. Encryption is not necessarily to protect the confidentiality of data in transmission, but also at rest.
On the surface, this sounds like what you want to do. You want to encrypt your data with said key, then decrypt it once the user wants to play your game.
A whole lot of problems
Sadly, this idea will lead to many problems, and probably will not give you any protection at all.
The gaming PC of Theseus Problem
Theseus was the mythical king and founder-hero of Athens. A little known fact about him was that he was also a passionate gamer, and loved building his own gaming PC. In fact, he was so passionate about it, that he always wanted to most powerful, up-to-date hardware.
First he upgraded his graphics card from a ψτω ΗΠ to a ψτω ΘΠ, then his CPU, hard drive, motherboard, case, PSU and more.
At some point his wife asked Theseus how many gaming PCs he has had so far, and he couldn't answer. Was it still the same gaming PC that he started with, even though it had no original parts anymore? At what point did it stop being his first PC?
While this may seem like a purely philosophical question at first, it does pose an interesting practical implication: What if your users modify their hardware somehow? What if a graphics card burns out and the user buys a new one? What if they upgrade their motherboard?
If your application behaves in a paranoid way, any any change to the hardware invalidates all their data, then people will quickly head for the hills and find a competitor. It doesn't even need to be a change in the hardware. If you read something like the BIOS as well, then any update to the system will invalidate it. Keep this in mind: Normal use of the computer could potentially invalidate the data.
Kerckhoffs's Principle
There was once a dutchman with a fancy beard, going by the name of Auguste Kerckhoffs. He was really into cryptography, and he made some principles in regards to good crypto design.
While there are six rules, only the second rule is of importance to us:

[The cryptosystem] should not require secrecy, and it should not be a problem if it falls into enemy hands.

More simply put, all should depend on the secrecy of the key. If your enemy is the user, and the secret component is some property of the PC of the user, then the enemy has access to the key as well.
As a result, the end user can, either manually or with a tool that will play chiptune music while running, read out their keys, decrypt the files, copy them over to an unauthorized system, and then encrypt them with the keys of the new system. As a result, your system fails completely.
More crypto is better!
Some may suggest to sign the encrypted data on your server before sending it to the client. The client may then be able to decrypt it, but cannot create a forged copy of the game to play on a different PC!
Well, they don't need to. Your data is already decrypted. All they have to do is use a custom executable, that does not attempt to decrypt the data, and the user can copy as much as they want.
Is there no way for this to work?
Not really. DRM, which is all this scheme is in its current form, is a complicated game of cat-and-mouse. And for good reason, more and more developers choose to remove DRM from their games after a certain time past the release.
The goal of DRM is mostly to prevent piracy in the first week of the game's launch, when people make the decision whether to buy or to pirate the game. The downside is that the games run terrible, install rootkits on the PC or otherwise make life living hell for legitimate customers.
But what about non-videogames? What about general things?
The flaws largely remain the same, and that is that users will find out which data is used as the key material, and then be able to manually decrypt their files.
Depending on how widespread your system is/will be, certain groups may release easy-to-use tools to dump those keys, or to decrypt them altogether.


John the Ripper missing formats I have an sha256 hash that I am trying to crack with John the Ripper. However, it doesn't recognize raw-sha256, raw-md5, or any hash format other than descrypt, bsdicrypt, md5crypt, bcrypt, LM, AFS, tripcode,dummy, crypt.

Can anyone tell me either how to fix my john or add the missing hash formats?

John 1.7.9 with Jumbo patch 6 has you covered. From: http://www.openwall.com/lists/john-users/2012/06/29/1

New hashes:
* IBM RACF [OpenMP]  (Dhiru)
  - thanks to Nigel Pentland (author of CRACF) and Main Framed for providing
  algorithm details, sample code, sample RACF binary database, test vectors
* sha512crypt (SHA-crypt) [OpenMP, CUDA, OpenCL]  (magnum, Lukas, Claudio)
  - previously supported in 1.7.6+ only via "generic crypt(3)" interface
* sha256crypt (SHA-crypt) [OpenMP, CUDA]  (magnum, Lukas)
  - previously supported in 1.7.6+ only via "generic crypt(3)" interface


Defeating ROP attacks in x86 Most defense techniques against ROP revolves around randomization, such as ASLR.

If I mark all regions of memory, other than the code segment, non-executable, will this defeat ROP?

No. Actually, most RoP attacks make use of existing codes (former return-into-libc-attacks). So, the RoP gadgets are snippets of existing code and have to be executable.


Trustworthy Android recovery image that allows rooting? I have an unlocked but not rooted Android device (Nexus 7 2013 WiFi "flo", legitimately unlocked using fastboot oem unlock from an x86 computer).  Neither adb root nor adb shell followed by su let me gain root or write to /system/xbin/su.  Installing F-Droid's Superuser app didn't help to gain an initial root (see https://f-droid.org/wiki/page/org.fdroid.superuser ).

fastboot works to affect the device, so I should be able to get root by flashing a recovery-boot image that lets me modify the system.  That's my goal.  But ClockworkMod's recovery images are hosted on download2.clockworkmod.com and TWRP's on techerrata.com and neither has a valid TLS certificate, nor is PGP-signed, nor even has a SHA hash shown anywhere.  I want to prevent any MITM  from getting root access to my tablet.

There's a ROM Manager app on Google Play to install these images using a GUI, but I haven't found any evidence it does anything different than downloading those same recovery images over unauthenticated HTTP.  If ROM Manager were in the F-Droid app store that'd be a modest sign of trustworthiness, but it isn't.

Maybe the source code is better?  ClockworkMod and TWRP are apparently open-source and on GitHub, which has tolerable security if they're using it right.  The build process apparently involves AOSP (Android Open Source Project), thus 8-30 GB of disk, 16 GB RAM/swap(?!) and a lot of steps (see http://source.android.com/source/building.html).  According to Replicant developers I chatted with on IRC, those "sources" themselves contain many binaries (cross-compiling toolchains and other) without systematic documentation and it takes days of human effort to actually build everything from source (unless you've already done it a lot).  In some cases builds only work on Ubuntu (apparently?).  The SDK only works as 32-bit x86 because it would be buggy if built for x86_64 (never mind other arches like ARM).  So, clearly I can't expect too much from either upstream (Google) or modders.

I think the least risky thing might be to build AOSP recovery (fewer non-security-conscious middlemen than the modded versions), from "source", downloaded via HTTPS, in a fresh VM.  Except: unmodified AOSP recovery images don't grant root, and I haven't yet found out if there's a simple way to modify the source so that they would.

Any clear instructions for even one way to get root on my device without trusting unauthenticated downloads that any MITM can modify would be lovely.

Replacing the OS with AOSP or CyanogenMod is fine if necessary and trustworthy, but as far as I can tell, I can't do that without first flashing a recovery image and/or getting root on the stock Google Android.  Chicken and egg problem.

(Posting this on security.SE rather than android.SE because y'all will understand what I want security-wise and why I might want it.  The hundreds of web pages by Android modders that I've found don't discuss my concerns at all.)

There are md5sums for twrp via techerrata I'm sure; you could download the image via different machines and compare.

Due to changes in Android 4.3 the Superuser app on F-Droid won't work. They haven't published the working version because of a silly reboot binary blob: https://github.com/koush/Superuser/issues/184. Since you have no real reason to trust f-droid.org either and since it is relatively simple, you may as well build the su/app yourself via the SDK/NDK or AOSP setup, following the recipe for the previous versions (see gitorious.org/f-droid) with the additional removal of the reboot binary beforehand (it should be as simple as that). Install via adb in recovery.

If you want to keep the current ROM the above path is best, though Google Play (now using https I think) could be used to download the Superuser app (which contains su). If you'd prefer to place your trust in another ROM, then it could be possible to create fastboot compatible images from a downloaded zip. I don't know of another way of rooting than going via recovery.


What is the technical rationale behind intermediary email servers? EFF's Survelliance Self-Defense (SSD) project has an illustration of how email over SMTP goes through intermediate mail exchange servers:

AFAIK each intermediate servers is expected to add its own Received: header to the email so at least the transit is traceable. I'm not sure how easy is to circumvent this. There seems to be plenty related terminology for Message transfer agents, like mail relay, mail server, mail exchanger, and MX host or MTA.

Observing the lack of somehow wide-spread adoption of email privacy measures like GNU Privacy Guard (GPG) with Pretty Good Privacy (PGP) despite available tutorials, it seems safe to assume that there is a significant amount of users who would be concerned about this but are simply unaware of the issue, unsuspecting any "proxy" servers.

A layman's idea of the process of sending emails could compared to that of with the web:

the domain name for the recipient's mail server's host should be resolved to an IP via DNS
a secure connection with TLS (or SSL) should be set up to that IP
the email should be sent to a server on the host on that IP

Now one may be aware that e-mail aliases or identities could be set up, for example where there are multiple domains with email addresses but only a single handler host. foo@bar.org may be handled by foo@foo.org if eg. an organization has multiple domains.

But this doesn't seem to justify transmission of the email body to every single intermediate node. It is not hard to imagine, figuratively speaking, a system where such aliases are resolved before sending the actual body. The mail server on bar.org could tell bah@sender.org that the actual host is on foo.org, before any email body is sent.

edit From a security standpoint this current system seems to be unfortunate. Albeit alternatives like BitMessage seems to exist, this question aims to find out what stands in the way securing the current email infrastructure, and to understand what lead to this system in the first place.

What is the technical or historical rationale that justifies the continuing existence of intermediary mail servers?

SMTP is a very, very old protocol, dating from the early days of the Internet when connections weren't reliable and security wasn't a major issue.  Many of the issues with SMTP (open relays, unauthenticated senders, etc.) are the result of trying to provide reliable delivery on an unreliable network where everyone knew everyone else (or at least everyone else's sysadmin).

The original rationale for intermediate servers was that if your server couldn't contact the destination server, it might be able to contact a third server who could relay the email to the destination.


Heartbleed client side attack: What can the attacker obtain? If I have got this right in my head it would be a simple enough task to combine arp spoofing on a public WiFi to redirect clients to an evil SSL server which sends malformed heartbeat requests or to set up a honeypot WiFi and use the box as a router.. not many people would notice this as most public WiFi hotspots redirect you to a login page on connection.. my question is what information can be gained from the client side attack (other than their private keys which in this usage case wouldn't be that valuable as we already have ssl strip etc..)?

Vulnerable clients are less of a problem than vulnerable servers.  The major web browsers don't use OpenSSL for security, and most non-browser clients (eg. database interfaces or email programs) are rather picky about which servers they connect to.


Is it possible to decrypt Bcrypt encryption? I do have password that has been encrypted with Bcrypt and the salt . Is it possible if I want to decrypt the password into normal text ?

bcrypt is not an encryption function, it's a password hashing function, relying on Blowfish's key scheduling, not its encryption. Hashing are mathematical one-way functions, meaning there is no* way to reverse the output string to get the input string.

*of course only Siths deal in absolutes and there are a few attacks against hashes. But none of them are "reversing" the hashing, AFAIK.


Locate server by latency it has to other servers I just thought about how one can locate a server he has administrative privileges on. My "best" idea till now is to ping a huge amount of servers and then measure the latency of the host to these servers and then calculate the hosts location like its done in a triangulation for smartphones by the authorities.

I know this wont be to accurate because routing is complex and not affectable by the host sending the request but shouldnt this give one a pretty good idea of where a host is located over a large period of thime?

Also are there any known implementations of this idea?

Given enough measurements so that you can remove variation caused by server load and network congestion, it should be possible to determine the "network location" of a system. I doubt that these measurements are accurate enough to get the geographic location, but they might be at least a start.

Other information you could use are geographical information about IP address (Geo IP), which is unfortunately very imprecise and sometimes completely wrong too (sometimes points to a different country far away). Helpful might also to detect the routers in between two systems using traceroute, i.e. not only the number of hops but which hops are shared between various systems. But and the end it is probably lots of heuristics and lots of results will be wrong.

As an interesting related article see the case of the 500-mile email.


Run docker as not sudoers I have on my ubuntu instance a group of non-sudoers ("deploy" group). In order, to enable them to use docker I have to change the permission of "/var/run/docker.sock" file to chgrp deploy /var/run/docker.sock and chmod 770 /var/run/docker.sock.

Is this approach considered as security blunder, is there any other better approach?

If you have a look at /var/run/docker.sock, you'll see that it's owned by root UID, and docker gid.

# ls -la /var/run/docker.sock
srw-rw---- 1 root docker 0 Jun  2 11:37 /var/run/docker.sock

Changing group ownership to your own group may stop docker from working properly, as it relies on the docker group for other functions.

The proper way to handle this is to add your users to the docker group. This is detailed in the post-install documentation. Note that giving a user access to docker is more or less equivalent with making that user root. If you have docker access, becoming root is extremely trivial:

  First of all, only trusted users should be allowed to control your Docker daemon. This is a direct consequence of some powerful Docker features. Specifically, Docker allows you to share a directory between the Docker host and a guest container; and it allows you to do so without limiting the access rights of the container. This means that you can start a container where the /host directory is the / directory on your host; and the container can alter your host filesystem without any restriction.


Why has Ubuntu 18.04 moved back to insecure Xorg? After reading

  Xorg becomes the default display server again

and considering the security risk of xorg, I am wondering why the developers left Wayland. The fact that a few programs do not work on Wayland does not justify such a security risk. Any low permission program will have your password and they can enjoy it.

Does any body know why Wayland or any other alternative could not continue with Ubuntu and why this risk is tolerated?

They are doing this because the next release is an LTS release, which means stability is the primary concern. Xorg has a good track record of stability, whereas Wayland is still (relatively) new. This decision is not permanent and does not mean Ubuntu has given up on using Wayland, just that it has delayed it. You can also opt to use Wayland instead of Xorg if you would like.
From Ubuntu Insights, the three primary reasons for using Xorg by default are:

Screen sharing in software like WebRTC services, Google Hangouts, Skype, etc works well under Xorg.

Remote Desktop control for example RDP & VNC works well under Xorg.

Recoverability from Shell crashes is less dramatic under Xorg.

You will still be able to use Wayland and it is still pre-installed:

The Wayland session will still be available, pre-installed, for people to use, but for our ‘out of the box’ users the Ubuntu experience needs to be stable and provide the features they have come to expect and use in daily life and Xorg is the best choice here, at least for 18.04 LTS, but for 18.10 we will re-evaluate Wayland as the default.


Secure implementation of user login Well, I created login which works pretty fine, but I'm worried about its security. For checking if user is logged in I use only this

$auth = $_COOKIE['authorization'];
header ("Cache-Control:no-cache");
if($auth !== "ok") {
    header ("Location:index.php");
    exit();
}

which is really bad I know, but I want to know what can I do to secure it even more, this is login form:

    <?php

    error_reporting(0);

    session_start();

    include("database.php");
    if(isset($_POST['login_button']))
    {

        $userName = mysqli_real_escape_string($con, $_POST['username']);
        $userPass = mysqli_real_escape_string($con, $_POST['password']);

        $hashedPass = hash('whirlpool', $userPass);

        $query = mysqli_query($con, "SELECT Ime, Lozinka, Confirmed FROM `Igraci` WHERE  `Ime` = '$userName' AND `Lozinka` = '$hashedPass' AND `Confirmed` = '1'") or die(mysqli_error());
        $row = mysqli_num_rows($query);

        if($row > 0)
        {
            setcookie("username", $_POST['username'], time()+3600*24);
            setcookie("authorization","ok");
            header( "Location:welcome.php");
            exit();
        }
        else
        {
            echo '

Podatci koje ste uneli nisu ispravni, ili vas racun nije aktiviran.

            ';

        }
    }

    if(isset($_GET['logout']))
    {
        setcookie("username", "", time()-60);
        setcookie("authorization","");
        header( "Location:index.php");
        exit(); # stop executing here
    }

    if($_COOKIE['authorization'] == "ok")
    {
        header ("Location:welcome.php");
        exit();
    }

?>

The problem with this login is that setting a username cookie with a value and setting an authorization cookie with a value of ok will log someone in. I would highly recommend reading up on PHP, sessions, and authentication.


Is my understanding about how SSL works correct? I've been reading about 2-way SSL or mutual auth recently, and here's what I've figured so far:

Mutual auth is a way for the client to authenticate itself to the server, just like the server does to client during (1-way) SSL connections. Web browsers are preloaded with the certs of well known CAs, so, when a website sends it's public key (something like a .cer file?) the browser can use the CA's certificate to figure if this received certificate is valid or not. Similarly, in 2 way SSL, the server needs to have the client's CA's certificate, or the self signed certificate using which the client's certificate was generated to confirm if the client is authentic or not.

Following are some specific questions about which I'm not yet clear and I'd appreciate if someone could verify my understanding:

The certificate that the server sends for 1 way SSL just contains the public key of the server right? Is this necessarily a .cer file, or something like a .cer file?
The CA certificates that the browsers come preloaded with - are they like .pfx certificates? And just having these certificates is enough for the browser to confirm if the cert received from the server is a valid one or not?
In case of self signed certs, does the server need to have the .pfx self signed certificate from which the client certificate was created?

I guess it's clear from my questions that I'm not even sure when the public key and when the private is key is used to encryption/decryption, so when you answer these questions, I'd appreciate it if you could also mention which keys are used for what purpose when a specific certificate is used.

Let's abstract from a .cer or .pfx for a moment.

What is a certificate? It is something tying public key to a name (oversimplification, but should be OK for this question). Certificate is signed by a third party (certification authority) which certifies that this public key "belongs" to this name (e.g. www.example.com).

Now, when web browser connects to a SSL site, site responds with its certificate. Web browser then verifies that certificate by checking if it is signed by a trusted root certificate (one of preloaded with the browser). If it does, browser can establish secure session using public key from the certificate (because it is now confident that public key belongs to the site it's connecting to).

In practice sites return not a single certificate, but a chain of them (site's leaf cert and one or more intermediate ones). This doesn't change the big picture much but browser now needs to verify whole chain and make sure it ends up in one of the trusted root certs (i.e. that leaf cert is signed by intermediate cert and that intermediate is signed by root cert).

As to private/public keys... Certificates do not contain any secret or private keys; they only contain entity's public key. In short, party proving its identity must possess private key corresponding to its certificate. With 1-way SSL this means that server must have private key corresponding to its certificate; with 2-way this means that that client must also have private key corresponding to its certificate. Anyone with private key corresponding to a certificate may impersonate certificate holder.

To your questions:

Certificate is a public key + name + other info; no private data in there;
Preloaded certs are exactly same as ones returned by the server (i.e. no secret data); the "magic" is that they are trusted by the system by default, so other certificates signed by those trusted certificates will also be trusted;
You're talking about client auth here? Server only needs certificate of the client that it can trust (self-signed certs might satisfy this) and client certificate must absolutely not contain client's private key.

I've tried to simplify things a bit, so they're not 100% accurate and there's a room for nitpicking :) But I hope this helps to better understand the basics.


SSL TLS renegotiation vulnerability - current situation in clients Reading about the SSL renegotiation problem CVE-2009-3555 one knows that servers supporting old type of renegotiation are vulnerable to data injection. We also have tools to test them (openssl s_client and Qualsys SSL labs).

But what's the situation with clients? After checking the https://ssltls.de site using few browsers, it would seem that the only two browsers that have fixed this problem are Firefox (since 3.5.9 and 3.6.2) and Opera (since 11.00 or 10.50?).

Browsers that are still vulnerable according to the site are:

Chrome 9.0.597.16
Chrome 12.0.742.124 (!)
Chrome 13.0.782.56 beta
Chrome 14.0.825.0 dev
Internet Explorer 9 (!)
Konqueror 4.6.3

Is this test reliable? Or is the situation really this grim?

Edit:
Is there a way to use openssl s_server to test client's vulnerability?

All current versions of the major browsers (IE/FF/Chrome) are actually patched with the fix for secure renegotiation.

The ssltls.de site has some problems it seems, as I went to it using different browsers, different network connections, and I got inconsistent results. Wireshark shows the browsers sending the extension and server replying to it, so it seems the test can be improved to better detect the extension.


Is it safe to use localstorage to store session variables and user password? I'm trying to make a web application in Java with a login/session system using com.sun.net.httpserver and as far I know, it does not have an inbuilt method to this. So, I had the following idea:

User try to login using a form in POST method.
Login success
Server generate an unique session ID string and send it to the client, than create an Hashmap with KEY = session ID and value = User object.
Client store the unique session ID, Username and Password using HTML 5 localStorage.
On each request, client send the SessionID, username and password and the server checks if everything matches.

So, here's my question: Is this method safe?

No, this is not safe and I would certainly not recommend it. However, several methods exist that fulfill your requirements (and more).

I suggest having a look at OAuth 2.0. OAuth secured services require a valid access token in the Authorization header of HTTP requests. Such a token must first be obtained from an identity provider, usually a 3rd server.

This eliminates the need to store the user's credentials in the client application, the browser in your case. Also, tokens have a limited validity: After a set amount of time, a new access token must be presented. OAuth has a mechanism to do that, without having to request the user's credentials again: When an access token is requested, a refresh token is included in the response. The refresh token has a longer validity and can be used to obtain a new access token.


MIT Kerberos: getting keytabs onto hosts securely When setting up a host (... or updating its keytab if it needs new entries), what's the standard way to set up keytabs?
Looks like the MIT Kerberos docs themselves recommend using ktadmin on the host itself (... sadly, I can't find the exact page anymore to link though). However... I'd presume this involves getting an admin-level ticket onto the new host (... e.g. by logging in using an admin password).
That is, if the host has been compromised, the attacker now has admin powers.
Alternatively, you could create the keytab somewhere else (e.g. on the KDC or your own, secure-enough machine) and copy it over to the new host. However, scp won't work if root ssh is disabled on the target; you can either copy it over to an unprivileged user's home (... an user account that's hopefully not used for anything else?), and make another copy as sudo root...
... or my personal solution is exporting a keytab, base64-ing it, and then running base64 -d | sudo tee /etc/krb5.keytab on the target. Which... works, but I presume there are more elegant solutions to this?
Or is "keylogger on host" a risk that everyone just accepts?

A keytab is the password derived into a key. That key is what allows you to authenticate to the KDC. As such, if the host itself is compromised it doesn't really matter if they saw the password or got the keytab. It's all the same to an attacker.
You also don't need admin credentials to generate a keytab. You only need the user's credential itself. That limits the attack to just that one account.


Site constantly getting infected I am the webmaster of some websites running Typo3, 2 of which are getting infected constantly. These 2 sites are being owned by the same client.

Something happens on those 2 sites that causes literally all *.php files to be infected by some code. It gets inserted at the bottom. Luckily the infection doesn't do much because I have php short-tags disabled and the infection depends on it (it uses short tags to execute it's code).

Now my question is: How is it possible that those sites are getting infected the whole time? I have made sure the client's computer is clean (he eventually did a full format 'n reinstall) and my own computer is clean too (absolutely).

What steps can I take to see how the script acted, how it came in, etc.
Keep in mind: I am not the hoster. The 2 sites are on 2 different hosters. The script infects all *.php files, then leaves no further traces (no executables, no scripts, nothing out of the ordinary. The only thing I noticed is that a ._htaccess file (not the .htaccess file) contains code to redirect the user based on referrer. This also won't work since the ._htaccess file never get's executed and is a demo .htaccess file for typo3).

Greetings John

You need to perform an incident response, you can hire a firm like Trustwave, but my guess if you don't have the funds for such a large investment.

Since you are using a popular open CMS system, its going to be a target of attack. It is also built upon other open source components, so those may be affected.  Of course, there are a number of other vulnerabilities that are possible given any number of third party, built-in, or home brew components. You can find a list of recent exploits and bugs at the NIST CVE database listing of Typo3 Vulns.

There are a few things that could be resulting in a massive infection that seems indiscriminate. If the permissions of the files and directories are not set correctly, or if the file and directory ownership is misconfigured this could be the first problem. There may also be some script or piece of software which is vulnerable and has the ability to execute arbitrary code, and thus can write and append any files it finds. If it has the ability to arbitrarily execute shell commands, then its easy to search for all php file and inject the code with a few lines of code.

Another possibility might be a flaw in another tool you are using, maybe a web-based management console for hosting or a helper application like phpMyAdmin or some other random code is vulnerable.

At any rate, the first place to start your investigation is by reviewing the activity logs. I'd start with your ssh access logs to determine if anyone logged in directly when you do not think you did. Next, you should look at your server access logs. If there is a flaw in some web application, they probably had to issue a command against your page. They may have googled for a certain common HTML source string in google and the target all sites they found broadly. Is so, they are probably re-running their attack every so often to reinfect you if you didn't find the hole. Look for log entries that seem to have SQL injection or XSS. This could be labor intensive process, but if you think you know the timeframe of when you got hit, that should help limit your search.

Another check is that you have removed any installation or other files they recommend you remove that could allow an attacker to reset defaults, etc. Also, be sure you are using strong, unique passwords. After an attack, I would always recommend changing your passwords as a precaution.

Lastly, there are often clues in the exploit code itself. Did they infect it to redirect to a certain site, do they have "greetz", or anything else that you may be able to google and find someone else talking about on a forum? Unless the attack is against your custom code, its likely someone else got hit in a similar way as well.


Proving download via https Suppose I download a file hxxps://example.com/somefile.txt with a client that logs everything, including short-term session keys.

Do these logs constitute sufficient proof that the given file has indeed been served by someone having a private key for example.com?

No, such logs would not prove (to a third party) that the given file was served by someone holding the private key.

TLS works in two phases:

The server makes use of its private key to prove its identity to the client and negotiate a session key.
The session key is used to encrypt and authenticate the application data.

The client and server both have access to the session key. The server's private key is not involved in the second phase at all.

So, having negotiated a genuine session key with the server and captured a genuine handshake to prove it, a malicious client could then proceed to use this session key to falsify the rest of the log and claim that the server sent it a different response.


Find Security Flaws in My Payment Page I've done some extensive research about how to secure your website from card fraud.

iFrames do a pretty good job of this, however, It can still be worked around from certain exploits.

Many payment providers have now moved away from 'Hosted Payment Pages' and typically offer iFrames as a quick drop unsecured method.

This got me thinking, how could I make a tight/secure payment page that is simple/lightweight

Below is my idea, I would like to hear of any flaws in this method. I like this simple approach as I typically work with many international developers on short contracts, the ability to separate it only my access is important here also. I'd like to remove developer access entirely from the payments page. (It will very rarely require amending)

For this example, I'll use Stripe (but any iFrame drop-in would work).

Simply Idea:

Stored in .html (Ensure nothing can be injected by the DB or exploitable server-side scripts, such as PHP).
File to only include HTML/CSS and some vanilla JS. With the exception of JS include from the payment provider. (No abundance of JS libraries that can't be easily checked for flaws also no dependency includes that could include malicious code).
Load iFrame on this page (the information is not getting posted to our site)
Retrieve payment amount from GET request in JS.
Post token (received from iFrame in JS) back to the functional website.
Host on separate AWS S3.
Enable version on the bucket for backward logs.
Ensure AWS account is protected with MFA.
Place Cloudfront with custom SSL certificate to ensure the page is protected.

I've given this much thought, and I can't understand why others have taken this simple approach to really lock down the payment process.

I am looking forward to your thoughts on how you could attack this and how I could further reduce the attack surface here.

Stored in .html (Ensure nothing can be injected by the DB or exploitable server-side scripts, such as PHP).

For this I would break everything down into modular components and work from there:

Harden your web server. An Apache Web Server Hardening Guide to get you started.
Restrict your web server directory (usually /var/www/):

# chown www-data:www-data /var/www/ -R
# chmod 555 /var/www/ -R

Most suggest using # chmod 750, and I agree, but do not give write permissions when not necessary.

Hardening your PHP client

OWASP PHP Configuration Cheat Sheet
While not comprehensive, it's a place to start.
PHP configuration hardening boils down to the same idea "If you do not need access (execute, read and/or write), do not give access"

Ensure PHP files cannot be loaded directly. E.g. the browser client cannot request example.com/login.php, but rather must go through example.com/login.html which performs an action.

One method is instructing the web server to not serve file(s) with the *.php extension.
Alternatively, it is possible to instruct PHP scripts to handle not allowing direct access. 5 Methods to Prevent Direct Access to a PHP File

Mitigating PHP inciting an SQL injection attack.

How can I prevent SQL injection in PHP?
PHP htmlspecialchars() Function

The htmlspecialchars() function converts some predefined characters to HTML entities. E.g. converts predefined escape characters before being parsed to SQL (sanitation).

Use an appropriate secure password hashing algorithm with respect to your hardware and database (hash rate per second) with a salt. Personally, for my usage, I am fond of Argon2id.

  File to only include HTML/CSS and some vanilla JS. With the exception of JS include from the payment provider. (No abundance of JS libraries that can't be easily checked for flaws also no dependency includes that could include malicious code).

Not much can be added to this, it is a good model, avoiding libraries ensures you vet the code, as you wrote everything. Although, take that with a grain of salt, Why is writing your own encryption discouraged?. I would suggest when a requirement can be achieved in either CSS or JavaScript, e.g. opt for a CSS slideshow of images or CSS hover selector, instead of using JavaScript where possible.

  Load iFrame on this page (the information is not getting posted to our site)

I cannot foresee this being a problem as you will be using HTTPS and will be using a domain owned by you. However, it would be amiss to not suggest it. Why are iframes considered dangerous and a security risk? and 3 Reasons You Should Never Use Iframes

I like the idea of loading more information on the client-side. With ProtonMail it not only increases security for the client but also reduces server resources.

  Retrieve payment amount from GET request in JS.

Why not use a POST request?

  POST is more secure than GET for a couple of reasons.

  GET parameters are passed via URL. This means that parameters are
  stored in server logs, and browser history. When using GET, it makes
  it very easy to alter the data being submitted the the server as well,
  as it is right there in the address bar to play with.

  The problem when comparing security between the two is that POST may
  deter the casual user, but will do nothing to stop someone with
  malicious intent. It is very easy to fake POST requests, and shouldn't
  be trusted outright.

  The biggest security issue with GET is not malicious intent of the
  end-user, but by a third party sending a link to the end-user. I
  cannot email you a link that will force a POST request, but I most
  certainly can send you a link with a malicious GET request. I.E: http://www.example.com/changepassword.php?newpass=Welcome123

GET vs POST which is more secure?

  Post token (received from iFrame in JS) back to the functional website.

Why? HTML supports iFrame.

  Host on separate AWS S3.

Anything Concerning AWS S3 I may make mistakes, as I am still new to this system. Merely a disclaimer!

So long as AWS S3 matches your OpSec, then this is fine. Just ensure your remote access to the server is hardened with strong passwords and 2FA where possible.

  Ensure AWS account is protected with MFA.

As discussed above, using two-factor authentication (2FA) is advisable. Although, if MFA is available enable it.

I have seen SSH botnets have an OpenSSH server with the following parameters below simultaneously enabled:

Password authentication
Public key authentication

Risk of compromise: stealing the corresponding private key.

Google Authenticator

Risk of compromise: stealing the device authenticator is stored on.

Unless it impedes usability, the stronger authentication the better.

  Place Cloudfront with custom SSL certificate to ensure the page is protected.

By custom SSL certificate I presume you are referring to issuing your own root CA with will sign the server certificate. If so, Jamie Linux has a very good article OpenSSL Certificate Authority, for configuring a public key infrastructure (PKI).

Amazon CloudFront seems like a good option for your requirements.

For deploying HTTPS on your web server consider the following parameters:

TLS 1.2 (or better)
HSTS
HSTS Preloading
RSA 2048 (or better)

Preferably if you can afford the performance impact use RSA 4096

AES-128 GCM (or better)

Again, preferably if you can afford the performance impact use AES-256

Allow (or enforce exclusively) forward secrecy (PFS)

Review your website using SSL Labs - Server Test

This is not a comprehensive review of attack vectors to produce a threat model. However, I hope it can serve to give a broader perspective. For further reading consider How do I deal with a compromised server?.


A PC constantly scans my network for IP addresses using ARP Using wireshark I have found that one PC on my network constantly scans for devices on the network using ARP, e.g. Who has 192.168.0.26? Tell 192.168.0.10

It does that approx. 2 times a second and asks for a lot of 192.168.0.x addresses where x is in the range 0 to 30.

I'm wondering what program that would do something like that?

Also I'm wondering if there could be a security problem involved.

The PC in question runs windows 7.

A lot of home networking "helper" apps, for network printers, network webcams, etc. will continuously scan the local network looking for devices. Some network appliances will too, like NAS devices, for similar reasons (looking for local printers).  Is the device doing the scanning a Windows PC with a bunch of typical desktop apps installed?  That would be the first place to look (after you simply identify which host it is doing the scanning).  It is interesting that it's focusing on 0-30 instead of the entire local subnet, though.  That sounds more like software looking for a device on a default IP to help with first-time configuration.

To get to the bottom of it, look at what happens when it does find a device (assuming you are using wireshark from inside that zone it's searching) to see, is it trying to open a specific port? A range of ports?  Does it do nothing?


User Enumeration Vulnerability while creating Google account When we create a Google account, Google tells us whether an account with specified username exists or not.

Doesn't that lead to user enumeration?

Why not let users fill other information first, pass the CAPTCHA test, and then choose the email address after passing the CAPTCHA test? Would this really frustrate users?

Email accounts are not private, so there is little risk to discover a certain address. The same thing could be accomplished by sending an email to random accounts and see what bounces back.

Email account enumeration is not the risk as much as true user enumeration is.


Event monitoring for a home network I'd like to utilise some of the free SIEM type products out there to increase the chances that I will detect attacks and compromises of any of the devices on my home network. Most of my home devices run Linux. I'm only interested in solutions that are possible without a large investment of effort (not more than ~5 hours setup time, say, and minimal manual feeding and watering).

I have the usual home network assets I'd like to protect: integrity and availability of compute resources including bandwidth (it would be good to notice I was part of a botnet); confidentiality of online account credentials; availability of stored media, etc.

Some research on this site and Google has suggested that Snort + Snorby might be an option; I also have some experience of using Splunk which is free for up to 500mb of logs per day and can be teamed up with any number of other products (I'm a bit of a Splunk fan, though I haven't used it for security purposes).

Is this viable, or are all SIEM tools designed to be ran by full time security operations professionals? If it is viable, what can I configure Snort+Snorby to detect / what apps or publicly available configs and searches should I use with Splunk?

Which of these two options is most likely to meet my goals of low setup and maintenance effort whilst still actually being useful?

I'm particularly interested in experiences from anyone* who has such a setup, but opinions based on professional experience using these tools are also more than welcome.

*if you have a setup running at home and you're also a secops person doing this for a living, please mention this fact :)

Security onion sounds like your best bet.  It will set up and IDS pretty fast.  Have it watch traffic in and out of your network and install OSSEC on your clients at your house and point them to security onion.  This website has all the information you need on the howto.
http://securityonion.blogspot.com/


Are there free online penetration testing labs that I can safely hack with my computer? I have seen the offensive security penetration testing labs; they are amazing but costly. Is there any other online virtual penetration testing lab I can SAFELY conduct penetration testing and exploitation against? I do not mean machines I can download, I mean online labs or sites.

Here are my favorites for practice:

GhostSec's pentest labs - Only VMs all hosted online.
VulnHub VMs (only downloadable VMs)
root-me.org is pretty awesome - it's got both web challenges as well as hosted VMs that you can deploy and attack.
hackthissite - name says it all, we app pentesting.
CTF365 - As you've probably figured, they have year long CTFs. It's been some time since I last used them, so I'm not sure if they've started charging for even usage.
hacking-lab
Enigma Group
Hack The Box - A competitive platform.
OverTheWire


Does split knowledge always require an implementation of dual control? Maybe I'm misunderstanding something here.

Dual Control:

  Actions taken by different operators to affect a change.

Split Knowledge:

  Information needed to affect a change is split between different
  operators.

If I have split knowledge, I must have at least 2 operators.

It follows that I must have actions take by different operators to use the information ergo dual control.

So if this is right: Can split knowledge always be considered more secure than dual control?

Not sure that "more secure" would be an accurate assessment of the two. Both of these are examples of separation of duties and both implementations require more than one administrator to perform the task. If the task requires more than one administrator does it really make it more secure if one doesn't have the knowledge to perform the other half of that task? From a corporate administration standpoint it's actually more risky to have only one person that can perform the task (all your eggs in one basket). One could argue that dual control could actually be more secure since both admins have knowledge of the task and can perform validation of the steps taken during the task and correct errors before they happen.
Once again I would say it's not so much of a "one implementation is more secure than another" as it is just different ways to enforce separation of duties.


If bruteforcing a password goes aaa, AAA, aab, AAB, etc, all the way to ZZZ, wouldn't ZZZZZZ be the most secure password? I'm only taking about security against bruteforce attacks.

I assume that most crackers start at a and go up to zzzzzzz for as long as instructed (so it could be zzzzzzzzzzz if told so in the programming), as randomly guessing, storing the list of guesses, generating a new random guess, checking it against the list of old guesses and trying if it hasn't been guessed would be inefficient. Also, ZZZZZZZZZZ is very unlikely to be in a dictionary attack.

Using that logic, wouldn't ZZZZZZZZZZ be the most secure password out of all passwords that are 10 or less characters?

The attacker is in your head. By this I mean that the attacker knows you and knows your password generation strategies. If you systematically use passwords beginning with a 'Z', then he will start his search with such passwords. (Especially since you have described this very method on a publicly readable Web site.)

You might have an edge if you choose your passwords differently from everybody else; but attackers adapt, and adapt fast. Choosing 'ZZZZZZZZZZ' as password is strong only as long as attackers try potential passwords in alphabetical order; and attackers have already stopped doing that. They first try passwords with "structure", such as ten repetitions of the same letter, because that's a kind of passwords that human users choose (then they continue with derivations from common words and names).

It is hard to outsmart attackers; it is especially hard to know how much you outsmarted attackers, because smartness is not something that is readily quantified and measured. The normal stance is to assume that the attackers knows everything about your password generation process, save the random choices within that process; this is the only way you can reliably estimate the strength of your password.

Regardless of how you choose your password, an attacker who is intent on trying all possible letter combinations can always generate these combinations in a random order, which guarantees him the theoretical average success rate of N/2 (if there are N possible passwords, he will try on average half of them before hitting the right one). There is no password generation method which can be used to prevent that.


Free space shredding I'm an avid fan of file system forensics but I'm an amateur so far. I've been reading up on NTFS forensics and I've noticed you sometimes can know if a file was on a certain volume even if it was deleted and the free space shredded with a tool. You can find it either in the USN journal (if it exists) or in the slack of an index block.

What I don't know is if any of the algorithms used for shredding are reversible. That is, if it just writes to free space random values or it just scrambles cluster by cluster whatever it finds there.

Also, is there a way to determine which algorithm was used to prove the shredding was deliberate? Is there a pattern?

Thank you, in advance, for your answers.

NTFS Meta datas

Considering ntfs, if you overwrite a block with any data, this block is irreversibly overwritten but,

NTFS hold name, size and some other information (meta data) in another place than data. So overwriting data won't hide this.
If the data written in place is totally random or zero only, origin of data won't be surely determinable.

Low level

If you do a full overwrite of your disk or partition, many times with random data, than finally with zero, your disk will seem cleen as never used..

wikipedia: Zeroisation

But if you wanna really know what's happens with a disk, you may try to use forensic hardware, like white room and magnetic force microscope to reconstruct some generation of data

wikipedia: Data remanence

SSD and flash

Warning! This kind of material work with a limited life time. this mean: each generation of data would use another physical space on flash memories!

Shredding wild just reduce life time, but won't hide anything for forensic labs!.

wikipedia: Flash memory


cookie path protection within same domain The answer to this question about how cookies are potentially vulnerable between sub-domains sparked my curiosity.

As far as I know, if a cookie is set on a sub-path of the same domain (www.example.com/dogs), then it is not accessible to any other path, unless it's a sub-folder of the path. i.e. neither www.example.com/cats nor www.example.com/ should have access to those cookies, but www.example.com/dogs/labrador would.

Reading further, I see it's possible to get the cookies from different paths:

  It is important to note that the path restriction does not protect against unauthorized reading of the cookie from a different path. It can easily be bypassed with simple DOM (for example by creating a hidden iframe element with the path of the cookie, then accessing this iframe's contentDocument.cookie property). The only way to protect cookie access is by using a different domain or subdomain, due to the same origin policy.

If that's the case, then what security (or even functionality) does the cookie-path provide? And if it can be read using an iframe, why isn't it accessible directly in javascript? Does this "restriction" actually give a false sense of security?

The cookie path doesn't provide any security (in most real-world situations).

It is important to understand that the cookie spec is ancient technology.  It dates back from the earliest days of the web.  The security model of the web has evolved since then, and become more carefully thought-out.  The security model for cookies hasn't evolved correspondingly.

As another example of impedance mismatches between the web's security model and cookies, the same-origin policy treats www.example.com:80 as a different origin from www.example.com:81, but they are treated as identical for purposes of cookies.  You can find more discussion of security oddities with cookies from Michal Zalewski.

Cookies can be read by Javascript.  While the browser may take the path into account when Javascript tries to read cookies, this is not a security feature: the path is not a security boundary, so malicious Javascript on one page can still read cookies for other paths (e.g., by opening an invisible iframe with the proper path, injecting malicious Javascript into it, and then grabbing the cookie).  The only effective security boundary is at the granularity of an origin.  As a result, the bottom line from a security perspective is: malicious Javascript on www.example.com/dogs can read a cookie whose path is www.example.com/cats.

In practice, developers typically avoid these corner cases that are left over from earlier days, or at least avoid relying upon them to provide extra security.  For instance, web developers should not rely upon the cookie-path to provide security (at best it reduces the number of cookies sent back, which could perhaps be used to reduce bandwidth in some situations).  As another example, sites these days usually avoid serving content from non-standard port numbers, since that situation is another corner case that exposes unexpected semantics.

At this point, the cookie path is mostly a vestigial remnant of earlier days.  It doesn't serve much purpose any longer, as far as I can tell, and if the cookie-path had never been introduced, today you'd probably never notice.  But browsers still need to support it, for backwards-compatibility reasons.  And so it goes, on the web.  It is best to think of the web not as a carefully designed artifact but as something that evolved over time -- and as a result, has accumulated now-useless gunk, like our appendix.


Where are some Security Policies that are actually in use? I know there are a lot of security policy samples and templates out in the web.  I'm curious to know if there are security policies that are actually in use and still published publicly.  I know they are out there so I'm inquiring here to see if anyone else has knowledge of companies or organizations that publish these policies for everyone to see.  If you know of any please provide the link and even better if you know why it's posted publicly that would perfectly satiate my curiosity in the matter.

This may be seen more as a template than a policy, but I think it's worth mentioning here.

The U.S. National Institute of Standards and Technology has a number of Special Publications (SPs) regarding the security of information systems.  These are collectively called the 800 series, as all of them have numeric designations beginning with 800.  They are used by some government organizations, and I imagine some corporations have adopted the concepts as well.

Perhaps the most significant of these (and the most relevant to this question) is NIST SP 800-53, "Recommended Security Controls for Federal Information Systems and Organizations".  As of this writing (Jan. 29, 2011), the most recent version of this document is Rev. 3 and can be downloaded as a PDF here:

http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final_updated-errata_05-01-2010.pdf

I could write a whole paper describing what this document is, how to read it, and how to use it.  Here, I think it is sufficient to say that it provides a strong foundation from which an organization can build a Security Plan for the protection of its IT systems.


How do INFOSEC competitions deal with social engineering? Whenever I read about a cybersecurity competition, I always wonder, since almost everyone involved is a security professional, can such exercises ever be realistic? One of the weakest links in any information system is the user; how can a competition simulate the effects of social engineering? Do they find a bunch of random people to act as network users? Do they add in confederates who intentionally click on everything?

I am not certain you understand the common types of security competitions. Most are specifically for security professionals, and have nothing to do with what a non-security-aware user would do.

Some examples: working out how to exploit rare or hard-to-find vulnerabilities, linking different vulnerabilities together, writing zero-days, identifying systems from limited information etc.

Simulating the effects of users randomly clicking on things is mostly irrelevant to those competitions, and is not what I would consider social engineering anyway.

That said, some competitions allow social engineering as a technique, giving you points for info/trophies gathered by non-technical means (ie lying, cheating, physically gaining access etc)


In the United States, when can someone legally search my personal laptop? (Government or private security) Unlike the United Kingdom, U.S. citizens don't have an explicit right to privacy in the Constitution. Although there are implied privacy rights within "penumbras" of the Bill of Rights this has evolved into various laws that have changed depending on the situation... it's hard to sus though and figure out.

Generally speaking,

What frequently used law does does the Government rely on to search private property?  (e.g. warrant, detainment, or arrest)
What "domains of authority" are relevant? Is it strictly hierarchical: local, state, Federal?
When can corporations,  search private equipment without violating tort laws?  (as the 14th amendment doesn't apply to them)

For a government example, despite schools having en loco parentis authority, private schools have more flexibility with the 14th amendment than state funded schools do.

For a private example, if I bring my laptop to a mall, does the mall security officer have the right to detain my equipment?  ... or search it?

Furthering the private example, from what I can tell parents are always allowed to search the property of their children.

Motivation

My need is to identify a general framework of where exceptions to privacy may exist in the interactions of Government, corporations, and private citizen, and not be an exhaustive list.

My goal is to use this with instructional material to motivate people to care about computer privacy within those contexts, because often times people either share more than necessary, or don't guard themselves appropriately without thinking of the consequences.

Probably not enough context to make any accurate determinations. But here is a shot at it.

  What frequently used law does does the Government rely on to search
  private property?

The supreme court is pretty clear on this that they require a warrant. Even with a warrant, there is some discussions that if your data (hard drive, as an example) is encrypted, you can not be compelled to provide that password. (Of course, some judge could compel you.

  What "domains of authority" are relevant? Is it strictly hierarchical:
  local, state, Federal?

Any of them.

  When can corporations, search private equipment without violating tort
  laws? (as the 14th amendment doesn't apply to them)

Often, an employee signs an employment contract that may allow them to do "anything" This is a "work-around" that is often done in Europe to get around their "tougher" privacy laws.

  For a private example, if I bring my laptop to a mall, does the mall
  security officer have the right to detain my equipment? ... or search
  it?

Perhaps. There very well be a "notice" posted that says you must comply with all the "rules" and the rules may include such searches.


Could anyone technically see my requests with TOR if the person has access to my router? I was wondering if someone could sniff the packets I send via my computer with something like Wireshark I guess even if I use TOR and the person could access the router like stated.

The communication between Tor's exit nodes and the Internet is not different from normal traffic which thing makes Tor also prone to MITM attacks. Entry nodes do not cause a problem, but exit nodes do.

To answer straight forward to your question. it depends on what you mean exactly by see my requests. In practice, by design TOR is such that locating the source of such request sthrough the network should be difficult to determine, including your typical case.

However relying on unencrypted protocols (such as sending emails using SMTP) leads to your TOR requests being able to be entirely monitored (or seen, in your own vocabulary).


Sensitive data transmission over Internet I was wondering how we should transfer our sensitive data (identity card softcopy, plaintext-password, secret documents, etc) over the internet securely, the following are a few related questions:

Is the security level of current widely used application such as WhatsApp, Telegram or Facebook Messenger sufficient for us to transfer the sensitive data? I believe this method is the most widely used by public users now.
Is the encryption feature (PGP) in email secure enough to transfer our sensitive data?

Is the security level of current widely used application such as WhatsApp, Telegram or Facebook Messenger sufficient for us to transfer the sensitive data? I believe this method is the most widely used by public users now.

Facebook Messenger and Telegram doesn't use end to end encryption by default. Your data is encrypted during transmission, but Facebook and Telegram can read your messages while it passes through its servers and they store your messages as well. Both Facebook and Telegram supports end to end encryption, but this is not default. You have to turn on Secret Conversation/Chat to enable end to end encryption. WhatsApp uses end to end encryption by default, so WhatsApp is much more secure than either in its default configuration.

However, users that wishes to use any of those services for transferring highly sensitive data need to take extra steps beyond default. In particular, in addition to enabling end to end encryption, you need to verify the other party's encryption key out of band, because otherwise you may be using an end to end encryption to talk to your adversary rather than your intended recipient. Also, Telegram have also been criticized for developing their own encryption scheme, instead of using well known secure ones. WhatsApp also has been the subject of some criticism in the way it can do transparent rekey and resend, which may leak some of your most recent messages.

Among the major encrypted instant messaging software, Signal is probably the one that's garnered the least criticism in its implementation of end to end security. WhatsApp and Facebook Messenger's end to end encryption protocol are based on Signal's protocol. All of Signals' clients and server implementations are open source, and the Signal Protocol is based on long respected cryptographic primitives. It's one of the few messaging apps that achieved perfect score on EFF's instant messaging score card.

  Is the encryption feature (PGP) in email secure enough to transfer our sensitive data?

There's no known vulnerability in the basic protocol of PGP encryption as of yet. There are from time to time implementation issues like how some features of HTML mail clients interacts badly with PGP and can thus be used to leak information (EFAIL attacks). Most of the latest mail clients have patched these issues. The base cryptography itself is still solid as far as we can tell.

As to whether it's secure enough, you will have to decide, based on the sensitivity of your data and your threat model. If your main concern is preventing leaks from common petty criminals, pretty much any of these services should be secure enough. If you're talking about targeted attacks from government agencies, especially hostile governments, then not all of the services above are sufficient, and you likely need to make changes in the rest of your online habits, not just your messaging service.


How should potential (unverified) security vulnerabilities be best reported? As an IT auditor, part of my job duties includes vendor risk assessment / conducting security due diligence.

Based on documentation obtained from the vendor, (SOC 2 report, SIG survey ) , I and several members of the team, (I am the lead of the team) have concerns that represent be potential security vulnerabilities. Specific concerns:

Uses SSL encryption - Did not mention whether this refers to the insecure SSL protocol itself, or the broader suite of technology known as SSL that includes TLS. The SSL is used for remote access by the employees of the vendor and to customer facing web - portal. In the SOC 2 report, it was described by the management of the vendor.
Logical access is removed timely upon notification of termination. - Never defined what is the SLA for timely. A specific statement such as logical access is removed within 24 hours or 3 days of termination would have been ideal. This vendor has access to sensitive company data, so no concrete SLA is concerning.

Our team is responsible for advising management on whether to continue to engage with this vendor, and our recommendation will be taken heavily considered. The definition of vulnerability I am using is from NIST as

  "Weakness in an information system, system security procedures,
  internal controls, or implementation that could be exploited or
  triggered by a threat source."

If engaging the vendor has not been fruitful, how should such potential vulnerabilities, o weaknesses in security controls, be best reported? On one hand, I do not want to mislead by reporting that the vendor is more secure than evidence suggests, but on the other hand, I do not to unnecessarily write off a vendor simply due to an unfortunate choice of words on the part of the vendor.

Is hard to answer your question, because you did not provide enough context from the report.

As for access termination, timely should comply with your internal security policy (termination of employee procedure) where a period of time is defined during which access for the former employees is being revoked. There cannot be an SLA for that.

As for SSL encryption, which part of repot does it come from? Is there a list of systems/services with enabled SSL encryption?

It seems to me that you are looking at summary of the report, which includes key findings only. You should contact your security vendor to clarify these issues, if you do not understand them or ask for a full version of the report.


How to prevent ICMP redirection produced by a man-in-the-middle How can I prevent my route to be redirected with redirecting ICMP packets from a man-in-the-middle?

I am specifically looking to avoid someone using ettercap with the -M icmp option. From man ettercap:

 icmp (MAC/IP)
                     This attack  implements  ICMP  redirection.  It  sends  a
                     spoofed  icmp  redirect  message  to the hosts in the lan
                     pretending to be a better route for internet. All connec‐
                     tions  to  internet  will  be  redirected to the attacker
                     which, in turn, will forward them to  the  real  gateway.
                     The  resulting  attack  is  a  HALF-DUPLEX mitm. Only the
                     client is redirected, since the gateway will  not  accept
                     redirect  messages  for  a directly connected network. BE
                     SURE TO NOT USE FILTERS THAT MODIFY THE  PAYLOAD  LENGTH.
                     you  can  use  a filter to modify packets, but the length
                     must be the  same  since  the  tcp  sequences  cannot  be
                     updated in both ways.
                     You  have  to pass as argument the MAC and the IP address
                     of the real gateway for the lan.
                     Obviously you have to be able to sniff all  the  traffic.
                     If  you  are on a switch you have to use a different mitm
                     attack such as arp poisoning.

To drop IGMP and ICMP:

iptables -A INPUT -p ICMP -j DROP
iptables -A OUTPUT -p ICMP -j DROP

iptables -A INPUT -p IGMP -j DROP
iptables -A OUTPUT -p IGMP -j DROP


How did my homepage get changed in IE? I have rarely used IE in the past. I just use it to test how a website looks. Today all of a sudden when I went on to open IE, it opened with a homepage that wasn't set by me. It was an address of  a pornographic site. I was really shocked to see how did that happen. We have a tight security firewall all around our computers and it has really taken me by surprise.

Do you know how somebody/some malware would get to change my homepage in IE? Normally when I visit any website, if it is malwared, or unsecure, my settings won't allow me to go there. But this has absolutely given me a shocker.

The simple answer is that any malware that exploited your computer could potentially change a browser homepage. In fact it is easier to do that than a lot of more serious exploits so this may be all it has done.

It could have been a co-worker out to cause trouble or mischief.

The problem is that aside from carrying out a bit of forensic analysis, you can't really tell out of all the possible ways this could have happened which one it actually was. Nor is it really that useful. Your browser can get to many malicious sites - many are created every minute, and if you hit one of them before your antimalware/antivirus knows about it, you can be compromised.

The downside for you is that you should consider your computer unsafe, as you don't know what else the malware has done. Time to wipe and rebuild it.

Then patch it up to date, check your firewall and Antivirus solutions, change your passwords and just chalk it up to experience.


Login on public Wi-Fi networks using HTTPS Is it safe to log in to my e-mail account with my iPad's Safari through a public Wi-Fi network (let's suppose someone is eavesdropping the traffic) provided that the e-mail provider uses HTTPS?

Your connection to the email provider is SSL encrypted (starting from your iPad, not the public access point), so this can be considered safe.


One domain using certificate of other domain I recently Googled a website e.g A.com and found B.com in search result at the top. In reality A.com should be on top as B.com doesn't have anything in common or related to A.com but Google shows it in search result at top. In fact all meta tags / keywords are not there in B.com
Now the interesting part is, when I visit B.com, browser does show me a warning. I ignore it and visit the website. Interestingly, all the content is from A.com. Even the contact form submitted is received by A.com. When I visit B.com without https original B.com is shown, whereas if I use https://B.com, then A.com is shown (browser url bar shows B.com with security warning)

1] Now I wonder why this is happening?
2] Has B.com installed A.com certificate by mistake?
3] If so, how can they get private key for that purpose?
4] Why Google is showing that website in search results?

2] Has B.com installed A.com certificate by mistake? 3] ´If so, how can they get private key for that purpose?

Probably A.com and B.com are both hosted at the same server and have the same IP address.  It is a common (mis)configuration of the server that if there is no certificate configured for B.com then it will use a certificate of another domain at the same IP address, in this case A.com. In other words: B.com does not explicitly use the certificate for A.com but it just happens to be the implicit fallback certificate on the host which serves both A.com and B.com.

  1] Now I wonder why this is happening? ... 4] Why Google is showing that website in search results?

It looks like Google's web crawler does not really care about the validity of the certificate when crawling a web site and thus https://B.com ends up to be indexed despite this configuration problem with the content of https://A.com and thus also shows up in the search results with this content. And the crawlers of Microsoft Bing and Baidu seem to ignore invalid certificates too since they also show up in the logs of a domain I explicitly serve for such tests with an invalid certificate.


Securely storing passwords in cloud I'd like to develop a password manager. I am unsure about the safest way to store the data in the cloud.

Credentials (usernames, passwords, login links) will be stored in a MySQL server. I'm planning to store credentials for each site in its own row. This data will be encrypted using the built in methods in Laravel: https://laravel.com/docs/5.5/encryption (AES-256-CBC)

The data needs to be synced between devices, and should not be accessable without decryption from the client (just like a LastPass vault is not decrypt-able by LastPass themselves).

The data needs to be decrypted when it is delivered to the device.

Before I go too far down this path, I'd like to know if someone could give me some feedback of this method, and if using the native encrypt/decrypt methods (https://laravel.com/docs/5.5/encryption) is safe enough compared to e.g. PBKDF2 SHA-256

This is not going to work. According to the docs you have to set the key in the php config. That means all users will have the same key and that key would also be stored on the server. That is not what you want.


Getting a DEP exception when trying to call SetProcessDEPException(false) I'm demonstrating an exploit for an old app.

On Windows XP SP3 32bit (EN), the address of SetProcessDEPPolicy() is usually  0x7C8622A4. I have that version of Windows (in English as well) and I've successfully built a ROP chain that brings me to exactly that place in memory with my return address to my shellcode and a 0 arguments neatly and correctly sitting on the stack.

But when trying to execute at that point I get debugged program was unable to process exception in my debbuger or a DEP exception when triggering the exploit outside of the debugger.

I'm wondering if it may be because of my patch level (I have the very latest patches). Has the address of SetProcessDEPPolicy() changed?

How can I manually find the address of that API function myself?

If the address of SetProcessDEPPolicy() hasn't changed, why am I getting an exception?

The screenshot below shows the situation where I get the exception, as far as I can tell I've got everything where it should be and should be able to disable DEP instead of getting an error. There's comments on the screenshot and you can get a better resolution by right-click->view image.

Finding functions come in two flavors:

Exported - Super easy.

In Windows use

HANDLE kernel32 = GetModuleHandle(L"kernel32");
FARPROC funcAddr = (FARPROC *) GetProcAddress(kernel32, "SetProcessDEPPolicy");

This will return the address of the function if it's exported by the module, in this case the module is kernel32.

Non-exported - Annoying

The first step is to manually find it first through some sort of reverse engineering.  This can be rough.  If you know of certain constant error types it might return you can narrow down the search to a handful of procedures.  Windows loves using constants, and they document their use in the MSDN.  Sometimes unexported functions are documented by other researchers, or if you're lucky enough to be doing this on an open source project you can look for the constants there.  But really you have to find the function through good old fashion RE.

You can take it a step further to make this easier on yourself in the future.  Find a unique byte stream to the function.  Then write your own function that can search a given image for that unique sequence, and calculate the offset to the beginning of the function.  Boom you have an address.

Of course using this dynamic searching is not guaranteed from version to version.  Maybe the compiler took a different optimization on SP1 than SP2?  The unique stream then becomes invalid.  But that's really the best option you have for unexported functions.


How to secure requests to my API from my web widget embedded in third party website Background

I'm designing a web widget for a new SaaS for embedding in a password-protected CMS.  This would allow the customer to add something like the following to all the pages in their CMS to display some information from my SaaS system:

<script src="https://www.awesome-saas.com/widget.js?userToken=xyz" id="widget"/>

When a user registers with my customer's website, my customer calls my API to retrieve a UUID for the new user in my SaaS system.  This is the user token. The unique id used in my customer's CMS is not passed in the API call. The customer CMS stores the association between user's unique id and the token provided by my system.  No personal information is stored in my system (no names, DoBs, credit card details etc).  This token generation approach ensures anonymity of the data stored in my system and ensures data residency compliance for my platform.

The CMS provides the user token to my javascript widget and the widget makes a request to my API passing the user's token to retrieve a JSON snippet to render on the page.

https://www.awesome-saas.com/getInfo?userToken=xyz

The JSON snippet that is returned does not contain any personal information in it.

All communication between the CMS, the user's browser and my API is done over SSL.
There is no sharing of user session between the CMS and my SaaS system.

Problem

  How can I secure the requests to my API originating from the javascript widget whilst making it as easy possible for my customer to integrate my service with their CMS?

Some options I have considered:

Option 1

Just passing the UUID token to my SaaS' API is good enough.  It would be extremely hard to guess and even if someone managed to do that they wouldn't know who the retrieved data related to.

Pros

makes integration easy
the responses to my API can easily be cached

Cons

could be a hard sell to customer, auditors or regulators
it's security through obscurity which feels wrong

Attack vectors

compromised browser history would reveal user token
brute force guessing could get lucky

Option 2

Get the customer CMS to encrypt all generated tokens and share their public key with us.  The encrypted token gets passed to my API, I decrypt it using the customer's public key.

Pros

ensures the token has originated from the customer CMS rather than a brute forcer
the brute forcer now has to try and guess an encrypted version of an incredibly hard to guess number

Cons

can't cache the requests to my API because the encryption on the token needs to be checked every time
more work for the customer to integrate with me i.e. code change

Attack vectors

compromised browser history would reveal encrypted user token

If the token never expires, an attacker can harvest and use the token to access your site indefinitely. Non-expiring tokens can be shared around, with LOTS of attackers using your still-valid tokens.

However, the non-expiring token presents an integration problem. Basically the customer site needs to communicate with your SaaS to obtain a currently-valid token and renew tokens as needed.

You might consider an OAuth 2 type of approach. Your OAuth 2 server hands out tokens (which expire) to the customer website. When your SaaS receives the token, your SaaS validates the token against the OAuth 2 server. If your customers are comfortable with OAuth 2 integration, that might be all you need.


How are eggs placed in memory How is an egg placed in memory before the egg hunter code executes?

If a payload is too large for the exploit buffer but an egg hunter can find the payload, is the payload also sent in smaller chunks and moved into memory before hand? If the payload is stored and done in stages, how are the memory chunks connected so that the egg hunter can find the full payload later on? I guess each payload chunk could be prefixed with the key.

How would a single payload be stored before hand though, if there isn't enough space for it to begin with?

Generally you would need to find something that will get stored to a appropriate variable in the same service to store your egg. The smaller egghunter then finds the egg you previously saved.


Does cloudflare protect against BREACH attacks? I know that enabling http compression would make a server vulnerable to the BREACH attacks. So we have disabled compression from the server side, tested and it was all good.

Then we implemented CloudFlare for the instance. We performed the SSL security scan again and found that the application is using gzip and so it is vulnerable to BREACH. From a detailed inspection we identified that the compression is enabled by CloudFlare.

Even though they claim that they have inbuilt BREACH attack prevention mechanism,folks from Security SE claims that BREACH can be exploited.

Then, in the next step, we disabled the Brotli compression offered by CloudFlare. But during testing, the scanner again detected compression. Now we are stuck. I understand that browser to CloudFlare traffic is compressed with Brotli and CloudFlare --> Server will remain uncompressed (since we have disabled gzip from the server side). Does this actually mitigate the BREACH attack issue?

If not, what recommendation do you people suggest?

Vulnerability scanners can be wrong. They often detect only the circumstances around a vulnerability, like compression, without actually testing to see if that circumstance is vulnerable. It's up to you to verify the validity of each detection presented by your scanner. To do this, you would have to launch a BREACH attack against CloudFlare. Please do not do this without clearing it with their security team first. You would be seen as a real threat if you performed penetration testing without permission. This is illegal in most jurisdictions.
This question can only be answered by their support team. In this case, you already have their answer. They have implemented a mitigation and they have verified it internally.

Cloudflare has patched all servers against these vulnerabilities. Also, the Cloudflare WAF has rules to mitigate several of these vulnerabilities including Heartbleed and ShellShock.

Close this item in your scanner as a False Positive.


Why can't the Router devices worldwide block automatically malicious packets? Maybe I am wrong but Routers should be able to see

if requests are doing many attempt of connection on same port (Brute Force/DDoS)
if requests are targeting all ports of a computer (port scanning)
and maybe more things that is easy to see as not normal internet use.

All this sort of bad Internet practice, can be temporary blocked for a minute may be by worldwide routers? (for example)
Would that be too hard to set this kind of rules without blocking normal traffic ?

I see lot of end users face those things, even people don't know anything in internet.

Why Internet Service Providers are not doing anything about this ?

We all know bots are flooding internet...

Should end user (called Newbies by lamerz) be concerned by that, and learn 30 books of security before buying a computer?

It's an uphill battle against windmills. When you block obviously malicious traffic, black hats will start using less obviously malicious traffic which achieves the same goals. New security threats and exploits are discovered every day, and keeping up with all of them is practically impossible.
There would be false-positives. Due to the complexity of possibly malicious traffic it would frequently happen that completely harmless internet activity is identified as malicious and innocent users get kicked off the net. This will cause inconvenience for the users and for the support staff of the internet service providers.
It's not free. The high-performace routers used by backbone connections are already requiring quite a lot of processing power just to do normal routing of multiple gigabytes per second. When you also want to scan all the traffic for malicious actions, it will get far more costly. Hardware appliances which can do this do exist, and they are sometimes used to protect corporate networks. But when you want to add these to all networks, someone has to pay for it. Guess who that will be.
It would slow down the internet. When you want to block malicious traffic, you need to examine it. To examine it, you need to look at it in context. That means you need to store traffic before you forward it. This increases latency which is important for applications like real-time communication or gaming.
It might violate privacy laws. In some countries providers are not even allowed to look at the traffic of their users. Even with the current data retention laws which sprout all over the world, providers are obligated to save certain information about the behavior of their customers, but the laws usually forbid them from using the information for their own purposes. Only law inforcement is allowed to look at it.


PCI-DSS for VX570 and POS on same network Have a Point-of-sale (POS) workstation and a VX570 credit card terminal connected via RS232 and both on the same network with internet connection.  No card data is transfered to the POS except for approval code.

Does the PCI scope include the VX570 and the POS workstation? Note, no cardholder data stored in POS.

Technically, all systems on the same network as the POS workstation are in scope. Any system on a network segment where cardholder data is stored, transmitted, or processed is in scope, not just the systems that actually store, process, or transmit the data.

see page 10 of the following:
https://www.pcisecuritystandards.org/documents/pci_dss_v2.pdf

The scope includes any system connected to the cardholder data environment. The cardholder data environment includes the network zones where cardholder data is stored, transmitted, or processed.


Isolating traffic between two physical networks on Ubuntu I have two network segments (call them A @ 192.168.1.x and B @ 192.168.2.x) plugged into two separate NICs (NIC-A and NIC-B).

The OS on the physical machine is standard stock Ubuntu, with nothing configured to do any bridging on routing. So it can "see" both networks, but the two networks don't have a way to talk to each other.

Devices on Network-B don't have a default gateway assigned.

Network B has no internet access, and I want to make sure that it stays segregated.

Is this sufficient to consider this solution fairly secure? Or should we consider implementing something on the OS to actually firewall these two networks?

That has certainly segregated the data and should be reasonably secure as long as nothing creates a route between the networks later on. That is not always easy to control when using a general purpose computer and OS. It would be more secure to implement the network using dedicated hardware designed for the purpose.

As you haven't specified the level of sensitivity nor the reason for wanting segregation between the networks, I don't think it is possible to say more.


Is disallowing write to USB actually an efficient way to prevent data leakage? In my organization, a group policy exists that prevents users from writing data to a USB stick. This always seemed like a bit of a pointless PITA to me, just "one of those things...". I forget about it as often as not since I can download data from my thumb drive when I need to (I only remember it again when I try to take a file home).

Recently, my responsibilities were expanded to include participation in state & federal audits and I've noticed some form of the following the bullet point is usually a highly-promoted feature when asserting compliance:

  Users cannot download sensitive data to a USB drive.

Is this actually an improvement to security on its own?

There are still a significant number of ways to extract data from the company domain (I've certainly used more than a few work-arounds simply for convenience.)

At first I thought it could maybe be argued that it prevents low-skilled, high-frequency attacks. But with the proliferation of personal fileshare tools (that may or may not need to be unblocked by company policy - e.g. a user has both a personal & corporate GitHub account) does this sort of policy still provide additional security? Or is it just a placebo for minimally literate auditors?

One of the main reasons behind the prohibition of writing data to USB drives (I had this explained to me once) is not to prevent employees from stealing sensitive information. If they wanted to do that, they would have no end of workarounds, up to printing QR codes on A4 sheets.

Rather, it is to prevent employees from saving sensitive information on USB drives in good faith, only to have those USB drives lost or stolen.

Often in such cases you'll find that it's OK to save data on specific encrypted thumb drives that can't be decrypted in case of theft or loss: e.g. biometric-lock drives(*) or encrypted file systems that will be "seen" as physical fixed hard drives instead of removable hard drives, thereby circumventing a "cannot write to removable drives" security policy.

Windows 7+ has explicit settings that enable treating BitLocked devices (possibly with corporate keys) differently from plain USB devices.

(In my case, that was Windows XP Pro SP3 some time ago, I had a USB key with a TrueCrypt volume on it, and I was allowed to take some work at home on it. I was under orders not to copy the files anywhere else and not to use the USB drive for any other purpose. This kind of precautions is clearly directed against accidental leaks, not intentional ones).

For the same reasons, some popular file sharing sites, or sites and apps that could allow file sharing, might be blocked by company firewalls. Again, not so much to stop espionage, but to prevent people from growing too careless (at least in the powers-that-be's opinion) with corporate information.

(*) Note

Biometric lock thumb drives and (especially) hard disks aren't necessarily secure - or even encrypted, or encrypted correctly. If the memory can be physically separated from the locking part (easy for most HDD enclosures, conceivable for many USB thumb drives) someone can try to read it directly, maybe just to "reclaim" the memory itself. After all, in case of failure the finder will have just lost some time. Once he or she has the hands on the readable memory, simple curiosity might be enough to take a peek and maybe even try and decrypt it before reformatting and repurposing. With luck, the device is vulnerable and just googling its make and model will allow someone to recover the necessary tools and/or knowledge.


Could the causes of CVE-2015-2502 vulnerability be common to Firefox and Chrome? On Tuesday  August 18, 2015, Microsoft published an advisory pointing out a 0-day vulnerability (CVE-2015-2502) that can be exploited by an attacker to perform a remote code execution on Internet Explorer (from version 7 to 11, even if you are running Windows 10) web browser allowing him to  gain the same user rights as the current user. The vulnerability resides in how IE handles objects.

These last days, I have been diving into this vulnerability to understand it so I landed on Understanding and Solving Internet Explorer Leak Patterns where I got quite an interesting insight on how IE object handling has always suffering from different bugs which are grouped by Microsoft  into 4 categories (Circular References, Closures, Cross-Page Leaks and Pseudo-Leaks).

Since the causes of these memory leaks are caused by the way JavaScript, DOM ... are interacting in IE, could these memories leaks be common to  Firefox and Chrome or are they specifically inherent to IE?

The CVE you provided contains a link to a tweet from Greg Linares that shows the cause of this vulnerability is a use-after-free within Internet Explorer. Use-after-free vulnerabilities happen when a program frees a chunk of memory while still holding a reference to the freed memory.

Although Firefox and Chrome both have their own Javascript implementations (spidermonkey and blink/webkit), both have been exploited using this same technique many, many, many times. Below are some of the best links I've found explaining use-after-free exploitation within Firefox, Chrome, and IE:

http://www.vupen.com/blog/20140520.Advanced_Exploitation_Firefox_UaF_Pwn2Own_2014.php
http://www.vupen.com/blog/20120625.Advanced_Exploitation_of_Mozilla_Firefox_UaF_CVE-2012-0469.php
http://garage4hackers.com/content.php?r=143-Beginners-Guide-to-Use-after-free-Exploits-IE-6-0-day-Exploit-Development
http://www.thegreycorner.com/2010/01/heap-spray-exploit-tutorial-internet.html