IIS - giving service accounts admin rights? I'm looking at a application running on IIS which requires service account(s) to run some services/software, however the service account requires LOCAL ADMIN access which is against policy.

Are there any alternatives? Is this a sign of an application that is badly made that it requires service accounts to need local admin access?

That sounds super sketchy man. The policy is right... Sounds like an app I'd like to deploy and test my pentesting skills on. :)

I'd go with the policy and push on the devs to provide a standard hardening guide to the minimum rights possible to avoid vulnerabilities to your host and ultimately your entire network if the host is compromised. Weak vulnerabilities in a web application could allow a hacker to generate shell to run commands on your host, gain a foothold in your network, and begin attacks within your network...

I would probably test it in a dev lab server... keep tweaking and hardening with basic user rights. Then keep hardening until the application breaks. Once hardened, you should only use a non-domain admin account on the box. Most importantly with a non-domain user, it should be a very complex, non-dictionary word, and at least 14-character password that's only used for that account. Avoid credential recycling.

Then when you login as the admin after all domain creds have been cleared and the box has been hardened, if the a local admin account is obtained thru privilege escalation attacks, it will slow the threat actor mildly by not being able to immediately pivot to another host. The attacker has to start backover at ground-0 on the pivot. Your security operations should catch them by then if they're monitoring for commands that shouldn't normally be running outside of a scheduled change window. It's not a lot of time, but enough to detect the service accounts abnormal behaviors of running various commands it wouldn't normally.

If you're just looking for a basic set of instructions on how to start basic hardening work in Windows. You may want to take a deep-dive and experiment with an Isolated Dev box for Windows until you have your hardening down. Just setup IIS with a basic "Web shell" and lock it down until your web shell is almost useless. You can google "ASP Webshell" and it will give you some code to test in IIS. Then remove the webshell from the system entirely! <- very important for obvious reasons!

Keep tuning your hardening until you're ready to make your production setup run and make sure you take lots of notes. I'm sure there are guides out there and MSDN has a lot of resources to assist.

IIS Service Accounts MSDN Link
IIS Application Pool Identities MSDN Link
CIS IIS Hardening Benchmarks CIS Security Link

Basic overview of what you'll be doing... this is mostly ran off of memory of essential basics, please check out hardening guides from CIS for more fine-grained policy recommendations.

Create a functional account
Remove User rights to that account
Preferably on-board that account into a password solution like CyberArk
Create a security group for "Run as a Service" rights
Open SecPol and remove all rights to Run as a Service except your new security group
Add that functional account to that security group
Restrict that security group from a lot of basic user functions other than minimum requirements
Configure IIS and the Application Pool services to run on these restricted accounts and never trust the app to run with "network services" because an attacker could potentially use "Network Services" to reconfigure a Service and elevate to "System" level privileges if is successful.
Ensure that this system is not trusted or a delegate for any AD Privileges.
Harden the file system from that service account and only allow it access to the minimum amount of data required to operate. (.Net Libraries as needed, IIS logging, etc.)


Did Skype give me a MBR virus? So here's the deal, I could never login on my desktop to skype for business. Since I am an microsoft 365 admin, I issued a ticket and waited for someone to call me to help me login. He remotely logged in to my computer was able to view my screen. After about thirty minutes of changing different settings on the admin page and clearing the Lync cache, I was instructed to download skype for business basic on my computer through the 'install apps' portal on office 365 admin portal. I already had office 365 installed and skype installed through
my school account, so when testing I was simplying logging out and logging back in. After the install of skype for basic was complete (for my account I could not log into) I tried logging in and nothing. We tried troubleshooting and nothing. Finally I suggested that I try on my mobile device, and I got an interesting pop up message after being able to successfully login (note we had tried on desktop about 8 times and I reset my password). Here is the message I received:  I knew that something was wrong with this certificate so I emailed to my self from my phone and showed him on my screen. He then told me that this is nothing like he has seen before and since this certificate was not issued by godaddy or microsoft he couldn't do anything about it. He then told me to hit the continue button and try to login. After doing so I was finally able to login successfully on my mobile phone and on my desktop. I still felt like I messed up big time by accepting a Fake certificate. After the call was finished I ran a couple scans, both on my desktop and on my phone and something came up.

C:\Users\Downloads\setupskypeforbusinessentryretail.x64.en-us_.exe ... is Suspicious !!!

Apparently McAfee GetSusp found it as a Boot Sector Virus. I then checked the time stamp of when I downloaded and it was during the call, the same time he told me download skype for business basic. I also ran another scan and this came up under a MBR scan:  Here are the VirusTotal results:

MD5 676846aea84c661c7bc62d8bdac7eb29
SHA-1   fbe8bef191dc31c73e4a5a50ba42f3b0d4e01dc3
SHA-256 7f60396d152b58215d2f677656f0ef0887f9fa6645c34d503c5f0efd18d84e55
Authentihash    ac082088fcead28338527fb6c961c78445c6ef14dd9c08793a6f30fe51af7f7a
Imphash 2e6b765f5c8cfe7892bc03c3c50ab319
File Type   Win32 EXE
Magic   PE32+ executable for MS Windows (GUI) Mono/.Net assembly
SSDeep  49152:ZVa6fmdbtYpIJBDV8/hSvTOHPjb44K8brLgLF3Q9QCa1BLk2Hyus5+iIe2tk9QMz:S0kSfyF87t+7PMr2FwY2sM
TRiD    Win64 Executable (generic) (87.3%)
Generic Win/DOS Executable (6.3%)
DOS Executable Generic (6.3%)
File Size   6.85 MB

File Names:
setupskypeforbusinessentryretail.x64.en-us_.exe
Bootstrapper.exe

So did Microsoft give me a MBR Virus or did I fall for a man in the middle attack on my mobile?

The screenshot you presented is, without doubt (okay: excluding a prank app installed by an evil room-mate), a classic sign of a Man-in-the-Middle attack.

Despite the name, it's not necessarily hostile activity, or even bad. Some antiviruses have to routinely MitM their clients to be able to scan HTTPS flow (as well as decoding MIME attachments and expanding ZIP files; but those activities usually go unnoticed). You definitely want to be "MitM'ed" by your antivirus!

Several proxies, firewalls, load balancers and security apps do the same, to their networks' benefit rather than for your sake. That's still not hostile activity.

So - what really happened to you, this time?

The warning

On the "hostile" side of the question we have the fact that we don't know who is it that is unpacking/repacking the flow. Normally, you should be aware of protections that you own, or otherwise avail yourself of. They should go at reasonable lengths to make themselves known to you and reduce the chances of a mistake or misrepresentation (e.g. through error messages and popups exactly like the one you saw). This did not happen.

On the "friendly" side, there is the fact - not that it's good news - that the operation was sloppy in the extreme, writing "FAKE" in SSL fields and using a certificate that's been out of date for two years. It's almost as if the 'attacker' wanted to be detected. This scenario is common in poorly or carelessly maintained softwares (I could name a ministry where they replaced the certificates with last year's archived ones, so that until last Friday a certain website was expired on January 2nd, 2017 instead of expiring on January 2nd, 2019; the fact that this happened to you near the turn of the year might be relevant - or not), but also in hardware.

It is also conceivable (and too frequently seen) in hacked access points and routers, where sites such as windowsupdate.com, apple.com or antivirus sites or identity-querying sites (GMail, etc.) can be redirected to personal-data-grabbing or Trojan-supplying sites. You think you're updating your video card, instead you're installing a ransomware or a zombie kit. Your credit card details do not go just where you think they're going. This is done by breaking into vulnerable hardware through external access or cross-site scripting attacks (think  inside an advert banner: evil.site.com will then try to access your IP after a few seconds and see whether it succeeds. If it does, they pwn your ass).

But if this had happened, the broken-into appliance would stay broken into; what happened once would keep happening (and they wouldn't have been so sloppy).

This would be plausible if you'd unpacked an old router from the basement storage and plugged it in, complete with the hack you hadn't noticed when you thought the router had just given up the ghost two years ago.

The file

The binary file could have been deemed suspicious, but the VirusTotal upload was legit (i.e., you haven't uploaded it to a fake VT site pretending that the file was clean when it wasn't), the file is digitally signed and the sign checks out, so we can dismiss this data point as "McAfee false positive".

My current conclusions

We're left with what looks to me as a very low suspicion situation; I'd face it with heightened awareness and being more careful than normal for a few days, to see whether other strange things happen.

(Keep in mind that little strange things happen all the time, so it's important not to see the hand of Dr. Evil behind every network lag or broken image).

I don't think that the situation warrants replacing the firmware or the motherboard or similar extreme resorts.

BadBIOS

You may have found out that the "BadBIOS scare" is now thought by several researchers[who?] to have likely been little more than a series of coincidences - or, who knows, maybe even pranks, or attempts to get him to discredit himself - over which Ruiu, the only researcher to have been "hit" by BadBIOS, built an edifice of suspicions.

(If you think this has never happened to reputable researchers or even scientists, think again. I do not feel this event reflects badly on Ruiu at all).

So... with this new "definition" of BadBIOS - "something that makes you suspect that your BIOS has gone bad on you" - yes, you were hit by BadBIOS :-)


Why do people say that PHP is inherently insecure? I've heard it said that PHP is inherently insecure. Is this true? Why?

It is pretty hard for a language to be "inherently insecure" by my definition, since a good programmer can adapt.  But PHP started out leaving a lot of minefields lying around for novices.

The initial versions of PHP paid little attention to security and the design had some big flaws.  Security is hard to retrofit into the core software and into the libraries.  Security training is hard in the best of circumstances, and even more so when a large subset of the developers are inexperienced and started off with bad defaults.

For example, it wasn't until version 4.2.0 that register_globals was disabled by default, so data received over the network was not inserted directly into the global namespace anymore.   This feature is finally slated for complete removal in the next version.

The early release of PHP and the ease of deploying simple PHP applications also attracted many developers with little security awareness, and ensured a large number of applications, a significant number of which had remotely exploitable vulnerabilities.  The size and vulnerability of the deployed base also attracted a lot of interest from the exploit community.

Here are some references and useful links

PHP Insecurity - Technology Review
How secure is PHP? - Stack Overflow
References on "inherently insecure": http://www.sitepoint.com/forums/showthread.php?threadid=112694
PHP Security Consortium
http://en.wikipedia.org/wiki/PHP#Security


Why does our network firewall drop netbios-ns packets? In our local domain environment, we use Sophos UTM to protect our network.

When I check the firewall logs, I can see that a huge number of packets dropped by the firewall are netbios-ns (UDP 137) broadcasts. Checking for more details reveals that these blocked packets were all generated by one of DCs.

My questions are:

How to deal with this?
Why are all generated by only one of our DNS servers and not the other two (we have 3 DNS servers)?

I would really like to know if it is safe to disable NetBIOS as DNS is supposed to serve the purpose.

Generally it is a good idea to disable bot NBNS and LLMNR. This is due to the fact that both protocols perform name resolution through either broadcast (NBNS) or multicast (LLMNR) which is not safe.

For an attacker its possible to perform a MitM Attack using spoofed answers. When you have WPAD disabled there is a wider attack surface. WPAD is the Web Proxy Autodiscovery Protocol which is used by Chrome and Internet Explorer to automaticly receive a Proxy configuration. This can be used to MitM all web based traffic from Chrome and Internet Explorer users. When it comes to the Internet Explorer there is a particular critial problem. The Internet Explorer will send your credentials via NTLMv2 to the attacker if the WPAD service he is providing is aking for it. There is a well implemented tool to perform these attacks which is called Responder.

In a modern environment you can disable both without facing any problems. When you have mac clients you should also disable MDNS which is apples equivalent of LLMNR.


What is the best material for building an web application firewall? I am a newbie in this field, and want to study more about Web Application Firewall. Could anyone tell me any materials or tutorials that I can refer in order to write (build) a Web Application Firewall from scratch?

I am planning to build a WAF which can prevent already-known maliciousnesses such as: SQL injection, XSS ATTACK, ect... at the same time, can study normal users over a period of time, and later prevent anomolies base on the learned data.

It depends on what are you looking for and your scope.
As a newbie, you can try already existing ones as:

OWASP ModSecurity Core Rule Set (CRS)
Baracuda
AQTRONIX WebKnight
IronBee

or whatever you like.
Here you can find some suggestions:
http://linuxbsdos.com/2011/12/06/3-application-level-firewalls-for-linux-distributions/


Effect of FDE for data recovery Assume that I fully encrypt an unused USB (FDE), then format it and copy plaintext files. If the files are deleted from USB by using a secure wipe, does FDE that was first applied decrease the possibility of recovering files?

Not really, no.

I'm reading this version of the question as

  I fully encrypt an unused USB (FDE), then format it

equivalent to randomize then format. Then

  files are deleted from USB by using a secure wipe

boils down to simply how good your secure wipe functions. The past history of the media can make manual examination a little bit more difficult as zeroes are easier to filter out than random. But the bottom line is still how well your secure wipe functions.


Security controls to implement on a private environment On a large project, my company is responsible of administering the internal servers where applications used within the intranet are installed. One of our sites are accessible from outside but we do not manage such redirection, another company is tasked to manage the network. Every seat has a laptop running W7 with no restriction at all, that's it, admin user by default. External people can't access the building, we have ID and fingerprint scanners.

I'm trying to "create" a security specific role. I'm new in this company but I'm the only one interested in security here.

So far I've analyzed passwords (every basic password principle is violated lol!), accounts management on servers (disable LDAP accounts when someone leaves, set expirity of temp accounts), privacy issues (webcam, logged sessions when leaving), clean desk policy (although as external people can't access, I'm not sure whether this is going to have any effect) and least privilege (limit access to some resources, admin and user accounts on laptops, prohibit the use of USB sticks).

According to all the stated above, what other security controls could I implement?

ISO/IEC 27002 lists 114 security controls they feel everyone should at least consider, but I wouldn't recommend starting there; you need to do a risk assessment first so you know what you have to control.

Don't start with a list of controls, otherwise you'll make a horrible mistake like assuming fingerprints readers mean external people can't access your building.

(Who cleans the kitchen? Who fixes the toilet when it breaks? Who delivers parcels? Who checks your smoke alarms? Who would your lowest paid employee let in if I gave them $5,000? Who would your highest paid employee let in if I threatened to tell his wife?)


Router infecting my computers? I received a new router from Verizon. A month or so after my PC couldn't get the Internet consistently. It started doing crazy things around the wireless issue. So I had it professionally cleaned twice. Installed all the best virus protection. Finally took it in to Geek squad who says they found 356 virus'

During this time I buy another ( open box but supposed clean and antivirus installed) PC. Within 1 day the new PC has wireless Internet problems. So I call geek squad and watch for 4 hours remotely while they removed the installed virus protection. They find a bunch of threats and viruses. Cleaned it up and reinstalled virus protection.

Next day no Internet. My apple products are fine. So desperate I use my ATT hot spot from my phone instead of the Verizon wireless connection- no problem!

Verizon insists that I don't know what I am talking about and has been extremely difficult.

Now I am bringing my cleaned computer home and don't know what to do. I can't keep paying people to clean it. I am returning the open box one for a new one but then what?

Thank you for bearing with me on this

Can you assist?

A compromised router (which is just another computer that happens to be on the network path between your other computers and the Internet) can attack hosts and compromise them. It can also redirect your HTTP (not HTTPS) requests to malicious websites in an attempt to fool you into installing malware. However, I would be really surprised that it could compromise a brand new, up to date Windows machine assuming the user wasn't an idiot and didn't intentionally execute the crap served from the malicious websites it redirected to. I'm not saying it's not possible - there is always a risk of a zero-day vulnerability (which would work silently without any user intervention), but nobody is going to "waste" a valuable zero day on you unless you're a really valuable target (and then they'll do a better job at silently compromising you rather than alerting you because your Internet doesn't work).

I'm actually sure your problems aren't caused by malware, but given that both PCs seem to have malware (at least according to the so-called "technicians") it looks like both computers continuously compromise each other so it's time for a proper solution.

Stop paying incompetent people for installing useless "best virus protection" (there is no such thing, antivirus evasion is trivial and the best antivirus is you) on an already compromised machine. Follow the usual procedure for dealing with compromised hosts : from a known clean machine (friend's PC, etc), download the ISO corresponding to the Windows version on your computer - pirate sites are a good source for them but make sure to verify the hashes against the official hashes published on MSDN to make sure you didn't get a compromised version. Now burn that on a disc, bring it home, disconnect your computers from any network (Ethernet disconnected and Wi-Fi switch set to "off"), boot from the disc, nuke everything and reinstall. Do the same for all machines on your network, then reset your router, connect the machines to it and only let them install updates - don't browse the Internet just in case your router redirects to malicious websites that would exploit the still unpatched Windows. Once it's up to date, if you still see weird stuff like redirections to malicious pages (sometimes full of nasty ads like porn), return the compromised router to your ISP and invest in a better one that has at least a somewhat decent firmware.

Note that you should never trust the "Refresh My PC" feature nor the built-in recovery partition for reinstalling a compromised machine - writing to that partition is trivial and malware can easily use it to persist.


How are DNS requests sent when using OpenVPN? Are they encrypted? I use OpenVPN through the gnome network manager. When my computer is connected to the VPN, do the DNS requests goes through the VPN IP or from my real IP?

Are the DNS requests sent in the same encrypted tunnel as the rest of my traffic or could someone with network level access read them?

In a default configuration, all traffic (including DNS) should be routed through an OpenVPN tunnel.

However OpenVPN in itself does not provide mechanisms to enforce all traffic being routed via its tunnel and if an application or the operating system decides to route traffic via unencrypted interface, it is free to do so (as was the case with Windows 10 Smart Multi-Homed Name Resolution).

As for your intention—protection against snooping on DNS queries by ISPs—you would be better off by configuring and using dnsmasq with DNScrypt even for your non-VPN connections.

By adding an outbound firewall (e.g. iptables in Linux) rules to block all DNS traffic you could ensure that even in case of OpenVPN failure or misconfiguration, you would get a fallback to an encrypted DNS channel (or no connection at all because of FW).


How Empathy - a messaging program, is storing my passwords I am connected to my chat accounts via Empathy, a messaging program, and it has my password stored in it.
I am really curious to know how it is storing the passwords, and if there is any they can retrieved back in plain text?

As far as I know, Empathy is using the system's password storage capabilities (GNOME Keyring, KWallet etc.) to store the passwords for your accounts, so you may have to look into specifically how these tools operate. Which of them is actually used depends on what operating system and desktop environment you're running on.


Is my Company Tracking Me? Every time I try to connect to a site through HTTPS from my office computer, there is a Certificate Error thrown 2-3 times before showing the login screen. Till now I use to ignore this and click continue. But recently one of my collegue told me the possiblility of Man in the middle attack.

All I want to ask is, is it possible for them to track my passwords or account details by such method?

UPDATE: They are replacing the Certificate. For now, I activated 2-factor auth in Google.

Yes. Certificates are basically a public key with information about the owner attached to it. They can be signed by an certification authority to confirm that the owner information is correct. There are a number of certification authorities already present in your browser.

You get the warning if the certificate, the server shows you, is not signed by a certification authority, your browser trusts (or is invalid for other reasons).

A man in the middle will trick you to accept his own public key as server key, so that he can use his private key to decrypt everything you send to him. He will then re-encrypt the information and pass it on to the real server.

There are out of the box security solutions, that work this way to scan the https traffic for virus and sites that do not comply with the company guidelines of acceptable use. They dynamically generate keys for the servers you want to talk to and sign them with their own certification authority.

In most cases the administrator will install the certificate of the company certification authority as trusted on all company computers, so that there will be no warning.

Paying attention to the names of the certification authorities in the chain of trust is likely to reveal such systems, unless the administrator put a lot of effort into hiding it by creating different local CAs with matching names.

There are more details at Can my company see what https sites i went to?


Does Mozilla's new "Facebook Container" have any advantages over uBlock Origin? Yesterday Mozilla launched a new Firefox plugin called Facebook Container:

This makes it harder for Facebook to track your activity on other websites via third-party cookies.
[…]
When you install this extension it will delete your Facebook cookies and log you out of Facebook. The next time you visit Facebook it will open in a new blue-colored browser tab (aka “container tab”). In that tab you can login to Facebook and use it like you normally would. If you click on a non-Facebook link or navigate to a non-Facebook website in the URL bar, these pages will load outside of the container.

I am generally concerned about sites tracking my online activity, and I'm already using uBlock Origin with its EasyPrivacy list - which seems to block the Share buttons, cookies, and various other features. I've also used Ghostery for the same reason. Of course, these tools also block countless other sites, most of them I don't even know (though I'm sure they know me...)
Are there any benefits for using Facebook Container, or the more general Multi-Account Containers if I'm already blocking these sites?

To understand the differences, we have to look at the different goals of the two.
Or in other words: What do they want to do? What do they do? And how does it affect you as an end user?
In this answer I will speak of Firefox's Multi Account Containers and Firefox's Facebook Container as pretty much the same thing, because - as far as I understand it - technologically they are.

What do they want to do?
uBlock
The creators of uBlock tell us here:

uBlock Origin (or uBlock₀) is not an ad blocker; it's a general-purpose blocker. [...] Ads, "unintrusive" or not, are just the visible portions of privacy-invading apparatus entering your browser when you visit most sites nowadays. uBlock₀'s main goal is to help users neutralize such privacy-invading apparatus — in a way that welcomes those users who don't wish to use more technical, involved means [...].

Their emphasis
Firefox Containers
Firefox says this about their addons:

Firefox Multi-Account Containers lets you keep parts of your online life separated into color-coded tabs that preserve your privacy.

and

Rather than stop using a service you find valuable, we think you should have tools to limit what data others can obtain.

This sounds very similar, but the differences are in the details.
uBlock is focused on privacy on a broad scale and users sometimes have to hazard the consequences -> buttons can stop functioning, sites can break etc.
The Firefox extensions are the parent-version of a neat tool to ensure some privacy. You can still use all services. There can be some collateral damage, but rarely for the typical user. And it's all color-coded, weeeee!

What do they do?
uBlock
uBlock Origin blocks these three types of annoyances: ads, trackers and sometimes malware sites, but can do a lot more. It has a pretty wide range for such a lean tool, but you have to be somewhat experienced to make use of the more interesting options like medium and hard mode. And if you do, sites will regularly start to break if you browse like most of the regular internet users.
If you take a look at the documentation I linked to, you will see what uBlock can do "under the hood".
Note: a lot of blocking by uBlock requires filter lists. The maintenance of theses lists is very difficult and tiresome and is done by a lot of nice people on the interwebz. Because they do it for free, sometimes trackers will not get blocked, because they are not on the list you are using. IMO that is not all too problematic, because the problem you as a user have stems from forming profiles, not from creating single points of information. If the contributors update the lists properly and you regularly update your filter list it is likely that the next time you visit a site with that tracker, it will not track you.
Firefox Containers
In the description of Firefox Multi-Account Containers, we find the following:

Each Container stores cookies separately, so you can log into the same site with different accounts and online trackers can’t easily connect the browsing.

and under the description for Facebook Container

What does Facebook Container NOT protect against?
This extension focuses on limiting Facebook tracking, but other ad networks may try to correlate your Facebook activities with your regular browsing. [...]

The big thing we can note: Firefox Multi-Account Containers neither block ads nor trackers. But this isn't what they were built for. They were built for separation or containerization. A lot of data is accesible for sites you visit across tabs - for instance: cookies.
Containered tabs - this is what we are looking at here - prevent this.

How does it affect you as an end user?
You can easily use both addons. I would definitely recommend uBlock (go for the hard mode). There are some restrictions that containerization brings to the table that can be helpful. I am not too knowledgeable about the inner workings of it though.
Conclusion: The two addons are very different, but that is very much okay, because they have different goals and I would say different audiences with different privacy needs.


What's the difference between using HSTS and doing a 301 redirection? If I already have done a 301 redirection from all the HTTP inner pages to HTTPS, why should I use HSTS as well?

Let's look at the scenario with a 301 redirect first. The victim sends a request to http://example.com (as pointed out in comments, this could because of SSLStrip or because the user just entered example.com in the URL bar and browsers default to HTTP). If there is no MitM attack they get a 301 response back, and is redirected to https://example.com. But if there is a MitM, the attacker can just choose not to send the 301, but instead serve a (possibly modified) copy of the site over HTTP.

The weak point here is that an initial HTTP connection (without TLS) is made, and the attacker can modify that traffic. However, if you had used HSTS the browser would know (assuming that the victim had visited the site previously) that the page should always be served over HTTPS - no HTTP request would ever have been sent, and the browser would just send a request to https://example.com. The attacker cannot MitM the TLS connection, so the attack is prevented.

(The fact that browsers cache 301 responses makes this a bit more complicated in practise. For more info on that, see bonsaiviking's great answer or this question. The short story is that the 301 being cached might help a bit, but not take you all the way that HSTS does.)


Invoke an antimalware scanner from code on azure Roles We have a requirement to scan uploaded images via azure services.

I found that Azure has a free out of the box solution
http://azure.microsoft.com/en-us/support/legal/endpoint-protection/

However simply enabling anti malware is not enough for our scenario.

There are more than one WebRole that can upload images.
and also some files may end up in the system via different channels

ex.

An business entity has a property ImageUrl. Url points somewhere in
the internet, blob storage or any other cdn.
If the object has some updated info, it's entered in a queue for further processing
There is a job that process the image URL, downloads it and does some work. then finally it will be used by any company system.

We thought that because all images will go through "Image processing job" before downloading and processing we should check for viruses. if the virus is found then fail the job with corresponding error and move to the next image.

I could not find how to invoke azure anti malware from source code anyway of getting realtime feedback from the virus scanner.

You are going to be fighting somewhat of an uphill battle to implement this the way you want to. For whatever reason, local anti-virus systems typically do not give an API for such interactions. I will give a few options:

1) Scan your files on a storage server after they have been uploaded. Then, check back later to see if the AV has zapped them.

pros: Easy to implement.
cons: Malware may make it deeper into your back end.

2)Use an open source AV solution such as clamAV, and look for a language binding that will do what you need it to do.
pros: Allows you to check on the results of the scans when you want to in the process.
cons: Open source. Potentially buggy.

3)Pay a large AV vendor to modify their solution to your needs.
pros: Will do whatever you pay the AV guys to make it do.
cons: Very expensive.

4)hash the file, and query a public AV provider like virus total.
pros: Cheap and easy.
cons: May fail to find custom malware, or malware that is new. Slight loss on the privacy front.

5)Upload the file to a public AV prover like virus total
pros: Cheap, easy, and effective. More likely to find custom malware via heuristics.
cons: Much bigger privacy loss for your customers.

6)Pay for an external service to hash/scan your files that you communicate with via API, and promises secrecy.
pros: works pretty well.
cons: Expensive. Promises of secrecy doesn't obviate privacy issues.


Is there a good site I can use to convert a string into any encoding? I am working on a ctf (capture the flag) challenge and I have a string that I believe is important, but I don't know what encoding it is in.  Is there a way I can decode the string in all of the larger encodings used? For example base64, rot13, html, url, ect..

You can use CyberChef. It allows you to try out a lot of encodings, compression, etc and you can chain them together. Can run in the web or you can clone your own copy.


Does restarting an encrypted session increase security and deter attacks? When a user initiates a SSH connection for example, keys are exchanged and a session is established with a new "passphrase" each time. If an attacker were to attempt to brute force this connection, their chances of cracking the "passphrase" would be much higher if the connection persisted for a long period of time right? If this is true, wouldn't it make sense for secure connections such as OpenVPN, SSH, and SSL/TLS to "reboot" the connection, thus generating a new "passphrase" between the two hosts and foil the brute force attack? If this is true, has it been implemented already?

It is implemented. Look for 'session re-keying'.


What do speculative execution patches protect me from? There are a barrage of patches coming out, both at the application and OS levels for the recently disclosed speculative execution attacks against various vulnerabilities in CPUs from AMD, ARM, and Intel.

I don't fully understand the attacks nor am I seeking a full breakdown of them. What I want to know is what each category of patches that are coming out buys me.

For example, if I am on a Windows OS, running Firefox and Chrome, where the OS is patched, but not any of the browsers, what does that buy me? Is speculative execution to read kernel memory via javascript still possible in that case?

Other then the browser vector, and OS, are there any other obvious risks for end users? I've read of patching for various other software, but I'm confused why other (non browser) software is really relevant here.

As a bonus, I've read that Mozilla and Microsoft have temporarily mitigated the attack via browser, by purposely making some the javascript timing mechanisms inaccurate/less-precise. Isn't it theoretically possible to bundle your own time measuring libraries to bypass that?

I'll bite...

Firstly let's handle meltdown (Google: P3). As you probably know, your system has multiple privilege levels for code known on Intel/x86 as ring 0 (supervisor code) and ring 3 (user mode), which are the CPL bitfield choices in your segment selectors. Code is either running using one segment selector or the other (the selectors cover the whole address space) and this determines what privilege the code can execute with.

In parallel, there is virtual memory, controlled by page tables in the CR3 register. Paging allows for a virtual address space of a certain size regardless of the actual amount of backing storage (physical memory) and allows operating system developers to do things like write pages to swap (windows: pagefile) to evict them when tasks are using memory, but have not accessed it for some time and physical RAM is in demand. Page tables also have a user bit, which controls whether code can be seen by code executing at cpl 3. If the bit is set, user mode code can see the page, otherwise not.

Now there are two key points to understand. Firstly, on x86 (and many other architectures), hardware level tasking does not exist. A process, then, (linux task, windows process) is entirely a concept in software. This works by allocating each process its own virtual address space and when processes switch, the relevant pages are switched, "plugging in" the new process into the virtual address space and removing the old one (or unmapping it, even if not evicted from physical RAM) temporarily.

The second thing to understand is that this is a relatively expensive processes, so operating system designers came up with a "higher half kernel": in each process' address space, the kernel is mapped into the higher half of memory completely. This brings us an important advantage: if the kernel needs to handle an interrupt, or perform some IO, we can jump into the kernel space via a system call or interrupt handler and we don't need to switch address spaces of the process. If the task doesn't require us to switch address spaces for any other reason (this is slightly different to a context switch, which is the save of register state, which we can still avoid using the higher half design in some cases) this is nice and efficient: the kernel does its work and returns to user mode as fast as possible.

Unfortunately it turns out that speculative execution occurs across privilege levels on Intel CPUs, specifically that code running as CPL 3 can speculatively load pages with a cleared user bit (so, supervisor/ring 0-2 only). Meltdown exploits this by referencing memory from the higher half on a page-by-page basis through instructions that are only executed speculatively. However, the processor pulls those pages into the higher caches, resulting in a cache based timing side channel.

KPTI and equivalent patches in macOS and Windows protect against this by not using a higher half design. Only the bare minimum needed to enter the kernel address space is mapped into every process; the rest of the kernel lives in its own virtual address space like a separate process. This has two main effects:

Any entry to the kernel implies a switch of address spaces. This is more expensive than the higher half design, hence the quotes of a 5%-30% slowdown. The reason for the "it depends on your workload" explanations is because it does depend on how many times you need to enter the kernel.
However, now, there is only a small amount of kernel space left in the same virtual address space as the process and most of it is an uninteresting interrupt handler. You can leak it, but, it's a smaller target and its location can be randomized as well. There's simply no valid references any more to things like disk encryption keys and so on, as they exist in a separate virtual address space, which requires a switch to the kernel process first.

This is obviously bad news. The same issue issue can occur for some kinds of hypervisor designs. Containers are a kernel construct entirely and thus are affected, just like processes.

Spectre (Google: P1, P2) works similarly, except it allows the attacker to induce a target to perform some kind of speculative execution in its address space and leak that via a side channel. A critical difference from the Spectre paper is:

  Spectre attacks only assume that speculatively executed instructions
  can read from memory that the victim
  process could access normally, e.g., without triggering a
  page fault or exception. For example, if a processor prevents speculative execution of instructions in user processes from accessing kernel memory,
  the attack will still work. [12]. As a result, Spectre is orthogonal to Meltdown [27]

In other words, you cannot use Spectre to read kernel memory from an unprivilged process directly - or any memory in a higher privilege level.

In order to fix these issues there are a number of possible resolutions:

XEN XSA-254's FAQ suggests that Intel, AMD etc are preparing microcode updates that will flush branch prediction logic on entry to the hypervisor, to ensure any attempt at poisoning across this boundary is removed.
It also mentions (and this applies elsewhere) applying indirect jumps in code, in such a way that speculative execution does not occur. This defence is to effectively defeat the CPU's optimizer and requires that the software in question is recompiled. It is this defence that is being added to GCC, Clang as mentioned in other answers.

Now, to answer the actual questions you asked:

  For example, if I am on a Windows OS, running Firefox and Chrome, where the OS is patched, but not any of the browsers, what does that buy me? Is speculative execution to read kernel memory via javascript still possible in that case?

If you have the KPTI patch series or equivalent, the answer is no, you cannot. Or more precisely, you can, but you can only find uninteresting things like kernel code for switching address spaces.

  As a bonus, I've read that Mozilla and Microsoft have temporarily mitigated the attack via browser, by purposely making some the javascript timing mechanisms inaccurate/less-precise. Isn't it theoretically possible to bundle your own time measuring libraries to bypass that?

Theoretically, if a method of measurement exists that is accurate to the required degree in browsers already, yes. However, bundling your own measurement essentially requires extending the browser. It isn't as simple as loading some javascript as, underneath, javascript in the browser is using entirely browser-provided APIs. So theoretically, if there is some code path that allows measurement that has not been closed off, yes, otherwise, no.

I would go with no for all practical purposes, as a result.

Summary:

KPTI series patches explicitly protect against Meltdown, i.e. full kernel address space reads, on Intel CPUs.
Spectre is harder to protect against as this allows for the same speculative execution, but targeting a different victim process across address spaces. KPTI does not fix it. Individual software packages must deploy mitigations. By contrast, Spectre cannot cross the ring 3-ring 0 privilege boundary (but I believe it can across ring 0 - ring 0 (or "-1" the hypervisor) and hence the Xen comments.


Confusing definitions of "parasitic virus" and "worm" I was studying for CISSP certification when I came across the question "what type of virus attaches itself to an executable?" The answer was "parasitic". I find terms relating to viruses and malware to be a bit confusing.

I thought all viruses modified executable files, as a method of spreading. That is they injected their viral code into an exe so that it ran the next time the file was run, and then returned the flow of execution to the original portion of the program.

And that a worm was a standalone program that had a method of spreading (e.g. copying to network shares, mass mailing etc.)

Am I confused? Is it that a virus is can be a standalone executable, and if it modifies other executable it would be known as a "parasitic" and that if it had more extensive methods to spread it would be considered a worm?

I mean, isn't a parasitic virus a contradictory statement because it's spreading, but a virus that spreads is a worm?

The difference between a virus and worm can be confusing. Both are self-replicating computer programs, but while a virus needs human interaction to propagate, a worm is standalone and can replicate on its own (usually exploiting security holes in computer systems). For example, a virus might replicate by sending itself as an attachment in an email and trick the user into opening it, but a worm might exploit a vulnerability (like EternalBlue) to gain access to systems.


Can I realistically rely on a proprietary password manager? I've always wanted to try some sort of Password Manager. There are many paid options for private/closed-source software.

Realistically speaking, is it possible for me to actually trust those services/software? The simplest conclusion I have come to is, no of course not: you can't tell how the app works, you don't know what data is sent to their servers (some services sync among multiple computers), and just because they have plenty of customers doesn't mean that they are trustworthy.

And yet, there are lots of those services/apps, which makes me wonder if I am missing an important point: am I being mistakenly paranoid? Under what basis can I trust said solutions?

Examples include Dashlane and 1Password.

In the end this always comes to trust: you must trust that the program is doing what it's saying, and you should pick a company you are willing to trust. Keep in mind that a password manager is not by all means the only software you trust nor the only software that could steal or leak your passwords. Or you could accidentally paste the password to a fake web site. Or something could be monitoring your keyboard or clipboard. This level of paranoia would require ruling all these possibilities out, too.

Just like Troy Hunt reasons in Password managers don't have to be perfect, they just have to be better than not having one. I also like how this article points out that a paper copy kept in a safe place has less possible attackers than anything saved on a computer.

  Password managers are a good thing. Even when issues like the LastPass
  one above are found, they're still far superior to our frail human
  brains when it comes to your overall security posture. Until such time
  as that changes and either they're worse due to a flaw that actually
  causes some serious damage or we create something better again, this
  is where the game is at. Less sensationalism, more pragmatism.

How to pick a password manager you could trust?

The most paranoid options:

Create one by yourself. It's a hard thing to code a password manager from scratch, but it could be combined from other tools. This has a limit that you must trust them all. To fulfill all the general functionality of a commercial password manager you need:

A tool that creates (truly) random passwords.
A tool for encryption: you could store them as files in a VeraCrypt disk.
A tool that can be automated to securely sync the encrypted version between your devices, e.g. Rsync. The less you trust the encryption the more you need to secure the communication: you could e.g. do this only on your LAN.

Only use an offline password manager that doesn't communicate over the network at all. Update it manually and block its access to the Internet. If you need to have the passwords synced across multiple devices, see where the database is located and sync it with an external tool you can trust.

If you can loosen your tin foil hat a little, take a look at the described functionality of the password manager you are planning to buy. If it stores the passwords unencrypted on a cloud (or does the unencyption on server-side), forget it. If it doesn't encrypt the password (like the ones built in the browser), forget it.

If the password manager encrypts the password locally and synchronizes the encrypted version, that's a lot more secure architecture. This should be your minimum requirement. To a certain extent you can check whether the program seems to work at described. The rest comes back to trust.

Many antivirus vendors have expanded to password managers. If you already trust a company that much to give them ultimate power over your operating system, it is not very practical to avoid trusting them in this matter, is it? Aviva Zacks has compared Kaspersky, Bitdefender and Norton. I'd add F-Secure, as their TOTAL solution now comes with a license for a password manager, KEY.

What if someone finds a vulnerability in my password manager?

You can estimate your risks by reading about the vulnerability and how it can affect you. If you don't have the expertise to estimate your risks or if you find yourself at risk, wait for them to fix it, update your password manager and then change your possibly compromised passwords. Or switch to another password manager.


Does knowledge of one or more passwords from my password manager help an attacker crack the master password? I use a keepass password manager with a master password of more than 100 bits.  I keep the password file in cloud storage.  If an attacker has my password file, it should be difficult for them to brute force the password.  Suppose that they have additionally cracked my password for one or more accounts that I have in my password manager, perhaps due to server-side security breaches.  Will this help them to crack the master password?

No, knowing one or multiple passwords doesn't compromise a master password, no matter if these known passwords are derived from the master password or have been generated by the application itself. Here is a nice answer about how hard it actually is to crack a Keepass master password.

As for the comments about Enigma: Enigma doesn't make use of any master password and has been cracked using other methods, see cryptanalysis of the Enigma.


Accessing user data by a public 'token' - is it a potential vunabilility? I joined a small project, I noticed that in the project uses something like a token associated with a user journey. So the URL looks something like: https://host.com/sell/:jurneyID.

All data entered during by the user in the journey are associated with the jurneyID including email, personal information and so on.

That means when I go to https://host.com/success/:jurneyID I can see user data related to that journey.

There is no concept of a session which means that anyone who knows jurneyID can access this data.

In theory jurneyID is long randomly unique string and expires after two weeks, however, I still don't like this solution because:

token string can be brute-forced
jurneyID is part of the URL therefore can be extracted from logs, browser history, etc.

I'd like to ask if you know any resources which can prove that this solution is a bad idea, and does such vulnerability has its name?

Token ids are a common tool. They originate into the 80's where the Kerberos protocol used a random token to identify a user for a period of time without requiring to give again a password.

The rationale is that only the legimate user should know the token, and that the duration of the token is short enough  to have it to expire before it will be captured. It is generally seen as a very long password with a rather short duration (between one day and a few months). So what is assumed that it is harder to steal than a normal password because the latter has to be easily memorized by its user, so it requires less protection and can sent along with the URL.

For the weaknessess you asked about:

brute forcing the token string - it is a large random string and a brute force attack on it would certainly be noticed before it has a chance to success, and the livetime of the token should make it expire before the attacker could exhaust the possible strings. In addition, incorrect token should occur scarcely, because they are normally sent by a machine with no risk for typos. So token errors should soon blacklist the attacking address, even for a small period of time making brute force attacks impossible
the token can be extracted from logs and browser history. Hmm... one of the security laws says that if an attacker can control your system, it is no longer (only) your system. One recommended counter measure is to educate the users to change their token as soon as they think that someone could have used their browser. For the log part, it only means that logs become sensitive data and that they should require administrative priviledges to be read. And it is useless to try to protect a system against its admin...

TL/DR: you are true by saying that using tokens enlarges the attack surface and for that only reason lower the overall security. For that reason, they should not be used for highly sensitive systems. Nevertheless, they are still commonly used and are generally seen as compatible with standard security requirements.


Why Can't Google Just Switch to Pushing Android Security Updates Directly to Users? Okay, I'll just begin with the question and then elaborate a bit below. It is:

Why has the world's dominant maker of non-Apple smartphone operating systems, Google, still not adopted a straight-to-the-user model of distributing security updates for Android, instead sticking with the current, obviously deeply flawed approach of relying on phone makers and wireless carriers to rapidly test, approve, and distribute them?  How substantial would the technical obstacles really be in moving Android to the direct-update model if Google genuinely wanted to do it?

So, some additional not-good news came out yesterday regarding the fun Stagefright set of media player-component security bugs in Android.  First, some newly-announced flaws in the same component appear to extend the scope of Android phones affected to virtually every one that's ever been made & sold. Second, there are apparently even more flaws in the same component that have been disclosed to Google and that are in the pipeline for public announcement soon, including some that will get a "critical" label. I'm not intimately familiar with the Android security scene, but this certainly seems like it's being held as the most important security event that Android has had to deal with so far.

Of course, the discovery of awful vulnerabilities, on any platform, always leads to the next question: "When is my device going to be patched?" Unfortunately, the way things work now with Android security updates--Google pushes them to hardware makers and carriers, who have to sign-off on off on them and be willing and to distribute the updates to users-- the vast majority of the 1 billion+ Android users can expect only one of two answers:

--For the lucky ones: it will be months. (This report, also linked above, quotes an estimate that it usually takes somewhere from 9-18 months for patches to get from Google to wind their way through testing and various approvals to a user's phone.  Now, one assumes that with Stagefright that will be hurried up to some degree, but still...)

--For the unlucky ones: never. (Some Android makers barely provide any post-sale update servicing at all for their phones. Others seem to have an unwritten support period limit of maybe a year, or perhaps two, after which the user is out in the cold.)

All of which raises the question: Why can't Google just do what companies who make operating systems for other computers do--PCs and servers--for example-- and bypass OEMs and service providers to deliver security updates straight to the user?

Now, obviously there are probably both technical aspects to this and business aspects to this.  I'm thinking more along the lines of technical aspects (though I admit that sometimes the two are less easy to separate from each other than one might think). In what ways could going to a process of Google directly issuing security updates--but not necessarily directly shipping any updates that involved anything beyond fixing security vulnerabilities--cause problems with hardware and/or software compatibility that could be so troublesome enough for users, phone makers, carriers, and Google itself that that factor could outweigh the value of getting these patches out much more quickly and far, far more widely than they are likely to under the present system? Or is it really a slam  dunk in favor of Google going to direct distribution, as 99% of security news reporters & commentators seem to think?

The crux of the problem is that with only a few notable exceptions, every phone ships with a fork of Android, not with the software written by Google. So Google can't push changes to Samsung's phones any more than FreeBSD can push changes to Apple's Macbooks.

Android is Open Source, which is a bit unusual. This is the first time a major consumer operating system with this size of userbase (1.4 billion users and growing fast) has been an open source project rather than a centrally-controlled one. We're used to the idea of the creator of the OS being able to take responsibility for updating it. And as evidenced by this question, we somehow expect Google to be able to control Android the same way Microsoft controls Windows and Apple controls iOS.

But by allowing companies like Samsung and Sony and Motorola to ship their own modified version of Android, Google gives up that control in a way that they can't get it back. Samsung then takes over not only control of their own flavor of Android, but also responsibility for keeping it updated. And by allowing Verizon to fork Samsung's version, Samsung then sheds both control and responsibility now to Verizon.

Theoretically this all works; theoretically Verizon will be just as responsible and dependable as Google. Except when they're not.

So there's three possible solutions. Either:

Manufacturers could start taking more responsibility for their OSes. Since Samsung's Android belongs to Samsung, we get nowhere unless Samsung takes some initiative on keeping it updated. This may require some cooperation with companies like Verizon if Samsung has allowed them to fork the code as well. This is more or less that status quo, but with more wishful thinking.
Google could take back control of Android. By switching to a closed-source license, they could impose licensing restrictions like requiring companies like Samsung to push patches within a limited timeframe. Of course, if Google went this route, there'd be no end of shouts about how "evil" and "anti-consumer" they were being, despite the fact that they're literally the only major player that is Open Source to begin with. Politically this is probably a no-go.
Companies like Verizon and Samsung could voluntarily give control back to Google without being forced into it by a licensing agreement. This is the sort of utopia arrangement where companies decide to do the right thing out of their own free will. Until a few weeks ago, this was the least likely of the three. But since the stagefright mess, several companies have pledged to do more or less exactly this.

So we'll see where it goes in the coming months and years.


Add main user account to docker group I recently installed ubuntu on my home system. As I am going to mainly use it for machine learning research, I tried to set up a python environment. I tried doing this with docker to make things easier (interference with the pre-installed python), but I ran into some instructions that said to add the current user to a docker user group, making it roughly equivalent to a root user. Not knowing much about this subject, I want to ask, is doing this a big risk for a desktop that will only be used at home? The docker website itself does warn about some risks, but I'd like to know if this applies to my scenario.

Docker daemon run with root privileges, but containers running inside it, even those that you don't set the current user (USER command in your Dockerfile) will run with limited access.

You can also drop some capabilities to isolate those containers reducing the attack surface. And never run untrusted containers with the privileged.

If a container is running with root (inside the container), and you map some volume, it will have access as root. So this is another point to avoid.

Here an example docker run --rm -it -v '/:/mnt' debian:9.2 cat /mnt/etc/shadow, it will have full access to / as root, it means, it can infect binaries, have access to your /etc/shadow file, add/remove/change password of users, etc...

Here is the full reference: https://docs.docker.com/engine/security/security/#conclusions


Is it worth it to install the same web application on different kind of web servers in a vulnerability assessment? When doing a web vulnerability assessment with tools such as Acunetix and w3af, is it worth it to install the same web application on multiple types of web servers (Apache, IIS, etc.)?

If differences could be found, in the scanning results, between the different web servers, what type of different vulnerabilities could be found?  Also, please keep in mind that I am solely testing the web application; I'm not testing Apache, PHP, MySQL, etc.

This could be of benefit if customers buy your web application and then install it on a platform of their own and you need to make it secure despite the underlying OS and back-end architecture.

If the application has been properly put together and treats user input correctly in all places, then there should be no difference. If however, parts of the application will allow an MS SQL exploit to work whereas a MySQL one will fail, or a Windows exploit will work, however when hosted on Linux this is not possible, then there is benefit. Of course, you will not know this unless you assess vulnerabilities on these platforms either dynamically (using a scanner like you propose, plus manual testing) or statically (analysing source code both automatically and manually).

Having said that, most applications would tend to exhibit similar vulnerabilities no matter what platform they have been installed on, and would have to be coded in a unique way for it to be exploitable on one platform and not the other.


How does SSH defend against keystroke-timing attacks? This paper:

https://www.usenix.org/legacy/events/sec01/full_papers/song/song.pdf

Explains how SSH can be compromised by analyzing the timing of the keystrokes to guess what the user is typing. It's about 12 years old.

I heard that this attack vector was solved in SSH long ago by sending keystrokes at random intervals.

However, out of curiosity, I fired up Wireshark and started an SSH connection to a Debian host. I typed in characters slowly and saw that a packet is being sent for each character, but there are no other packets sent besides. Then where is the defense against the timing attack?

SSH does not actually defend against keystroke timing attacks. To my knowledge, no actual case of password recovery through timing analysis of a SSH connection has been spotted in the wild; however, since nobody in particular would have kept me informed if that had been the case, what does it prove ?

This report claims that the Song-Wagner-Tian attack is too difficult to pull off on a practical network, because the latency implied by the network masks the delays between key strokes. One may notice that the purported attack relies on a learning phase in which delays between two specific letters are first gathered (for a specific victim); that phase looks hard to do in practice. Another vexing issue is that an oft-typed password usually has its own delay patterns; that is, when you type the same password again and again, the delay between, say, a 'v' and a subsequent 'o' occurring in the password will be quite distinct from the delay measured when the "vo" letters appear in a non-password text that you also type.

Note: SSH includes some random padding, at least four random bytes (see the standard), but this is meant to avoid some potential weaknesses of the used block cipher. It does nothing about timing.


Mac address spoofing in Kali resets back MAC addr. after connecting to WLAN I use kali 2016.2 in virtualbox as root user.

First I change with macchanger my MAC addr. on 2 interfaces(eth0 and wlan0)

but after i connect to a network, the used interface(eth0 or wlan0) resets the MAC to the permanent(original) MAC and I dont know what to do, to stop this behaviour.

I appreciate every answer.

This is a known issue with Kali. Older versions from before the rolling releases don't seem to have this problem when running on real hardware (non-VM).


Certificate Signed Using Weak Hashing Algorithm impact on a workstation I did a vulnerability scan on some of our company workstations. These are workstations used by employees (dev, HR, accounting, etc.) to do their job.
One of the common result I found is SSL/TLS Certificate Signed Using Weak Hashing Algorithm.
Based on the vulnerability description "An attacker can exploit this to generate another certificate with the same digital signature, allowing an attacker to masquerade as the affected service." I'm thinking this is more on a server side.
My question is, what could be the impact of this in an ordinary workstation?
What can an attacker/pentester do to the workstation with this vulnerability?

Background for context:
Digital certificates bind trusted identity information to a public/private key pair.
The identity information is trusted because the certificate is cryptographically signed by a trusted Certificate Authority (CA).
There's an excellent explanation of the hashing and signature process in this answer.
Answer:
In short, an attacker could create a trusted copy of the workstation certificate and use it to impersonate the workstation. The impact of this is dependant on the role of the workstation and its certificate in your network. However, this vulnerability is very expensive to exploit and it's unlikely any attacker would attempt to do so.

An attacker could generate their own key pair (meaning that they control the private key) and subsequently a certificate associating any identity information they like with the key pair. Under normal circumstances, it would be easy to verify that the trusted CA hasn't signed the certificate by comparing hashes - thus the certificate would be invalid and untrusted.
However, where the hashing algorithm is weak, it is technically possible for an attacker to create a fake certificate with a hash that matches that of a genuine certificate, resulting in the fake certificate being trusted.
This has been achieved with certificates using the MD5 hashing algorithm.
There is a good write-up from Cloudflare on this here
The Cloudflare article is a little old and SHA-1 collision attacks are now real, but fortunately only apply when certificate serial numbers are predictable.
I say technically above, because certificate attacks cost tens of thousands of dollars:

By renting a GPU cluster online, the entire chosen-prefix collision
attack on SHA-1 costed us about 75k USD. However, at the time of
computation, our implementation was not optimal and we lost some time
(because research). Besides, computation prices went further down
since then, so we estimate that our attack costs today about 45k USD.
As computation costs continue to decrease rapidly, we evaluate that it
should cost less than 10k USD to generate a chosen-prefix collision
attack on SHA-1 by 2025.

If you're prioritising vulnerabilities for remediation, this one should be near the bottom of the list from a practical risk perspective. The reality though, is that weak hashing algorithms on certificates have got quite a lot of press and many people overlook the difficulties of real-world exploitation, so it may be beneficial to replace the certificate with a SHA-256 or above equivalent from a perception of risk perspective.


How did someone find my Windows username? I recently (and stupidly) created a Windows SBS 2011 user whose password was the username.  Multiple unauthorized people across the Internet used RDP to log in as that user.  How did they find the username?

Your account may have been brute forced. This is when someone writes a script to (not manually, automatically) try all combinations of usernames/passwords up to a certain length.

For example, one alogrithm my start out with a then go through z then try aa, ba, ca, ... za, ab, ac, ..., zz for usernames length up to a certain number. Some/Most brute-forcers also check for the most common usernames such as "admin", "root", and common names.

If your username was short, it's much more vulnerable to brute-forcing, since the longer the password is, the more possibilities there are to the username of that length.

With crystal ball in hand, I predict your username was either a) really short or b) a common name.


Using salt or secret for Hmac I'm working on a web API. We are going to use Hmac256 for signature hashing. From what I can gather, the secret is a key used to initialize the hash algorithm (ie to generate a random number). The salt is appended to the content, to make it harder to decrypt.

The API will be used by a few clients and the data is not very sensitive (for now).
We will be doing IP filtering on our server.

What is the best practice, using a salt, a secret, or both ? It's kind of cumbersome for the client to have both I think.

Salts and secrets serve different purposes when you're creating a MAC.  The secret (the key) is used to prevent existential forgeries, or in other words, to prevent an attacker from creating an equally valid MAC on a tampered message.  Without the key, you have no integrity, and you've essentially turned the MAC into a hash.  So, you need the key.

A salt, on the other hand, is only useful with a MAC if you are creating signatures for identical messages and need to prevent information leakage.  If you create signatures for the same message twice, using the same key, then the MACs will by design be identical.  If you don't want attacker to be able to discern whether the messages being signed are identical or not, then you need a salt.  If the messages are not identical, as would be the case with encrypt-then-MAC, for instance, where you might rely on an initialization vector to make the ciphertext you're creating the MAC for unique, then you do not need a salt.


Adding Escaped HTML to DOM I am learning about XSS and am in the process of trying to understand why escaped HTML added to the DOM is triggering XSS vulnerability.

The application will draw a modal overlay for a form (bootstrap) and add in HTML (both escaped and unescaped) to that portion of the DOM document.  It gets the data from a request to the server which auto-escapes any user input that has HTML in it.  Below is the code that is causing the vulnerability.

$('.update_button').live('click',function(){
    $('#name').modal()
    var id=$(this).attr('data-id');
    $('#form_holder').hide()
    $('#form_holder_loading').show()
    $.ajax({
        url:'/some/path/',
        data:'id='+id,
        dataType:'json',
        success:function(data){
            // data is an HTML string with HTML entered by the user encoded
            // such that any HTML characters are replaced with their entity
            // e.g. '<' becomes '&lt;'
            $('#user_form_holder_loading').hide()
            $('#user_form_holder').empty().html(data.form)
            $('#user_form_holder').show()
        }
    });
});

The way to safely print untrusted data in HTML is by replacing HTML-significant characters with character entities. (That is, you'd replace < with &lt;, etc.) I suppose this is what you mean by "HTML escaping".

Now, if you filter untrusted HTML that way, you can't trigger XSS with jQuery's html() anymore. E.g., this will just print plain text without markup:

$('#element').html("&lt;h1&gt;XSS&lt;/h1&gt;");

Also note that the recommended way to insert untrusted content with jQuery is text(), since you don't have to bother with your own filtering. This is safe:

$('#element').text("
XSS
");

See this JSFiddle for a demo.


mySQL into outfile strange behaviour I have sql-injection with file_priv=Y (root user) but I can only create file in /tmp and /var/tmp directories even when i have 777 permissions to destination folder - mysql server just won't create file (Errcode 13). Server runs freebsd 8.x and mysql 5.x. What could be the issue? Thanks!

Things to check:

the secure_file_priv variable
The server must have read access to the whole path, and might need to have scan access also (e.g. to write in /a/b/c, you need r-- access to both a and b, and -w- access to c, at least. Those could be r-x and -wx respectively).


Is SOCKS proxy lest secure than VPN? How? In what circumstances a SOCKS proxy is vulnerable and a VPN is not?

SOCKS doesn't add any additional encryption by default. If your traffic is already encrypted then it will stay that way. While a VPN can encrypt everything leaving your machine, such as DNS.

SOCKS also does not protect against traffic analysis

I know you didn't ask benefits, but to help balance my argument for others, SOCKS can be a lot faster because of the lack of additional overhead encrypting.


HTTP request from Embeds Trackable I'm pretty new here so please be gentle with me, a security newb.

I have a website where I want to have a user fill out a form. This form already exists on another website I own (that has greater capabilities), but due to the name of the website/url it could be a physical security risk to the users of the first site (the countries in which the users reside could persecute them for going to the website).

By embedding anything from the 2nd site into my 1st site, am I putting my users at risk? Could the HTTP requests made through the web form on the embed be traced? How is any request through an embed handled? Is it as if the user were going to that website anyway?

If you simply embed content from site A (dangerous) into site B (innocent) somebody watching the traffic of the user will see requests made to site A, i.e. not what you want.

Instead you need to replicate the full site A into site B so that site B only embeds resources from site B and also the final form submission has to submit data to site B. This can be done by making your server at site B a proxy which internally forwards (not redirects!) every request to site A. Be sure to use no fully qualified links which include the name of site A though  but only site-relative or site-absolute links (i.e. links without explicit domain).


What makes PINless Wi-Fi Direct using WPS on Android secure? I've read from Wikipedia that Wi-Fi direct uses WPS (Wifi Protected Setup),
and I know that in Android (at least what I have which is 4.0.1 on Galaxy S3) uses the WPS method of the "push button" to authenticate a client.
We know that in 2011 a researcher revealed a security flaw in WPS.

Does WiFi Direct device that uses the "push button" method of WPS also vulnerable to the security flaw? (Because in the push button there is no PIN code to try to achieve by brute force).
It also written that

  The standard also includes WPA2 security and features to control
  access within corporate networks.

What does it mean exactly? If the authentication done by WPS so what WPA2 has to do?
Does the data transmitted between the two WiFi Direct devices is encrypted?
If it's encrypted, by what key? Can the user configure this key somehow? (I didn't find the way in my device).

Yes and no. Push-button WPS is "just pray that noone will attack you during the connection establishment phase" anyways, so it is vulnerable by design. While the button is not pressed, however, it cannot be attacked.
According to the source linked in the Wikipedia article

  The Alliance says they've considered that and mechanisms are in place so that, for example, a laptop with Wi-Fi Direct doesn't suddenly become a unwanted bridge.

Yes, using WPA2
A random key established using WPS. On Anrdoid, the group owner can get the passphrase using WifiP2pGroup.getPassphrase()


Are there any exploits in Movable Type that allow the attacker to delete the movable type files? I'm a developer for a web site; we have a small blog powered by Movable Type that we added a few years ago. The blog doesn't get a lot of traffic or attention; we just noticed a couple of days ago that the links to the blog were broken, caused by several of the symlinks involved in our installation being missing; however most if not all of the actual files are intact. I'm fairly certain this was done maliciously, my question is whether there are any Movable Type exploits that could have been used to do this or whether my site has a larger vulnerability that was exploited. The only suspicious files I've found so far are files called "1.do" and "1.php" in one of the movable type directories; both nothing but an empty pair of single quotes. Their modification dates also correspond with the first times I found the blog pages not loading in my Apache access logs.

Anyone know what exploit may have been used and what I can do to prevent it from happening again? I have three load-balanced web servers running CentOS 5.9 and the Movable Type installation was 5.12

There are a large number of known vulnerabilities in MT 5.12, but this one that allows command injection (i.e., anything you can run at the shell, it can do) stands out: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-0319


How much do unusual characters in passwords help? If I use a system that allows all Unicode characters or a similarly large space for passwords, how much would using an unusual character help in practice (for example, ࡀ ,which I found under Mandaic and doesn't render properly in Firefox for me)?  I understand that in theory, an attacker making a brute force attempt would probably determine the character space and use the entirety of the possible characters.  But, is this common in password cracking software?  Is it likely that someone would try bruteforcing a large character space, or more likely they go for the low hanging fruit of alphanumeric and maybe include special characters easily entered on a keyboard?

I understand that Security Through Obscurity Is Bad and relying on this as the sole method of choosing a password is a bad idea and I shouldn't choose a 1 character password with the assumption that no one would try my character.  But I'm curious if anyone has information about how strong of a password something like "ᏯᏯᏯᏯᏯᏯᏯᏯ" would be based on how hackers actually work.

Technically, characters are just sequences of bytes. So while that character may look incredibly exotic to you, there's nothing special about it. It may occupy a few more bytes than, say, an ASCII character (depending on the encoding), but that's it.

Of course an attacker will probably start with the low-hanging fruit (words from a dictionary, digits-only, alphanumerics etc.). But after this, they may very well switch to raw bytes, and then the only thing which protects you is the actual entropy of your password. Where the bytes come from is irrelevant. Instead of your exotic Unicode characters, you might as well use an equal amount of ASCII chars.

Another problem with Unicode is that it's not fully supported by all applications. Some don't support it at all, others only support the BMP. That means there's a certain risk that your password will be mangled in some way -- if they're even accepted.

So to answer your question: Yes, there is a benefit if you assume that the attacker will only go after “standard characters”. But it's better to take care of the raw (byte-level) strength. For example, I usually generate 16 random bytes and encode them as 32 hexadecimal digits. This provides maximum security and compatibility at the same time.


What is the best way to report IT Security risks to Executive management? I am seeking your opinion on what is the best way to report/communicate IT security risks (risk register) to IT executive management in big organization?

From the resource, Information Security Governance for Board of Directors and Executive Management -- http://www.isaca.org/knowledge-center/research/documents/information-security-govenance-for-board-of-directors-and-executive-management_res_eng_0510.pdf

  Desired Outcomes

  Information security governance consists of the leadership,
  organizational structures and processes that safeguard information.
  Critical to the success of these structures and processes is effective
  communication amongst all parties based on constructive relationships,
  a common language, and shared commitment to addressing the issues. The
  five basic outcomes of information security governance should include:

  Strategic alignment of information security with business strategy to support organizational objectives
  Risk management by executing appropriate measures to manage and mitigate risks and reduce potential impacts on information resources
  to an acceptable level
  Resource management by utilising information security knowledge and infrastructure efficiently and effectively
  Performance measurement by measuring, monitoring and reporting information security governance metrics to ensure that organizational
  objectives are achieved
  Value delivery by optimizing information security investments in support of organizational objectives

  [...]

  Process Integration

  A promising concept, driven in large part by the increasing tendency
  to segment security into separate but related functions, focuses on
  the integration of an organisation’s management assurance processes
  regarding security. This can serve to improve overall security and
  operational efficiencies.

  These activities are at times fragmented and
  segmented in silos with different reporting structures. They tend to
  use different terminology and generally reflect different
  understandings of their processes and outcomes with, at times, little
  in common. This makes it difficult, if not impossible, to seamlessly
  integrate them. Results include overlapping security initiatives,
  which waste resources, or major gaps that can lead to serious security
  compromises.

There is no one-size-fits-all model, but we have a few strong frameworks to aid in governance. The NIST Cyber Security Framework (CSF) is a strong, dominant framework for addressing cyber risk in that it is outcomes-focused. For defining a common language, the OpenGroup FAIR standard documents a strong, dominant information risk-analysis model that includes very-specific language, in addition to variable selection, et al. FAIR does not tell an organization how to calculate, but it does lay out the calculables. A book reference I would recommend is Measuring and Managing Information Risk, where FAIR is shown to utilize PERT analyses with Monte Carlo Simulations to produce an accurate picture of information risk that many businesses can rely on to be the state-of-the art in accuracy. The authors also show their work and document where else information risk analysis models are being developed.

For process integration, we should see existing structures outside of IT merge with cyber risk. Many colleagues and I have been discussing how BCDR risks work alongside or simultaneous to cyber risks. If your org has an existing BCDR program (or subset), it may strike up interesting conversations to say the least -- especially that can aid the risk communication cycle with executive management. Some orgs may have other places this can occur, such as physical security, corporate security intelligence, a risk office (or committee), etc.

Depending on the culture and structure of your executives and the business, some models and frameworks will work better than others. Some businesses and top-level processes run on experiments -- some strongly tied to the scientific method. Very often, the business works the top-line and bottom-line of their financials. Given the time value of money, many executives trained with financials see that investing in growing the business will pay dividends for the business (and its shareholders, who many executives work for). While nobody knows why certain organizations have cyber security budgets at the levels they do (or how they get to those numbers), at least we do have some research on what those budgets typically are: If the company's revenue is under $100M/year, they should be spending around $800K/year on cyber security; if $100M-$1B/year, spend should be over $3M/year; if revenue is over $1B/year then the cyber security budget should be over $30M/year -- (Original sources: https://web.archive.org/web/20160315032510/http://blogs.wsj.com:80/moneybeat/2015/09/09/cybersecurity-index-beats-sp-500-by-120-heres-why-in-charts/ --
 http://www.cyberrisknetwork.com/2015/09/24/data-spotlight-cybersecurity-budgets/ , N.B., as of Q2-2017 this second source is no longer available and the images were difficult to locate even via archive.org. Knowing what we know from the Equifax data breach, for companies with revenue of over $1B/year, the cybersecurity spend should be at least $40M/year. A new study would greatly help this simple approach to budget allocation).

There may be hybrid models, and more often than not -- balancing risks with business needs comes down to a cost-benefit analysis (CBA). Krag Brotby wrote a few books on security metrics and other topics where this is partially covered. However, the idea of a CBA has been around for quite some time. You can Wikipedia concepts such as Opportunity cost or Sunk costs to find out more. Also in this vein comes from a book, A New Framework for IT Investment Decisions, that uses either Hubbard AIE and/or the Black-Scholes model to provide Notional Value / Potential Impact. Using the Black-Scholes model, one can treat investments as options where the underlying assets are the IT systems, the current value is NPV from IT projects, volatility is uncertainty in cash flow from IT projects, the exercise price is the investment required, and the exercise date is the date for developing the IT project. Hubbard AIE is covered in the book, How to Measure Anything in Cybersecurity Risk.

I have found hybrid models to be useful. Combine all of these ideas but still keep it simple. A useful aid when integrating cyber risk processes to existing business processes (such as BCDR) is the Multiple-Scenarios Generation Technique, as well as related analytical techniques. Scenario planning is a common strategy tool, but other tools such as SWOT Analysis, Hoshin Planning, Porter's Value Chain, and other strategic business concepts may also be useful. I think these are great places to start, but to get to a common language, such as FAIR, is really the ultimate challenge for a cyber risk register that has a model approaching closeness to reality. Maybe not exact reality, but a useful model that supports the business needs at the time. The problem with cyber is that the models typically need to be updated (or somehow self adjust to global cyber-risk events) hourly or daily.


Will patching a higher layer protect against the spectre/meltdown vulnerability in a lower layer? The question I am about to ask is similar to the following question:

Do I need to patch Linux for Meltdown/Spectre if the hypervisor has been patched, and I trust the guest?

However, I would like to take the question a bit further or a bit deeper.

Consider the following environment, where a UCS virtualization layer, is hosting VMware ESXi instances, which themselves will be hosting Windows, Linux and other OSes, which layer should I protect in order to protect the underlying layers?

-> Hardware
   -> CPU
   -> RAM
   -> Mainboard
   -> Storage
      -> Operating System (UCS Management)
         -> partitioned "hardware" servers
            -> physical CPUs
            -> physical RAM
            -> Storage
               -> OS of VMware ESXi Hosts
                  -> partitioned "virtual" servers
                     -> virtual CPUs
                     -> virtual RAM
                     -> Storage
                        -> OS of virtual Windows Server
                           -> Microsoft Hypervisor
                              -> virtual CPUs
                              -> virtual RAM
                              -> Storage
                                 -> OS of Microsoft Hypervisor Server/Client
                           -> Microsoft SQL Server
                              -> SQL Server OS (yes, SQL Server has its own OS)

Seeing as the various vendors are supplying patches for the various levels (VMware, Microsoft OS, Microsoft SQL Server), will it be sufficient for me to patch for example, only the first highest possible "physiscal" layer (UCS Operating system) to guarantee that the underlying layers will no longer be affected by the vulnerability?

The idea behind this question is to minimise the possible amount of patching that would have to be implemented to protect the underlying layers.

How far must I patch?

For Meltdown you need to patch guest VMs as the patch is in the kernel. So you need those guest kernels up to date.

For Spectre, the patches are in the CPU microcode, so they need to be loaded to the host system. I think vmware has already these, but the current microcode updates doesn't have fixes for all CPUs included yet, so there will be one more update by the end of January.


Send a CA certificate via email without a digital signature? If a friend wants to send me their S/MIME CA certificate containing his public key, why does he need to add a digital signature?

A digital signature verifies that the content was sent by him and not a man-in-the-middle who has put his own public key in the email. But since we are now talking about a CA certificate (which is signed with the private key of the CA itself saying "yes, this public key belongs to email address yxz") and not just a raw public key, I think a digital signature by my friend is not needed at all, is this right? The articles that I've read were all saying the same thing: "send a public key via email and add a digital signature", but I'm assuming they were assuming a raw public key, not a CA signed one.

Am I correct to assume that a CA certificate can be safely sent via email without any encryption or digital signatures involved?

I guess it's important to distinguish between a public key and a CA certificate which contains a public key. But I would like to have a confirmation by the experts since this is a sensible topic.

He should still sign the e-mail. While you are correct in saying that the certificate itself cannot be forged since it already contains a digital signature from the issuing CA it is still arbitrarily copyable.

A signature on the E-Mail (or any other document) adds the proof, that subject actually does know and control the private key and is able to use it for future secured communication.


Which Authentication mechanism to choose for PCI-DSS system I want to create Angular 9 + Spring Boot application with strong security complaint to PCI-DSS security standard.

Which security protocol is preferred for user sessions in order to have high security when we use Angular and Spring Boot:

Session cookies
OAuth2
OAuth2 + JWT
JWT

for now I'm thinking to secure the application using JWT. Can you share what issue might I have using JWT and is it a good choice?

The only requirement that directly relates to session management is 6.5.10 which is very general:

6.5.10 Broken authentication and session management.
Secure authentication and session management prevents unauthorized
individuals from compromising legitimate account credentials, keys, or
session tokens that would otherwise enable the intruder to assume the
identity of an authorized user.

The best PCI-type resource is the new Software Security Standard.
https://www.pcisecuritystandards.org/documents/PCI-Secure-Software-Standard-v1_0.pdf
which recommends threat modelling and then selecting your authentication and session management based on this.


Is there a good place to find WAF rules tested? I am searching evaluated WAF rules that check OWASP Top 10 and even more to have decent protection of a web infrastructure.

In my experience you can't apply a generic set of WAF rules and suddenly be immune to OWASP Top 10 issues. You may find a compilation of WAF rules of known payloads for CVEs in Tomcat, or in nginx. Really though, once you patch your application you don't really need the WAF rules for CVEs that you're no longer vulnerable to.
There is value in WAF rules for 0-days; that is vulnerabilities that you have not had the opportunity to patch. I imagine there probably are security companies that offer services where you tell them which technologies you use and they will update your WAF rules the same day that a vulnerability goes public, but I imagine those services are expensive and hard to find; I'm not aware of any. This is also becoming a bit of a product recommendation, which is off-topic here.


Nmap give me a ssh service with OpenSSH 12.1 I just did a scan with nmap and it found a ssh service running (nothing wrong here). The problem is it identifies the service as OpenSSH 12.1, but when I looked on the website of OpenSSH they say the last release is 7.3

Here the command, if it may help:

nmap -sS -A -p 22 xxx.xxx.xxx.xxx

Here is the output:

Starting Nmap 7.12SVN ( https://nmap.org ) at 2016-08-15 15:29 EDT
Nmap scan report for xx.xx.xx.xx
Host is up (0.00026s latency).
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 12.1 (protocol 2.0)
| ssh-hostkey:
|   1024 xx (DSA)
|_  2048 xx (RSA)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:linux_kernel:2.6.32
OS details: Linux 2.6.32, Linux 2.6.32 - 2.6.35

Any idea?

Someone is being deliberately deceptive. Nmap's service fingerprints are written as regular expressions that match and capture portions of the banner. Here's an example for OpenSSH:

match ssh m|^SSH-([\d.]+)-OpenSSH[_-]([\w.]+)\r?\n|i p/OpenSSH/ v/$2/ i/protocol $1/ cpe:/a:openbsd:openssh:$2/

So if someone created an SSH service that returned a banner like this:

SSH-2.0-OpenSSH-12.1

Then it would produce the output you see. OpenSSH itself does not allow this banner to be configured at runtime, so the person in question either changed the code before compiling or is running some other SSH daemon.


is it possible to avoid hardware backdoors? Hi I have recently started to learn about data protection. After the snowden events it seems pretty certain that intelligence agency may have planted backdoors in hardware. I have got a few questions relating to this topic and hope it is not too much ;) and someone with enough patience will help a newbie.

libreboot offers laptops that run only on "free" software. Do you know/think that a librelaptop does also provide for no backdoors? On their website they are only mentioning the intel processor backdoors but what about harddrive backdoors or other relevant components?
If there is no device which is backdoorfree with 100% certainty available right now, do you think that there will be one one day? (I do not think so)
I have read a comment in which someone asserts that these backdoors are not used by intelligence since all the data they would pick up must be sent to them over your router so that anyone would know about it and it would be too easy to find out. What do you think about this argument?
My next question relates to internet anonymity. Does it really matter to try hiding all your information, protect yourself and try to use as much "secure" (open-source) software as possible when people spying on you just could use the hardware backdoors?
My last question: what do you think about parallel vpns: https://thesafety.us/en/parallel_vpn ? does it seem like a good idea or would you prefer proxychains? Tor?....

A key part of information security is risk analysis.

It is not possible to completely secure everything, everywhere, at every point in time.

Example, you download a file. Can you be aware that someone has tampered with it? Can you be sure someone hasn't inspected this content before you downloaded it? How much of a 'risk' is this for you?

On the case of the libreboot, while it may be open source, have you compiled it yourself? Do you understand what is going on? What is the risk of using default, "from the factory" firmware/boot loaders?

Depending on how paranoid or concerned you are about your own security, the only true way to have complete trust over a system is to build it yourself, with your own chips. This is unlikely to happen until individuals can buy and manufacture chips in their basement. There is implicit trust in what you use, and with anything such as a car. Can you trust the people who work on your car, or do you work on it yourself?

Backdoors that work at the hardware layer and inserted into firmware are hard to detect unless you are able to compare the factory's image to yours. While a joke, the story about a HP printer containing a modified chip and firmware is completely possible. How would a user be able to detect such a change? You may find this article of interest: https://en.wikipedia.org/wiki/Logic_bomb and this about the "joke" http://www.theregister.co.uk/2003/03/10/one_printer_one_virus_one/ .

Another assumption made is that open source = secure. This is not the case, as demonstrated by Heart bleed in the very popular open source OpenSSL library. Microsoft's implementation was not effected by such an attack, but is closed source.

Tor will guarantee "perfect forward privacy", but a destination must still be known. In theory, users can still be tracked through tor if the entry and/or exit nodes for your connection are compromised.