Can a mobile phone battery contain malware? It has 3 terminals and is presumably a smart battery.

I bought it on ebay recently for $2.74 USD and that included postage from China to Australia. It would normally retail for maybe $40 - $50.

The phone's an LG TU550 and the battery is supposed to be model LGLP-GAJM. The sticker on the back is identical-looking to the original but the battery is larger and black, not silver like the original.

Update: I've plugged it in and apart from looking ugly (it sits on the outside of the phone and forms the back of the keypad) the only obvious misbehavior is that the phone doesn't show that it's charging (animate the battery icon) when plugged into the power adapter.

One possible reason for suspicion is the price - how can they be making a profit? (If they weren't, I'd have to wonder about their motives)

Update 23 Jul 2011: Looks like this is definitely plausible, at least for Apple laptop batteries. See Threatpost article Apple Laptop Batteries Can Be Bricked, Firmware Hacked.

  You can read all the firmware, make changes to the code, do whatever you want. And those code changes will survive a reinstall of the OS, so you could imagine writing malware that could hide on the chip on the battery. You'd need a vulnerability in the OS or something that the battery could then attack, though.

Pretty much paralleling what the other two responses have said;  Firmware based malicious code has been proven countless times.  From a theoretical standpoint, it is possible that there is some sort of malware contained w/in the smart battery's firmware.

In the reality of the situation the much easier target is the phone itself.  Those who are in the business of creating malware will, almost unequivocally take the easiest path to their end goal.  This means that unless you are specifically targeted for some reason and attacking the phone is for some reason a poor option, this might be a possibility.

Unless it is a targeted attack, the "bad guys" want to get the most out of their work.  This means they will target the most users in the easiest way that they can figure out.

So, while not saying this is impossible, it is improbable, based mostly on the design of the vast majority of attacking schemes.

I have one additional question:  Is there a specific reason for you to suspect that your phone is infected with some sort of malware?  If so what is that reason?  In that case, what lead you to suspect your battery as the source?

P.S. If you happen to be a high-ranking member of a government or something to that nature, this evaluation may need to be revised, haha.


How is a certificate extension different from a certificate file name extension? The following article has explained both differently.
X.509 wiki

Now my question is:

Can we use more than one extension in a certificate? Is it how there can be more than one use of extensions in a certificate?
How are they differentiated by a server?

Certificate extensions are just additional information in the certificate, i.e. "extending" on the information which has to be provided at minimum. If you need these extensions you have to use X.509v3, without extensions you can use X.509v1. Typical extensions are usage restrictions, subject alternative names or links to CRL download and the OCSP resolver.

A certificate can contain multiple extensions and this is actually the common case. The server can differ between the various extensions because each has a type id which is contained in the X.509 file. For  more detailed information about the variety of extensions which exist see Redhat: B.3. Standard X.509 v3 Certificate Extension Reference.

Certificate extensions have nothing to do with file name extension, hair extensions, loan extensions or any other kind of extensions.


How do I configure nmap to verify my firewall is performing stateful packet inspection? As part of a compliance audit, I need to run a routine scan that verifies that our firewalls are performing stateful packet inspection on incoming packets. I have a dedicated server outside our network, on which I can run nmap or whatever software I need to, and scan the external port of our firewall.

The compliance audit manual says I should "run NMAP on all TCP ports with “syn reset” or ”syn ack” bits set", and that a response means 'packets are being allowed through even if they're not part of a previously established session'

What are the nmap switches I need to scan a range of IP addresses - in this case a single /28 subnet - and report on which ports are open and whether the firewall is performing SPI?

Server is Windows 2008; nmap version 5.21 is installed and working.

The flag for SYN ACK scans is -sA. scanning all ports is -p- 192.168.0.0/28 will scan for the obvious subnet. You may want -vv to see more details

The following command:

nmap -sA -p- 192.168.0.0/28 -vv

should work.


VeraCrypt PIM feature - Is it really necessary? I am looking to encrypt my OS hard drive, and VeraCrypt caught my eye as a real good option.

I tried to encrypt my drive with it, and the resulting encrypted system, takes around a minute to decrypt.
This timing is unacceptable by me. I can dedicate around 10 seconds for it.

After a little bit of research, I found out that one critical parameter can be changed to achieve faster timings - PIM

I tried to understand the usage of such thing, but I couldn't.

I presume that all readers here are familiar with AES-256, but just in case - It is considered practically (and also theoretically) impossible to brute-force this encryption....

So why do I really need this extra hashing rounds that slow me down extremely?

I am looking for practical reasons only, I don't care about some out of the world improbable computing force that maybe could be used to hack my system.

I do care about governments computing force.

Thanks

VeraCrypt's PIM is unnecessary if you use a sufficiently strong password.

What VeraCrypt's PIM is

In layman's terms, VeraCrypt's PIM defines the number of times your password is hashed before being used to decrypt the disk.

To be precise, each VeraCrypt volume is encrypted using a random master key. Your password is used as a base to decrypt the master key: what actually decrypts the master key is the result of a key derivation function which takes your password as input. This key derivation function repeats its internal hashing computation a number of times depending on the PIM.

From the VeraCrypt manual:

  When a PIM value is specified, the number of iterations is calculated
  as follows:

  For system encryption that doesn't use SHA-512 or Whirlpool: Iterations = PIM x 2048
  For system encryption that uses SHA-512 or Whirlpool, non-system encryption and file containers: Iterations = 15000 + (PIM x 1000)

Implications of VeraCrypt's PIM

VeraCrypt's PIM increases both the time it takes you to decrypt the disk and the time it takes an attacker to brute-force your password. The stronger your password is, the longer a successful brute-force attack would take, the lower the PIM can be to make the attack impractical or anti-economical. Therefore if you use a sufficiently strong password then VeraCrypt's PIM is superfluous.

Using VeraCrypt's default PIM increases attack time and decryption time proportionately, while using a custom PIM increases attack time more than it increases decryption time, because the attacker would have to brute-force both the password and the PIM. The time increase of the attack in the last case is 1+2+3+...+PIM = PIM(PIM+1)/2 corresponding about to a square.

Assuming your password only uses English letters and numbers, increasing the PIM by a factor of 1000 (e.g. 500 --> 500000) roughly corresponds to increasing the password by just 4 characters (36^4 ~ (1000*1001)/2). In my opinion it is counter-productive because you need to memorize about the same number of characters with the added nuisance of increased decryption time.

All the above is unrelated with AES, which is a symmetric cypher used to decrypt the VeraCrypt volume after a random master key is derived.


Preventing Attacks Scanning for PHPMyAdmin etc I have a Linux web server running Rails and each time I check the Nginx logs I find attempts to access PHPMyAdmin, database and admin directories such as this:

190.196.161.110 - - [16/Oct/2011:23:37:31 +0100] "GET //PHPMyAdmin/ HTTP/1.1" 404 728 "-" "Made by ZmEu @ WhiteHat Team - www.whitehat.ro"

The attacks are coming from a variety of different IP addresses and they just increment version numbers and check each directory, e.g. GET //PHPMyAdmin 1.0/, GET //PHPMyAdmin 1.1/ etc.

Will this affect the performance of my web server much?  Also, is there a way to automatically ban IP addresses that do such things e.g. like fail2ban for ssh log-in attempts.?

If you're using Apache for such applications, you may want to look into ModSecurity, mod_evasive and/or mod_qos. The latter two are more geared towards brute force and DoS attacks. ModSecurity though has a ton of stuff under its banner.


Is plausible deniability actually feasible for encrypted volumes/disks? Based on Is it possible to tell if hard drive is encrypted?, is it actually possible to hide a volume in practice? According to this answer TrueCrypt is the only well-known disk encryption software that does not have a signature. And even with TrueCrypt it seems unlikely to be able to convince anybody that you just happen to have a file of exactly modulo 512 bytes, corresponding to no known binary format, with an extremely high level of entropy. And in the case of full-disk encryption, isn't it astronomically unlikely that the entire disk will be filled with highly random data, even straight from the factory?

It seems like it's debatable whether even TrueCrypt hidden volumes can be created and used in a way that provides plausible deniability of their existence.

TL;DR: No, plausible deniability is a weak argument to protect a data.  Building privacy based on plausible deniability is unwise.  (Also, read the first quote below)

TrueCrypt is not the only popular disk encryption solution that can be used to encrypt a disk cryptsetup can be used with -c and -h to produce an encrypted disk that looks like random noise (given that the specified cipher with -c is used in XTS mode).

(I have added this point to the linked answer as a comment)

I have (almost) no experience with TrueCrypt therefore I'm writing the answer from the cryptsetup point of view.  A point of view that is very well defined by Arno Wagner in his awesome cryptsetup FAQ:

  why should "I do not have a hidden partition" be any more plausible than "I forgot my crypto key" or "I wiped that partition with random data, nothing in there"? I do not see any reason.

In summary, we are talking about plausible deniability, which is different from simple deniability in the fact that an attacker already know that something may exist he just cannot prove it.

If you throw your disk into the closest river that's plain deniability, until the moment someone finds the disk.
plausible deniability enters the scene when the attacker is in possession of your disk but he cannot prove what is on it.  It is just as if your shirt had a blood stain (and therefore you looked like a murderer), all DNA tests point that it is human, but no matter how hard the police tries to match it against a DNA database they cannot find a match.  You have a human blood stain, but it can pretty much be blood from someone that is very alive and well.

Imagine that you have a LUKS partition, but you really forgot the password.  Someone may give up or may do nasty things to you to force you to give the password.  He cannot prove that you have the key, neither he cannot prove that you do not have.  It depends on his intent and willingness to do nasty things to you.

Nothing is different with a disk that contains random noise.  It can be an encrypted disk!  And the willingness of the attacker to do nasty things to you is a much stronger point than the ability to prove that the disk is an encrypted disk or not.

Now imagine the attacker as being a law enforcing government agency, and you will see that "doing nasty things to you" may simply be keeping you in prison on "suspicion" of something.  I live in the UK so it calls for another quote from Arno Wagner:

  [encryption without LUKS] has limited value against the authorities. In civilized countries, they cannot force you to give up a crypto-key anyways. In quite a few countries around the world, they can force you to give up the keys (using imprisonment or worse to pressure you, sometimes without due process), and in the worst case, they only need a nebulous "suspicion" about the presence of encrypted data. Sometimes this applies to everybody, sometimes only when you are suspected of having "illicit data" (definition subject to change) and sometimes specifically when crossing a border. Note that this is going on in countries like the US and the UK, to different degrees and sometimes with courts restricting what the authorities can actually demand.

All above is considering that an attacker cannot prove that the disk is an encrypted disk, i.e. that plausible deniability works.

Bruce Schneier argues in his paper about TrueCrypt and DFS (Deniable File System) that there are environment cues around partitions that look like random noise that defeat plausible deniability.  Whether you believe the paper's arguments is your call (I do not), but it gives yet another sight on how plausible deniability is a weak defence.

References:

Sections 2.4 and 5.8 from cryptsetup FAQ - Arno Wagner
Defeating Encrypted and Deniable File Systems - Czekis, Hilaire, Koscher, Gribble, Kohno, Schneier


How secure is E-Z Pass? E-Z Pass is an American company that allows people to electronically pay tolls without having to carry change or come to a stop at toll booths. Instead, you have a device that you attach to the inside of your windshield that automatically pays tolls from a bank account or credit card when you pass through a special booth.

I saw a news article about E-Z Pass fraud that people did by stealing E-Z Passes out of cars and replacing them with fakes, but does anyone know how secure the devices’ protocols are? I’m imagining someone attacking the system with with a RFID reader/emitter walking through a parking lot and spoofing an E-Z Pass booth, allowing them to steal money from everyone in the parking lot.

I saw a news article about E-Z Pass fraud that people did by stealing E-Z Passes out of cars and replacing them with fakes, but does anyone know how secure the devices’ protocols are?

Let's assume you do clone the RFID tag. It certainly isn't tied to the payment information, as you change that through the web interface. It's tied to a toll-authority account and vehicle.

At least here E-Z pass is an RFID system and with OCR on the license plates, and high def camera shots on the face of the driver. You can run through it once every six months or year or whatever and they'll send you a nasty-gram. With a cloned tag, you could flip the plate by the time they'd catch you -- you'd be on your merry way. But, it's probably not worth it. From The Chronicle

  Now, HCTRA has its own high-tech specialists. One uses software to analyze traffic and pinpoint the day of the week, time, lane and direction a frequent toll violator is likely to pass through. Another specialist spends part of her shift doing the equivalent of fingerprint analysis on the photos to track down car owners who have tried to mask their license plate numbers.

If you even take the tag to a second car, they know if the car's color make and model fails to match. I assume it gets Q/Aed if there is a color fail.

A better scam, if you want to skip the tolls, is to get an out of state dealer plate. Note these are not the temp dealer plates. They run up millions of dollars of unpaid of tolls every year. For reference you can see this mentioned here in 2012

state vehicle inspection, emissions inspection, and toll fees avoidance;
parking ticket fine avoidance (local level);

However, recently (2014) they've been cracking down on out-of-state plates, and I assume dealer plates are soon to follow


Samsung SSD 850 EVO. Best way to protect personal data against thiefs I'm wondering what is the best way to protect my personal data stored on Samsung SSD 850 EVO in Linux?

I did some research and found this.

  To set an ATA password, simply access the BIOS, navigate to the
  “Security” menu, enable “Password on boot” and set an “HDD Password.”
  Administrators also have the option of setting a “Master Password,”
  which can allow a lost user password (“HDD Password) to be recovered.
  The “Master Password” may also be used to unlock and/or erase the
  drive (depending on the settings), effectively destroying, and thus
  protecting, the data but allowing the drive to be reused.

(http://www.samsung.com/global/business/semiconductor/minisite/SSD/global/html/whitepaper/whitepaper06.html)

  I steal your laptop. You have a password set on the hard drive. Oh
  well looky here i have another PC that support this kind of hard drive
  password encryption (Not all do and most desktop's don't support it
  except for business class like the dell optiplex which is what i did
  all my testing on). I go into my BIOS. I set an Admin password on my
  BIOS. I turn off my PC, plug in your drive, turn it on, go into BIOS.
  But you are thinking WAIT! it ask for the hard drive password before
  you can even get into the BIOS! Errrr WRONG! I use MY admin password
  for your hard drive and I am in my BIOS. Now i go to the hard drive
  password, and change it using MY ADMIN PASSWORD AND THE CURRENT
  PASSWORD, and then either set no password or changed it. I reboot, I'm
  in, your files are mine.

(http://www.tomshardware.co.uk/answers/id-2813442/encryption-samsung-840-ev0-ssd.html)

In other case I can use additional OPAL software msed (https://vxlabs.com/2015/02/11/use-the-hardware-based-full-disk-encryption-your-tcg-opal-ssd-with-msed/) or use software based encryption utilities like TrueCrypt and accept all performance issues.

In other words
- is it really so easy to decrypt Samsung EVO 850 hard drive password?
- will msed usage be more secure in my case or TrueCrypt is the only solution?

For Samsung 850 drives and other SSDs, your best and most secure option is to use the OPAL full-disk encryption by enabling a drive password in your system's BIOS.

The way the encryption on these SSDs works is that the drive is always encrypted -- it comes from the factory with an encryption key generated and set.   All data it writes and reads is encrypted/decrypted with this key, nothing is written unencrypted.

When you set a password in BIOS, the drive encrypts the encryption key (stored in the drive controller) with the password you supply.  Thus, until you enter the password and give the drive the key it needs to decrypt it's own encryption key, all the data is unreadable -- even to the SSD itself.   Additionally you can't issue any SATA commands or even format/repurpose the drive without supplying this password.

Note that this is transparent to the operating system -- the encryption is handled at the hardware level, and decryption at startup via the BIOS.  The OS, no matter what it is, will just see a regular SSD and interact with it normally.

When you use the Samsung software to conduct a "Secure Erase" of an SSD, it actually doesn't 'erase' anything in the pure sense of the word.  With SSDs, each write/rewrite of a sector can be easily recovered through forensic analysis.  If that data was encrypted, you can still recover it -- so long as you have the encryption key.  What the "secure erase" facility does is reset the drive's internal AES encryption key to a new one; effectively resetting the drive.  Thus, all the old information on the drive which could be recovered by forensics is now encrypted/unreadable even to the drive itself, making recovery of the data exponentially more challenging if not impossible.

The drive controller itself handles the password.  If your BIOS supports OPAL or SED drives, you cannot bypass drive encryption using the supervisor password of the BIOS to change the disk password.  Even if logged into BIOS with a supervisor password, you will be unable to change the password on an OPAL/SED SSD (if your BIOS supports this properly) without supplying the existing SSD password.  If you can, that means your BIOS never communicated with the drive to set the password in the first place.  If this was the case, the BIOS doesn't support OPAL and you could also simply plug the SSD into another computer and image the data unhindered. Most drive manufacturers offer tools you can use to check this and see if the drive's status is "encrypted," meaning a password has been set.

Note that TrueCrypt has now been retired and there's rampant speculation as to whether the project's codebase may have been compromised by some entity like a government agency; or if the creators simply retired.  Here's an article with some information.

Also note the vulnerability of full disk encryption is that your data is protected when the encrypted data is not in use/the encryption key is not in memory -- meaning when your computer is on and in use. If an adversary got ahold of your computer while it was running, it is possible (although difficult) for them to recover the key from the system BIOS/drive controller memory.

Of course, full disk encryption also won't protect you from the effects of malware or other compromises when the system is running as well.

Links

Samsung's marketing site noting Samsung 850 SSD's support OPAL encryption

Samsung SSD White Paper detailing how encryption works


Preventing a site from appearing in the 'Most Visited' or 'speed dial' section of a web browser Are there any established ways of preventing a website from appearing as an icon on the 'Most Visited' / 'Speed dial' / start page of a web browser?

One example of this is the tab that opens by default when you start a new Google Chrome window and contains lots of little thumbnails of previously visited websites.

We have privacy concerns around displaying sensitive information from a web app in one of these thumbnails. (Vaguely similar to how sensitive information may be leaked via the task switcher on a mobile device)

I would assume that there was a HTTP header / meta tag that would be able to do this but so far I have not discovered anything in my research.

Cache-directive headers and other standard methods of preventing a page from being cached that we have tried so far don't appear to work.

Edit: I am asking in the position of a service provider running a website that displays sensitive information and doesn't want the user's browser to show that to anyone who can see their screen when they open a new tab.

This is an interesting question why I was looking into the source code of Chromium too see how they do it.

The Answer

It is nearly impossible to implement a 100% reliable feature to prevent a screenshot that will be used in the most visited view. You have to hide the sensitive content right the moment the service is storing the data. Which might happen all of a sudden and without a warning (at least from the view of the website).

Technical Details

They have a service running which is responsible to evaluate the top sites. There is another service which is responsible to create screenshots of such pages. In top_sites_impl.cc there is TopSitesImpl::GetUpdateDelay which returns the interval for creating such images. The default value is 30 seconds:

if (cache_->top_sites().size() <= prepopulated_pages_.size())
   return base::TimeDelta::FromSeconds(30);

But it might get much more complex then that:

int64_t range = kMaxUpdateIntervalMinutes - kMinUpdateIntervalMinutes;
int64_t minutes = kMaxUpdateIntervalMinutes -
                last_num_urls_changed_ * range / cache_->top_sites().size();
 return base::TimeDelta::FromMinutes(minutes);

Furthermore there have to be some special events met to re-initiate this update mechanism. This is implemented to prevent spamming the top pages service.


Show full path of a downloadable file On the website of the company I am working for are files, which can be downloaded. On the page, where you can download that file, you can also see the full path on the server itself of the file, e.g. /var/www/homepage/path/to/downloadable/file. This seems to be like an information next to the download link of that file.

The link of the downloadable file is handled by a download manager. So when you go to the download link of that file, you'll see something like http://page/download/?downmanid=[number]&ind=[bigRandomAlphaNumValue]. This [bigRandomAlphaNumValue] seems to be a sort of check. You cannot download the file, if you change that value.

But now from a security perspective: What to do about this full internal path of that downloadable file? Should I be concerned?

I think you should be concerned. It discloses information about the server hosting your company website. For instance, depending on the path it may contain unix usernames or give hints on how to exploit any path traversal vulnerability found in the website.

There is any reason to show the full path to the file? Why not just the filename?


How can I tell if a site is using open SSL, and which version? In light of the Open SSL Heartbleed bug, I'd like to make sure I'm not putting any personal information in any system that is using Open SSL that is vulnerable.

So, from my browser (IE 11) how can I tell if 1. a website is using Open SSL, and 2. if so, what version of Open SSL?

I know I can view the security certificates by clicking on the little lock in the address bar, but from what I see, there's nothing that says Open SSL, nor the version.

Thanks.

You're not able to tell from version info, mostly because you can't guarantee that it's accurate or even available.

Browser plugins are check sites are surfacing that allow you essentially test the exploit to identify if the site is vulnerable and that's really the only way to know for sure.


Would a digital signature have prevented the CCleaner compromise? I read today about the CCleaner hack and how code was injected into their binary. People were able to download and install the compromised software before the company had noticed.

Isn't this what digital signatures are for? Would signing the binary or providing a checksum have done anything to prevent this?

To add to the confusion, in this Reuters news article a researcher claims they did have a digital signature:

  “There is nothing a user could have noticed,” Williams said, noting
  that the optimization software had a proper digital certificate, which
  means that other computers automatically trust the program.

How could the OS accept to install a software with an invalid signature? Or can an attacker change the binary and forge the signature?

Based on the incomplete details that have been released so far, the malicious code was inserted before compilation and signing (e.g. on a developer's machine, or on a build server). As a result, the compromised version was signed by exactly the same processes as would be used by the uncompromised version. The flaw was introduced before the signing of the binary took place.

Similarly, a checksum would have been calculated based on the results of the compilation, by which point, the malicious code was already present.

This is a weak point in all signing architectures - if the process before the signature is compromised, there is no real way to detect it. It doesn't mean they're unhelpful - if the attackers didn't get access to the systems until after the signature had been applied, the tampering would have been detected easily, since the signature wouldn't have matched.


Allow access to a directory for certain application only I would like to restrict an access to a directory. For example, on my system there is ~/.thunderbird directory that contains settings, letters, caches, etc of Thunderbird mail client. Obviously, other applications doesn't need the content of this folder. And other applications should not access the folder not because of security but just because of safety (for instance, "crazy" behavior of some other application caused by a bug or an error in my shell script should not affect the content of Thunderbird's directory).

I cannot use setuid bit on Thunderbird's executable (e.g. /usr/bin/thunderbird). Because after setuid bit is set I will not access usual files created by Thunderbird (for example, downloaded attachments).

There is a workaround with setgid bit on Thunderbird's executable (downloaded attachments will has thunderbird group while the owner will be me). But this way is not secure (because the owner will be me, so I can accidentally delete something from ~/.thunderbird).

Anyway, approach with setuid/setgid is unreliable and fragile (for example, after Thunderbird is removed and installed again the bits will be not present on the new instance of /usr/bin/thunderbird executable).

chroot is not a solution because Thunderbird requires access not only to its home directory by to shared libraries as well.

I've also looked into AppArmor. Yes, I can set up restrictions on Thunderbird. But it seems impossible to write rule that denies an access to ~/.thunderbird for all executables except /usr/bin/thunderbird.

Perhaps, the goal can be achieved via SELinux. But it's too complex to me for now. And it's superfluous: may be there is a simpler way.

Could you please help me and point to tool (or kernel module) that can allow an access to a directory for a certain application and deny an access for all the rest applications?

PS My distro is LinuxMint 17.1 32bit.

For this have you considered using a containerization solution like Docker to have an isolated version of Thunderbird?

There's some existing examples like this one.

Docker solves the problem of shared libraries that you identified in the chroot section of your question by bundling up all the dependencies within the container, and you could restrict permissions to directories that are mounted into the container.

One caveat to this approach is that you should ensure that the other users on the system that you don't want to read the data are not able to run docker commands (so don't add them to the docker group if you use it) as they could then get access to the data.


Can XHR patching prevent XSS side-effects? XSS & Single-Page Apps

I'm researching on web security, and have seen that token based authentication is good for CSRF prevention, distributed system architectures and processing performance.

But another problem is XSS. Not specifically talking about the injection itself, but the libraries. With single-page apps developers normally include hundreds of different modules into their code, which could later on execute maliciously when the app is in production.

Patching XMLHttpRequest

So I had the idea to patch the XMLHttpRequest property and take control of the original "native code" function, preventing third-party code from making ajax requests.

(function () {
  // my code
  let XHR = window.XMLHttpRequest
  window.XMLHttpRequest = null
})()

// load third-party code after...

I tested this in the console with facebook and youtube... all their ajax loaded content stop working.

Malicious Example

An example of uncaught malicious behavior is code that only executes in production by checking if the window.location is something like "app.x.com" so the developer doesn't realize of the ajax requests during development.

Patching the XMLHttpRequest property would prevent this, and taking into consideration that all other mesures were taken to prevent XSS (sanitization), this would close the final gap and let you take control of network requests, preventing malicious code from stealing the auth tokens.

Final Doubt

Are there any caveats to this approach? (security-wise)

Are there any caveats to this approach? (security-wise)

Yeah, it's not very thorough, you can get a new instance of the constructor from a new window object instead:

XMLHttpRequest = null;

var iframe = document.createElement('iframe');
iframe.style.display = 'none'; // optional
document.body.appendChild(iframe);
var XHR = iframe.contentWindow.XMLHttpRequest;
console.log(new XHR());

You would have to overwrite a lot more things to ensure a XMLHttpRequest cannot be accessed, that's just 1 way to do this.

For XSS protection, just use a Content Security Policy and only use trusted libraries from trusted sources.


usernames and passwords I was thinking about usernames and passwords and I was wondering how secure it would be to instead of the server having a list of usernames and accompanying hash of the passwords, just have a list of the password and username concatenated and then hashed, or something along those lines.

If someone could explain why this wouldn't work that would be great.

The problem of securely transmitting a username and password is a solved problem, HTTPS is elegant and works well.

In terms of this proposal it is significantly less secure than HTTPS,  because this proposed system is vulnerable to a replay attack.  Who cares what the username and password actually are,  if you just login with hash(user+password),  then this is the only value the attacker needs to know.

Secure hash based challenge responses usually innovate a causation where the server provides the client with a nonce,  and then the hash(nonce+hash(password)) is used.  The nonce can never be reused,  Microsoft's NTML has had this problem "fixed"  more than once.

After you login with the username and password you still need to protect the session id,  which is the authentication token sued by the browser to maintain the authenticated state,  so HTTPS is a good solution for this as well.


PCI DSS compliance on shopify using the client's payment processor I'm developing an e-commerce website for a client on Shopify, usually shopify integrates with many gateways, but for this instance, the client asked us create a custom checkout that integrates with a payment processor that is not supported by Shopify.

The development is done and everything is working fine (the site didn't go live yet), however I just got the genius idea to check if the process is PCI DSS compliant. I hope you can advice me on this:

Site is developed on Shopify
Customer checks-out and enters card data on the Shopify site.
Data are transmitted to our server (droplet) on Digital Ocean via an AJAX request.
HTTPs cert of the server is from Let's Encrypt
I just performed an online PCI DSS compliance test on https://www.htbridge.com and the results seem good except for one problem (which I try to solve asap):

The total price and shipping rates are recalculated on the server & and the date are send to the Payment Gateway.
Only order data is stored, everything except card info.

I have several questions:

Am I out of the woods yet, or it is still a long road ahead of us?
Is there an official PCI DSS compliance cert? is it obligatory?
Who would check the validity of the process? how & when?

You may still have some way to go I'm afraid.

If the card data touches your server, then your server is in scope.

If your server not segmented from the rest of the network then your whole network is in scope. This could include physical access to buildings and every desktop in the company.

You can get an audit if you want to be super sure you are compliant but that is usually only done by people selling solutions.

It's a bit late in the day, but if shopify doesn't support this gateway then you should probably try to find a 3rd party that does. The major selling point of this sort of provider is that they handle the PCI compliance for you. If not prepare for headaches.


Integrate antivirus with a sandbox When reading the Difference between antivirus and sandbox?, I came up with the idea of how to integrate a sandbox with AV. When the sandbox analyzes the sample and finds that the malware, antivirus automatically called and removes the malware. How can I do this?

Actually, modern antivirus software actually already uses a sandbox. Many of them will execute suspicious files in their own built-in sandbox, all the while monitoring them for malicious behavior for a fraction of a second. If the software appears to behave itself, the program is re-executed with the sandbox disabled. Otherwise, the AV software will quarantine or delete the file. This is a common technique in heuristic antivirus software. Note that malware often has techniques to evade this detection method by running a benign task long enough for the sandbox check to pass.


Is possible to attack a Wordpress website if someone know username and password of admin account? Currently, I prevented accessing my wp-admin by htaccess as well as used functions.php to create a function to prevent accessing admin panel if the user is Admin.

If someone knows the username and password of the Admin account, is it possible to change my website appearance as well as deleting posts/comments, etc.?

If possible, how could they?

As every lawyers first sentence: It depends. So without exactly knowing what you did, let's do a little "risk-assessment".

There are multiple ways of compromising wordpress based websites:

knowing the admin-credentials
finding a vulnerability in wordpress
discovering a vulnerability in one of the used plugins
finding a vulnerability in the webserver or it's configuration

Where vulnerability as in: Software-vulnerability, misconfiguration and so on.
Also we have to further split all those possibilities into two options:

going from zero to admin
escalating from user to admin

So let's see what you have accomplished: If the admin-access really is blocked and properly blocked, knowing the admin-credentials is not a direct threat to the page anymore (it can still be if you reuse credentials from somewhere else or if your .htaccess or function does not block all the resources properly).

There is still multiple options to go for when targeting your site. I suggest you have a look at this page. The statistics are a little too agressive in my opinion but you will get a feeling for the problems you might face when protecting your site.

  “73.2% of the most popular WordPress installations are vulnerable to vulnerabilities which can be detected using free automated tools.” – WpWhiteSecurity.com

This seems quite a lot to me but it's not unimaginable. That is not exactly what you are asking but it's some information to consider when thinking about how to lock down your site.
There also is a quote about credentials but its really out of context so read the links carefully before really making your opinion.

So without knowing your exact target or your exact approach: Locking down your admin account is a nice approach (if it works properly) but credentials are not the only way to transform wordpress installations into something else. And probably (careful; assumption) they are not really needed in most of the cases. If someone manages to find some SQLi or RCE in your WP installation (not unlikely as shown before) or one of the plugins (even more likely) your security measure might not really catch.


Technology that can survive a "Rubber-Hose attack" In the documentary film Citizenfour, Edward Snowden says about documents:

  I'm comfortable in my technical ability to protect [documents].
  I mean you could literally shoot me or torture me
  and I could not disclose the password, even if I wanted to.
  I have the sophistication to do that.

What technology/methods exist that would enable the scenario Edward Snowden is referring to when he claims to be able to create a protected file where he cannot disclose the password?

Shamir's Secret Sharing is a method for this. It allows one to encrypt a file with a public / private keypair, and then effectively split up the parts of the private key to be distributed to several different people. After that action (and assuming the various parts and original input private key are destroyed after distribution), it would require a quorum of people to act together in order to decrypt the data.


Clients breaking after avoiding RC4-MD5 As per http://projects.webappsec.org/w/page/13246945/Insufficient%20Transport%20Layer%20Protection , we have been recommended to stop using RC4-MD5.

The clients supported by our Application are IE 8 and above, Safari 5 and above, Chrome 18 and above , FF 12 and above, Mobile safari for iPhone, iPad.
Ofcourse we want to avoid BEAST and CRIME attacks.
Will there be any issues if we stop using RC4-MD5 on supported clients or any other issue ?

Unless you need to be FIPS compliant I wouldn't disable rc4 md5. You can simply prefer it as a last resort. You can configure your webservers in such a way that they will only resort to rc4md5 if the client does not support any other ciphers you offer. This way you needn't worry about supporting legacy clients.

To my knowledge older phones sometimes only supported RC4 MD5 (from the pre smartphone era).


Antivirus evasion for reverse tcp I'm trying to do reverse tcp in an exe payload. To do antivirus evasion, I've tried to use Veil evasion, The fat rat, and also Phantom evasion, but even if the exe wasn't deleted by antivirus (I use Avast in Windows 10), the connection doesn't start. The connection starts only if the antivirus is stopped, even if the exe isn't detected as a malicious file.
Does anyone know some methods to make a reverse tcp payload with antivirus evasion?

The ideal way is to write a custom payload with custom behavior, you will find this Link very useful
but you can try other tools like:

Shell7er
PoshC2
Hack The World:

for this purpose.


intel wireless 5100 AGN adapter to support injection i ran aireplay-ng -9 wlan0 and it seems that my intel PRO/Wireless 5100 AGN adapter does not support injection. i use Ubuntu 10.10 64bit (2.6.35-25-generic kernel).
is it possible to make the adapter have injection capability? if yes, how?

Try using Backtrack or Blackbuntu.  Those two distribution have better driver support for packet injection.  Some wireless cards need specially modified drivers.  Once you figure out which one you need you can install it in Ubuntu.  Backtrack and Blackbuntu are worth using for that purpose though.

Also it is worth noting that you MAY have better luck using a 32-bit OS,  Backtrack for one is only 32-bit because most drivers and tools work better.  I can't vouch for there being any issues with using a 64-bit OS though.

Good luck in your Penetration Testing. (I hope that's what your purpose is)


What this type of attack called? (gaining peripheral information) When the intruder looks at the transmitted data and finds information about the sender and the receiver of the data or other peripheral information that won't help him hack the system but know more about the transmitted data type/nature/ sender  and  receiver peripheral info.

What you describe isn't technically an attack. Nothing is exposed, nothing is exploited, and the parties involved are not affected.

What you are describing is a phase of an attack called "Information gathering". Any targeted attack will involve Info Gathering at some point so that the attacker knows what to do to gain what is desired (DoS, access, data, etc.)


Is there any way to send malicious keystrokes to wireless keyboard USB dongle? I have read many blogs on how to intercept wireless keyboard keystrokes. Similarly is there any way where we can send keystrokes to any keyboards USB receiver module? can we kick out the existing keyboard from the connection and manipulate the keyboard using some radio transmitter module?

In short, yes - for some keyboards. The technique used to intercept and sniff on some (mostly older than 5 years) wireless keyboards can be pretty easily leveraged to allow an attacker to transmit back to the receiver on those keyboards.

You say you are aware of blog posts that discuss how to intercept wireless keyboard keystrokes. If you are, then you know that those methods include breaking the 'encryption' of those devices. The 'encryption' used by those keyboards is as simple as XOR'ing the data with the MAC of the keyboard. Now consider an attacker has successfully obtained the key of the encryption, from there, he/she can use the same radio transmitter they used to sniff to start transmitting, instead of just passively intercepting.

Since this is RF we're talking about, there is no state-full 'connection' between the keyboard and receiver other than the predetermined protocol. This enables the attacker (that now knows the protocol, since he/she successfully sniffed the traffic) to start transmitting to the receiver pretending to be the keyboard.

An HID attack can then take place. The attacker could do many malicious things to the victim machine. Although, if the owner is using the machine, the attack is easily thwarted, simply by injecting random keystrokes or by disconnecting the receiver, so the attacker must initiate the attack at an opportune moment.

Edit: According to daniel's comment, I have tried to make my answer clearer and more accurate.


How serious is a local virus in terms of network security My colleague got a notification on his machine of a possible virus (through the virus scanner that is installed by default on all machines). He called up the tech department, and they simply told him not to worry about it and continue his work as normal, as they will look at it at the end of the day after he is out of work. I was pretty surprised by this, as I would assume that a virus detection could possibly be any form of malicious code that could potentially infect the network, and compromise my colleague's data. A virus could potentially lead to stolen confidential data.

Am I missing something here? Do companies monitor the network in a way that they feel secure about a potential virus on one user's machine.

There's two possible states I can think of:

The AV caught it on 'entry', stopped it, removed it, and logged it, at which point there's nothing else for anybody to really do
The AV just now noticed something that's been present for a while, so you're already 'compromised'; potentially, any data could have already been exfiltrated, and there's nothing to do but check the logs.  Analysis of the logs could take a while, can be done remotely, and would include checks of other resources (say, network connections) that likely have higher priority.


How could malware like Stuxnet be detected? Stuxnet and others in this list of state-of-the-art Internet worms had certain features that they were very stealthy in leaking out the information they harvested. Thus it managed to go under the radar and would typically go unnoticed by IDS/Firewalls. Stuxnet also had a feature that the infected machines contacted and updated other infected machines via RPC in a P2P fashion.

My question here: What additions or changes might be required to have intelligent UTMs/IDSs which can detect such malware which tend to be stealthy and go under the radar?

I am not inviting speculations here, but knowledge-based opinions and some great ideas...

I can think of some ways:

Malware connect to C&C server. if you monitor your traffic (as sensitive system should be monitored) - than you find unusual traffic that can be sign (and should be investigated)
If the malware uses USB flash drives to spread itself, and you have different computer platforms in your environment (e,g: windows, mac, linux and BSD systems), than you will see other platforms executables on the flash drives. This way you have a real "sample" of the malware to analyze. (most malware are platform specific), so you can see the malware files if you connect the flash drive to a non-windows machine without the risk of being infected)
Honeypots - You said that stuxnet is too smart to fall in honeypots, but I think that it all about who is smarter - the honeypot or the malware. If you use a common honeypot - the malware will ignore it for sure, but if the honeypot is using new techniques - it will not be detected as one by malwares.
keep in mind that some highly sophiticated malware, like Duqu and Flame, do spread only when instructed by C&C servers, that makes them much less vulnerable to finding by honeypots.

After I wrote this, I went to see how Stuxnet was found, Stuxnet itself was detected because of a bug who made BSOD (Blue Screen of Death) on infected computers (source). Flame was found while researchers were looking for another malware. I couldn't find how Duqu was found.

So we can all be very clever, but what we really need to find such sophisticated viruses is luck...


Why mobile phone app sessoins are never timed out? This question talks about the session time out for web applications. I have noticed that most mobile phone apps I use never ask me to login again after the first login.

These mobile apps call web services to get the functionality done. So they must be using some token based authorization system.

It seems to me that, because the session/token never expires, if someone else gets access to the token/session they would be able to impersonate the user whose token they stole.

My questions are,
a) Are above assumptions correct?
b) How do mobile phone apps not log you out after some period of time and still achieve good security?

They may or may not be using token based authorization, and they may or may not be timing out sessions.  The reason they never ask you to log in again is entirely separate, and for convenience.  Users don't want to log in over and over again, and apps that make them cause them to be unhappy, and being unhappy causes them to give the apps bad ratings, and bad ratings make the developers of the apps unhappy, and application developers don't like to be unhappy, so they don't make the users do things that they don't want to do.

So, some ways that apps that do time out session but don't require repeated logins might manage this would be, for instance, storing credentials directly, and using them to obtain a session token each time they need one, (not great) or they may be retrieving a long-lived authentication token on first use that they can store as a surrogate credential, and use that token to retrieve a short-lived session token when the app is used. (better option.)


Pivoting a VPN Connection Scenario: An attacker is connected via VPN to an unknown remote host. The remote host is assumed to have two NICs, one serving the VPN and the other serving another unknown subnet. In addition, the remote host is not exploitable using other vectors such as RDP or SSH.

Question: How can the attacker pivot of the remote host? A possible first step could be to find the details of the other subnet. Such as what you would get if you could execute "ipconfig/ifconfig".

Since it was not specified, I will address both TUN and TAP VPN servers. You can read more about the difference at the OpenVPN wiki.

Typically, a VPN server using TUN will push static routes to one or more subnets, or potentially for the entire address space, as to act as the default gateway. The client configuration file may contain information about routes, or once connected to the VPN, the attacker's routing table may be populated with information about the remote subnets. This information could be used for enumeration and scanning of hosts on those subnets.

In the case where the VPN server only pushes routes to act as the default gateway (e.g. OpenVPN's redirect-gateway def1 option), you may have to resort to blindly performing host discovery on RFC1918 private networks, perhaps using Nmap or another scanner.

On the other hand, a VPN server using TAP may result in the attacker receiving an address directly on the target network, so the local tun0 interface or similar will display information about the remote subnet. The attacker can also start receiving broadcast/multicast traffic on the network, which may help with passive discovery of other hosts.


Mitigation of potential risks with the recent Intel ME exploit Today Slashdot published an article about a new exploit involving the Intel Management Engine (ME) which allows for undetectable exfiltration of data from a system via a Serial-over-LAN tunnel to an outside host. Because this does not involve the host OS it is not detectable there (via packet capture).

As I unterstand the article it is generally not possible to simply disable the ME.

This leads to my question: Which countermeasures can be taken to avoid that such Serial-Over-Lan tunnel can even be established to an outside host.

A comment in the original article on bleepingcomputer.com for example asks about ports that could be blocked in a router. Preliminary search did not reveal any usual ports and I wouldn't be surprised if there is no specific port involved, because it is software-defined by whatever RAT is running on the host.

Pondering this, I had the idea that because the AMT TCP/IP Stack is apparently not integrated into the OS stack, perhaps changing the OS MAC address and enforcing a router-based MAC access control could be effective? For me, the host OS would be windows 8. But I'd welcome answers for any host OS.

AFAIK, stuff such as AMT(AMD has the same stuff call PSP), only works with a particular network adapter that supports the instruction.

So besides disable AMT from the BIOS, which is not 100% disable (unless you flash the firmware), another mitigation method is unplugged network cable connect to Intel adapter, and use another network adapter that doesn't talk Intel AMT.

There is a many Network adapter vendor. , since AMT is proprietary to Intel, so it is a safe bet that to use any external network adapter (not the internal one, as some may license technology from Intel to make it AMT ready) that not using Intel Chipset(with a risk of AMT enable).


Disable internet access of development PC for security My friend's company is trying to disable Internet access of programmer's primary development PC to improve security, while giving them another PC to connect to the Internet. He is a web programmer. I do not think this makes sense. It's going to be terribly annoying for web development. I think famous Internet companies like Google, Facebook or StackExchange would never do that. In my opinion, my friend's company should find some other way to improve security but I might be wrong.

Does this policy make sense?

First of all, I'm in the camp that thinks this is a terrible idea. Security is about trade-offs, usually trading potential safety against convenience. But in a business environment it's all about costs. The cost of a potentially malicious outside influence in your source code (which is dubious at best) would have to outweigh the increase in development costs, which will be dramatic.

The cost of security failure isn't an all-or-nothing game; you can mitigate the cost of security failure by using proper vetting, backup, code review, and SCM techniques and tools. Plus, these techniques help with other issues as well, not just security problems.

The only excuse for such a policy would have to be a gross understatement of the costs it would impose and a lack of understanding regarding the alternatives. And a company with that sort of management disability is not a good long-term employment prospect.

Now, that said, I can think of one environment in which such a policy is perfectly reasonable. Specifically, many security-related companies (and government security contractors in particular) have a red-green division on all resources. The "red" side is susceptible to outside influence, while the "green" side is absolutely isolated and self-contained in every way. No cross connect, no shared systems, no shared code, no shared information.

In such an environment, "green" development would have to happen on a machine that is disconnected from the Internet. However, also in such environments, each employee/developer is expected to have two workstations, a red one and a green one, so the empoloyee would not be utterly cut off from the Internet.


Is prototype pollution only exploitable on the back end? I received a Jira as a result of a security scan asking to update lodash for CVE-2019-10744, which is a prototype pollution vulnerability. After reading this excellent paper about prototype pollution, it seems to me that this would only be an issue when running JavaScript on the back end.

As we only use JavaScript on the client side, is it reasonable to deprioritize this particular class of vulnerability? Or can this be exploited client side as a vector into other kinds of attacks like xss? More generally, is there a reliable way to tell what kinds of JavaScript vulnerabilities are problematic on the front end vs. back end?

Prototype pollution can be exploited at the front end. Payloads can be sent in similar fashion to reflected and stored XSS, and affect the behaviour of the front end for the victim recieving them. So this is a real issue that you should deal with. The most famous example of prototype pollution vulnerabilities is probably from jQuery - a client side library.

However, prototype pollution attacks can be quite complicated to pull off as they need to be tailored to your specific application. And just because you are using a vulnerable library doesn't mean your application is also vulnerable. Figuring out if you are is probably considerably harder than just fixing the issue, though.

So update lodash! Don't deprioritize it!

If for some reason  an update is complicated, have a look at the no-pollution package that mitigate the issue without solving it completely. (On second thought, that library doesn't look like it solves anything.) If you want to learn more, I found this Medium article very helpful. This question could also be good reading.


Read-only vs. Write-protected From an information security aspect, is there a difference between saying "read-only" or "write-protected" storage/memory?

Is there a chance that a read-only memory would not be write-protected at the same time?

In addition, is the OTP (one-Time-Programmable) memories better described as write-protected memories or as Read-only memories?

Read-only means one can only read from it. Write-protected means that writing is possible but controlled. Those controls can fail.

If "read-only" is defined in the hardware, then it will always be write-protected at the same time.

OTP memory is OTP. After being burned, it is read-only.


Can standalone malware survive on current mobile devices? Can malware run on mobile devices? I don't see how it would be able to (given that those devices have fine-grained permissions and sandboxing). Unlike on a desktop OS, malware cannot access registry components; it also can't have root access unless the device is rooted. So does this mean current mobile OSes are immune to standalone malware?

Yes. Just about every security feature of mobile operating systems is implemented in software. Complex software like that can will have bugs. Some of these bugs will be exploitable to give unauthorized access. This applies to any sufficiently complex software, because programmers are no more superhumanly perfect than anyone else.


Using history of two-factor codes found on a phone If an attacker gains access to a cell phone's text messages, and that user routinely used text messages to receive 2-factor tokens can this information be used to gain further access to the persons accounts?

In the short term, the tokens obviously expire very quickly, so if your attacker has only had once off access this isn't a problem. If your attacker has live access to your phone's messages as they come in, then they can request a new token themselves and use it immediately to pass authentication before it expires.

With only a history of tokens, it is possible (with difficulty) to figure out the backing pattern that makes your authenticator unique, and predict future tokens - however the algorithms behind these systems are designed to make this impossible or infeasable without first analyzing many thousands of past tokens.


Intercept and modify simple TCP session? Say there's a simple socket-based server/client chat app like these. How is it possible for me to intercept whatever they are chatting and modify it? I've been looking around for MitM which requires ARP poisoning, which is not applicable for my exercise.

Another thing is TCP session hijacking but I don't understand how it works. Can anyone give me small idea, or maybe good links where I could learn some, or maybe some python code (preferably on GitHub)?

I don't have trouble learning,  Or maybe some open source tool that can do this, I just don't want to be a script-kiddie.

TCP Session Hijacking

Let's imagine a client communicating with a server over a network connection. The client has authenticated with the server and has been granted access. So far, so good.

An attacker is on the network between the client and server, and has been keeping an eye on their session. This has given him time to learn the port and sequence numbers needed for the conversation to take place. Because he knows the sequence numbers, he can anticipate the numbers in subsequent packets (see: TCP sequence prediction attack). This is when the attacker decides to intervene.

He paralyzes the client by launching an ICMP flood, ensuring that the client cannot respond to the traffic sent by the server. This allows the attacker freedom to communicate with the server as though he were the client. Because the client is paralyzed and the server has sent out a response, the attacker gets to it first, forges a packet that appears native to the established stream, and the server is none-the-wiser.

Here is a figure to help you understand the role sequence numbers play in the protocol and how an attacker can take advantage of it:

Source: https://www.cs.umd.edu/~shankar/417-F01/Slides/chapter3b/sld003.htm

This is the best I can do, for now. I haven't been able to locate any Python code or open source tools that can do this sort of thing.


Why is it unsafe to use a password that exists online? I recently saw a post asking why something that appeared to be a random string of characters was a bad password. One of the answers was that it already exists on a website so you can Google it by just searching the password.

More recently, I found out about Have I Been Pwned which has a database of user information that has been breached in the past. On its page about passwords, I noticed the same thing that the person said on StackExchange:

  This exposure makes them unsuitable for ongoing use as they're at much greater risk of being used to take over other accounts.

Why does the password existing online make it unsafe? If I uploaded an infinitely large text file containing every password possible, would that make all passwords unsafe?

A major difference between your hypothetical situation and the current situation is that instead of attackers having to brute force every possible configuration possible (your list), they can brute force with a list of every known configuration. Mathematically, if we assume all passwords are a variety of 8 characters with (Uppercase[26] + lowercase[26] + numbers[10] + special characters[26]) possibilities, that gives us a mathematical sum equal to...2.9642774844752946028434172162224e+79 or a lot. A lot more than 750,000,000.

And that's just 8 character passwords. It gets much worse with 9 and so on.

For an attacker, a library of all the known passwords makes it much easier to crack the general populations' password without the computation expense of generating and testing all those possible combinations. Even better, it cracks longer passwords too which is a nice bonus.

So for you to defend yourself best, you are best off hiding in everything that the 750,000,000 doesn't cover because you're that much harder to find. This is why NIST, Troy Hunt, and others recommend keeping your password unique to you as long as you possibly can.


Random token and email confirmation key of 10 chars sufficient? I have a function that returns random unguessable keys with the following characters: a-z A-Z 0-9.

I have set the key length to 10 and I am using that for my form tokens to prevent CRSF and I will be using the same function also to generate email confirmation keys.

My question is if that will be secure enough to use?

The form tokens will be tied to a user session, and the email confirmation keys will be stored up to 24 hours before destroyed. Other than that I will not keep a log of them.

I have noticed there are a lot of sites that use extremely long confirmation keys with a length of about 30-40 characters. In my eyes that looks way overkill.

If you add limited validity period (like 20minutes) for these keys (csrf, email confirmation) then I would say it is sufficient.

Also this is assuming you do not keep any history of the keys.


How to restrict third closed source process to read only own folders on Linux? I have DropBox, Opera, Steam and others third closed software on my ArchLinux. I don't trust them, so I want limit its to read only its own folders aiming security and privacy protection.

The first idea that comes to mind is inspired by the way Android handles this: create a new user account for each app.

When you want to install a new untrusted program, first create a new user for it. Next, install the program as that user, in that user's home directory. Launch the app through scripts like su dropbox; dropboxd and set the permissions such that apps can't read each other's files. Make your login user a member of all these groups so you can still read the files.

Note: this is an off-the-top-of-my-head idea, I have no idea how feasible it is. It may take a fair amount of work to build a workstation that behaves this way while still being moderately user-friendly.


Client/server communication keystore and tls I want to establish a client-server communication using TLS protocol. The point is I dont understand a few things since I don't know many oner security. I have created certificates for my server and a certificate for a specific client. First of all, do I have to create a certificate for any other new client? Second, in some examples in web I have found code that uses keystore. Do I need keyes even though I have certificates? Thank you very much.

Certificates are used to prove the authenticity of a given computer. TLS is just used to encrypt the data.

If you want to prove the authenticity of the Server(which you want to, atleast in most cases) then create and use a Certificate for the Server, this requires that each client connecting to the server should somehow be able to verify the Certificate of the server.

If you want to verify the authenticity of each of the clients, then you need to create a unique certificate for each client and then verify the certificates of each client in the server.

A keystore is just a list of Certificates that are used to verify a given certificate. for instance a client will use a keystore to verify the certificate of the server.

This Thread explains how the Certificates are Verified.


Microsoft Word protected view - is it secure enough to protect users? We had a user receive an email with what appears to be a Word Doc virus and it wanted them to open the file and enable editing.  If they did not enable editing but merely opened the file, should we be concerned that they may have gotten a virus (assume they are telling the truth about not having enabled editing)?

No. It is still possible to get a virus via MS Word. If the virus utilisies an exploit kit, it auto-executes without any user interation. If it is a macro virus depending on the level of security, the user, assuming macro security is enabled, will either have to click 'enable' in a pop-up or won't be able to activate any macro. So it isn't impossible to get a virus via MS Word, although it isn't too likely. But still take precautions.


Do It Yourself Credit Card Storage (PCI - DSS Compliant) I'm a software developer, considering writing a custom system for credit card number storage. Our intent is to be fully Payment Card Industry (PCI) compliant.  I'm working with a small business owner who rents things and would like to keep a credit card # on file ensure the return of the item rented.  If a customer fails to return an item on time, then they get charged per their signed rental agreement. The credit card info is purged upon merchandise return.

We are aware that some credit card processors, in addition to normal credit card processing we use for the rental payments, also offer a service for the STORAGE of credit cards. They store the credit card numbers and provide you with a token representing that card in storage. (e.g. Paypal, Stripe) This business owner already has a commitment to a credit card processor that does NOT offer that service.  Changing the credit card processor to Paypal or Stripe does not appear to be an option.  We also investigated credit card storage vault services (using tokens) and won't work either.  $1300 / month to store 500 cards is a bit too expensive for this small business.

I've seen some key postings here:

PCI Encryption Key Management
Web Application encryption key management
Storing sensitive information securely

I can see that all three of the major Cloud storage providers (Amazon Web Services, Microsoft Azure and Google Cloud) are PCI DSS compliant as an infrastructure.

I'm seriously considering using one of those services as a repository for Credit Card information.  Obviously we want to be fully PCI DSS compliant.  I know how to write apps and servers.  I know how to add a robust login system.  I know how to use published encryption libraries, for server side encryption.  I know how to create a MongoDB on a separate server hosted in one of those cloud services. I know how to communicate with server via https.  What I'm not clear about is the whole key storage thing.

From the first linked item above:

  The encryption key (EK) you use to encrypt the data, should be itself
  encrypted by a key encrypting key (KEK). The encrypted EK should be
  stored in a protected place - this can be a file, a registry key,
  whatever - the important thing is restricting access to it, to the
  appserver's user only.

I'm a little confused by that description. I thought everything has gone to a
public key / private key encoding technique. Do I assume that in the above reference, the encryption key mentioned above is actually the private key?  Or am I incorrectly mixing algorithms here?

I had presumed we are using a public key / private key algorithm.  I would assume I will include the public key within my server code.  My intent is to store the private key totally offline in a different location (and yes, meeting the requirements for PCI-DSS 3.5.3).  My tendency is to require a custom copy / paste of the private key for a credit card decode/retrieval.  This is a pretty infrequent process, and will likely only be performed by the business owner.

But perhaps I'm just doing this all wrong.  What is PCI-DSS "approved" algorithm for individual credit card encoding? From what I can see, the specific requirements are stated as:

  The intent of strong cryptography (as defined in the PCI DSS and
  PA-DSS Glossary of Terms, Abbreviations, and Acronyms) is that the
  encryption be based on an industry-tested and accepted algorithm (not
  a proprietary or "homegrown" algorithm) with strong cryptographic keys...

Here are my questions.

What algorithms for public/private key style encoding are currently recommended to meet the PCI-DSS standard here?
If not public/private key encoding is some other encryption technique recommended?
Am I doing this correctly?
Any other comments, or lessons learned here?

Many thanks.

The PCI DSS isn't expressly clear on this topic.  The meaning of secure key storage and secure key management is left up to the QSA's interpretation.  You may find that that one QSA considers the private KEK to be all that needs to be secured, and he treats the EKs as tokens.  Or you may find a different QSA that sees every individual EK as needing to be secured, even though they've been encrypted with a KEK.  We've had both kinds of auditors, and frankly, I thought the "harsher" of the two was more competent (even though I disagreed with his assessment of the risks.)

The bigger problem I see is that you're not taking into account the cost of owning this system.  A complex system like this is going to take time and money to build.  It will require the auditors to make a very careful examination of all the nooks and crannies of the systems, which will also take a lot of time and money.  And they'll have to repeat their examination every year.

Consider that under the current rules, if you build a system that gets breached, the rental guy will be liable for 100% of the costs of all fraud associated with the breach. That means if someone steals a millionaire's card and charges a Ferrari on it, he's liable for the loss.  If someone steals 10 millionaires' cards and charges one Ferrari on each of them, he's liable for the whole loss.  His lawyers, of course, will immediately turn around and sue you for building an insecure system.  And they will sue the QSA for incompetence at not telling them that your homemade system was insecure.  So the QSA has to charge enough not only to pay for the time spent auditing the system, but also some insurance to cover their risk.

Frankly, the rental guy would be better off having his counter employees making photocopies of customer ID cards and dropping the copies into a drop-box type safe under the counter; and keeping his security cameras rolling.  If a customer fails to return an item, or returns a damaged item and contests it, he'll have the evidence he needs to bring the renter into small claims court.  That's a whole lot cheaper than building a PCI DSS compliant system and maintaining it.  (And that's really the point of the PCI DSS - the auditor should identify and explain the risks, the business owner should carefully consider the risks, and then make wise choices.)


Package metasploit is not available I am trying to install kali linux on my docker. So, i just tried to follow this page.
After i run these two commands:

docker pull kalilinux/kali-linux-docker
docker run -t -i kalilinux/kali-linux-docker /bin/bash

and i have the kali image on my docker. but when i try the command:

apt-get install metasploit

i face with:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package metasploit is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'metasploit' has no installation candidate

so, how can i solve it?

When you search it (apt-cache search metasploit) you see that the package is called metasploit-framework. So you can install it with apt-get install metasploit-framework -y.
And you should use apt-get update before to get the latest version.


What is the status of forced HTTPS everywhere (Strict transport security) via DNS? I only see the July 2010 draft I'm trying to find the most recent RFC on HSTS in DNS (or rather said DNSSEC), but can only find this year old one in expired draft status

Where can I find the most current guidance on STS in DNS? If it's not available yet, how can I keep informed of the latest developments?

Click the link in the header: this draft dated Mar 2012 replaces the one you linked, and expires in Sep 2012.

See also the websec working group.


TLS 1.0 fatal (2) handshake failure I would like any seasoned analysts in network security & cryptography to help me confirm the following case.

I have a .NET console application to get information from a web service hosted in the Exchange server 2013. Every time I execute the console application, I see in Wireshark that the TLS 1.0 is refused by the Exchange server. What I did to check the list of supported SSL protocols on the Exchange server was to use nmap. Below is the command

nmap -p 443 --script ssl-enum-ciphers exchange.contoso.com

Output is as follows

However, there is no cipher supported by the destination server that is in the SSL packet sent from the client. Below is the cipher suites of TLS 1.0 the client sends to the Exchange server.

With this information, could I confirm that the destination server refuses TLS 1.0 because there is no cipher supported accordingly? If so, how can I sort the problem out? I was thinking allowing more SSL protocols in Windows Server (registry modification like this article https://support.microsoft.com/en-us/kb/187498)

Any suggestion would be very much appreciated.

[Updated]The client's OS is Windows Server 2008. Upon Steffen's answer, I have to figure out how to make the console application or the client to use TLS 1.2.

I would like to put more updates. When I opened the website (with SSL), I noticed that the destination server accepted the TLS 1.0 protocol.

Cipher suite of client-hello packet

The response from server

Perhaps I have to put something in my .NET console application to specify the protocol it should use by default.

Yes, the server supports only RC4-SHA with TLS 1.0 and TLS 1.1. With TLS 1.2 it supports several more ciphers. Since all of these (GCM) ciphers where introduced with TLS 1.2 they are not available for TLS 1.0 and TLS 1.1 connections.

You can solve the problem in the following ways:

Have the client use TLS 1.2 so it can offer more ciphers. The protocol is available since Windows 7.
Enable support for RC4-SHA4 at the client. This cipher is often disabled for security reasons.
Enable more TLS 1.0 ciphers at the server side.


How to make / dump contents of memory for forensics analysis? I work as a Information Security analyst and was recently tasked to look into Incident response + computer forensics related topics. For starters, I am experimenting on my PC which is running Windows 7 64 bit SP1). I have downloaded a live memory analysis tool named Volatility and tried the first command:

python vol.py pslist -f /path/to/memory.img --profile=Win7SP1x64=

I got an error stating that I don't have image or file for analysis and realised I have no clue how to dump live O/S memory into a file.

I did some Google search for tools e.g encase, helix, MDD, hBGARY but found these tools to be far complex for my current knowledge about this field. Furthermore these tools aren't free.

Note that I am NOT looking for recommendations for which tool to use, I would like to understand the process and how to go about taking memory dumps for forensics.

If you google for forensic memory dump tools, one of the first ones to come up is the free Microsoft SysInternals tool, LiveKd. Helix is also free, and has greater functionality. Download the Helix ISO and have a good look at the tools available.

As far as complexity, all these tools provide a wide range of functionality. This shouldn't be confused with being too complex, as you will just use the functions you need. This goes for Volatility as well.


Do MS monthly security rollups include previous monthly rollups? do Microsoft monthly quality security rollups include previous-monthly releases? For example, if you skip march rollup and install april's?

For Windows 10, updates are cumulative. In October 2016, all patches to Windows 7 and 8.1 became cumulative as with Windows 10. The ability to download and install individual updates were removed as existing updates were transitioned to this model. Source: Wikipedia

I interpret this as if you will get March's update too if you install April's.


Why is it not standard practice to run password-based KDF's client-side? In most protocols I have encountered in which a passphrase is used for authentication it is stored not in plaintext, but a PBKDF digest of it instead. This is obviously good.

However what does not seem to be standard practice is to compute this PBKDF digest on the client-side while registering/updating a passphrase. Instead, it is often sent to the server and then the user is left to only hope they handle it properly.

Why is this so? Am I missing something?

EDIT: Because this was unclear to some, I don't mean to suggest the server-side should not hash. The server should. I'm asking why it's common practice to not hash client-side at all.

I think the main issue are the client side languages (normally JavaScript), they are relatively slow. This would often lead to fewer hashing rounds and therefore weakens security.

If your client side language is fast enough, you could calculate the expensive PBKDF client side, then calculate a cheap hash on server side (SHA512 for example). To get the plaintext passwords an attacker still had to calculate the slow PBKDF. It is also not possible to use the PBKDF directly as password, because only the hash of the PBKDF is stored (the output of a PBKDF2 can be seen as a very strong "password", so it is safe to use a cheap hash function).

One downside is, that the handling will become more complex, you need to send salt and cost factor to the client for verification of the entered password. Another problem is to ensure integrity of the client side code, if somebody could alter the delivered JavaScript code, he could return a known string and you would store the now unsafe PBKDF.


How to patch against RefRef's DOS attack Overview
Anonomous claimed responsibility today for the Denial of Service attack against wikileaks.  They are using a new software called RefRef.  It seems to exploit MySQL using the server's processing power against itself.  This of course requires no botnet.
Question
I can't find much information about this new software.  I would like to know what I need to patch MySQL in order to protect against this exploit.

If this http://www.refref.org/p/refref.html is the DOS i did some research.

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.5.9     |
+-----------+
1 row in set (0.01 sec)

mysql> select benchmark(99999999999,0x70726f62616e646f70726f62616e646f70726f62616e646f);
^CCtrl-C -- sending "KILL QUERY 193" to server ...
Ctrl-C -- query aborted.
+---------------------------------------------------------------------------+
| benchmark(99999999999,0x70726f62616e646f70726f62616e646f70726f62616e646f) |
+---------------------------------------------------------------------------+
+---------------------------------------------------------------------------+
1 row in set (3.55 sec)

mysql>

It does not crash the MySQL daemon it just seems to do what the benchmark function is suppose to do, it evaluate the expression 0x70726f62616e646f70726f62616e646f70726f62616e646f 99999999999 times which will take a lot of time. 0x70726f62616e646f70726f62616e646f70726f62616e646fis the ASCII string "probandoprobandoprobando" where "probando" is the latin word for "proving", i guess someone wanted to prove that the benchmark function work as it should.

So the original problem is to make sure your are protected against SQL-injection which should be quite easy if you use some sane database abstraction and don't build your own SQL queries with string concatenation etc.


Mobile apps that use OAuth2 to offload authentication to a 3rd party: are they misusing OAuth2? I have been tasked with building a mobile app that requires users to login to a 3rd party service via OAuth2 to obtain some data about them. This mobile app also requires its own backend database storage via a webservice and access to this needs to be secured by user.

I understand the usage of OAuth2 in gaining permission to access 3rd party APIs, but I am less clear on using 3rd party authentication as the basis to secure my own webservice.

Many, many mobile apps use 3rd party social logins like Facebook as ways to offload the authentication process to a separate provider. I see the benefits of this, such as not needing to ever receive a users password. This post details the exact use case I was looking at

I also read many posts on here and elsewhere that say "OAuth2 is not authentication."Example and Example

Further, the particular OAuth2 provider I am using does not return any unique user identifier I can use as a key for a user record in my database, only OAuth2 tokens and non unique user data.

This leads me to think that OAuth2 isn't really about offloading authentication to an oAuth provider at all: it is purely about gaining authorisation to access 3rd party APIs.

Are all of these 100s of mobile apps using OAuth2 social logins in place of their own authentication actually misusing OAuth2? Should my app have its own authentication and store the users credentials aside from requiring a social login to access their social information?

You are correct that oAuth2 only gives your application permission to act on the user's behalf in their API. oAuth2, by itself, has nothing to do with authentication.

If the third party API has any sort of request that gives you a unique ID for the user that you're working on, then their API can be used as a form of authentication, with the caveat that you're putting your trust in authentication into a system that you don't have control over, and a reminder that authentication is not authorization. (Just because they showed a valid ID card doesn't mean they're allowed to walk into your bank vault.)

But yes, oAuth is only concerned with letting you use the third party API on a user's behalf; it has nothing to do with the accuracy and security of that API beyond identifying you as acting on behalf of the user.

As far as whether or not your application should use their API for authentication, I suggest doing a risk assessment. There really isn't enough information in your question for us to inform you of any known risks, as we don't know how sensitive your data is (will people try to steal your users' accounts?), or how secure the third party's API is.


What does a Let's Encrypt (or other DV) certificate prove? This is a follow-up to other questions like "What makes Let's Encrypt secure?".

When I first run the Let's Encrypt (certbot) client on my server, it obtains a certificate by publishing a certain file on www.mydomain.example, which proves to the Let's Encrypt service that I really do control the website at www.mydomain.example.  Now I have the certificate, visitors to https://www.mydomain.example will see a padlock icon.

This indication would be meaningless if Mallory somehow gained the ability to serve pages from www.mydomain.example, since with that ability she could easily get a new certificate the same way I did.  Previous answers have only said that the CA counters this possibility by validating my server from multiple locations around the world.Am I right in understanding that DV certificates rely on attackers not being able to hijack a DNS entry globally? Is that simply not considered to be a risk?
It occurs to me that CAs could mitigate that risk by requiring that when I renew the certificate, as well as verifying that I control the domain, I must also prove that I have the previous certificate.  Even if Mallory somehow steals my domain, she cannot get a new cert for it because she doesn't have the old private key.Do CAs do something along these lines?

Like most site admins, my main concern is simply to make the padlock icon appear, because users are increasingly warned to avoid sites without it.  And, if I didn't use HTTPS, users on public wifi would be sending passwords etc in the clear.  But it's still not clear to me what, if anything, that padlock should be assumed to prove.

DV certificates only validate that the certificate request for a given domain came from someone who has control over that domain. It validates nothing else. An attacker who can hijack your site's nameservers or otherwise take control of the domain's DNS settings will be able to get a DV certificate issued for them.

Avoiding this requires using a different (and more expensive) certificate, specifically OV (Organization Validation) or EV (Extended Validation). An OV certificate involves the CA verifying that you exist as a legal entity and have permission to run that domain, such as verifying that example.com is owned by Example Ltd. An EV certificate additionally verifies your physical presence, checks that you alone have exclusive control of of the domain, and ensures that you have legal authority to request a certificate. Naturally, these certificates are more expensive as their issuance cannot be automated like DV certs.


is LastPass SMS Recovery a security risk? According to the LastPass FAQ, employees of LastPass cannot see nor decrypt the stored passwords.

  LastPass encrypts your Vault before it goes to the server using
  256-bit AES encryption. Since the Vault is already encrypted before it
  leaves your computer and reaches the LastPass server, not even
  LastPass employees can see your sensitive data!

However, there is an option to use SMS Recovery in case of a lost Master Password.

  One method of gaining access to your account after you forget your
  Master Password is to use SMS recovery to reset the password. This
  method, however, requires that you enable SMS account recovery in
  LastPass before you forget your Master Password. If you have already
  enabled SMS recovery for Master Password retrieval, do the following:

  Navigate to https://lastpass.com/recover.php, enter your email address, then click Continue.
  The system texts your phone a numeric code. Enter this code into your browser, and click Verify.
  Click Press to Recover Account.
  If Multifactor Authentication is enabled, authenticate yourself, but you must type the authentication numbers in your web
  browser for this step.
  When the next window appears advising that Account Recovery has been detected and that you must immediately change your password,
  click OK to proceed.
  Enter a new Master Password and a password hint (optional), then click Confirm.
  When prompted with a message that your password has changed and advising you to log out manually (if you are not automatically
  logged out), click OK to proceed.
  Once you have been logged off of LastPass, you can log back in again using your new Master Password.

This suggests that the stored passwords are decrypted without knowing the original master password, and re-encrypts them with the new master password. This happens all server side.

To me, it seems like LastPass employees could abuse this method to decrypt users passwords.

Am i correct or am i missing something?

Yes, it is a slight security risk, for the reason Conor Mancone points out. But no, it does not mean that LastPass stores your master password on their servers, and would-be hackers need to do more than just obtain the recovery SMS.

To use SMS recovery, you must have access to a computer and browser where you have previously used LastPass. LastPass generates and stores a recovery one-time password (rOTP) on your computer when you log in the first time on a new computer/browser. This rOTP essentially works like a second master password and is only stored locally on your computer, but is disabled until you request account recovery. The recovery SMS just activates the rOTP, allowing you to access and decrypt your vault using it, after which you can reencrypt it using a new master password of your choice (the rOTP is disabled permanently after being used once).

Without access to a computer where you have previously used LastPass, SMS recovery won't work. This means that any hackers or LastPass employees that want to use it to access your vault would first have to get access to a computer where you previously logged into LastPass, and where you haven't taken steps to delete any traces it left behind.

More details are in the blog post announcing the SMS recovery feature. The LastPass help file you cite unfortunately is ambiguous and confusing on the rOTP part.

A more technical (and less ambiguous) description can be found in the LastPass Technical Whitepaper (I'm not sure that link is stable, so click "Technical White Paper" at the bottom of the Overview of LastPass Enterprise if it's broken). See page 10, under "Recovery".


Can you use Google's authenticator app when Google "makes sure that you’re really you"? I've heard that you can configure your Google account to use its (more secure) authenticator app rather than sending you a text message - in my most recent case, this was when Google sent me a text message to "make sure it was really me" when I signed in from an unknown device.

However I can't seem to find any setting that allows me to switch Google's mechanism of 2FA to the authenticator app for this scenario.  Is it possible or will they always use the text message method?

Yes, you can do what you are asking. Just open the Google Security settings from here and open the "protect my account" section. From there you can add other phone numbers, configure your android device to allow new account logins and also configure the Google authenticator app.


Is it risky to install a theft-protection system? I recently bought a Dell laptop and found out that Dell recommends to install a theft-protection system called LoJack. It is a system installed on the BIOS; if the laptop is stolen, it is possible to connect to their website to locate the laptop, delete files on it, etc. Since it sits on the BIOS, it cannot be removed by formatting the hard-drive.

It seems like a good security measure. On the other hand, it seems to give a lot of power to the company behind LoJack; apparently, any of their employees can now control my laptop remotely.

So, my question is: do I put myself on risk by installing such a theft-protection system on my laptop? Are there known cases where a laptop was taken control of using such a system?

Here is the good old wikipedia info on LoJack for laptops.

As mentioned by the page, it is NOT a remote control tools, but piece of tools that trigger as "beacon" and send information back to its designated home server.

Perhaps the biggest concern is not about the computer being hijack by more sophisticated malware(as mentioned in the wiki page about rootkit installation through vulnerabilities), but the company able to monetize from the demographic data the server collected.


Will using super-glue on the screws of my laptop prevent it from being opened unnoticed? I know someone can break open the case, but what about opening it without leaving evidence?
Are there any seals available for securing your laptop from unauthorized access?
And sealing the sides of the laptop with superglue

Are there any seals available for securing your laptop from unauthorized access?

Yes.  Google, or look on Amazon for, "tamper evident stickers".  These stickers will fall apart if removed, making a messy residue that can't be put back in place.  You can put them so they cover screws and along the sides where the laptop comes apart.

And sealing the sides of the laptop with superglue

That seems a bit more drastic and messier than using stickers, and probably easier to tamper with (re-glue looks just like glue).  I'd just use the stickers.


phishing from chrome This just showed up in Chrome.

It's obviously phishing - the mangled English and weird url give it away. How would it work? Asking me for info I shouldn't give them?

My system then slowed down. Reboot asked to check files so I did.

Restarted in safe mode with network. Backed up files to another place.

McAfee status OK.

Need I worry about how they managed to hijack my NY Times page to display this?

Need I worry?

Answering my own question, so it doesn't remain unanswered and may help others.

I thought nuking from space (as suggested) might be overkill. I asked friends and got this advice, which I took:

Googling:
https://answers.microsoft.com/en-us/protect/forum/protect_other-protect_scanning-windows_10/virus-warning-big-red-page-wanting-me-to-call/b451426e-1408-40ff-b171-4c83a149b761

Did you visit Yahoo at some point in that browser session ... ? (No)

https://answers.microsoft.com/en-us/windows/forum/windows_10-security/google-chrome-critical-error/92ddd0e1-b860-4d63-b6af-f8a5da2c159f

Suggests accidentally clicking on an ad as a cause, and suggests
installing an adblocker (and clearing browser history) as a solution.

I also recommend running a complete virus scan before you do anything
else after you clean cache and cookies.

The problem has not recurred.


How should a web page respond to a CSRF attack? I know that you use tokens to prevent CSRF, but how should the receiving page respond when it is attacked? Should it fail silently, pretending the transaction was successful? Display an error message? Log the attack?

Please explain your reasoning for your answer as I'd like to understand the why behind a best practice.

Edit:

Some of the answers so far seem to advocate giving the users an error message of some sort. One part that I didn't think of when I asked this question is the possibility of false positives. Maybe I'm just not being imaginative enough, but I'm having a hard time creating a scenario where a legitimate user would be mistaken as a CSRF attack in the course of normal use of a website. Can anyone explain how this could happen? How would the CSRF error message ever appear if a CSRF wasn't actually in progress?

If a user can accidentally trigger a visible CSRF error message, I guess I can see the point, but if they can't, I'm not sure why you would want to display one. Presumably the attacker would know that they are attacking, so giving them an error message seems either pointless or giving them more information than they should have. If someone could clarify, it would help me understand it more fully.

In case you are using a secret token solution to counter CSRF attacks. There can be many response strategy in case you do not receive the secret token in your request where you expected it ( I will not go into when you should include/exclude the tokens). You need to keep a balance between usability and security

Some of possible response to user can be

Invalidate the session and take the user to the generic session expiry page. THis page can be common page for idle timeouot, use of back/refresh button etc. THis should be considered for web sites like transanctional, handling very sensitive data etc.
Do not invaldte the session, ask user to renter the password
Redirect user to a confirmation page before processing the request

In all cases you should log this as a security event.


Is it safe to connect an M.2 SATA SSD (via USB 3.0 adapter) from a hacked Windows computer to a Mac? As long as the Mac doesn't try to open any potentially harmful files on the drive, what's the worst that could happen? Could a firmware hack happen?

First check if any launch agents or daemons are enabled which may try to access the USB storage when detecting a new device is connected. Also, use using launchctl to view and disable any automatically run programs which may be accessing the USB storage.

Since there have been instance of cross-platform malaware (e.g. some of whom have used Java), its best to remain cautious.

I would recommend installing an anti-virus/anti-malaware temporarily on the mac for precaution, before connecting the drive.