Can virtual machines be used to isolate vulnerable software?

It's possible to break out of a VM and execute onto the host machine which is usually version and software specific so the scope of this actual attack but as I'm sure you'll of guessed it's very low possibility but not to be overlooked.

If you're very paranoid and want the most secure then no software can offer you full isolation. Use a physical computer which doesn't have access to any device which is capable of outputting any signals to any remote devices.

If using a physical machine isn't possible then yeah, VM is the best solution. Just ensure you restrict the user you execute the actual VM under doesn't have more permissions (DACLs etc) that it actually requires to minimise the security risk of malware executing outside of the VM.

Edit:
Sorry, I misread what the OP was asking for. Nether the less I'll leave above answer if any is doing the reverse.

With that been said, of course it's possible to break into a VM. I use Visual Studio which is a programming IDE and there is a VMWare plugin which you can debug your software into running VMs which is created by VMWare. So, if VMWare Plugin can see all running VMs then they must be some export that uses an IPC to the VMWare itself.

Even if the VM vendor didn't have inbuilt functionality if the malicious software can execute OpenProcess (or lower APIs such as NtOpenProcess), ReadProcessMemory (NtReadVirtualMemory), WriteProcessMemory (NtWriteVirtualMemory):

http://msdn.microsoft.com/en-us/library/windows/desktop/ms684320%28v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681674(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/ms680553%28v=vs.85%29.aspx

Well, this list could go on about other forms of code injection. Breaking from host into a guest would be must easier as you'll have direct access to the memory.

To secure your software you'll want to execute it under another user and deny all other users using DACL to the following:

PROCESS_VM_OPERATION
PROCESS_VM_READ
PROCESS_VM_WRITE
WRITE_DAC
WRITE_OWNER
PROCESS_DUP_HANDLE

http://msdn.microsoft.com/en-us/library/windows/desktop/ms684880%28v=vs.85%29.aspx

Finally ensure to use an AV which monitors IPCs and virtual and physical memory.

@Comment
Yeah, the risk is quite minimal really unless your targeted as an individual.
If the attacker can compromise the host machine then your VMs are easily at risk unless you've preformed the above tasks to reduce the scale of the attack.
Though, if the malware manages to get into kernel then it's game over regardless of the security you put in place. Malware on the host machine gaining access to the guest machine is a whole different field.

To explain this little better I'll make the scenario:

Your VM software is Oracle VirtualBox
Your host machine is Windows operating system which is infected with x malware.
Your guest machine is isolated from any remote connections etc which is currently virus-free (This is why it's differs from scale of attack on host)

Exploiting the inbuilt components of the software (Easy method):

Simplest way to explain this without knowing Windows internals would be there is an executable called VBoxManage.exe which is capable of managing hardware of your VM and the whole VM itself.
So, the malware just invokes passes the malicious commands to VBoxManage.exe to copy and executes the malware onto guest machine. Though, do note that administrator permissions is required by the malware.
If you let me know the VM are your using then I can give you more accurate scope of attack. VMWare has pretty much same functionality as Oracle VirtualBox without getting all hardcore into details.
I've not used VirtualBox in a while so things maybe slightly different but you could used to use a command called VBoxManage.exe guestcontrol.

Memory hacking

Let's for argument sake say there is no command-line executables to manage the VM and/or SDK on how to communicate with VM.
If the malware process can use OpenProcess API with PROCESS_VM_OPERATION, PROCESS_VM_READ and PROCESS_VM_WRITE the malware can perform many varies ways to inject code or read data from your VM process.
This can be a very challenging or easy task but it's hard to say without trying it myself though I'm sure administrator permissions would be required to begin with.

I don't know if you want me to go into the details of process security and reverse engineering the software? Or you just stick to the above on how to reduce the attack scope regarding process permissions and user permissions.


Encrypting With Passwords - Encryption of Key vs. Data

The main advantage of using an intermediate key is that is allows changing your password without reprocessing all the data.

E.g. you have a big file (gigabytes...) encrypted with random key K (a 128-bit value), and K is itself encrypted with P (the key derived from the password). If you change your password, you get a new password-derived key P'. To adjust things, you must then decrypt K with P and reencrypt it with P'. This does not require reencrypting or even accessing the big file.

Apart from that advantage, using an intermediate key decouples the operation, which is more flexible. For instance, the process used to turn the password into a symmetric key might not be up to the task of producing a key of the length you want for bulk encryption (for instance, bcrypt will produce a 192-bit key, not a 256-bit key).

Another advantage of the intermediate key is that it allows revealing files. For instance, you have your big file, and you want to show it to Bob. But you do not want to give your password to Bob; you want Bob to be able to see that single file, not all other files which are morally encrypted with the same password. With the intermediate key, this is easy: you just show K to Bob. As long as each file has its own random K, this works.

Note that the model extends to asymmetric encryption: a file sent to n recipients will be encrypted once with a random key K, and K will be encrypted with the public keys of each recipient. This is how things work in OpenPGP. The corresponding advantages map to the password-based situation as well.


Derived Unique Key Per Transaction (DUKPT) is a key management scheme in which for every transaction, a unique key is used which is derived from a fixed key. Therefore, if a derived key is compromised, future and past transaction data are still protected since the next or prior keys cannot be determined easily. DUKPT is specified in ANSI X9.24 part 1

The key aspect of DUKPT is that for each transaction that is originated from the PIN device, the key for encryption shall be unique. The key shall not have any relation with the keys that were used in the past or the keys that might be used for future transactions. The encryption algorithm that shall be used is TDES.

IPEK is derived from Base Derivation Key(BDK). The inputs to create IPEK are the PIN Device ID  and the Key-Set ID. The Key-Set ID uniquely identifies the BDK. So you can see that, with one BDK, you can have multiple IPEKs. One IPEK for each device with unique ID. The BDK shall not be known to the PIN device. The BDK is a super secret key which shall be known to the gateway with which all PIN devices communicate. The gateway shall store the BDK securely in a HSM device. The BDK cannot be shared among the PIN devices. Period. Thus comes the IPEK to rescue.

Once the terminal has been initialized with IPEK, it shall populate the 21 Future Key registers by invoking a non-reversible transformation process. The inputs to this would be IPEK and a value which is function of the register number. Then the IPEK is discarded.  Now the terminal has 21 Future Keys stored in 21 registers. Now PIN device can communicate witht the gateway, encrypt with the generated key along with meta data which includes Key-Set ID and device ID. With this meta data and the BDK , the gateway also shall derive the key for decryption.


Is it possible to create a secure chat web application relying on HTML5 web sockets?

Actually, this has nothing to do with moving CryptoCat to a browser plugin/extension. It's not even related to SSL at all. Having that in mind, Stephen's answer is somewhat misleading. I'll attempt to address that. CryptoCat is still JavaScript & HTML.

Give me your full attention, assume that SSL is doing its job and you're 100% sure that you're connecting to the genuine CryptoCat server. If Nadim (the guy behind CryptoCat) was forced by law to reveal your future conversation, he'd simply detect when you connect (from your IP) and send you some rogue JavaScript that would make your browser use a custom key and therefor giving himself the ability to decrypt your conversation and giving them to the FBI, NSA, CIA, etc.

That form of security is called host-based security, where you give your complete trust to the service provider. Yes, your stuff are encrypted, but the encryption/decryption logic is coming from service provider, and they can send you whatever they want. CryptoCat was criticized by Schneier and other security researchers for this.

By moving the code to a browser plugin, now you need to trust the source only the first time you download code. Communication still happens between you and the server, encryption and decryption still happens in your browser, the code is still JavaScript and HTML5. The only difference here is that next time you connect to CryptoCat servers, you don't need to trust the code they send you. The code in your browser all the time, you can audit it and check it whenver you want.

Patrick Ball wrote a very interesting article on the subject; he explains the concept of host-based security and other related issues. It'll help you understand the big picture regarding this matter.

To directly answer your question, yes it is possible. CryptoCat is a great example.


Untrusted Connection after installing SSL Certificates from Let's Encrypt

You seem to have a problem with

understanding how https works,
what let’s encrypt certificates can do and
what you need

Let‘s make this as simple as possible:
(For SNI, see below)

You have two certificates for two domains both hosted on the same IP. When a client connects and asks for a certificate, how would the server know what domain has been requested before the http request is handled?

The TLS handshake (the one where your server presents its certificate to the browser) comes before the http request by the browser, otherwise the requests wouldn’t be encrypted nor authenticated.

This is where SAN (Subject Alternative name) comes into play: it allows for one certificate to be made out to different domains (for example www.test.com and test.com). You do not need two certificates but one for both domains.

Edit for future reference:
Apart from SAN certificates for multiple domains, there is a method called SNI (Server Name Indication) that does allow for the server to know the domain name during the handshake.
Thus, the server can know the host name at the right time and present the right certificate.
This can be more complex to set up and maintain and in this case (the two domains belonging to and representing the same entity), a multiple domain certificate as described above does a better job at representing the situation than SNI.


Network and Security Associates v.s. CISCO Security Associates

Without further information we can't tell you which is better. However, by name, I guess the first one is better.

Why? Because it seems to be general whereas the second is only Cisco related.

You can do the first one and then get certified in Cisco.


How to secure the connection between the proxy and application

Your question is a bit confused (you state that "the connection between proxy and the application is encrypted using SSL" and then that "the connection between the application and proxy is NOT encrypted": apparently, you are using the term "application" to designate several distinct things).

That being said:

SSL is meant to be end-to-end. When the SSL client talks to the SSL server, they establish a tunnel which is safe from third parties (for confidentiality and integrity of data). This property holds even against whatever proxies the connection has gone through.
HTTPS (i.e. HTTP within SSL) can be forwarded through a proxy (see RFC 2817 sections 5.2 and 5.3).
An HTTP proxy is contacted through HTTP -- theoretically, it should be possible to contact it through HTTPS too, but browsers are not necessarily configurable that way. I have seen it done with a Proxy auto-config file which was returning the proxy not as an hostname+port pair, but as a full URL (beginning with https), which is out of spec, but was working (I don't remember which browser supported that, though).

So you could make a SSL connection through a proxy, the tunnel between the application and the proxy being itself an SSL tunnel; at which point you would have two SSL tunnels, one nested in the other. But what would be the use ? If the data is sensitive enough to warrant SSL, then it should use SSL on the whole path, even beyond the proxy. And if it does use SSL for the whole path, then an SSL layer between application and proxy is superfluous.

(HTTPS with proxy makes sense when the proxy requires password-based authentication, and you fear interception of that password, though.)


Why should I sign data that's already encrypted?

Encryption provides confidentiality, i.e. ensures that only intended recipient will be able to decrypt the message.

Signing provides authentication, i.e. allows recipient to check that message was sent by a particular sender and wasn't modified.

One way to look at this in the context of PKI is like this: encryption only requires the knowledge of recipient's public key, so anyone can encrypt a message. Signing, on the other hand, requires knowledge of sender's private key, so only the sender can sign the message. As you can see, pure public-key encryption doesn't provide integrity nor authentication.


What does data do

It allows data URIs, such as:

data:text/html;charset=utf-8;base64,PGgzPkhpPC9oMz4=

to be used as sources.

Data URIs can contain any content, they are quite widely used, as they can reduce the amount of URLs that are requested when the site loads.

Should I use it

Not if you want to limit the damage of injection and can avoid it, as it lets anyone who can inject into the page use a data URI containing any content they want.

Should all 3 headers be used

They don't need to be used for Chrome and Firefox, but as CanIUse shows, there are browsers which still need special headers.


An encryption key is generated and used to encrypt the secret message you want to store. The secret message is then stored encrypted on their server and they distribute you an URL which contains the decryption key and the id of the secret message. They do not store the decryption key anywhere on their server and thus have no knowledge of the message content.
When someone visit your link, it uses the id to find back the secret message and the decryption key to decrypt it.

This kind of method is called zero-knowledge storage.


KeePass Password Safe is an open source solution you may want to check out. It is mainly designed for Windows but it can be ran from a Linux box, details here.


Old OS memory space protection - was it really that bad?

Memory isolation

Your example wouldn't work on Windows 95, but it did work on DOS and Windows up to 3.11 (not Windows NT).

The PC architecture, and the Microsoft series of operating systems, started with the Intel 8086 processor and an operating system (DOS) designed to run a single program at a time. You would run a program, and when you were finished with it, you'd exit it, so the overwriting data of another process wasn't really a concern. (You could have programs that remained in memory after exiting; they were essentially part of the operating system.)

The Intel 80386 processor changed the deal by being the first of its lineage to have a memory management unit (MMU). An MMU is a hardware component that provides virtual memory by translating virtual addresses (pointers in a program) to physical addresses (actual locations in RAM¹). Windows 95 was the first in its lineage to take advantage of it: each Windows 95 application ran with its own MMU configuration, so that *firefoxmemory would either point into the program's own address space (in which case whatever bad thing it did could only affect that program) or not point anywhere at all (in which case the program — and not the whole system — would crash).

Windows 3.0–3.11 took advantage of some of the 386's novelties, but they ran all applications in the same address space. This was due to several factors:

a requirement to keep old Windows 1.x/2.x applications running (they were designed to run on single-address-space hardware, and many took advantage of that to poke into OS internals to achieve things that weren't possible through documented interfaces);
lack of development time to redesign the whole operating system based on a completely different architecture;
a requirement to run on computers that had little RAM: keeping applications isolated does cost more memory on a scale of 2 MB or 4 MB (because data has to be copied between programs, and because the operating system has to keep track of all program interactions to allow applications to communicate and to regulate the communication).

It wasn't so much that the operating system was explicitly designed to allow programs to access each other's memory, but that there was no way to prevent it. When ways to prevent it became affordable, it took a few OS versions to take advantage of them.

For example, let's consider a feature such as inter-program copy-paste (clipboard). If you don't have memory isolation, this can be implemented by having the source program keep a copy of the data in its own memory; when the data is pasted in another program, that other program copies the data directly from the source program. The only thing the operating system needs to track is who currently owns the clipboard. If applications' memory is isolated, the operating system needs to arrange for the data copying, and possibly to store a copy of the data independently of the source application. This requires more development work to write this code, and more resources to store this code in memory and run it.

I've simplified a number of things here; for more about how an operating system uses an MMU to isolate applications, you can read How the kernel can prevent a malicious program to operate?, How can two identical virtual addresses point to different physical addresses?, Is it possible to support multiple processes without support for Virtual memory? (they're Unix-oriented but the principles apply to Windows or any OS you're likely to encounter on a PC).

Privilege isolation

In this passage, Anderson isn't actually discussion memory isolation, but privilege isolation, where a running program is prevented from affecting certain parts of the system. Memory isolation is necessary, but not sufficient. The operating system must also control the ways processes interact, control what files they open, etc. Even with each application running in its own memory space, applications can interact. Memory isolation merely forces applications to use operating system services (via system calls to a kernel which can access all memory) to interact.

The Windows 1.x/3.x/9x/ME series of operating system was designed as a single-user operating system and did not isolate applications. Memory isolation was added in Windows 95, but only to improve stability, not to implement security restrictions. These operating systems have no security restrictions: if you ran a program on your machine, it is allowed to do everything. (This is of course helpful to virus writers.) The memory space is isolated, but not the file space.

The Windows NT/2000/XP/… series of operating systems, like operating systems in the Unix family, was designed as a multi-user operating system, which introduces a basic security goal: what a user does should not adversely affect what other users can do. So the operating system has to enforce, for example, that programs executed by Alice cannot interact with programs executed by Bob, cannot modify Bob's files, etc. Programs and data that are part of the operating system concern every user and so should be protected from all users. (Of course, some interactions are allowed by explicit permission, e.g. a network server does process requests that it receives from the network, Bob can change a file's permissions to be writable by others, some users are granted administrative privileges and so can modify the operating system, etc.)

A great many applications were written to target Windows 9x, which had no security restrictions. So they took liberties such as writing to the operating system directory (under Windows 95, copying the file to the Windows directory was the normal way to install a shared library). Much of what these applications do was considered somewhat messy even by the standards of that time, but it worked so people did it. Versions of Windows from the NT series (which includes all versions since XP) necessarily broke some of these applications, though Microsoft did add a number of workarounds (such as pretending that writing a file to a shared directory succeeded, but actually writing it to a user-specific directory).

Windows XP enforced user isolation, but most installations wouldn't take advantage of it: many installations just had the user be an administrator, so all the programs they ran had the privileges to do pretty much anything. There were two main reasons for that:

It allows badly-behaved legacy applications to run. While most such applications are only used by a small proportion of users, many users do run such applications and it takes a long time and a huge effort to renew them all.
Introducing privileges means that sometimes the user will be told that something can't be done because of a lack of privileges. Witness the complaints about Vista, that it would keep showing those privilege escalation prompts.

Application isolation

If you're young enough to have discovered computers through portable devices, you may be used to a model of isolation centered on applications, rather than users. In the Unix and Windows model, Alice's data is protected from Bob. Applications are neutral in the security model: they just execute under the identity of the logged-in user. This means that the application code has to be trusted not to misbehave.

Windows has traditionally coped with misbehaving applications by trying to detect and contain them through antivirus software. That doesn't work too well. Unix systems, especially Linux, tend to cope by distributing more software through traceable channels from which malware is eliminated.

Operating systems designed for mobile devices, in particular iOS and Android, don't trust application developers, so applications are isolated; for example each application has its own file space. This has a security benefit, but also a significant cost in that it reduces what applications can do. Applications require privileges to modify operating system behavior (e.g. to create shortcuts and more generally automation), you can't easily manipulate the same file in different applications, you can't easily allow multiple applications to display information at the same time, etc. Or, to take a more dramatic example, you can't write a debugger with restricted privileges, because the whole point of a debugger is to snoop on and perturb the execution of the application that's being debugged. This cost is why the mobile application isolation model can't just be grafted onto a PC environment.


No expert but I do know that WP8 does indeed use bitlocker and also uses hardware encryption where possible.

So I doubt that you can obtain a usable dump from a standard phone.

Having been involved with a hardware problem on the Nokia phones recently, all I can say is that the engineers use special debug versions of the OS to do hardware level logging and debugging.

I think that you need to contact Microsoft to find out more. I would see if you can track down a tech blog from Microsoft that covers the phone and see if you can reach out to them. They are a lot more responsive generally than they used to be. If you have enterprise support, you could also raise a query via your TAM.


Preventing control-flow attacks by storing code in ROM

Oups, there are different points in your question...

Why is not the code for libc of other program stored in ROM?
By definition ROM is read only, that means that it would be impossible to upgrade libc nor any program if is were stored in ROM

Why are not code pages marked as read-only at MMU level?
They are marked as read-only. Unfortunately it has no use against buffer-overflow, return-to-libc attacks

What makes those attacks possible?
The return address is not stored in code, but in the stack. All current languages (past mid 60s Fortran 4...) also store local variables in stack to allow multithreading and recursion. That means that is a program has no special stack protection and you overflow a local buffer, you could theorically rewrite the return address and that way execute arbitrary libc code.

It must be noticed that most current compilers now implement special stack protections to mitigate those threats.


Security implications of setting the same password on private key and PKCS12/JKS?

If the involved software systems do not do anything stupid, then no, it should not cause any particular problem to reuse the password in that case. By "anything stupid" I mean something like reusing a salt value or failing to generate any IV in the proper way. Each of the involved encryption layers (in JKS, for the private key itself, and for the two passwords in PKCS#12) is defined as a stand-alone entity with its own password-to-key derivation (with its own salt), IV and encryption algorithm.

As a generic cautionary measure, you may want to do all this conversion/export/import in a temporary directory on a memory-based filesystem, so that the involved files are not actually written to a physical disk.


How to prevent malicious file uploads to a site

We have the following report from one of our plugins (it's a WordPress site), which shows multiple attempts to traverse the directory and upload malicious files. Our worry is that without this plugin the culprit would have had easy access to carry out said attacks - but the scan shows directory's that do not exist?

Because the plugin doesn't say - and can't really say - if the attack was successful. It can only say that it did take place.

These look like automated scans for known vulnerabilities. The path traversal test for example is for a vulnerability in wp-ecommerce-shop-styling v2.5.

If you are worried about the attacks, you can follow up on the reports. Check if you have the named plugins installed, and if so, if there are publicly known vulnerabilities for the version you have. You could also visit the link and check if the attack is successful (but first check what the link actually does; You do not want to accidentally trigger an XSS attack for example). Note though that most successful attacks can delete logs, so just because you do not find a successful attack does not necessarily mean that there was none.


Application level proxy on HTML. Capabilities

Technically all three "could" be yes if the SSL and VPN connections are terminated on B at the application proxy.

Without terminating the encrypted connections on B or using a key to decrypt the connections at point B only the first one would be true as in case 2 and 3 the proxy in theory could not see the traffic within the encrypted sessions to be able to differentiate between the .jpg and .html files.

A real-world example of this might be if you used mod_security on a proxy server as B to filter .jpg files from a web-server behind it.

This said I think the original question you read needs to have better clarification. Or you need to be specific about the encryption cases in all of your answers to make up for the lack of specificity in the original question.


I obfuscated my commercial software, i lost source

Hopefully you've learned a valuable lesson about the importance of source control, and backups in general. I'm sorry it happened this way.

Obfuscators are just speed bumps. The only info that is actually lost is stuff like comments; everything else is just made hard to read. For example, all your strings got base64 encoded, which is trivial to reverse. The names of those string variables/constants appear to themselves have been encoded and stored in a lookup table; you should be able to reverse that too. Some names that were internally-scoped only are probably lost, but you should be able to figure them out from context and memory.

There may exist tools to automate some of the above steps. Alternatively, you might have to write one. A relatively short python script could recover all the $GLOBALS assignments in your screenshot, for example (you could do it in any language, python is just a convenient balance of power and ease-of-use). Assuming the obfuscator did anything worse than just hide the names of stuff, you might have to do some actual work picking apart the logic in the obfuscated functions, but unless you're implementing anything super complicated (advanced math, handling binary data formats, etc.) it should be pretty easy.

Technically off-topic and just out of curiosity, why are you obfuscating PHP source? If you're just uploading it to your own server, all you're doing is wasting CPU cycles. If you distribute the source to third parties (such as customers), I suppose you could say some obfuscation makes sense, but generally you just solve that with copyright law unless your software actually contains genuine trade secrets that others don't know how to do and would find worth the effort of reading your code to figure out. If that's the case, then obfuscation is "better" than nothing, but - as mentioned at the top - it's just a speedbump.

Also, especially if you aren't using source control, you shouldn't be obfuscating files in place. Create a new destination path for the modified files, don't overwrite the originals.


What could be done with web shell on unrooted android device?

If the web server such as Palapa Web Server is installed on the Android device and the Android device is capable to execute PHP scripts then you can definately get the shell access of the device.

Note: Android supports a beautiful and the robust concept of sandboxing such that each application runs as different user. Once you will get the shell access on the device you will get the privelleges of the application that is executing the webshell.


Is this plausible?

Yes, it is. As pointed out in the comments, tampering with an iPhone (or an Android Phone for that matter) isn't that complicated when you have physical access to it. The problem is, you do not have access to the data is stored on the phone itself.
Plus: You can think about him what you want, but pretty much all of Snowden's allegations turned out to be true.

  Can the government really break into an iPhone through physical code overwrite?

The government (or whoever has physical access to your phone - and a bit of time) can "break into your" phone. This means components can be altered.
But what it does NOT mean is, that an adversary can then read the files/data that is stored on the phone, because they are still encrypted. They can get encrypted with the user's passcode/PIN, and this is - to my knowledge - not accessible through hardware tampering.


The BDK should generated and stored on Tamper Resistant Security Modules (TRSM) usually an Hardware Security Module (HSM). There are cloud solutions like CloudHSM from AWS that can help with that.


How to enable ECDHE in openjdk-1.8.0 in CentOS 6.7?

I just wanted to append my thoughts to this since I've been recently going through the same thing.

All my attempts of trying to get ECDHE with SunEC have been pretty unsuccessful, so I'd strongly recommend just using Bouncy Castle. You just add the provider jar to your JRE/JDK ext folders and modify your security providers in your java security file and boom, you're ready to go.


Why do people use IP address bans when IP addresses often change?

IP address bans have flaws as you mention, but I think the primary reason they are used is simply that there aren't really any better alternatives. Other identifying features, like browser user agent, cookies, browser fingerprint, etc. are even easier to spoof or circumvent. There are plenty of extensions you can use to change your user agent or fingerprint, and cookies can simply be cleared.

  For example, we turn our router off every night so our IP address
  often changes in the morning. Furthermore, often a simple power-cycle
  is enough to change the IP address. Thus IP address bans are
  relatively ineffective.

The ease with which you can change your IP address depends heavily on the ISP. For instance, back when I had Verizon DSL, my IP address would change each time I turned the modem off and back on just like what you describe. But after switching to Comcast, my IP address has not changed for the entire two years I've been with them, even after multiple power outages and modem restarts. So the "router reboot" workaround won't necessarily work for everyone.

Another thing you should consider is that even if you're one of those people who can change your IP address with a reboot, you're likely still getting an IP address from a fairly limited pool of addresses. This is because ISPs generally don't assign addresses completely randomly; they divide their service area into smaller areas (e.g. neighborhoods), and then allocate a small range of addresses to assign to customers in each area. So if there was a really persistent and problematic user, a site administrator could ban the entire address range (though this could cause significant problems for other users as you mention).

Side note: It's worth mentioning that there are other ways of masking your IP address that get around this problem, like using a VPN service or Tor. Some sites, like Wikipedia, try to block all IP addresses of known public proxies to counter this.

  On the other hand, banning IP addresses can cause a lot of grief for
  innocent users who are using the former IP addresses of a malicious
  user, and sometimes a range of IP addresses is banned thus causing the
  banning of innocent users to affect even more people.

Yes, IP address bans are a blunt tool and this is one of the problems inherent with them. This is especially the case when an IP address is shared by hundreds or thousands of users in the same building, or even a large part of an entire nation via carrier-grade NAT. It is the responsibility of site administrators to minimize the effects of IP address bans on legitimate users. Various measures can be taken - for instance, you could make an effort to identify IP addresses are shared and make sure those IP addresses are only banned for short periods, or make it so that users with a certain minimum reputation can still log in from banned IP addresses and remain unaffected by them. If done right, IP address bans can be very effective at blocking unwanted users while having minimal impact on legitimate ones.


How safe is it to put your 1password file on Dropbox?

Disclosure: I work for AgileBits, the makers of 1Password.

Short answer

The safety of your 1Password data on Dropbox depends on the quality of your 1Password Master Password.

Long answer

The long answer is just an explanation of the short answer and a couple of other things.

We designed 1Password under the assumption that some people would have their encrypted 1Password data stolen. Whether it is stolen from their own computers (someone walks off with a laptop) or from something like Dropbox doesn't really matter. It is possible for the data to be stolen, and this is why it is encrypted with keys that are encrypted with keys that are derived from your Master Password.

Now we make heavy use of PBKDF2 to slow down automated Master Password guessing in the event that the 1Password data is captured, but PBKDF2 and the like only present a speed bump to the attacker; it does not provide a solid barrier. So it is important you pick a good Master Password.

More than five years ago, we offered some advice on picking a good Master Password in Toward Better Master Passwords. This advice was picked up by XKCD and made famous, but it satisfies what I call the Kantian Principle of password creation advice: Password creation advice should remain good advice even if everyone follows it.

Do not reuse your Master Password. In the three known (to us) cases in which someone's 1Password data was compromised, the user used the same password that they used elsewhere for both Dropbox and for their 1Password Master Password. Don't be like them.

Beyond Dropbox

At the risk of descending into a sales pitch, I should point out that with a 1Password account, you no longer need to manage your synching through something like Dropbox. We have even designed this with Two-Secret Key Derivation (2SKD) so that even if your data is captured from our servers, an attacker would not be able to launch a password guessing attempt against that captured data. Please see our white paper (PDF) for details of how that is managed.

But as the question was specifically about 1Password data on Dropbox, let me return to that ...

OPVault v Agile Keychain

Depending on when you started using 1Password and on which platform, you may be using the Agile Keychain format on Dropbox. The Agile Keychain Format was designed nearly a decade ago and has some shortcoming for a today's world. It exposes much more "meta data" than is appropriate and it does not include any tamper detection.

So the one thing I would recommend to those synching 1Password data with something like Dropbox is that they switch their sync format to the OPVault format. OPVault encrypts far more meta data, and uses authenticated encryption to defend against a wide class of attacks that involve tampering with the data.

But with either data format, the safety of your 1Password data depends on the quality of your 1Password Master Password. Make it unique, strong, and memorable. And you may wish to write it down and keep that in a safe place because there is absolutely nothing we can do if you forget your Master Password.

With a 1Password Account, a good Master Password is still needed to protect you if data is stolen from your local machine, but 2SKD does protect you if data is stolen from us.


How secure is the Windows 8 "Reset your PC" function?

That entirely depends on the option chosen during the use of the Reset your PC tool:

As you can see in the image above, the user is presented with two options:

Just remove my files option is the faster of the two, and is meant to be selected when you're resetting your PC for your own personal use also after the reset.
Fully clean the drive will take much longer to complete, and is to be used when you're giving your PC to someone else. It's supposed to prevent anyone from extracting personal information from your previous Windows 8 installation by using forensic file recovery tools, and make it safe to transfer your PC to a new owner.

Both options will literally install Windows 8 from scratch (which is good to know, as you might need to reinstall any custom drivers not included in your Windows 8 installation), but the latter option (Fully clean the drive) is supposed to securely* erase your files, before it proceeds with reinstalling Windows 8. When the program finishes, it leaves your computer free of your personal data, and with a fresh copy of Windows 8, ready for the new owner.

* One thing to add though, that I haven't been able to find any information on what specific method is used to securely erase files from the drive that this tool will reinstall Windows 8 on. Microsoft isn't really clear on it either. For example, in their page on How to restore, refresh, or reset your PC:

  You'll be prompted to choose whether you want to erase data quickly or
  thoroughly. If you choose to erase data quickly, some data might be
  recoverable using special software. If you choose to erase data
  thoroughly, this will take longer but it makes recovering data far
  less likely.

Frankly, this lack of official information doesn't really fill me with confidence this process is entirely secure, and the recommendation to hire a certified Microsoft refurbisher in case of high risk data on their page on How to more safely dispose of computers and other devices doesn't help much either, basically telling us to buy more products to solve problems with the previous products we bought off them.

If you feel your best option is to secure erase your sensitive files on your own and not trust Windows 8's Reset your PC tool to do that for you, then here's a link to some apps on Windows 8 Downloads that should do that for you and are hopefully better documented, and here's another related question with some recommendations in the answers.


Vulnerability of Chrome's "Login Data" file after being orphaned from the host system

In Windows, Chrome uses the Data Protection API (DPAPI) to Triple DES using your Windows user's password. This means that every other program running under your Windows user is able to decrypt the login data. In fact, that's how tools like ChromePass and ChromePasswordDecryptor work. They only decrypt the file and reveal the passwords only if you run them on the same system that encrypted the file (or, perhaps, provide the victim's Windows password).

If the attacker was only able to acquire the Login Data file (for example, you had the file on your memory stick and it was stolen/lost), then your login data are protected as strongly as your Windows password is.


What it seems like you are asking about is an Identity and Access Management (IDAM) solution which offers federated authentication from non-university sources.

I've only dealt with proprietary solutions (Oracle, CA etc..) but generally IDAM solutions are made up of the following elements:
- Authentication
- Access Control
- User Management
- User repository

I cannot answer your question whether Gluu or Keycloak plus AD covers your requirements and I know nothing about them.  Defining and mapping your requirements against each solution should indicate whether they are suitable.
I would also assume that any open source solution with a rich and mature community would have plenty of guidelines regarding hardening, configurations etc...


Relationship between threat analysis and attack modeling

I'm not sure where you got those definitions, but let me try to simplify.

The English word "threat" has many meanings.  "There's a threat of a hurricane this weekend."  "He threatened to hit me!"  "There's a buffer overflow threat."  Similarly, "Someone could use a buffer overflow to attack that."

In my book on threat modeling, I defined a 4 step framework for thinking about threat modeling:

What are we working on?
what can go wrong?
what will we do about it?
did we do a good job?


Why is system32/ntoskrnl.exe blocking port 80?

I've found out that there was an instance of IIS running on my system (not the developer version that is started by Visual Studio, but the standalone version that can be installed via "Turn Windows features on and off"). This causes ntoskrnl.exe to use port 80. Sorry for the false alarm ;)


No.

If your computer is not connected to the router, other people having access to it won't be able to access your computer through it.

You could pose a convoluted (and highly unlikely!) scenario where a three-letter-agency recorded all your wireless traffic, then buy your router to attempt decrypt the messages that were sent in plaintext (ie. using only the Wi-Fi encryption) through that router in the past once they learnt the password you were using. This would require that they had recorded the initial 4-way handshake for that session, which requires being highly targeted. This would not allow decryption of anything you hadn't sent that session, or that were separatedly protected (eg. inside a HTTPS connection).


wifi devices connected even if they give a wrong password, how can i use this vulnerability

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

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


Hardware components based on which to generate password

If you were on Linux, you could simply query /dev/urandom to get the random value without carrying about what the source of the randomness exactly is. But yes, the device will use noise generated by the devices to increase the entropy.
On Windows you may use the Windows equivalent: https://stackoverflow.com/questions/191335/windows-equivalent-of-dev-random
But you may also use everything else that is meant for crypto purposes. You have tagged your question with [java]. In Java you may use the SecureRandom class. The output is unpredictable and this should be the most important concern regarding a random number generator.


Security flaw while importing certificate?

1) What's this certificate for?

For SSL interception at the firewall, i.e. the SSL connection will be terminated at the firewall and the firewall will do a new SSL connection to the server. All the certificates you get in your intercepted connection will be signed by this CA certificate you've imported and are therefore considered trusted. This way the firewall can analyze even SSL traffic.

  2) If I don't import it, every site access attempt results in a certificate validation error. Why is that?

Because your host does not trust the CA certificate of the firewall which is used to create the new certificates for the intercepted SSL connections.

  3) Is there any flaw in this situation? For example: can I use this certificate in order to try a MITM attack?

Anybody who has access to the private key of the CA certificate can MITM the connection.

  4) Windows users don't need to import this certificate, whilst Linux users do. Linux users need to authenticate every 12 hours, whilst Windows users don't. May someone write something to explain what's going on here?

With windows the proxy CA  certificate is automatically propagated to all machines using a policy. And there is probably some process to which maps an IP address to the user currently logged on the machine so no manual login is necessary.

  .. Given the fact that I have the certificate,
  A) can I "extract" (or export or get or whatever) the private key from it?

No. You have the certificate only. This includes the public but not the private key. The is the same with all the other CA certificates you have on your system or in your browser: they are used to verify a certificate only which is done using the public key in the certificate.

For more information about such firewall based MITM see Can my company see what HTTPS sites I went to?


Hashing Password on Client Side to avoid lag on single-core game server?

I am assuming that some of my users will be using the same password as they are for other sites.

In the context of protecting password from use on other sites (besides your own), it does not matter whether you hash the password client-side or server-side.

However, depending on your client environment, (i.e. web browsers) you may have difficulty finding a sufficiently well-optimized (strong) implementation of a Slow Password Hash. (e.g. Argon2 or BCrypt) So, your suggestion of client-side hashing may only be practical in App environments where native cryptography is available.

Of course, hashing client-side will do nothing to protect the password from being used on your site. An attacker who has stolen the hash can simply skip the client-side hash routine and become authenticated with your server. (never trust the client) Fortunately, this attack vector can be solved server-side. (see below)

  The server has a constant game loop that needs to run, and I don't want the game to lag every time someone registers an account or tries to login. This approach would take some of the load off the server.

As you know, it is traditionally recommended to hash sever-side. If you are concerned about load, I submit a few suggestions:

The Work Factor should be tuned only to take ~100ms on your target hardware. (your server) So, that's not really much of a lag, is it? I normally advocate 50ms-500ms, but your site could use a lower value and still be considered robust.
The Hash should be in a separate thread from your main game loop (async) so that the game can continue to operate (albeit with slightly poorer performance) while the hash is calculating.
You should include some form of DoS protection to limit the amount of hashes your server would calculate. Typically, the site would throttle sign-in attempts (per user?) so that an attacker would not be able brute-force effectively. Such a throttle would prevent endless hash computation.
If you like, you could hash the password on both the Client and the Server, if the client environment has sufficient native support. (described above) Then you can get away with an even smaller work factor server-side.

If the client-side has a sufficiently strong Work Factor, then it actually becomes reasonable to run only a quick (i.e. zero lag) SHA-2 on the server-side, and that will solve your problem completely. (thanks @HenningMakholm)

Finally, make sure the client sends the password (or hash) over HTTPS only. This is the most important thing, as no amount of supposed hashing will protect passwords typed into an HTTP site.


How secure is NAS server in LAN (wi-fi enabled)?

The Synology NAS's are very cool. I've just doubled the RAM on my 412+ as I tend to run too many services on it.

It is, of course, possible that someone could break into your Wi-Fi and then into the NAS and do nasty things. However, if you have a well set up Wi-Fi and have configured the NAS with decent security (e.g. on the Synology, I use the internal firewall to ensure that no unencrypted connections are allowed) then the risk is minimal.

In fact, it is statistically far more likely that you will be burgled, have a fire or flood or even earthquake (well maybe the latter only in certain regions)! So the main problem is one not related to a NAS but rather related to having valuable data at home. Loss through one of these or through disk failure is vastly more likely than a Wi-Fi hack for the majority of people.

So no matter what you are using to serve up your precious files, you really must also use off-site, secure backups. An advantage of at least some of the Synology devices is that you can persuade them to run Crashplan which generally remains the cheapest secure cloud backup if you need more than a few 10's of GB. They can also connect to a wide variety of alternatives including other Synology or other remote backup devices.

As mentioned, the Synology software includes an internal firewall which is easily configured to restrict connections from specific source addresses if you want to do that, it will add a little extra protection though honestly is almost certainly more hassle than it is really worth.

If you want to restrict to wired only connections, you will need a way to either limit the IP addresses of wired connections (through manual setting or DHCP fixed addresses depending on your router) or a way to put Wi-Fi through a separate VLAN. Either of these options will depend on having a decent router.

In general though, if you have a backup and set sensible defaults on the NAS (decent user passwords, encrypted connections only), that should be more than enough unless you live in a particularly vulnerable location or have particularly sensitive files.

Final note: I am not familiar with the WD NAS's only the Synology's.

UPDATE: For the specific requirements you've mentioned, the Synology would be an excellent fit I believe (possibly a QNAP device and others as well but I can't comment on those I'm afraid). Any of the NAS's will give shared drive access from Mac, Linux and Windows with the restrictions you mention. Certainly the Synology will let you set up any number of "shares" (shared logical drives) all with different security. You might also want to set up users on the NAS so that you can give different access to different people. Otherwise you just set up yourself and a guest account.

However, I recommend you work out how you will backup the data before you invest in the device.

The smaller NAS's are OK for simple use but may restrict your options for backup. Crashplan for example is a bit of a memory hog so you will struggle to back up >0.5TB on the smaller devices. To get round that, you should split your backups and run them on a rotating schedule (which the Crashplan client allows you to do).


Is it possible to ensure that only two specific services are allowed to talk to each other?

Pretty sure you can do that with TCP wrappers I would give a very detailed account of how to do it but, Red Hat does it much better!


Yes, but it depends on how much of the private key you have.

RSA can always be brute-forced if you know the public key; it is protected by the sheer length of time that it will take to try out all possible factors.
If you have part of the private key, this means you can rule out a number of candidates - those that don't contain this part of the private key.
How much of an advantage this is, depends on how big the public/private key pair is, and how much of the private key you have.


Implications of replacing Java Applets with Client Side Websocket Server

You're trying to do the impossible here. You're having the localhost server authenticate the client application running in the browser. This is impossible to do securely.

What you would want is to write a browser plugin/add-on. The browser plugin/add-on should only activate itself when visiting authorized sites.


Why would a replay attack be considered a threat to integrity and not confidentiality?

A replay attack is an attack where you record a legitimate transaction and then replay it at a later date.

It is not an attack on confidentiality because the attacker isn't learning any new information: he has the same data than what he recorded in the first place. it might lead to an unauthorized access but that is a different issue.

It is not an attack on availability because the target system will still be functioning normally (again, unless the replay attack opens up the way for a different kind of exploit).

It is, however, a breach of the system integrity because it allowed an unauthorized transaction.


Why my files that Encrypted with EFS in Windows 8.1 shown in Linux ubuntu?

This is normal. It's how EFS works.

Although it is common to refer to file folders with the encryption attribute set as “encrypted,” the folder itself is not encrypted. When encryption is set for a folder, EFS automatically encrypts all new files created in the folder and all files copied or moved into the folder by using My Computer.

(Source: Microsoft TechNet: Using Encrypting File System) (Archived here.)
You may want to use full disk encryption like TrueCrpyt or Microsoft's own BitLocker instead of EFS.
EFS ZIPs
Edit: EFS-encrypted ZIP files are a quick and dirty workaround.

File names in encrypted folder are not protected. Actually, encrypting folder contents means automatically applying encryption to all files in the folder, not encrypting directory data itself.
Since the file name itself could contain sensitive information, it could be a breach in security. One of the solutions would be using encrypted .zip archives instead of folders, which are treated by Windows XP almost like folders. Thus, only one file is needed to be encrypted and archived data themselves are harder to crack.

(Source: NTFS.com: EFS - Encrypting File System. Encrypted Files and Folders
(NTFS v. 3.0 and newer) (Archived here.))


Who and how can update cable modem firmware?

It doesn't matter at all if you own the cable modem or not.  Providers have policies (for several good reasons) about how endpoints are managed and most of them (especially the big ones, Comcast, Cox, Charter/TWC/Spectrum, etc) require that in order to connect to their network, your cable modem must run their firmware.  Its not even a choice, during initial connection handshake the cable modem downloads the appropriate firmware (every time, no matter what) and runs it. Trying to update the firmware to some other version, if even successful, would only result in losing connectivity until you reboot the modem, at which time it will load again from the network.

Now, its important to not confuse the cable modem with the router/firewall gateway device, in most circumstances these are two different pieces (the modem is strictly responsible for providing IP/ethernet connectivity over the coax, nothing more) so a much different answer would apply if you ask the same question about your router/firewall device.


Will quantum computing destroy all our present encryption?

On a slightly different tack, Mike's response addresses the question of "could/can quantum computing destroy" some of our present encryption.  This is slightly different than "will they".  Basic quantum computers have been built and work.  The challenge now lies in increasing the number of qubits.

In a recent breakthrough MIT researchers were able to use a quantum computer to calculate the factors of 15 with 5 qubits.  Now 15 is a pretty big number.  I can't even count that high without taking off one of my shoes.  The world record is calculating the factors of 21.  I can't count that high with both of my shoes off!

Kidding aside, the point here is that for a quantum computers to factor a large key, they need a lot of qubits to be in superposition.  The thing is that the more qubits you try to keep together in that state, the harder it is to maintain.  This is the reason that quantum mechanics is so strange to us because even the tiniest objects we deal with in the natural world are all made up of very large numbers of atoms.

It's kind of like juggling.  A lot of people (e.g. me) can juggle three balls.  Juggling four is way less common.  Not something I can do.  Juggling 5 is pretty extraordinary.  6, 7 we are talking amazing.  11 balls is the Guinness world record.  Getting 5 qubits working together was a big deal.  Getting 1025 in superposition?  No one today knows if that's feasible and if it is, who's to say we aren't using 12288 bit encryption at that point?

Don't get me wrong.  I'm not saying it won't happen.  Perhaps there will be a breakthrough and the increasing difficulty of keeping more qubits in superposition goes away.  I think most people who really understand this stuff and being honest will tell you it is still an 'if' and not a 'when' yet.


What is the Session ID parameter indicate in Client Hello and Server Hello messages

Can this be captured by an attacker?

Yes - but its not much use to them.

It's an indirect reference to the algorithms and keys previously (and securely) agreed, which are remembered by the server/client. So if the attacker asserts to your server that he wants to resume the session, your server will resume with ciphertext the attacker's client doesn't know how to decrypt.

(There may be some scope for escalating this to a DOS against a single client, but that's conjecture on my part. And if the attacker can sniff the traffic there are easier ways to subvert the connection.)

The TLS session has got nothing to with the HTTP session(s) so even if the attacker was able to decrypt the data, this is not sufficient to get control over the users session in the application.


Is a standalone phone number considered Personally Identifiable Information?

It depends. Could this number linked to a single person? (e.g. it is your cell number and if I know this number is in a database and know it's yours, then I know you are in that DB)

Then yes.

If this is not possible (e.g. it is the central call in number of a big corporation that is connected to any available agent) then no.

If you only have phone numbers without further information about them, you have to assume it is PII, because you don't know if a number belongs to an individual or not.


How to acquire security advisory for CentOS?

AFAIK, whatever applies to RHEL should apply to respective CentOS release. Read more here on the similarity part (https://unix.stackexchange.com/questions/27323/is-centos-exactly-the-same-as-rhel). [1]

Also best way to search for CVE is to go to https://cve.mitre.org/ and search for CVE List with keyword like "CentOS". e.g. (https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CentOS)

Edit: In the provided first link, an answer mentions "CVEs (Common Vulnerabilities and Exposures) are not tested on CentOS, and it is expensive to test them properly." I didn't got any source to verify this claim.


Why would a stealth scan attract more attention than a connect scan?

Nmap, like any adversary tool, can be fingerprinted by Intrusion Detection Systems (IDS). As such, any of Nmap's techniques are generally classified as an attack by these modern tools -- especially Next-generation Firewall (NGFW) technologies, or the bleeding-edge equivalents of NGFWs.

Additionally, information sharing alliance centers (ISACs) are sharing Cyber Threat Intelligence (CTI) indicators (often shown as Indicators of Compromise, or IoCs) that involve either

IP addresses that original attacker traffic, such as Nmap, and thus would be blocked or detected by an organization that has a CTI team, consumes CTI feeds, or has products or service that include a CTI element
Network traffic signatures, such as Snort (N.B., Snort is a very popular free, open-source IDS) rules, that contain information about how Nmap works -- especially Nmap's "stealthy" scans, e.g., NULL, FIN, ACK, Window, SYN, et al

Which book are you referring to? Given the context, it appears that the author is discussing how SYN scans are potentially more noisy on a network than TCP connect() scans. This is because the SYN scan does not complete the full TCP handshake. Again, IDS/IPS, UTM, NGFW, and CTI defensive techniques will detect the SYN scan, much like many other Nmap methods and many other network penetration-testing tools and techniques.


Is it secure to wipe a file in a Virtualbox disk if the vbox disk file is on an ssd?

No, it's not secure.

Wiping a file in a virtual machine will wipe out the corresponding bytes in the virtual disk file: every VM I'm aware of does a 1-to-1 mapping* between virtual disk sectors and parts of the disk file.  However, that doesn't mean the data will be wiped out on the underlying disk: solid-state drives perform wear leveling, so successive writes to the same logical sector will almost never result in writes to the same physical sector.

* Actually, most use sparse files, where never-used parts of the disk simply aren't present in the file, but this doesn't change the situation.


VirusTotal shows that APK contains Exploit and Trojan, how trustworthy those flags?

Koodous (a cloud-based mobile-AV scanner) does not do an analysis of this particular APK -- https://koodous.com/apks/6341be988be00042c698511fd88c97c618e6109afac40fdf5bed52383bcdf18e

but if you look at the subject and issuer attributes for the Android certificate, this malicious app is similar (contains the string rtt) to other ones that have been analyzed -- https://koodous.com/apks/6cea48dd0aa2cf5d5bfcf6c8a162f5a13624aa4429ee494c0f8d6583b204a98f -- (VirusTotal for this second one here -- https://www.virustotal.com/#/file/6cea48dd0aa2cf5d5bfcf6c8a162f5a13624aa4429ee494c0f8d6583b204a98f/details )

This analysis clearly shows that 8 out of 97 Koodous-analyzed APKs with the same cert also contain adware/malware -- https://koodous.com/apks?search=cert:2DAF3283B6EA6F38238102C7B236A22E85A4C2F1

If you look at the Interesting Strings section for the APK you ran through VirusTotal -- https://www.virustotal.com/#/file/6341be988be00042c698511fd88c97c618e6109afac40fdf5bed52383bcdf18e/details -- you will see http://api.share2w.com/stat/adrequest, which is a malicious domain and URL.

As the other answer eludes to (and in the same details section described in the last paragraph), the APK contains one or more Linux executables. In your APK's situation, at least one of the binaries it includes was found on the filesystem as /r/m/su.png which is the su binary used for Linux/Anroid privilege escalation. I have no idea why this made it into the Google Play Store, but the APK is also available in the AppChina app store / app market.

In addition to the su binary, the APK also contains the following suspicious/malicious code:

private void a(File object, InputStream inputStream, String string2) throws IOException, InterruptedException {
    int n2;
    if (!object.getParentFile().exists()) {
        object.getParentFile().mkdirs();
    }
    String string3 = object.getAbsolutePath();
    object = new FileOutputStream((File)object);
    byte[] arrby = new byte[1024];
    while ((n2 = inputStream.read(arrby)) > 0) {
        object.write(arrby, 0, n2);
    }
    object.close();
    inputStream.close();
    Runtime.getRuntime().exec("chmod " + string2 + " " + string3).waitFor();
}

It probably also contains other malicious logic, but these are enough to conclude that the APK is indeed some sort of adware/malware.


How to fix WordPress CVE vulnerabilities or preventive measures?

So multiple questions here.

  1: Are points 1 and 2 invalid in my case as I am on 4.9.8 version.

So Vuln 1 (1000600) is invalid as it does not include 4.9, but everything below that.

Vuln2 1000773 is not invalid and is a finding. How risky it is is dubious though and based on how much access your users have. See the linked reference and below quote:

https://www.theregister.co.uk/2018/08/20/php_unserialisation_wordpress_vuln/

"As things stand, the objective scope of the vulnerability, and how easy it might be to exploit is unclear. Thomas's presentation contained a number of caveats omitted from Secarma's press release about the presentation, which boldly claimed the flaw left "30 per cent of the world's top 1,000 websites vulnerable to hacking and data breaches."

Crucially, an attacker would need a suitable account, be able to upload images or other files, and the site would need a vulnerable plugin installed before malicious commands could be injected, for example. To pull off a complete host system compromise, further vulnerabilities would likely need to be exploited to escalate the intruder's privileges."

  2: Are these issues fixed in the latest update?

https://www.cvedetails.com/version/263829/Wordpress-Wordpress-4.9.8.html

Not specified if 5.0.1 has fixed all of these; that said they are not listed on any sites as being found in 5.0.1. And all but one were fixed by 4.9.8.

https://latesthackingnews.com/2018/12/16/seven-wordpress-vulnerabilities-fixed-in-version-5-0-1/

This site references a PHP_uniserialisations_vuln being fixed for 5.0.1 which I imagine has to be this one... but can't say for sure. Eitherway, It's probably worth checking on a dev box if upgrading breaks anything and then pushing it, or verifying your users don't have permissions to allow the vuln to work.


Is DNSSEC vulnerable to (remote) timing attacks?

I agree with your argumentation, i.e. I don't think that DNSSec is vulnerable to timing attacks in most cases (see edit below for when it might be vulnerable). Cryptographic operations are only done when records get modified, added or removed or if the keys get changed but not when answering a DNS query. Since the attacker can only control the DNS query but not the change of records or change of keys he can not observe the timing of the cryptographic operations and thus cannot use timing attacks against these.

EDIT: Habbie@ correctly pointed out that some providers like Cloudflare use online signing and that thus the attacker might actually trigger a signing operation (see comments for details). In this case a timing attack might maybe possible in theory. I don't know how well this would work in practice, i.e. how sensitive the timing need to be and how many signature operations need to be triggered. crypto.stackexchange.com might help with more details here.


Should I generate new SSH private keys for each machine I work from?

The question is a bit confusing. As I understand it, you're asking about logging in to a server, via SSH set up with PubKeyAuthentication, from any of your three machines.

You should generate one pair of keys for each machine. In this way if one private key gets compromised you don't have to regenerate a key pair on all three machines you login from. In fact, you want to identify yourself (to the server) as "you at computer X".

If you were using PGP, then you should be using an unique key pair to identify yourself (to other PGP users) as "you".


While RANDOM_UUID a type 4 (randomly-generated) UUID that changes every time it's read, RANDOM_BOOT_ID is a similar UUID that changes exactly once per boot. This is useful for configuration or instance differentiation to keep straight properties for your application that should change exactly once per boot.

This value is not typically significant for security or cryptography, but instead is used simply for instance management.

Also, RANDOM_UUID is not a replacement for /dev/random, but rather a source of properly-generated type-4 UUIDs. See how the first digit in the 3rd group is always "4"?

See also:

/proc/sys/kernel/random/uuid
/proc/sys/kernel/random/boot_id


Will PHP malware from my hacked website be able to infect my computer locally if downloaded?

No, not unless you run it. And by default Windows can't run PHP files. Cleaning the site is a good idea, but be careful not to make the same mistake twice; if they got in through a file upload vulnerability, they will do it again if it's the same site. So try to find out what file is malicious and post it here so we can help.


How to exploit system call when the full path of binary is given inside the call?

I have compiled the program and I can execute the "id" command by providing

`id`

as arg on stdin. Looks like they missed the backtick as forbidden character. Maybe you can create a sh script that creates a root user...


Send credit card info by email from HTTPS and SMTP on SSL

I would not trust credit card details to be sent out over email unencrypted, and while I am not an expert in PCI, I believe this violates PCI's requirements to protect cardholder data.  HTTPS merely encrypts data transfer between the web browser and the web server over the network.  If your email client is set up to use SMTP with SSL, that only encrypts data transfer between your email client and your email domain (e.g., if your address is gmail.com its encrypted while being sent to gmail's servers, but then gmail can fully read your data).  Your mail server may route your plaintext email to many other servers (who would be able to read that information), even going over unencrypted networks if necessary.

Also again, I wouldn't trust PCI data with a company like http://www.sendinc.com/.  They say they randomly generate a decryption key, which they will send to you, and also say they will not keep their own copy of that key.  That last part relies on you trusting them not to keep a copy of your key or plaintext message, and I simply would not trust them to do so without an explicit business agreement that holds them liable to any flaws in their implementation setup that allows any malicious admin (or hacker) at their end to steal your data.  If you need to send sensitive data over email, I would save it into a file and encrypt that file somehow locally (on the same computer) and then  send the encrypted file to the client, and on a separate secure channel give the client the passphrase/key to decrypt it.

If this needs to be done infrequently, maybe something simple like install GPG in a linux/unix environment (like Mac OS X) and use gpg -c sensitive_file.txt, which will prompt you for a passphrase, and create an encrypted file sensitive_file.txt.gpg which you can then send for the other party to decrypt (gpg -d sensitive_file.txt.gpg) with a passphrase you've shared in person or through a non-eavesdroppable channel.  Otherwise, you both should set up a public/private keys that you each trust, and then can set up encrypted email clients with PGP or S/MIME.  This is a little bit more work, but most modern email clients support some form of email encryption.

PS: This request seems very strange.  Are you sure you aren't being socially engineered by someone trying to steal credit card information?  Make sure this is really your client, not someone posing as the client (say after getting their login credentials/email account password in any of a variety of ways) who is now trying to get you to give away credit card information in a phishing attempt.


Why does Kaspersky anti-virus not consider this executable as malicious?

Anti-virus programs detect malware in two different ways.  First, they contain a set of patterns that match known, existing malware.  Something matching one of these patterns should be definitively a piece of malware.
Second, they contain a set of heuristics which are found in many malicious programs.  These are not foolproof, so they are usually weighted in some way and a program which contains several may be flagged as a potentially malicious program.  When antivirus vendors make a mistake with heuristics, they do things like flag many benign programs written in Go as malware, which leads to problems.  Ultimately, these are guesses and they will have both false positives and false negatives.
In your code, you are using standard C library functions that are likely to be used in a lot of reasonably portable programs.  Opening a file, transforming the data, writing it to a new file, and then deleting the original is a pattern used by lots and lots of software for non-malicious purposes.  I suspect a similar invocation is used in the Unix program sed when invoked with the -i option.  While your code is malicious, it's also commonly used by a lot of benign software, so your antivirus won't flag it.
If your program did additional things that malware commonly does, like try to evade detection or hook the message queue, those would likely be flagged.  But right now, regardless of your intent, your code doesn't look that different from benign software.


I believe it should be more advanced and it should take into account origin of the requests to prevent DOS.
Most common is a lockout after a number of attempts but this requires a good unlock procedure that is secure. A lot of sites require a captcha or second factor after a certain amount of attempts.

Always combine lockout or throttling with a strong password policy. How often will an attacker need to guess based on that policy? That is an important factor in designing a lockout/throttling mechanism.

A good approach to protect a login could be:

Strong password policy
Captcha after 5 failed attempts for a certain user from a certain IP within 10 minutes.
Blacklist IP or trigger an alert after 100 failed attempts from a certain IP.


referrer checking as a defence for XSS attack

Many of the cross-site request forgery countermeasures will make reflective XSS more difficult to exploit but not impossible.  It may still be possible to exploit one of these flaws with clickjacking or other methods.  Clickjacking and other vectors should also be fixed, but its not a simple or foolproof solution when compared to input validation/sanitation.

There are problems with the referer header as a security measure.  If the request originates from an HTTPS page going to an HTTP page then Referer will be absent.  The origin header was created to address this issue.  An OWASP A10: Unvalidated redirects and forwards could also be used to bypass a referer check.


How will security need to be changed if we can crack password hashes in quasi-polynomial time?

I think the best way to answer your question is to say: the premise is highly implausible, so the issue simply does not arise.

I might as well ask: if we suppose that we discover time travel, is there cause for alarm about password security?  Sure, if we discover time travel, someone could travel back in time, appear poof just before I enter my password, look over my shoulder when I typed my password, and poof disappear before I notice.

Or, if my computer can time-travel on demand, I can set it up to iterate the following loop: pick a random password guess, try to see if it is correct, if it is correct print the password and halt; if it is incorrect travel back in time to the beginning of the loop and start over.  If time-travel algorithm is possible, this is an O(1)-time algorithm to crack any password, given its password hash!

But of course these answers are silly, because for the foreseeable future there is no realistic likelihood of anyone discovering how to travel back in time.  Similarly, for the foreseeable future there is no realistic prospect of someone discovering an algorithm to solve all SAT instances efficiently.  Sure, if someone could find a SAT-solving algorithm that could solve every SAT instance in 15 seconds, then they could crack every password (given its password hash) in 15 seconds.  But I don't think that's terribly likely to happen in my lifetime.

P.S. I see from clicking on your link that you would probably prefer a more technical answer.  My suggestion is to read up on Hellman's time-space tradeoff and on rainbow tables; that will give you a better understanding of the state-of-the-art methods applicable to password cracking.  You might also want to read up on why rainbow tables are not applicable to salted passwords; similar reasons are likely to apply to your methods.

Looking at the complexity of the method in your link, I see your method requires a 2v precomputation, where v is the number of variables in the SAT instance.  In contrast, Hellman's time-space tradeoff and rainbow tables require a 2n precomputation, where n is the number of bits of the password (the number of bits input to the hash function).  In the password setting, n is going to be much smaller than v, so rainbow tables and Hellman's time-space tradeoff look like they will perform better than your method.  In other words, it doesn't look likely to me that your method -- even if it is valid -- will beat the state-of-the-art at password cracking or will have much relevance to password cracking in practice.  Of course, you could always try it in a little experiment, and compare your method to existing password crackers; that would be the true test.  But at the moment, I see no reason to expect advances in SAT solving that would be relevant to password cracking.


In regards to GPG4Win, what does "use NAME as default secret key"?

1- what does "use NAME as default secret key" do in Kleopatra tool options?
  The reason why I ask this, is I have a looooong password for my certificate. And apparently this becomes a hassle when encrypting several files. So does the option in question replaces my long passphrase with my name? is that what this is?

The "default secret key" is the key that Kleopatra will use to sign files with if you don't specify a specific key.

Note that if you're purely encrypting a file, no secret key is involved at all, and thus no passphrase is involved.  It's the decryption (or signing) that requires the secret key.

  3- and lastly, will it make a difference to use long or short passphrase when creating a certificate? Now that I think about it, the file is going to be RSA 4096 encrypted! What difference does the passphrase make?

No, your symmetric key is RSA 4096 bit encrypted.  Your file is encrypted with the public key you're encrypting to's most preferred symmetric cipher that your software supports.  From the command line, use "gpg --edit-key " and the "showpref" to see that public key's preferences, or "setpref" to change them; leftmost is most preferred.  3-key TripleDES and SHA-1 are always, always supported, even if they're not on the list (see RFC4880 for details).  "gpg -v --version" will let you list your version's supported algorithms and the numbers they're assigned.

P.S. Your key's self-signature is probably SHA-1; if you can, generate keys at the command line with "gpg --gen-key --cert-digest-algo SHA256" or "gpg --gen-key --cert-digest-algo SHA512", and then use the edit-key setpref listed above to set your cipher preferences.

P.P.S. an example setpref line (see above) would be "setpref CAMELLIA256 CAMELLIA192 CAMELLIA128 AES256 AES192 AES 3DES SHA512 SHA384 SHA256 SHA1 BZIP2 ZIP ZLIB Uncompressed" - this has a strong preference for Camellia (EU, Japan) over AES (US); please reverse or otherwise change that as you see fit.  It also does NOT list old ciphers like CAST5 or IDEA, nor broken hashes like MD5.  SHA1 is listed only because it's the "must implement" hash.


Dangers of Sending Onetime Pin numbers over http

Yes, it is problematic.

An attacker may intercept the connection, return a "Login failed, please try again" to the client, and proceed to use the one time pin himself. If the transaction is low value, this may not be a problem, but it's trivial to avoid: use TLS.

In general, there's no real reasons not to use TLS today. Certificates are free, setup is easy, and browsers will soon mark form submissions over HTTP as insecure:

So whilst it may be tolerable in some applications, the question is why you would want that, when it is so cheap to reduce it to nearly zero?


What is the distinguishing point between a script kiddie and a hacker?

It really depends on your point of view.

From the outside, the "script kiddie" is, nominally, the wannabe attacker who uses tools written by other people (the "scripts"), without really understanding what is going on. Everybody uses tools written by other people (if only operating systems, C compilers, libraries...), but some people have a certain understanding of how things work internally, and could, at least potentially (if free time was free), rewrite these tools from scratch.

The script kiddie himself does not think of himself as a "script kiddie", of course. In his view, he is an "elite hacker", and the other people are script kiddies. The expression "script kiddie" is meant as a disparaging designation, to insist on the alleged youth of the individual and its associated inherent shame. To consider youth as shameful by nature, you have to be young. Old people don't think of youth as a disgusting fact to hide, but as a lost treasure. When somebody uses the expression "script kiddie" too often, you can often infer that this somebody is himself not very old, and a metaphorical scripty smell probably lingers around his person.

A more neutral, less emotionally charged classification would be about competence. Attackers are more or less competent at what they do. Just like anybody. The less competent attackers, which other script kiddies are prone to point out and mock as "script kiddies", will run their tools (collected on the Internet), and if the off-the-shelf tools don't succeed in the attack, they soon give up. More competent attackers will adapt their tools to the specific situation; they see the tools more as a generic framework for attacks than the actual instruments.

Given the above, to avoid being seen as a script kiddie, the trick is to distantiate yourself from the kiddie term, not from the script. Scripts, and, more generally, tools, are neutral. It is the maturity of your reactions, or lack thereof, which will mark you as a script kiddie or not. Despite what is usually believed on the subject, it has very little to do with technical skill; it is a matter of communication, of public relations. Be cool, don't whine, and you will never be a script kiddie.


Should I worry about remote timing attacks on string comparison?

There are published successes with remote timing attacks.
From the document -- "... we can reliably distinguish remote timing differences as low as 20µs."  So yes, you should be worried about the underlying implementation of .equals() (spoiler: Not secure). Implement .equals() using a sum of XOR of characters to compare in a timing-independent way.

Here's a python implementation as an example of a timing independent compare of bytes.

def equals(bytes1, bytes2):
    if len(bytes1) != len(bytes2):
        return False
    else:
        differences = 0
        for a, b in zip(bytes1, bytes2):
            differences |= a ^ b
        return differences == 0


Bank account number and account holder in check exposed?

Going to have another go at this one, to try and address the many excellent comments...

A cheque is an instruction to a bank to take money from Alice's account and give it to Bob. In order to act on it, the bank need to know Alice's account details; they must be written on the cheque in some form when it arrives for clearing.

A pre-printed cheque in Alice's cheque book happens to have her account number already written on it, purely for convenience sake, in both human and machine readable forms.

@IMB first asks if this is a vulnerability, since if Eve gets hold of a cheque, she can read the account details off it and use them in an attack. The answer is yes, it is a vulnerability.

Then @IMB asks if hashing the account details would be a good control. I suspect they actually mean encrypting, rather than hashing, as cryptographic hashing is a rather specific technical term that doesn't quite apply here, but you get the picture. The answer is also yes, if done carefully, encrypting the account number (with a suitable nonce added) would largely prevent Eve using the account information.

Lastly @IMB asks why don't the banks do it then? Well, as with every security control, you have to measure the cost of using it against the impact of a failure in order to decide if you should implement it or not.

I think the main cost is that humans could no longer read the whole cheque. That doesn't sound like a problem in these days of ubiquitous computing, but banks are conservative and old fashioned and they are particularly fond of having human audit processes. They like a manager being able to pull a cheque at random every day and double-check how it was processed. They like being able to pull a physical piece of paper out and wave it at a customer and say "No, we didn't make a mistake."

Additional costs are that it adds overhead to the cheque clearing process (and customers already hate how long that takes), that you no longer have a backup if the machine readable part of a cheque is damaged, and I suppose you might run into regulatory difficulties about the legal definition of a cheque.

The risks, on the other hand, are not huge, because the banks have other controls in place. They authenticate people before allowing them to remove money, and require more than just account numbers to easily withdraw money. They use various technical methods to prevent Eve printing cheques with Alice's details on. They have insurance to cover any losses. They  monitor account activity for suspicious transactions.

One last thing to consider: Alice has to tell her account details to quite a lot of people anyway: her employer (so she gets paid), the tax man, the water company (for direct debits) and so on. And she has to embed it in her debit card. And the bank have to print it on her statements... So Eve has many other ways to get this information.

In the end, the banks have weighed the costs and the risks and concluded it's just not worth it - especially considering the decline in use of cheques. Last time I tried to pay for something in a store by cheque they had to get the manager because none of the sales assistants had seen one before except in movies.


First, use SSL (https).  This will prevent an eavesdropper from learning users' credentials.

See
What are the pros and cons of site wide SSL (https)?,
HSTS extra security over HTTPS,
Guidance for implementors of HTTPS-only sites (Server side).

If you are embedding a password in the code of the mobile app that the user downloads, that's a bit weird and does not sound like good practice.  That's effectively equivalent to putting that password on your web site for everyone to see: anyone can download the app and look at the bytes to find the password.  Nothing stored in a program binary should be treated as secret.

If the user types in his/her password into the app, it is fine to store it in app-private storage and reuse it on every connection.  Or, it is fine to generate a private key on first launch of the app, securely send the corresponding client cert up to the server (over an SSL connection authenticated by the user's password), and then use SSL with client certs to authenticate the mobile client to the server on all subsequent connections (so the user does not need to type in his/her password again).

If the content on the CMS is intended for the public to see, then you should remove the password for viewing content, as it is a bit pointless.  If the mobile app is available to the public, and anyone with the mobile app can read the content on the CMS, you've effectively decided that the content on the CMS is intended for the public to see.


You can have an authentication backend, and users have to authenticate first, get a token, and use the token on subsequent requests.

Hopefully only your users will have credentials to your service (the exception being users with weak, leaked passwords), and the only ones able to interact with the API. But you should employ rate-limiting on the backend so bot owners will not brute-force the authentication backend.


How to eradicate and recover a compromised network

I have done this on a large scale at an enterprise. What we did was create an air gapped network with a new drop from an ISP, and AD servers this got us a stable and reasonably secure baseline. Then we created new VLANs on the core network where we switched user groups over on a scheduled basis, ensuring each was quarantined/reimaged and brought in to the new network. Creating a corporate wide new infrastructure was not in the budget, which is why we used the new VLANs on the core.

For a home network where the goal is to build a new network, I would perform a factory reset on your gateway, then do you have a "clean machine"? I would use that to reset your WiFI with all new passwords and bring one machine online at a time, can you see a problem when one machine connects? Personally it does sound a bit like the VPNFilter malware, but that is just a guess.


How does SSL protect against network level attacks on integity?

If integrity was not maintained, an attacker could alter Web pages in transit, and, for instance, modify Javascript code contained in these pages. Encryption, by itself, does not prevent relatively precise alterations, provided that the attacker has some idea about what the encrypted data is. In most Web contexts, the attacker can also register as a normal user, so he can see the structure of Web pages that normal users obtain.

When the connection uses RC4, then a key-dependent pseudorandom stream is generated and XORed, bit by bit, with the data to encrypt. Therefore, if the attacker "guesses" that a given byte is the encryption of a 'A' (ASCII code 0x41) and wants to make it the encryption of a 'm' (ASCII code 0x6D), then he just has to XOR the encrypted byte with 0x2C (that's the XOR of 0x41 with 0x6D) to obtain another encrypted byte which, upon decryption, will yield a 'm' instead of an 'A'. Nothing else would be impacted; thus, with RC4 encryption, surgical alterations are easy.

With a block cipher in CBC mode, things are less easy for the attacker, but he can still enact some evil: if he wants to modify a specific byte, he can, but this will mangle the previous block. Specifically, with a block cipher, the data is a sequence of blocks of 8 or 16 bytes (depending on the cipher: 8 bytes for 3DES, 16 bytes for AES). The attacker can modify at will a block, with surgical precision, provided that he knows the initial value of that block and does not mind changing the previous block into some uncontrollable random junk.

Let's take an example. Suppose that a Web site has a login page, with an HTML form, which looks like this:

<form action="https://www.example.com/authenticate.php">
Login: <input type="text" name="login" />

Password: <input type="password" name="password" />

<input type="submit" name="Submit" />
</form>

I know it is ugly; it is just an example. When the user clicks on the "submit" button, the browser sends a POST request to the https://www.example.com/authenticate.php page.

Now suppose that this page is CBC-encrypted with 3DES (8-byte blocks) and that the '.' of '.com' happens to be at the start of a block. The attacker can then XOR the previous 8 encrypted bytes (the bytes corresponding to .example) with the following:

 00 01 0E 09 01 07 0D 5B

On the victim's browser, the form will decrypt as:

<form action="https://www########.bad.fx/henticate.php">
Login: <input type="text" name="login" />

Password: <input type="password" name="password" />

<input type="submit" name="Submit" />
</form>

Where the "########" will be some random bytes. Provided that none of them is a zero or a double-quote (chances that this happens are low), then the browser will consider them as part of the target URL. The bad.fx domain is controlled by the attacker (the "fx" TLD does not really exist; feel free to replace with your favourite "TLD for Evil people"); the attacker's DNS gleefully redirects all requests for anything.bad.fx to his server's IP address; and the attacker bought (completely legally) a wildcard certificate for "*.bad.fx". When the user enters his password, his browser connects to the attacker-controlled Web site, does the SSL, is perfectly content with the attacker's certificate (assuming that none of the '#' is a dot; again, this is probable), and sends the password.

Fortunately, SSL includes strong integrity protection, which prevents such attacks. With stream ciphers like RC4, and block ciphers in CBC mode, the integrity protection uses HMAC; newer versions of TLS can also use block ciphers in GCM mode, which integrates an equally good integrity protection. If the attacker attempted any of the stunts described above, the client (Web browser) would detect the alteration and protest and refuse to use the decrypted page. See the standard, section 6.2.3.


Why would one need to encode an MD5 hash string? Is it unsafe to display unencoded?

Hash functions output binary data, usually as a byte array. This cannot be displayed correctly, therefore, you need encoding.
Transmitting binary data can create problems, especially in protocols that are designed to deal with textual data. To avoid it altogether, we don't transmit binary data. Many of the programming errors related to encryption on Stack Overflow are due to sending binary data over text-based protocols. Most of the time this works, but occasionally it fails and the coders wonder about the problem. The binary data corrupts the network protocol.
Therefore hex, base64, or similar encodings are necessary to mitigate this. Base64 is not totally URL safe and one can make it URL safe with a little work.
In another way, character encodings are reversible and don't require encryption keys. This has nothing to do with security; it is about visibility and interoperability.


Is image uploading to a database secure if you resize the image first in raw bytes?

While sanitizing the image by resizing it is a good idea there were several critical bugs in image processing libraries in the past.  Which means that the process of resizing the image itself could trigger such a bug and thus cause DOS with a complexity attack against the image manipulation library or even remote code execution. That's why the process of resizing should be done within some kind of VM or sandbox and should be also limited in CPU and memory usage.

And then there are several ways of resizing. I'm not familiar with the implementation you use but it might be that the meta data of the image are preserved (i.e. comments, flags, creation time etc) and thus might still be used later inside an attack. So you better convert the image first into some format like PPM which has no ability to store meta data to remove any kind of potential harmful meta data.

I'm also not familiar what your code of storing the image in the database really does in the implementation. Hopefully it uses parameter binding or similar techniques, because otherwise a malicious image might also be used for an SQL injection attack.

As for reading the image you should be aware that browsers often ignore the content-type you send depending on the context. This means if the URL is used as the source for the script tag the image will be interpreted as script, even if the content type is image/png (Chrome does not allow this but others do). Similar context enforcement can be done with a forced download. For example you could sent malware hidden by an image type with <a href=image.png download=malware.zip> and it might even have the correct magic bytes for the image type at the front because extraction of ZIP files often ignores junk at the beginning of the ZIP file. But if you removed the meta data like I've recommended you are probably safe against this kind of misuse.


How to configure Burp Suite for localhost application

If none of these solutions work for you, like they didn't work for me, you could try to change value network.proxy.allow_hijacking_localhost to true (using firefox v 67.0.1 64-bit).

Open new tab, type about:config in address bar, then type network.proxy.allow_hijacking_localhost and double click it to change its default value to true.


How does the CVE-2017-7494 "SambaCry" exploit work?

It would be easier if you can analyse the source of the exploit. You can find it here: https://github.com/omri9741/cve-2017-7494

From what can I see it seems Samba just loads the SO and executes it without need of any buffer overflow. Have no idea why such thing is over there but it has probably something to do with RPC over 445/TCP.

Edit:

Yep. So I went bit deep to it and its really related to IPC/RPC. It seems that you was able to open any .so file under specific conditions over named pipes. Of course, only trusted modules should be allowed and not those uploaded by anybody so I think they mainly fixed from where the modules could be loaded.