What does " oscrashed.xyz " do to a computer? I mistyped an URL into chrome and it redirected me to the site: oscrashed.xyz

It appeared to be the typical scam site that asks you to call a number to get your computer unlocked or cleaned of viruses. But after a while, it causes my entire system to freeze (not just chrome).

I had to do a hard reboot to get control back. I launched system monitor, and visited the website again, with the process ID in mind in order to stop chrome from the shell. It appears that the site just uses 100% of the CPU, but I still managed to send the kill -STOP signal to chrome; despite that, the computer still froze after a few seconds.

I don't have the skill set to investigate how the website accomplishes this. Can someone take a look at it, or point me to the right direction on how to look into this?

Thanks.

I'm running Linux (Centos 7.2)

It appears that this website loads a lot of new pages in the browser, as you can see from the source code:
<script type='text/javascript'> window.location.href = 'chrm'; </script>
A quick look at the source code and a scan by VirusTotal don't show any other malicious activity, so you're probably safe, but you might consider an antivirus scan just for extra safety.
There are other, similar webpages designed to crash Chrome and other browsers, including Safari, as this article states:

The website is http: // crashsafari.com. Please be responsible with this information and do not send it to anyone as a joke.
By its name, it sounds like a way to target Apple's browser only, but Chrome and Firefox are impacted too. On my Ubuntu laptop, running Chrome, the entire browser froze. I had to force close it in order to continue. Some Chrome on Windows users report that only that tab crashes.[...] While it can be argued that this is nothing more than a prank-worthy nuisance, remember -- some people work exclusively in the browser. This could result in important work being lost. Rebooting an iOS device entirely can cause a ton of lost app data.


How does OpenVPN handle previously established connections? Started using OpenVPN on my desktop computer and monitored the traffic with Microsoft network monitor. What I noticed, is that when the openvpn session is initialized, only connections established after this point are routed through the VPN. That is to say I had to restart Skype to get it to route traffic through OpenVPN. is there a way to make it terminate connections and re-establish them once the tunnel is up?

OpenVPN creates a new interface for connections to go through, it doesn't override all connections that exist. In other words, it becomes an 'optional' connection. This can be important because you might need to use local network resources without the VPN.


Is adding a default context to Python's Urllib necessary security-wise? And is it enough? I've been messing around with Python to automatize downloading webpages and images when needed, and for that I'm using urllib.request, usually authenticated to the sites with my login. As someone still very ignorant about internet security, I heard HTTP connections are not recommended due to the fact that the information you send to the website (including usernames and passwords) gets exposed to your ISP and possibly hackers.
Would using urllib.request only on addresses starting with https:// automatically secure me, at least from the problems related to HTTP described above?
Or do I need to set up some stuff on my side too? Searching about this question online I found out it is recommended to at least use ssl.create_default_context() as the context for urllib methods which I'm gonna do from now on. So basically:

Should I be worried about the passwords I used without the ssl library's context? Are they (and all the data I exchanged) exposed to my ISP? Or did connecting only to https URLs automatically protect me from this particular problem?
If my passwords are indeed unsafe, will using the default context (after changing my passwords) help here? Or that's not enough?

Any data transmitted over HTTP is plain text and might be intercepted or read by anyone who has control of the devices/networks between the client and the server. HTTP should no longer be used for transmitting sensitive information.
Any request over HTTPS is today normally secure when using modern software and standard configuration. A modern server would refuse insecure connections, and a modern client would also refuse insecure connections.
However, a badly configured client (like older versions of Python) that don't do HTTPS certificate validation can lead to security problems. If anyone has full control over the network connection between your client and the server they might be intercepting and reading everything that is being transmitted. This is why you read that ssl.create_default_context() is recommended since it would configure older versions of Python to do certificate validation and set a recommended set of ciphers.
Not validating a certificate doesn't necessarily mean that your data is unsafe. If your connection ended up in the intended destination at the web server you wanted to reach, the connection is still securely encrypted (unless both the client and the server allows insecure protocols/ciphers). Even if someone like your ISP would try to dump the transmitted data, it would not be readable.
However, without validating the certificate you are vulnerable to man in the middle attacks if anyone in the network between your client and the web server is able to intercept your connection or by other means redirect your connection to a rogue server which can read the contents of your request (including any passwords), and pass it on to the real destination so you won't notice any thing.

If you are using an older version of Python that does not validate SSL certificates by default, and you ALSO have a reason to not trust your ISP or any network between your client and the server, you should be worried. If you are using a newer version of Python it is secure and there is no need to worry. If you are using an older version that does not validate certificates by default, but you do trust the path between your client and the server, it should probably be OK was well.

If you were using an old version of Python that does not validate SSL certificates by default, ssl.create_default_context() should be enough to validate certificates and enable a decent set of protocols and ciphers. Using a newer version of Python will automatically validate SSL certificates.

From release version 2.7.9/3.4.3, Python will validate certificates by default. This  affects all relevant stdlib modules (urllib/urllib2, http, httplib).
Sources and documentation:
https://www.python.org/dev/peps/pep-0476/
https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection


Internal access to security sensitive data in a company I'm building a software that requires a lot of security for the data. The user data in essence is very sensitive. So we are building a lot of encryption, 2 step authentication, app call tokenization etc., Now our DBA's and support admin have access to this data via tokenized database interface calls, no direct database manipulation. They also have to login, essentially to support issues that come from the field. For instance if there is some record corruption in the database and a user complaint comes in, the DBA's and admins can login and find the user data and try to correct the corruption. But this means essentially they will be accessing the user data. Is this ethical given the amount of security we are putting in. Is there an industry standard way of accessing this data (possible contractual agreements that this data is not leaked, granting selective permissions etc.,)? Or are there other secure ways of doing this?

A lot of a correct answer for you will be up to the jurisdictions that you are subject to (laws, regulations, contracts with customers, etc.)

But, as for industry standard ways of dealing with access to customer data, you would need:

a ticketing system to record the request by customers for changes (and thereby, permission to access)
clear separation of duties for all parties to ensure that no one individual can by-pass controls
logging of all systems involved to trace the activity of the data access and also to show the state of the data before and after the access
independent internal auditing of all of the above to make sure it all happened according to plan

But, as I said, the details of all of these things will depend on the laws and regulations that you are subject to.


iOS/Android Pen-Test This question might be vague, that is because I am not sure where to start.

There are a lot of books and courses on pentest focusing on networks, systems, and OS such as windows, yet I haven't been able to find anything on mobile platforms such as iOS/Android.

I am very interested in learning on how to pentest and secure mobile platforms. The real-time content (location, phone-state, phone-calls...), are valuable information, which makes it very interesting.

By my understanding, due to the hardware/components, penetration methodologies are different when dealing with mobile phones.

How and where could I get started and possible create a future profession on mobile pentest?

Start with the Emulator and Simulator, which are part of the standard SDKs. If you prefer certain environments over others, you will gravitate towards a reliable framework for pen-testing these platforms.

For example, with an iOS app, I always start with the iOS Simulator after building the code in Xcode. I set my Mac OS X system HTTP and SSL/TLS proxy to localhost where I run Burp Suite Professional. Then I launch the app and utilize the Xcode DTrace functionality found with the command-line dtruss tool. I tend to look at the plist files with the smartphonesdumbapps tools.

With Android apps, it's similar. These days, I go back and forth between IntelliJ IDEA and Eclipse, but both have very usable Android SDK integration points. For Eclipse, it's ADT. I like to launch the Emulator via the ADT. I like to interact with the filesystem and memory using the DDMS, which is primarily useful for debugging. When it comes to software tracing though, I tend to hop on an adb shell and strace the processes I'm interested in, along with a simultaneous logcat. For proxying, I typically use a DNS blackhole to create a transparent proxy to Burp Suite Professional using the Emulator's -dns-server flag. It's useful to look at the manifest in ADT as well, especially to look at the permissions and intents.

Much of this changes if you do not have buildable source. Even worse, you could be targeting an app that has self-modifying or self-checking code. In these situations, you will need an approach that involves disassembling and decompiling the app. For iOS, the class-dump-z, otool, otx, and i386codedump tools are a safe bet along with IDA Pro. You can find a lot of information on decompiling Android apps, although ARM debuggers and IDA Pro will come in handy for those apps that are heavily invested in self-modifying or self-checking code protections. There is a lot of information about malware and tools around malware on the Android platform that are tied to this sort of problem. For example, there's a mobile-malware mailing-list.

Some other great resources happen to be the developer documentation combined with hands-on work. Pluralsight and Raywenderlich have some excellent tutorials that cover these platforms -- I've been through all of their material. There are many books from Syngress and OReilly books on Android and iOS -- many of which that cover security and forensics topics quite in depth. There's a book on Cocoa Application Security from Wrox Press that is also worth a look, albeit dated. Most books covering the basics of the base languages (Obj-C and Java) will be useful, although it's also good to understand where mobile app languages and concepts converge (e.g. PhoneGap, MonoTouch, et al).

** UPDATE 3/26/2012 **

I tend to use similar tools, although I've branched out more to the DTrace-Toolkit and iprofiler/Instruments for iOS Simulator apps. I tend to do a lot more work using cycript on a jailbroken iPad 2, which has been an eye-opener (especially along with class-dump-z). For Android, I believe that I forgot to mention the Activity Monitor, which is very useful for launching intents.

A lot of the runtime can be viewed/analyzed/modified by using runtime Obj-C or Java/Smali, so knowledge of these languages and their platform specifics on target devices is not very optional.

Occasionally, I am asked to pen-test apps that are another format (e.g. AIR for iOS/Android, HTML5, Titanium, NDK, et al) but compile as native apps. In this situation, it is best to build (as would have the original developer) and/or reverse engineer every component using a combination of binary, static, and dynamic analysis. This may require use of Flash Professional or another IDE/build-tool.


How safe (for privacy/security) is ZIP for file encryption of backups on a flash drive I am looking to encrypt files on a flash drive (for backup) just in case it gets stolen or lost. I don't want to install any extra software like TrueCrypt but instead just use what's already there on most computers.

1) I can think of using 7z/zip which uses AES-256 (apparently good) and just password protect and archive the files.

According to [1], it's safe (I guess?).

But according to [2], apparently "It isn't that hard to decrypt a password protected ZIP file. There's plenty of apps out there to either figure out the password or just remove the password."

So, is this true? Is encrypted 7z/zip safe? How safe is it?

2) Are there any alternatives for encryption that you don't have to install any new programs to use?

3) Which is better to use? 7z or zip?

-

[1] Can password-protected zip files be broken without brute force?

[2] How secure is a Windows password protected zip file?

There's plenty of apps out there to [...] figure out the password.

Well, yeah, those are dictionary attacks. It doesn't matter if you're using AES-256 or FOOBAR-1024, if you choose a weak password it can be broken easily. The only thing that helps slightly against dictionary attacks is using an expensive key derivation function. From a comment on the question below, it appears that 7z uses 2^19 hashing operations to derive the key, probably giving some protection:

https://stackoverflow.com/questions/12470378/how-key-derivation-and-key-verification-functions-are-implemented-of-a-7-zip-arc

  Is encrypted 7z/zip safe? How safe is it?

I haven't reviewed their code myself, but I would hope they are as strong as the underlying cryptographic primitives (e.g., 256 bits of security for AES-256). If a tool is so broken that it is not clear from its interface or documentation which cipher is being used at which bit strength, then don't use it.

256 bits of security is plenty safe; in fact, your password will almost certainly have fewer bits of real entropy than 256 unless you are very hard core.

  Are there any alternatives for encryption that you don't have to install any new programs to use?

Depending on your definition of "install", you can use a custom LiveCD or virtual machine to run programs without "installing" them.

  Which is better to use? 7z or zip?

zip, assuming WinZip AE-1 or AE-2 format is used for actual encryption. It uses standard protocols like PBKDF for key derivation, and others have probably written compatible software, so any discrepancies would've been noticed by now. 7z is just not in the same league.

OTOH, if you're using a random zip tool's "password protect archive" feature that doesn't mention AES-256 or PBKDF, it could be god-knows-what.


How to manage a custom session in a webapp? I was reading through the OWASP Cheat Sheet and something mentioned in the "Weak Authentication and Session Management" row did not make sense to me.

It is recommended in the Design Column, that inbuilt session management should be used and that Custom session identifiers must be stored in the native session object and should not be sent as additional headers or cookies. I don't understand the second part of the statement. If not as a header or a cookie how else can I establish/send additional session information? Isn't it standard practice to add a secure cookie for the feature I am writing for?

What is a native session object as referenced in the document?

How does it differ from the inbuilt session management?

To quote directly:

  Only use inbuilt session management.

  Store secondary SSO / framework / custom session identifiers in native session object – do not send as additional headers or cookies.

What this is saying is that, if you've got a secondary system which doesn't/can't use inbuilt sessions, you shouldn't send that second session token as a cookie or header, but instead should put that token into your inbuilt session. That way, you have one single session token which may point to others if needed.

When they say "the native session management", they mean something like $_SESSION on PHP, or the Session object in ASP.NET, whereby the session data is stored server-side and a token is maintained on the client-side in order to identify the session for that user.

For example, let's say you've got three webapps. You later roll out a single sign-on (SSO) system so that you don't have to separately log into each. According to the OWASP guidelines, it would be a bad idea to implement it such that visiting each separate application gives you separate session tokens. Instead, the SSO should give you a single session token, which should be used for all three applications. If separate identifiers are required for each, these identifiers should be stored in the session data, so that they can be read from there.

The benefits of this are:

Expiring the main session expires others automatically - no latent sessions.
Less attack surface for cookie management issues (e.g. Secure or HttpOnly flags).
Less likelihood of session token leakage.

A quick PHP example of how you might handle this in a webapp:

<?php
session_start();
$sid = isset($_SESSION['app3_session']) ? $_SESSION['app3_session'] : NULL;
if ($sid != NULL)
{
    // verify SID for this particular app
}
?>

The SSO would create the initial session and populate the app3_session value.


How to ensure authenticity and integrity of a directory I want to do something similar to Ubuntu's signed checksums in distribution and I'm currently stuck on the integrity part. The tutorial here covers most of what I'd like the process to look like (I've modified what I'm writing for Mac syntax since that's what I'm using): https://tutorials.ubuntu.com/tutorial/tutorial-how-to-verify-ubuntu

Unfortunately the distribution channel I'm using requires that the files are distributed unpacked; otherwise I would have just zipped them up into a tar file or whatever and performed checksums on that.

It's simple enough to generate the SHA256SUMS file for the files present: find * -type f -exec shasum -b -a 256 {} \; > SHA256SUMS (just would have to remove the sums of the sums files), and then the sums can be verified with shasum -c -a 256 SHA256SUMS

My concern is that this system only guarantees integrity of files that were present when the sums were generated; an attacker could add additional files and this system would not catch that.

Staying in-band, one option I thought of is to have the recipient run the same command to generate the sums in a new file and then run diff between the one they generated and the one I generated, but I fear some people might just run the typical verification command. If instead I included a script to run verification, any attacker would just change this script as well, and it also runs the risk of people ignoring the script and running the typical verification strategy.

It's seeming the best option so far is to have another distribution channel where things are tarred up, have a signed checksum for that file, and then to finish verification you would check the diff between the two file trees. Any other ideas?

Rather than designing such a system yourself, you might want to take advantage of an existing File Integrity checker such as Aide:

  Aide creates a database from your filesystem and stores various file
  attributes like permissions, inode number, user, group, file size,
  mtime and ctime, atime, growing size, number of links and link name.
  When someone make changes in filesystem, then Aide compare the
  database against the real status of the system and report it to you.

You can configure it to watch the specific files and directories you care about, and notify you of changes.

For the Mac, Aide can be installed with Brew.


Solution to hide a shared password to users I am looking for a solution to a business / security need.

All our users use a shared login and password to access a web application.

we cannot have an account by user
we can not change the web application

I am looking for a solution to hide this login and password from users.

Is there a kind of proxy where a user connects with its own credential, to access the application, the proxy would make the authentification with the shared password?

This way the password does not need to be known by all users and can be managed in only one place; the proxy.

I have been where you are and had to deal with this kind of thing.

The technology type you are looking for is a Cloud Service Broker. It acts as a wrapper for external services that you can connect your local authentication services to. The service broker (depending on features) can then log in as a designated account to the external service.

This wrapper means that you get added security, auditing, the ability to lock someone out of the account (if they leave), while never exposing the service password.

Steffen is correct, though, whether or not you can use a CSB will depend on the target site.


What is the safest way to close a popup window? The internet has many articles recommending ways to close a browser popup window without infecting your computer with malware.  I've seen click the red X, use ALT-F4, go to the windows task bar, right click on your browser's icon and do a close window, click file-exit in the browser.  I believe all of the above recommendations, while easy to perform by the user, can be intercepted with a javascript function call which means performing those recommendations could download malware onto your computer.  And the only safe way to close a popup window is through task manager and killing the browser process.  Is that correct or are some of the recommendations mentioned above really safe to perform when closing a popup window?

Click the red X --> Popups can masquerade as a browser dialog window
Alt+F4 / Taskbar>Exit / Browser>File>Exit --> Javascript can indeed trigger an action on page close (which also happens on exiting the browser because the page has to be closed to do so - just tested while writing this post)

Therefore it is correct to say that the safest option is to to Ctrl+Alt+Del and kill the process. This is safe because (in Windows) Ctrl+Alt+Del is a secure key combination that can only be intercepted by the OS, so it can't trigger any Javascript in the browser (it can't trigger anything actually).

The Ctrl+Alt+Del link above also has some commentary about what it does in other Operating Systems.


USB stick encryption on specific network/domain I am in a difficult situation here. For my company I need to make the use of USB  sticks secure, their demand is that when someone uses a USB stick it will only be readable and accessible on the network/domain of the company. So when the USB is used for example at home of the user, it won't work and it will not show anything. It needs to be able to identify if it is on the company's network.

The company is asking me to look for software that is capable to do something like this. The only thing I could find is a program called USB lock https://www.usb-lock-rp.com/usb-lock-remote-protect.html but I do not think this will encrypt the USB sticks on a specific network.

So my question is, does anybody know some kind of solution for this problem? I am stuck atm.

Help will be very much appreciated.

Kind regards,

Jelger

What is common is just the opposite: only allow secure removable storage media on a network, while you want to disallow your secure USB stick outside of the network.

The only way I can imagine, is to encrypt the USB stick and manage to make the key only accessible from the local network. The simplest way would be to use a HSM to store the private key that is used to decrypt the symetric key used for the USB stick encryption. Unfortunately, that will not prevent a malicious user the store the decoded symetric key and later use it outside of the network.

As it makes harder to use the USB stick outside the network, it may (or not) meet you actual requirements. The hard part is that to increase security further, you would need a special USB driver that securely connects to the central point that decodes the symetric key and never let it accessible to the user. It may not be that hard to develop if you can use a normal USB driver as original source, but driver development is risky because a buggy driver can easily make a machine no longer useable, and I have never heard of such a driver. I'm sorry no to be able to give your more than a hint, but I cannot imagine a better way...


Is there a multi-layered DoS protection which can be tightly integrated with cloud hosting services? I know that one can deny services (DoS) in any of the 7 layers of the OSI model and that in principle, a denial can be done by a single entity (human or machine) or from 2 or more such entities ("distributed" - DDoS).

I also understand that:

On layers 1,2, a DoS can be done by a single entity without software limitations, as these are purely "concrete" layers.
On layers 3,4,5,6, a DoS is software-only and is typically distributed (DDoS) because of typical ISPs bandwidth limitations on entities (so one or more entities would typically need 2 or more ISP accounts) even if the hacking is done from one machine that includes 2 or more virtual machines.
On layer 7, a DoS is software-only and can be either single or distributed easily without bandwith limitations (at least for a few types of attacks), but in any case are easier to manage in comparison to attacks on layers 1,2,3,4,5,6.

Background on cloud hosting services (CHS)

I know that there are basically two types of CHSs used to host web applications:

1. Minimally controlled cloud: The user is provided with an OS, DNS zone management tool, bypass console and some more possible tools while the user adds the rest by itself (examples: DigitalOcean, Linode and so forth).

2. Maximally controlled cloud: Either the user or the company provides the OS, DNS zone management tool, bypass console and some more possible tools while the user adds the rest by itself (examples: Microsoft Azure, Amazon Web Services (AWS), Google Cloud Platform (GCP) and so forth).

The main difference is that the latter allows using the VAD stack (Vagrant, Ansible, Docker) that enables true continuous integration or the closest one can get to it.

Regarding minimally controlled cloud; on the one hand, you don't have true continuous integration as when the time comes, you'll have to migrate all your data from one OS to another (say, from Ubuntu 18.04 to 20.04) or at least from one webserver to another (say, from Apache 2.4 to 3.4); these operations can be very resource-demanding and frustrating.
Regarding maximally controlled cloud; on the other hand, on maximally controlled cloud, the VAD stack can result in significantly slower performance and higher pricing.

Background regarding my problem

I generally host a few simple presentational websites with only a contact form and maybe also a paypal donation form; not anything grandiose like some mega ecommerce website with customer financial data but from an SEO standpoint, some of my websites can be in dense competitive fields and I suspect some form of DoS would be likely from an immoral competitor.

Regarding to layers 1 and 2, I understand that any CHS should protect these layers otherwise they won't be able to operate seriously because an immoral competitor of their own destroy these concrete layers of them.
Regarding to layer 7, I already protect from MITMs with TLS, from SSH and content management system BFAs with at least SSHGuard, and from Backdoors and DB injections (like SQL injections) with various policies and methods.

My problem

I worry about how to protect layers 3,4,5,6 from DDoS attacks, as both general types of CHSs seems to me not to include any internal protection mechanism from such attacks on these layers

Ways I know to handle it

1. Using a Content-Delivery-and-Protection-Network (CDPN) such as Cloudflare (more information here).

2. Using shared hosting platforms (such as SiteGround) that either have their own mechanisms to protect from such DoSs, or they themselves utilize Cloudflare "behind the scenes" or at offer their plugin for quickly utilizing its full version (no further pay is needed).

My question

Is there some technology I could use within a CHS to protect my services from being denied in the aforementioned ways?
I wouldn't mind paying say 25$ instead 20$ --- I just desire a technology that I could utilize from within the service, without opening other accounts on third-party providers like Cloudflare or otherwise.

Provider's Responsibility

In the cloud, as a general rule, the cloud provider handles OSI layer 1 and 2 protection. This is essentially free, as they cannot offer a functional service without it.

At OSI layers 5+, it's generally up to you unless you're buying SaaS or PaaS. If you're buying SaaS/PaaS, it's likely the responsibility of your provider, although you'll need to check the SLAs to see what they actually guarantee.

Your Responsibility

From your question, it sounds like you are not considering SaaS/PaaS so layers 5+ will remain your responsibility.

You can pay CDPNs to take it off your plate. You could simply use the same tools in the cloud that you use elsewhere, although you have extra options in the cloud. E.g., you can spin up more servers automatically in response to a DDoS attack until you can figure out how to filter it properly.

The Tough Nut to Crack

The real issue is, as always, DDoS protection at layers 3 and 4. While you can mitigate or eliminate your DDoS risk at layers 5+, everyone is fundamentally very vulnerable at layers 3/4.

A competent attacker can saturate any customer network link; it is no longer shocking to see 10+ Gbps attacks. Major attacks have even threatened the internet backbone and root DNS servers.

This is why CloudFlare and their competitors exist. In order to address all potential attacks, you need several fast, independent routes and/or a responsive ISP. Large cloud providers can offer this directly, at whatever price they see fit, or you can setup third-party protection in front of your cloud environment.

Comprehensive protection against layer 3/4 DDoS attacks requires backbone-grade network links or cooperation from the companies that have them. Very few organizations can accept 10+ Gbps traffic and only pass through the bits that you need.

To be comparable to CloudFlare, you would need to look at AWS Shield Advanced, Azure DDoS Protection, or Google Cloud Armor. Amazon seems to offer the best free protection at the moment, but there are some gotchas in there.

Economics

When my company looked for DDoS protection, the CloudFlare crowd offered far better pricing than the cloud providers. The dedicated DDoS protection firms had the lowest ongoing costs and fairly low costs for intervention (where applicable). This may vary depending on your workload and threat model.

Your prices suggest a very small cloud presence. If you're looking to add protection to one or two small sites, Azure and AWS will be far more expensive than Google or CloudFlare.

I would tentatively suggest:

AWS if their free protection is adequate
CloudFlare or competitor if you can bend on external protection
Google Cloud Armor, Amazon WAF, or any other rule-based service may be within reach of your budget for small/light deployments (more than $5/month though)
Neither Azure nor AWS DDoS protection are within reach of your budget

Be sure to take note of services which charge based on traffic; the price will spike during an attack. There should be a discussion with the application owner to determine what costs they are willing to incur to remain online during an attack.


Asymmetric vs Symmetric Encryption I am currently taking a principles of information security class. While talking about different encryption methods a large number of my classmates seem to believe that Asymmetric Encryption is better (more secure) than Symmetric Encryption. A typical statement is something like this:

  Generally asymmetric encryption schemes are more secure because they
  require both a public and a private key.

Certainly with symmetric encryption you have to worry about secure key exchange but as far as I can tell there's no inherent reason why one must be more secure than the other.

Especially given that the asymmetric part is often just used for the key exchange and then the actual data is encrypted with a symmetric algorithm.

So, am I missing something or can a general statement like this really be made about which is more secure.

So if I have a message encrypted with AES and another copy encrypted with RSA and all other things being equal which is more likely to be cracked. Can this comparison even be made?

Symmetric and asymmetric encryption are distinct operations which operate in distinct contexts, for distinct usages and distinct attack models. There is little sense in claiming that either is "more secure" than the other (it would first require some kind of quantified measure of security, which is not easy to define).

Asymmetric encryption is more demanding: it is about realizing encryption and being able to publish the ways to encrypt (the public key) without revealing the ways to decrypt (the private key). A practical implementation needs mathematics, whereas symmetric encryption is mostly scrambling things around (mind you, it is difficult to do a good job of scrambling; but still, less mathematics are involved).

Commonly deployed systems (e.g. SSL/TLS) combine asymmetric encryption and symmetric encryption (and a few other things as well) into protocols which do some intended job (e.g. "bidirectional tunnel with confidentiality, integrity and authentication").


If an adversary took over a major Certificate Authority, what bad things could they do? If an adversary took over a major Certificate Authority, what bad things could they do? Aside from the obvious attacks, what could they do in the context of the Public Key Infrastructure as a whole?

This has happened.  In 2011, the CA Diginotor was breached by a malicious actor, enabling the malicious actor to issue fraudulent certificates for any site on the internet.  These certificates were trusted by most web browsers, because most web browsers had Diginotor's root CA certificate installed in their trust stores.  This made it possible for anyone with control of a user's network connections to pull-off a man-in-the-middle attack for connections by that user to any site on the internet.

In the case of the Diginotor attack, it is suspected that the Iranian government took advantage of the Diginotor breach to issue false certificates for gmail.com, then used these certificates to conduct MITM attacks by way of its state-run ISP's to spy on its citizens' gmail accounts.  Comodo may have also been hacked.

Nowadays, there are standards in place to protect against these types of such as DNSSEC/DANE.  But, adoption has been slow.

What's scary is that it could happen again.  And, it wouldn't even require a hack. The malicious actors would simply need to write a check, and acquire a CA.  A number of CA’s have been acquired in recent years for under $1B (e.g. Symantec's CA business was acquired for $950M in 2017), which is nothing for a well-funded terrorist group, and pocket-change for a rogue nation.


Is it safe to store password in PHP session? I need to do some encryptions in the private zone of my website and I want to bcrypt the user's password.

Is it safe to store the password in the session when user does the login, so that I can use it later?

Don't store the password in the session variables. Instead, use a surrogate key.

For example:

Generate a random key. This is your surrogate key.
Use that key to encrypt whatever data you need.
Generate a storage key from your password, using an appropriate key-derivation function (e.g. PBKDF2 or bcrypt).
Encrypt the surrogate key with the storage key. If the two keys are of equal length, a bitwise xor of the two is an ideal form of encryption, since it's simple and cannot be broken without knowing one of the keys.
Store the encrypted surrogate key.

When the user logs in, you do the following:

Compute the storage key from the password.
Use the storage key to decrypt the encrypted surrogate key.
Store the decrypted surrogate key in your session variable.
Use the surrogate key to decrypt the data as necessary.
Destroy the decrypted surrogate key when the session ends.

If an attacker gets read access to session data stored in your /tmp directory, they might extract surrogate keys. However, they will not be able to get at the user's password. Whilst this doesn't protect the data you're encrypting on the server, it does prevent unauthorised access to the user's account, and stops the attacker from exploiting cases where the user has used the same password elsewhere.


A=0 appended to web server queries While looking through the logs for my web server, for a web site I wrote, I've noticed a lot of queries are being made twice, first as I expect then followed again within a second with 'A=0 appended to each argument.

The A=0 is not part of any code I wrote for the web site, so it is being added by the remote browser and/or user.

Examples:

"GET /xxx.cgi?id=1160 HTTP/1.1"
"GET /xxx.cgi?id=1160'A=0 HTTP/1.1"

and

"GET /list.cgi?anon=true&list=abb HTTP/1.1"
"GET /list.cgi?anon=true'A=0&list=abb HTTP/1.1"
"GET /list.cgi?anon=true&list=abb'A=0 HTTP/1.1"

This happens frequently and regularly and from many different sources, so I don't think it's a hack attempt, but it does make me wonder what could be causing it.

Does anyone know why this is happening?

The browsers are logged as many variation of Mozilla and Chrome, and IPs are scattered around the world.

There is a very good chance that this is a botnet looking for SQL injection. Even if the bot's goal isn't SQL injection,  it will get a ton of SQL errors by adding 'A=0 to parameter names. The first attack string is shown below:

"GET /xxx.cgi?id=1160'A=0 HTTP/1.1"

If the ID parameter is used in a query,  it will produce a syntax error:

select * from `table` where id = '1160'A=0'

The above query has unbalanced single quotes which may produce an error message. Adding A=0 will never be valid syntax because there will always be an odd number of single-quotes, and there is no comment terminator.  This maybe by design, because it is a string that always errors.


What are the requirements to sniff UDP packets in a Wireless Ad-Hoc network? In a wireless Ad-Hoc network, I have two computers which communicates in UDP together from 192.168.1.3 to 192.168.1.5

I have a third computer (192.168.1.6) which wants to listen to the packets which are not addressed to it. I can see the packets with tcpdump (which sets the wireless card in promiscuous mode).

To redirect the packets, I am using :

  iptables -t nat -I PREROUTING -s 192.168.1.3 -j DNAT --to-destination 192.168.1.5

Is it the only rule I need to use? Why isn't it working? Did I miss other requirements?

Why are you using iptables rather than using good old Wireshark which is specifically made for this? Wireshark is a free and open-source packet analyzer and the ideal tool for performing these types of analysis.

EDIT

If you need to reinject the packets I would have a look at scapy in python.


Tripwire report shows modification dates from when I was on vacation with computer shutdown at home Tripwire report shows modification dates from when I was on vacation with computer shutdown at home - how is this possible?

here is one of many examples:

Modified object name:  /lib/x86_64-linux-gnu/security/pam_systemd.so

  Property:            Expected                    Observed
  -------------        -----------                 -----------
* Inode Number         14155863                    14156649
* Modify Time          Do 12 Mai 2016 11:39:41 CEST
                                                   Do 01 Feb 2018 15:31:23 CET
* CRC32                B5TykA                      B/R1Fi
* MD5                  Ag+rN14JZRydCT88KOuyuX      BAHe4c1qm712mqcpi1k+rI

On the first of february I wasn't near my computer which I shut down approx a month before. I came back another month later. February has nearly 3000 changes in files. January 1500 changes. I was away from 6th of january until 27th of february.

Are there any other traces in the system logs? It seems strange that someone could sanitize so thoroughly a system that the logs show nothing, and yet not spot Tripwire or at least reset the timestamps properly.
Try updating a package, and see whether the updated files have the timestamp of when you ran the update, or the timestamp of the original file inside the update packet (this is typical in Windows, not so in the Linux distros I'm familiar with, but on the other hand you did not say what distro you're using).
Also, you could compare the checksums with those of a known good version of your same distribution.
update
pam_systemd.so was officially updated (at least on the one system I checked, Ubuntu 14.04-LTS), and the patch was published the day you report:
-rw-r--r-- 1 root root 42864 Feb  1 16:01 /lib/x86_64-linux-gnu/security/pam_systemd.so

Notice that I am in Italy, but my system clock is in UTC; if you're in Spain, our files were updated within thirty minutes of each other.
So my guess is that someone booted up your computer at least twice (one in January, one in February), and whether he logged in or not, the system proceeded to perform automatic updates.
Depending on whether it's a laptop or a desktop etc., and whether it was plugged in, it is even possible that it might have turned on by itself (I had a desktop once that did that about once every two weeks, or in case of thunderstorms), and then turned off again by itself after some hours of inactivity.


How to identify the phishing email originates from a compromised account or a compromised server? We have a whale phishing case, in which the sender is from the insider (we're using Zimbra email service for some specific user groups). A cursory investigation indicated that this account had probably been compromised.

My concern here is that is there anyway for the hacker to take over this account through server? I assume no because the email was associated with the specific email account.

Look forward to receiving your support.

Compromised accounts are typically used to escalate internally, e.g. to launch a new phishing attack from inside in order to bypass spam detection or abuse trust between users (they have access to the compromised account's past emails too).

In most deployments, internal forgery is trivial; you could send mail as your CEO to anybody in the company (or externally) and it'd pass all of the spoofing detection tests. That means you have to look at the Received headers to determine what host the message actually came from. (If SMTP-AUTH is enabled internally, you should have the authenticated username available somewhere in the headers, typically the Received header added by the local SMTP server.)

  is there anyway for the hacker to take over this account through server?

Didn't you already conclude that "this account had probably been compromised"? If so, it has already been taken over. Change that user's password as soon as possible and perform an audit of all of that user's logins and emails going at least 72 hours before you believe it was first compromised (unless you have a definitive compromise time, in which case use that).

Perhaps I'm not understanding your question. If you're asking if there was a server vulnerability that was exploited and that perhaps the account was compromised in that manner, you'd have to search for CVEs related to all of your relevant server software. If you regularly update your software to the latest patched versions, this is a lower risk, but you should still check.


How to demo a new 0-day security product? We are a development team working on a new 0-day protection security product.
We aim to protect against new unknown 0-days attacks against servers.
We have a very strong solution ready to demo.

The question is: how do you demo such a product ???
If you show that you can protect against known attacks - then you are no better than existing anti-virus solutions.
But how do you demonstrate the capabilities against 0-day unknown attacks?

Any ideas would be welcome

I think that's a marketing problem, not a technical one. 0-day means that no one in authority knows about it. So unless you discover your own 0-day and don't tell anyone ...

The demonstration is how it detects a problem, not the validity of the particular 0-day itself. You could keep a record of tests done against recently released 0-days that have not yet been addressed by vendors or signature-based AV solutions to show how your solution responds.

If you are looking for a canned, repeatable demonstration, you will have to reuse a known attack against a target that does not have protection against it and differentiate yourself in describing how your detection engine works.


Is doing credit card transaction via 3G secure? 3G, GPRS or other mobile-based connection. Because it seems like it's easier to intercept, than, say, land-based connection or encrypted WiFi. If it matters, the transaction I want to perform is Android Market/Google Checkout transaction. How do I know if it protect my data?

If I am correct, normally you use an SSL connection when doing money transfers. SSL encrypts the data before you send it over the network. In this way, even if your connection is being eavesdropped upon, they will not be able to see anything.

It does a lot more than only encrypting, also authentication and message integrity is provided.

To learn more : http://en.wikipedia.org/wiki/Transport_Layer_Security

My point is that with this layer you shouldn't be worrying about your connection.


Why does the first authentication process does Not need a Authenticator in KERBROS(v4) Well first this is a general protocol Kerberos v4

(1) C -> AS: IDc||IDtgs

(2) AS -> C: Ekc[Kc,tgs||TGT]

(3) C -> TGS: TGT||Authenticator

(4) TGS -> C: Ekc,tgs[Kc,v||Ticketv]

(5) C -> V: Ticketv||Authenticator'c

Notation:

  C = Client

  AS = authentication server

  V = server

  IDc = identifier of user on C

  IDv = identifier of V

  Kc = secret key derived from the user’s password on C

  Kv= secret encryption key shared by AS an V

  TS = timestamp

  || = concatenation

  TGT = Ticket Granting Ticket

  TGS = Ticket Granting Server

  Authenticator simply includes ID of user on client and also a
  timestamp.

Question: why message (1) does not contain authenticator?
Cheers!

Kerberos first message only checks that the login id exists in the KDC and that the time are synchronized with the AS. There is no authenticator because, a replay attack at (1) does not make sense.

Authenticator is created mainly for AS and TGS.

As you can see from your (3) the authenticator appears at this point. This is where the access to server is requested. Ticket from (2) is validated and user authentication is validated.


Login based on mail domain I'm trying to make a system where the sign up would be allowed or denied based on the domain of the mail.

So let's suppose that only people from company.com are allowed to sign up on that system.

Let's pretend that the system admin from company.com has total control of all mail addresses that are created.

My question is, is there any security issue that would allow someone that does not belong to that company to get sign up on the system?

Would an attack as DNS poisoning affect this system making mails to be redirected to another domains?

I think it would be enough if you can actually restrict the Sign up process to  specific domain(s) in the Application itself.

Three very important security points I can think of are below

You can actually have a list of allowed domains for signup and thoroughly check every signup email against this list.
Also should verify the signed up email by sending a activation link with unique and long(>32 charterers) random token. This verification should be mandatory before granting access to prevent abuse by others.
You are right about DNS. The activation mail you send will be delivered after doing a DNS lookup for the MX record of domain. So,you have to be sure that you use very secure DNS servers like Google public DNS . A wrong DNS look up can make the email delivered to wrong inbox.

In the answer i mentioned the mandatory checks which have to be done as per your question.

You can have additional security measures in place like encryption(HTTPS) and Two Factor Authentication etc depending on your business needs.


my email just hacked, no 2 factor auth. request or new sign in? Am I infected? Gmail.

I just received two emails sent from my own account that I did not send. They are in my sent messages as well so were not spoofed.

I have on this account(and all my accounts):

STRONG unique password, changed frequently
2 factor authentication tied to my phone
backup email

I received no 2 factor code, new sign-in alert, or ANY notice at all of an account sign-in before receiving the messages from myself.

The attacker did not even try to actually do anything, like change my password or phone number, but just spammed a bunch of other email addresses from me and cc'd me(?).

The only possible way I can think of this happening is someone hijacking the signed-in session of gmail on my desktop, why explains why there was no new sign-in attempt.

How possible do you think this is given that I run Chrome on Linux, no Windows at all? Should I consider my desktop to be infected and wipe it?

Please, beyond changing all my passwords again, what should I do?

It's a simple spoofing attack. Gmail is showing sent items not based on what was truly sent but on "from" address that matches your e-mail address. So you received an e-mail that has your e-mail address as to/cc/bcc and from at the same time, you will see in there but the e-mail wasn't sent from your account.

to check that, grab headers from original of one of the spam emails and drop it in this tool, and you will see under section "from" who originated it.


Is using simultaneously a VPN on router and another on computer any good? I know that the use of two VPNs on a machine is generally not advised for multiple reasons (security, stability, etc.) as well explained here :
Connect through two VPN clients

However I was wondering if the issues would still occur in case of a commercial VPN running on a router while another is running on a computer (e.g. WireGuard).

Would such configuration add any privacy/security ?

Edit :

My primary concern is that I do not trust real no-log VPNs.
In the light of some comments, which of the following configurations would be better (considering two different VPN providers):

VPN on router + VPN on machine
VPN on machine + VPN on a VM such as here : VPN tunnel inside other VPN tunnel

Also, which one is easier to configure to avoid potential issues ?

Thank you,

A different VPN on different machines will tunnel correctly. It doesn't matter if the machines are host, router, or VM.

Getting it to work is easy enough, but stop and ask yourself what you are trying to accomplish. You state that you don't trust the the VPN services, so:

How are you aquiring the VPN services, are you paying for them? Follow the money. If free or paid annonymously, the first VPN ("A") has your IP. Assuming you're tunneling to a second VPN ("B"), "A" knows this. While "A" doesn't know anything else, you immediately stand out as unusual double VPN traffic.

How are you paying for "B"? Unless it's anonymous you've immediately mooted "A". "B" also sees that you are unusual double VPN traffic. "B" has the same logs you're concerned about. It may or may not be politically practical to trace back from "B" through "A", but technically it would be a piece of cake given the right resources.

By using two VPNs, you've created 2/3 of a Tor connection (the most vulnerable 2) in a network that only you or a small handful of people are using. If a single VPN does not meet your needs, give serious consideration to Tor.


Are Anti DDoS server farms really effective? I'm looking to host a web app in a datacenter and I'm considering a few options. All of them seem reputable and claim to offer Anti-DDoS protection.

If just about every hosting provider is offering Anti-DDoS protection, does that mean that a) DDoS attacks are less of a threat because Anti-DDoS technology has caught up or that b) many of these claims are not as solid as advertised and if so, how can I tell if a web hosting company is really DDoS protected?

Thanks.

In my experience, there is no such thing as 100% DDoS protection. The largest DDoS cyber-attacks ever recorded have reached and exceed 1Tbps. Even if some company claims that they can protect you against such an attack, that would be a false statement.  The Internet of Things is perhaps the best mean an attacker can use since the level of security on those devices is extremely low. Therefore, the attackers have all the means to launch extremely large DDoS attacks nowadays.

In principle, the quality of the DDoS protection services you get, depends heavily on how much money you are willing to spend. Most of the ISPs that offer Internet Breakouts to web hosting companies, bundle some sort of DDoS protection. Some Web hosting companies might not choose to do the “washing” of the traffic on the cloud though, and might prefer on-premise devices (for example there are basic DDoS mechanisms on some firewalls or some load balancers).

If you are concerned about having good DDoS protection, I would suggest you to talk to the Web Hosting companies you are interested in, get answers in writing on what kind of DDoS protection they are using and evaluate which one is the best. I would strongly suggest picking a company that has a hybrid DDoS protection environment, meaning that they do traffic “washing” on the cloud first using some 3rd party vendor, and at the same time they also have a second layer of protection using on-premise devices which also acts as a detection mechanism. In general, I would stick with a company that uses well-known vendors in the DDoS protection field such as Incapsula, Arbor, CloudFlare, F5 Networks (ASM Module on Load Balancers), etc.


Is DIGEST-MD5 secure if done over HTTPS? If the DIGEST-MD5 negotiation is done over an HTTPS connection instead of HTTP, does that prevent this list of disadvantages from Wikipedia?:

Digest access authentication is intended as a security trade-off. It is intended to replace unencrypted HTTP basic access authentication. It is not, however, intended to replace strong authentication protocols, such as public-key or Kerberos authentication.
In terms of security, there are several drawbacks with digest access authentication:

Many of the security options in RFC 2617 are optional. If quality-of-protection (qop) is not specified by the server, the client will operate in a security-reduced legacy RFC 2069 mode.

Digest access authentication is vulnerable to a man-in-the-middle (MitM) attack. For example, a MitM attacker could tell clients to use basic access authentication or legacy RFC2069 digest access authentication mode. To extend this further, digest access authentication provides no mechanism for clients to verify the server's identity.

Some servers require passwords to be stored using reversible encryption. However, it is possible to instead store the digested value of the username, realm, and password.[2]

Similar to:
Is BASIC-Auth secure if done over HTTPS?

Digest access authentication is intended as a security trade-off. It is intended to replace unencrypted HTTP basic access authentication.
  It is not, however, intended to replace strong authentication
  protocols, such as public-key or Kerberos authentication.

By implementing SSL you are bringing public-key authentication into the equation so you are addressing that issue. Anything stronger than that would require additional infrastructure that wouldn't be practical in many situations.

  Many of the security options in RFC 2617 are optional. If quality-of-protection (qop) is not specified by the server, the client
  will operate in a security-reduced legacy RFC 2069 mode.

That has to do with implementation and really doesn't apply here.

  Digest access authentication is vulnerable to a man-in-the-middle (MitM) attack. For example, a MitM attacker could tell clients to use
  basic access authentication or legacy RFC2069 digest access
  authentication mode. To extend this further, digest access
  authentication provides no mechanism for clients to verify the
  server's identity.

Using SSL will greatly reduce the risk of MITM attacks. It will provide the method for verifying the server's identity. Yes a certificate can be spoofed, but web browsers are getting better at alerting users to these issues.

  Some servers require passwords to be stored using reversible encryption. However, it is possible to instead store the digested
  value of the username, realm, and password.[2]

Yeah you shouldn't be doing that anyway.

So the answer is yes, SSL does address the weaknesses quite well. It isn't perfect but the next step after that is a pretty big one.


Are SSH keys and PGP keys the same thing? I have a 3072 bit RSA key that I generated for use with SSH. Can this key-pair be used with PGP/GPG, or do I need to generate a new pair of keys separately for use in email encryption?

Are the two interchangeable, or is there a difference between the two?

Yes, the same RSA key pair can be used for both (Open)SSL and OpenPGP/GnuPG.

The monkeysphere project contains a tool to convert RSA keys in PEM format to the one defined by OpenPGP, pem2openpgp. For converting the SSH key pair into the PEM format, there already is a comprehensive answer in Converting keys between openssl and openssh.


Most secure way to read an int32 in C I was discussing about the subtle issue that you can face when you write in C, so (for fun) I started to create bulletproof code that can read an 32bit integer from stdin.

I wrote this code:

#include<stdint.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<sysexits.h>

void flush_stdin()
{   int c;
    while ((c = getchar()) != '\n' && c != EOF);
}

int32_t readInt32()
{
    char line[13]; // -2147483648\n\0
    int32_t n = 0;
    if (fgets(line, sizeof(line), stdin)) {
        if (sscanf(line, "%d", &n) == 1) {
            if ((line[0] == '-' && n > 0) || (line[0] != '-' && n < 0)) {
                fprintf(stderr, "Overflow detected\n");
                exit(EX_DATAERR);
            }
            if (feof(stdin))
                flush_stdin();
            return n;
        }
    }
    fprintf(stderr, "Error: wrong int32\n");
    exit(EX_DATAERR);
}

int main()
{
    int32_t r;
    r = readInt32();
    printf("read %d\n", r);
    return 0;
}

Is really bulletproof as I think?
Do you have some tips about this code?

The main drawback is that it truncate the first 13 Byte of your input, so if you provide something like 000000000000001 it reads 0.

EDIT:

this code works as expected only if you generate a 64bit executable, but the solution provided by @Colin it's better...

I'm sure you can add more to secure it to make it the most secure, but another option could be to:

Read in the value as an int64
Check that the value is within the range min_int32 - max_int32
if the value is within range the copy to an int32 variable, otherwise return an error condition.

Your code as it stands (and as you've checked for it) contains a possible integer overflow.  This in itself is technically 'undefined behaviour', and as such, you cannot rely on the compiler or code execution from behaving.


Why did browsers deprecate 1024-bit RSA, but retain SHA-1? I was reading Mozilla's security blog Phasing out Certificates with 1024-bit RSA Keys. Effectively, some browsers are deprecating 1024-bit RSA for CAs and Subordinate CAs because the certificate must withstand attack for 10 to 30 years.

As far as I know, 1024-bit RSA provides about 80-bits of security due to advances in integer factorization and the number field sieve. 80-bits of security is out of reach of most attackers.

SHA-1 provides about 61-bits of security due to Marc Steven's HashClash. 61-bits of security is well within the reach of many attackers, especially when compute time is so inexpensive on Amazon's EC2 or OpenStack's Nova.

Two real life attacks on crypto I am aware are (1) Texas Instruments signing key, which factored a 512-bit key; and (2) Flame, which exploited collisions on weak/wounded signing algorithms. From TI, we know the attacker will attempt to factor a key with 60 or so bits of security. And from Flame we know the attacker will attack the digest function when its effective security is around 60 bits or so.

Why did browsers deprecate CAs and Subordinate CAs with 1024-bit RSA, but retain SHA-1?

Breaking a CA SHA1 signature would not get you anywhere: you could just recreate a public certificate with the same signature as a legitimate one, but the public key of the legitimate certificate would still be used to verify certificates, because it is stored in browsers.

To successfully forge a certificate you need to break one of:

an RSA private key of the chain
a checksum of an intermediate authority
the checksum of the SSL/TLS certificate

The checksums do not necessarily have to use the same algorithm of the root CA: a root CA hashed with SHA1 may be used to sign TLS certificate hashed with SHA256.


Does a TLS-connection to a proxy-server encrypt the destination url's? If I use a browser through a proxy-server over a secure connection (i.e. the proxy is HTTPS) - does that mean that everything is encrypted, or just the page returned from the site?

And who does the DNS lookup? Does the browser do it through my ISP (in which case the url is known to them) or does it delegate that to the proxy?

Assume Firefox, if the answer depends on that.

The full URL (hostname and path) is only inside the HTTP protocol and is thus encrypted by the TLS layer. Also, any HTTP headers and payload of request and response are end-to-end encrypted.  But, the hostname part of the URL is usually in the CONNECT request when using a non-transparent HTTP proxy, unless the client itself makes the DNS lookup. With a SOCKS proxy the situation is similar, i.e. the client provides the target IP (SOCKS4) or might provide the hostname (SOCKS5). Additionally the hostname is usually included in the TLS handshake too in clear (SNI), no matter if using a proxy or not.

This means it is known to the provider of the proxy (maybe the ISP) which host your are accessing but not which page on this host. Also any hop after the proxy knows  at least the target IP because this is needed for routing. And if SNI is used (i.e. in most cases) any hop can also find out the targets host name.

In short: the goal of TLS is not to keep privacy or to allow anonymous connections. The goal is to protect the data transferred between client and server against sniffing and modification.

  And who does the DNS lookup?

With a SOCKS4 proxy it must be done by the client (browser). With a SOCKS5 proxy or a HTTP proxy it can and will usually be done by the proxy since these protocols can transport the hostname instead of the IP address.

Edit: I was not aware that recent versions of Firefox and Chrome actually support connecting to a HTTP proxy with HTTPS. In this case only the connection to the proxy is visible to any hop before the proxy and thus the URL including the hostname and IP address is fully protected on the path to the proxy. On and after the proxy this additionally TLS protection is removed and thus the hostname and target IP address are visible again as described above. I would assume that the browser sends the hostname and not the IP address to the proxy (because this is done with a normal HTTP proxy too), so the DNS lookup will only be done at the proxy.


Clarification of details regarding an SSL Stripping Attack I'm looking for clarification of some of the details of an SSL stripping attack.

My current understanding is that:

The attacker sits between the victim and a server.
When the attackers receives an HTTP request from the victim, the attacker sends the request to the server using HTTPS
When the attacker receives the response from the server, it strips away the HTTPS links and then forwards the response to the victim using HTTP

These are some of the details I'm missing:

The response from the server back to the attacker is in HTTPS and is encrypted. How is the attacker able to read the content to strip away the HTTPS links?
Are the HTTPS links being stripped in the body of the response from the server?
Does anything in the response header need to be changed before forwarding the response back to the victim?

Your understanding is correct.

This is because the attacker established the HTTPS communication, so when the response from the web server comes to them it is decrypted and then forwarded to the victim.
Yes, all HTTPS links in the body are replaced with HTTP links, as the Location header.
sslstrip analyses the response headers and

removes accept-encoding

I think this is so the attacker doesn't have to decompress and recompress every request from the client when analysing requests.
removes if-modified-since

This is so the client has to make a full request to the server, even if the page hasn't been modified. This header needs to be removed because otherwise there is no complete request to the server and nothing to intercept.
removes cache-control

This is for the same reason as if-modified-since, so the client doesn't try to load the page from a cache and avoid making a complete request to the request to the server.
changes link in Location header to HTTP


Public Key Infrastructure: Sending data securely to CLIENT? Ok, so been looking up public key encryption and using it a bit around some of my web applications. From some testing, I understand that the server contains two keys and sends the public key to the client.

With this kind of system, the client can send encrypted data.

My question is however, how does the SERVER send data securely to the client?

Thanks...

1. Handshake

It all starts first with a handshake. The client tells the server what version of SSL it supports and what cipher suites. The server answers with the information on which version of SSL and which cipher suite will be used.

2. Cerfiticate

The client now has to check if the server really is who he sais he is. This is done with the certificate. The client verifies the name of the holder, the domain, public key, signature and the date when it will expire. The check of these information is done by asking the certificate authorities if it is valid or not.

3. Key exchange

Now that everything is almost set up, the client generates a random symmetric key that will be used for encrypting the data sent back and forth between the client and the server. (note: both ways are encrypted!) The client then encrypts this symmetric key with the asymmetric public key of the server and sends this information to the server. Only the server can read this data, because it only can be decrypted using its private key. So now both parties have the symmetric key that will be used to encrypt and decrypt the data of the communication.

The reason why there is a symmetric key is because of performance. Using only the asymmetric public key of the server would be much to slow and is even bound on limitation of the size of the data. And as you pointed out, the server otherwise couldn't send encrypted data back to the client.

I hope this gives you a brief understanding in how SSL works.


Company VPN (tunnelblick), https, root CA and privacy My company provided me with a MacBook for work. I was the one that took the laptop out of the sealed box and I was the one to set it up. I only had to install the tunnelblick VPN client and use the tunnelblick (certificate) file (fileName.tblk) that was explicitly generated for me. No other IT/administration/device management software or anything else in that regard was/is installed.
I'm now considering to sign in with my private Apple Id and use my passwort manager on that device (for convience), because I'm pretty sure that in my case they are not able to access any information even if I'm connected to the VPN, except for the websites that I connect to (which I don't mind them knowing).
Am I correct in my assumption? I know that it is possible to install a root CA to apply MITM attacks to circumvent the VPN limitations, however I couldn't find anything if that is even possible with tunnelblick. I didn't see any abnormalies with the certificates of the websites that I checked in my browser (e.g. google was still certified by GTS)

tunnelblick seems like a simple p2p VPN that establishes a secure connection.
However if all your traffic is routed through the organizations' DC rather than split tunnel configuration they might have a web gateway acting as a MITM. You can relatively easily check this by checking the certificate of common websites you use. If it's the original certificate there's probably no MITM.


using secure boot in embedded systems The whole idea about using Secure Boot in Embedded Systems to boot an operating system is new to me. I've never paid much attention to it previously. I just know that it prevents the loading at start-up of code which has bad credentials which could be potentially a virus.

Recently it has become a requirement in a project we are working on. We use Raspberry Pi and Beaglebone boards with embedded linux for prototyping. It seems that the hardware on these boards do not support secure boot, which I did not know.

I've been searching for exact hardware requirements for secure boot online without too many answers.

My queries are, must the microcontroller be a special one that supports secure boot? Would any ARM core not work? I would have thought that permanently programmable ROM would be all that is needed in order to burn the special key.

I'm just confused about the exact hardware requirements for this, and hopefully, someone with knowledge could shed some light on this. Thanks

If you want to have hardware ensure that software is valid before you boot, you would want to use something like a TPM for measured boot. A TPM is meant to be platform-independent, even if it is most commonly seen on x86 systems. This means it can be made to work with a Raspberry Pi. A TPM will measure the bootloader, kernel, and even firmware before it unseals a secret value. That value can be an encryption key, for example, so that only if the TPM unseals itself will the system be able to continue booting. Since the TPM will only unseal itself if the bootloader and other components of the boot process are in a known-good state, the system will refuse to boot no matter how much modification is done to writable, unencrypted components.


Can the photos/videos I deleted a year ago can still be on my iPhone or on the Internet? I have been getting paranoid lately and decided to ask for your insight on this issue. A year ago, I took photos of some personal information (cc, passport, etc), and deleted them a month later, along with some videos that reveal my face and sound. A couple of months ago, my iPhone (iOS 12.2) was stolen and ever since, I am not able to get a good sleep as I am concerned about identity theft, or even social engineering that may occur in the future due to my losing my phone.

Here are some questions I would be very happy if you could answer.

Once a photo/video is uploaded to iCloud or Google Photos, does it stay in their servers forever even after I deleted it from the trash, like does consumer content ever completely erased? If no, should I be worried about them getting hacked? It's been more than a year since I deleted that personally-identifiable content. Also, the same goes for other apps such as Facebook and Instagram that require access to the gallery.
I know there are certain forensic tools that can recover data from iPhones. Can they recover the data that was deleted from the phone more than a year ago? Like photos and videos? I'm worried a criminal would use the phone (Find My iPhone wasn't working, so I couldn't blacklist the IMEI) and get caught after committing a crime, and law-enforcement find my ID in there when they dig it up. I know it sounds like paranoia, but know it's a possibility. Flash memory and data pointers make it possible.
What advice would you give to continue my life being not worried about such things? It is definitely affecting my daily life.

Thank you all!

Once a photo/video is uploaded to iCloud or Google Photos, does it stay in their servers forever even after I deleted it

One can never be sure. They may have backups (I really hope so) that are kept for long time. What is deleted from the live system still stays in backups. They may have bugs in the trash-purging procedure. Whatever. In the general case, an ordinary user will not capable of accessing these obscure copies. Then again, data breaches do happen.

  certain forensic tools that can recover data from iPhones. Can they recover the data that was deleted from the phone more than a year ago?

It depends. The storage space in these devices is constantly reused and once a certain space is marked as free, it may or may not be overwritten. If your iPhone is, say, 32GB and you did save nearly 32GB (and got the storage full), you have some degree of confidence that the data you deleted before is overwritten. But you can still not be sure. These storage devices have spare blocks that are sometimes exchanged to active ones, so your data may have settled in some spare block. There are other possibilities, too.

  What advice would you give to continue my life being not worried about such things? It is definitely affecting my daily life.

Whatever you do now, it will not affect the possibility of someone abusing your personal information that you don't control anymore.

Don't worry. The probability of someone recovering your data is fairly low (except if you are a celebrity, a high-rank business or government official and the attack is targeted at you personaly). Most of the thieves just sell the phone to someone that is interested in the phone itself and the first thing they do is to wipe the phone clean. They have to in order to minimize the risk of the stolen item to be tracked back to them by the law enforcement or by a capable victim.

And you cannot do much by worrying anyway.

Learn the lesson - the phone has encryption functions, designed exactly to mitigate these risks. In the future, either learn to use them, or don't put sensitive information on your phone.


Is hardware firewall needed for a local network without internet access? Is a hardware firewall needed for a local network without access to other networks?

The local network only consists of a server with SQL database, workstations & PLC controllers.

I am asking this because Stateful and Deep Packet Inspection is part of the project cybersecurity requirement.

Firewall used to separate trusted network to untrusted  network. If you trust your that insider will not
initiate any threat then you don't need firewall. But, users to be very aware. Like, they would not connect any device will any of the device at the
inside network's devices. Threat not always comes form Internet. If you network is wireless then attacker could access to your network.


Hidden service security SSH Pretend I have a Tor hidden service.

For ultimate security I would firewall the internet entirely, except for Tor, to try to reduce IP address leakage and other security risks.

My problem is how could I then connect to the box via SSH?

My question is how can you keep all ports closed for security reasons, but still access VPS with SSH? I can't think of a secure way of doing this, which keeps server secure.

A lot of what I discussed in this answer about alternate SSH ports is applicable to this question.

Since your goal is to be as invisible as possible*, I think your best bet is secure port knocking with a tool like fwknop (as noted in this crypto.SE question) or perhaps a custom one-time password scheme for sufficiently complicated port knocks (to help protect against replay attacks).

Another idea is to port knock through Tor; there may be latency within Tor, but port knocking doesn't consume much bandwidth and can be configured to tolerate more latency.  Once you've knocked on the .onion address, the end of your knock could be an encrypted (or plaintext, depending on your sensitivity) form of your client public IP address, which would then be able to access the server's public IP address for a short time window.

You'll also want a system like Fail2ban, which can recognize failed logins and ban the IP that attempted them (by default, Fail2ban blocks an IP for ten minutes after ten failed logins within ten minutes, but this is all configurable).  This will help protect you against attacks coming from systems that share your public IP address (e.g. by being behind the same NAT or by claiming your IP when you disconnect).

I'd still recommend using Tor for your everyday access and only fail over to the public internet when Tor becomes too slow (which hopefully isn't that often; much of Tor's slow speed comes from being starved for exit nodes, but a hidden service doesn't need an exit node).

*Since Tor runs atop the internet, it still needs some ports exposed to the public internet.  You won't be completely invisible and any adversary should be able to easily determine that your server runs Tor.  You might be able to do some kind of reverse port-knocking (upon detecting a port scan, drop all packets to and from that IP), but some port scans are hard to detect (and an attacker might start with the port in question).


Can the BadUSB exploit be prevented? Recently I read a few things about the BadUSB exploit, for example:

http://arstechnica.com/security/2014/07/this-thumbdrive-hacks-computers-badusb-exploit-makes-devices-turn-evil/

My understanding is that a device connected to USB can change its appearance (drive, keyboard, network card, ...), which opens the opportunity for an infected USB drive (or other device for that matter) to simulate things like a keyboard and submit malicious commands or a network card and connect to web adresses to download programs. The problem appears to be that the computer automatically trusts USB devices. However, the power of the infected chip is probably very limited, which makes it difficult to simulate more complex hardware like network cards:

How to prevent BadUSB attacks on Linux desktop?

Anyhow, I am interested if it is principally possible to prevent such behavior:

Is my understanding of the exploit correct?
If so: Wouldn't it be possible to implement a software "firewall" that asks the user for permission if new USB devices are connected and especially throws a warning if the "type" of the device changes? By that I mean not simply clicking ok (which a malicious USB device may do on its own), but use something like a CAPTCHA.
If that is not possible, because the software may not be able prevent the usage of a USB device (or for some reason): Would a hardware solution be possible, that forwards USB data, but for example only allows USB drives and not keyboards? How does a USB device tell the computer its "type"?

There's a chicken-and-egg problem with the "firewall" solution: your keyboard and mouse are USB devices*.  How do you as the user tell the OS that you want to give permission to the keyboard and mouse, without using either of them?  What about if the keyboard and mouse are connected through USB ports on a monitor -- they'll be disconnected and reconnected every time the monitor is turned off and on.  I'm sure there are other situations where the "firewall" will either leave the user with no input devices and no way to approve new ones, or in attempting to avoid that situation, will automatically approve a device that it shouldn't.

*Yes, even on a laptop.  They're simply USB devices that are permanently wired in place.


Pegasus iOS exploit & Kernel Memory Corruption I'm currently reading about Pegasus, the malware on iOS that uses 3 zero-days, in the Lookout Blogpost.

Blog Post about Pegasus

I'm a cs student in the first year and I understand that the malware needs to gain access of the kernel priveliges to get full control of the system but I dont understand how the process works. I'm really curious and thought about specializing in Information Security later on in my studies.

In particular:

How does Pegasus (which is apperantly running on a website in some way? Sorry, I never did webdevelopment) from safari into the kernel? Does it use malicious javascript code or how should I imagine that? So how does it corrupt the memory of the webkit and why gives me that the memory location?
Why is it bad that a program / an attacker knows the memory location of the kernel? I thought the kernel memory is protected?
How does corrupting the memory of the kernel lead to the jailbreak? Memory corruption, as far as I understand it, is just overriding the memory which is used by another program, right? Why should the kernel execute the new code in the memory location?

Thanks in advance!

The exploit uses a combination of three vulnerabilities. Each vulnerability is a bug in an iOS component that allows the attacker to do things that are not supposed to be possible.

Stage 1 (CVE-2016-4657) is a bug in WebKit, a library of code used to render web pages. WebKit code is executed in the context of the Safari web browser of iOS. No details have been released yet, only the description as a “memory corruption issue was addressed through improved memory handling”. This could be a buffer overflow, a use-after-free, or some other similar type of bug. The general idea of memory corruption bugs is that the attacker passes inconsistent data (here, some web page content — could be HTML, CSS, JavaScript, etc.) and instead of detecting the inconsistency the program behaves in an inconsistent way and ends up overwriting some of its own instructions with data supplied by the attacker. This allows the attacker to execute the code of their choice in Safari.

Stage 3 (CVE-2016-4656) is also a memory corruption bug about which no details have been released, but this time in the kernel. This bug allows an iOS application to corrupt some data structures in the kernel and either execute code in the kernel or (I suspect given the description) at least elevate the privileges of the calling application so that it can do things that applications aren't supposed to do, such as installing programs that bypass normal iOS permissions and so allow e.g. installing spyware that won't be shown in the list of installed applications because it masquerades as part of the basic operating system.

Stage 2 (CVE-2016-4655) is an enabler for stage 3. Normally it shouldn't matter that the program know how the kernel maps its memory. And if the attacker is able to cause the kernel to execute arbitrary code then the game is lost. But it can happen (and this is probably the case here) that the attacker doesn't have much room in which to play. For example, maybe there's a size check that's present but slightly off, so the attacker is only able to overwrite a few bytes after the place where the injected data is located. In such cases, the attacker may need to know exactly what to put in that location, otherwise they won't be able to cause any interesting effects. If the location they can overwrite is a pointer, they need to know what to put there to cause the kernel to use valid but wrong data, rather than an invalid pointer that would just cause a crash. For example, change a pointer to a list of capabilities to the address of a place in memory that's known to contain what looks like a list containing some key system capabilities. For that, knowing where the kernel maps its data lets the attacker calculate the right pointer value.

Just to be clear, I'm just giving examples of plausible attack methods that fit the one-line descriptions that have been released at this time.

The best way to get a feel for how this works is to write a few exploits yourself. Get some old versions of software (preferably open-source) with known exploitable vulnerabilities, and go and write an exploit. You may also want to play some CTF.


Deep international spy forensics: what hw really needs to be destroyed? True Scenario:
Representatives from the GCHQ went into The Guardian newspaper corporate office in London and demanded top secret data (leaked by Edward Snowden) be returned to authorities.  The senior editor did not comply with the request to turn over the laptop, but agreed to have the machine symbolically destroyed by GCHQ on premises.

(Lets focus on just the laptop.  This question is JUST about the laptop, not USB copies, backups, politics, etc.)

So the machine can't be taken away by GCHQ and kiln or dropped in a vat of acid.  Portable grinders will have to suffice.  No parts were submitted to GCHQ, but GCHQ needed to make sure no parts of the machine could “fall into the wrong hands” and top secret information be gleaned.  So for obvious reasons they need to be thorough.  (For example, a BIOS password may also be used for an encrypted file copy found elsewhere in the world...)

The idea is that if Russia or China (or whoever) got a hold of the junked Guardian laptop, and had full-on laboratory level analysis (including Magnetic Force Microscopy, and anything else you can think of real or theoretical...)

I'm looking for a brainstorm of all the bits/chips that should be destroyed within the machine.  What would that GCHQ agent's checklist look like?  He or she needs to stand tall in front of the GCHQ / NSA executives and say “I destroyed that machine - nothing can be recovered.”

Hard drive.  (Check)
RAM boards (Check)
BIOS password RAM storage (Check)

What else?

Nic Card?
Video card?
Processor cache?

Thanks.

You grind the whole laptop and incinerate the remains.

But as you mention focusing on the laptop is merely symbolic.

Any and all data could have been transferred off the laptop prior to destruction. Indeed unless the newspaper is willing lose unrelated information from the laptop, some of information would have been backed up beforehand anyway.

Destroying data in an open network is almost futile. The laptop connects to the corporate intranet, which connects to the internet, which connects to any third party. The assumption that the newspaper confined some of the information on the laptop is entirely unverifiable.

The solution of document watermarking doesn't work here - since the watermarks, if they existed, would simply point to whoever published the files from a secure watermark-generating server (i.e. Edward Snowden). Watermarks couldn't trace whoever propagates the material between various unsecured networks afterward, as no new watermarks are added.

However, the same mass surveillance revealed by the whistle-blower could be used to trace what the newspaper chose to propagate; providing that Edward only propagated to The Guardian and that the newspaper chose propagate only through non-anonymous networks.


Windows Server Update Services (WSUS) - can I pivot to a client machine? I'm considering setting up WSUS on a Server 2008 machine to push updates to my Windows 7 clients. If I do, I'll be following the hardening guidelines issued by MS (such as enabling SSL).

One thing I couldn't seem to find out (and apologies in advance if I have missed the relevant MS documentation!) is how the updates are signed. Obviously, the updates it downloads from MS onto the WSUS server are signed by MS, and verified by the WSUS server (right?) but does the client machine validate the certificate too, or are updates re-signed by the WSUS server for transfer to the client? Surely not, right?

My concern here is that an attacker with root on the WSUS server may be able to easily break in to all the connected machines, by sending a bogus update to them. Is this a valid concern, or does the client perform the same validation of updates as it would when downloading updates directly from Windows Update?

I'm not concerned, in this scenario, about MS's Windows Update key being compromised, and I'm also not concerned about an attacker on the WSUS box preventing updates from being pushed to clients.

Also, the client machines are not joined to an AD domain, if that is relevant. Configuration is done locally on each client.

Thanks.

Okay, I've done some investigation on this one. I still can't find any word from MS about it - presumably they feel it's such an obvious thing to do that it needs no such assertion.

Examining the WindowsUpdate.log file suggests that signature checking is taking place, and examining the wuaueng.dll file with a debugger verifies this. Windows update will reject images signed by someone other than MS.

I've done a blog post containing the gory details - http://strange.systems/a-quick-check-that-windows-update-validates-updates-against-mss-certificate.


Return address incorrect (buffer overflow) I'm trying to exploit the following code with a buffer overflow to get a shell:
int main()
{
    char str[64]

    gets(str);
    return(0);
}

The platform is Ubuntu 64 bit, arch i686.
The program is segfaulting on the 76th byte. Next four bytes are the return address.

But when i implement a x86_64 execveat("/bin//sh") 29 bytes shellcode the return address is not correct and the shell doesn't spawn.

The return address :

Have you any tracks ?

Since you are using gdb, set some breakpoints before main returns. Try executing step by step. Notice how 0x39783039 came to be the return address and see where it came from. Getting familiar with your tool will help you tremendously.
In this case, you have a typo in your python script which is sending "x90" repeatedly instead of NOPs. So, it is three times as long as you expected. Thus, the intended NOP sled is still overrunning right through the return address.
Remember that 0x39783039 is "90x9" when unpacked in ascii.


How to protect integrity of resource files in a white-box attack context? In a white-box attack context (e.g. PC, tablet, smartphone), there is no trusted entity, which can be used to guarantee some reasonable security. TPM is not considered a solution because it is not available on all platforms and is also disabled by default. This means that it is not possible to store a hash of a resource file, or some secret-key associated with this file on the system, such that the attacker (e.g. malware), will not be able to read/write/modify it.

How would one be able to detect any tampering of a non-confidential, small, resource file, in such a white-box attacker context?

My only guess is via white-box implementations of a cryptographic cipher such as AES. However, this is not a really secure approach and also requires a lot of extra memory resources.

You can't.

Once you hand a user a device, it is theirs to do what they wish with. Even if you enforce it in hardware, a smart and well-equipped user would still be able to determine a work-around. This is the same principle that stops DRM from being effective.

If your security model relies upon integrity of a file being maintained regardless of malintent by the real owner of the device, then you need to change your security model. As someone once said: "a computer is only as secure as its administrator is trustworthy"


How to run a tor hidden service from home securely? Another theoretical question about Tor: Imagine I am running a dissident web site as a hidden service. How can I reduce the chances that I get caught?

Assume I am running the server from home, over a large ISP. Going to a small ISP seems too suspicious, and giving the server out of hand is way to dangerous.

I'm especially worried about the following: The spies figure out (though the content of my site, idiosyncrasies of my writing, the times I post updates) in which country I am living. The major ISPs here are all in cahoots with the spies. One call - or a secret secret court order - and the ISP starts bisecting all connections. They disconnect half of the connections for a split second, and the spies look whether my site went down. If not, they try the other half. But if so, they continue bisecting the half I am in. In roughly log2(number of customers) steps they have identified me.

This is a very simple approach, I'm sure there are much more sophisticated attacks, like traffic correlation analyses. Are there things one can do to remain anonymous? Is there something like DNS round-robin for Tor? Are there documented best practices for running hidden services?

There is no way to securely host Tor hidden services from anywhere that can be linked to you. Hosted servers are vulnerable, of course, because you can't monitor or control their physical security. But it's a good trade-off, because losing a server is better than losing your freedom.

But don't use VPS, because (as you note) that's too readily monitored by hosting providers, who might be concerned about their liability. Use dedicated servers, with hosting providers that (1) expressly permit Tor hidden services, and (2) accept anonymous rental and payment.

Use thoroughly anonymized Bitcoins for payment. Before use, check your payment wallet at blockchain.info for taint from your initial-funding wallet.

Only access the server via key-authenticated ssh via Tor. Start with a basic static HTML site. In order to securely manage user login credentials, you'll need an authentication server, which only connects with the content server via Tor.


Accepting other similar passwords when storing a salted, hashed password If a website stores passwords as a salted hash, is it reasonable to accept similar passwords as correct?

For example, given the password stackexchange, does it dramatically decrease security if the website were to accept stackexchange, Stackexchange, or STACKEXCHANGE? The thinking here is that this will be easier for users. The first is the exact password, the second is in case the browser capitalizes the first character of their password, and the third password has inverted case, in the scenario where the user has Caps Lock on.

If someone were to get a hold of this database and try cracking the passwords, would allowing these additional combinations significantly reduce password strength?

If someone were to get a hold of this database and try cracking the
  passwords, would allowing these additional combinations significantly
  reduce password strength?

I would argue that it would not in this specific situation.  I highly doubt that they are storing three forms of the hashed password in the database, but rather hashing three different versions of the provided password and comparing it to the one hashed password that is in the database.

There is an interesting post on here that discusses how Facebook has this password functionality. and while it doesn't go into exactly what is going on in the background, the consensus seems to be that it is not a significant security risk.


Auditing EXEs to ensure buffer overflow protections are in place? (such as SEHOP, ASLR, and DEP) According to this answer, it's possible to compile a GCC-based application without certain buffer overflow techniques.  Perhaps this is even possible with Visual Studio.

How can I audit a given EXE or DLL if it has the relevant anti-buffer overflow technologies in it?  Is it even possible?

For Windows binaries you might want to take a look at BinScope from Microsoft.


Passing secret keys securely to docker containers I want to pass a secret value needed by an app that runs in a Docker container. This particular container is short-lived -- it starts up, runs a command, and then terminates.

Method 1: Pass the value as an environment variable via the command line when starting the container (Docker supports this as a command line argument to starting a container). I feel like this is bad since the command will show up in process lists (with the key and all) on the host machine that started the docker container.

Method 2: Pass the value as an env variable via an env variable file. This solves the process list issue, but running docker info on the running container from the host shows a list of all the environment variables set for that container. This makes me believe Docker is storing these somewhere on disk on the host that is unsafe (since adding a new environment variable in the running container does not update this list, it must not be reading it directly in real-time).

In general, I feel like environment variables are not adequate to securely store secret data (even if only temporarily), but I do not have enough knowledge to back up this thought.

What is a secure method for passing secret data to a container?

Environment variables are the best way to do this, specifically method 2. Docker, by default, does not allow itself to be run by users other than root. Access to the socket is prohibited. I'd say method 2 is reasonably safe, as out of the box if an attacker has root access (and can poke around in your docker containers) you're already in bad shape.

Two Docker security notes in general. Be super cautious with enabling the API, as by default there is no encryption or authentication. They have a way to use certs and TLS that they documented, but proceed with caution.

Also, if possible enable SELinux on your server. Newer versions of it are able to actually see docker containers and automatically build security contexts for each one. This prevents a container compromise from easily moving back into the host. By default docker runs as the root user, and even with the USER directive it still interfaces directly with the kernel unlike a VM. This exposes the host to any local privilege exploit as soon as a docker container is compromised.