Code injection using packet modification Is code injection possible through packet modification?

For example, if a game sent a packet declaring score=99 could I then modify the packet to score=*code* or something similar?

I guess a similar question would be, is it also possible to execute non-API code in an API environment?

Yes, in the sense that you can forge and send such a packet.

First hurdle: is it still a valid packet? This depends on the packet structure. Many games leverage existing libraries that will use standard formats such as JSON or XML, so it will not be easy to forge a packet that contains the desired code and still be syntactically correct for the involved data format.

Then, will the server accept the packet? Most game developers are wont to wonder what would happen if someone modified

"score": 999

in

"score": 999999999

While I suspect, from some leaderboards I see in Google Play, that not all developers gave this possibility enough consideration, the usual low level, low security, but fast method to stop 99% of wannabe "winnerz" would be to also include the hash of the value and of a client (== unsafe) secret:

"score": 99,
"hash": "ff24e8a1f3fddb010095102bce5a013c"

A member of the remaining 1% of gamers could easily override this by digging out the secret from the game binary, or even trying to bruteforce it out of same binary: most of the time the hash for such a simplistic scheme will be something like MD5("SECRET" + SCORE) or maybe MD5(SCORE + "SECRET"), and SECRET will be one of the entries in the binary string table, in clear.

So you send along the modified code with the appropriate hash, and it will pass muster.

If the defense is still tighter, its stage will be almost impossible to overcome, though: the game contains the server's public key and uses it to RSA-encrypt the score, not even bothering to send it in the clear.

You can ignore this difficulty if you know that the buffer overflow server side is in the code reading the variable itself, whether it is RSA encrypted or not (i.e., before it is even decrypted).

At this point you've managed to send a string to the server in the hope that it will do something with it.

If the server foolishly makes some hardcoded assumptions on the string length, that could be enough for a buffer overflow. You may have to whip up some ad hoc substitutions to avoid sending a code payload with binary zeroes, which are likely to disrupt the string copy operation, but it's doable (and has been done).

But now another difficulty arises. You have injected something somewhere in the process space of the server. How do you manage this to result in something "useful" (from an attacker's point of view)? It might very well be that all of the above only results in the server hiccuping, or malfunctioning for longer periods.


Advice on what to do after being hacked? After running a system scan earlier today, I found that my computer had been infected by a trojan horse. My reason for running the scan was because Windows kept shutting down and then recovering.

After calling Microsoft tech support, the diagnostics tech accessed my computer via remote session and discovered that I had been "cracked" (hacked) by someone with a foreign (non-U.S.) IP address.

A repair tech later fixed my computer--deleted files, installed a proper firewall, etc.

I'm nevertheless very scared that this had been going on without my knowing. From what the dx tech had found, access to my computer had been successfully established something like 18 times, and after speaking with him on the phone, he seemed positive that someone has indeed been watching my online activity or utilizing my computer (the latter is what really scares me).

Additionally, I couldn't really get straightforward answers to the questions of how long this had been occurring and what it could mean for my own safety (perhaps they simply didn't know?); in fact, I wasn't really getting many straightforward answers about anything. I remain worried because I've heard such horrible stories about victims of "cracking" who have had their identities stolen, had illegal files stored on their computers, etc.

So now for my questions: what sort of consequences can something like this have for me and/or my system in the future, and what, if anything, can be done to minimize or correct those problems? Is there any sort of entity I should be reporting this to (i.e. credit card companies)? If a hacker did put harmful material on my computer, is there any way it could survive a professional system clean-up? Could I be completely overblowing all of this and acting like a total paranoiac? Am I asking questions that no one can really answer?

Even though I've been assured that this problem has been eliminated, I'm still feeling panicked about any problems that could still arise from this. Any input would be greatly appreciated--thanks.

UPDATE: It seems that, merely six hours after Microsoft tech support supposedly fixed my computer and installed Hitmanpro (which I've been unable to find anywhere on my computer), it appears to be infected by another trojan horse (trojan.agent/svchost.exe). According to Malwarebytes, this has been quarantined--do I trust it?

What you should do now is wipe your computer and start afresh. Treat it as a lesson learnt.

You ask whether malware can survive a professional system clean-up. The answer is yes. Once your computer has been compromised, you can no longer trust that it is safe. In fact, I wouldn't consider Microsoft tech support to do a professional system clean-up. Wipe it, start over.

What should you do once you have reinstalled your system? Firstly, grab a good antivirus. Microsoft Security Essentials is an excellent free one. Tinker with your firewall. Set it to deny all network traffic, except the ones you allow. ONLY allow traffic that you trust.

You will probably want to change the passwords of your online accounts. See XKCD #936: Short complex password, or long dictionary passphrase? on how to choose a good, strong password. Alternatively, consider a password storage solution like LastPass or KeePass.

To prevent future attacks from happening, use common sense. Don't click on suspicious links, don't open suspicious email attachments. Be more wary of anything you find on the internet.

Make regular backups. Starting fresh once your system is compromised can be a huge pain. Having a known clean backup to restore from can somewhat ease that pain.


Why does Windows still use a weak hashing algorthim to protect passwords? Why does Microsoft still use LM/NTLM for hashing of password? Why are they not using more secure algorithms for hashing like BCRYPT or SHA512?

Two reasons: backwards compatibility and threat model assessment. Microsoft uses Kerberos over the open Internet, but NTLM within a network. The reasoning is that if your network has already been pwned, using a more secure algorithm offers no benefit. Internal applications also within an organization also tend to run older versions of the OS (XP, mostly), so allowing NTLM lets corporations to continue to use their older hardware and software.


I see two different sets of certificates for Google websites when I am at work and when I am at home I see two different sets of certificates for Google websites when I am at work and when I am at home.

I mean if I save the certificates (in firefox, click on the "Google.com" block on the left of https in the address bar and select "more information" -> security -> view certificate details -> export) both at home and at work they are different. (I am just comparing them using diff work.cert home.cert).

I noticed this when I started using "Convergence" FireFox plugin (http://convergence.io/)

Is it OK?

There may be a number of reasons for that. Without the information from both  certificate chains, it is impossible to give a definite answers.

Different set of servers

Google has many server clusters distributed all over the world. Your request are handled by a cluster that is near to you based on network topology. It is possible that you end up in a different server cluster depending on your and the company's Internet Service Provider. Google might use different keys for different clusters.

https proxies

It is likely that your company uses a proxy server that sniffs https traffic. Since https is encrypted and has special measures in place to prevent man in the middle attacks, the proxy server has to fake the certificate.

A normal https proxy connections works like this:

the browser tells the proxy server: "I want a low level connection to www.google.com:443"
the proxy server connects to www.google.com:443 and blindly forwards all packets from the browser to google and via versa.

A dedicated https proxy does this instead:

the browser tells the proxy server: "I want a low level connection to www.google.com:443"
the proxy server generates a key pair for www.google.com:443
the proxy server signs the the certificate with the private key of a local CA.
the proxy server shows this certificate to the browser
the browser will check the certificate. Normally it would complain, but it was told by the administrator beforehand that the proxy CA is trustworthy.
the browser sends the http request for a page.
the proxy reads server the requests, opens a secure connection to www.google.com and requests the appropriate page
the proxy server receives the answer, decrypts it, checks it and encrypts it with the session key derived from the faked private key generated in step 2.
the browser receives the answer, decrypts it and is happy.

The critical step here that breaks SSL is that the administrator has configured the browser to accept the proxy CA which is used to sign the faked keys.


What is the difference between OWASP PHPSEC and PHP-ESAPI? On the surface it looks like both libraries are designed to preform the same functionality with similar "drop-in" capabilities. Are there differences that I need to take into account when making a decision about which to use? If so, what are they?

https://www.owasp.org/index.php/OWASP_PHP_Security_Project
https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API

I would not use ESAPI-PHP.   It's a port of the Java ESAPI framework, (which has had its own issues, but soldiers on, more or less, mostly less) but the PHP port has been dead for a considerable amount of time now.  I wouldn't trust it as far as I could throw it.

I can't speak authoritatively to the PHP Security Project, but at a glance, the PHP Security Project may be in a similar state (their project page and site announces their upcoming participation in AppSecUSA 2013, which happened over a year ago) but at least it was a native PHP framework designed for PHP, so there may still be use to be had from it.  It's potentially worth researching, at minimum.


Are all SSL Certificates equal? After running a few tests from Qualsys' SSL Labs tool, I saw that there were quite significant rating differences between a GoDaddy and VeriSign certificate that I have tested against.

Are all SSL certificates from different providers equal? If not, what should one base their decision on? Currently I believe that most people will weigh up the cost vs. brand (I.e.: GoDaddy ~$70.00 vs. Verisign ~$1,500.00).

I have a feeling from what I have seen that a lot of this also depends on how the SSL is actually implemented - would this be a more accurate conclusion?

For clarity:

Godaddy SSL Lab Report
Google SSL Lab Report

Disclaimer: This answer comes directly from the eHow article. No infringement intended.

  Domain Validation SSL Certificates

  Domain validated SSL certificates are used to establish a baseline level of trust with a website and prove that you are visiting the website you think you are visiting. These certificates are issued after the SSL issuer confirms that the domain is valid and is owned by the person who is requesting the certificate. There is no need to submit any company paperwork to obtain a Domain Validation SSL certificate, and these types of SSL certificates can be issued extremely quickly. The disadvantage to these types of certificates is that anyone can get them, and they hold no real weight except to secure communication between your web browser and the web server.

  Organization Validation SSL Certificates

  An Organization Validation SSL certificate is issued to companies and provides a higher level of security over a Domain Validation SSL certificate. An Organization Validation certificate requires that some company information be verified along with domain and owner information. The advantage of this certificate over a Domain Validation certificate is that it not only encrypts data, but it provides a certain level of trust about the company who owns the website.

  Extended Validation SSL Certificates

  An Extended Validation SSL Certificate is a "top of the line" SSL certificate. Obtaining one requires that a company go through a heavy vetting process, and all details of the company must be verified as authentic and legitimate before the certificate is issued. While this certificate may seem similar to an Organization Validation SSL certificate, the key difference is the level of vetting and verification that is performed on the owner of the domain and the company that is applying for the certificate. Only a company that passes a thorough investigation may use the Extended Validation SSL certificate. This type of certificate is recognized by modern browsers and is indicated by a colored bar in the URL portion of the browser.

Additonally, OV versus EV also have an impact in terms of insurance amounts in case of compromise. The insurance premium for an EV lies a lot higher than with an OV.

Read more/original: Mickey Walburg, Differences in SSL Certificates | eHow.com


Is my email, pc or something else hacked? Recently I registered iCloud account with my gmail account. Now I received fake email from "iCloud" on mail.com email address which I use frequently for registering accounts on various sites. This email address is also recovery address for the gmail account.
Here's the fake email:

Also, something similar happened when I transferred money from paypal to my bank account. Couple days after transferring money, I received fake PayPal email with link (phishing I guess) telling me my paypal acc is limited and I wont be able to send or receive money. That email came to my mail.com account, which I also use for paypal account.

I doubt that your account is hacked. I think what you experience here is cognitive bias instead.
Such phishing mails are pretty common and one even gets these without having iCloud or Paypal accounts. Usually one simply ignores these mails. But if one suddenly gets such a mail after creating or using such accounts, one is prone to assume a causal link between these two events - even if none exists.
This cognitive bias does not need to be solely caused by one's own mind. A self-adapting spam filter might play its role too: If usually such phishing mails are treated as spam and automatically moved away, the spam filter might realize that one suddenly has an actual interest in iCloud and Paypal. It might therefore treat new mails about this topic as relevant too. This way one will suddenly be exposed to phishing mails, which in the past would be automatically moved out of sight.


What is the best way to go about generating a “token” for user authentication Let's say I have a MySQL database with thousands of user accounts in it. These accounts contain lots of data, but for verification purposes, they each contain a username and a (hashed and salted) password. Now, when a user requests signing in, I will take a username and password from them, transfer it via WSS to a Node.js server then transfer it via HTTPS to a PHP file on another server. On that server I will look up the username in the MySQL database, and if I find an account, I will hash the password and see if it matches that username's password. If they both match, then I want the PHP file to create a "verification token" of sorts, save it (and associate it with the account verified) and send the token back to the Node.js server. I then want the Node.js server to send that token back to the client and for the client to save that token. Now the next time the user connects to the Node.js server via WSS, I want the client to check for an existing token, and if it exists I want it to send that token via WSS to the Node.js server, the Node.js server to send that via HTTPS to a PHP file, and that PHP file to see what account that token belongs to, and complete the sign in...
So I guess my first question would be: Is this a good model? Would this be a good idea, and would this be secure, or should I do this differently?
My second question is: What would be the best way to go about generating this token? Should it be completely random? Should it be a combination of letters+numbers? Should it be a hash of some random values? How should I go about the generation of this "token"?

To clarify, I'm not asking how to build a server or make requests or transfer data or anything of that sort, I'm merely asking what is the most secure way to generate a "token" that can be used as authentication to the same degree that a username+password can be used.
Thanks in advance! I'm sorry if this is a really stupid question.

Short version:
Tokens should be either completely random, or cryptographically signed data (either asymmetric signature algorithm such as RSA or ECDSA, or message authentication code such as HMAC) using a key only the server knows. In the latter case, everything except the signature can be whatever you want (including simple human-readable text), but there are standard formats with existing libraries and I recommend you use them.
If you want to go the "random data" route, it's sometimes a good idea to store a hash of the token server-side, and hash the user-submitted token before validation (this is an easy way to avoid timing attacks on the check).

It sounds like you're trying to re-invent the "access token + refresh token" model. Leaving aside the probably-irrelevant stuff (why do you have a Node server sitting between your users and a PHP back-end?), it sounds like you're trying to develop some sort of long-term access token.
In theory, this is trivial; just generate a securely random string of bytes - 16 bytes out of /dev/urandom is fine - and then hex- or base64-encode that and use it as the access token (provided to the client, and the client transmits it with every request). The server maintains a dictionary in memory of user sessions and, upon receiving the token, looks it up in the session dictionary to retrieve the user info. The sessions have an expiration (possibly known to the client, but enforced by the server after which the user needs to actually log in again, but the expiration can be years or decades away if you really want it to. The server should also support invalidating a token (logging out) on demand, before it expires.
In practice, the trivial approach doesn't scale. First, anything that requires storing state on the server gets expensive when you have lots of users, especially if the sessions are long-lived. Second, this breaks down when you switch from a single back-end server to a cluster, because now you either need to cache sessions across the whole cluster and keep them in sync, or you need to route each request to the correct back-end server in the cluster (the one that has the relevant session). Both approaches are possible but both kind of suck.
The common solution, then, is to put as much state as possible on the client rather than the server, but sign it with a key known only to the server so a malicious user can't modify their session state (for example, to impersonate another user). This is typically done using a JSON Web Token, abbreviate JWT; these are a standardized three-part format for tokens that encompasses metadata (issuer, expiration, etc.), session data (user identity, permissions, anything else you want), and a signature over the other two parts (to prevent modification). The great thing about JWTs is that they require no server-side session state or DB lookups at all - if the token is within its validity period and the signature checks out, you can trust all the data in the JWT - so they are great for scaling. The problem with JWTs is that there's no good way to revoke them or dynamically lower their privileges; because the server stores no session state, it can't tell when you want to modify a session or end it prematurely.
The solution to that last problem is to make the JWTs very short-lived - typically a few minutes - and add "refresh tokens" (which is basically the random string mentioned above, stored in the DB on the server side). The refresh token is only used when a JWT is expired, or possibly just when it will expire soon, and serves as a long-term token that can be used to retrieve an updated JWT. While the JWT can be validated without needing a DB lookup, refresh tokens can't; they are stored in the DB along with any other relevant information. However, a user might make hundreds of requests that use the JWT in the time before needing to refresh it, so the load on the DB is still very low compared to a session lookup on every request, and you still avoid the state synchronization issue.
The total process looks like this:

User visits login page, provides credentials.
Server validates credentials, generates a refresh token and an access token (probably a JWT) back to the client.
Client includes the JWT with every request for a few minutes, allowing the server to keep track of session state without needing to store that state between requests.
Client periodically uses the refresh token to request a new JWT, which will be valid for a few minutes more.
If the client goes away without logging out, the JWT will expire but the refresh token will remain valid, so the user can resume their session without needing to log in again just by using the refresh token (as in #4).
If the client logs out (or the session is otherwise terminated for some reason), the refresh token is deleted from the DB. The user could in theory continue using the access token (JWT) for a brief time, but can't refresh it any more and would need to log in again.

With all that said... you should seriously consider using some existing authentication and session management library, rather than trying to build your own. Not all of them are good, but some of them are... and most (though not all) are written by people who didn't need to ask this question. For example, "salted and hashed" is not sufficient for password storage. You need a slow hash function, ideally one explicitly designed for password hashing. Using a well-reviewed open-source library will save you from needing to know all this stuff, and avoid common pitfalls, while also saving you development time.
At the very least, if you do use JWTs, use a library for them. Generating and checking random tokens isn't too hard to do securely (though ideally you do want to avoid things like timing attacks in the string comparison), but more complex token types with digital signatures and so on should be handled by library code. Honestly, though, if you have to ask "completely random" vs. "a combination of letters+numbers", you should let other people handle this.


Is it worth it to implement both SHA2 and SHA3 at the same time? I'm creating a password storage system for a web server I'm building for fun.

Would it be more secure for me to use both SHA2 and SHA3 for hashing, and then store them in a database? If I use both algos, then I would be able to detect whether or not someone tried to send a SHA2 collision (however unlikely that may be), as the SHA3 hash would be wrong.

But is SHA2/SHA3 so secure that this whole endeavor is entirely pointless?

You are doing it wrong, and thinking it wrong. The problem with password hashing is not, and never has been, about collisions. The main problems with password hashing are speed (hash functions are too fast) and parallelism (a hash function is always the same as itself).

There is a lot of theory on password hashing. As an introduction, read this answer. The simple one-line summary is: use bcrypt.

Making anything better (i.e. more secure) than bcrypt is hard (some people are trying, and do it the right way: with an open competition, public research, and years of effort). However, making something which is much worse than bcrypt is very easy, and a lot of people achieve just that seemingly effortlessly. By your scheme with a combination of SHA-2 and SHA-3, you would be on the right track to add one more person on the depressingly long list of people who felt that creativity was a good thing in cryptography, and paid dearly for it.

(None of this says anything about SHA-2 or SHA-3 as generic hash functions. But, despite the names, hashing and password hashing are in fact very distinct activities, do not have the same requirements, and should not use the same algorithms.)


Comparing TLS and Cipher Security I'm trying to compare the connection security of two different websites. I'm going to be entering some Sensitive personal information into one of these websites, and, because I'm not familiar with this part of the banking world, I'm looking for some opinions on their security.
I've checked the Connection Security on both websites and one seems a bit "behind the times".
I'm also not an expert on this aspect of Information Security, but I have a general understanding.

Website A: TLS 1.0 AES with 256 bit encryption (High); DH with 1024 bit exchange

Website B: TLS 1.2 AES with 256 bit encryption (High); RSA with 2048 bit exchange.

Both Websites use HTTPS (obviously), however the browser Google Chrome and Firefox flag Website A as trying to run "unsafe scripts". I looked into it and it appears to be loading some Javascript and trying to import a google font over an unsecure connection.

Website B seems more secure because its using TLS 1.2, though my understanding is the security also has to do with implementation. I am also more familiar with RSA vs "DH" though I won't pretend to be an expert.
I also don't want to fall for the fallacy of "bigger numbers = better". Website B is also part of a major credit agency so I feel more comfortable with them.

Thank you for any help you can provide!

EDIT: I ran both sites in ssllabs.com as suggested by user kaidentity. Site A got a C- and Site B got an A-.
I'm still interested in hearing (and learning) more if anyone has anything else to add.

The TLS version and cipher suite are the relevant parameters for the connection security of a TLS connection. The information above doesn't show the full ciphersuite, e.g. the hash algorithm is missing.

However, instead of getting opinions from individuals here on this site you can get some kind of official rating of the quality by submitting the host name to the "SSL check" on https://www.ssllabs.com/. It will give you a rating (A, B, C) and checks a lot of stuff.


Why doesn't outlook 2013 meet modern security standards? It is required to turn on the allow less secure apps setting in order to be able to use a gmail account with outlook 2013, despite it is using the IMAP and SMTP services with SSL protocol enabled.

Why doesn't outlook 2013 meet modern security standards?

That specific GMail account flag simply allows system that uses standard SMTP to connect without using OAUTH2.

The only secure password authentication method gmail allows SMTP clients to use is a (non.standard) XOAUTH2 SASL mechanism (the correct tag is actually OAUTHBEARER).

GMail has decided to refuse all other secure login mechanism: you're either using their own flavor of OAUTH2 SASL or you need to enable that flag and use the LOGIN (i.e. cleartext) password. Security-wise, your password is still proetcted by the TLS encryption. What changes is that the client application needs to keep your password in an encrypted format while, with OAuth, it keeps an access token (a per-application password, if you want).

In other words: it's not that Outlook does not "meet modern security standards", it's that google have a very peculiar view of what these standards are.


ClamAV detected CVE-2014-8449 in some PDFs. How do I know if it's a real problem? We run clamav on all our user-uploaded files. It's currently giving this message for several PDFs:

<filename...>: Pdf.Exploit.CVE_2014_8449 FOUND

Looking at the CVE, it's for a integer overflow in Acrobat. So what does it mean that a PDF matches a signature definition for it? Has ClamAV detect actual code that would run as a result of the overflow, or could this be a false positive? How would I tell?

If there is indeed malicious code in these PDFs, we'd like to stop serving them and inform the users. But it would be nice to know if these are just a bunch of false positives.

If the files are not sensitive from a content point of view you can upload them to a checker such as Virus Total

If this also gives you a positive result it's likely an infection.


How to use testssl.sh on an SMTP server? I need your help with testing SMTP with testssl.sh.
This is the command that I run:

./testssl.sh -t smtp [IP]

Where the IP is the SMTP server IP where I know there is an SSL/TLS certificate.

With the preview command I receive an error message - "testssl.sh can't connect to SMPT server". I think it is an syntax error. What am I doing wrong?

wget https://testssl.sh/testssl.sh

chmod +x testssl.sh

./testssl.sh --mx <domain name>

works fine.

./testssl.sh -t smtp <ip>:25

and

./testssl.sh -t smtp <ip>:587

also work fine.

Note that not specifying the port assumes port 443, despite specifying protocol smtp. That doesn't work.


Is it exists a possibility to encrypt with several public keys and decrypt with any of them? I need to implement the following  scenario:

application generates string - "Hello world"
ask the user about his Public Key
user gives his Public Key to application (no privacy violation)
application encrypt this string with both Public Keys: it's public key (application's) and user's public key.
application stores encrypted string in the database.
once user wants to show the data - it takes the encrypted string and decrypt it with his private key
the same thing for the application.

PGP has a method for handling this that (in your case) would go something like:

To protect the data:

Application knows user's public key (Ku)
Application generates "Hello world."
Application generates good symmetric encryption key (Ks)
Application uses Ks to encrypt "Hello world."
Application makes a copy of Ks that's encrypted with Ku
Application makes a copy of Ks that's encrypted with application's public key (Ka)
Application stores encrypted string and both encrypted passwords

To retrieve the data:

Application delivers the copy of Ks encrypted with Ku
User decrypts it using their private key
Application uses the decrypted Ks to decrypt the data and display for user.

Because there's a copy of Ks encrypted with Ka, the application can decrypt the data without the user as long as the application's private key is available.

EDIT:

As @CBHacking stated in comments, it's highly advisable you find an existing well-tested crypto system that will suit your needs. Roll-your-own crypto is an easy way to make embarrassing mistakes. Speaking as someone who implemented the first non-plaintext password storage at my company, there are plenty of options created by people who understand this stuff way better than we do.


Custom Python Server - how to secure it? I'm going to purchase my own dedicated server service soon and run few python server scripts on it.

Firstly, let me tell you that I am total noob when it comes to internet security and was unable to find answers to my questions using google.

I want to have few python servers, listening on different ports and providing me with different services. For example one of them will poll few websites to get their content and update data on the server. Then I will connect to it and grab the most recent data. Communication between server and client will be in JSON format. I would want to enable file downloading as well. Probably using SFTP to secure whole process.

So my questions are:

How can I implement secure connection between client and my python server? I guess I could use SSH or SSL, but which one will be better suited for the job? And If I choose SSH then wouldn't it interfere with SSH login service I use to manage my (whole) server?
Is opening multiple ports very insecure? What kind of attacks could it bring on me? How can I prevent them?
Do you have any other tips regarding own server implementation?

As I'm totally new to this stuff please tell me if you see any gaps in my logic :)

How can I implement secure connection between client and my python server? I guess I could use SSH or SSL, but which one will be better suited for the job? And If I choose SSH then wouldn't it interfere with SSH login service I use to manage my (whole) server?

If it is only you that will be connecting to the server, I would secure the whole process using a VPN.

  Is opening multiple ports very insecure? What kind of attacks could it bring on me? How can I prevent them?

The ports are only as secure as the services listening on them. Opening multiple unneeded ports serve to increase the attack surface of your server, as there are many more points of failure possible. Disable all unused services on your server.

  Do you have any other tips regarding own server implementation?

Keep your server up to date. This involves running a command like sudo apt-get update && sudo apt-get dist-upgrade on Ubuntu-like distros or yum update on RHEL-based distros.

Have proper iptable rules configured. See this link for a good baseline. Configure as necessary.

Configure ssh to use key-based authentication instead of passwords. This helps to increase the difficulty of bruteforce attacks against the ssh service. Disable root login using ssh.


Brute Forcing Domain Controller I have a MS-Server2K3 domain controller that also serves as a Exchange server. Due to recent network speed loss and issues I began looking at event logs and noticed an exceptionally large number of faulure audits wich is an obvious dictionary attack with it cycling through users in alphabetical order. The workstation name was the same server that hosts the domain controller. Also the logon porcess was advapi.  This stopped

In addition to this I have a large volume of MSExcahnge AL informations statements in the exchange application logs. 20-30 a second. Ldap operations, search of directory, and completed call to policy group provider.

What could be causing this and how to prevent it. We have consistent antivirus protections across the network and have run quick anti-malware on this server.

If there is anything I need to clarify please let me know. I am relatively new to active directory and exchange.

Thanks

If you are sure it's brute force/dictionary based attack against Domain controller authentication, anti-virus may not help you here. Anti-virus works on signature based strategy where as unsuccessful authentication attempts (part of attack) are just normal connection attempt without carrying any malicious data in them. So anti-virus or malware scanner will not be able to get you any information about that.

You should try finding source workstation/domain member which is launching brute force attack against your DC. And further investigation should be launched who's using that workstation depending upon attack times, valid/invalid use of creds whether it is by an internal authorized user or someone on the network trying to launch attack from unauthenticated perspective.

You can prevent this by host based intrusion detection capability where such mass attempts should be blocked by IP address or any network monitoring software that should tell you spike in traffic towards domain controller from a particular source.


Full Disk Encryption, Single User System: User/Root Passwords required? Are there any security issues of having no (or weak) passwords for user and root account on a single user system with full disk encryption (except boot partition)? Assuming no SSH server is running, or SSH is only valid using authentication keys.

In modern versions of windows and most *nix distributions you typically run with lower level privileges and then elevate your privileges ("run as" / UAC / sudo / etc.) to do more risky tasks. In some cases there is just a prompt, but a more secure configuration would require the password each time you elevate.

If a malicious script or malware runs and want the hire privileges, the password can act as a gate. If you are always running as root or Administrator without a password, malicious software or scripts may just run commands on their own.

Full Disk Encryption only protects the data when the system is off; when the system is live the data is plainly accessible. The password or key you use for FDE serves a different purpose from operating system and user passwords. You can choose not to have a password on user accounts, but the FDE doesn't really protect against the same types of threats.


How does IIS persist identity credentials? Does it create any security issues? We want to implement a feature similar to IIS in how it remembers user configured usernames and passwords.  As I understand it, when you configure IIS to use a set of  credentials for an app pool identity and run under the context of that identity using those credentials (username and password), it also then stores the credentials so that when the machine restarts, you don't need to manually re-configure it in order for it to continue using those same credentials.

However, since the credentials are persistent, this means that any user who can access the persistent storage (be it the  file system or some other form of storage) could potentially extract the username and password.  Is this an security issue?  How does IIS resolve this issue?  If it only saved a token, which would result from the username and password for authentication, it wouldn't work because you would also be extract the token and use it.

It doesn't.  This is why the service accounts should only have the minimum level of permissions necessary.  If the application server is compromised, so are the service accounts that it has access to.  I'm pretty sure even an HSM couldn't help any since the system needs to be able to get the password out of whatever storage to submit to network resources.


Securing 2 factor data from apps that are co-located on the same device? Several apps such as GMail, Coinbase, Yahoo and others require the use of the mobile device to gain access to the data within the app.

For example

Gmail requires TOTP in Google Authenticator (usually co-located on the same phone)
Yahoo sends an SMS message (to the same phone)
Coinbase uses Authy uses an app (usually co-located on the same phone)
Microsoft Azure/O365 (similar to Authy) uses an app (usually co-located on the same phone)

Any compromise of the phone, or more specifically inter process communications between apps, could allow a rogue entity to gain access to my protected data.

Question

What approach is generally more secure? (app, vs SMS, etc)
Is it a risk that PhoneFactor (Azure, 0365) has an in-app approval button that permits access, or is that a fair trade off between ease of use and security?
Can someone explain the risk an OTP style app (listed above) getting the secrets compromised?

I assume that the risk is greater for Jailbroken iPhones and Rooted Androids.

SMS or app:

App-style access is more secure on both major platforms since app data is sandboxed while SMS provider is publicly accessible from all apps. Android is a little bit more secure than iOS since it gives the user a list of privileges an app is using hence giving out a clue to the user to be more cautious when the app asks for SMS access (or, if using CyanogenMod, it can be even shielded from SMS by Privacy Manager).

On the other hand if the device is compromised sandbox won't help you much unless the sandbox is encrypted. I believe that iOS does this but I'm not sure, you'd have to ask some iGeek that. A sandbox breach clears the difference between sms or other app since sms app is just another app. Some OTP apps encrypt their secrets using a PIN and some devices have some kind of TPM circuitry that might be leveraged.

OTP secret compromise:

If your OTP secrets are leaked, the OTP can no longer be considered secure. You should negotiate new secrets ASAP. It equals to your hardware OTP token being stolen.


Will ISP see my router MAC address? connection by 4g USB modem Question is similar to Will my USB modem send my MAC address to my ISP? but not exacly.

I have router dwr-116 and usb 4G modem which is connected to this router.

Will ISP see dwr-116 mac address? or will ISP see only 4g modem IMEI ?

I think that ISP will see only 4g modem IMEI but maybe i'm wrong?

No. ISP cant see MAC address of your router. MAC is a layer 2 address which exist within the network only.

And yes, your ISP will see only the IMEI.


How can I launch DHCP starvation attack in WLAN? In WLAN, due to MAC association on Access Point (AP), I can't send the DHCPDISCOVER messages using random MAC addresses. But if I keep my original MAC address as the source ethernet MAC a and random MAC address in the CHADDR field of DHCP packet and send the DHCPDISCOVER message, it is passed by the AP and transmitted to the DHCP server on the wired side. But again, when the DHCP Server replies back with DHCPOFFER message, it extracts the CHADDR mac from DISCOVER message and make it as destination MAC address for DHCPOFFER message. When it reaches to AP, it directly drops that packet because that random MAC address is not associated to any device at all.. What to do, please help?

Note: Its working fine on the wired LAN.

I think you must create a "fake association" first with that mac to the AP in order to be able to launch that DHCPDISCOVER message. It seems your access point is doing a "good work" protecting the network but it can be avoided.

Maybe you can create some kind of script to change the mac, create the association, and then launch the starvation attack.


What security measures should be taken when running a Linux web server out of our office? I am interested in running our company's web server from our local office. The office makes use of file sharing and NAS devices among other common office protocols. The worst case scenarios I've envisioned would be someone eavesdropping onto company emails, doing packet traces, etc.. I want to take the necessary precautions that will help ensure it is harder for someone with malicious intent to gain access to our internal network via the web server or potentially listening to outgoing traffic if our company's dedicated IP is made known. Here are some of the things I'm considering:

Disabling SSH/FTP port access from outside our network.
Changing defaults ports (e.g. changing default HTTP/HTTPS/SSH/FTP ports)
Implementing firewall rules on the web server itself
Restricting sharing and internal network access on this Linux server so that it's harder to communicate with other computers on the network

Is there anything else that stands out? Some common security practices that I should adhere to? Thanks in advance.

Unless you have a very good reason to do this, you are likely to find that this not only introduces potential risks for your site and office infrastructure, but also provides a detrimental experience to website users.

At the very least, you should use a firewall to drop all traffic to unexpected ports (probably 80 and 443, depending whether you use HTTPS or not), and ensure that the web server system is isolated from other office computers and networks.

Changing the default HTTP and HTTPS ports will cause you headaches relating to users having to specify a port in order to connect to your website, and provides very limited protection for any other service (it takes a matter of minutes to scan all possible ports on a given IP address - if someone is looking at your server, they would find that SSH was running on 2020 rather that 22).

You should also consider how your network could be affected by denial-of-service attacks, if you are sharing the internet connection with your web server. If you do not have complete isolation between the web server and the rest of the network, it would also probably be possible for a determined attacker to pivot from your web server to attack other systems, which are probably not hardened for attack in this way.

It would also be important to keep the web server patched with the latest security patches, since the impact of an attack could potentially extend beyond just the one server.

On the other hand, if you host your site through a managed hosting provider, they will have dedicated bandwidth, firewall systems to minimise connections between servers, may well install security patches as they are released, and, depending on the provider, may handle basic backups and fall over procedures.

There are very few reasons for any small to medium business to self-host, so any decision to do so should only be made if there are specific reasons which cannot be overcome in other ways.


Why are js libraries designed to be loaded in iframe? I am developing a JavaScript library which users would include in their website. a common theme across 3rd party libraries is that they are loaded in a n iframe. (ex you tube) . Is there any specific reason for that from security point of view?

my library was initially designed to be loaded in iframe but because of some very particular cases i think only way i have is to somehow load it directly in DOM.

Loading javascript in an iframe "automatically" protects the parent from unwanted changes with respect to some flavour of the Same Origin Policy that browsers adopt.

So they limit the damage that a third party library can do when attempting to change your original web content; for example, they may modify an legitimate link to some other same-looking place that performs some phishing and steals user's information, cookies, etc.

This is not the only way where the same origin policy is implemented, but it is quite an easy one. In the case you need (safe) interaction between the parent and the iframe, one of the ways is to perform postMessage calls.


Powershell opened up, switched to administrator mode and ran scripts all without me touching my computer. How worried should I be? I'm on a laptop running Window 8.1 connected to the internet running Kaspersky. I am the sole user and administrator of this laptop.
While going about my usual work, I paused for a moment (hands off both keyboard and mouse) during which time a powershell windowed opened all by itself and started flashing. With each flash, the window switched between Administrator and normal mode until after about three seconds and stayed steady in Administrator mode. It paused for about another half second and then ran something so fast I couldn't see what it was and then a second powershell window opened up in front of it and ran something else but this time all the output was in red text.
I've tried to google around and find out what might have caused this but I haven't been able to find anything of value so I'm hoping that somebody in this community might have some awareness of what this is, whether or not I should be concerned and what I should do about it.

In short: Powershell opened by itself on windows 8.1, changed itself to Administrator mode and ran two scripts all without me touching anything. Should I be worried or terrified?

While I'd recommend following ekaj's suggestion and trawling your logs to be sure, it sounds very suspicious to me.

If you have allowed automated updates, it is possible that this was part of an update script...but usually updates present quite formalised user information.

Safest bet is to assume the worst - and wipe it and rebuild. A Powershell running as admin could have done anything.

We have a range of questions here on what to do once a machine has been compromised...the canonical answer is, however, to do a complete wipe, and either rebuild from a known clean backup or from installation media.


Login form authentication logic I am building my login form action, and I want to make sure my logic is solid and as secure as possible.

1.) First I check if the provided e-mail address exists in database, if not, I show a generic error message Invalid e-mail address or password. and exit. Notice, the error message does not specify that the e-mail does not exist.

2.) Then I check if failed_logins which is stored in the database is greater than 5. If it is, I show an error message User has been locked out due to excessive invalid logins. and exit. Notice that this message is shown if a user account is locked out, but the incorrect password was provided. I did this because if an account is locked out, I don't want a potential hacker to be able to determine if they provided the correct password.

3.) Check the password comparing the bcrypt hash in the database with the password provided. If incorrect, show Invalid e-mail address or password. increment failed_logins in the database and exit.

4.) Check the flag activated in the database. If activated is set to 0, then show an error message User is not activated. Notice, they have to provide the correct password to see this error message.

5.) Valid, set failed_logins back to 0 in the database and set the sessions.

Is there anything in this logic that is flawed or insecure? Thanks much.

Some attacks to think about:

Tricking the failed_logins by clearing your session id.  Enumerating accounts by trying to lock out existing accounts.  DoSing administrative accounts by locking them out with failed login attempts.  Enumerating login names with the forgotten password feature or with registration,  or insecure direct object reference. Spoofing your ip address by supply a x-forwarded-for http header element.

Broken session management:  Session Riding (CSRF), Session Expiration, Session Fixation, Problems with Cookie Domain/Folder Scope, Storing Session ID's in plain text in the database,  Insufficient entropy in session ids.  Not setting the "secure" and "HTTPOnly" flags.  Clickjacking.  OWASP A9...

Did I miss anything?

YES


Source code as password Passwords with a mixture of letters, numbers, and special characters are sometimes hard to remember. Is it secure to instead use a small amount of memorable source code as a 'passphrase'?

As an example, take a simple for loop in Go: fori:=1;i<5;i++{fmt.Println(i)}

Normal people would only see the cryptic syntax, but as a person with a programming background, this may be more easy to memorize.  Would it be at least as secure as a normal password?

You can use source code as password.

However I'd strongly recommend against using source code as a passphrase.
The reason for this is entropy.
Passwords / passwphrases need to provide lots of entropy (100 bits+) and programming languages usually pose severe constraints on the formulation of instruction thus resulting in less entropy per character than even with a standard passphrase.

What may be possible aside of that, you can use source code files (100 lines+) with lots of complex instructions and non machine-codable as keyfile.


Java SE 8, Update 51 Added "Native Sandbox" Protection for Windows PCs. Wait, what? So I was doing a little research about differences (if any) between the sandboxing models for Windows 8/8.1 applications and windows 10 applications when I stumbled across something rather interesting: when Oracle shipped Java package 8 update 51 a few months they added a new feature that seems to have flown way under the radar:

  New Features and Changes

  Operating system's restricted environment (Native Sandbox)

  JDK 8u51 introduced the following changes to Native Sandbox:

  Native sandbox is available on Windows platform only.

  Native sandbox can be enabled or disabled through Java Control
  Panel->Advanced settings->Enable the operating system's restricted
  environment (native sandbox) or by setting
  deployment.security.use.native.sandbox property to true in
  deployment.properties file.

  Native sandbox is disabled by default.

  When native sandbox is enabled, the sandbox applets or web-start
  applications will run in a restricted environment, that is provided by
  the operating system. This will not affect the all-permission
  applications and they will continue to run as before.

The link is here.  It contains a little more (very little more) information.  And trying to find documentation or discussion elsewhere has turned up ... well, basically nothing.  Nothing.  Were it not for that bit of text in the release notes above and the existence of the new option in the UI there would be no reason to think that a new capability had been released. Strange.

Anyway, setting aside why there's an amazing lack of information out there about this "Native Sandbox" feature, does anybody actually have any further idea of what it is, and what it does? Does it move the Java VM and libraries into the sorta-semi-sandbox "Protected Mode" privilege area that IE uses? Does in take advantage of the Windows 8/8.1 and/or Windows 10 app models to put Java VM and accompanying stuff into a new Windows application sandbox.  (I know Microsoft has said that in 2016 it's going to ship a capability to put traditional desktop programs into sandboxes and distribute them through the Windows 10 store, so maybe putting Java player into a Windows 10 sandbox might not be out of the question.)  Something else completely? In either case, the VM would still be there, running within the extra sandbox? I'm kinda baffled.

And why hasn't Oracle said anything about this, except (apparently) on the one single page? The feature is obviously in the product. Why is it disabled by default? Is it supposed to be in testing, somehow? Anybody?

EDIT:

Doing a slightly-different Google search turned up, ironically, a very similar question already asked on Stack Exchange by someone else but unanswered.  Apologies if duplicated that question...but, does anybody know anything more about this?

Since you sound like a Java developer then you know that Java code can modify system level things. If an applet is malicious they take advantage of this fact to try and gain access to the client system. This sort of attack is hard to stop because by the time the applet runs, it's already to late. This native sandbox is another level of protection provided by the Windows OS that makes it so that if an applet breaks out of a browser, it shouldn't be able to do anything bad since it's inside a sandbox. If it is designed to interact with the system and it gets approved to do so even if a sandbox is set, then it will be able to since then the applet would be one allowed to do this by the Exception Site List or the run time environment's Deployment Rule Set. So you could run applets in the sandbox by default with this setting just to make sure you're extra protected until Oracle decides to turn it on for everybody, but be aware that if you do this some of the ones that need to interact with the system won't work unless they get approved or you tell it to allow them too.

Disabling it by default will allow legacy applets to update and (take advantage of/prepare for) it before it gets enabled by default if Oracle chooses to do that, or if a security over conscious user wants to use a "dangerous" applet, they can do so with confidence that it won't(hopefully) ruin their system.

Currently many applets probably aren't on the ESL or many environments aren't setup to use the DRS, so by setting it disabled by default they can make sure that it won't break anything(yet). Another reason may be that this option isn't entirely supported by Windows yet, and they have their part done and Windows just needs to catch up now or they are still ironing out the details before flipping the switch. There are still many more reasons that setting it by default right now makes sense, but we won't know until they say more. My guess is they have it set off until the ESL is large enough that they feel safe in setting it on without the people who won't read patch notes asking a flood of questions about why so and so no longer works on such and such website.

Edit:
After a bit more digging it turns out that the windows 10 sandbox exists already for windows store applications, info here and here, that can now be used by Java applets when correctly written and setup without problem. So it will be in the App-V sandbox used by windows store applications and newer desktop applications on Windows 10 since that seems to be the new default Windows Sandbox.


How will users know if their session is DNSSec protected or not? There is definite security value in having DNSSec-verified connections, however I have yet to see software indicate if the connection is secure.

Ultimately I would like my users to recognize that DNSSec is a more secure solution, and prefer it or demand it when handling our business transactions.  It would give us the competitive edge.

  What are my options to get users to see that they are more secure with
  DNSSec?  They don't have to understand it, and it's better if they
  don't have to go trolling though menus to determine this.  Suggestions such as Browser plug-ins or solutions for LoB applications are more than welcome.

It's a shame that EV certificates are the ones that highlight URL in green.  I would think that DNSSec is more of a fundamental security improvement than EV, which essentially is Security Theater in comparison.

I strongly believe that the pure usage of DNSSEC should not be indicated to the user at all. DNSSEC just ensures that the DNS lookups are not tampered with by third (fourth?) parties.

DNSSEC does not ensure that the connection is really established with the returned IP-address nor that no attacker is listening in on the data. So pure DNSSEC is way too complicated to understand for an average user compared to the small gain in security.

An interesting approach is to publish the public SSL key via DNSEC instead of or in addition to using the traditional SSL certificate authorities. This solves one of the main issues of the traditional approach: At the moment any (transitive) trusted SSL certification authority can sign certificates for any domain. With a DNSSEC based approach only the authority responsible for the top level domain can sign. This greatly decreases the attack surface. (And places a lot of power at the domain authorities)

The visual indication of "SSL with public key published via DNSSEC" should be  similar to SSL using EV certificates. I doubt that we see the traditional approach to go away any time soon because there is a lot of money involved.


Is it good idea to use a access point MAC address as wifi password? I realized that one network I'm connecting with is using a MAC address of one of its interfaces.

If an attacker would know that fact, could he somehow obtain the MAC address wirelessly and break into the network? Let's exclude brute force attacks.

The answer is: No it's not a good idea.

There are several reasons for that. The first and most important is that the mac address of the router is broadcastet by the router multipile times every second. This is done by sending so called "beacon packets" which contain a log of information which is realted to that access point. This means the mac address can be obrained by simply running a tool like airodump-ng which captures and displays the content of these packets.

Also it is never a good Idea to use a password that has a direkt relation to the service it is used for or the person the account is associated with. This is because its very common for attackers to create wordlists from every pulic available source that is related to the target. This might also contain a scan of the wireless networks and in that result the mac address of the accesspoint.


Risks to company while performing the penetration test I would like to know what the risks a penetration testing company faces while performing tests for clients.
For example: A penetration testing company named "A" providing services for a client called "B". So now what threats would company "A" be exposed to if they do that test for client "B"?

For example the threat to company "A"'s own data, if client "B" has serious vulnerabilities in system.

Real penetration testers should not be using their own office bandwidth. If you attempt to access a system from a registered IP address, it's not that difficult to reverse look-up to be able to see where the traffic is coming from. If this is a red team / blue team scenario, then the internal staff already know who the attacker is, and may adjust their protections accordingly if they're trying to appear more secure in an attempt to save face. Some pentesting firms stipulate dropping the firewall connections or allowing specific accesses so they're not testing the firewall itself, but if the company is already infected this could lead to significantly more damage and new unwanted intrusions if not done properly. It's unlikely, but this may allow a tunnel into the network of Company "A" if they're using a localized net.

Penetration testers should definitely be using hardened goods, if they are professional they should be ideally very difficult to thwart, detect, and even trace.

The biggest issues might be legal.

If Company "A" doesn't have the proper legal documentation to perform the tests on Company "B," then depending on the legal jurisdictions, Company "A" could face issues with the ISP contracted by Company "B" as they are not likely party to the agreement in the case of something like DDoS (distributed denial of service) testing or added network strain. Also if the equipment Company "B" owns is housed in a facility like a server farm there may be certain restrictions on bandwidth and the actual tests being performed across the network. Certain activities could cause alert of the authorities even though "permission" has been provided by the target. Someone on the server farm's DFIR (Digital Forensics Incident Response) team might react to the intrusion.

All impacted departments at Company "B" need to be onboard. Nobody likes being sued because there is a breach in a department that is not part of the arrangement. All of Company "A" team players need to be vetted legally.

If the DFIR team at Company "B" detects non-authorized intrusion from Company "A" there could be an issue down the road. This is in the event of a rogue employee who finds an exploit they decide to take advantage of themselves on their own time. Then there are other legal issues.

Also if Company "A" doesn't outline clearly what they are testing for and they bring down the server of Company "B" with an exploit, then there may be issues that stem from the downtime if there aren't legal clauses in regard to indemnification. "We're not responsible if we find an exploit that breaks your current installation. Clients are responsible for maintaining backups." That sort of thing.

Company "A" needs to verify every system they will be testing and make sure they don't test any systems not part of the agreement. In certain municipalities it is illegal to be on a network without authorization, so it really depends on the laws of all of the areas involved. Cross-border intrusion can also have negative impacts as well, again depending on the states. They'll want to make sure if they happen to find another network that's not disclosed, that they don't go testing it as well. Simply document all of the issues and present the report with findings and recommendations.

If there is an infection, it's best to investigate the infection on-site, clear it, then perform the tests, otherwise there may be false positives and too much noise vs signal.


Why do medical institutes block VPNs? I was faced with a security control i never saw before,
recent i was in a local hospital and i tried to connect to a VPN server via NordVPN mobile app. The effect? A graphical infinite loop showed up and it took unexpected long while it never successfully connected to all of their servers. I'm sure it was not a network issue.

Is this of to manage legal security issues?

I doubt that they explicitly block VPN. But it is not uncommon that free networks and sometimes even paid networks in hotels restrict access to only allow web (HTTP/HTTPS) and mail in order to reduce possible misuse of their networks. This can have the side effect of implicitly blocking less common services like VPN as collateral damage.

Specifically for NordVPN see the NordVPN FAQ for firewall settings:

  What ports should be open on firewall/router for it to work?
  1723, 443 TCP and 1194 UDP ports should be open; also your firewall/router/ISP must allow pass-through for PPTP/VPN.

Likely the firewall in the medical institute does not allow port 1723 and 1194 at all and port 443 for UDP since these are not needed for the usual web and mail traffic.


How far should I go in creating anonymity? I am in the early design stages of a system (QuestGuide) to help researchers gather information (arbitrarily complex), analyze it, annotate it, visualize it, and, ultimately, share it. There are enough problems to solve that this feels like the software equivalent of the Seven Summits, but I'm retired and this project will keep me off the streets for a few years :-).

After watching a 2-part interview with Eben Moglen at Slashdot, I realized that I wasn't designing for / thinking about anonymity. Although my imagined target demographic is academic researchers (and maybe people shopping for a refrigerator), it is entirely possible that this system will be used by people who are gathering and correlating information that, if-and-when they share it, could get them imprisoned or worse.

For the purposes of being able to backtrack to the original source (e.g. for citations, source checking, etc.), I am collecting date-time, IP/URL of original sources, and all manner of stuff. This is being done as an aid for the researcher, but it could also be used as a source of information to work backward to the person who published their quest anonymously.

I have identified the following as needing removal / scrubbing / obfuscating:

UUIDs used need to be random and not related to MAC address and time.
All metadata with time-date, URL, IP, etc. must be removed.
The transmission of the quest must be encrypted with the receiver's public key, but not signed (or otherwise associated) with the sender.

Question:

How many more types of information that might be in either the data or in the supporting metadata can you think of that I need to scrub when someone wants to be really anonymous?

If there's a list somewhere of things that have tripped people up in the past (anecdotal or real), that would be educational.

Update / Clarification:

QuestGuide is 100% FOSS. I'm currently trying to understand how GPLv3 Affero plays in a system composed of many FOSS components: MariaDB, Django, and numerous other bits of FOSS released under various licenses. It may be necessary to fallback to GPLv2 Affero.

Although I'm sure there can be revenue generating operations based on it, I see them falling more along the lines of Red Hat selling support for a completely FOSS-based product. I'm retired and have no particular need or desire to be part of any of those operations.

The system itself is designed to run locally on the user's machine—DB, proxy server, UI, all of it. The "central site" is intended purely for the convenience of users who need multi-location access to their quests, who wish to share their results with the world, or who wish to download preconfigured components and entity definitions. Once QuestGuide is installed, the user does not need to have any further contact with any sort of centralized server.

It sounds like anonymity is the opposite of what you want.

If you see me naked is it still a violation if you don't know my name?  Your system is a lot like this,  you are collecting personal information and then obscuring who it belongs to but at the end of the day you need to associate a large fact base with an individual,  and that is what people fear.

I would make sure your system is at least as bad as Google's stance on privacy.  Google is pretty awful when it comes to privacy,  but they are widespread and most of us have become accustomed to their targeted ads.  If you are worse than Google then you might get the wrong kind of attention.

You should also respect the Do-Not-Track HTTP flag.  It might not be against the law to ignore this flag right now,  but I am sure it will be.


What can a RAT (Remote Access Trojan) do? I have been wondering, if I get infected with a RAT, what can the hacker do to my computer? What will he/she have access to, and what can they do with my computer?

Taken from infosecinstitute.com:

when used for malicious purposes, they are known as a Remote Access Trojan (RAT). They can be used by a malicious user to control the system without the knowledge of the victim. Most of the popular RATs are capable of performing key logging, screen and camera capture, file access, code execution, registry management, password sniffing etc.

Since there are many varieties of RAT's, I suggest you start by reading the article I quoted and later if more information is needed a simple Google search will return a lot of information/research's that are relevant.


Am I getting MITM'd? Recently I've noticed a delay in my Internet speed.

Pages seem to start loading a little later than they used to.

I decided to do a speed test on speedtest.net, but it wouldn't do the speed test and gave this error:

I'm using Wi-Fi and I can access my router's default gateway login. Although it seems to load slowly as well.

Is there any way to check whether there is some kind of MITM attack happening?

Pages seem to start loading a little later than they used to.

Treat this as latency, so review your ping. You can check your ping time against a server from the command line: Command Prompt (Windows), Terminal (OS X) and Linux, well too many for me to list off. Ping Google's public DNS server 8.8.8.8, as it is well documented, and has known response times. Via the Internet connection, I am currently connected to, a VDSL line my Speed Test result is:

Note the ping of 7ms via fdcservers.net. Below you will see ping results from Google's public DNS server 8.8.8.8.

safesploit$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=122 time=10.788 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=122 time=9.498 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=122 time=9.502 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=122 time=9.685 ms

Do give margin, but this is a good response time (6-12ms) for VDSL and hybrid fibre-coaxial.

  Is there any way to check whether there is some kind of MITM attack happening?

You can check if a MITM attack is being performed on your LAN by checking your ARP table. See Detecting man-in-the-middle attacks? as this is quite an involved topic, and it has already been answered. Outside your network, a Trace Route might be advisable, although it becomes particularly more difficult.

As suggested port 8080 might be blocked. You can either use NMap to port scan, connect using the Tor Browser bundle and specific for Tor to use port 8080 and see, or use OONI by Tor.


Is this information leakage dangerous? After scanning my website with a automated tool I get this

Is this dangerous, is it a vulnerability or not? If yes what can an attacker do, how to fix it?

The error message discloses the full file path structure of this web app, and the versions of Apache, and your OS. That's a lot of info to hand an attacker.

The more specifics an attacker has, the more the attacker can custom-tailor their attacks. Best practise is to hide this information, but not to rely on secrecy as a means to protect yourself (security by obscurity). But blinding your attacker is better then handing him the blueprints to your server.

The standard "fix" for info disclosure in error messages is to create custom, generic error messages that do not include all this data.


How can one using Tor and a Virtual Machine be traced? Theoretically, wouldn't it be impossible to be traced using Tor + Virtual Machine? Assuming you connect to a website trying to track your personal location.

Your IP address is completely hidden by Tor, then using a virtual machine, your browser and other computer settings completely change, so shouldn't you be completely untraceable? I'm not seeing how it's possible.

You are conflating a lot of concepts together, so let me try to separate them.

Virtual machines are a convenience of many purposes but enhancing anonymity is not one of them. Yes  using a browser in a VM will give different indicators such as User-Agent and Fingerprint, but that’s just another set of tracking variables. It’s extremely difficult to configure your own browser for privacy. When browsing with Tor, you should be using the Tor Browser Bundle (TBB). TBB has all of the security levels configured for you as well as some privacy capabilities completely lacking in other browsers. It’s designed to look like the same TBB everyone else is using.

Theoretically Tor is indeed traceable and the Tor project will confirm that. The details however make it very very difficult. In general it requires monitoring or control of multiple nodes in multiple countries that are themselves changing. Tor is designed to resist a nation state level of effort. Multiple nation states working together can at least partially defeat Tor, but that is a high bar.

Last but not least, Tor doesn’t protect you from giving away your identity. If you login to an account both with and without Tor, you’ve correlated the two.

Tor is an anonymity transport mechanism. It will transport anything, including identifying information if that’s what you feed it. TBB is a browser configured to protect privacy and use Tor transport, use them together!

Also, you (or TBB) define and setup the multihop Tor circuit. Your machine knows the full path to a web page (not an .onion). Any sufficiently privileged code or trojan on your machine can see it as well.

Tor is not perfect, but it’s very good if used carefully.


Is it possible to compromise a mobile phone just by using the telephone number? In a recent tweet, a prominent UK journalist has claimed to have witnessed a European police force accessing content on a mobile phone just by using the telephone number.
https://twitter.com/krishgm/status/1388072994296184832
Are there any known technology or attacks that could do such a thing?
Edit
For clarity, here is the full thread of the tweet referenced in my original question. As pointed out in the comments to this question, the following tweet does add further context.  I believe that the original question about the existence of technologies or attacks that would do such a thing remains vaild.

Such an assertion sounds conspirational and not founded in reality. However:

The SMS system has many known security issues. Network operators and state actors can locate mobile phones via a “silent SMS” or “stealth ping”. Network operators can associate a new SIM card with the number. SMS can easily be re-routed to a different recipient (without the intended recipient noticing). Since such attacks are possible at low cost, SMS is not a suitable mechanism for two-factor authentication or as a account recovery channel.
Unencrypted data transfers can be analyzed by anyone in a MITM position, such as network operators and state actors. In particular, SMS lacks encryption. However, all popular messaging apps use transit encryption.
Especially older phones have many known security vulnerabilities. For example, MMS handling is highly vulnerable under old Android versions due to the Stagefright bugs. This could be leveraged by an attacker to perform a no-click attack. As a high-profile example, Saudi Arabia allegedly hacked Jeff Bezos' iPhone via a malicious video file sent over Whatsapp in 2018.
Some countries (including the UK) allow devices to be actively hacked for security purposes. However, this can only work if there are vulnerabilities such as the one discussed above. In some cases, installation of surveillance software might require physical access.

However, exfiltration of data from a device necessarily requires more than just knowledge of the number – it generally requires physical access to the device, or an exploit to install malware on the device that will then send data from the phone to the attackers. However, that necessarily requires an active network connection.
There are more theoretical approaches for exfiltrating data from a device, such as side-channel attacks that monitor electromagnetic radiation from the device. However, these generally require close physical proximity to the device to work in lab settings.
So what is that tweet about? Clarification comes in a follow-up tweet from the author:

To be clear: I’m talking about messaging not apps such as banking or a Word document on your phone. The Italian police told me they could listen to and read any message traffic in real time
– @krishgm, https://twitter.com/krishgm/status/1388082271815671808

This indicates they are talking about interception of SMS, which is trivial, especially if the mobile network operator cooperates – which they might be legally required to do. SMS have next to no security guarantees like Confidentiality, Integrity, or Authenticity. This is in stark contrast to all mainstream messaging apps that do use transport encryption, or even end-to-end encryption. For example, it is exceedingly unlikely that Italian police have cracked Signal encryption. For messaging services with transit encryption but without E2EE, the messaging provider (such as Facebook or Telegram) does have the plaintext messages and could be compelled to hand them over to the police.


One user ID of a trusted key has unknown trust I observed today that Thunderbird/Enigmail (24.2.0/1.6) does not allow me to select a key for encrypting mails to one of the addresses associated with the key, even though others work. Help sites claim that the reason must be a lack of user trust, but the key is trusted (fully).

I think I tracked down the issue to some extent; gpg --edit-key ABABABAB outputs something of the form:

pub  1024D/ABABABAB  created: 1970-01-01  expires: never       usage: SCA
                    trust: full          validity: full
sub  1024g/BCBCBCBC  created: 1970-01-01  expires: never       usage: E
[ unknown] (1). John Doe <doe@some.tld>
[  full  ] (2)  John Doe <j_doe@some.tld>

Sending to j_doe works, to doe not so much. What might be happening is that Enigmail checks the trust value for the specific user id, not the whole key (only when sending, though; key management happily announces "trusted" everywhere).

How do I change the trust value of uid (1)? I tried (re)setting trust of the whole key and selecting the subkey and/or the uid and settings its trust (which does not even seem to be feature) but unknown does not go away.

I use gpg (GnuPG) 1.4.12 on a Debian GNU/Linux variant.

There is a difference between trust and validity. Trust allows keys to validate other keys (so its outgoing signatures extend your partition of the web of trust). Trust means that you trust in the key's owner to reasonably sign other keys. A key is valid if it is in your partition of the web of trust: signed by you, or has acceptable trust paths from your key.

Trust is key based, while signatures are (usually) UID based. Looking at the given output, you probably signed John Doe <j_doe@some.tld> some time ago, but not John Doe <doe@some.tld>.

Sign that UID to make it valid. The trust on the key does not matter here.


How to create "infected" .docx file I have a file scanner that checks if a file is infected or not, I want to make some tests, so I want to create some infected .docx or .pdf or .xls files and to see the response of the scanner to those files, my question: how can I create my own infected files without damaging my computer?

I know EICAR but this infected string works only on .txt files

EICAR should work on any file name or extension. It is intended to be placed into a .COM file in the first place.

For Microsoft Office files, your best bet is to add a bunch of VBA macros in that try to create files with .exe extensions and write junk (perhaps EICAR) into them. For newer (e.g. xlsx, docx) files the format is just a ZIP, so you can also include EICAR into there as an embedded file too.

For PDF files you could use one of the known exploits for PDF readers, but make the payload benign. There's a decent-ish tutorial here on how to generate PDF exploit payloads with Metasploit.


How much does it cost to protect your website against DDOS, by tier? Cross-posted to Quora

Today several financial institutes in Israel (banks, stock exchange) were DDOSed. They decided to block all foreign IPs as a first aid measure.

While I agree that it was possibly the best thing to do as a first aid measure, I was really surprised it was necessary. Don't banks and large institutes like the Tel Aviv Stock Exchange have "serious enough" DDOS protection?

How much it would cost to implement protection against DDOS attacks? I know there are ranges of possible DDOS attacks, from silling SYN attacks to more serious application level DDOS. I'm interested in how much would it cost to protect against each of these (just trying to understand why it wasn't implemented well in advance in this case).

Protection against DDOS is, on a general basis, pretty much impossible. Normal operation of a server is to handle clients, doing some computation when a request is received. A DDOS is... just that. The difference between the normal situation, and a DDOS, is that the "clients", in the latter case, are not interested in the result returned by the server, since the clients happen to be mindless zombies. "Being interested" is not a concept which lives in the abstract world of computation.

So the strategies for dealing with DDOS are a combination of:

Trying to detect zombies based on "usage patterns" (assuming that a zombie involved in a DDOS will behave in a way which is distinctively different from a "normal user" -- this involves quite a lot of faith in Mankind).
Having the clients invest some computational effort, such that the server can verify that work has been performed, with much less effort.

The first strategy is a psychological hide&seek between attackers and defenders, and we can expect roughly the same kind of success than for antispam -- i.e. good against amateur attackers, bad against determined attackers. The second strategy is an ongoing research subject but there is nothing widely deployed in existing software. That's one trouble with Web servers: they cannot ask for anything that existing Web browsers do not already know how to do.


WYSIWYG Rich text editor and renderer with no XSS risks In our web app, we need to allow users to input rich text which is then presented to other users. We are looking for a simple WYSIWYG (JavaScript) editor that outputs a format which is backwards compatible with plain text (to support existing text in our database), has simple rich-text formatting support (bold/italic/underline/bullets/blockquote/etc) and a frontend renderer that accepts the output and can display it, while not being able to introduce any HTML tags at all. This will greatly diminish the chance of XSS.
I could not find any major project that does this.

We are currently implementing the following to evade XSS:

CSP
iframe sandbox
All important cookies are HttpOnly
Using a renderer that does now render scripts, like markdown-it or react-markdown.

That being said, it still feels like here is a major gap in the ecosystem. There is no editor + renderer that works with something like reStructedText or BBCode, or some other format with no support for HTML tags or advanced functionality. Most editors and renderers work with Markdown, which is problematic. We'd love something super simple that will allow basic features with a minimal amount of exposed surface.

Does anyone have any recommendations on how to tackle this challenge?

First of all - the use of the security mechanisms that you have described before is a good practice.

State-Of-The-Art XSS Sanitizers

DOMPurify

CURE53 (a leading group of security researches), created a client-side JS library that's called DOMPurify. You can use it as "sanitize(string)", that allows you to enter code and clean (sanitize) it, based on rules that you describe.

Caja

Caja is a similar tool from Google.

Both of Caja and DOMPurify are sanitizers only. However, they are super easy to use, and considered State-Of-The-Art in regards to HTML sanitation.

A Quick word about Iframes

Please keep in mind that using different domain (not only sub-domains) sandbox Iframe is a great practice, but not enough. Please beware of other pitfalls, such as using insecure window messages between the Iframes

A Quick word about CSP

I would like to encourage you to test your CSP in Google CSP evaluator (unless you are familiar with that already).


SMTP Service STARTTLS Plaintext Command Injection We are getting this vulnerability on SUSE Linux Enterprise Server 11. This vulnerability is getting triggered on port 587 for postfix. I have checked several links but I am unable to get any relevant solution for it.

Has anybody faced an issue with this vulnerability? How do I remediate this?

Links referred:

https://www.securityfocus.com/archive/1/516901/30/0/threaded
https://xorl.wordpress.com/2011/05/02/cve-2011-0411-postfix-starttls-plaintext-command-injection/
http://www.postfix.org/CVE-2011-0411.html

Based on the links you've provided, this appears to be CVE-2011-0411.  Given a CVE, you can browse at suse.com to see which packages will fix it.  In this case, postfix >= 2.5.6-5.6.1 (patchname: slessp1-postfix) will correct the issue for SLES 11.


How can I identify which computers a USB drive has been used on? Is there a way to find out in which and/or how many computers a USB flash disk entered.
And if its possible can we find out how many times a file was read/edited.
I heard that its possible , but I cant find a program  to do it.

Removable devices including USB sticks don't store this information.

You can perhaps find some specific products which implement an auditing / logging technology to remember the number / type of devices it has been plugged in, but if your specific device don't implement it then you can't.


ISP's defence methods against IPv6 Spoofing I read about there being methods applied by ISP's to defend networks against IPv4 spoofing, but not too much about IPv6 spoofing. I'm wondering if someone has some knowledge if ISP's apply techniques against IPv6 spoofing.

Actually, there's not that much of a difference. The same techniques available for IPv4 can be applied for IPv6. Reverse path filtering (RPF) and static access-lists are the most common used, but given a specific network and its design other techniques can be used. MANRS has a nice overview on anti spoofing techniques for both IPv4 and IPv6: https://www.manrs.org/isps/guide/antispoofing/


Is it a good idea to give users an additional password that they do not control? It's a given that users will choose bad passwords. Why not help them out? Using a securely-random choice from a large dictionary, choose one or two words and tell the user to write them down. When they log in, require username, password, and the words that were generated. The password hash is based on the concatenation of the password and the secret words.

This provides a clear entropy boost from the perspective of a hash-cracking attacker, and prevents password reuse from being as much of a problem, too. Since the entropy comes from the random choice from a list, the server could normalize case and auto-correct spelling before hashing, to make it easier on the users.

I believe that writing down passwords is just fine in most cases, because people are generally good about protecting sensitive information that they write down. By instructing the user to write the secret words down, the burden of memorizing them is removed. They will still choose a password to meet very minimal complexity requirements (e.g. minimum 8 characters, 2 character sets, 4 unique characters), so it is likely they will not write down the entire access key (password + secret words).

This question is a similar idea, but instead of offering choices (which removes entropy, since users will choose things that "make sense"), words are provided directly. The words would look similar to the old AOL passwords distributed on their CD-ROMs.

EDIT: The context I imagine is a web site or other system with many distributed users. I'm not necessarily suggesting this for corporate login systems.

Most passwords these days only have to be good enough to defeat brute-force at the web interface, and to do that they don't have to be all that complex. Given how good password cracking is these days with GPUs, hash tables and rainbow tables if your password database is compromised you'd have to consider them cracked even if they are complex. Plus, if your password database was compromised you'd still want to send new passwords just to cover yourself.

Sure, you could give your users complex passwords which are so hard to remember they have to be written down, and then lost, requiring another one to be sent, which will then be written down and lost. It's a great way to piss off your customers without much net increase in security over simply enforcing good password standards.


Securely building a local pentest lab in a VM I'd like to set up OWASP WebGoat or a similar vulnerable web app in a VM (probably VirtualBox on Linux). For convenience's sake, I'd like to get it running on one of the primary machines I use (say, a laptop with an internet connection). I realize virtual machines don't provide complete security and isolation for, say, loading a machine up full of viruses, but I just want to use it to learn about and practice pentesting web apps.

What needs to be done to do this securely? What are some of the risks of running a security-related "sandbox" in a VM on an actively-used machine (as opposed to an isolated machine dedicated to that purpose)?

Edit: Just to clarify, my main question here is about a VM for pentesting a vulnerable web app, not virus/malware analysis, etc.

The core mindset you want is:

Build it as if it were real, not virtual.

What would you want in place? Firewalls, access controls, logging etc

For a lab running virus analysis etc., you would normally segregate that from the rest of your network, so do the same here. I don't know of any malware yet that is specifically designed to break out of a VM in order to compromise the host and spread that way. However, what you'll find is that quite a lot of malware will detect it is in a VM and tailor its activity accordingly, which could hamper analysis.


Program getting exploited inside gdb, new shell is spawned but terminated immediately I am trying to exploit a SUID program.

The program is:

#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#define e(); if(((unsigned int)ptr & 0xff000000)==0xca000000) { setresuid(geteuid(), geteuid(), geteuid()); execlp("/bin/sh", "sh", "-i", NULL); }

void print(unsigned char *buf, int len)
{
int i;
printf("[ ");
for(i=0; i < len; i++) printf("%x ", buf[i]);
printf(" ]\n");
}

int main()
{
unsigned char buf[512];
unsigned char *ptr = buf + (sizeof(buf)/2);
unsigned int x;

while((x = getchar()) != EOF) {
        switch(x) {
                case '\n':
                      print(buf, sizeof(buf)); continue; break;
                case '\\':
                      ptr--; break;
                default:
                      e();

                      if(ptr > buf + sizeof(buf))
                            continue;

                      ptr++[0] = x; break;
        }
}
printf("All done\n");
}

We can easily see that if we somehow change ptr's contents to some address that starts with CA then a new shell will be spawned for us. And as ptr normally holds some address starting with FF the way to decrease it(ptr) is to enter \ character. So I make a file with 0x35000000 '\' characters, and finally 3 'a' at the end of the file

perl -e "print '\\\'x889192448" > file     # decimal equivalent of 0x35000000
echo aaa >> file        # So that e() is called which actually spawns the shell

And finally in gdb,

run < file

However instead of spawning a shell gdb is saying

process <some number> is executing new program /bin/dash
inferior 1 exited normally

And then back to gdb prompt instead of getting a shell. I have confirmed by setting breakpoints at appropriate locations that ptr is indeed starting with CA before setresuid() gets called.

Also if I pipe this outside of gdb, nothing happens.

./vulnProg < file

Bash prompt returns back.

Please tell me where am I making mistake.

This may be a little late but GDB stays attached to the parent process when a program forks by default. To make GDB follow the forking process add set follow-fork-mode child to your .gdbinit. GDB will then follow the shell process that is spawned when your exploit lands. More information about gdb and forking processes is available at https://sourceware.org/gdb/onlinedocs/gdb/Forks.html.


Testing Network layer encryption enabled or not I am new to network security. I have a requirement to test whether the network layer encryption is enabled or not. How do I test this requirement? Are there any automated tools available?

Network encryption (called also network level encryption) is a network security process that applies crypto services at the network transfer layer (above the data link level, but below the application level).

Network encryption is implemented through Internet Protocol Security (IPSec). IPSec works through the network architecture, which means that end users and applications don't need to be altered in any way.

The use of IPsec, which encrypts network traffic, renders network intrusion detection, virtually useless, unless traffic is decrypted at network layer.

To practically make a test, you could just try to send a plain text message through the network and monitor traffic to see if you can read the content or not. If you read it plainly, there is no network level encryption. If the data was received at the other end and you could not read the actual content, then there is network level encryption in-place.


How to bypass origin based csrf protection? I'm trying to do some csrf attack test on a site.

I found that the site protect itself from csrf by checking the http Origin header.

But I guess maybe under some conditions I can bypass the protection. The website just check if the request has the Origin: header set to https://example.com -

Is it possible to set a custom Origin header in the browser using some php code?

The HTTP Origin is a forbidden header name, meaning that it is set by the browser and cannot be overridden in any requests. As long as a modern browser is used and the web application returns an error if the origin header doesn't match or isn't sent, there is not a way to bypass this.
Side note, as pointed out in comments, PHP does not run in the browser, as it is a server-side language.


How should software respond when Captive Portals or Untrusted SSL certs prevent connectivity? I need to fix an issue where the initial (or perhaps only) HTTPS call to a website is blocked by a captive portal, not managed by me. The resolution has been to ask the user to navigate to a "http" only site in order to tell the software stack to login via portal.

From an app perspective I see that the expected site is:

SSL is unavailable (any of the ICMP response codes)
SSL has an untrusted cert from the portal
SSL has an untrusted cert and unexpected content (portal login)

Each one of those behaviors results in a different outcome by various software stacks, OS's, and home-brew software.

What is the most compatible way of dealing with captive portals when:

Accessing a website that offers protected REST services, SPA app, or similar?
Requesting from an app on iOS, Android that leverages the built in HTTP framework for that platform
Requesting from an app that doesn't leverage the platform HTTP framework, but instead, uses OpenSSL, BouncyCastle, or Monotouch/MonoDroid
Requesting from a Desktop PC (OSX or Windows)

w.r.t. #4, I know that OSX will attempt to contact http://captive.apple.com/hotspot-detect.html  to determine if a 301/302 redirect is in place... or if the portal simply replaces the content outright via a MITM/Content Injection.

Not just OSX but most platforms now will request a known URL and see whether the content is replaced or tampered with to detect hotspots.

Windows 7+ :

  NCSI performs a DNS lookup on www.msftncsi.com, then requests http://www.msftncsi.com/ncsi.txt. This file is a plain-text file and contains only the text Microsoft NCSI.

  NCSI sends a DNS lookup request for dns.msftncsi.com. This DNS address should resolve to 131.107.255.255. If the address does not match, then it is assumed that the internet connection is not functioning correctly.

Source: http://blog.superuser.com/2011/05/16/windows-7-network-awareness/

Android 4.2.2+:

  http://clients3.google.com/generate_204

Source: #1 & #2

Most of these URLs can be changed if privacy is a concern.

The solution for your application would be to make a HTTP GET request and see if that gets tampered with.

On most of the hotspots I use, I see either a failing SSL/TLS session due to the site being signed by the hotspot provider rather than the one I was attempting to visit (they don't have the certs for the site I'm attempting to visit) which your TLS/SSL hostname checking will flag up... or they just block the connection until they see a HTTP GET to a site they can MITM... which would look like a timeout.

An advantage to having a http://yourapp.com/status style URL rather than re-using either Microsoft's or Google's is you can attempt to provide more helpful information on the health of your application if your status URL reports that the service is healthy but the user's network isn't letting them connect to your TLS/SSL endpoint over if the http://yourapp.com/status page is down then perhaps your application is down too.