Are Chrome file system API not supercookies? Why are people not worried about them? Chrome has a file system API that seems to persist through normal clearing of the cache, etc.

(In fact, I'm not sure if there's any built-in way to clear this data globally.)

Isn't this a security issue? Why is this allowed, and why does no one seem to be worried about it?

I seem to recall that storage mechanisms that aren't easy to clear have always caused lots of security concerns, and I'm baffled at why this one seems to have flown under the radar.

Is there something about it that makes it less of an issue than usual?

In order to use persistent storage, the application must request quota, which results in a prompt to the user.  It could obviously be used as a supercookie at that point, but given that the user has been prompted, it seems to be a less concerning avenue than other areas.  (Also, being Chrome specific would likely make it less targeted than other supercookie techniques.)

Temporary storage is not prompted, but the browser can clear it at any time.  I'm not sure when this occurs, but I believe it should occur if you clear all local data.

I'm not aware of any specific security concerns related to this API, since it provides a sandboxed filesystem to each origin.  (It cannot read/write arbitrary data from other applications or locations on the user's computer.)

I consider this a privacy issue more so than a security issue -- in my mind, if the API is working as intended and does not leak/reveal data that was not in the original design, then it's a privacy decision that was made by the spec designers.  (Obviously, many users are unhappy by many privacy decisions that have been made -- I'm not saying it's desirable.)  It becomes a security concern when a privilege boundary is crossed or you can use it to reveal information that the designers did not intend.  (Such as the implications of canvas fingerprinting.)


A malicious folder is created automatically? After I ran a third party game and uninstalled it, my antivirus is showing this message repeatedly every 7-8 seconds.

When I run the antivirus it shows the malware detected and removed, but again the problem persists, the message is displayed. I found the folder in "C: drive" when I tried to delete the folder myself, it is created automatically. I am using Windows 7 Ultimate, my PC and antivirus are fully updated.

The file it is trying to download is not exactly malware; it is a potentially unwanted program (PUP) (probably spyware). See here for details.

Apparently the game you downloaded was either downloaded by a downloader, or packaged into an installer, that relied on OpenCandy.

From their site:

What is OpenCandy?

OpenCandy is a service that helps app developers earn money and keep their apps free-of-charge for you, the user. Developers earn money by recommending other select, free apps during the download and install process of their free app. We guarantee that all app recommendations are optional and you may choose to accept, decline, or uninstall any app at any time. As it takes an enormous amount of time, effort and investment to create apps, we are focused on helping these developers keep their apps free (and their lights on) while maintaining the highest quality user experience.

Usually you should get:

a checkbox in the install process allowing you to opt-out and not install OpenCandy on your computer;
an entry in the Control Panel > Installed Applications > Uninstall list allowing you to remove OpenCandy after you have installed it;
OpenCandy entrypoints and hooks that are not hard to hunt down and kill.

Since it's too late for option #1, see whether condition #2 holds. Unless your game's developer was feeling particularly unscrupulous, you should be able to find an entry for either OpenCandy or Advertising which you'll be able to remove.

IMPORTANT: be aware that some tools claiming to remove OpenCandy or listing it among the spyware they remove are malware in their own right.

This tool (others exist) claims to be able to remove OpenCandy, and at this moment, VirusTotal gives it a clean bill of health. (Their site is listed by ESET Smart Security, updated not five minutes ago, as "unsafe" - I have notified ESET).


Windows 10: telnet - Openwall GNU/*/Linux telnetd running on an open port normal? I noticed my internet connection was acting a little strange (stuttering up abruptly seemingly randomly), so I thought I'd see what's using it using Zenmap.

I ran "Intense scan" using the latest version of Zenmap and set the target to my modem's default gateway ip.

5 ports open 2 filtered. Most of the service names check out (netbios-ssn, microsoft-ds, icslap, http (Router name as Version)...), but there's this one I find really suspicious:

23  tcp   open   telnet   Openwall GNU/*/Linux telnetd

When I search for windows 10 and telnet nothing noteworthy pops up. If I search Windows 10 Openwall... I get nothing with both those keywords in it.
Checking out Openwall, I'm greeted with this Jack the Ripper bit about fast password cracking.

I've never installed any such software directly, and checking out the running services in task manager there's nothing by the name of "telnet" or "Openwall".

Any kind soul willing to tell me if I should freak out or not?

Your question is a little unclear (and I don't have the reputation required for comments) so I'll assume that what you're referring to is having scanned your default gateway IP Address from inside your local network.

If that is the case then what you are seeing is likely just a telnet service which can be used to manage your router and this on its own would not be cause for concern, as it's a common port used for that purpose.

The reference to openwall will be based on the banner returned by the service when zenmap connected to it.  you can test this by using a telnet client and connecting to your gateway IP address.

As the comments have noted, whilst openwall does product the john password cracking software, it does also produce linux software called OwL http://www.openwall.com/Owl/ which includes a telnet server.

One other point is that if you need to adminster your router/modem you should ideally use SSH rather than telnet......


Bridge Exploit of Network Multi-function Print/Fax Devices I performed a recent security audit and was wondering if anyone has heard or run across any known exploits against any commercial multi-function print/scan device whereby you can bridge the incoming fax line and network? These were all commercial grade equipment and I did some extensive google'ing on the topic, but I did not find anything. I had some vague notion in the back of my head that a printer tech one time told me that they used those fax lines for remote maintenance, and if so, I could imagine being able to exploit them and bridge the two...

Any thoughts?

Multi-function printers have reasonable computing power, and many are in fact linux devices, so it is theoretically possible that someone could use it to bridge into a network. It would make little sense to try it though:

Slow access: most faxing happens at 9600 baud, that's really slow. Even if you could negotiate faster the best you could realistically hope for is 64k, which is still very slow
Easily traceable: the internet allows for a huge amount of anonymity in attacks - an American hacker can attack a French company using a hacked Chinese computer and everyone will think it is state-sponsored espionage. However, dialing a phone line leaves a traceable record. Why would you take the risk?
Attacks cost money: it's unlikely someone is going to dial locally to attack a company, so long-distance or international phone charges will add up. If the attacker is a phreaker as well then he/she won't be paying, but someone will, and they may investigate
A printer suddenly accessing drive shares or scanning systems would stand out much more than a user laptop doing the same, it would be more likely to be noticed
Low re-usability of attack: if I come up with an attack that works on say one line of HP MFPs then it will only work against those machines, not against Xerox, Canon, or any other printer model. In fact, the attack may only work on one line of HP, or even one model range. That's a great deal of effort for something that would only work on one subset of machines
Easy to defeat: If I was worried about this all I'd need to do is put my printers in a network behind a firewall and prevent them from accessing anything. I'd also look at the phone records regularly
There are much more effective and easier ways to attack someone: targeted phishing attacks against companies using 0 day or only recently patched vulnerabilities is far less challenging and much simpler to do than trying to subvert a printer over a phone line

The only time I could see concern for this being worthwhile would be in an environment which has no internet access however they did have MFPs plugged into phone lines. Even then an attacker is more likely to use removable media as an infection vector.


JWT access tokens: Too much information? I've recently encountered the practice of systems using JWTs as Access Tokens.  I have a concern and I'm not sure if it's unfounded:

I associate JWTs with the OpenID Connect protocol, where there are used as ID tokens.  They have in intended audience.  The claims in them are supposed to be for that audience only.  For example I may be happy for one audience to have my phone number but not another.

On the other hand an opaque access token contains nothing other than my permission to access a resource.  It's about delegation; that token can safely travel from system to system taking my permission with it (confirm?).

However if you effectively use an ID token as an Access Token, not only are you passing my permission to access a resource, but you're passing details about me.

Have I misunderstood something or should this be a real concern?

It's all dependent on whether the RP actually needs the information provided in the token to evaluate permissions.

You might have privacy issues if it's purely identifying information. The fact that it's a dual use token is problematic, but whether this actually poses a problem needs to be evaluated on a case by case basis.

Edit: Delegation of permissions is an unfortunate capability because these tokens are often bearer tokens -- whoever has the token can use the token. There's no way to separate this permission from the token, unless there's an explicit mechanism to delegate. In the OAuth world this is on-behalf-of (though I'm not sure how widespread it's used or accepted outside of Microsoft technologies).

The audience doesn't apply here because the audience dictates what service you're allowed to communicate to, not from. In order for this to be blocked the token needs to include ways to authenticate the client, and the client needs to authenticate to the service using a separate mechanism.


Tool or Process to check for AES-NI support on processor? In another question, Thomas' answer mentioned the AES-NI instruction set, which piqued my curiosity.

Is there a tool or process available out there to check whether the instruction set is available (besides comparing CPU model numbers)?

On Linux systems, do:

grep flags /proc/cpuinfo

This will give, for each CPU core, the list of what that core can do. The AES-NI instructions are there when the flag "aes" appears in the list of flags. See this page for a list of possible flag values.

On macOS, do:

sysctl -n machdep.cpu | grep -i aes

If it doesn't find anything, this machine doesn't have AES-NI.

For Windows, see this question on SuperUser.


How can Google search change the location in a URL tooltip? When hovering over a website link in Google search the tooltip says the link of the website (stackoverflow.com). But when I click it it goes to some Google page and then StackOverflow. But now if I go back to the Google search tab the tooltip has the Google URL.

How does Google do this? And is it is possible for any website to do it which can be used maliciously?

If you look at the page source, there is a JavaScript function rwt() executed on onmousedown event.

Information Security Stack Exchange

It rewrites the href for the link you click on (you can even see the change if you click and hold the button).

Information Security Stack Exchange

So technically it's changing the contents of the page on user action. Browsers display the tooltip according to current value.

Any party can do that with JavaScript.

Turn off JavaScript in your browser and Google will provide the results on a page where all destination links are real.


Should I encrypt Long-lived Facebook Access Token when storing them in my DB? I own an application that grabs some Long-Lived Facebook Access token, in order to be use later according to the corresponding logged user.

Should I need to encrypt them before storing them, to avoid any leaks if database is hacked, or a Facebook mechanism already exists to prevent some malicious usage?

Simply: yes, encrypt it. And don't store the encryption key in the database.

The token is tied to your app, so an attacker might not be able to use it alone, but if they can breach your database and get your app secret too they can use the token. You'd have to encrypt the app secret and the user tokens.


Email header red flag I am to analyze email headers for spam/phishing attempts. What is the methodology I should follow by only looking at the header? I know that I have to look at the from field, return-path, received, sender policy framework but can you provide some examples or some hints? How can I recognize through the various hops that it could be suspicious?

In particular I need to formalize an eventual theory about any possible fraud attempts. I want better understand:

what the first hop is actually describing, in the sense that it is a hop between the first Message Transfer Agent and the next one, meaning that it is not representing the hop between the machine of the user and the first mail exchange server, or could also represent this last situation? (For example I am analyzing some emails and in some cases the first hop is "from apache by "some domain" ", or "from user[IP number] by "some domain" ");
if there is a hop in which there is the name of the mail exchanger and also the IP next to it, in an enclosed parenthesis, but it looks like that the IP is in another country, what does it mean?
how should SPF be interpreted (the check refers the machine of the sending server so the first hop)?

These questions are a bit broad and confusing. Email headers often look different for a host of reasons.

  what the first hop is actually describing, in the sense that it is a
  hop between the first Message Transfer Agent and the next one, meaning
  that it is not representing the hop between the machine of the user
  and the first mail exchange server, or could also represent this last
  situation? (For example I am analyzing some emails and in some cases
  the first hop is "from apache by "some domain" ", or "from user[IP
  number] by "some domain" ")

The first hop is generally the first MTA reporting it received the message. "From Apache" just means the server that sent it was running Apache. Typically, the actual users IP address, if present, is found in the X-Originating-IP field.

  if there is a hop in which there is the name of the mail exchanger and
  also the IP next to it, in an enclosed parenthesis, but it looks like
  that the IP is in another country, what does it mean?

The names you see in an email header are fully qualified domain names (FQDN). They identify a particular machine on the Internet and within that domain. The IP address in paranthesis is the IP address of that machine so if it resolves to a certain country, that is where the machine is located.

  how should SPF
  be interpreted (the check refers the machine of the sending server so
  the first hop)?

SPF puts a record in DNS with a list of all IP addresses authorized to send mail on behalf of the domain. Recipient mail clients check to see if the MTA sending the message they are receiving has an IP address that falls within those ranges. If it does, there is usually a denotation in the header that says Pass. If it does not, several things can happen depending on how the SPF policy is configured:

If the record ends in -all, messages will not be allowed through and you will see a Fail denotation in the header.
If the record ends in ~all, messages will be allowed through but they should be marked. You may see a None or SoftFail for these messages.

Other things that can be done is with regard to the hops is to check whether the FQDN's match up with the MX record for the domain. For instance, if sender Bob's domain foo-bar.com used Google to send mail, then you can expect to see Google FQDN's in his portion of the message path. This may at times require performing whois lookups on the domain names in question because they may not always be named in such a way that it will be obvious they belong to a certain organization.

Another test is to check whether the sending domain uses DKIM. If it does, and there is no DKIM signature present, that is a good indicator of a spoofed email.


Storing basic financial data I'm working on a project similar-ish to a budgeting app like mint or ynab. I'll be using the Plaid api, which abstracts away account/routing numbers, etc. Thus, what I'll have access to, and be trying to store, would be the account name, balance, type, and transactional data (amount, location, name, type, date, category).

I'd also like to store the user's name and email. I was thinking that if I encrypted the name and email, that that would be "enough", but I'm still a little uneasy about that. So, here are my questions:

How much should I encrypt?
What's the best way to encrypt it? Only the email really needs to be reversible by me.
What's the best storage medium? I was going to just use postgres, but there might be a better way to store this data.

Thanks in advance for any tips, tricks, references, whatever!

First of all, this depends on the country you are in and its laws. The best practice is to encrypt all your user data since you are handling financial data.

Just to avoid confusion about data encryption, there are generally two things to deal with, as described below. The reason I bring this up is that in my experience people tell me as a security consultant that "the database is encrypted".

However, by asking a few more questions, it turns out that the data in the database itself is not encrypted but the disks the database is running on.

1. Disk Encryption

This type of encryption protects your data from being stolen if one of more physical machines are in rest (turned off and stolen perhaps)

2. Database Encryption

This type of encryption protects your data in the database itself. For example, if an attacker is able to (partially) dump your database, the records are encrypted and is basically useless to the attacker.

The only challenge here is, where do you store the encryption key. This key should never be on the same disk (e.g. in a configuration file) of either the application server and database server.

In order to read the encryption key, a 'vault' mechanism is recommended. Google "encryption key vault" should lead to several solutions that you could implement.

How much should I encrypt?

In my opinion, financial data itself should definitely be encryption but this also depends on regulations and company policy. I have been in companies that use the following policy:

"Every record that can be used to identify a person is considered sensitive data"

Examples are: Social Security Numbers, bank account numbers etc.

What's the best way to encrypt it?

In my experience, most of the time, symmetric key encryption is used.

What's the best storage medium?

Most open source databases support column encryption, so does Postgres.


DUKPT - how does the receiver verify the transaction counter? I have one question regarding this document:

ANSI X9.24,
Retail Financial Services Symmetric Key Management Part 1: Using Symmetric Techniques

In the chapter "Method: DUKPT (Derived Unique Key Per Transaction)", page 41, it says, that the receiver should verify that the originator's transaction counter in the SMID has increased.

Other sources say that HSM's (the receiver) do not store any state apart from the base derivation keys:  The base derivation keys can be looked up by the key set identifier (contained in the SMID). So the receiver (HSM) is able to decrypt without keeping any state of the originator. I understand that very well.

But when verifying the transaction counter I can not imagine any other way than keeping track of the transaction counter per key serial number (KSN) of the originator (a table or map) - that is there is some state in the HSM kept, but there should not be kept any state.

Although the document contains pseudo code that explains the implementation of the methods described in the document there is no hint how the transaction counter is verified.

How is this actually implemented or what is the basic idea how this is achieved without keeping track of the state?

(this question was posted on stackoverflow, not answered there, but recommended to be asked here)

I am probably a bit late with my answer, but your initial question is very clear for me and I know exactly what you mean.

The KSN is normally stored by the receiving host in order to keep track of the transaction counter. So for each transaction, the host verifies that the sending device is not using a previously used key by checking that the transaction counter in the KSN is higher than it was when previous transaction was handled by the host. For some transaction types however, the host might have logic that it accepts the same set of DUKPT keys to be used for more than one request/response pair. E.g. for technical reversals.

Brg

Arne


Possible to send password in plain text with SHA-256? I just registered on a site where I had to specify sensitive information, eg. my card number. I got a confirmation mail where my password, the one I specified as my login password, was in plain text. I learned that password should NEVER be in plain text. If they can, that means that my sensitive information are stored in plain text too.

I contacted their support and they claim that they are using the encryption method SHA-256 for the passwords. Is it safe? Is it still possible to send plain text password even after encryption?

First, if you're worried, contact your bank and request a new card number, right now.  Then change every password you use that's the same as, or similar to, what you sent them, on every site everywhere.  Then terminate your account with them.

Second, the SHA family is a set of hash algorithms.

Third, they're lying, by omission if nothing else.  If they truly did use any form of SHA-256 on your password, then they cannot send it to you in (probably unencrypted) email

Unless they ran an offline cracker themselves, AND your password was P@$$w0rd, Jennifer2007, 12345, or something similar.  Without a weak password, SHA-256 will take a bit.

Fourth, unless they're using PBKDF2-HMAC-SHA-256 with a high iteration count (i.e. slow down offline attackers), then they're STILL doing it wrong if they're using SHA-256.

Fifth, either they're storing passwords in plain text, or they really are using encryption (instead of hashing), which is What got Adobe in trouble in 2013, and is wrong.

You are correct, they SHOULD NOT be able to retrieve your plaintext password from their storage.

Also, they shouldn't send it out over potentially unsecure email even if they are storing it.  Double stupidity for the loss!


Moving GIT/SVN servers to internal network segment while still allowing external collaboration Here is my situation:

I have a typical network setup, with DMZ and internal segment, with a VPN concentrator. Because we have external collaborators, the GIT/SVN servers are in the DMZ. Individual collaborators are given credentials for the GIT/SVN servers (but not for the internal network / VPN).

I would like to move the GIT/SVN servers out of the DMZ in order to reduce their exposure. But external collaborators will still need access. How can I do this?

The only idea I've had, and I don't quite know how to express it or if it's possible, is to move the GIT/SVN server to a separate internal network segment, and give collaborators VPN accounts that are limited to that network segment. Would this work? Other ideas?

Thanks!

That plan should work, yes.

For git, at least, you have a number of other options afforded by its distributed nature. External collaborators can work on their own forks (in fact, they must, given how git works), and someone who has access to the internal server can then pull in their changes to the internal canonical server. Git was built with the core idea of mailing patches to a list, and git am still supports that flow. Or if the internal user has access to the external user's repo, they can add it as a remote and merge the commits in directly.

Why do external people need access? Why are you moving the repo internally?


Use NTFS permissions to prevent folder access on USB key TL/DR: how to use NTFS permissions to prevent all users on other PCs from accessing a particular folder on an NTFS USB key?

BACKGROUND

I have an NTFS formatted USB key. The top level contains a single folder named "MAIN". There's an arbitrary hierarchy of many more files and folders in and below MAIN.

All these files and folders are created by a single non-admin user "FRED", on a single PC "MYPC". So MAIN, and everything in and below it, is owned by non-admin user FRED on MYPC.

There's nothing special about FRED, or MYPC. MYPC is a default Windows 7 Starter Edition netbook. FRED is a normal non-admin user on that netbook.

REQUIREMENT

I want to make the minimum number of ACL changes possible, to MAIN, and preferably only to MAIN, to achieve two things:

(1) Prevent all users on other PCs from accessing MAIN at all. By "access" I mean, even just view the content thereof. So on MYPC, FRED and admins can access MAIN as normal, but on other PCs, no-one at all can access MAIN at all.

(2) Say FRED, on MYPC, copies something from within MAIN, to (say) MYPC's desktop, and then to a different USB key or PC. I'd like the copied thing to not be restricted as described above. That is, users on other PCs can access the copied thing, or not, in the same way which would have occurred if (1) had never been done in the first place.

None of these folders and files are encrypted - nor do I want them to be. So I do understand that someone could just mount the key on a non Windows system, and read-off all the raw data. That's not part of my threat model.

TIA for any suggestions!

Simply put: you cannot do that. NTFS permissions are set per user. They also are dependent on the scope: any user who is local admin can take ownership of local resources and change permissions as he wants.

Your only option is to rely on encryption. I suggest you have a look at Bitlocker to go: it is very easy to setup and very convenient to use: you can configure your machine to auto-mount the device (storing the key with your lock trusted store) and set it up with a strong password (which you will store in your password manager).


Is encrypting home sufficient? I currently have a fully encrypted Windows System, and I'm looking at switching to Ubuntu. Is encrypting my home directory (with ecryptfs) sufficient?

On windows this would be problematic due to software leaking out some possibly critical details, but on Linux I usually wouldn't have write permission to many places outside of my home directory anyways.. right?

The other issue is that I currently have a strong password (for "offline" attacks) for the system-level encryption, but a weak login password for the Windows user account, since I log on/off often (while leaving the PC running). This isn't an issue considering that windows limits how many failed logins you can try out per time interval. With ecryptfs however my login-password would also have to be strong since the ecryptfs password is derived from it. Is there perhaps a way to mount the home directory once after boot up, indepentently of my login password (and subsequently, does Linux/Ubuntu limit failed login/su attempts)?

Data from any running program might end up in swap, so your swap space needs to be encrypted as well. Unless you want to hibernate your system, the swap space can be encrypted with a random key that is generated at each boot. This is the case by default if you select full-disk encryption during installation but not if you merely later encrypt your home directory. If your swap space isn't encrypted already, set it up with `ecryptfs-setup-swap. If you want to have both swap space and hibernation, see Enable Hibernate With Encrypted Swap in the Ubuntu community documentation.

Many programs put temporary files in /tmp. The best way to handle this is to put /tmp on the memory-backed filesystem tmpfs instead of leaving it on a disk-backed filesystem. There's also a slight performance advantage. See this writeup for how to do this.

Beyond this, private data can end up in various places that aren't your private storage area. You have to decide based on what you consider to be confidential whether it's worth it encrypting these areas. Here are some notable places:

If receive mail locally (as opposed to fetching it from a POP or IMAP server), it arrives in /var/mail. If you send mail using the traditional unix method (sendmail), it transits via /var/spool/postfix (or whatever your MTA is). If you don't understand this paragraph, it doesn't apply to you.
If you set up recurring tasks, they are stored in /var/spool/cron.
When you print something, it transits in /var/spool/cups.
The system logs under /var/log might contain data you'd rather keep private, such as network errors from sites you've tried to connect to or from.
Your system configuration in /etc might have a few confidential things such as ISP or wifi passwords.

If you encrypt your home directory with ecryptfs, beware that it won't be mounted if you log in remotely with SSH while not logged in locally, so if you do that, your SSH public key file (~/.ssh/authorized_keys) needs to be present in both encrypted and cleartext form.


Is a REST webservice without any authentication or authorization unsecure? There is a REST-based webservice that has no authentication or authorization whatsoever - anyone that knows an URL of a particular method of this webservice can use it.

However, the URLs of methods are not exposed to public (for example, there is no public documentation that would enumerate API methods, or anything like that). Only place the webservice is being accessed from is an Android application that, obviously, needs to know the URLs to use the webservice (they are hardcoded in it). The app is not published in any public app stores and it's only distributed internally.

Is there a way for a potential attacker to access the webservice outside of the Android app? Of course, one obvious way would be to somehow get hold of the app, decompile it and find out what are the URLs; are there any other, realistic ways except that?

The webservice in question really exists. Right now, I have only a feeling that the whole setup is a recipe for disaster - I need some particular examples to be able to convince my boss that we really need to improve the situation somehow.

Here are a couple possible scenarios:

an app user connects to Internet via a public WiFi hotspot, and plain HTTP traffic is eavesdropped by a third person. That person is able to get hold of your URLs.
app user's mobile Internet provider implements automated harvesting and analysis of user's behaviour in order to create a behavioural profile for ad targeting. If it sounds too far-fetched check out this story about Verizon in US. I've also heard of some Internet providers in Russia implementing a similar solution. Since you didn't specify the country in question, I don't know what applies in your case.
mass surveillance by NSA or any other security service.

At the very least, I'd implement HTTPS or encrypt traffic using hard-coded certificate. This will not put away a determined attacker but should thwart "drive-by" eavesdropping.


How long would a computer have to be off to be resistant to a cold boot attack? I understand that the longer a computer is off, the more resistant it is to a cold boot attack.  I also understand that an AES key can be reconstructed from a redundant round key schedule even after a large percentage of the bits in memory have decayed, and RSA private keys can be obtained in a similar fashion.  According to this paper, there is a period of slow bit decay, followed by a period of rapid decay, followed by a period of slow decay.  How long would it take for the redundant information from which the key is recovered to degenerate to the point where it can not be recovered.  Would it be a matter of hours?  Days?  Or would it take several weeks for the bits to decay sufficiently?  The paper gives an indication that the key can be recovered if the computer is turned off, but it gives no indication of how long.

There are some factores that are crucial for these kind of attacks. The RAM of a PC is not flushed immediately after the pc is powered off but it is in normal cases flushed in under a minute. When this attack was migrated first by scientists they said the memory needed between 10 and 30 seconds till the content wasn't useable anymore.

This period of time can be increased by using ice spray like its done in the cold-boot-attack. They said this will increase the lifetime of the data in the memory to 10+ minutes after the PC was powered off.

There are also some practical issues that can prevent such an attack. When you reboot a pc there are two stages of memory testing in which the BIOS writes to the memory. In the first stage which is not optional the first 64k are tested. In the second stage which is optional the whole memory is tested. This test writes to the memory and if this happens the cold-boot-attack will not work anymore because all the content you needed has been overwritten. So you have to skip the test.

Also boot passwords are likely to obstruct your attempt to boot a live system. This is of cause needed to dump or at least analyse the memory of the pc. This might prevent the attack at all because even a weak security measure that can be overcome in half an hour might cost you so many time that the data in the memory is gone.

// I heard of some cases where the police tried to prevent their suspects from turning off their PC's because they wanted to carry out a cold boot attack. One of these cases took place in germany (where I come from). The suspect was an arms dealer on the darknet and he was that paranoid he only runned his laptop with an electric wire and a detatched battery. In the raid the suspect pulled out the electric wire and the police then wasn't able to recover the cryptographic key. You can find the whole article here.


What type of attacks will a SMTP server face if it does not have ratelimiting while sending mails? Assume a web site with some kind of mailer option, that doesn't implement any rate limiting: This enables users to send an unlimited amount of email per second.

Will SMTP face possible DoS attacks for that? Or any kind of problems? Can anyone explain this?

One of the difficulties in securing SMTP lies in the protocol itself, specifically the admonitions in RFC 5321 which give proscriptions on timing out a session.  A faithful implementation provides no facility for timing a session out.  Ideally one would want to ignore those recommendations, and set a session timeout for the mail session.  This will prevent for example any attacks where long delays are used to send data character by character with large mail sizes.  For example if you have a mail server with a 10MB mail size limit, it is fairly easy to write a script which delivers a fake mail to your server and writes a Lorem Ipsum message, one character at a time up to the 10MB limit, but delaying each character by 1 - 2 minutes.  Theoretically without a session limit such a mail session could run around 10 million minutes.  So now run a script that simply starts bots that do this from hundreds of places on the web, and pretty soon the bots will have all your connections tied up (assuming you have connection limits, or are using a connection pool).

Ideally, one would set up a timer from the time the DATA command was issued to the time that the "CRLF . CRLF" was issued.  Something like 5 minutes or so for the whole data to transmit should be reasonable.  And violate the RFC and simply drop the connection if it exceeds that timeout.  Well behaved clients will never come close to that limit and even people using the command line terminal ought to be able to send data within that time frame presuming they know how to type.


Is the original IV mandatory to decrypt an encrypted message? TL;DR

If we encrypt a message with an IV, do we need to store this specific IV somewhere to ensure that we're able to decrypt the message later?

There isn't much I know about this. From my understanding, IVs are a way of creating different ciphertext each time the same message is encrypted.
The Problem
I encrypted a message with a particular random IV, and stored the encrypted message (say,  a file).
Now, I tried decryption with a random IV (different from the one used for encryption), and got gibberish text, instead of the original plain text message which I expected.
But, if I decrypt with the same IV as used in encryption, I see my original plain text message.
If this is indeed the case, how is an encryption key different from an IV?
Implementation Information
I don't think the following has to do with encryption per se, but it's there in case someone needs it:

I'm using two JavaScript functions, encrypt() and decrypt()
Calling those two with the same globally defined IV gets me the original message on decryption.
Calling those two with different IVs inside them gets me gibberish.
Here is the code if someone needs to have a look.
-I am using AES in CBC mode

Appreciate an answer!

For AES-CBC, if you have the key, but not the IV, then you can still decrypt the entire message, except for the first block.  See https://crypto.stackexchange.com/questions/1129/can-cbc-ciphertext-be-decrypted-if-the-key-is-known-but-the-iv-not for more information.


Session renewal how often is necessary? I am looking at the session management again of a site and currently it renews the client session id on every page refresh. The idea being that if it is stolen directly from the browser there is less chance of the session being hijacked.

This though doesn't seem to make sense. If it is possible for some kind of malware or browser vulnerability to output a session id to a hacker, then they should quite easily be able to hijack that session regardless of the new session being created each time, as they would 'get there first'.

From what I can tell there is simply no way to solve that kind of issue by focussing on the session token itself but rather matching other users profile information is more reliable. And of course asking for the password for critical changes.

So is there any point at all in creating an new session token for every page load, it seems a bit pointless and a waste of resources. In fact if so many ids are being created there would be a higher chance of guessing a session randomly.

Would not changing the session token at all be acceptable during a session or should it maybe renewed every couple of minutes?

You are right that it doesn't really provide more security.

Except usability problems and increased complexity, I'm not sure what it brings. For example, if you change the session_id and invalidate the previous session_id on every request, your user won't be able to use many tabs in his browser.

Also, as you stated it doesn't stop an attacker to get in there first and use the session_id before the real user.

Is it acceptable to not change the session_id?

Yes, while the user is logged in there is no reason to change it.

So, then, how long should the user stay logged in?

It always depends on the security your application need. For example, stackoverflow doesn't reset my session if I don't log in for a week. It doesn't reset it even if I close my browser. On the contrary, my bank website will close my session if I'm inactive for like 10 minutes or if I close my browser tab.

Leaving a session open increase the risk that it can be stolen. If it's crucial to keep the session safe then change it often. The idea here is to define rules about when you need to change it and to balance security and usability.

Note : The session_id security is pretty similar to CSRF token. Here's a similar question : Why refresh CSRF token per form request?


Is HTTPS necessary for password change if user has already logged in with HTTPS? I notice many websites implementing HTTPS for changes in account information even though the user has already logged in through HTTPS and tracked by SESSION.

Is this really necessary?

In fact, any site that uses a combination of HTTP and HTTPS will be vulnerable to man-in-the-middle attacks, and most will also be vulnerable to Firesheep-like attacks that capture the session cookie by eavesdropping on the HTTP connection.

It is not enough to use HTTPS for just the login and changes in account information.  Sites need to use HTTPS for everything, if they want to be secure against man-in-the-middle attacks (e.g., if they want to be secure for users who are connecting over open Wifi).

See the following questions on this site:
What are the pros and cons of site wide SSL (https)?,
When are HTTP session cookies at risk over Wi-Fi?, and
What sites are still vulnerable to FireSheep?.


How do ISPs detect whether a phone uses tethering? I'm trying to figure out how ISPs detect whether a phone uses tethering beyond checking whether the TTL is set to a particular value. Also, do any major ISPs use a form of passive traffic fingerprinting?

I'm trying to figure out how ISPs detect whether a phone uses tethering beyond checking whether the TTL is set to a particular value.

There is a good description about various ways over at android.stackexchange.com - How can phone companies detect tethering (incl. Wifi hotspot). No need to repeat it all here but apart from TTL and OS stack fingerprinting it is also about the tethering feature of the phone actually telling the mobile ISP that tethering is active. For the latter aspect see also this post at Hacker News where it states that another DUN is used for tethering and how to avoid this.

Very interesting is also an article from Sandvine Policy Control for Connected and Tethered Devices since Sandvine is actually a provider for the necessary technology. In this articles it mentions features like TCP timestamp option, behavior of TCP source port, number of parallel sessions, various features from the HTTP request etc to distinguish different devices.

Similar Cisco offers tethering detection in its products as can be seen from ECS Administration Guide. Here it again mentions TTL but also OS fingerprinting and User-Agent detection.

  Also, do any major ISPs use a form of passive traffic fingerprinting?

This is very common. If an ISP offers pricing models where specific traffic (like some music or video streaming) is excluded from the accounted bandwidth then you know for sure that deep packet inspection is used. Apart from that it might be used to block or disrupt services which impact the business model or terms of service, like using VoIP or P2P file sharing or tethering. Sometimes it is done for legal reasons like blocking access to specific domains. But it might also be done to actually enhance the service, i.e. prioritize real time traffic against other traffic.


wordpress server visitor log contains a script, what's the risk? I see this in my WP statistics:

Is it safe to click on the link? Under what conditions will the script be triggered?

It should be safe to click (although I still wouldn't).

It looks like the attacker tried to exploit the shellshock vulnerability. If your server is vulnerable, the script will already be executed, you calling it again doesn't add that much harm (in this case, you don't have any more rights than the attacker has, assuming you are not viewing the log from the server).

Of course, clicking the link doesn't gain you any knowledge either, and generally, it's a bad idea to click on links in your log (because of XSS), so don't click on it, and check if you are vulnerable to shellshock.


Which type of authentication is not prone to man-in-the-middle attacks? I am preparing for the CISA exam and come across material saying "challenge response-based authentication is prone to session hijacking or man-in-the-middle attacks". But the material doesn't mention which kind of authentication is strong against MiTM attacks.

According to my understanding, the above statement is not very meaningful because all types of authentication are prone to MiTM.

To prevent MiTM, we can apply more than single factors for authentication. For instance, beside a login from the browser, the user might also need to press the confirm button on the mobile app within a minute in order to complete authentication. However, there is a single authentication method not prone to MiTM. Am I correct?

Authentications based on key exchange methods are immune to MitM attacks by design. They do require some kind of certificate infrastructure, however. (note that the key exchange itself does not provide authentication)

Authentications based on shared secrets, public-key cryptography or certificates can also be designed to be immune to MitM attacks. Such authentications can include challenge-response mechanisms.

Two- (or multi-) factor authentication is not immune to MitM attacks, however Eve needs to be able to simultaneously intercept all the channels used, which dramatically increases the difficulty for her.

The basic idea of doing authentication that is safe from MitM is to do in sequence:

establish a secure (i.e. MitM-protected) channel
establish the identity of the other party
exchange authentication information

This is how your online banking is set up. DH key exchange + suitable encryption for step 1. Certificates based on a trusted root CA for step 2, standard web-form authentication for step 3.

Note that TAN lists (shared secrets), pseudo-random TAN generators (shared secrets) or SMS TANs (2FA) are often used additionally, but typically after the actual authentication.


Is a file hash checking system 100% secure and non-bypassable/fakable? I'm building an open source distributed (and partly offline replicated, as it's assumed that the network will be unstable) CMS and one of the core system 'job' will be to group all the files and generate a unique hash from them.

This special hash will be checked against a genuine hash to see if they match, so to ensure that nobody alters the source maliciously.

If both hash matches we can safely go on with the process and particularly the replication, if no match is found, we get the ip/proxy/tor-node and block subsequent join attempts.

Ok, lets add some context...

Let's assume we have a folder called 'cmsfiles' and inside we have the files: app.py, dbconn.py, users.py, reputation.py, node_list.py, blacklist.py etc..

There is John, the founder of a portal called "Breaking old News". He has a genuine hash ("originalhash") and is in the "node-list", thus he's a point of reference to be checked against.

Now, comes Dan who interested in the portal wants to join it for having his deal of participation (be it discussions or anything else).. so he downloads and install (let it be python + sharded Sqlite DB) the software suggested by the read-only portal.

Now, when he visits the portal again, a message is displayed telling something like "We're checking for integrity before aligning both machines, keep tight man and wait"..what happens in the background is that John's machines is contacted (from the node-list addresses list) that then proceed to group all of Dan's machine files in 'cmsfiles' to a single hash and check against the genuine one..if both hashes match, Dan's machine is added to the node_list list and his database is downloaded/updated and so follows John's "train".

2 days pass from Dan's joining..

Another guy called "Jack" comes along, but with malicious intent, as he altered the "reputation.py" file so to overcome the limitation of 120 points to vote.

He sees the same thing as Dan but in the background something little different happens..

When John's or Dan's machine check the hash, they find that it doesn't match with the requester, so either John's or Dan's machine proceed to kick him out of the network by putting him in the "blacklist.py" list.

note: if Jack manually changed the addresses in the list so to try validating his machine he would be on his own and would have just created his own portal without any harm to the other portals already existing

What I'm not sure of, is if this can be considered a safe system and that nobody can fake/bypass the hash some way. Or maybe if I'm doing it wrong and should be done in a different way?

p.s. Was partly inspired from the inner working of Bitcoin and Osiris sps.

If I understand you correctly, you're asking if the process you've described places the security burden on the hash algorithm, hence the question about how good hash algorithms are. Well scrutinized algorithms (like SHA1 through 3) should be very good, in that creating a collision should be extremely difficult.

However, from reading your process, I think the weak point lies elsewhere.

What is stopping the malicious user from lying about their hash result?
To prevent #1, you may require the users files to be uploaded and hashed on the server (creating its own set of problems). If so, how do you prevent the malicious user from sending the files you expect to see, while running modified files?

Tools such as MITMproxy make this trickery a lot more accessible that it used to be. You will probably find that Stackoverflow is also very good at noticing general process/workflow issues like this one.


Unexpected email from Yorkshire Bank I have started receiving unexpected emails from Yorkshire Bank.

I have never been a customer.  I don't recall applying for any of their products either, although maybe I did many years ago.

The first of the strange emails reads:

  Your partial postcode is 8NX

  We've included your postcode at the top so you can be sure this email
  is from Yorkshire Bank. To see how you can stay safe online, visit the
  Security Centre

  We've sent your Authentication Code Letter

  Hi Mr Stewart,

  You should have received our letter that contains an authentication
  code by now.

  Once you've got our letter, you can confirm the code by clicking on
  the button below to get back to your application, and then follow the
  instructions. This will allow us to progress with your application.

The sender appears to be legitimately email.yorkshirebank.co.uk, but the 8NX is NOT part of my postcode in any way.

There have been 3 following emails, of an advertising nature.

I feel that ignoring would be the wrong thing to do, but I'm not sure what to do.

My main concern is that my identity has been stolen for the purpose of procuring Yorkshire Bank products, such as a loan, which I may be chased for when the identity thief defaults.

Is this likely or even possible?

What other explanation might there be?

I feel that ignoring would be the wrong thing to do, but I'm not sure what to do.

If you feel that ignoring this is wrong, look up the bank's phone number from a reputable source, e.g. yellow pages or the banks actual website. Call them, and ask. Or submit a contact form on their website, or similar - in short, contact them through a channel not related to the e-mail and ask them to verify the content.

Do not use the links in the e-mail.

If it's identity fraud, they will be very interested to clear it up. If it's phishing, banks tends to like to be made aware of ongoing phishing attempts, so they will not be angry with you for calling.


BEAST attack on TSL1.2? It is my understanding that BEAST only works on TLS1.0 and I got confused when I saw a demonstration of BEAST attack on paypal.com, locally: https://www.youtube.com/watch?v=BTqAIDVUvrU

Paypal uses TLS1.2, so I'm not sure how the attack could reveal the message, or cookie in this case?

Paypal supports TLS 1.0, 1.1, and 1.2.   If your browser advertises that it would like to use TLS 1.2, then that is indeed the TLS version that Paypal will choose to connect with.   If, however, your browser suggests to Paypal's servers that the highest TLS version it supports is 1.0, then Paypal will happily connect using that protocol version as well.   I imagine that this is exactly what whoever was demoing BEAST did.  Set their browser up so that it would only use v1.0, and not 1.1 or 1.2.


Question about HTTPS & Client side tampering Could someone explain something to me please:

I am intercepting requests on my local proxy to a HTTPS server.  The POST body has data such as "ID=4001" in plain text when I intercept it.  Firstly, is this normal?  Is the HTTPS in place on this server weak or lackluster somehow?

Can someone explain why what I deem sensitive information would be in plaintext here?

Did the devs drop the ball and present it in plaintext for the client to easily tamper with?
Would this be encrypted if the HTTPS was properly configured?
Because im intercepting requests locally from my own machine, HTTPS has no benefit until the request flies off across the network/transmission?

I am intercepting the requests locally from my client directly (not across the network so to speak).  Trying to gain a little clarity on this for my own understanding, am I right in thinking at this stage HTTPS has little to no impact and the ID=4001 is a fault on the developers end?

ps. this ID is very sensitive and we wouldn't want someone knowing it or tampering with it successfully.

Update: I guess my question is, I can see this ID param/value in plaintext in burpsuite when intercepting client packets against a web application running on a self-signed HTTPs cert(I assume self-signed is irrelevant), is the fact I can see this ID a fault on the developers? or am I being silly and this would be encrypted in a real production environment? see image:

Sounds like you have configured BurpSuite to allow monitoring of HTTPS traffic. According to the documentation:

By default, when you browse an HTTPS website via Burp, the Proxy generates an SSL certificate for each host, signed by its own Certificate Authority (CA) certificate. This CA certificate is generated the first time Burp is run, and stored locally. To use Burp Proxy most effectively with HTTPS websites, you will need to install Burp's CA certificate as a trusted root in your browser.
Note: If you install a trusted root certificate in your browser, then an attacker who has the private key for that certificate may be able to man-in-the-middle your SSL connections without obvious detection, even when you are not using an intercepting proxy. To protect against this, Burp generates a unique CA certificate for each installation, and the private key for this certificate is stored on your computer, in a user-specific location. If untrusted people can read local data on your computer, you may not wish to install Burp's CA certificate.

So essentially, BurpSuite is performing a man-in-the-middle attack, taking advantage of the fact that it runs on the local machine and installing its own certificate.
In the normal use case, BurpSuite is not installed on the client machine, and the hacker does not have any ability to install root certificates. Without this ability, the hacker would be unable to perform a man-in-the-middle attack without triggering a security warning in the browser, which would look a bit like this on Chrome:

To answer your questions:

Did the devs drop the ball and present it in plaintext for the client to easily tamper with?

No. The protocol is working as intended. It will protect you from Man-in-the-Middle attacks launched on the network. It will not protect you from a Man-in-the-Middle attack launched by a process running on your local machine with sufficient authority to install certificates. There is no technology in the universe that can protect a machine that has been locally compromised in this fashion.

Would this be encrypted if the HTTPS was properly configured?

Yes

Because im intercepting requests locally from my own machine, HTTPS has no benefit until the request flies off across the network/transmission?

Correct.  HTTPS in general does not protect you from local access (after all, the Chrome dev tools also let you see the traffic); it protects you from a listener on the network attempting to eavsdrop.


Risk of spyware on seized devices This question (Prevention measures against laptop seizure at US borders) addresses a number of techniques for securing data while crossing borders.  Perhaps the most useful advice was to simply not have any sensitive data stored on the device, and to have ways of retrieving the data (via VPN or whatever) after you have crossed the border.

My concern is the risk that a seized device will be compromised with spyware before being returned to its owner.  Is there a significant risk of this occurring, and if so, what would be the appropriate countermeasures?  Is it sufficient to re-image the OS once it is returned, or should one be concerned about hardware spyware?

Though you might expect this if traveling to certain countries, this question hinges on whether we should trust the authorities (or a specific person, still an opinion) and somewhat separately known capabilities (which are broad).

An essential answer is the risk you're willing to accept. You could say you can't trust your device if it ever leaves your sight, or for how long, or sometimes even if you never lose track of it. Hardware exploits can (and do) pivot from zero days, but you may never encounter one.

If you're travelling in a normal, uninteresting way (where one way to be interesting is to be/act suspicious of authority) generally I'd say no, don't worry about it.


Security of service requests on a public Wifi I'm currently rebuilding my network infrastructure and am planning to make my NAS available trough an OpenVPN server running on my router for "outside" use (no port forwarding: NAS in private LAN, available trough the VPN).

Now I was wondering about a certain scenario:
let's say, I have mapped some of the NAS's drives as network drives via SMB/CIFS in Windows on my laptop (using the local IP address of the NAS in the LAN) or have a proprietary software of the NAS's manufacturer trying to connect to a certain service on a dedicated port.

If I were to take this notebook to an unsecured, public wifi- would this expose the local LAN IP's and/or ports in the CIFS request or the connection request coming from the proprietary software until I'm connected to my VPN (i.e. in the very moment, I'm connecting to the wifi until the VPN tunnel is up)?
Does this depend on the way such a request is implemented in the software?

Note: Not exactly an answer to the question asked but side-steps the need to know for the OP.

Answer: You could block the outbound of this application with a host-based firewall for any network adapter besides the virtual adapter of your VPN.


Buying versus Creating TLS Certificate? Let's say a web server would like to host traffic over HTTPS. My incomplete understanding is that TLS enables HTTPS.

client <--- HTTPS (over TLS) ---> server

The server must produce a certificate to present to the client, who then must trust it to proceed the HTTPS communication. The server has 2 options to get a certificate:

Buy a certificate from a "Trusted Certificate Authority"
Create a certificate

In the first case, as I understand, the client's run-time, e.g. Java's JRE, will trust the certificate.

However, in the second case, as I understand, the client must add the "certificate" to their "trust store."

Assuming the above is partially correct, why would a company choose the second option, i.e. produce their own certificate?

Let's say I'm running a network of IOT devices and I want to enable trusted communications with them. If they're running with a standard certificate store, they'll trust any site with a certificate in their store. Alternatively, I could create my own PKI (Public Key Infrastructure), install only my certificate and these devices will only trust me. I can use this certificate to create encrypted sessions, monitor systems, deploy patches etc.

Another example is installing certificates on desktop endpoints and rejecting domain connections from systems without those certificates.

Another example would be installing certificates on payment terminals.

Consider also using client-side certificates to permit mutual authentication in client-server communications.

So, installing your own certificates can be a cheap way of creating a private trusted network.


Suggestion setting up a SQL injection honeypot I just stumbled on a website vulnerable to an SQL injection attack by mistake ( https://stackoverflow.com/questions/6181248/is-this-site-vulnerable-to-an-sql-injection-attack ).

That made me curious about what is tried and how often an attack attempt comes by on some website.

So I'm thinking it would be cool to setup a honeypot on my server to see if / how often / using what techniques 'crackers' try to get access to my SQL data.

There are some basic things I can think of to lure them, like:

/login.php / asp url

/adminlogin.php / asp url

A searchform

?id=111 url

with some fake SQL errors when trying to inject some SQL.

Anybody has some more / better suggestion / ideas / whatever to set up a honeypot for SQL injection?

May I suggest some honeypots designed for things exactly like what you describe:

WebLabyrinth ( info )
Glastopf
DShield Web Honeypot Project


Can I test/determine all decryption types on an unkown filetype. I do have the password I have a file that's nearly 200Mb.  It was reportedly packed/encrypted with Kruptos 2.  But it has a .~enc extension.  The header of the file is pure gibberish.  Running file says it's data running mimetype says it's an application/octet-stream.  The only thing that looks like a way to identify the file is at the end of the file.  It looks like it may be a checksum.  Here's what I gathered from the hex editor at the end of the file.

786D4532D08A6A06F14D78EA11C648AC6615C025727D1294AA08F43862CBE529©9AA799BC68761F45F3360FEE03D88665©none©F75C7BCC8FB7E449636AE9E3CB81BC8018FCBF307DE1A881765C0A1CBCB65339©193971605©11©3©0©2©32©0© 202©<tkk>

My other hex editor shows the copyright symbols as dots

786D4532D08A6A06F14D78EA11C648AC6615C025727D1294AA08F43862CBE529.9AA799BC68761F45F3360FEE03D88665.none.F75C7BCC8FB7E449636AE9E3CB81BC8018FCBF307DE1A881765C0A1CBCB65339.193971605.11.3.0.2.32.0. 202.<tkk>

Is there a way I can run a decrypt command with trying all the available encryption types using the password I have?  Or at least identify how this file was made and what it is?

One odd thing, I ran df -T myfile.~enc and it says ext4 type filesystem.  I tried to mount it but that didn't work.  So maybe that's just a fluke.

Oh, maybe the file name would be a hint.  It's 021405631868CFACCB0C965D0AF04738ABDCB012CEEAC9C583B2A49CDFEE75BE296b.~enc

stackexchange.  This question can't be answered by security experts; you need to contact the person who generated the encrypted file and/or learn how to use Kruptos 2.  This site isn't for supporting how to use specific applications like Kruptos 2.  The extension of .~enc tells little by itself.  enc is a common extension for encrypted files, but ~enc doesn't seem to be a common convention; though as users are always free to rename files.  And possibly you have a case where the original file was blah.~ and became blah.~enc when it just appended enc to the file.  I'm not familiar with Kruptos 2.

The file utility saying data just indicates that the file seems to have binary data (that is not an executable), as opposed to ASCII or unicode plaintext.  The mimetype application/octet-stream is simply stating that it is a stream of bytes (octets) and that there's no meta-data it can infer about what created it.

df -T file doesn't tell you anything relevant -- it just states that the file is stored on a partition that is ext4 (df doesn't tell you anything about the specific file, it only tells you about the partition that the file is being stored on).

Hexeditors only show printable ASCII characters in the right hand column showing the decoded text.  They generally show unprintable letters as a period (.), though your first hexeditor seems to be attempting to encode the symbols in iso-8859-1 (latin-1), which means the byte displayed as a copyright symbol is really an A9 in hex (See: iso-8859-1 (latin-1) codepage layout.

There are an unlimited number of ways to encrypt a file, so you can't just try all of them.  There's an infinite number of ways you can generate a key from a password (e.g., the first 128-bits of iterated 5000 rounds of a SHA-256 hash function combined using the IV as a salt), many types of encryption algorithms (AES, Serpent, Blowfish, Threefish, DES, RC5, CAST, Salsa -- and this is just for symmetric ciphers; there's also a variety of asymmetric encryption algorithms), and many tweakable settings for each type of method (key size, rounds, block size, block cipher mode (CBC, OFB, CFB, CTR, etc), where to store the IV, how to encode the data, etc.


Should the Payload of Push Notification also be encrypted? If you have a fully end-end encrypted app, should the push messages sent to the APNS or GCM also be encrypted.

The payload only contains message ids, from uid n conversation gid. Is there a major risk if we don't encrypt this ?

How do other Apps like WhatsApp or Signal do it ? I read Signal only sends a wakeup call with no extra details in their payload of Push notifications.

I think you should encrypt this, because of profiling data leak, this information can contain the time of chat between two clients (even they delete messages) and it's very good for branding, you can say you have the fully encrypted application. but to determinate the actual risk you need to ask your self, with that information like "message ids" what you can get about the user, when I say you I mean every person with access to the database and server. can you find out the message from who and for who? if yes its data leak risk.

about the signal app you according to this link they have data leak in the desktop application(but they send text body in notifications its nightmare) but in your case, you don't send text body to the clients.

according to whats app faq: your messages, photos, videos, voice messages, documents, status updates, and calls are secured from falling into the wrong hands.

its seems they don't encrypt notifications. but zulip mobile encrypt notifications


Tracking down Malware within home network My home network has been shutoff by my Internet Provider twice now because it is "trying to gain access to unauthorized resources" within the Internet provider's network.

I am trying to track down the offending device so I can purge any malware that has taken root on it, but I am not sure how.
I have a number of computers running, Linux, macOS, and Windows and some (not many thankfully) IOT devices, any of the above could be the culprit, and only a few of the devices (macOS and Windows boxes specifically) have anti-virus software that I know of.

My network topology is pretty simple, I have a Modem/Router connected to the internet provided to me by my Internet Provider (made by Arris) that is also connected to another wireless router (I think both act as DHCP servers with the wireless router sitting on its own subnet, routing traffic to the Modem as needed, but I will need to confirm how I set it up after I get home).
All of my devices connect to either of these two devices and get internet traffic forwarded on to my Internet Provider.

The only way I can think of tracking this down is asking my Internet Provider for details on the resource my network is allegedly trying to access and then setting up Wireshark and putting my NIC in promiscuous mode and waiting for it to happen again.

Is there a better way to track this Malware down?

To identify precisely what's happening, the capture over time using Wireshark (and add maybe a little bit of logging on each network node) will make you know quite precisely what's going on. "Quite" because, knowing the attacker is attacking your ISP, we can assume the malware might have spread in your home network, gaining safe and quiet places to hide for some time.
Let's follow some crisis methodologies (or a light version of it!)

Deny the attacks, limit the spread

Maybe an IDS/IPS can help you to snort the malware, and block the malicious communications on the network bridge. Add some firewall rules: I'm currently thinking about destination IP filtering, but you can add some rules based on the use of each of your machines. That may isolate it, that's a good beginning.

Eradicate

Then, eliminate may be harder and the solutions are quite evident: antivirus scans might work or disk wipes will do.

The few IoT objects may still be difficult to deal with, as the device can be locked/proprietary.


understanding client certificate - pfx on the general Today I am given a pfx and told to access a website. I have absolutely no idea what was given to me initially, so please kindly confirm my understanding on a general level

1) the pfx is a container which is use to safeguard private key and certificate.

2) when I double click the pfx, it actually prompt me for a password. This is the password use for extracting the contents (e.g. private key and cert).

window prompted me to choose on which store to put the certificate or automatically select the certificate store

  q1) how do I find out where is the certificate store on my system ?

  q2) where is the private key extracted to then ?

In this scenario, I believe in order to access a website, the client will need to provide the certificate which contain the public key which the server will use to communicate with it.

In order for all these to work (client authentication)

a) the client must generate a CSR with its public key inside
b) the client must submit the CSR to be signed by an authorized CA
c) the authorized CA certification and all roots certficates for it must be
installed/available in the SERVER side
d) the client send its certificate over to the server, the server validate the cert, uses the cert's public key to encrypt information before sending over to the client.
e) the client who has the private key will decrypt this
information etc etc.

this private key and certificate is store in a pfx file.
Anyone with the pfx file (and the password to open the pfx) file, can communicate with the server.

  q3) does that means anyone/client who has a valid certificate signed
  by a CA can access the server then ? how does the server choose which
  client to allow access and which not to ?

So let's tackle easy first:

Q1/Q2 you can see your certificates in the certificate manager a.k.a. certmgr.msc

Q3 your scenario is probably wrong. If you are provided with a client certificate, it is probably already signed by some certificate authority (maybe an internal CA used by the service you're trying to access maybe).

Therefore, the CSR workflow don't have to happen here, since you do not need to generate a certificate from a freshly generated key pair.

If you are referring to the process of creating the certificate prior to you getting one shipped, then you are correct. Public key goes into a CSR with your info. Some CA signs it. You need the root CA of the chain.

The last part is the authentication. I'm currently looking for the right protocol, if there is one. But what should be done is:

check the signature of the certificate against the CA public key
check the validity of the certificate
check for revocation
check the subject of the certificate (from who it comes from)
assess proof of possession (through a challenge)

The client certificate might not have to be send, if there is a public keystore for the webservice.

Resources :

oracle - Sun Directory Server Enterprise protocol
The bear stance on client cert validation


What are the main weaknesses of mobile software based OTP generators? What are the main weaknesses of Software based OTP generators like Vasco's DigiPass for Mobile?

Kind of a vague question, but off the top of my head:

Leaving protection of the key/seed to the mobile device means that its possible to extract the key on various platforms unlike dedicated hardware devices with protected storage
You lose your phone you lose your key


A Replay Attack was Detected (4649) on DC and File Server - How should I investigate this? Just as the title states. We've had an alert for a replay attack being detected, how would I investigate this? It's the first alert of this type I've seen, so I'm unsure how to proceed.

I snagged this potential answer from Reddit which linked to an article at ITProToday:

  ”When the Kerberos logic on a DC or resource server
  validates a Kerberos authentication message, it will always check the
  authenticator's timestamp. If the timestamp is earlier or the same as
  a previous authenticator, the server-side Kerberos logic will reject
  the packet because it considers it part of a replay attack and user
  authentication will fail. The Kerberos server-side logic also compares
  the timestamp in the authenticator to the local server time. If the
  timestamp in the authenticator isn't within five minutes of the time
  on the server, it will also reject the packet. These five minutes are
  referred to as the Kerberos time skew.”

  I would start by having the local time checked on that remote host.
  Then any issues on the vpn infra. Apparently this type of attack
  grants nothing for the attacker so it most likely is not an attacker
  but a misconfiguration.

https://www.itprotoday.com/security/understanding-how-kerberos-authentication-protects-against-replay-attacks

So, your first step should be to determine if this is a "true positive" by ruling out potential configuration issues while also analyzing your Domain Controller logs.


How many unique house keys can possibly exist? A Yahoo! answers user suggested that there are 5^5 possible unique configurations for a physical key, but the answer wasn't sourced. I wondered if anyone had similar numbers for how many possible key combinations there are. I ask because, it seems impossible that there can be a unique key for every lock in the world, and I'd like to know how many different key configurations a thief would have to try to have a certainty of cracking the lock (if the thief didn't want to force the lock in another way.)

Here is a very short Youtube Video on how keys work. Given the space available for the length and number of the pins, and operational room for error there are only so many key combinations possible. Given all the different variables involved it's certainly possible for every person on the planet to have a unique lock, it's highly impractical.

Most vendors distribute key/lock combinations by region. Car companies (or house door lock manufacturers) for example might have 200,000 possible key/lock pairs but could redistribute the same combinations on both the east and west coasts since the likelihood of 2 people with the same key/lock combos meeting and then realizing they're the same are extremely low. Generally keys are created using "codes" where a number represents the height of the peaks on the key.

So given say 5 pins with say 10 different height possibilities you're looking at 10^5 unique possibilities. You can then add another dimension of complexity by putting ridges on the sides of the keys. I think you see where this is going. A lock could have more pins or more height possibilities depending on manufacturing accuracy and size of the lock.

If someone was to somehow have every possible key combination in one place, there is NO WAY they would be able to transport it. Let alone go unnoticed. It would take multiple dump trucks to move even a portion of the keys.


PHP hack base64 code uploaded and sending mass emails cPanel server with Exim MTA and Dovecot. Some hacker is finding old scripts at different users public directory, and uploading base64 encoded files then using it to send massive spam.
How do I block it at the server or Exim config itself, without disabling normal PHP scripts sending legitimate email?

Example of that code http://pastebin.ca/3039339

This most likely means you or your users are using outdated software / applications. The only way to prevent this, is to regularly update and patch this software / applications unless the hacker is using a 0-day exploit that's currently unknown.

Try determining the entry point where this script is uploaded from the web server log files. Once found, inform your user(s) to patch their software / application(s).

If you think you should block this at the "SMTP level", I think you are wrong. When hackers are able to upload and execute malicious PHP files, your server may be (partially) compromised. Try determining the root cause instead of fixing it somewhere else.

I suggest to investigate how much of the server is compromised by means of log files. Worst case, I'd suggest to start from scratch.


Is it possible to add backdoor to a file with the same size and crc32 checksum (4bytes)? Is it possible to add backdoor to a file with the same size and crc32 checksum (4bytes)?

(The file does not contain byte code, it contains program code as text. The language is PHP.)

Yes. CRC-32 does not prevent deliberately creating a file with the same CRC-32 and size as another but with different contents. For that, you need a cryptographic hash, such as SHA-256.


External Hard Drive Operating System If I put a OS onto a External hard drive, would it allow viruses to infect my internal hard drive?

Yes.

An Operating System on an External Drive can have the same access to your system as your installed system. The reverse, your installed infecting your external system may also be possible.


Is autocomplete="off" bad for username input fields? So it seems the current consensus is that autocomplete="off" is bad for password input fields:

Should web sites disable form autocomplete on all forms?
Should websites be allowed to disable autocomplete on forms or fields?

But does that include the username field? It just seems to me like these come as a pair.

To clarify, I'm asking if autocomplete="off" is bad for username input fields?

autocomplete off is for sensitive information, for example credit card numbers. The exception is the input type password, because modern browsers do not store input for that type, and disabling autocomplete messes with password managers, thus decreasing security.

Usernames are not sensitive information, although there are still good reasons not to broadcast all your users usernames - eg via username enumeration - if you can avoid it (easier bruteforcing or phishing).

But in the case of autocomplete, an attacker cannot harvest all or even a large amount of usernames, but only usernames where they have physical access to the computer or if an XSS vulnerability exists.

The only negative effect may be privacy violations via leaked usernames or email addresses (if they are used in stead of usernames). But if a user is concerned about privacy on a shared computer, they should use private browsing.

Because of this, it is very difficult to argue that there is even a slight security benefit for autocomplete off for usernames. There is however a real usability impact, so I would recommend against it.


JWT is being sent in cookies, but when I try for CSRF they are not sent I am testing this application which sends JWT and CSRF token in cookies, I created a PoC file to test for CSRF, but only CSRF token is being sent in the PoC request and not JWT.
I was under the impression that cookies are always sent in all requests regardless of the domain sending those requests, this is the reason CSRF attacks are possible in the first place.
Why is JWT not being sent in CSRF PoC request?

Perhaps the cookies are marked as SameSite, or you are using a browser that has SameSite as default behavior.


User Credentials for Accessing Network Resources I am in the process of setting up the infrastructure for microservices using RabbitMQ as our message broker for our company. I am trying to figure out the best way to handle security for the system. This system will only be used (for now) on our internal network. We use Active Directory to maintain users in the domain.

I have configured RabbitMQ to use LDAP over TLS to authenticate users using our Active Directory servers. At some point I will have to send a user's credentials to RabbitMQ. I plan on using .NET NetworkCredential to store the credentials. RabbitMQ can't use the WindowsIdentity token, so we will need to send actual credentials (username and password instead of a token) to the RabbitMQ server.

First, I understand that NetworkCredential is not bullet proof but is better than nothing.

Some co-workers have expressed concern that we will be storing personal user credentials in the memory of applications. When not using RabbitMQ, there was no need to explicitly store credentials long term. We could simply authenticate the user and move on, (letting the garbage collector eventually clean up the users entered password).

They argue that they would rather have a power user identity that has the permissions needed to connect to RabbitMQ. Then we would not be storing personal credentials, and instead using transitive security via the "Application User" identity.

My question is what is standard practice for this situation? My thought is that storing a power user identity in an application is problematic. If the power user credentials, which will necessarily be distributed to every user in some way (even if obfuscated in the code), were compromised the consequences would be worse than if an individual user's credentials were compromised.

As far as controlling permissions in the system it seems to me that using a person's actual credentials is preferable to some power user identity. I have no way of locking out individuals if an individual has access to the power user credentials.

Am I missing some tool or resource that manages this situation?

The Kerberos authentication plugin we found for RabbitMQ is immature and isn't being maintained as far as we can tell. The only real option was for us to send the user's credentials to RabbitMQ over a TLS connection. We store the credentials in the app in a NetworkCredential object as needed which encrypts the password in memory making it significantly harder to gain access to.

Application users and power user credentials are only viable when you can control access to those credentials. That is, they should only be used in limited contexts, like within a secure web application or service that itself controls access to specific functions users can perform. The app, living on a server, can use the elevated account, without exposing the credentials to a user.

If you share power user credentials with common users, through a desktop app for example, so that the user can take actions that the power user can, then you have to assume that the user has those credentials now, no matter how well you obscure those credentials inside the app. It's a better idea to use the user's own identity for security whenever possible. This allows you to revoke permissions from a user if needed. It also allows you to track and log who is doing what in the system.


Can attack to a website from a parked subdomain with different hosts? I have a website like maindomain.com that hosted on a different hosting like 192.168.1.1 i want to add a subdomain from a different host like 192.168.1.2 to my main domain which my address will be like subdomain.mainwebhost.com
If on Subdomain host i have a script with a security bug , Can attackers setup any kind of attacks against my data that hosted on my main host ?

In the context of SQL injection, if both domains are run by the same web server and an attacker is able to perform SQL injection on your subdomain host such that he/she can obtain information from the database, there is a good chance the attacker can also obtain information from your main host as well since both hosts use the same database and web server.


How does an attacker approach a website? What is a typical mindset and method of approach? What are they likely to try first? At what point does a novice give up versus an expert? How would an automated attack differ from a manual one?

From most of my clients (generally Fortune 100 companies) I can say that most attackers they notice (lets exclude the wide range of scans and script kiddie attacks dropped at the perimeter and DMZ) are very experienced, have extensive resources and follow pretty much the same methodology as the white hats.

An example:

Discovery - from public sources
Footprinting - can be under the radar of most IDS's
Vulnerability Scanning - of web apps, perimeter defences, mail server etc
Exploitation - use identified vulnerabilities to get to target or get a foothold
Escalation - move from user to admin/root access, or from DMZ to internal network
Embedding - rootkit, backdoors etc
Cleanup - hide tracks in log files etc

Of course this is just a very high level example, but it gives an idea.


Can a CA sign a PGP certificate? Say I have a public/private PGP key pair used to sign emails.

When someone receives a message, he obviously has no way to check that the message was ~really~ signed by me without having received my public key before by another mean.

Is there a way to remedy that by having my public key signed by a CA?

Your public key can be 'signed' by any other private key you like. However, your recipient's issue will be how to trust the signer i.e. the burden of trusting your public key's origin has now shifted to the burden of trusting the signer's public key origin so not much have changed.

A 'CA' is a vague term. If you mean a SSL chain CA (as in browsers certification authority) then various CA's have their public key hard coded into the browser on installation and this removes the need to verify the signer's public key with a third party. PGP and similar encryption schemes don't work like this for a host of reasons but mostly because signing individual keys would be prohibitively complex and restrictive (think how complex/long the process is to have a signed SSL cert for a website for example, now multiply this with all of the PGP certs out there!)

PGP cert trusting working on a web of trust i.e. the recipient needs to have some 'trusted' public keys pre installed on their keychain that have been marked as trusted by them usually by some side channel (phone someone up and check the key fingerprint for example). If your recipient does not have a trusted public key for someone you are using to sign your public key then they need to check the key with you by some other channel e.g. calling you and asking you to identify it by fingerprint etc. or to download it from a trusted third party keystore where the keystore has a verification mechanism.

So, get your public key signed by as many trusted keyholders as you can and hope your recipient has a trusted corresponding signed public key, or call them for the first key install into their keyring and confirm the fingerprint. Once installed and trusted on their keyring you are good to go without further trust issues.


I found emails and passwords on github, what should I do? Content in question: I found a file in a public repository on Github that contains a few 100 emails, some of them with a password (as bcrypt).

Verification: As I recognize several of the addresses, and know of the background of the file in question, I'm positive that the data are genuine and not intended to be public by the respective owners.

Publicity: I found no evidence of awareness of the repo anywhere.

How should I go about having the file removed? Is this something a CVE should be assigned to?

This is an everyday event not worthy of a CVE.

It sounds like in this case it could be a simple mistake however the following are useful steps you can take or at least consider for any situation where credentials have been discovered.

Contact the affected users if appropriate: The best way to help if this were a case of a public dump of passwords would be sending a single BCC e-mail to each of the people affected letting them know their credentials have been disclosed and that they should quickly change all of their passwords and potentially look for evidence of abuse of these credentials. Don't copy the information or redistribute it, simply send a link to where it was publicly exposed at or tell them the site name.

Contact the owner and service provider abuse accounts: Likewise if you know how the information came to be disclosed/lost it would definitely be helpful to contact the organization(s) involved that lost the information so they can handle it appropriately. To do this simply send an e-mail to abuse@company.com and optionally a sales@company.com or other publicized contact address.

Do not sign any NDA's in this process. Some companies use NDA's to prevent disclosure it's an ugly issue just don't do it. State that you are only notifying them of the problem and do not want to be involved.

Contacting the affected users is very helpful simply because some organizations when contacted about the loss of such data literally do nothing and never tell the affected users (depending on what country it's hosted in this may not be breaking any local laws either). At least this gives the users a chance to protect themselves from further harm.

Be aware some password dumps are fake: The following doesn't apply to your specific situation but be aware that sometimes people post fake "password dumps" to sites like pastebin.com. So use appropriate language when writing your e-mails "It appears that something may have happened ...". etc...

Assuming this wasn't accidental you can politely request the information be removed but in the case of a password dump if it was made public elsewhere the user may have no obligation to remove it (not your situation I just mention this for others). Again passwords being dumped on-line is a common occurrence and there are many sites hosting millions of exposed passwords from compromised sites.


Can ISPs see which website we visit when we use desktop VPN client and browser VPN extension? If we user both: desktop VPN client + chrome VPN extension
or
if we use just browser's vpn extension,

does ISP see which website/link we visit?

Depends on where your DNS requests are being sent. However, if all your network traffic is going via an encrypted VPN then no, the ISP will not see - the VPN's ISP will of course.


Security policy for system administrators I've been in charge of systems administration for a small company for a couple of years and am now training some new collaborators to take over. So far, there has been no security policy, but I would like to leave behind a good security policy that clearly states:

a code of ethics agreed upon by all and the direction board;
rules on how to maintain, update and configure servers;
specifics on how to maintain the security structure: new attacks surface, etc and right now we don't have a structured way to deal with that;

I'm a bit lost on how to start and am sure that list is way incomplete, so I'd like to ask for some pointers on how to research this and get started.

Thank you.

Alright, so this was originally intended as a comment to your response to the answer given by @jl01 but it became too long and it should have merit on it's own....

There's almost an art to creating policies.  Ideally (though i'm sure some people would disagree with me) a policy would be a very general statement regarding the topic.  For example, something not much more complex than "This company will operate with current best practices for system patching".  The idea is that a policy should be established and not need changed (if done perfectly).  It should be generalized enough that it will not need to be updated as different technologies, attack vectors, regulations, etc change.

It is very common to split policies up into each separate realm of business/technology.  This lends itself to producing policies that are more custom fitted to your company and allows you to keep clarity when referring to those policies.

Another way to think of it is that a policy is the business' way of covering their hind ends.  It is created to cover as much as possible so if something goes wrong the company can mold their response to each separate situation while still using the same policy.

Those policies would be  expanded on via procedures, guidelines, and regulations (come to think of it, this should be fairly close to how SANs describes it). I believe SANs refers to what I call "procedures" as "standards".  I apologize for any confusion because of that.

A procedure would be an actual practice which follows a policy (many policies that i have seen seem to refer to the applicable procedures within the policy itself).

A guideline on the other-hand is exactly that, a suggestion of acceptable practices.  Though they are only suggestions, they are not to be taken lightly.  When audits occur, these are the low hanging fruit that an auditor can latch onto.

Procedures and guidelines are the only things that you should need to update with changing business climate, environmental issues, threats, etc.

When i designed my first set of policies, granted this was from a class regarding information security policies, I set up these different policies:

Information Sensitivity Policy
Extranet Policy
Email Policy
Removable Media Policy
Password Policy
Security Monitoring Policy
Router Security Policy
Server Security Policy
System Update Policy
ASP Policy
Server Management Policy
Security Training Policy

This is not an exhaustive list, but it should give you an idea of some of the break downs that may take place.  The way policies are divided are dependent on the needs of that company.

Last, but definitely not least, each policy should be created in such a way that there is do doubt as to what and how it's applied.  By this, i mean that along with each policy the purpose, the scope, the enforcement, and the definitions regarding that policy should be established. I always have fun typing the phrase "will be subject to repercussions up to and including termination".

Though I did not list it earlier, an ethics policy should be in every policy set.  Even when using ASPs, or any service for that matter, it's good practice to request their ethics policy and, depending on what you see, require by contract that they abide by your companies ethics policy for that job.

So, i may have dove a bit too far into the subject... but i hope it helped.

Disclaimer: I am more than aware that this isn't the only way policies can be constructed.  From my experience, most companies have a set of policies that have been loosely constructed over years of regulation changes and compliance issues.

p.s. an ASP is an application service provider, i see that i haven't mentioned it's definition anywhere above.