When reading PGP or other encrypted emails, is it wise to unplug my computers ethernet in order to use my private key? I've never used PGP before so my logic may be a bit off.

When receiving an email encrypted with my public key, would it not be best to unplug or disconnect my computer's internet before decrypting with my private key? That way there can be no chance of my private key being stolen?

I assume we want a deterrent against software-only attacks targeting the passphrase, unauthorized use of the private key to decipher or sign, or unauthorized access to deciphered data (including emails).

It would be effective to:

Disconnect from the internet
Make a full backup
Use PGP/GPG with private key and passphrase
Fully erase the machine (can be combined with 5)
Restore the backup
Reconnect

But without 2/4/5, disconnecting from the internet is only mildly effective. In particular, a software keyloger targeting the passphrase, or malware keeping track of deciphered data, has a fair chance to do its thing then exfiltrate the result after 6.

Problem is, 2/4/5 is a pain.

One reasonable option is to perform 1/3 in a Virtual Machine, and destroy it afterwards (or equivalently, restore a snapshot made before 1).

Booting on a live CD (assumed malware-free) is a nice option, but since there is no Windows live CD AFAIK, this won't accomplish much of what a Windows user want to do if HD storage is encrypted, or data (like emails) in a Windows-only format (Outlook..). The only reason I see to disconnect from the internet on top of that is to prevent exploitation of a vulnerability on the live CD.


Vulnerabilities with DB backed session tokens A user logs in and is given a session token. This token is also stored in a database on the server. The user includes this secret token with each request, and the server will pull it from the DB to authenticate the user.

This scheme is vulnerable to someone (an angry DBA perhaps) sniffing the token out of the DB and hijacking the user's session. Keeping the session token store in memory increases the difficulty of sniffing the key, but it is still not impossible.

What is the generally accepted way of securely storing session tokens?

I'd say that for most cases it's generally considered that once an attacker has DBA level access to your system it's compromised, therefore mitigating this attack would more likely be done via policy/change management/activity monitoring etc.

If you think about the damage an angry DBA can do to a system, sniffing one users session token is likely quite far down the scale...


Why would Chrome not display a padlock icon at all on an SSL site? I have an internal website running on SSL, but when going through it in Chrome, I don't get a padlock icon at all:

However, clicking it does show that the site is encrypted. There are a bunch of obvious issues - our internal CA doesn't have public audit reports and it's using old TLS, but the weird thing is that I have another server with a similar setup and there the green padlock icon shows up just fine.

I've seen troubleshooting for cases where there's a grey padlock and for cases where EV doesn't work, but neither is the case here - there is no padlock at all. I've used other browsers and tools like OpenSSL and curl and they all tell me SSL is just fine.

Before I assume this is a bug in Chrome, I wonder if there is a rule that I'm overlooking that makes Chrome behave this way intentionally?

Your certificate only contains a sha1 signature, probably with a lifetime past 1 January 2017.

These are deprecated, and Chrome therefore removes the appearance of security. See https://googleonlinesecurity.blogspot.com/2014/09/gradually-sunsetting-sha-1.html for more info.


How does LBaaS / DBaaS or "auto-scaling" help protect from DoS? I ask this question as a follow up to this question in which I asked how I could protect from the simplest types of DoS attacks (say single-machine / up to 5 machines network level DoS attack) without using third party services like a CDN, given that it is unlikely for me to go thorugh a DDoS (although the answers to my question there shows that DDoS is likely just like a simple DoS is, in these days, due to various services that would help even a single attacker to launch a DDoS)

My hosting provider engineer told me that they are developing tools that could achieve my desire, at least in part, in the future, though these tools are now but experimental and far from being released in any form. The engineer mentioned the following three types of tools without explaining how each one of them could help reduce the risk to the phenomenon I just described:

LBaas (I don't know what that means)
DBaaS (Database as a Service)
"auto-scaling" (I don't know what that means)

Assuming I understood correctly, how could any of these tools help prevent any kind of network level DoS, if at all?

LBaaS probably refers to Load Balancing as a Service (LBaaS).

With an LBaaS solution, the traffic to your site will reach to the LBaaS endpoint and then handed off to the server farm serving the site. In an auto-scaled environment, the number of servers(typically Virtual Machines) go up or down depending upon the traffic load.

LBaaS solutions themselves integrate DDoS prevention mechanisms by monitoring packet states and other detection mechanisms. In combination with DBaaS and autoscaling, as the load goes up (in a DDoS scenario), the backend instances scale up as well to handle the additional load.

This of course does not assume that the Anything-as-a-service solutions can handle infinite load. That is, a service supported by the cloud cannot take DDoS attacks of the scale of Tbps (as have been recently demonstrated).


How does VPN provider hide traffic from different users I´m currently learning much about VPN security and now I got to that point where I would like to know how a VPN provider is able to hide my traffic from other user.
I am connected to one gateway (as others user) and if I use it with http websites my requests are transported in plaintext. Why are other users not possible to intercept my traffic if we are on the same VPN?. I think I am missing something now. Can you lead me in the right direction?

Other clients on the same VPN service don't share your tunnel to the VPN. Your connection to the VPN is encrypted with a key that is only used for your communication.

After your traffic reaches the VPN, it is no longer encrypted by the VPN tunnel. The traffic (in your case a plain text HTTP request) is forwarded to the host you're trying to talk to (example.com).

The hosts response is then returned to the VPN and returned to you over the VPN tunnel.

For economic reasons (and potentially some anonymity) many VPNs use shared IPs. This means many users traffic is sent from the same IP address.  Even in this case, other users can't intercept your traffic.

Essentially VPN users are just trusting a third party to forward traffic in their behalf.  Even though you may see a private IP on your system, traffic from private IP to private IP (VPN user to VPN user) is typically disabled on most VPNs (although there are some setups where that is the purpose of the VPN)


Strategies against jamming attacks? We have some devices which are designed to use standard frequencies/protocols, such as GSM, CDMA, GPS, Wifi and Bluetooth, among others. While our focus is not thought to be used for high-profile criminals (such as organized crime) who will often use jammers, we are aware that this is, to our knowledge, the weakest link in our system. Thankfully it is a weak link that is very rarely exploited by the more common adversaries found in our adversary model, and we do not pretend to handle situations for such cases.

So, while this is not really a practical issue, as a technical person I can't wonder but think if there's any way that we could actually protect against jammers while still using common protocols.

Is there any strategy? This is not my area of expertise, so I am nearly clueless, but as far as I know, frequencies that are high enough in the spectrum are reserved for other uses, so we can't even change to them, and strategies like frequency hopping don't work with said protocols. I'm lost, to be honest.

EDIT: There were many excellent responses and I wish I could have accepted two of them. Thank you.

Jamming is the radio equivalent of shouting. The jammer drowns your communications under a lot of noise. Defence against jamming usually is a combination of the following:

Power: speak louder. I.e. increase the power of your radio-emitting apparatus, so that it will take more noise to drown it. Of course, this increases energy consumption and heat dissipation, and it is not necessarily workable with your devices at hand.
Tightening: try to use directional radio beams. The sender will send a non-isotropic signal, much stronger in one direction than in any other; the receiver will also concentrate its reception ability on this specific direction. This has been used in aircraft navigation systems (see this). This kind of solution requires directional antennas, and, more importantly, proper orientation: the sending device must know the approximate direction of the receiving station, and vice versa.
Frequency hopping: switch frequencies over a large range of possible frequencies. Sender and receiver agree upon the sequence of frequencies that they will use. This relies on the idea that it is much harder to jam a large spectrum than a single well-defined frequency. GSM/3G signals already includes frequency hopping, and the sequence is nominally unpredictable by outsiders because it is agreed upon under the cover of the cryptographic layer (subject to possible weaknesses of the cryptography as used in GSM, of course). Note, though, that in normal marketable equipment, frequency ranges are legally constrained, and it is still relatively easy to jam all frequencies which have been allocated to GSM and 3G.
Retaliation: a jammer is an active attacker; it emits a strong signal. This allows for tracking the jammer, and send armed goons to shut it down and appropriately reward the jammer operators, e.g. with some free dentistry.

The bottom-line is that if there was a way to force communications to go through even in the presence of active jammers, then the Military would use it. But in the battle between jammers and defenders, the jammers are currently winning.


USB read only permission and antivirus We would like to block write permissions to USB drives. We will allow user read-only permissions to the USB drive.

By doing that, do we still allow the Antivirus to scan the USB drive and delete, if needed, the potential virus found?

No. If the USB port only allows reading, then Anti-virus cannot delete the file from the drive.

But it might not have to. AV can simply block the file from being run. The virus will still be there, but it will not infect the machine.

Alternatively, there is software that will block users from USB. So you could run AV as a permitted user.


Why it best to do security testing on a copy on a Virtual Machine rather than on than the live server? Why is it better for a security tester to take a copy of a server e.g. eBay server and test it on a virtual machine rather than on than the real eBay server?

E.g. doing security testing on the live server can cause damage and cause the eBay services to be unavailable. (e.g. SQL injection attacks can erase the eBay database)

Why does a virtual machine prevent major security risks or any risk like these?

The advantage of a virtual machine is that it's what it is, virtual. Assuming you're testing against a real server (be it a development or production one), you run the risk of losing data by poking at the wrong stuff, and have some downtime, meaning lost customers and revenue.

Another thing is that virtual machines can easily be save-stated, duplicated, and then are extremely valuable testing tools. If you find a vulnerability, you can have a VM that's in the state where the vulnerability can be exploited, you can then save that state, and reproduce it far easier at a later time to get more insight.

Overall : Using a VM eliminates the risk of downtime due to pentest, and allows an easier reproduction of the found exploits without compromising data


Becoming a malware analyst? So, I'm currently 16 and am considering a career in IT when I finish school. The thing that has intrigued me the most while growing up is malware. I've come across it so often and have often had to clean it up for family and friends (I also did it temporarily at a PC store I worked at).

Sometimes I reverse engineer malware that are coded in a .NET language that might be obfuscated and require manual IL code analysis. I like a bit of a challenge and I find reverse engineering "fun". I also have some knowledge in x86 assembly and code primarily in C++ and C#.

I was actually a part of one of the UNITE training programs for a period time but decided to drop it because I was more interested in pulling malware apart rather then diagnosing and performing cleanup from logs.

Anyway, I'm not sure where exactly to go about becoming a malware analyst but I know that I will probably need a degree in Computer Science. The thing that I noticed most of the "Malware Analyst" positions I looked up online required some previous experience as a mawlare analyst and I was wondering what other jobs would you'd probably need to have for this "previous experience". Lately, I've been really thinking about and I could see myself working at an anti-virus company in the future.

Perhaps someone who is knowledgable about this could shed some light? Also, if it makes a difference, I live in Australia (I know that many anti-virus companies are based in the US or Europe).

For studying malware, you will be doing a lot of reverse engineering to understand what it does as well as a lot of analyzing systems for weaknesses to try to predict which ways malware development might go.

A Computer Science degree will be critical and you will want to focus on decompiling and low level development (assembly and C/C++).  Understanding embedded systems wouldn't be a bad idea either since one of the scary future places that malware will likely go is firmware and other places it can hide from current virus scanners.

A graduate level degree will probably be helpful (but not necessarily critical) as most bachelors programs focus more broadly on computer science as a whole and graduate work in reverse engineering will be beneficial.  I'd also suggest it is worth paying for a "good" technical/engineering school because a lot of cheaper Computer Science programs tend to focus more on what is needed for developing business applications than going in to the details of low level programing and decompiling.


Risks for implementing single sign on I'm working with an organization that's integrating a lot of apps with LDAP in a Windows environment. They are doing a good job of implementing least privilege, so there aren't a lot of scenarios where an admin account on one system is an admin account on another.

What are the primary risks we should be thinking about when integrating applications into LDAP? Are there significant problems with Kerberos we should be controlling for?

Your question is a bit broad and especially does not make clear whether you're using LDAP or Kerberos for authentication.

I'm pretty sure there are tons of web pages providing information about security best practices for MS Active Directory in general.

Some important aspects regarding applications:

If you use LDAP simple bind for letting your applications check the user's password then all these applications have access to the user's clear-text password

If you use Kerberos then bear in mind that the services' keys are always protected. Because if an attacker can get a copy of the shared secret of a service he can impersonate as any user to that particular service.

In general I'd recommend to use a single sign-on method based on asymmetric crypto. At least for web applications that's not that hard anymore.


How is WhatsApp sending end-to-end encrypted messages in push notifications? WhatsApp implemented end-to-end encryption (whitepaper) in their latest update.

How is it possible for WhatsApp to send push notifications with message contents to the Apple Push Notification service?

One possible solution would be to send the unencrypted message to APNs from within the app itself but this would be open to abuse and would defeat the purpose of end-to-end encryption.

Update:
I have just tested it a bit more, according to Apple's documentation:

  However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.

Which I tested, and resulted in me still receiving the plain text push notifications. This would lead me to believe the app is not running in the background to decrypt any notifications received and then repost them.

Update May-2017:

I have now used the VoIP API ( as mentioned in the answers below ) to effectively achieve the same result myself in a demo app. Works very well.

Update July-2017:

Apple no longer allows the usage of the API for push notifications of non-VOIP apps. They do however allow WhatsApp to do it in their infinite fairness.

Update September 2018:

A notification application extension can now be used to decrypt push notifications. However, dynamic libraries are discouraged from use in such extensions so you must have a codebase that can be compiled statically for decryption etc.

WhatsApp could be using VOIP background mode along with PushKit for solving this problem.

Voip pushes are:

delivered directly to the app.
considered high-priority notifications and are delivered without delay.
delivered even if the app was force-quit by the user.

For details refer to Voice Over IP (VoIP) Best Practices

Once the encrypted payload of VOIP push is decrypted they show a “Local Notification” with the decrypted message.

There is one small issue though, PushKit is available only on iOS 8 and later. So, how is Whatsapp doing it for earlier versions of iOS?
Well, it isn’t. They don’t allow you to see message preview in notifications on versions earlier that iOS 8 (Verified it on iOS 7, see screenshot)


Is this code JavaScript vulnerable to DOM based XSS? I have some JS code below that is redirecting to a location taken from a HTML form. Is this vulnerable to an attack like DOM based XSS?

document.theform.reference.onchange = function(){
    var id = document.theform.reference.selectedIndex;
    var url = document.theform.reference[id].value;
    window.location.href = url;
}

Yes, it is vulnerable if document.theform.reference[id].value can be a value controlled by another user.

If this value was set to javascript:alert('xss') by an attacker then the line

window.location.href = url;

would cause the script to be executed in the context of the current domain for whichever user is currently using the site.


Solution for protocol downgrade attacks I am having protocol downgrade attacks on my website, and I have seen the solution to do TLS Fallback Signaling Cipher Suite Value (SCSV) to prevent protocol downgrade attacks.

Refer link

Can anyone suggest how can we implement the SCSV? I am really new to web servers and security, and would appreciate a step-by-step solution.

Both, the client and server need to support it to make it work. TLS Fallback SCSV is used as a signaling cipher suite (TLS_FALLBACK_SCSV, value 0x5600) during the handshake. All new browsers (clients) supports it. On the server, you will enable it by updating OpenSSL.

From https://www.openssl.org/news/secadv/20141015.txt:

OpenSSL 1.0.1 users should upgrade to 1.0.1j
OpenSSL 1.0.0 users should upgrade to 1.0.0o
OpenSSL 0.9.8 users should upgrade to 0.9.8zc

Debian and other distributions are deploying backports of the TLS-FALLBACK-SCSV update on OpenSSL.

Also, upgrading alone is not sufficient. You have to disable SSLv2 and SSLv3.

Refereces:
https://alpacapowered.wordpress.com/2014/10/20/ssl-poodle-attack-what-is-this-scsv-thingy/
https://wiki.openssl.org/index.php/SSL_MODE_SEND_FALLBACK_SCSV
https://stackoverflow.com/questions/26406586/how-to-enable-tls-fallback-scsv-on-apache


Why can't WhatsApp read end-to-end encrypted messages? In the web page of WhatsApp there is the following:

WhatsApp's end-to-end encryption ensures only you and the person you're communicating with can read what is sent, and nobody in between, not even WhatsApp. This is because your messages are secured with a lock, and only the recipient and you have the special key needed to unlock and read them.

However the users don't decrypt the messages themselves; the WhatsApp application does it itself. Therefore, the application knows all required encryption keys. Therefore, WhatsApp may read all the messages.
Or I don't know something about this staff?

Whatsapp wasn't a secure application to begin with. But with so many accounts being compromised the company had to do something, so they introduced the over advertised "END TO END ENCRYPTION" Which is a standard maintained by mostly all others. But yes the keys are generated on the client side and even stored in the same place. As the database is stored on the client side rather than on the server it is a bad idea to store the keys with them too.

Yes there is a possibility that the algorithm they used to encrypt the messages may have a back door or a master key that can decrypt any message. check the WhatsApp Legal page read 7. Limitation of Liability, even if they want to read your messages and you somehow get to know about it, they can easy blame it on a 3rd party. And just for a moment lets cross that line where they ensure that they can't and won't read your messages because if they can encrypt these messages and have access to the keys they sure as hell can read them too. If your conversation is controversial or illegal and they can earn profit by exposing that to a right party there are chances that you are being monitored.

The only security which is added according to me is that now if anyone who tries to tamper/capture my message from the network is gonna get an encrypted cipher rather than plain text.


Why does Chrome display "Managed by Organisation"? My wife inadvertently clicked on a flash player update and suddenly my chrome browser displays that it is being managed by an Organisation.
I tried deleting chrome and reinstalling it but nothing changed.
Could this be a malicious attempt to hijack my browser?

The chrome notification Managed by your organisation is not necessarily even a bad sign.

There are many possibilities why Chrome displays this message.

You can have a look at chrome://policy to find the causing policies.

For example, a plain Chrome installation from the Fedora 32 repo has the flag AuthNegotiateDelegateWhitelist activated for Single-Sign-On by default which leads to the same notification.


Are multiple applications of a salted Linux MD5 hash easier to break than one? I hashed the same password a lot of times (approximatively 1000 times)  using the salted Linux MD5 format.

I want to know if it's easier to recover the clear password or not.

Is there something that can exploit these multiple applications of the hashing algorithm.

applying the same hash function several times makes the hashing process more computationally expensive. The benefit of this is that when other means of cracking the password hash fail (guessing, dictionary attacks, rainbow tables, etc.), and the attacker is forced into brute-force techniques, it takes them longer to try each password, simply because they have to apply the same hash function more often. So if one round of hashing would require one month of brute-forcing, applying it twelve times would increase the estimated time to a year.

https://softwareengineering.stackexchange.com/questions/115406/is-it-more-secure-to-hash-a-password-multiple-times


Meterpreter detected by AV Since January I observed that meterpreter_reverse_https was detected by AV even with the enablestageencoding set to true. I tried to change the signature of the meterpreter and set the handlersslcert to true, without success. After this, I set the SSL option of web_delivery to true but still have the same problem. So, I switched to reverse_tcp_rc4 which worked perfectly until this weekend. Now it is also detected by Symantec.

One point which is important, when I take the source code of the meterpreter in PSH and execute directly in the powershell console, it works! I think that ips detects the signature of the communication between the victim and the web delivery server.

Can some one please explain to me how to resolve the problem? I really need it because I have a meterpreter session which launches periodically with this method.

I find where is the problem, it's the web delivery module of metasploit.
I think that IPS are triggering some HTTP headers of this module.
I bypassed the problem by using multi handler module combine whith a usal apache2 server and it's work! ( you don't need to follow paranoid steps)

If some one know what IPS is exactly triggering and how we can bypass it using web delivery module. Please inform me.

Thanks to all


Is rel="noopener" any different from rel="noopener"? I have a Wordpress tooltip plugin that converts any links in the tooltip text using special entities, so that my rel="noopener" becomes rel=&quot;noopener&quot;.
Is there any difference in terms of security in this? Do browsers correctly interpret the rel="noopener" tag? To clarify, I'm referring to a new page opened with target="_blank" being able to access my window object.
I should mention that <a href=" is also converted to &lt;a href=&quot; but functionality isn't lost (i.e. the link is generated normally).
Going into the plugin's innards, I noticed it generates the text using this line:
$html .= ''.do_shortcode($trigger).'';

Which means, HTML is generated using PHP's htmlspecialchars. According to the manual:

Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings.

This is an example of the actual HTML output as shown on "View Source":

You are basically "seeing things". That's one reason I am referring
to it as a philosophy of seeing
.

The actual output on the browser (hovering on the tooltip) looks like this. The link works and opens in a new tab.

I also looked at these two questions, but they don't seem to be directly relevant to my question:

XSS to overcome HTML entities
Are HTML Entities inherently unsafe?

If you look at the HTML output, the HTML for the tooltip is inside the title attribute of the the element the tooltip is applied to. That means that quotes and tags has to be HTML-encoded. If they were not, they could not be contained within a HTML attribute.
If you look at the picture, the content of the title attribute has somehow been turned into a real part of the page, and not just a title text. That magic is probably done by some JavaScript from the Wordpress plugin. I can't say for sure what that plugin does, but I am fairly certain that if you use the inspector in the development console to take a look at the link inside the tooltip it will indeed have rel="noopener".
So I don't think there is anything to be worried about here.


SSL certificate with IP I have an embedded device and it is running a https server. This device will be accessed from a standard web browser using the IP address. I am generating a TLS certificate. I have added a commonName (static string) and subjectAltName (default IP address) and generated the certificate.

If the IP address is changed or DHCP is enabled or more interfaces are added, like the device can also have a private IP 192.168.x.x or 169.254.x.x, do I have to regenerate the certificate?

What is the general recommendation for certificates using an IP address and having a dynamic or more than one IP?

It's generally not recommended to use IP addresses for certificates.
That said, you have several alternatives. If you absolutely must use an IP address as identifier, then you can configure your DHCP server to always give the NIC of the embedded device the same IP address. I use this technique to ensure all static devices in my home have fixed, known IP addresses (e.g. my router is 192.168.0.1, my home server is 192.168.0.2, etc.), and all "dynamic" devices (e.g. phones, etc.) have high IP addresses.
An addition to this is to use DNS. You can use an internal DNS server, which manages a pseudo-TLD such as .lan or .local, and use that to give your devices logical names. For example, you can designate your printer as printer.lan, and give it the fixed IP address 192.168.0.7. This way, you don't need to re-generate the certificate if the IP should ever change. You just need to change the DNS entry.
But why is it not recommended to use IP addresses for certificates?
This is a legitimate question. It makes conceptual sense to certify that something is reachable under a certain name, rather than a certain address. The CA wants to sign "This certificate is for printer.lan", not "This certificate is for 192.168.0.7", because as you correctly identified, you really can't know who 192.168.0.7 will be in a month or two.
Logical names, on the other hand, will stay the same. Your phone will never be called printer.lan, even if it may one day be reachable under 192.168.0.7.


What should be header response of XSS vulnerability upon form submission? We have a PHP web application and all of the user inputs are sanitized. We tested it within Burp tool and found no XSS vulnerabilities.

One of our security adviser tells us that when you type down any script within user input such as <script>alert("Pop")</script> and it gives 200 header response then that means XSS vulnerability presents. Header response should be 4xx or 5xx but I am having doubt. In above scenario, we removed such code from user input and stored remaining information within database by sending back 200 response.

Please let me know what could be response header when you found some XSS vulnerable scripts within user input upon form submission.

The HTTP response code is unrelated to the existence of an XSS. If you get a 200 (status ok) while trying an XSS then it could be that the XSS was actually successful or that the XSS does not work because the server has sufficiently sanitized the data.

Similar a code of 4xx, 5xx etc could happen without a successful XSS, for example if a web application firewall in front of the server has detected something which seems to look like an XSS and has blocked it before it even reaches the server. But this does not mean that the XSS attempt would have actually been successful against the web application.


Antivirus / Wireless PCI v2 Controls Scope Do the Antivirus / Wireless controls within PCI v2 apply for the entire organisation, or just for the PCI scope?

No... but it depends if you're confident with the layer isolating what's in-scope and what's out-of-scope. If so, you're good.

PCI requirements only applies to what's in-scope - nothing else. The tricky part is actually to define this line. It has to be black and white and that's not easy - too many shades of grey.

To be sure, as always validate with a QSA (Qualified Security Assessor).


What can be used to keep xp_CmdShell in SQL Server disabled? It's a well known fact that anyone with "SA" privs can turn on xp_CmdShell and use it and that includes any would-be attackers that can gain access to SQL Server as a login that has "SA" privs.  There are some very good best practices to help prevent an attacker from "getting in as 'SA'" including disabling the "SA" login but that doesn't prevent an attacker from getting in as a DBA who might have "SA" privs by using any one of a dozen automated password cracking methods.

In my study on the subject, I came across an article at the following URL http://msdn.microsoft.com/en-us/library/ms175046.aspx where I found the following quote:

  Because malicious users sometimes attempt to elevate their privileges
  by using xp_cmdshell, xp_cmdshell is disabled by default. Use
  sp_configure or Policy Based Management to enable it.

That's actually a pretty useless recommendation so far as I'm concerned.  Since malicious users can't actually use xp_CmdShell unless they have "SA" (or Control Server) privs, they'll try to break in as someone with "SA" privs.  If they succeed, there is NOTHING that I'm aware of in SQL Server that will prevent them from turning xp_CmdShell on and using it for whatever they need to use it for.  Of course, you can limit the damage by throttling back the privs of the logins for the SQL Server Service and the SQL Agent but they can still mess with your server a lot by using xp_CmdShell.

So, the best thing to do would be to make it so that even "SA" prived logins couldn't enable xp_CmdShell.  The useful part of the quote above is that you can use "Policy Based Management to enable it", which infers that you can use PBM to disable it, as well.

With that thought in mind, is there a way to use Windows or anything within SQL Server to make it so that even people with "SA" privs can't enable xp_CmdShell?  My initial thought is "NO" but I'm definitely NOT a Windows security guru by any means and I'm not even sure what I should be looking for to answer this question.

And, to be honest, I don't care which way it comes out... I just need a definitive answer one way or another.

Thanks for the help, folks.  I really appreciate it.

Well, its assumed that if a hacker has admin powers, then it's game over. It is the same for the operating system. As soon as a hacker the root access gain, he can normally do everything.

What used to be possible to do (at least MSSQL 2000) was to drop this store procedure with a command:

exec sp_dropextendedproc 'xp_cmdshell'

and to re-add the xp_cmdshell stored procedure with a command:

exec sp_addextendedproc 'xp_cmdshell', 'xplog70.dll'

You can check this article to more details http://support.microsoft.com/kb/891984


Can a Trojan horse hide its activity from TCPView? Can a Trojan horse hide its activity from TCPView?

I've done a little research before asking, but I still can't find the answer for this.

I know that a Trojan horse can hide from the Windows Task Manager through various methods. Also, less frequently, it can hide its activity from the netstat command (mostly replacing the program with their own version). I guess is less frequently because (I expect) any non-compromised antivirus protect and alert for changes in system files (not sure if I'm being naive).
Even though, If the Trojan uses a Windows process (not it's own name) to connect to the Internet, many times you can identify what isn't an expected connection to some random IP address.

Many websites recommend using TCPView to check for unusual connections, and I wonder if a Trojan can hide its activity from TCPView. I'm not sure if TCPView is just a graphic interface using the netstat program. In that case, if there's any method to hide from netstat, it will be hidden from TCPView of course.

I don't think that a Trojan horse would be specifically coded to hide from TCPView (or it is TCPView so popular that this happens?), but maybe there's a method to hide its activity from any program trying to check the current Internet connections (even Wireshark) and to hide what programs or Windows processes (even svchost or system) are establishing those connections as well.

If you know specific methods used to hide from TCPView could you mention them?

I want to know this, because I'm not sure that using TCPView or Wireshark to check for unusual connections is a bulletproof test to confirm that activity.

I don't think that a trojan horse will be specifically codded to hide
  from TCPview (or it is TCPview so popular that this happens?) but
  maybe there's a method to hide it's activity form any program trying
  to check the current internet connections (even wireshark) and what
  programs or windows processes (even svhost or system) are establishing
  those connections.

  If you know specific methods used to hide from TCPview could you
  mention them?

A kernel-level rootkit can hide itself from any user-level program on the system, which includes TCPview.  That's because all user-level programs make requests of the kernel in order to get information, such as access to network connection tables, interfaces, and packets.  The attacker "hooks" the kernel interfaces so as to intercept these requests, and so user-level programs may say "show me all the packets" and receive everything except the rootkit packets.

There's a good paper here called Countering Persistent Kernel Rootkits Through
Systematic Hook Discovery which describes the method by which rootkits do this pretty concisely.  To quote:

...a rootkit by nature is programmed to hide itself especially from various
security programs including those widely-used system utility programs such
as ps, ls, and netstat. As such for an infected OS kernel, the provided
kernel service (e.g., handling a particular system call) to any request
from these security software is likely manipulated. The manipulation
typically comes from the installation of kernel hooks at strategic
locations somewhere within the corresponding kernel-side execution path
of these security software.

  The reason I want to know this is I'm not sure that using TCPview or
  Wireshark to check for unusual connections is a bulletproof test to
  confirm that activity

If you think a system may be compromised, you can't trust a thing it tells you.  So external methods of checking, such as wireshark on a different machine (capturing via hub, span port, what-have-you) are necessary to get an objective view of network traffic.

The combination of external and information can also be very, very useful.  If you see lots of packets from remote:3456 to suspect:8080, but your suspect machine says it's not listening to 8080, that's a good sign you've got a kernel rootkit hiding its use of the network.


Why do some HTTPS-enabled websites use HTTP by default? Some sites like Stack Exchange have an HTTPS version available. But when I type their address or go to them via Google, I get an unencrypted version.

This seems to render the HTTPS version totally useless, as most users (maybe not on SE) will use the unsecure version without even noticing.

I don't know of any modern desktop or mobile browser that doesn't support HTTPS. So why are these websites even keeping an HTTPS version, and using it by default ?

It is simply open to accepting secured and unsecured connections.

Since HTTPS increases the processing and bandwidth requirements, forcing it in situations that really don't justify it only costs more to every one.

Forcing it would also require a redirect, which would make the user experience an even longer load time because of that.


How does a virus infect our computer just by visiting a website I wondered how a virus infects our computer just by visiting a website, without user's assistance at all. I know that a malicious website can exploit some browsers' vulnerable features, such as JavaScript, Flash, HTML5, etc., and cause some error like buffer overflow and be able to deliver a virus into our machine.

But in the condition that we disable all of those vulnerable features, allow only bare HTML to be rendered without any additional features at all, Is the malicious website still able to deliver a virus into our machine? If yes, can you explain the mechanism how it is still able to do this?

It is not possible to achieve the condition of disabling all vulnerable features.

Features that may be disabled through a browser's user interface do not comprise anywhere near the complete set of potential vulnerabilities.

Consider text handling. There is no switch to disable processing of multi-byte unicode characters, yet improper handling of these has been the vector for a number of client-side attacks involving delivery and execution of exploit payloads. The underlying problem of parsing streams of bits and turning them into data structures is not securely solved.

There is also what sounds like an assumption in the question that somewhere in a piece of software there is a secure base or core, that functionality accretes, that vulnerabilities exist only in new functionality, that what we have to do to improve security is disable only the new functionality.

This assumption is faulty. Functionality accretes, and with accretion comes complexity and with complexity comes new bugs, but it is not the case that older simpler functionality represents some sort of security ideal.

Newer code is very often written with greater discipline and maturity and awareness of risk, and is often in an absolute sense more secure.

Older functionality may have been secure for the time in which it was authored, but would not survive for a moment against attackers of today. Older code is often of far worse quality than newer code, surviving with known bugs and vulnerabilities only because replacing it is too daunting or complex to realistically contemplate. Security issues may be carefully hidden under layers of intended protections, but they are still present, awaiting a clever enough attacker to find a vector through which to exploit them.

In short, there is no non-vulnerable software. Of course people speak in black and white terms and refer to some features as secure and others as insecure, but it is more accurate to remember in discussions about security the old joke of running faster than the other guy when being chased by a bear.

Chromebooks will be "secure" as long as they're less popular and not Windows. Were Chromebooks the dominant platform in the ecosystem, the rate of discovery of vulnerabilities would dramatically increase. The vulnerabilities would be different in character than ones found on other platforms and so given the current state of knowledge are harder to find than those on other platforms, but they are still there.

This trajectory isn't just true for software, it may be observed in any realm of human functional endeavor. There are incentives to tear down old buildings in Tokyo, even sacred ones, because they represent a danger in the context of making the city more resilient against earthquakes. Cars that are more than 5-7 years old are relatively speaking manifestly unsafe in accidents compared to newer counterparts.

In the end, it isn't vulnerabilities that matter, but safety. It doesn't matter if at a particular point in time a given attacker can't find a weakness in a particular place in a specific piece of software. Attacks are conducted with goals in mind, often economic, and the landscape is rich enough that if one approach fails there are dozens of others that can be profitably tried.

The most common attack that people fall victim to is phishing, which may but doesn't have to exploit any particular piece of technology, beyond using it to engage the victim.

So a browser may not have an extent or discovered vulnerabilities but from a user's perspective that does not make it safe. Simplicity and reduction of functionality can reduce the attack surface and increase the cost of targeting a particular user, but there is no magic combination of settings a user can tweak to enable them to forget about safety.

I hope that was the actual question being asked.


Does subject alternative name order matter for TLS certificates? I ran into an issue today and I'm interested in finding out if the behaviour seen is standard or non standard.

We have several servers that are exposed through a load balancer serving https requests. These servers use TLS certificates with three Subject Alternative Name entries.

For example:

myservice.mycompany.int
dc1.myservice.int
dc2.myservice.int

We had one of the servers rebuilt and a new cert deployed on that server. The Subject Alternative Name entries on the new cert had the same entries as shown above but in a different order.

We had one client system that had issues after this server went into the load balancer where it was throwing the following errors:

Caused by: javax.net.ssl.SSLHandshakeException: server certificate change is restricted during renegotiation

So I came to the conclusion that this was due to the order of the SAN entries when an SSL session renegotiation was being performed by the client system and it got a cert with the SAN entries in a different order.

Is the order of the SAN entries supposed to be significant when determining whether a certificate is equivalent for the purposes of TLS renegotiation?

The order of subject alternative names is not important. What the client is complaining about was a change of the certificate during renegotiation inside an existing SSL session. It does not matter what the change is, i.e. it is enough that the serial number has been changed.

Apart from that it might be a bug in the client. See What means “javax.net.ssl.SSLHandshakeException: server certificate change is restrictedduring renegotiation” and how to prevent it?
 where the answer points out a bug in Java7 and Java8 introduced while trying to mitigate POODLE. According to this post the bug was fixed in Java 7u85 and 8u60.


Is this event a security concern: Windows 10: Event 360, User Device Registration? My computer just froze, and I ended up having to reboot.  It appears Windows Defender was coming up with a notification, but that froze as well.  I was trying to see what went wrong in the event viewer, and noticed several application hangs (not really a security concern), and then this, in the Administrative Events: Warnings section, which is more of a concern to me:

Event 360, User Device Registration
Windows Hello for Business provisioning will not be launched.
Device is AAD joined ( AADJ or DJ++ ): Not Tested
User has logged on with AAD credentials: No
Windows Hello for Business policy is enabled: Not Tested
Local computer meets Windows hello for business hardware requirements: Not Tested
User is not connected to the machine via Remote Desktop: Yes
User certificate for on premise auth policy is enabled: Not Tested
Machine is governed by none policy.
See https://go.microsoft.com/fwlink/?linkid=832647 for more details.

I should not have any devices connected to my computer, it is a home computer.  Google searching reveals that AAD is Azure Active Directory.  Does this mean someone is connected to, or tried to connect to my computer?  I ran an antivirus scan, and looked in the security event log, and both results were okay.  Is this just a normal log entry, or indicating something possibly malicious (e.g. a person attempting to connect to my computer)?  Is there anywhere else I should check / actions I should take?
Edit
I do connect to a wireless printer, so that might be a clue, not sure if this message is in reference to that.  I did not try to print anything when the system froze.
Edit
I finally found after some more searching on revisiting this topic, that "Windows Hello" is likely associated with the finger print scanner. Odd this would have caused this event when I was already logged in though. I have seen other accounts of people running into this error, but not much explanation, and the nature of the event is still largely unclear to me (e.g. was the finger print scanner trying to register, or was it possibly a malicious user device trying to get into my computer, or something else?)

I also try to get rid of this warning. I observed it from two types of environment: on Workgroup computers (typically at home) and with on-premise Active Directory joined computers (corporate network) on Windows 10 1607+. It doesn't seem to be linked to Windows Hello but rather to the Azure Active Directory (AAD) join and probe process. The event is logged when Windows starts, which is when it checks its domain relationship, so the same behavior occur with AAD.

As stated in this KB article about other events, I do think the event 360 can be ignored as it doesn't apply to your environment.

It's not a security concern to me, as long as there are not other events logged related to AAD. On a few machines, I found events reporting they were trying to register with AAD but failing (which make sense for on-premise AD joined boxes). In this case, the failing request probably contains personal data so here it could be a security concern at some point.

Even though it doesn't solve the problem, if you don't want to see this event anymore, you can disable the Microsoft-Windows-User Device Registration/Admin log.

Alternatively, there seem to be a scheduled task coming into place for this process, as described in this thread.


How do new security and cryptography techniques/protocols avoid the chicken-and-egg problem? . . .better solutions have been proposed and will be worth considering once they have withstood the test of time (i.e. “5 to 10 years in the field, and not broken yet”).

-From Thomas Pornin's excellent blog post on password hashing.

The quote seems to me to be a case of the chicken and the egg. New solutions need field experience, but until they get field experience they cannot be trusted, and hence cannot be used in the field.

The AES selection process somewhat avoided the problem by bringing a great deal of academic force to bear. Over five years, the best cryptographers in the world meticulously examined the submitted algorithms, with the result that Rijndael was chosen as the best compromise between security, speed, and usability.

But AES had the significant advantage that the standard it was replacing was demonstrably weak against modern computer hardware and in dire need of replacement. Most new protocols or algorithms don't have this hard limit to help them achieve prominence.

Given that the standard answer to "which algorithm?" or "which method?" is always "use the trusted", how do new solutions ever get their field experience? Does it rely on someone taking a leap of faith with their sensitive data, or does it rely on use of the new solution with non-sensitive data and then extrapolating based on that experience, or what?

(I understand that the quote's context was specifically related to password hashing. If generalizing from that to all security methods is unfair or off-base, knowing why would be useful.)

The bootstrap process is achieved when people do use the new algorithm. To gain trust in the algorithm's strength, it must have exposure. Exposure is achieved through either formal competitions like for AES, or, more recently, for SHA-3; or it is achieved through the algorithm being widely deployed and becoming an interesting target.

Open competitions are tricky: in order to claim a good level of exposure, the competition must have attracted a lot of researchers for quite some time, and that's not easy because academic researchers rarely work for money, but for glory (or at least what passes as fame in academic circles). It needs a powerful sponsor. NIST is good for that, and did it well for AES; arguably, SHA-3 was also a success, although the end of the process has a somewhat bitter aftertaste (because NIST is currently deciding what tweaks it will push into the winner algorithm, and such tweaks undermine the whole trust building process). There were other "competitions" such as eSTREAM for stream ciphers; it did get a fair amount of exposure, but "not as much" as AES or SHA-3. For password hashing, there is an ongoing competition which is at the candidate collection phase (until January 31st, 2014).

Wide deployment occurs when some organization decides to deploy the algorithm "early", because the new algorithm offers a decisive usability advantage (e.g. a signature algorithm which has very short signatures, or requires very little computing power), or because the powers-that-be in that organization feel (wrongly) that "newer is better" and want to be early adopters of the new nifty cryptographic technology. For instance, SSL was widely deployed because it filled a niche which was not otherwise covered, even though the protocol was really not up to known "good practices" at that time (SSL 2.0 was quite bad and lead to a complete rewrite as SSL 3.0 less than two years afterwards).

Thus, as cryptographers, we MUST recommend that people refrain from using algorithms which are "too new" and "insufficiently reviewed", but we are also quite happy that some people do the "wrong thing" and do not refrain; it gives the exposure which is necessary for the bootstrap, and also ensures that cryptographers won't get out of job (a research article which demolishes a poorly-specified protocol -- WEP, I am looking at you -- is still a published research article). The best we can do, in the meantime, is to prepare: cryptographers can design algorithms based on rational constructions which thus stand a reasonable chance of surviving the deployment. For instance, when bcrypt was first described, it had not (of course) been exposed in the wild for several years, but at least the authors tried to follow some justified rationale, and the algorithm turned out to be "mostly good".


Are bad passwords used to breach security in real life? I sometimes hear news articles about hackers managing to get a list of usernames/emails and passwords from a given site, and I also hear news articles about how little entropy there is in some people's passwords, and how common some of the most common passwords are.

However, I don't hear many news articles about people using passwords to breach security. The last time I've heard of something vaguely similar to that was for a very high-profile target - a Vice-Presidential candidate in the 2008 election campaign (and it involved resetting a password using verification information).

Are bad passwords used to breach security in real life?

The question Are there any examples of huge damages done by password leaks, or bad password management policies? is partially related, but it seems to be also touching upon the damage caused to companies by the company having lists of usernames/emails and passwords leaked.

Yes, stolen passwords are used in real life attacks. I didn't actually know myself until I searched, and it's buried all the way on the third page of my fourth or fifth Google search; i.e. the information practically doesn't exist. ;-)

Anyway, apparently back in 2012 there was a period of several months where Best Buy accounts were compromised by stolen passwords from another site. And in 2015, Verizon estimated 63% of data breaches used stolen, default, or weak passwords. I don't feel like registering to download the full report from Verizon so I'm not sure how many were stolen vs. weak or default, but I'd guess it's a significant portion if they're reporting it that way.

I'd guess more information is out there for the finding if needed.


Injection/SQL Injection Attacks in Layman Terms I'm having trouble figuring out what SQL injection attacks are, or in more general terms, what injection attacks are. Most explanations out there on the internets are kinda hard to understand. Could someone explain, in layman terms, what an injection attack is, and specifically an SQL injection? Also, what are ways to defend against these?

Thanks

In layman terms:

Typical web applications are three-tiered(browser +web server + backend databases). When a user accesses a website, his browser receives html and js which is product of static web pages as well as dynamically generated ones using server side code (e.g. php, asp). When you login, for instances, you send your password and username to the web server, which processes such parameters and applies the pre-programmed authentication logic (in php,asp).Such logic requires verifications using a database that stores users data and allows the simple verification: username matches password. So, the server side logic takes your arguments and queries the database (e.g. MySQL).

SELECT * FROM Users WHERE username='your_supplied_username' AND password='your_supplied_password';

The database processes this and returns (if the database is correctly designed) only one (username and password match) or zero (wrong password) matches which "represent you".

What about SQL Injection Bro?

I am not your bro, bro :P. A sloppy developer would take the parameters sent by you and put them directly on the your_supplied_* fields. If the user wasn't malicious, this would be no problem at all. Yet, for a malicious attacker, this opens a huge door for attacks. If you are familiar with SQL, you know that AND requires both left and right expressions to evaluate to true. Also, in SQLi, the comment character "--" is an helpful friend so, what if i write my_username';--?

SELECT * FROM Users WHERE username='your_supplied_username';--' AND password='your_supplied_password';

Server side code will take my input, apply it to the stringed query and send it to the database. The database will interpret "--" as a comment which will exclude:

' AND password='your_supplied_password';

while keeping:

SELECT * FROM Users WHERE username='your_supplied_username'

This is a valid query which will easily evaluate to true. Now, the behavior here varies. If the username is unique (typically it is), there will only be one record returned. If it isn't, multiple records will be returned and the web server code (e.g. php) will typically pick the first. If you are familiar with SQL, you may now get creative and chain queries, use wildcards and get wild. Now the question is:

As a developer, what can i do?

Now, this depends on the server side language you are using but the coding primitives are typically named alike. You can escape special sequences using php (http://php.net/manual/en/mysqli.real-escape-string.php) or use prepared statements (http://php.net/manual/en/mysqli.quickstart.prepared-statements.php).

How do i know if the server suffers from SQLi?
You can run tools such as SQLMap or SQLNinja. You can also go to the forms and write

'gibberish
where the ' will hopefully confuse the php query parser and leak an error shown on your browser (SQL statement error). There are other techniques such as injecting a sleep statement on queries to check if the database hangs for a few seconds before returning. As a defense mechanism, you should always process your SQL errors on the server side code before sending them to the user to avoid intel leakage.

Stay safe ;)


What is the meaning of public key parameter in the X.509 certificate? While I am checking the fields of X.509 I've noticed there is field called public key parameter and its value is 05, what is the use of this field? I have searched and did not find a clear answer for that.

Nowadays the most important use of field "key parameters" is within ECDSA certificate; the field holds an elliptic curve per RFC 5480 section 2.1.1.

Still, as of 2017, most people use RSA certificates; for these RFC 4055 section 1.2 says "the parameters field MUST contain NULL" (except the fringe RSASSA-PSS or RSAES-OAEP). Bytes 05 00 simply mean NULL in DER (and CER and BER).


Can you encrypt a password using that password itself? Possible Duplicate:
  How to securely hash passwords?
  https security - should password be hashed server-side or client-side?

I need to make a request to a web server, the only information I have from the member is an account number and password. The account number can’t be encrypted because I need that information to look up the members record. I would like to encrypt the password before passing it to the web server. But I don’t have any secret key to encrypted the member password, the application can be reversed engineered. My question is can you encrypt a password using that password?? Like MySecretKey is encrypted using MySecretKey as the password. I don’t know if this is possible even if salt is added. Any advice?

To answer your specific question, then yes, of course, you can encrypt a piece of data using another piece of data as key, even if both the data and the key happen to be identical. But what would that achieve ? Decrypting would be difficult: you need the key to decrypt, and you do not have the password until you have decrypted it...

"Self-encryption" could be viewed as a kind of hash function: a deterministic transform of some input data, in a way which can be reversed. Hashing is the proper framework for password storage (where, in fact, the password is not stored, only a password verification token). However, growing home-made hash functions is known to be hard; when cryptographers want to build a hash function, they take a lot of time because they need to be sure that the function is secure, and you cannot know that just by looking at it.

Also, secure hashing is not, by itself, sufficient. You need a SLOW and SALTED hash. This subject has been beaten to death several times on this site, see for instance this question or that one. The comprehensive answer being: use  bcrypt.


Have a HTTP or HTTPS website? There were some questions regarding this topic, but none of them discussed if there is some expection, and if http is just enough for some kind of websites.

I've seen lot of school/high school websites with just http, so there was no https link. On this websites there was also no login or something present, so was a let's say normal static kind of website (I did not check it further, maybe there was some hidden link to login and edit the website).
Does this kind of website need a https?  What is a danger of having just http for this site?

Another example would be a personal website. Imagine you have a website where people can read your info, the projects you were working on and contact details; so no login and nothing. Does this kind of website requires a https connection? Also here, what is dangerous of having just http for this site?

Also this: http://collegeinfogeek.com/
This website is http, but does this website need a https for their purpose?

One more thing that is not clear for me. If there is a login option present on the website, https is highly reccomended. But in the case we use http and we encrypt the login credentials and send the ecrypted data on the server we should be also secure or?

NOTE: I am reffering to "small" websites, not an organization or business website (with bank transactions and so). Just normal site with login possibility.

HTTPS is always recommended these days. And generally fairly easy to implement too.

Any webiste that contains sensitive information or any that simply has a login MUST be secured with HTTPS. Othewise, you are sending information in clear text over the Internet which is easily intercepted.

For sites with no login and no sensitive information, HTTPS is perhaps less critical but there are still reasons. The main one being that without it, it is possible for attackers to substitute some of your legitimate content with their own. When using HTTPS, the end-to-end conversation is encrypted and so attacker have no way of intercepting and replacing content.

The other main reason to want HTTPS always is to stop 3rd parties from following what you are reading.

These apply to the website you listed. Although the store part of the site is already secured with HTTPS, the general sections are not, by default, and so may be vulnerable to attack and eavesdropping.

You should note, however, that having a general website only use HTTP is still very common and the risks are generally not that bad.

Note: Try using HTTPS on that website, For me, it completely messed up the formatting. So something is not correctly configured.

Regarding login pages: It is best practice to encrypt the login page not just the actual login dialogue. This ensures that the end-to-end communication is encrypted and it provides visible assurance to the user that you have done the right thing. Never give your login details on a page that isn't using HTTPS. Not for any reason. You probably don't have time to go round checking what the system is doing behind the scenes and it indicates poor understanding and/or practice on the site owners and developers parts.


Can using torrent help me obfuscate Tor-over-VPN traffic? There is tremendous misinformation about Tor in my country's mainstream media so, even though i use Tor for everyday surfing, I'd like to hide it from my ISP.

Currently, I use a VPN whenever I am online, tunneling also other traffic such as torrents.

I am in a 14-eyes country, but my VPN server is not.

I know that using a VPN I should be covered, but I fear that this could not be enough.

Here is my question: If I generate heavy loads of traffic with p2p protocols (e.g. torrent) while I am surfing with Tor-browser, everything over the same VPN, can it gives me privacy benefits?

In other words, will my ISP have to try harder in order to discover that I am using Tor?

If you want to hide the fact that you are using Tor, you should use pluggable transports with a bridge. These are a variety of protocols that obfuscate the traffic between you and a supported bridge relay. It functions to hide the protocol and thus the existence of the Tor connection in order to evade ISP-level censorship. The current best obfuscation protocol to use is obfs4. Many bridges support this protocol.
You can visit the Tor's BridgeDB to obtain bridges using pluggable transports for obfuscation.

will my ISP have to try harder in order to discover that I am using Tor?

No, it is easy for an ISP to know that you are using Tor through a VPN. Tor sends traffic in "bursts" of 514 bytes (previously 512), called cells. If the data being sent does not divide evenly by 514, then it will be padded. A VPN, on the other hand, sends data encrypted but without any padding. This makes the usage of Tor through a VPN apparent to anyone who is monitoring packet sizes and can detect those cells. Anyone who sees a VPN send traffic in bursts of 514 knows that Tor is running underneath.

I am in a 14-eyes country, but my VPN is not.

That's not necessarily a good thing. If your connection to your VPN passes the border of an SSEUR country, then traffic will almost certainly be logged. If your VPN is within your country, then the chances that high-resolution logs will be kept is significantly lower, since the small ISPs between you and a local VPN are less likely to have the resources to wiretap. Using an offshore VPN is especially problematic, since your connection to it will be going over an undersea fiber optic cable which is trivial to tap.


What are the privileges of shell spawn by a shellcode? After I see some examples of shellcodes in various exploit examples they try to spawn a shell.

I want to understand why after spawn the shell have privileged access?
Doesn't the shell should have the same privileges as the user running the process?

Well, what to say except that you are fully right?

The spawn shell will have the exact same privileges as the process from which it is spawned, no more, but no less either. All the interest is here: the greater privileges the vulnerable application has, the greater privileges your spawned shell will have.

However, once you have a shell running on the machine, nothing prevents you from trying to run local privilege escalation exploits. But this will be done at a second step:

First step: spawn a shell which will have the same privilege as the end-user or the web-server running the vulnerable software,
Then, as a second step and if you need to (you do not necessarily have to increase your privileges, it all depends what your final goal is), you will try to use other exploits in order to increase your current privileges. The main difference is that, having an interactive shell running on the machine, you will now be able to take advantage of local exploits instead of being limited to remote ones as in the first step.


Securely wipe external drive with Windows only Consider following 2 disk wipe procedures, using only vanilla Windows installation:

First do a quick-format to make the disk appear empty, then do one of these:

Just do full format of the disk.
Bitlocker-encrypt the entire drive (all space) using a strong key which is then thrown away, leaving disk unusable until formatted.

Both are operations which can be started quickly and then left running unattended, and then the drive yanked out when it's finished. And the concern is wiping the the data that was on the disk previously.

Is doing 2 more secure than doing just 1? Or to put it other way, who can recover the original contents after alternative 1, and who can recover them after alternative 2?

So, the key point of this question is: is there any advantage of writing single pass of "random" data (by encrypting) instead of writing a single pass of zeros (by full format).

Bonus question: Can you suggest other alternatives for Windows 7 or 8, assuming no extra software can be installed?

If I were you, I'd encrypt the whole thing, because it's really hard to securely erase an SSD. I don't remember the specifics of WHY at the moment, but there's another question on here that talks a bit about it. Anyway, the basic point is: if you can, encrypt the data. Just deleting it isn't necessarily secure.

EDIT: Just FYI, I'm not saying that a reformatting will be sufficient for an HDD either. It's just that SSD's pose their own set of challenges.


Security goals vs ITU-T security services I am doing a course on cryptography, and there I learned that the major security goals are

Confidentiality
Integrity
Availability

Also I Learned that ITU-T provides 5 different security services

Data confidentiality
Data Integrity
Authentication
Non-repudiation
Access Control

If there are only 3 security goals, why do we need these 5 services, and how does these services provide the above goals?

All models are, by definition, simplistic in some way; they are models. That's their job.

At some point, someone coined the triad "confidentiality, integrity, authenticity" (I don't know who, but it is old). This is a mental framework: every information security concept can be forced into one of these three categories, sometimes with the help of the psychological equivalent of a sledgehammer. Later on, other people suggested to augment the model in various ways, e.g. the Parkerian hexad which extends the list to six categories.

It is relatively obvious that the less categories you have, the more approximate they will become. However, piling up extra categories does not guarantee that it will make the model more adequate. You should read these lists of categories as checklists: helpers to see whether you did not forget one facet of the problem at hand. But don't take them as Gospel. We already see too many people who try to one-up each other by their use of one more byzantine category.

In practical terms:

Confidentiality is about keeping information private.
Integrity is about keeping information unaltered. This is defined only with regards to a reference state ("this file is identical to what it was at time T on machine X").
Authenticity is "owned integrity": this is about integrity of some data where the reference state is "whatever some specific guy thought that it was". This morphs into authentication protocol, where the verifier makes sure that what it receives really comes from a specific prover (which, indirectly, may imply that the said prover was involved in the operation).
Availability is again a sub-category of integrity, where the "alteration" boils down to "the data is simply not there". Thinking about it as a specific category can be helpful in that malicious alterations (the bad guy flips some bits in a file) and wholesale unavailability (DoS attack, flood...) are so different in their modalities that keeping them under a single category is not a fruitful modelling.
Non-repudiation is an extension of authenticity, in that it adds an extra feature: third parties can be convinced. "Normal" authenticity is between a prover and a verifier; the verifier becomes convinced that the data at hand really comes from the prover. With non-repudiation, the verifier also obtains a proof that he may show to a third entity who would become equally convinced. This is the basis for digital signatures.
Access control is a bridge between confidentiality, integrity and authenticity. It begins with authentication, and then works out what data the authenticated individual may "access", where access is a combination of reading (that's confidentiality) and writing (that's integrity).

There are other classifications which can be useful in some contexts. For instance, in Identity Management, we would talk of identification, authentication and authorization:

Identification: "There is a user called Bob, born on xxxx-xx-xx, with employee number nnnnnn".
Authentication: "A user sent password 'B0bst4ongP4sswo0rd!' which matches the hashed password stored for Bob, so chances are that we are right now talking to Bob".
Authorization: "Bob can read columns X and Y in table Z of the database".

With these categories, "access control" becomes a sub-case of "authorization".


Does a CSRF cookie need to be HttpOnly? We recently were handed a security report containing the:

  Cookie(s) without HttpOnly flag set

vulnerability, which we apparently had in one of our internal applications.

The applied fix was as simple as setting the Django's CSRF_COOKIE_HTTPONLY configuration parameter to True.

But, this is what got me confused. Django documentation says:

  Designating the CSRF cookie as HttpOnly doesn’t offer any practical
  protection because CSRF is only to protect against cross-domain
  attacks. If an attacker can read the cookie via JavaScript, they’re
  already on the same domain as far as the browser knows, so they can do
  anything they like anyway. (XSS is a much bigger hole than CSRF.)

  Although the setting offers little practical benefit, it’s sometimes
  required by security auditors.

Does this mean that there is no actual vulnerability here and we just have to be complieant with the security auditing rules?

As joe says, there is no real security benefit to this. It is pure security theater. I'd like to highlight this from the documentation:

  If you enable this and need to send the value of the CSRF token with an AJAX request, your JavaScript must pull the value from a hidden CSRF token form input on the page instead of from the cookie.

The purpose of the HttpOnly flag is to make the value of the cookie unavailable from JavaScript, so that it can not be stolen if there is a XSS vulnerability. But the CSRF-token must somehow be available so it can be double submitted - thats the whole point with it, after all. So Django solves this by including the value in a hidden form field. This negates the whole benefit of HttpOnly, since an attacker can just read the value of the form field instead of the cookie.


Basis for "trusting" third party code and services I remember reading an article mentioning, that third party services and code should not be trusted, meaning blind trust.
So, i was thinking, everyone uses third party code in software development daily, even high profile IT security companies, and some of us take it for granted that the code they just used is trusted, meaning secure and tested.

Questions:

What's the basis for trusting third party code and services in software development?
What measures are taken by IT security companies before granting that trust?
What measures are taken by IT security companies to maintain that trust?

Both open-source and closed-source.

For example, think of:

The web hosting company to host your or your client's application and data
The piece of software you didn't write but work with.

Thanks!

I was recently employed for an organization that used third party software. Here is our thought process.

There is strength in numbers. Third party software that is A) open source, B) has a dedicated and knowledgeable security team, C) has a responsible disclosure policy, and D) is widely used by thousands of customers is better than anything our organization could ever put out.
There is strength in doing the legwork. I was assigned to every module of this third party software, and I did a full review of it before allowing it to be added to our infrastructure. And if we found a vulnerability, we utilized the responsible disclosure program to make the software better.
There is strength in updating. We subscribed to vendor alerts to make sure that if someone else found something, we were able to respond to the incident and protect our infrastructure.

Of course, there are also weaknesses to this approach:

There is weakness in homogeneous software. If a large exploit came out, there's a high chance someone found our site and attempted a point and shoot exploit.
There is weakness in numbers. We did a full review, but did the other thousands of people using it? Probably not.
There is weakness in volunteer work. If something happened, there was no vendor rep to talk to. We had to A) retrace the problem, and B) fix it before we got hit.
There is weakness in quality control. Open source is all about community contribution. However, the first law of humans is that humans are stupid, and no language is stupid proof. Especially PHP, which is what the software was written in.

As with all security policies, you must be risk aware, and minimize risk where you can. The only way to reduce your risk to zero is to write on wax tablets by candle-light.


Securely store tokens in WinPE We have a tool running on WinPE (Windows PreInstallation Environment) which talks to a web service. A user enters his login credentials and the web service authenticates the user and returns an authentication token. I want to securely store this token on the system for sending this with subsequent requests.

DPAPI Looks like DPAPI won't be secure enough as there won't be any user account (neither local not domain) in the WinPE. This question

How can this be achieved?

Summary: unless you have very specific requirements, just use the decent tools Microsoft has provided.

DPAPI allows you to encrypt with user specific or computer specific keys. On a typical shared machine it is slightly less safe to store data for one user in computer context.

If your WinPE environment is short lived, e.g. the tool runs and then it shuts down, it should be quite safe to use “current computer” mode. You can do this by setting dwFlags to CRYPTPROTECT_LOCAL_MACHINE when calling CryptProtectData.

At this point your secret data is stored on disk using encryption which should be well implemented and tested by Microsoft. This is better than rolling your own crypto.

Risks now are:

Anybody who can run code on the machine can extract the secret. If this is a concern, also pass a value for pOptionalEntropy to CryptProtectData. This is effectively a “password” and would force an attacker to also reverse engineer your program to obtain the additional entropy. However, if someone can run code it should be game over for most sensible threat models.
Data can be obtained from a forensic image of the machine. Offline decryption of DPAPI data is possible, there are tools and even a Python implementation. However, this takes time and requires a good forensic image of the original PC. Note it is not an offline attack, you need all of the key material. This is no different to using any other encryption to protect the data. Consider Bitlocker to protect the disk.

If you control the web application, also consider best practises like risk scoring API token usage. Has the client IP changed? Has the bowser changed? Is the client trying to conduct a privileged operation? Each of these can increase a risk score and perhaps trigger extra validation.


Do I need logging enabled in my rules in IPFW for sshguard-ipfw to work/blacklist ip's? From the FreeBSD handbook:

  Even with the logging facility enabled, IPFW will not generate any rule logging on its own. The firewall administrator decides which rules in the ruleset will be logged, and adds the log keyword to those rules.

So my question is, should I enable logging to any rules for IPFW for sshguard-ipfw to work and be able to blacklist IP's?

I only have rules allowing SSH in and out on 22. It would only make sense to log deny rules. Pam authentication errors for SSH should be enough information for sshguard-ipfw to block and blacklist IP's?

According to sshguard's website you can use it even without a firewall, so I'm guessing the logs for ipfw don't matter.

Before someone says this in the answers to enable blacklisting add this to syslog.conf
auth.info;authpriv.info |/usr/local/sbin/sshguard -10:/var/db/sshguard/blacklist.db

Thanks.

Logging is open to choice and I will explain why. It is easier to block ALL (drop, not reject) and allow in ONLY trusted addresses. This allows you to make ONE rule versus N amount of rules you'd be generating by blacklisting. Have a look at the average blacklist and you will find that there can be well over the 1k mark on any given day. What occurs is the following:

Firewall (be if IPFW, IPTables, a Checkpoint FW, SSG, etc.):

Connection is coming in --> Check against the first rule
Connection is coming in --> Check against the second rule
Connection is coming in --> Check against the ... rule

Your machine will have to process N amount of rules - where N is the amount of IP addresses in your blacklist. Not to mention, I know of ssh-based bots which spoof addresses, so there is also the possibility of spoofing: the machine itself, the default route... 0.0.0.0/0 (everyone). Think about that for a moment. If I did the following:

nmap -sS YOUR.IP.ADDRESS -p 80 -D 0.0.0.0,YOURGATEWAYIP,YOURUPSTREAMGWIP

Your logs will show entries from 0.0.0.0, Your Gateway IP, Your Upstream GW IP, in turn creating a FW rule to block connections. To avoid this, you'd have to WHITELIST IP address, creating even more rules:

Connection is coming in --> Check against the first rule --> WHITELISTED

This packet will be sent immediately depending on the placement of the rule (it would have to be one of the first. Otherwise:

Connection is coming in --> Check against the first rule
Connection is coming in --> Check against the second rule
Connection is coming in --> Check against the ... rule
Connection is coming in --> Check against the first rule --> WHITELISTED

The bigger your rules become, the harder it is to maintain. If at all possible, its better to do the following:

firewall --> this Whitelisted address is allowed all others blocked

One rule to process versus cumbersome rules. Now, back to logging; what would be the goal of logging. Attacks come, attacks go. The Internet is like outerspace filled with junk. Many of the ssh attacks are coming from compromised hosts, not the actual attacker. Many are parts of botnets, some of which are 100's of thousands strong. Not only are you wasting processing power, eventually, you are also wasting space on the drives since logs can grow.


Does a simple mobile REST API need HTTPS? Let's say I have a really simple mobile app with a server API. For example some kind of Q&A app, where users answer questions to win some points ('Who wants to be a Millionaire' kind of game).

Users can download new questions from a server's API. Next, the users can upload new questions they made up to contribute to a common database of questions.

I was pretty much always taught to use a HTTPS on production servers. However: do I really need to use HTTPS with some kind of security token in this case? Is there a way to inject some malicious questions if simple HTTP is used? Or other threats?

Do you care if a 3rd party monitors or modifies a request in transit from the client to you or from you to the client?

If you don't care, just use HTTP. If you do care, use HTTPS.

Is there a way to inject some malicious questions if simple HTTP is used? Absolutely, the real question is does it justify the extra cost of developing a HTTPS system to prevent that from happening? (most of the time the extra cost to implement HTTPS over HTTP is so minimal the answer to the question usually is "yes, the cost is justified")


Which security protocols are the todays state of the art in WSN? WSN (Wireless sensor networks) are mostly distributed low power computer with the sensing task that rely on limited battery life and therefore are not able to implement full size security protocols. Depending on the kind of network heterogeneous, homogeneous and the environment they will be used in (likeliness of some attack scenarios) the security means used may depend a lot.

The question relates mostly to networks with homogeneous networks w/o internet connection that rely on some coarse distributed base stations or heterogeneous networks with only slightly differing nodes (towards computational power) that allow clusters to some extend but also heavily rely on coarse distributed base stations.

Does anyone have an idea what todays state of the art protocols are for the different kinds of possible attacks? Key distribution methods, Intrusion detection systems, ...?

One area is certainly low power WAN networks, with NB-IoT (CAT-M1 and CAT-NB), LoRa and Sigfox as most common examples. I cannot comment on security levels, but I NB-IoT (part of 4G) should be pretty OK.


TLS key exchange algorithm = Certificate signing algorithm? My bachelor thesis is about TLS and I have a basic question about the algorithms used there.

If I use e.g. a sha1WithRSAEncryption signing algorithm (RFC3279) for my certificate, that means that the public RSA key of the certificate is signed using the SHA-1 hash.

Now does that mean that RSA has to be the key exchange, too or is the public key of the certificate used for authentication only? If I use RSA as key exchange and for my certificate, will I have two separate key pairs?

Sorry for the many (unstructured) questions, most articles explain either authentication or key exchange.

that means that the public RSA key of the certificate is signed using the SHA-1 hash.

The certificate is signed and not the key. The key is part of the certificate but a certificate needs more, i.e. subject, issuer, when it is valid, how the key can be used ...

  Now does that mean that RSA has to be the key exchange, too or is the public key of the certificate used for authentication only?

Since the authentication is done using the certificate and the certificate contains only the RSA key the authentication is done with RSA. The key exchange can be RSA but can also be Diffie-Hellman. The latter one is actually the recommended way. With TLS 1.3 RSA key exchange is no longer possible (i.e. always Diffie-Hellman) but RSA authentication can still be done.

  If I use RSA as key exchange and for my certificate, will I have two separate key pairs?

With RSA key exchange the same key is used as for authentication - i.e. the only key which is contained in the certificate.


Computer Virus Phylogenies algorithms - pseudocode? I've collected a large number of "Web Shell by oRb" (a.k.a. "FilesMan" backdoor, a.k.a. antichat backdoor) files by running a WordPress honeypot, and searching pastebin. The code in the variants is obviously related. I'd like to figure out a "phylogeny" of WSO variants. I found D. Gusfield, Efficient algorithms for inferring evolutionary trees, which has a clearer explanation of the phylogeny generating algorithm in Caroline Uhler's Finding a Perfect Phylogeny.

Unfortunately, the folks who created some of the WSO variants borrowed code from other variants, so a "perfect" phylogeny doesn't exist - some variants have two or more immediate ancestors due to the malware writer equivalent of "horizontal gene transfer" as practiced by real life bacteria. The only thing I've been able to find about phylogenies that are directed acyclic graphs, is Constructing Computer Virus Phylogenies. The problem with that paper is that it doesn't seem to actually show you an algorithm - either no algorithm is present, or it's buried in the assorted lemmas, theorems, definitions and proofs.

Are there other papers that actually display an algorithm or pseudocode for an algorithm that can generate "phyloDAGs"? I'd settle for an implementation in a major programming language, even.

Yes.  You are looking for Ancestral Recombination Graph (ARG) algorithms.  ARGs are the natural extension of phylogenies (trees) to DAGs.  ARG algorithms tend to be exponential algorithms, while phylogeny algorithms are polynomial.  This means that the dag problem appears to be significantly more difficult than the tree problem.

Please see the book:

D. Gusfield. Recombinatorics. MIT Press. 2014.

https://mitpress.mit.edu/books/recombinatorics


After a full web vulnerability scan, do we need to test each & every similar field for possible injections? I ran a zap scan for my project and found some medium & low level vulnerabilities. But going through some posts, I found that we should run injections (sql, xss, command) on text fields also.

But running these injections on every text fields is a tedious task and takes most of the time. As per my understanding, if we run these injections on any one text field in each page should give the same vulnerable results instead of running on all text fields on that page for the project.

Please suggest if this approach makes any sense?

It all depends on how your application handles the fields.
If it handles them in exactly the same way then yes, in theory you only need to scan one of them. However this is not the normal case, applications usually use fields differently.

There are various ways to speed up ZAP scans - see this blog post: https://blog.mozilla.org/security/2013/07/10/how-to-speed-up-owasp-zap-scans/


Extra PBKDF2 characters in SHA-512 output I was using hash_pbkdf2 earlier today when I noticed something strange.

The normal way to generate a hash is to output the entire string like the code below which outputs a 128 character string (128 chars, 4 bit each, 512bit total):
echo hash_pbkdf2("sha512", "123456", "test", 30000, 0);
c7b35be6c57b716fe4beb1ca33341ea32cb0de817636c115244db9c57cea1120828ea2b9f19805b24667c876d7b0e5ec4a3b05b3b793845ece2404106d781cda

However I made a minor error which I noticed output a whole heap of extra data:
echo hash_pbkdf2("sha512", "123456", "test", 30000, 512);
c7b35be6c57b716fe4beb1ca33341ea32cb0de817636c115244db9c57cea1120828ea2b9f19805b24667c876d7b0e5ec4a3b05b3b793845ece2404106d781cda6b38792a96c1677e897dc7640c759dc660b02bdd6b590e6b90edc88484a03bbc8d5abf598cfe0493d99aea0074ba9d66c16ecc5ab92b02e27eece56253b6c55546bc0d699129d726fc9c794baaa7bbda45625e7f7efbf958baf3f77236eadd3e4b86beaf7ed302f995096ad08e95fe078a0bb0ad0ff5dd672aac76fc335b6746ee177d6f2133de667a8a49a1356129d2a34a3a57aeb341101cd78fd8998d11910d926576427da7a02da554a787efe782fe7d26f01fe3e4f8bf4f4f352470725c

What are the extra hex output by this bad code, I was under the impression that SHA-512 could only output a maximum of 512bits?

According to the function definition, you specified a bit length of 512. By default (raw_output = False) the extra bits come from the derived key.


Does the server administrator see what sites I visit I have seen a lot of answers but here is the peculiarity of mine.

In the office we all have a login to the WiFi,

First with that login, if I use Tor will my visited sites still be logged by the router and traceable back to me (maybe by my login credentials)

Second, if I'm using incognito on any of these other browsers like Chrome, can I be traced (on a Linux Ubuntu OS and a windows OS)

Note for both cases I have to login with my WiFi credentials to be able to surf

The WiFi is distributed round the organisation using routers

With TOR, the communication between you and the TOR network is encrypted. Unless the TOR exit node also happens to be on the same network, your administrator will only get encrypted traffic.

Incognito mode on web browsers does not affect the network encryption at all. Its effects are localized to your own machine (what site visits are logged in the local history, what form input is saved for auto-complete, what cookie database is used, etc.). An eavesdropping network administrator is not impeded by this.

The actual use-case for incognito mode is when you share the same computer with multiple users and don't want them to know what you did. It's not supposed to protect your anonymity on the network level.


What does banking etc. server room protection look like? What happens if it fails? Given that information security is derived from physical security, as evidenced by this theft, I'm curious as to what protection surrounds my bank account?

There are two main avenues I'm interested in. Physical security, e.g. locked doors, fences, mission impossible laser beams, and the underlying technical security (e.g. encryption). If someone did physically steal my data, what prevents them from accessing it? I'm aware of several techniques for protecting data in this fashion, but with encryption a key and IV needs to be stored somewhere, but, for example, what prevents that being stolen?

I'm not asking about specific banks, but general practice amongst big banks (not specifically national banks, but large banks with millions, or tens of millions of customers. Think banks of the order of Barclays).

Well, what they are really supposed to do is look to the most effective physical security measures used in the customary practices of high-security data centers in data processing industries in general, plus implement specific measures & practices that their lawyers tell them are required by the collective body of federal regulations that speak to the information security of U.S. financial institutions.

Guidance on best practices and recommendations for the secure design and operation of data centers in general certainly isn't hard to find.  You seem interested in the specific details of what access control mechanisms should be in place, how perimeter security should be monitored, etc., (which I'll admit I've always found interesting as well.)  This piece from CSO Online is one of the more comprehensive and readable run-downs, listing 19 specific physical security elements that a well-protected data center should implement well. ("Mantraps, access control systems, bollards and surveillance." among them.)  Probably not surprisingly, there are compliance certification standards for data center physical security that companies in "highly regulated industries"--financial institutions first and foremost-- are very often required (by practical forces if not directly by legal regulations) to comply with.

Now, talking about info sec regulations that apply to banks and other financial institutions is always a massively complicated endeavor. Such regulations come from, just talking at the federal level, the "Board of Governors of the Federal Reserve System (FRB), the Federal Deposit Insurance Corporation (FDIC), the National Credit Union Administration (NCUA), the Office of the Comptroller of the Currency (OCC), and the Consumer Financial Protection Bureau (CFPB)".  So says the IT Handbook resource for the Federal Financial Examination Institution Counsel, which is probably one of the best official government sources you're going to find that covers federal information security regulatory requirements for banks comprehensively, coming from that broad, broad swath of agencies.  FFEIC's specific page on data center physical security is here. It is a fairly short document, and addresses intruder detection, the training of security guards, and other topics. Look at topics surrounding that specific page in the virtual IT Handbook for information on physical security concerns that will often pertain to data centers as well as other facilities. You might also take a direct look at the Federal Reserve's guidelines regarding information security standards; some of those high-level conceptual standards most definitely do eventually affect how banks do the specifics of providing physical security at their data centers.

So there's some fun night-table reading for you.

tl; dr:  They should being doing what responsible companies in other security-intensive data processing industries are doing, plus meeting what the requirements in regulations from any number of different agencies and jurisdictions that oversee financial institutions mandate.


Difference between XML external entities and Remote File Inclusion attacks I was just studying about the XML external entities attack and Remote File Inclusion Attack.

According to my understanding, the XML external entities attack is where the XML parser in the web application has the option of external entities enabled and the attacker can parse an external XML from a remote server and execute commands or read local system files.

While the remote file inclusion attack is where the attacker is able to make the system execute the a file that lies on a remote server and the contents of this file may also be malicious and the attacker can access system level files or can even install a backdoor using this vulnerability.

I am not able to differentiate between XML external entities attack and remote file inclusion attack as both the attacks mean that a remote file execution can lead to leaking of the information.

The most notorious programming language for remote file inclusion is PHP. The following is the php example code for PHP remote file inclusion vulnerability from wikipedia article "File Inlucsion Vulnerability". In this example, code from an external server is included, thus it is run by the vulnerable application. Remote file inclusion is a remote code execution class vulnerability.

<?php
   if ( isset( $_GET['language'] ) ) {
      include( $_GET['language'] . '.php' );
   }
?>

An XXE (XML External Entity) vulnerability can also be similar to the example above. The following is an example from OWASP abuses the expect scheme to execute code. This is only for PHP.

<?xml version="1.0" encoding="ISO-8859-1"?>
 <!DOCTYPE foo [ <!ELEMENT foo ANY >
   <!ENTITY xxe SYSTEM "expect://id" >]>
    <creds>
       <user>&xxe;</user>
       <pass>mypass</pass>
    </creds>

The expect scheme execute the command (on OS level, rather than as PHP code). PHP has a document that explain how the expect scheme is meant to be used.

But if we remove focus from PHP, and look at web application in general, XXE can often only be abused to look at local files (or remote files the vulnerable web application have network access to). Commonly done with the following payload:

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!DOCTYPE foo [
   <!ELEMENT foo ANY >
   <!ENTITY xxe SYSTEM "file:///etc/passwd" >]><foo>&xxe;</foo>

Another misuse case for XXE, is that it can be used to trigger sensitive calls to internal web applications using the GET method. For instance:

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!DOCTYPE foo [
   <!ELEMENT foo ANY >
   <!ENTITY xxe SYSTEM "https://internal.hawaii.gov/api/pacom/alert" >]><foo>&xxe;</foo>

But the bottom line is that remote file inclusion and XXE is unrelated. Both might lead to remote code execution. But generally, remote file inclusion is remote code execution and XXE is abused to steal data from local files (on the server)