Is internal or external hosting more secure? I have been looking for a while to find out the number of malicious attacks that have been successful against internal vs externally hosted web and SQL solutions.

When I say internal, I mean the server and resources are provided by the company, possibly with some 3rd party apps, and mostly internally built. When I say external, I mean a SaaS or PaaS such as Amazon, Paypal payments, or Azure Web and SQL. I understand that depending on how it is hosted, you may still be responsible for some security, but let us pretend that we give the responsibility to the vendor as much as possible.

We need some numbers ammunition as to why hosting in the cloud with a proper service/vendor is more secure than trying to run everything internally. We do not want to talk about the pros and cons of anything but security. This could be a company with one or two security and network experts or none. We are not talking about big IT companies with a lot of security resources.

It is entirely true that internal hosting can be more secure, but in general we believe it is not due to the number of experts within the company and the ability to track current vulnerabilities. (i.e. why do most people buy virus scanners vs building their own.)

EDIT: Let's get this more specific. Our current concern is that the data is not sensitive and cannot really be tied to anything of importance. Also, we are stuck trying to sell external hosting to older non-IT folk who will "never go to the cloud", when we believe the local solution is not nearly strong enough. We have tried to argue specific points, but none seem to stick.

Let us take the Azure platform with a website on app services and a database one SQL vs a small IT shop, be it 1-4 total employees with no more than 1 security expert (most likely none). So a comparison of a large hosting company vs a small IT team.

I found this very interesting, I just wish I could see how they were hosted. I also know that any numbers I do find will be skewed by the lack of reporting breaches and ability to track these breaches for small companies. Think data hostage situations. http://www.informationisbeautiful.net/visualizations/worlds-biggest-data-breaches-hacks/

Everyone says it depends, and you are right, but where are the numbers to prove your depends? Whose to say that one truly isn't more secure than the other?

In a generic sense neither internal nor external hosting are inherently more or less secure on their own. Ultimately it's just a different set of trade-offs.

In both situations the amount of security controls, how they are integrated, how they are managed, and response to events could theoretically be the same regardless of location. There is a small edge for the external hosting provider in that they are likely to receive more attacks which may give them more training data for learning algorithms if they are using such algorithms in their defenses. This might make them a bit tougher or stronger in the long run.

That said, there may be many unique flaws involved with the specific ones you mentioned which may give one of those systems more weaknesses or fewer options for control implementation. Loss of access to things like NetFlow data from a switch that can be trusted when a given host has been compromised might be an example of something you may lose with some external providers. Likewise another disadvantage is that an external hosting provider will likely care less about your data than you might care about your own but even this is questionable and depends on the type of provider. I'll also point out that the current popular hosting platforms do not represent what could potentially be done if security were a companies highest priority.

A tremendous amount of security controls can be deployed on 3rd party hosting platforms. More importantly for most types of data, possibly not those involving national security issues, but pretty much everything else the level of security controls that can easily be implemented is far beyond the needs for that data. One thing to note here is that in addition to all the security hours needed to currently protect a given internally hosted platform you may need additional security hours to deal with security issues unique to the external hosting platform.

More than anything the choice becomes one of economic tradeoffs for an organization as a whole. Is it more cost-effective to host somewhere else or does the added complexity of a given platform increase the costs such that the advantages are lost. Likewise do other aspects about the platform allow a business to grow quickly ? This may be a good reason for some organizations to justify an increased expense if it helps long-term.

Ultimately it's what you make of it. External hosting means you have a business partner who in the process of outsourcing some work for you may act as the custodian of your data but you are still the data owner and responsible party for ensuring its security. This is important to note because despite any claims an external hosting provider may make the security work and responsibility for security will still be owned by your organization and ultimately your organization has to be capable of both truly understanding the risks involved and also managing these choices responsibly.

In regards to your statement:

  We need some numbers ammunition as to why hosting in the cloud with a
  proper service/vendor is more secure than trying to run everything
  internally.

What if the results show the opposite due to a massive number of small companies deploying poorly secured cloud instances simply because they are cheaper ? Since it's likely a different set of demographics for who buys these it may have very little value on evaluating which is truly a more secure option.


How do you find out if a phone is secretly sending private data to a remote server? I read a recent article on a Chinese phone manufacturer on Wall Street Journal that says:

  The rumors had begun when a user posted online in mid-July  that his
  RedMi Note smartphone was “secretly” connecting to a server in
  Beijing, although he had turned off the data backup functions. The
  server was connecting to his phone’s media storage application, so he
  believed his photos and other data were being sent to Beijing. With
  consumers already wary in general about data privacy, the allegations
  took off across the Internet

For desktop computers, if you have some knowledge on firewall, it is easy to track outbound connections by logging network packets and checking their destination IPs. But for mobile phones where installation of such intrusive software may require rooting the phone and installation of some specialized software, is there any easy way for the less technologically inclined users to find out if their phone is secretly transmitting their personal data?

An easy way? Pehaps, but it depends on your own experience with Android penetration testing or relatable systems; Linux. And what level of perinoa you're willing to advance to.

If you're command line savvy then install no-root BusyBox and run netstat -plant with auto sync off on the target device to list the ports and addresses and process IDs that it is listening and connected to. The process IDs can be further investigated by listing their symbolic links with ls -hal /proc/<PID_number>/exe ... However this will not detect all forms of malware, some are better hidden with rootkits or reverse SSH sessions that only activate if the device is in a certain state; nastier still are the ones that fork or take the ID of a legit process. For general security the app Tustable by Bluebox is fairly easy to use for scanning for known exploits on a target device but this and other scanners can really only tell you about known exploits and Bluebox will not even tell you if you're currently being exploited.

For Rooted Android (attacking/sniffing) I like InterceterNG and DSploit for intercepting traffic between another device and it's WiFi access point. However for this to work on cell phones and force all traffic through the WiFi the target should first be put into 'Airplane Mode' and then have it's WiFi turned on. Then fire up interceptor on the attacking Android device and sniff away. WireSkark helps with pcap files but if you just need IPs and packets with time stamp IntercepterNG is great on the go; it'll even try to help strip https.

For on the target device sniffing you could try RRCpacketsniffer and Android IMSI Catcher or Logging Test App all of which have their own nice user interfaces and features to explore. These are good for root but there is also NoRoot Data Firewall which may help with logging dropped packets when nothing should be hitting the network. Also if you have access to the device it is possible to setup a reverse modum USB tether via the Android USB debugging Bridge ADB and have all traffic routed to your PC that the device is plugged into; no root required but nearly the same amount of work to setup.

For Rooted mitigation of security risks on Android targets I like Xprivacy Installer because instead of blocking access to data it can feed junk to advertizing/spyware apps; causes less errors than blocking access on legit apps too. The Xposed framework also has other fun plugins for security on device that can be setup before you think you'll be a target. But is inadvisable if you think the device is already compromised because Xposed gives a lot of control of the system to the system.

If you want full insight into what data is being sent over your target device's radio then RIL the Radio Interface Layer is what you'll want to become more fimilure with here's part one of an artical that'll get you up to speed on the technical. And if you need to capture packets sent over non-WiFi networks (be first aware of legalities of frequency ranges in your area) then SDR a Software Defined Radio maybe what you need as SDR devices can act as a full base station (cell phone tower) and preform full man in the middle attacks on these frequency ranges. It is even possible to use a second Android with a USB attached SDR and some chroot magic to act as a mobile BTS. Put both (target device and SDR antina) into a box that doesn't allow other cell phones to accidentally connect (Faraday Cage) and you'll avoid breaking laws while trying to capture packets of the target. Testing if it's sending packets while on Airplane Mode is also a good sign you've a rouge process

I've tried to list these in the order of easy to harder and only link to information that is a bit harder to find when diving into Android's networking capabilities. Unfortunately the very base of Android's networking has propiotery drivers so for now there will always be a bit of mystery as to what goes on and what vulnerabilities are available. Additionally if the device has been compromised a sufficiently advanced attacker could clone the device's ID (ESN/IMEI/SIM numbers) such that even when the target has switched off or doesn't have network access the cloned device receives the calls and text instead; when the target device is on it's more of a coin-flip's chance on which'll get rung first...

Edit/Updates bellow

On the defencive train of thought:

After doing a bit more testing on my Android devices of apps to restrict network access (fancy GUI'es for iptables) the best one so far is
afwall the source is on github and the interface is easy enough to use with little to no knowlage of iptables. Better still is that the backed up rules can be used as a good study guide for how to effectively use iptables chains and logging features. Though this does not help if the device has already been compermized (nothing can be trusted if it has) from the more devious forms of mobile rootkits.

On the breaking things for your self train of thought;

I've also been preforming some tests using one Android device as a target and another as exploiter a sonopsis of installation and re-configuration can be found at the linked stackoverflow topic. Sufice it to say that where you to have a sufficently edcated attacker infect your device nearly anything within it's network range and anything it becomes pluged into (ie a PC for charging) could then become the next target. While the network bit is old news you may have cause to worry about USB based attacks being used to infect the PC running ADB while preforming your investigations... no knowlage of this link's trustabilaty, but, they do have a BadAndroid .zip for download as well as some documentation on how BadUSB is not a product but a feature that many devices can use to tell the system what you've just plugged in.

I've not seen it in the wield just yet but the potential to have your phone infect your PC is there and the potential to have your phone infect another's phone is also present. Tests so far shows that Metasploit is sluggish but very useable for scripted actions and having logs pushed back to the exploiting device. Some apps even work fine when ports are forwarded correctly for remote file browsing of the target's file system on the Android doing the explotation; got'a love them custom mount points option in fstab. Android devices do well at attacking printers, routers and modums but not so well without backup at attacking resonably secure Linux servers or home PCs, MS-boxes though are very much at the mursy of exploits left un-patched.

When preforming your tests be carefull and consider the PC preforming the tests to be suspect. Consider setting up KVM or firejail ie something to sandbox the USB and ADB and tripwire to monitor both the jailed system and host OS on the PC. Even then you may want to have the host PC on a seperate network and monitored remotly via another device preforming packet capture and or man in the midle attacks. If you plug in your phone and the PC starts trying to make an outgoing SSH connection then you've just won a really advanced set of Malware to study; really any kind of network activity from a PC when a phone is connected should be a very bad sign unless you've setup modum tethering over USB.

News updates

  The story as I heard it was that an odd pop-up told it's user to plugin their phone to their computer and (surprise surprise) their computer isn't working so well for them anymore and their phone is still acting funny and not keeping a charge. Seeking a new phone from the store this mobile user was completely baffled and their attending service agent was at a loss for words... hopefully they where told to not plug in their new phone too their old computer when it asks to sync to it.

What was once a known but underutilized attack vector is now in the wild and being used by markers of cross platform malware. Not FUD'ing y'all just keeping readers updated to the possible threats to security when performing evidence gathering over USB.


Security implications of storing the password hash along an encrypted AES key I am using the PKCS#5 standard to generate a key using a random and unique salt and the user's password in input. Consider this key as the "encryption" key.

The "encryption" key is used to encrypt a random AES key. Each user has an AES key associated to their profile.

So, a user's profile will contains this information:

password hash for authentication purpose.
salt used in the PKCS#5 algo. (From the PKCS#5 V2.0 documentation, we know that this information needs no protection).
the encrypted AES key generated randomly and encrypted with the "encryption" key generated by the PKCS#5 algo with the salt and the user's password.

I was asking myself if it is dangerous to be in possession of the password's hash, the salt and the encrypted AES key AT THE SAME TIME. I am 99.9% sure that this is not a problem, but can it facilitate the work of an attacker being in possession of all those details?

Just to make sure I've got it - you're storing:

the hashed password - theoretically the password can't be recovered, since the hash is one way.
the salt - only half the equation for the encryption key, since you need the password in the clear as well, right?
the encrypted AES key

So... the AES key is the real payoff, presumably, because that's being used for encrypted communication or storage.

When you want the server to use the key, I'm guessing the process is this:

user gives the system his password
system checks the password, hashing it - and it's good.
system takes the password (not the hash!) and the salt and computes the encryption key
system takes encryption key and decrypts AES Key

Then the system handles the AES key appropriately, does whatever it needs to do and erases any copy of the AES key from memory so that it's not lying around in the clear anywhere.

As is, I don't see a weakness in that, but you've boiled everything down to the strength of the password.  If an attacker should get your data store, the one thing he needs but doesn't have is the password.  If a user has an easy to guess password, then the attacker will get the user's AES key.

I think it if was analyzing this system, I'd not worry too much about that - instead, I'd start poking around at how user passwords are communicated and how the AES key is handled after it's decrypted - those are weak points, too and may be easier to hack than a back end data store of hashes, salts and encrypted keys.


How to protect files (cron files) frome being executed by everyone? I wonder what read / write permissions should I set on my cron files (php files) so they can be executed only by our server.

We're using CentOS 5.9 - 64bit and cPanel / WHM + Apache.

Thanks!

Are these cron files going to be executed by root or are they going to be executed by a specific user such as apache? Normally I either log into a specific user (bob) and then run "crontab -e" to edit Bob's crontab. For these cron jobs to run, you just need to ensure that bob has execute writes to the script in question. However if these are going to be more administrative scripts for apache or root, then you may want to just put them in "/etc/crontab". From here, you can set how often the script runs and what user should run the script. Then just be sure whatever user you set to run the script has the appropriate rights to execute it. So if only root needs to run it, just chown the file to root only and you can 744 it so only root can execute the file.


Is the (SSL3-based) SSTP VPN protocol vulnerable to the POODLE attack? The Secure Socket Tunneling Protocol is a VPN protocol developed by Microsoft. It sends traffic over an SSL version 3 connection.

Since SSlv3 is vulnerable to the POODLE attack, does this mean that SSTP trafic is vulerable? This answer says that:

  The main and about only plausible scenario where [the conditions
  required for the attack] are met is a Web context

but would this include web browsing over an SSTP VPN?

I suspect that it's not realistically possible to use this exploit against SSTP.
According to that answer, the attacker needs to be able to do two things in order to be able to exploit this vulnerability:

inject data of their own before and after the secret value that he wants to obtain;
inspect, intercept and modify the resulting bytes on the wire.

The reason that the answer says:

  The main and about only plausible scenario where such conditions are
  met is a Web context: the attacker runs a fake WiFi access point, and
  injects some Javascript of their own as part of a Web page

is that you need access to the data both before and after it's encrypted. Javascript in a browser is perfect for this as you can actually form the malicious request and send it all in your own execution context.

The only way to do this in the context of SSTP would be to have some kind of compromised access to the windows machine that was trying to initiate the SSTP connection, and if you're in that situation you have far greater problems to worry about!

TL:DR The POODLE vulnerability needs some specific circumstances to be exploited, which are not provided by the standard use case of an SSTP VPN.


I'm getting lots of unfamiliar connection attempts, what do I do? I'm running Mac OS X and I have the system firewall enabled and I have stealth mode enabled.  I opened up my system console and noticed that I'm getting tons of blocked connection attempts from places I'm not familiar with.  I checked the locations of some of these addresses and some are from China and Japan.  These are just a few of them, but I've got hundreds of attempted connections.  I'm glad OS X is doing its job and blocking them, but is this something I should be worried about?  Is this normal for a home user? What's on these ports anyways?

10/7/11 12:29:47.319 PM Firewall: Stealth Mode connection attempt to TCP 192.168.1.102:49710 from 84.40.104.29:16960

10/7/11 12:29:48.078 PM Firewall: Stealth Mode connection attempt to TCP 192.168.1.102:49706 from 142.151.157.96:14082

10/7/11 12:29:52.792 PM Firewall: Stealth Mode connection attempt to TCP 192.168.1.102:49703 from 150.101.189.21:64929

10/7/11 12:29:57.067 PM Firewall: Stealth Mode connection attempt to TCP 192.168.1.102:49730 from 180.213.74.14:6002

10/7/11 12:29:59.388 PM Firewall: Stealth Mode connection attempt to TCP 192.168.1.102:49741 from 124.121.40.124:10502

Yes, it is normal background noise. Those addresses are most likely belonging to infected computers that are trying to infect more computers.

If you have too much time you can do a whois query (web frontend) and contact the service providers telling them about the infected machines.

But the best approach is to disable logging of rejected connection attempts and ignore them. They are just burying the important messages.


Can 'cracked' product keys harm the user in any way? If a user download commercial software through the official, corresponding website, but use a product key which you did not legitimately purchase (e.g. websites that offer a list of product keys for free), does that harm anything other than the company who made the piece of software?

I was wondering if the person who generated those product keys can see which user(s) have used that key and are able to harm them in any way.

In short: yes. Any software can harm you.

Legally: If the authors of the software find you are using illicit copies of their software, they are at liberty to file a civil copyright infringement claim against you. Software commonly "phones home", even in the form of checking for new updates. They may not go after you if you're a poor individual, but they love taking businesses to court, even if it bankrupts a small business.

Technically: Some authors have even put in attack code that runs if you use their software with a well-known pirated product key. This might be funny (for example, the game Crysis gives pirates a gun that shoots chickens instead of bullets) or it might be serious, like deleting all your personal files.

Morally: The software authors trust you to buy their software legally; you abuse that trust. You trust them to leave your computer unharmed when they find you using an illicit key. What if they abuse that trust? If they delete your entire hard drive when their software recognises an illicit key (regardless of phoning home -- software can have an embedded list of known pirated keys), what are you going to do about it?

Ultimately, your piracy might drive the authors to other means of making money, such as selling your personal information, which harms everybody, including licit users.

Personally, I would recommend you find free software that allows you to achieve the same aim, instead of using cracked proprietary software. Instead of cracked Windows, use Ubuntu. Instead of cracked Photoshop, use GIMP. Instead of cracked Word, use LibreOffice. Instead of cracked Maya, use Blender.


Why do some companies ask last 4 digits of my SSN or a scan of my ID? What are my risks? Yesterday I found out that some major service provider (online rentals) that I use now requires proof of my identity if I want to continue and make a booking. I was offered 2 options:

Enter last 4 digits of my social security number and answer several questions.
Scan some form of ID card (passport, driving license or other valid government ID)

I decided to give up the last 4 digits of my SSN, but I was a little bit shocked of what happened next. On the next step they started asking me questions that I did not expect them to know the answers to:

Which state did I live in 2005?
Where is XXX street (on which I lived in 2013 & 2014) located?
Etc.

Based on the questions and proposed answers it seemed like they already knew the answers to those questions. The reason why I think they already knew the answers is because I didn't live in the US in 2006-2012, and they seemed to know that I lived in the US in 2005 and then since 2013.

How did they know it? So it's so easy for a company to get this information? I don't feel comfortable!

Now I have a few questions:

Why do some companies want the last 4 digits of my SSN?
How do they supposedly use it? How do last 4 digits of SSN help check my identity? How does it work?
What can a hacker do if they somehow steal this information (my name, date of birth, address, last 4 digits of SSN)? How can this information be used against me?
Do you think they could get those personal questions and answers just based on my name, address & date of birth, or they could get that information somehow only after I entered last 4 digits of my SSN?
What can a hacker do if they somehow steal a photo of my ID?
What do you think is safer: sending last 4 digits of SSN or a photo of ID card?

I live outside the US so I'm not sure exactly how SSNs are normally used, but it sounds like they're using these details as a key to look you up in an external identity verification service.

This isn't too uncommon in relation to property rentals seeing as most physical rental agencies want scans of your ID, etc. any way.

  1) Why do some companies want last 4 digits of my SSN?

  2) How do they supposedly use it? How do last 4 digits of SSN help
  check my identity? How does it work?

It's very unlikely that anyone else has the same first and last name, plus the same last 4 digits in their SSN.

Therefore I can imagine this combination being used as a key to look up your record in an external database. Once they have your record the are asking you questions against that information to prove you are indeed that person.

  3) What can a hacker do if they somehow steal this information (my
  name, date of birth, address, last 4 digits of SSN)? How can this
  information be used against me?

To some extent it's protecting you. It wouldn't be too difficult for an attacker to obtain the information you mention, however it would be much more difficult for them to answer questions like "Which state did you live in 2005?".

Therefore if they tried to use your details to rent a property under your name (eg. to run a meth lab) they'd hopefully be prevented by not being able to answer the additional questions.

Having said that, there is of course the threat that an attacker might be able to access your records via the identity authentication service. Hopefully the identity verification service would require sufficient controls to protect your data before providing access.

It's a trade-off between convenience, protecting you against the company as a threat to your privacy, and protecting you and the company against fraudulent renters.

  4) Do you think they could get those personal questions and answers
  just based on my name, address & date of birth, or they could get that
  information somehow only after I entered last 4 digits of my SSN?

Probably, I imagine credit providers (eg. your bank) would at least have a history of your postal address and they'd be able to uniquely identify your record from this information.

From a practical standpoint, I'm not sure the specifics of how they might provide that information to an identity verification service. It seems reasonably likely it could happen though.

  5) What can a hacker do if they somehow steal a photo of my ID?

  6) What do you think is safer: sending last 4 digits of SSN or a photo
  of ID card?

There's a lot of factors to consider, but I'd say sending SSN is safer assuming there's no additional verification (ie. no extra questions) when you upload your photo ID.

The reason being is that an attacker could just resubmit your photo ID every time and pass verification. However, if they only had your SSN they'd have to answer those questions too (which hopefully change every time).


Security of iframe vs Redirection For a certain functionality, I can either
1. Redirect my user to a partner website.
2. or, Open up the partner's website in an iframe.

Supposing the partner was malicious and/or easily hacked, what are the security risks of using an iframe instead of using a redirection?

So far I see that the embedded iframe could trick the user into clicking links within it. However, this can happen if we redirect as well. Can the embedded partner hijack portions of my site from within the iframe? Are there other risks?

You should look into the HTML5 Sandbox options. While these are not supported in all browsers, they can be helpful to restrict certain actions the attacker might take, such as redirecting the user (replacing your page) rather than being contained in the iframe.

Thanks to Same Origin Policy, JavaScript and other plugins should stay fully contained within the iframe.

Obviously there is the risk of a vulnerability in the user's setup. This is more likely in a plugin than with JavaScript. However I believe the risk difference there is quite small when comparing iframe vs redirect as you are asking. I would say that redirect (or popup window) is ever-so-slightly safer.

Ideally, you only allow such redirection or iframing to your Partner, and not to 'any random site'. Less-tech-savvy users are more easily tricked into downloading malware from tricky malicious sites. If you only allow a select set of sites (i.e. just partners as you say) then you are less likely to be accidentally guiding users to such tricksters.

@paj28 makes an excellent comment:

  With an iframe, the browser address bar still shows your site, so if an external site asked for a password, users would think they're telling your site the password, when in reality they're telling the external site.

This does not affect the Remember Password feature of the browser, but @paj28 is correct that users may not realize the presense of an iframe at all.

I would suggest that a header bar above the iframe be visible to clearly indicate that the visitor is on someone else's site, and to give them a convenient way to return to the safety of a page on your site.

As for redirect, while the URL bar would show the destination site (unlike iframe), it also gives the destination site full control of the site display (you can't include a header bar) so that might make it easier for them to phish the user's password, as many users rely on visual cues (i.e. an official looking header & logo) more than the URL bar.

Finally, I'd point out that well-known sites, before redirecting a user away, would provide brief announcement that it may be unsafe. I personally find such notifications annoying, but it may help from a security standpoint.


How to protect emails in a database when you don't need to send emails I have a hypothetical system where users enter their email address, and they are sent a one-time link to something or other. The system doesn't need to use the email addresses after that point, but it needs to ensure that a user doesn't perform this action twice with the same email address. To that end, I have decided to hash the email addresses just so I have a little bit less to worry about, security-wise1.

I am fully aware that a simple hash with no salt provides very little real security compared to a password hash like bcrypt, but because these are just email addresses, and not passwords, I don't think that will be much of a problem.

I have two questions:

What hashing algorithm is most secure in this context? (Specifically, without using a salt)
What other precautions can be taken to safeguard users' email addresses in the event of a data breach?

1This doesn't mean I'll be lazy on other areas. I'll obviously protect this information as if it was plaintext, but more security is probably better, right?

You could create a global salt for your application (not stored in the database, but in the code itself.) and use a rather weak hash since you're not really aiming for amazing security. For example:

$globalSalt = 'ilovebananas123';

Now, on registration it will look something like this:

$email = $_POST["email"];

$emailHash = sha1($email . $globalSalt);
// search the database for this hash.
// if no result was found, the email is unique!


Internal HTTPS recommended security practices So I'm by no means a security expert. I'm just a recently graduated software developer who is working on a contract project and I want to ensure I'm taking appropriate security measures for my client.
Essentially, my program functions as a basic HTTPS listener service. It listens for messages from an existing system, acknowledges receipt and then it does some stuff. This would all happen over a LAN. However, I don't know their network topology and who/what has access to this network. To be safe, let's assume nefarious devices could access the LAN.
The existing system can send messages both externally and internally and it also requires basic access authentication. Per the documentation:

Transmission Security will use SSL (TLS) protocols for any service communicating externally...
SSL TLS 1.2 or higher is required

Required Authentication to your service should be supplied using Basic Authentication... In the configuration of the service, a user can supply a single Username and Password. These credentials will be transmitted as a Basic Auth Header.

Since everything is internal, the documentation seems to indicate I do not need to use TLS. Would there be any security risk to not using TLS for intranetwork HTTPS? Would that open the door to man in the middle or a spoofing attack?
Further, what security "hygiene" would you recommend for this kind of setup? I.e. How often should the basic auth credentials be changed? Should the public/private keys be changed with any frequency?
Finally, I'm planning on using Python to develop this program. Are there any recommendations for reputably secure Python HTTPS packages for building out a simple server like this? Would a different language provide better, more secure choices?
Thank you!

Since everything is internal, the documentation seems to indicate I do not need to use SSL. Would there be any security risk to not using SSL for intranetwork HTTPS?

I would highly recommend to never assume anything and expect everything. I would suggest to contact the security officer or someone in charge for security. Security policies are often different between companies.
As far as is there is any security risk to not use TLS (Note: SSL is depricated), is the management of certificates in internal networks. In my experience, small to big networks have issues managing their certificates properly.
One concern is the availability, when a certificate expires a front-end machine can no longer communicate to a back-end machine for example.

Would that open the door to man in the middle or a spoofing attack?

By not using TLS internally it could be possible to perform a man in the middle attack and thus sniff specific traffic that is sent from your application to another. However, the company you work for could have accepted this risk and decided not to implement TLS on the internal network.

Further, what security "hygiene" would you recommend for this kind of setup? I.e. How often should the basic auth credentials be changed?

Personally, I would try to use TLS internally when sensitive (client) information is transmitted from one system to another.
Also, using basic authentication is something I (personally) would try to avoid because:

When using HTTP, the credentials can easily be sniffed. HTTPS would prevent this.
In each request sent to the web server, the credentials are sent. There is  no session, thus no timeout etc.
There is no 'real' logout function other than closing the web browser.

Are there any recommendations for reputably secure Python HTTPS packages for building out a simple server like this?

Perhaps not regarding Python packages but I would recommend to use a reverse proxy and not directly expose your web application to the internal network.


Security breach from contact form in Laravel 5.8.36? the most bizarre thing happened, someone fount out the smtp mail driver credentials from a Laravel project, which are stored in the .env.
The credentials are used for a contact form. The .env was in production and  the debug was set to false APP_DEBUG=false. The location of the .env was never changed so it is not a public file.
Any suggestions how can one get the credentials? I am using re captcha to prevent spam mails.
Contact controller:
public function sendMail(SendContactMailRequest $request)
    {
        $email = FormEmail::whereId($request->department)->firstOrFail();

        \Mail::send('emails.contact', [
            'name' => $request->name,
            'email' => $request->email,
            'phone' => $request->phone,
            'subject' => $request->subject,
            'form_message' => $request->message
        ], function ($message) use ($request, $email) {
            $message->from($request->email, $request->name);
            $message->to($email->email)->subject($request->subject);
        });

        return redirect()->route('contact')->with('message', __('custom-form.success-message'));
    }

there is lot of possibilities here:

you are on shared hosting ( weak one ) which had another website hacked and that lead to your files.
you have another cms on the same account ( wordpress, magento, ...etc ) that has been hacked and lead to your files.
you have SQL injection vulnerability in your code which lead to your database then your admin access then your files.
you have upload field in any contact form which is not secured and lead to upload a shell.


When do flash drives overwrite previously written data? Let's say I have a pen drive of maximum capacity 20MB. Does this mean, that after an additional 40MB of data has been written to the drive, the first 20MB of data would be completely overwritten?
Assume that it's never completely filled. At any point of time, there's always some free space (i.e., space that has been marked free), say about 2MB.

Wear leveling on modern flash drives is a very complex topic, and the big manufacturers have all devised proprietary algorithms for it, so it's hard to give a general answer, but I'll attempt to.

All modern flash drives have more flash space than is advertised to the OS.  There are sections of flash that are used just for wear-leveling and replacement of bad sectors.  These are not accessible from the operating system interface to the flash drive.
Blocks are large compared to rotating media.  It's not unusual to have erase blocks of a couple of MB in size.
Wear leveling attempts to keep the average number of writes per block the same.  Because statistical models are used in modern flash drives (expecting that files are naturally written to in a non-random fashion), this does not mean that in the short term, the number of writes per block will be the same.
Some flash controllers compress data before writing it to flash because the controller is faster than the flash.  This gives improved write speeds in benchmarks.  Especially if you were to try to erase a flash drive by writing a bunch of \0 bytes to it.

Consequently, there is no point at which it is guaranteed that a given block has been overwritten, but there is an increasing probability of it.  So how does one manage flash media properly to prevent the loss of confidential information to a determined adversary?

Encrypt data going onto removable media in a secure fashion.  Any kind of removable media should be encrypted (if permitted at all) in an enterprise dealing with sensitive data.
If you need to ensure that media that was not encrypted is destroyed beyond retrieval, physically destroy the device, including all of the flash chips inside.  I'm not aware of any forensics technique that will work on flash chips turned into multiple pieces.
If you're dealing with an SSD and not a USB flash drive, you can try to perform an ATA secure erase.  For major manufacturers, these appear to be implemented correctly.
If the flash drive needs to be reused, your next best option is to completely fill the drive with random data multiple times.  On Linux, you can use the shred utility, or dd if=/dev/urandom of=/dev/flashdrive bs=1M.  shred is nice because it can do the multiple passes for you.  Multiple passes are necessary to increase the likelihood of overwriting the sectors reserved for wear leveling.


Is ping of death attack specific to ICMP or could it also happen with other transport protocols? A Ping of Death attack is a denial-of-service (DoS) attack, in which the attacker aims to disrupt a targeted machine by sending a packet larger than the maximum allowable size, causing the target machine to freeze or crash. The original Ping of Death attack is less common today. A related attack known as an ICMP flood attack is more prevalent.Is ping of death attack specific to ICMP or could it also happen with other transport protocols?

The ping of death was caused by a bug in handling invalid packets. Such bugs are not restricted to ICMP but can happen with other protocols too. In fact, the more complex a protocol is the more likely bugs in handling unexpected data will be. For example in 2016 Cisco ASA had a critical bug in which it was possible for an attacker to execute code on the machine (CVE-2016-1287) with a malformed IKE (UDP) packet. Or in 2011 it was possible to DOS the Apache web server with a few crafted HTTP (TCP) requests (CVE-2011-3192). Other examples are the SQL Slammer worm which caused major disruptions of internet traffic in 2003 and could be triggered by a single UDP packet. And there are many more cases.


Integrity-Based Execution Intrusion Detection Systems (IDS) rely on binary signatures or known-bad-behavior of malware in order to detect threats. It has become very clear that this approach has limited success due to the fact that in most cases it will miss new threats and variants.

My question is, rather than taking the more-or-less "black listing" approach, what would be the drawbacks of taking an integrity-based approach or "white listing" safe applications and system components? The integrity auditing could easily be done through an external hyper visor that hashes the binary of a program before it's executed.

While this approach won't stop certain attacks that make use of the vulnerable program to run malicious commands, it seems to me that it would be effective in preventing a persistent foothold on a machine.

Some vendors sell systems that work like you describe. The biggest problem is lack of active cooperation from vendors; there is no reliable way to build a list of hashes of "allowed binaries" since:

What looks like "an application" from the user's point of view may be a collection of many executable files (to a large extent, that's what DLL are).
Any software update will break the hash values and require recomputing them. This is especially an issue with applications that auto-update automatically on a daily basis (as is typical of some modern Web browsers).
Some applications rely on on-the-fly generation of executable files, e.g. to optimize things with regards to the local hardware (I think Adobe Reader does that). Notice too that the .NET framework comes with a C# compiler (csc.exe) and  that compilation process can be invoked programmatically (this is what powers ASP.NET Web pages, and it is rather mainstream).

So, in practice, systems that work that way are coupled with a learning phase (where information is gathered about what files are executed by a given user on a "typical day"), explicit exceptions for corner cases, and a streamlined process by which the user may request addition of a given application to the whitelist.

Be warned that if you apply such a system, your users will hate you thoroughly, because they will feel it to be an intolerable intrusion in their private world. User hatred has its own cost, security-wise (security works much better when users are willingly collaborating), so this had better be counterbalanced by a net gain from the whitelist system.

Also, consider that malware is not necessarily a .exe or .dll file. Word macro virus are a well-known example.


Nmap scan report with all port status Is there a way to ask nmap to print the final scan report with the state of all ports tested and the reason?

For example when the scan is launched with --reason :

Nmap scan report for 127.0.0.1

Host is up, received user-set (0.000028s latency).
Scanned at 2016-03-12 17:11:53 WET for 42s
Not shown: 4093 closed ports
Reason: 3999 resets and 94 port-unreaches
PORT     STATE         SERVICE     REASON
22/tcp   open          ssh         syn-ack ttl 64
123/udp  open          ntp         udp-response ttl 64
137/udp  open|filtered netbios-ns  no-response
138/udp  open|filtered netbios-dgm no-response
1900/udp open|filtered upnp        no-response
5353/udp open|filtered zeroconf    no-response
Final times for host: srtt: 28 rttvar: 6  to: 100000

I would like to see all ports tested with their reason instead of having a condensed count of closed ports like in the output presented

Not shown: 4093 closed ports
Reason: 3999 resets and 94 port-unreaches

It could be interesting to know what probes received reset and those that received port-unreaches.

Thanks in advance.

You need to use the -d3 option to show all ports no matter what. For -d2 and lower, the formula is 25 * (v + 20 * d), where v is the number of verbose options (-v) used, and d is the number of debug options (-d) used in the command line. This gives the number of ports a state can have before being "ignored" or rolled up into the summary.


In TCP, what happens when two Data packets come in with the same sequential identifier, but different data (spoofed) I'm trying to verify an answer I posted to a recent question:

  Client A with real IP has connected ... Now, the attacker machine M sends a [data] packet [with a correct sequential identifier] spoofing the IP address of A ... Will the ACK flag/field from server S be accepted by A?

For passive attacks the answer is no. The client will not accept the Acknowledgement (from the Server) for a data packet which it did not send. (the attacker sent it instead)

However, would the connection be able to continue? The client will eventually send another Data packet with the same sequential identifier (that the attacker used) which the Server just Acknowledged.

I assume the server does not log previously acknowledged data, and would simply repeat the acknowledgement, dropping the new Data packet (on the basis of the duplicated sequential identifier) without realizing that the new data is different. Is this correct? Or, is this implementation-dependent?

OK, I'll argue that that statement is not quite right.  The statement is correct if we assume that no TCP options are being sent.  In theory, an attacker that can eavesdrop packets can inject a correctly crafted packet into the server, and confuse the connection.

In practice pretty much all TCP connections today are tuned and use window scaling.  They define a window size to receive data faster, and not need to acknowledge every packet.

Now, this is dependent on implementation but all data in a window must be kept in a buffer instead of being passed to the application because it may happen that the entire window fails to acknowledge correctly.

If an attacker M eavesdropping the connection send only a single packet to the server S with less data than the window size (most likely since windows are often a handful of megabytes), that packet data will end in the buffer with its location defined by the sequence number.

The client A now sends a packet to the server S continuing the connection, the packet contents are likely to be blindly dumped into the buffer holding the window.  And the attacker fails to confuse the connection.

The above is not strictly true either.  An ACK can be sent at any time during the collection of the packets for the window, not only when the window size is reached.  In practical terms this (most likely) means that:

The attacker M can succeed submitting a single packet to interfere with a slow moving connection (a lot of time for the server S to send ACKs).
The attacker M will have trouble to interfere with a fast paced connection where the server S decides to wait for the window to fill instead of sending ACKs.

On a fast paced connection the attacker M will need to fill the window with his data before client data arrives.  That is still feasible if the attacker M is closer to server S than client A.

References

Window Size and ACK Number - networking.SE


NMap Showing Unknown Private IPs Like this question nmap is showing unknown IPs from 192.168.2.* in my home network which has an IP range of 192.168.1.*.

Unlike the above question, every single IP appears to be completely locked down, including blocking of ping attempts. For all of the IPs (about 70 between 192.168.2.0 and 192.168.2.143), executing nmap -A -Pn results in:

PS C:\Users\Matthew> nmap -A -Pn 192.168.2.137

Starting Nmap 7.01 ( https://nmap.org ) at 2016-01-18 12:14 Central Standard Time
Nmap scan report for 192.168.2.137
Host is up (0.0021s latency).
All 1000 scanned ports on 192.168.2.137 are closed
Too many fingerprints match this host to give specific OS details
Network Distance: 1 hop

TRACEROUTE (using port 6788/tcp)
HOP RTT      ADDRESS
1   16.00 ms 192.168.2.137

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .

Based on the comment by AddisonWIlson below i executed the following.

nmap -T4 -A -v -Pn

PS C:\Users\Matthew> nmap -T4 -A -v -Pn 192.168.2.137
Starting Nmap 7.01 ( https://nmap.org ) at 2016-01-18 13:18 Central Standard Time
NSE: Loaded 132 scripts for scanning.
NSE: Script Pre-scanning.
Initiating NSE at 13:18
Completed NSE at 13:18, 0.00s elapsed
Initiating NSE at 13:18
Completed NSE at 13:18, 0.00s elapsed
Initiating Parallel DNS resolution of 1 host. at 13:18
Completed Parallel DNS resolution of 1 host. at 13:18, 0.01s elapsed
Initiating SYN Stealth Scan at 13:18
Scanning 192.168.2.137 [1000 ports]
SYN Stealth Scan Timing: About 29.55% done; ETC: 13:20 (0:01:14 remaining)
Increasing send delay for 192.168.2.137 from 0 to 5 due to 65 out of 162 dropped probes since last increase.
Completed SYN Stealth Scan at 13:19, 43.95s elapsed (1000 total ports)
Initiating Service scan at 13:19
Initiating OS detection (try #1) against 192.168.2.137
Initiating Traceroute at 13:19
Completed Traceroute at 13:19, 0.02s elapsed
Initiating Parallel DNS resolution of 1 host. at 13:19
Completed Parallel DNS resolution of 1 host. at 13:19, 5.52s elapsed
NSE: Script scanning 192.168.2.137.
Initiating NSE at 13:19
Completed NSE at 13:19, 0.00s elapsed
Initiating NSE at 13:19
Completed NSE at 13:19, 0.00s elapsed
Nmap scan report for 192.168.2.137
Host is up (0.000077s latency).
All 1000 scanned ports on 192.168.2.137 are closed
Too many fingerprints match this host to give specific OS details
Network Distance: 1 hop

TRACEROUTE (using port 4998/tcp)
HOP RTT     ADDRESS
1   0.00 ms 192.168.2.137

NSE: Script Post-scanning.
Initiating NSE at 13:19
Completed NSE at 13:19, 0.00s elapsed
Initiating NSE at 13:19
Completed NSE at 13:19, 0.00s elapsed
Read data files from: C:\Program Files (x86)\Nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 54.65 seconds
       Raw packets sent: 1828 (82.664KB) | Rcvd: 1010 (40.400KB)

Called my ISP based on the question linked above, and they said it was not their equipment.

I am new to network admin but have developed software for 20 years, so I am technically inclined. Not sure if any of the following could be the cause.

VMWare installed years ago, but never really used.
MS HyperV with a virtual switch, however everything on that switch
is 192.168.1.*

Anyone have any ideas?

Pay attention to the clues you see in the output and start eliminating possibilities.

The latency to this target is 0.000077s, or 77 microseconds. I observe my wireless gateway to have a latency of 0.013s to 0.10s, 3 to 4 orders of magnitude slower. A localhost scan shows something like what you got: 0.000065s to 0.00018s. So this IP is likely running on your own system somewhere, perhaps virtualized.

Change the state of your network and see how the target responds. Unplug your network cable and/or disconnect from your wireless network. Does the IP still respond?

How is the packet getting to the target? Examine your routing tables (netstat -rn or route -n) or ask Nmap what it is doing: nmap --route-dst 192.168.2.137. Is it using a gateway address? Do you have a 192.168.2.0/24 address configured on your system?


How do I deal with browsers complaining that my MediaWiki website has unsecure resources? I recently bought a subscription to a NameCheap shared hosting plan, and I plan to primarily run MediaWiki on it. I've managed to setup everything fine except for the SSL encryption. When I visit my website (https://www.jcwiki.website/wiki/Main_Page), my Chrome browser tells me that my website is verified by "COMODO RSA Domain Validation Secure Server CA", but it also tells me that there are "other resources that are insecure". So basically my question is, "What do I do to make Google Chrome and other web browsers say that my website is 100% secure?"

I know that the certificate is verified, but essentially, I am not sure what else to do in this situation. Perhaps someone could explain what Chrome means by "other insecure resources"?

Edit: I checked my LocalSettings.php and saw the $wgServer variable was set to https://www.jcwiki.website so I don't think it was a problem there. Good guess though!

I just did a small audit if your site, here are my findings.

ssllabs test report grade A which is good
a curl -vvv https://www.jcwiki.website/wiki/Main_Page | grep "http:" yielded no results, also good.
Opening the site in Google Chrome (Version 42.0.2311.152) incognito window yields a mixed content warning.
I checked the development tools and the reason is that a request to  'https://www.jcwiki.website/w/load.php' results in a redirect to the http variant. HTTPS pages should load EVERYTHING over HTTPS. (ergo chrome complains).

you can see the error in action through the following curl command

curl 'https://www.jcwiki.website/w/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cmediawiki.ui.button%7Cskins.vector.styles&only=styles&skin=vector&*' -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36' -H 'Accept: text/css,*/*;q=0.1' -H 'Referer: http://www.jcwiki.website/wiki/Main_Page' -H 'Connection: keep-alive' -H 'Cache-Control: no-cache' --compressed -vvv

After some more research I suspect the $wgServer variable in LocalSettings.php is not setup right. source

I see you are using apache to host your site, you can use this vhost snippet to redirect http to https in apache :
<VirtualHost *:80>
   ServerName mysite.example.com
   DocumentRoot /usr/local/apache2/htdocs
   Redirect permanent /secure https://mysite.example.com/secure
</VirtualHost>

Source and Source 2 for using rewrite


Generating a GPG key with a expiration date I'm looking a way to generate a GPG key with a given expiration date. In GPG/GPG2, when you create a new key you can set a date only in signature, but the key expiration date is always set to zero.

:public key packet:
        version 4, algo 1, created 1417388459, expires 0
        pkey[0]: [2048 bits]
        pkey[1]: [17 bits]
:user ID packet: "my user id mymail"
:signature packet: algo 1, keyid mykeyid
        version 4, created 1417688533, md5len 0, sigclass 0x13
        digest algo 2, begin of digest f0 52
        hashed subpkt 27 len 1 (key flags: 03)
        hashed subpkt 9 len 4 (key expires after 5y31d23h59m)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)

I found some discussion about why GPG handle the expiration (https://davesteele.github.io/gpg/2014/09/20/anatomy-of-a-gpg-key/ is a good starting point) but I don't know if there is a way to set an expiration for your primary key.

How to create a primary key with the expiration date set?

when i type gpg2 --full-gen-key, right after selecting the algo and keysize, i get this prompt:

Please specify how long the key should be valid.
     0 = key does not expire
  <n>  = key expires in n days
  <n>w = key expires in n weeks
  <n>m = key expires in n months
  <n>y = key expires in n years
Key is valid for? (0)

This configures the validity of your primary key. Is this what you're after?

Edit: the "expires:0" is perfectly normal for every GPG generated key, as GPG simply does not use this field for setting an expiration. This is done in the self-signature; the internal proof that the user ID provided is valid for the given public key. This is done for flexibility reasons as described here: https://davesteele.github.io/gpg/2014/09/20/anatomy-of-a-gpg-key/


Is it possible to identify mobile phone user with voice recognition A friend of mine claims that it is possible to identify every anonymous call (prepaid, skype, etc) only using voice recognition. However the scientific literature which I've read so far is ambiguous, i.e. if you apply voice recognition to a limited number of individuals, you could reliably identify who is who. However if the number reaches a certain limit this becomes impossible. So the question is: Is user identification using voice recognition of all network participants really possible or is my friend just being paranoid?

Well it is probably true and trivial to fake. You can find speech engines around, and if you use such a speech engine, it will not be possible to identify the human being that prepared the text.

Worse, it is easy to get words and/or partial sentences from public people from radio, or internet. Simple audio file processing could then make them say more or less anything. And you soon fall in the same problem of identifying gangsters wearing masks from facial recognition...


How to decrypt TLS in WireShark if I can hook the application's crypto API calls? I hooked BCryptEncrypt and BCryptDecrypt calls of an executable. I can get the input arguments and output values of these functions. This program calls BCryptEncrypt to encrypt the data sent over TLS, and calls BCryptDecrypt to decrypt the data received from TLS. So the hook gave me a lot of unencrypted data over the TLS channel.

However, a single HTTPS request might split into several TLS packets, and thus during each call of the above functions, my hook can only get a portion of the whole HTTPS stream.

I'm wondering if there's a way to "decrypt" the TLS captures in WireShark, given that I have already got the plain text for all the encrypted data for the TLS packets. So that I can utilize the Follow HTTP Stream, Gzip uncompression and many other goodies in WireShark to help me analyze the capture.

There is no way to let Wireshark work directly on the application level data you've got. But you can create a new pcap based on these data and then use Wireshark to analyze this pcap. For example this can be done with a bit of Perl and the Net::PcapWriter module which lets you easily create a pcap and add TCP connections with your own application data to it:

use strict;
use Net::PcapWriter;
my $pcap = Net::PcapWriter->new('test.pcap');
my $conn = $pcap->tcp_conn('1.1.1.1',1234,'2.2.2.2',80);
$conn->write(0,"GET / HTTP/1.0\r\nHost:..."); # HTTP request from client
$conn->write(1,"HTTP/1.1 200 ok\r\n...");     # HTTP response from server

Similar things can probably done with Python and the famous scapy library.


What is the benefit with using encrypted RAM? I sometimes hear that encryption is used for the RAM, but I don't really understand why this is needed.

Why is RAM needed to be encrypted? And is this done by the hardware, the operating system or the application?

What kind of attacks is it preventing? Is it only useful if people has physical access to the computer or even when people can access the computer over a network?

I thought that the operating system is protecting so that the applications could not access each others memory. Isn't that enough?

Really, what is the benefits with "encrypted RAM"?

Encrypting RAM is about preventing unauthorized access to the RAM contents.

Under normal operating conditions, the Operating System maintains RAM access permissions and blocks applications from seeing memory from other applications; so we are talking about an attack context where the attacker plugs into the RAM "from the outside". It has been demonstrated in lab conditions. Theoretically, properly applied encryption could thwart such kinds of attack.

If RAM is encrypted, it must be decrypted automatically for usage by the CPU. The CPU does not operate on RAM directly; it loads code and data from the RAM into its internal caches. This loading/unloading process is transparent for both the applications and the operating system. This means that an automatic RAM encryption system is conceivable, but would have to be done in hardware, preferably in the CPU itself (if it was done in the RAM chips, the attacker could just freeze the RAM and then plug it into his own machine; similarly, decryption in an external RAM controller would not prevent active attacks).

Such CPU with RAM encryption exist (but are still pretty rare). This 15 years old article from Anderson and Kuhn cites the Dallas DS5002FP microprocessor, a 8051-compatible CPU, which is still in production today (the article explains that the encryption is actually quite weak).

Note that encrypted RAM (decrypted only in the CPU) cannot work well with DMA -- so disk and network accesses would be quite slow in a PC with encrypted RAM.


Videos and visual tutorials on Format String Vulnerabilities Anyone know of good format string vulnerability tutorials/videos that demo how to test on a web app, such as modifying the URL. I've watched Vivek's videos from securitytube and another from CarolinaCon, but am looking for a more detailed/visual demo of how to apply it in web app pen-testing. In addition, I have seen other vulnerable web apps such as Damn Vulnerable Web App and Webgoat, as well as a few others, but can't seem to find how an attacker can exploit a format string vulnerability via a web browser and how to protect against it, other than modifying the code of the vulnerable link and/or program.

This all stems from reading different external scanning reports that always seem to contain Format String Vulnerability located at www.domainname.com/default.asp?(insert name here and code, ex.) News=%2508x. What exactly should I be looking for and how is someone supposed to investigate/test this (tools, manual, etc.)?

The OWASP Testing Guide has some guidance, as well as some whitepapers and references to tools.

WASC has this entry.

There scanning tools that look for this kind of vulnerability. w3af has a formatString plug-in that might help you test, depending on your application's setup.

Other than these things, I assume you learned from the videos to test for printf formatting characters. If you add these characters to a dictionary and fuzzing attack on inputs, you can determine the vulnerability of the application, if not exploit the vulnerability.


Why do scammers use emails like yahoo? I was doing a Cyber Security and IT audit for a company.

I was told that they had very little in terms of fraud protection, one of the only ways that they detected potential fraudsters was by manually checking if the email address was Yahoo or not. This was for orders on their website.

To my surprise it was almost completely perfect!

My question is why do scammers use email addresses such as yahoo and not try to blend in with legitimate users that have gmail and hotmail? I have seen many cases online of scammers still using yahoo, AIM, yahoo forums etc...

Ever tried to access your google account over Tor?

Spammers want to e.g. register 1000 email addresses via script over Tor or from the same IP address and then send 1000 spam mails from each. Google doesn’t let them do that, detects automated access, makes them solve captchas or verify their identity by cellphone. Google probably also cries foul by spam mail 17.

So bad guys will use a provider that lets them do their thing with the least hassle. Also they will be unwilling to change provider if the have already scripts for that provider, methods for solving their captchas, etc.


Android encryption when phone is on So I have android lollipop installed, which should be encrypted automatically with some startup password.

My question is, what happens if the phone get stolen while its on, and the screen is locked?
(If I had time I would obviously wipe it through Google.)

Is the file on my phone (nexus) encrypted while the phone is on?

Since applications can continue to execute in the background, the disk encryption key has to exist somewhere in memory.

There are differences among various Android versions in how the encryption key is derived from a passphrase or PIN, but all versions use the dm-crypt block-level disk encryption service of the Linux kernel. (Unlike iOS, Android doesn't use file-level encryption or multiple encryption key levels; on iOS, some keys are dropped as soon as the screen is locked, rendering some files inaccessible.)

This means that the files on disk are always encrypted, but the kernel will transparently decrypt them for any application that has sufficient file system privileges to read them.

Basically, the security of a device in such a state (locked screen, disk encryption key loaded in kernel memory) depends on the presence or absence of any security bugs in the Android lock screen or any installed application that can be remotely or locally exploited by an attacker; in that respect, there is no difference to an unencrypted device.

However, encryption protects against all attacks that require rebooting the device: As soon as the power is cycled, the encryption key is wiped from memory.

As commenters have noted, it should be added that an attacker with physical access to the device has more opportunities to gain access to the key material in memory than just exploiting kernel or application bugs: They could physically or logically extract the DRAM contents (which contain the Kernel memory and thus also the key) or gain access to debugging facilities of the system (assuming that they are not disabled).


cracking MD5 with salt using JTR In a legal, learning context at school, we have to understand security in Linux in the /ect/shadow file and the anaconda-ks.cfg.

These two files contains often different kind of hash and the password of often hashed as:

$encryption$salt$hash.

In my exemple, I have something like $1$8CharsSalt$22CharsHash

I understand it's a MD5 hash using the the 8 chars salt and using a base 64 encoded hash.

I have two questions about these lines.

My first one: Is the salt in clear format (in /etc/shadow in Linux). I am pretty sure that the answer is yes, but I just want to confirm.

My second one: using a password cracker tool like John the Ripper, I paste the line above (the real hashes) and it detected It was FreeBSD MD5 [32/64]. I see what John is trying, but, is he using the 8 chars salt of the pasted line?

Yes, it's just a base64 encode of the salt.
Yes, all UNIX/UNIX-based systems have some standardisation of their user databases and functions. FreeBSD was the first variant to use MD5 and encode is in the UNIX scheme of $algo$salt$hash base64 encoding the salt and the hash parts. Linux uses it in an identical way if md5 is being used (unlikely on new Linux systems).


How to upgrade the hashing method of a live database without compromising security? I'm working on an Intranet project that is accessible from the outside. The password are stored in a Sql Server database in the normal Hash and salt method. The problem lies in the hashing algorithm.

It currently use SHA512Cng and we can't find the decision behind why this algorithm was used. I would like to upgrade this hashing algorithm to use bcrypt as well as making the salt key longer.

Of course, since the passwords are hashed, we just can't run a batch to upgrade the password.

What are the possible path available when upgrading an authentication method from a less secure one to a more secure one of a live database?

Of course, we would like the database to remain as secure as the SHA512Cng method currently provide and not compromise the database during the upgrade process.

I recommend incrementally switching each user over to the new password hashing method on their next login.  At that point, you know their cleartext password, so you can re-hash it with bcrypt and switch them over to bcrypt.  This avoids the need for a "flag day" or contacting all your users.  In fact, it is invisible to users: your users never need to know you are transitioning to a new password hash algorithm.

In more detail:

Add another field to the database to indicate which kind of hashing algorithm was used to compute the password hash.  In other words, there are two fields associated with each user: one for the password hash, and to indicate the hashing algorithm (SHA512Cng or bcrypt).  Initially, password hash algorithm for every user is initialized to SHA512Cng.
When a user tries to logs in, look up the password hash algorithm for their account, hash the password they provided using that algorithm, and compare it to the stored hash.  If it does not match, the login is rejected.  If they do match, the login is accepted.
Additionally, if the login was accepted and if the algorithm in the database is SHA512Cng, then re-hash the password using bcrypt, overwrite the password hash with the new bcrypt hash, and change the algorithm in the database to bcrypt.

This allows you to gradually transition to the new password hash algorithm, as people log into your service.

Optionally, after a few months have passed, if there are any users who haven't logged in (and thus still have their passwords hashed with SHA512Cng), you could reset their password or email them and request them to log in again or something.  However, in many cases this may not be necessary.

P.S. Or, you could use Ramhound's elegant solution of simply bcrypting the password hash.  Clever!


How to hide my platform from a browser to keep my privacy? I just visited https://amiunique.org/fp in order to try to understand what makes a web page realize what platform it is running on, aside from User-Agent request header.

So I learned about window.navigator, which has member platform and more that are used to track me.

My question is how can I change these values in my PC and phone?

It's virtually impossible to do this on your own. There are dozens of fingerprinting vectors that can be used to detect the operating system you are running or uniquely identify a browser, and sometimes even your individual hardware irrespective of the OS you use. Paradoxically, any changes you make to your browser configuration actually make this worse. In addition, TCP option fingerprinting makes it such that your browser alone is incapable of hiding the platform you are using, because the mere connection that comes from your operating system leaks the operating system (and even system uptime).

There is a solution, however, which is to use Tor Browser on the highest security setting. Every Tor Browser installation attempts to be indistinguishable from each other (it has a large anonymity set). It's not perfect, but it's far better than nothing. The use of Tor as a proxy also defeats TCP fingerprinting.


How does my ISP filter Akamai servers There is an internet plan in my ISP that allows only Facebook, and because Facebook uses Akamai it is included also. So any server that belongs to Akamai can be accessed. How does the firewall know all the servers of Akamai because requesting the IP address of the server works fine, so it's not based on domain name.

I did a little searching Firewall defined Akamai IP Range

and I found out that it is not possible to know all the servers, so any theories and how can I confirm it?

In most cases people gather lists of big companies IP address ranges from their BGP AS numbers which are associated with ranges of IP addresses. A quick search at a public BGP AS looking glass reveals many lists for Akamai IP addresses these can then be aggregated and blocked by your firewall.

This technique usually won't work for smaller companies as they are less likely to use BGP. It also has many limitations in that a company may host servers on another companies network (think cloud compute services) and those servers will not show up under the companies BGP AS IP ranges. None the less, for blocking access to large well-known services this is an easy way to find a companies IP address ranges.

http://bgp.he.net/search?search%5Bsearch%5D=akamai&commit=Search


Amazon keeps asking for login/cc info via unsecure page - DNS hijack? All my computers in the house will not connect to Amazon.com, but some unsecure (http) Amazon login page. This is the second time I'm having this issue.  The first time I resolved it by changing my DNS servers to Goggle's DNS (8.8.8.8 and 8.8.4.4).  I checked them tonight and a random one was first, while 8.8.8.8 was second.  I reset them to Googles yet I still get this bogus login page.  Every link I hit just refreshes the same page (like the Privacy Policy, Help, etc...)

My router is an Asus RT-N66R with the latest firmware.  If I use the network tools to ping amazon.com, all packets are lost.  If I use my laptop, I get responses from www.amazon.com, but not amazon.com

I used F-Secure's router checker and it shows everything as ok - both when I use Google's DNS and when I set to auto and use my ISP (Comcast).  I'm at my wit's end as to WTF is going on.  Please help me!

[EDIT] Used Google's DNS servers and reset the router -all is well now but I would still love to know what the heck has been going on.

Based on your details something is messing with the DNS settings and since it affects the whole network it is probably the router. Also the fact that the first DNS address in the router was something you did not set indicates an attack against the router.

  I used F-Secure's router checker and it shows everything as ok

I have no idea what the router check really does, but from a short look I would suggest that it looks up various random hosts inside the ismydnshijacked.com domain. The DNS server will probably check where these lookups come from. But if this is really all then an attacker could setup its own DNS server (and set your router to use it) which then resolves these domains using the public DNS servers of google. In this case everything will look fine because the DNS lookup came from a trusted DNS server.

Insofar I'm sure that this router checker could easily be tricked into believing that everything is fine and attackers are known to make sure that their attacks will not be detected by known security solutions.

  [EDIT] Used Google's DNS servers and reset the router -all is well now but I would still love to know what the heck has been going on.

Again this indicates an attack against your router. Based on your description the router is Asus RT-N66R  which just based from a google search has a bad history which contains several possible exploits. It looks like there were fixes done in 06/2015 to reduce the attack surface ("Enhanced the login authentication strength and fixed CSRF related issues.") but there is a firmware from 2015/11/06 which again makes fixes at these area ("Modified brute-force protection mechanism in router login page." and several buffer overflows fixed).

Thus I would suggest that your router is either not on the latest firmware since this was only released 2 weeks ago or that the device is still vulnerable even after the latest fixes. Given the problems the vendor had in the past this would not be that unexpected.


Overwrite pointer with an address struct record {
char name[24];
char * message;
};

int main() {
puts("GOT Overwrite");

// Create the struct record
struct record student;
strcpy(student.name, "Alice");
student.message = (char *) malloc(sizeof(char) * 24);
strcpy(student.message, "hello world");
printf("Message from %s: (%s)\n", student.name, student.message);

// Read some user data
// Could leak the memory at student.message
read(0, student.name, 28);
printf("Message from %s: (%s)\n", student.name, student.message);

// Overwrite the message
// Could allow arbitary write at student.message
read(0, student.message, 4);
printf("Message from %s: (%s)\n", student.name, student.message);

// Print the name again
// The address of puts could have been changed to system
// and student.name could be "/bin/sh"
puts(student.name);
}

What I want to do is overflow the student.name pointer, and push an address into student.message. But the thing is, the the read function prevents me from writing an address in the form of '\xef\xbe\xad\xde' into the student.message. How do I format/place the address into the student.message pointer after filling the student.name with padding?

Thanks

I'm assuming this is from a GOT hijacking homework assignment that uses Python Pwntools.

If you look on line 24, you'll see that the read instruction reads 28 bytes even though student.name is only 24 bytes. Record is a struct, and as such, student.name and student.message are right next to each other in memory. This means that if you overflow student.name in line 24, you can overwrite student.message.

Essentially, try inputting 24 bytes of garbage (like 24 A's), and then input your address (which I'm assuming is the address of puts you got off-line). Manually inputting may not work if read includes the new line character at the end, so instead input using a script. Perhaps something like:

from pwn import *

def main():
    p = process('./a.out')
    command = 'A'* 24 + '\xef\xbe\xad\xde'
    p.send(command)


Safe place for private-public ssh key pairs Where can I store my private-public ssh key?
I would like to keep these files somewhere safe, and also I would probably need to keep them updated from time to time. Is it a good idea to keep it in a git repo (that I'll also have a private GitHub repo)?

Since you are talking about public keys only, it is fine to place these file in any repository you like.

Now I am unsure if you are really only talking about the public keys. In case you are wondering what to do with a private key, here is what I do from a backup perspective:

Encrypt external media
Use a long (20 characters) random password which I memorize to decrypt the external media.
Copy the private key(s) to this media
Store the external media in a (physical) vault


Can Arbitrary Code Execution be done using CSS Injection? As part of our class project, we are studying the attacks that could be done using CSS Injection. In our threat model, attacker can manipulate any CSS file on the server. If attacker replaces original CSS file with a malicious CSS file and if the web-server sends this malicious CSS file to the client, can the attacker execute some code in the client?

For example, a CSS file contains information like this

#mw-indicator-mw-helplink a {
  background-image: url('images/help.png');
  background-image: linear-gradient(transparent, transparent), /* @embed */ url('images/help.svg');
  background-repeat: no-repeat;
  background-position: left center;
  padding-left: 28px;
  display: inline-block;
  height: 24px;
  line-height: 24px;
}

Can an attacker change the url to some malicious url, and execute some code in client?

If attacker replaces original CSS file with a malicious CSS file and if the web-server sends this malicious CSS file to the client, can the attacker execute some code in the client?

Executing client-side code via CSS does not work in modern browsers.

I highly recommend taking a look at "Scriptless Attacks – Stealing the Pie Without Touching the Sill", "CSS: Cascading Style Scripting", and LiveOverflow's recent video "The Curse of Cross-Origin Stylesheets" if you are interested in learning more on scriptless attacks that rely on CSS.

  Can an attacker change the url to some malicious url, and execute some code in client?

Actually executing malicious JavaScript via url() will only work in outdated browsers.


Securing a script to prevent database from being exposed We have an Ioncube encoded script running on an Apache web server which stores customer confidential information in a MySQL database. We have configured the script to run under its own account using suphp. As usual the script reads the database credentials from a 'config.php' file. We'd like to mitigate the risk of the database contents being exposed through a zero day exploit. The web server OS, Apache and MySQL have been hardened. Is there anything we can do to lock down this script further. For example, if someone did exploit the script, I assume they would end up with the same privileges as the suphp account that the script runs as - Would they attempt to mysqldump the database? Should we be restricting access to all the mysql binaries?

You didn't mention MYSQL injection attacks in your list of precautions. Also you could reduce the permissions of the mysql user for the database. Usually people give the user all rights but you can restrict the mysql user's ability to do ALTER, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, EXECUTE, INDEX, INSERT, LOCK TABLES, REFERENCES, SELECT, SHOW VIEW, TRIGGER, and UPDATE. Only give the mysql user permission that are needed to run your script.


How to secure store sessions values in webapps? EDIT: I changed the title of this post from "How to manage sessions in webapps?" to "How to secure store sessions values in webapps?" as it might have been misleading

In the recent months I happened to encounter interesting scenarios that made me wonder on how to manager web apps sessions.

Some months ago I read about a SQL-Injection in Joomla 3.4 that would allow an attacker to perform a session hijacking.
This is possible because Joomla 3.4 stores in the database the value of each user's session that connects to Joomla.
What is interesting is that a couple of weeks ago I performed some on a friend's domain he built a loooot of time ago. His web site is so old that he's still using Joomla 1.1.
I could immediately find a SQL-Injection in one of the plugin he installed, so I remembered of the session table and I looked for that. I found it, and I tried to show him the effect of the vulnerability. The thing is that .... I couldn't.
The values stored in the database are different from the one the browser receives. I checked the Joomla source code and it turns out that Joomla 1.1 generates a pseudo-random number, performs some md5 operations with that number, and sends to the browser the pseudo-random number and stores in the database the result of the md5 operations. In this way I simply couldn't perform a session hijacking at all.

I also tried to inform the Joomla community about this but they don't seem to care about it. To me it seems quite important, a 10 years old software wouldn't allow an attacker to perform a session hijacking in case a SQL-Injection is found while the new version would.

I started to wonder on what would be the best way for managing sessions values.
Why storing them on the database?
Why not simply using what the back-end programming language is providing (like session_start in php)?

What do you think about it?

Yes, it is best practice to hash session tokens within the database. This way sessions cannot be hijacked if the data is exposed. Session tokens themselves should be generated with at least 64-bits of entropy.

Therefore, value provided within cookie = token, value stored in database = token hashed.

As of 2016, SHA-2 is recommended to create the hash. Note that salts are not needed for values generated using sufficient entropy.

A database server is often required for server-side session storage where servers are clustered (although a caching layer can be used instead). Although you can use PHP custom handlers in order to do this, it appears that the Joomla authors decided to roll their own, which is vulnerable to data extraction attacks as you mention.

It is also best practice to restrict access to the storage mechanism. For example, a database account with write access to the table can be used for login and logout and updating the session expiry, and a database account for read access for checking the login session. The rest of the application could use a database account that cannot access the sessions table at all. A secret "pepper"/"system-wide salt" could be used in order to mitigate other attacks where the session table could be written to.


Which are the most important RFCs when learning security? I was reading some security related blogs and write ups in internet and I started going for the RFCs instead, but they are huge, therefore impossible to learn all of them. I see those below as very important ones:

RFC 761 Transmission Control Protocol
RFC 791 Internet Protocol
RFC 792 Internet Control Message Protocol
RFC 2616 Hypertext Transfer Protocol 1.1
RFC 768 User Datagram Protocol

Am I missing any?

Learning Basic Networking is very important.These are protocols specific RFC's , to gaing in-depth knowledge about a particular protocol.
You can approach by :
for example IP RFC 791
First study and learn IP from IP RFC,or various resoures.
After Having the knowledge of IP , you can find out what are the different security problems related to IP.
For example in its design , its header , various ways an attacker can manipulate and use IP protocol,spoofing,replay packets etc.
Than finding the safety measures required.
This may lead you to ipsec,firewall(iptables).
Then finding how ipsec saves you.
For that go for IPsec RFC and find out how it solves various security problems you have encountered earlier.
If ipsec is not the complete solution find out more.
You can keep on researching on DNS,HTTP etc
Hope it helps !


gpg: decryption failed: No secret key I cannot seem to get gnupg to decrypt files encrypted with my keys. I've tried migrating my secret key from an old laptop to a new one, and I keep getting the same error:

gpg: decryption failed: No secret key

I tried exporting my public, secret, and subkeys from my old laptop as follows:

gpg --export MYKEYID > pub.key
gpg --export-secret-keys MYKEYID > sec.key
gpg --export-secret-subkeys MYKEYID > sub.key

I then copied them to my new laptop, and imported them as follows:

gpg --import pub.key
gpg --import sec.key
gpg --import sub.key

Then I edited the key to give it ultimate trust:

gpg --edit-key MYKEYID

gpg> trust
...
Your decision? 5
Do you really want to set this key to ultimate trust? (y/N) y

yet no matter what, it fails to decrypt:

gpg --decrypt -v encryptedfile.gpg
gpg: public key is E78E22A13ED8B15D
gpg: encrypted with ELG key, ID E78E22A13ED8B15D
gpg: decryption failed: No secret key

Version on old laptop:

gpg --version
gpg (GnuPG) 2.1.21
libgcrypt 1.7.6

Version on new laptop:

gpg --version
gpg (GnuPG/MacGPG2) 2.2.3
libgcrypt 1.8.1

This was entirely my fault. I'm not sure what happened, but the file I was trying to decrypt was not encrypted by my key. I tried a different file and it worked.

I'm not sure how that happened, but testing the same file on the old machine first would have saved me a ton of time :).


If DNSSEC is so questionable, why is it ahead of DNSCurve in adoption? Looking at all the people who question the viability of DNSSEC, it's no wonder that the adoption rates are so poor.

However, what about DNSCurve?  It supposedly fixes all the DNS security and privacy problems independent of DNSSEC, doesn't suffer from the problems that are specific and unique to DNSSEC, and, should one disregard the maturity of either approach, seems to be a clear win for the situation — yet even though it's much-much younger than DNSSEC, there are still practically no implementations for DNSCurve, other than djbdns and DNSCrypt support by OpenDNS.  Why?

There's a problem:
DNSCurve is more like TLS for DNS servers, in comparison to DNSSEC, which is signed records. DNSCurve uses point-to-point cryptography to secure communication, while DNSSEC uses pre-calculated signatures to ensure the accuracy of the supplied records.
So we can summaraize it like this:
DNSSEC: Accurate Results
DNSCurve: Encrypted Traffic
Theoretically you can use traffic encryption to ensure accuracy, the way TLS does for websites. Except that it's not really the encryption that's ensuring your accuracy, is the authentication provided through the PKI. And there's a set of critical problems with the basic DNSCurve PKI.
The first problem here is that with DNSCurve, each and every DNS server involved needs a private key, and since the key signature is encoded into the resolver's address, then in the case of anycast DNS servers, each server needs the same private key. But even if they use different keys, you're still trusting the local security where the DNS Server is installed. If the server is installed somewhere hostile, then the results can be compromised. This is not true with DNSSEC.
ICANN has stated that, in the case of the DNS Root zone servers, DNSCurve will not be implemented, ever. Many of the root servers operate in less-trusted locations, and the potential for abuse by local governments would be enormous. This is precisely why DNSSEC was designed such that signing happens outside the DNS server. DNS relies on a vast network of server which may not be individually trustworthy, so DNSSEC was designed such that the trust is based solely on the information they serve, not the honesty of the operator.
The second problem is that DNSCurve secures the public key by encoding it into the resolver name. But DNSSEC does not sign the resolver name. This means that DNSSEC (which is implemented in the root zone) cannot be used as a trust root for DNSCurve, because the one thing that DNSCurve requires to be accurate is in fact the very thing for which DNSSEC cannot ensure accuracy.
So essentially DNSCurve is pretty much a non-starter. While it can be used to guarantee the security of your communication with a single DNS resolver, there currently is no way of globally anchoring your trust in a way that could guarantee the accuracy of any results you retrieve.
Unless DNSCurve is re-designed to allow for trusted key distribution, it will have to remain a client-side security tool rather than a tool for ensuring the authenticity of DNS records.
Since DNSCurve is relatively new and was developed largely by djb in isolation, presumably these show-stopping issues were simple oversights on his part, and may be fixed at some future date. Though given Dr. Bernstein's track record of maintaining his inventions, I wouldn't hold my breath.


Certificates and keys validity I'm connecting to a server via TLS.
My device has installed server cert, device cert, private key and public key.

I read here validity SSL/TLS  that TLS cert will last max 2 years.

This means that every 2 years I will have to updat all the certs stored into my device?
Only server cert and device cert?
Do I have to update also public and private key?

Given your previous question it looks like you are talking about an IoT environment, i.e. IoT devices which communicate with a server via mutual TLS. In this environment you very likely don't use certificates issued by a public CA but instead use a private CA.

The limit of 2 years you mention is only enforced by public CA. If you run your own CA and have full control over the communication peers you can use any validation time you want, also longer than two years.  Still, it is not recommended to use a certificate forever since attacks against the used algorithms improve with the time and also the chance of a compromised private key increases.


Does changing credit card numbers provide better security over time? I've always contacted my bank and credit card provider every year and simply asked to change my credit card number itself (and get a new card). They do so without a hassle and I feel more secure in doing it.

Does this actually provide better security? My thought process is that if a hacker steals or otherwise finds one of my old CC#s then it will not matter because it will not work. Is this in fact true?

update: Pertaining to the USA. Also, I know this isnt explicitly InfoSec but I see loads of questions on here that are less IT related and more security in general.

Changing your credit card regularly may "provide better security over time," and it is unlikely to degrade your security significantly.  That being said, "over time" is a good way of putting it - you're shifting the odds, nothing more.

It might be appropriate to say: risk = threat x vulnerability.  By rotating your card, you may lower some aspects of your vulnerability (but not all).  The threat is unaffected.  Therefore, you still have risk.

Let me walk you through the thinking that leads me to say this.

Firstly, let's take as a given that card details - number, expiration, name - are enough to allow a card to be used somewhere.  99 out of 100 Internet retailers will require CVV, but that means 1 out of 100 won't.  Card Not Present transactions have weaker requirements than Card Present, and when someone steals your card number, they can find a way to take advantage of it, somewhere, somehow.

So that's your threat - if someone gets your card details, and the card is active, they can take advantage of it.  Let's talk about your vulnerability.

In some cases, changing your card doesn't lower your vulnerability.  Let's say you bought a Snuggi at Target in November 2013; Target was compromised; the card you used is now known to attackers.  They turn around and use it.  Your annual card cycling doesn't happen until January 2014 - the attackers have a 2 month window to take advantage of your card.

Where your system helps you is when something old gets compromised.  Let's say you shopped at Alice's Internet Doodads back in November 2013.  AID was compromised in February 2014, and their entire card database got stolen.  You, however, are safe - because you changed your card number in January 2014.  You have a more limited window of vulnerability based on your card cycling.

(Note that the advent of Account Updater, this may not be true if you previously used the merchant that the attacker tries to use.  Maybe someone more familiar with the complexities of Account Updater can weigh in on how a cardholder-initiated account update will get propagated.  But it does introduce a case where "old CC# will work".)

I did mention that your system is unlikely to degrade your security significantly - but it can degrade it..  One threat vector for cards is during card issuance - they mail you your new card through the post, and you have to call from the right phone to activate it.  But the post is not at all high security, and it's not impossible to spoof the activation call (at the very worst, the attacker steals mail from your mailbox, breaks into your home, activates the card, and steals your Xbox to boot!)  Since you're receiving cards more often than average, your risk goes up slightly.  It's not huge, but it is a change.


Hipaa Compliant Server I have an instance in Amazon EC2 and need to be HIPAA compliant. I have two questions,

Should I need to do a block level encryption of the database storage.
Should I need to encrypt sensitive data before storing in the database.

The paper mentioned is more of a marketing message than anything substantial.

While I am not an expert on HIPAA, it is pretty similar to the UK requirements on sensitive (patient) data. Ideally, you will always try to encrypt data "at rest", eg when on a permanent storage device. However, this is not always easy and to do it well requires very careful execution. No point, for example, in encrypting your drives if the key is in vulnerable memory.

In the UK, government data is classified according to sensitivity levels and then risk assessed against a standard set of Business Impact Levels (IL for short). Patient data for example would be classified as OFFICIAL-SENSITIVE and IL3 is advised. IL3 would recommend encryption at rest but this is not mandated if the data centre and any staff with access are appropriately certified and security cleared.

In your case, the use of AWS means that you have to rely on Amazon to maintain their claims about the data centres. For the UK market, Microsoft have certified their Azure platform (in the EU) to IL2 making it suitable for OFFICIAL classifications (most government documents). To obtain a higher level of classification on a shared platform would be prohibitively expensive. However, there are higher level certified systems though they are effectively private clouds.

So to answer your direct questions (sorry about the extended background):

Ideally you should, it gives you a higher level of assurance and reduces risk (when done correctly)
If you can then key assets are best encrypted. Again assuming you do it right. It may not be possible though depending on how you need to use the data. Probably not sensible to do both on the same data though.

Putting sensitive data onto an open cloud platform is fraught with issues and risks. You need to do a good risk analysis on each part of your service, document the risk and the impact if the risk is realised. Then weigh that against the costs of additional security. If this is patient data, you should also consider the impact on the patients, this wont (shouldn't) just be a simple matter of corporate economics.

There is no absolute right or wrong answer here.