Completely mimimise the possibility of my web hosting account being hacked I've just moved web hosting providers and I want a fresh, secure start. To a certain extent, I don't mind what I have to do I'm just fed up my account being hacked or infected. I just wondered how to be as secure as possible!

My master password is very secure and I can remember without writing it down, but for various reasons I need to keep record of some other secure passwords relating to the account that I can not remember. I have these encrypted with 256 bit AES and the key to decrypt it is a file on my memory stick that I always keep with me.

I'm also going to be using SFTP, and SSL on one of my domains. Is this secure enough?

I was thinking about installing Ubuntu on a virtual machine or even an old computer. Is this overkill, or even pointless?

The security of your Web server will entirely depend on the skill and commitment of the system administrators, both for the operating system and for the Web server software itself. It does not really matter whether the sysadmin is you or someone else; what matters is that the configuration is under control and security updates promptly applied.

Out of personal experience, I would recommend as OS one of the mainstream Linux distributions, e.g. Debian, Fedora or Ubuntu -- which one does not matter much as long as you regularly check for updates and apply them (by "regularly" I mean "on a daily basis"). The *BSD systems are also worthwhile alternatives (FreeBSD, NetBSD, OpenBSD) but they usually have less support from hosting services, and they require a bit more in-depth knowledge of what is going on in the OS entrails (however, their somewhat simpler, more traditional internal structure makes acquisition of such knowledge a bit easier than the Linux case). The relatively smaller user base of the *BSD systems also makes them less likely targets for attackers -- that's "Security through Attacker's Incompetence", which is even less reliable than "Security through Obscurity", but still works in practice.

If your are not the sysadmin of the Web server system, as you hint in another comment, then you rely on the actual sysadmins to do their job properly. This is one of these cases where you tend to get what you pay for. Luck will play a large role in that matter: when using shared hosting, you are nominally isolated from other customers of the same system, but in practice perfect isolation is not a given. Fortunately, most people are honest, as the continued existence of civilization tends to demonstrate.

For your access passwords, what matters most is that you use only "clean" machines. The longest password or the best "key file" on a USB stick will not save you if you type it or insert it in a compromised desktop system. Keeping a desktop system "clean" works along the same lines as keeping a server "clean": be wary of what you install, check for security updates. You do have a few extra possibilities with desktop systems; for instance, you could boot a "secure" system of a USB stick (or a USB external harddisk), without touching the internal hard disk. That way, you could maintain a separation of roles: the OS on the internal disk is for "risky" activities (Windows-based gaming, Web surfing...) while you the USB-booted system would be reserved for Web server administration.

SSL and SFTP are secure technologies, but only act as tunnels. They protect data in transit between two points (e.g. a Web browser on some user's machine, and the Web server) but they do nothing about the security of both end points. SSL and SFTP will not save your skin; it is more a case of not using them would create additional holes to contend with.

Disclaimer: I have presented fairly subjective opinions above about the comparative merits of operating systems. However, I consider that I have both enough experience and a sufficiently inflated ego to be entitled to make such assertions. Other people's experience may differ; I hear that there are some Windows sysadmins who are content with its security. The core assumption, however, is consensual: know your system. You won't get a lot of security as long as the OS and the software remain "magic" in your eyes. Knowledge dispels the magic.


Can Bluetooth earphone leak data between phones? I have a Bluetooth earphone connects to both iPhone and android. I forgot to switch off the connection of android when using iPhone. So I am wondering if the sound of iPhone or even the iPhone data privacy could be recorded or leaked to that andriod  phone when they were both connected to the same Bluetooth earphone. Or this is just a wild speculation?
If your android is hacked, can the  hacker record and see what you do in real-time on the iPhone because of this shared Bluetooth device situation? Thanks

This answer assumes the earphones are a slave device and the phones are master devices. Each Bluetooth pairing is distinct using a different Longterm Key negotiated at the point of 1st pairing and then re-used as part of session authentication. There is no reason why a Bluetooth device should 'leak' information to another paired device.
Regards the 2nd part of your question, if your android is hacked, there is no immediate reason why an attacker could take advantage of a Bluetooth pairing to the ends you describe. Even if the attacker rooted your android they'd still have a job to use your iphone in this way. Apple phone security is pretty good. Everything is sandboxed. So they'd have to get you to grant permissions to the Bluetooth device they're masquerading as to use things like the camera and the microphone. It would be more straightforward to hack your iphone than to hack an Android to then hack an iPhone.


How difficult it is to solve a salt if knowing the original data and the hash output that uses the SHA-2 algorithm I am reading the documentation for Kentico where it describes using hashes to validate query strings

EX:http://localhost/KenticoCMS8/cms/getfile/2d003444-9a27-43c9-be97-4f5832474015/Partners_logos_silver.aspx?latestfordocid=75&hash=eee41e027bd45142fd1f44d173d61950f34d6e98f4e35018fda70542322adc77&chset=013bca78-6bf2-42ac-8959-b8bbbeb0a8e8

Documentation
https://docs.kentico.com/display/K8/Query+string+hashing

I am making an assumption:  On it's own hashing a query string and including it as part of the string is not useful.  Anyone who knows the algorithm (published int he help doc)could simply generate the hash from his new malicious query-string, and include it as part of the request.

The added protection that Kentico uses is a static salt that is included when hashing the query-string.  This should make generating your own hash not as simple.

My question is how difficult would it be to solve this salt?  An attacker could easily generate many different query strings  They would know the input, the output, and the algorithm.  Could they simply figure out the salt?

And if they know the salt, can they then without any difficulty generate their own query-strings?

Cryptographic hashes are in principle not reversible.  So it should not be possible to get the salt by taking a known query string and associated hash (or a set of them) and reversing them, other than by trying brute-force.  Brute-force is not going to be feasible with a random GUID that's has 32 hex-characters (one hex character is 4-bit, hence the GUID is 128 bit).  So brute force of the salt should require creating ~2^128 sha-2 hashes to be created (half the time you should find it with 2^127 or less hashes).  On the other hand, if you used a 2 hex-character-salt, brute-forcing would be trivial with only 2^8 = 256 SHA-2 hashes.

Granted this analysis assumes no new unpublished attacks on SHA-2 exist or one that utilizes this expanded attack surface by being able to create multiple hashes of arbitrary text all starting with the same salt.  This scenario seems a bit similar to the related-key attacks where you break a cipher (find the decryption key) when you are assisted by being able to force someone to encrypt data with several unknown keys that are related in some mathematical sense (some bits vary but most are the same).

However, I'm not aware of any such attack on SHA-2 or any other hash and have never seen the problem actively discussed -- given everything but s in the following "H(s ++ p1) = h1, H(s ++ p2) = h2, ..., H(s ++ pN) = hN)" recover s.  Typically you think of three attacks in regard to hash functions; pre-image resistance (given h generated by H(m) find m), second pre-image resistance (given m1 find another m2 such that H(m1) = H(m2)), and collision resistance (find any two distinct m1, m2 such that H(m1)=H(m2)).  This is something different.

Personally, I can't imagine how an attack of this type would work on a modern cryptographic hash like SHA-2 (with 64 rounds) due to the avalanche effect, but to quote Schneier's law "Any person can invent a security system so clever that he or she can't imagine a way of breaking it."  The fact that it hasn't been studied extensively would not make me confident that hash functions would be resistant to this type of effect against very sophisticated attackers.


Can 3rd party JavaScript libraries access the http headers of the hosting html page So, I have website, it uses a cookie stored in the http header of the downloaded html document to maintain the session while the end user is logged on and accessing there 'secure' data. This webpage also includes 3rd party hosted javascripts which are used for marketing and analytical purposes. Can any of those 3rd party javascripts read the http headers of the hosting http document?

As the commentators suggested you correctly, you will need to use the HttpOnly fla as a solution. But I just want to add a note regarding the right comments you received about HttpOnly flag.

In fact, if a client of your website uses a Mozilla Firefox browser of version before 3.0.6 (Bug 380418: XMLHttpRequest allows reading HTTPOnly cookies) and/or SeaMonkey browser of version before 1.1.15 (Rough Changelog for SeaMonkey 1.1.4) the HttpOnly  won't be helpful because this flag  won't be able to remove cookie information from the response headers in  MLHttpObject.getAllResponseHeaders().

Further reading.


Websites with HTTP and HTTPs pages I saw a website which consists of HTTP and HTTPs parts.
that is, the website (80% of it) is over HTTP where as the Payment page is over HTTPs.

So would that website be considered as safe ?

Can it be exploited ?

From the HTTP parts of website the payment part be exploited ?

HTTP pages can be read / modified by an attacker through a man-in-the-middle attack.

An attacker could then easily replace any reference to the payment page (or any HTTPS page) to point to HTTP pages instead, so that he will still be able to read / modify the HTTP traffic.

Since a user is unlikely to start his session on the payment page, it will most likely start it on a unsecured HTTP page, and his whole session will be likely to be vulnerable.


Capture wireless traffic in PROMISCUOUS mode (not monitor mode) I am trying to capture packets from other devices that are connected to the same network as I am. I know the difference between monitor mode and promiscuous mode (explained in this question), but for my purposes I feel that promiscuous mode is more useful.

My problem is, how can I configure a wireless interface to capture the traffic in promiscuous mode?

(FYI: I have already captured traffic in monitor mode, but it's useless as the traffic is encrypted. Also, I am trying this on a Raspberry Pi 3B+ with Kali linux with Nexmon installed, if that's any help. However, I can use Raspbian as well, if necessary)

I am trying to capture packets from other devices that are connected to the same network as I am.... I feel that promiscuous mode is more useful.... the traffic is encrypted.

Promiscuous mode is likely not what you want.

To cite from the WireShark Wiki: "However, on a "protected" network, packets from or to other hosts will not be able to be decrypted by the adapter, and will not be captured, so that promiscuous mode works the same as non-promiscuous mode."

Note that this is not a restriction of WireShark but a restriction due to the design of protected WLAN. Thus it will not help to just change the capture tool.

See also Wireshark - I can't see traffic of other computer on the same network in promiscuous mode.


What are the circumstances in which it's not foolhardy to have access to your primary email address through your smartphone? Most web sites I use allow a password reset through email; a few require two-factor authentication with a phone call or SMS. It would perhaps only be banking or major commerce sites that would require some additional authentication factor.

So having a “Gmail” app on my smart phone (or linking my primary Gmail address to my smart phone) seems incredibly foolish to me. Outside of having a very complex screenlock password, I'm giving anyone who steals my phone access to all of my accounts. (So, in my case, my Android phone is linked to a dummy Google account, which I have only so that the phone will work.)

Is there wise way to have email access through one's phone? Or does everyone just accept that risk?

Unfortunately, no one can answer this question for you. You need to formalize your threat model if you want to be able to understand the risks. Start with the understanding that unlimited access to your phone provides access to your Gmail password. You then have to consider who your adversaries are and how likely they are to gain such access to your phone, for example:

Thief - The average thief is likely to steal your phone and just pawn it off if they can't open it easily. This kind of attacker is unlikely to be after your Gmail password specifically, but would still utilize it for their own purposes if they were to obtain it. Protecting against them is as simple as using a strong form of authentication for your phone. Note that a thief could simply take your phone while you have it out and unlocked. It is not uncommon for someone to ask for the time and, when you pull out your phone to check (if you have no watch), they snatch it and run. These thieves are more likely to be able to access your Gmail.
Stalker - A stalker or another unsophisticated attacker who wants access to your Gmail or other personal information may target you specifically. However, they will not be able to easily unlock the phone unless the password is particularly weak (something they might guess).
Nation state - An advanced adversary who wants access to your Gmail would be able to compromise your phone as long as it is powered on, regardless of whether or not it is locked. However, you must realize that this particular adversary might also be able to directly access your Gmail (e.g. via subpoenas). While there are certainly attackers in this class that need your phone to access credentials, you have to decide whether or not they are yours.

If you do not have a particularly sophisticated attacker out to get you specifically, and as long as the content on your email is not so valuable that people will dedicate significant resources to obtain access, then you really only need to make sure that your authentication method is secure (e.g. a strong password), and that you keep your phone locked whenever you are not actively using it. Make sure you keep the software up to date so there are no known screenlock bypasses.


Doesn't Samesite cookie and Sameorigin policy effectively does the same job? Pardon me if I am wrong, however, I am looking for an answer for my understanding that isn't the concerns regarding CSRF solved by both Samesite cookie and Same-Origin-Policy effectively? Then why is the need for 2 different things?

The basic difference which I can recollect:

Same-Origin-Policy (SOP): Is a policy set by the browser to protect a user from not letting it read the contents of another site unless the origin is same or CORS is implemented effectively

Samesite Cookie: On the other hand a job done by a server to mark a cookie to be strict or laxed as per their requirement

Is it just this? is there really a good reason behind having two different ways to prevent CSRF attacks?

The Same-Origin-Policy does not prevent CSRF attacks. It does not prevent the request from being send and it does not prevent site specific credentials (i.e. session cookie) to be attached to the request. It only prevents cross-origin reading, not cross-origin writing. Thus it is possible to send a fully authenticated request (i.e. with session cookie implicitly attached) cross-site which allows an attacker to do an authorized action on the server side even though the attacker cannot directly get the result of the action (i.e. read the response).
Same-Site cookies mitigate this problem with an additional restriction when a cookie will be implicitly attached to a request. Without same-site property it will be attached to all requests which includes cross-site requests. With same-site property it will no longer be attached to cross-site requests. Thus it is still possible to write cross-site, but not with cookie based authentication information implicitly attached.


Why is Message Labs sending mail in plaintext? I have several SMTP servers on various networks around the world, and all of them are getting mail through ESTMPS - extended SMTP using TLS.

So the email coming from GMail, MSN, Yahoo, as well MOST of other mail servers, including Exchange servers, Rackspace Email etc, are getting there over ESMTPS. BUT: so-called "secure" Message Labs is doing it plain text. For example (also they use DNS based in US only including the EU):

  Received: from mail1.bemta7.messagelabs.com
  (mail1.bemta7.messagelabs.com [216.82.255.50]) by mail-01 (Postfix)
  with ESMTP id 6904B757A   for ; Mon, 15 Oct 2012
  10:59:53 -0700 (PDT)

Another example is gmail:

  Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com
  [209.85.220.44])  by mail-01 (Postfix) with ESMTPS id E8822161A   for
  ; Sat, 20 Oct 2012 05:11:38 -0700 (PDT)

Does anyone see any reason why it's like this? I use a self-signed certificate on my postfix mail servers, and all I want is to get mail over TLS.

TLS is initiated by the sending server. MessageLabs (or Symantec.cloud as they are now known) provide email scanning services for anti-virus, spam, etc and support TLS at two levels:
    - Opportunistic i.e. if the original mail server initiates a TLS session with the MessageLabs infrastructure it will scan the email and then attempt delivery over TLS.
    - Enforced - the enforcement is usually configured at the domain level and the message must be received and delivered over TLS.

I suspect in the instance you are showing the original email was not received over TLS so the delivery was completed using SMTP.

I'm not sure about the reference to DNS but MessageLabs has a global infrastructure with data centres in the EU, US and APJ which includes DNS servers. Customers are generally configured on their local infrastructure i.e. EU customers are configured on EU infrastructure, US customers on US infrastructure, etc. Multinational customers maybe configured on both EU and US infrastructure.

Hope this helps.


Does SQL Server CE 4 decrypt data securely? I am going to store data in an encrypted SQL Server CE 4 database, where the database is doing the encryption.  (Note that SQL CE is the embedded version, not the fully installed server.)

When the data is decrypted does that only happen in memory or is it possible that is is logged or paged to disk in an unencrypted format?

The database will be accessed by an ASP.Net MVC application running in IIS.

If you are serious about the security of your data you shouldn't be using SQL CE, but rather a full blown SQL instance running on a dedicated box. Whether it pages cleartext to disk is wholly irrelevant to the overall security posture of your application because you're running an embedded SQL server in your web server process.

To answer your question though: Windows has the power to persist your memory to disk and there isn't much SQL CE can do to stop it because the data is present in IIS memory.


Predicting Math.random() sequence using V8's MWC1616 algorithm If you have the seeds for Math.random() using mwc1616, are the random numbers generated in the same order every time / are they repeating? Basically wondering if, given a seed, can I predict past outputs of Math.random()?

(Given say 8 Math.random() outputs from the past, if I find the seed they were generated with, could I potentially figure out what the 9th Math.random output would have been had the pervious 8 been generated in succession?)

I've been trying to find the seed for a set of Math.random outputs using this tool: https://github.com/XMPPwocky/nodebeefcl, it doesn't work when I add more than 2 outputs though.

That is a pseudorandom number generator.

So, yes, that's what all PRNGs do:

Given a specific seed, always produce the same sequence of only seemingly random numbers. That happens by initializing the internal state from the seed, and then, every time a number is generated, updating the internal state and outputting a number.

I've only superficially looked at MWC1616:

  The two generators have the form
     x(n)=a*x(n-1)+carry mod 2^16 and
     y(n)=b*y(n-1)+carry mod 2^16,
  in this case a and b are choosen as 18000 and 30903

Considering that it's mostly a linear algorithm, I'd say it should perform especially bad in terms of being able to conceal the internal state from reverse engineering.

I'd expect that algorithm to be bad in terms of quality, too. This can even hypothetically only achieve a sequence length of 2³² (so, easy to simply brute force the next number by going through all 4 billion in minutes at most values on a modern PC) albeit having 64 bits of state, but I'd be surprised if the sequence length was not actually shorter.

All in all, a very bad algorithm. What ancient library / programming language brought you this? If possible, consider using a different random generator (from different authors, tbh; "roll your own PRNG" is about as clever as "roll your own crypto") or different platform.


DNS query through squid? My IDS picked up our squid proxy server doing a dynamic DNS request.  I wasn't aware squid passed DNS requests from the client to the internal DNS server.  Is this possible?

Snort Alert:

ET POLICY DYNAMIC_DNS .dyndns.org DNS Lookup - Possible Malware

A Socks 5 compatible proxy support DNS look-ups,  and squid supports the sock 5 protocol.  On a side note,  TOR can make use of Sock 5 for their own DNS .onion domains.  This is probably a false positive on behalf of snort,  I don't see how this is a security issue.


micro segmentation in the campus We have so many devices (IoT and wintel, macs, androids, ios) spread across a few VLANs. Worried about any one device getting affected (e.g. Ransomware) and potentially infecting all other devices on the VLAN. Do you see this as a problem too? Any solution recommendation? Data centers are deploying micro-segmentation. Why not for campus?

Assuming that in many/all cases there's no requirement for individual wireless clients to communicate with each other (i.e. they only need to communicate with server devices and Ineternet sites), one option to consider for this would be Wireless Client Isolation.

This is a feature provided by some (generally more enterprise) wireless networking setups which stops clients from talking to other devices on the same VLAN apart from their default Gateway. For example this document from Cisco describes their approach.

That would work to prevent clients infecting other devices on the VLAN.  Past that you'd need to make use of standard firewalling to ensure that clients could only get to approved local server serivces and out onto the Internet, and then ensure that your servers are well patched/protected, so that if ransomware does get onto the campus you're limiting what it can affect.


Reflected XSS - Automatic understanding of filters I'm currently facing this possible reflected XSS vulnerability on a webapp:

URL = http://www.test.com/login/?login=[PAYLOAD]

When a user clicks on this link, it displays a login page that includes the following code:

I tried to close the  tag using > with different encodings, but this is filtered and displayed as %3E. I also tried to close the double quote and use some things like onclick etc. but this is filtered as well.

So I was wondering, is there any tool out there that can automatically test all characters in a given set with different encodings to see what is filtered ?

I could create my own script to do that, but it might save some time and well... reinventing the wheel..

Update:
So it appears that there is no tool that provide such capability. ie: test and report for every input what is filtered (and how it renders) or what is not. Burp ends up being the best solution to do that semi-manually, and a Burp extension can be done to fully automate this process.

You could probably use Burp Suite to do this.  Burp Proxy will let you intercept an HTTP request to a specific URL, http://www.test.com/login/?login=[PAYLOAD] for example.

Once you have intercepted this request you can specify which of the parameters you would like to target using Burp Intruder(in this case login).

Next you can specify a payload that you would like to apply to this parameter.  You can choose from a number of existing payloads or you can create your own.

When you begin the attack it will fire a request with every item in your payload set and give you a number of options for examining the result, such as grepping for the payload to see if it made it through intact.

Hope this helps!


password complexity policy for non "English" passwords In an internationalized application, what is the best practice for a policy on complexity of passwords?  I am not having luck searching for the answer.  Wikipedia lists these items for password policy:

  the use of both upper- and lower-case letters (case sensitivity)
  inclusion of one or more numerical digits
  inclusion of special characters, e.g. @, #, $ etc.
  prohibition of words found in a dictionary or the user's personal information
  prohibition of passwords that match the format of calendar dates, license plate numbers, telephone numbers, or other common numbers
  prohibition of use of company name or an abbreviation

If I am a non Latin based language speaker, how do rules about upper and lower case work?  It's not as simple as a-z and A-Z.  What about dictionary lookups and prohibiting certain formats?  This problem seems well know for English, but what about other languages and cultures?

Most drive-by password cracking attempts are going to assume that the password is a subset of ASCII characters. However, targeted attacks (under the Advanced Persistent Threat model) are likely to discover that your users aren't using ASCII passwords and change tact.

As such, I suggest the following rules:

Identify which languages are likely to be in use, based on your user base.
Perform dictionary lookups for those languages, and deny passwords based on them.
Ask native speakers to suggest common non-dictionary words and phrases that might be used as passwords.

If you can identify character subsets for each alphabet, you can apply individual entropy scores to them. This allows you to require a minimum security for such a password.

Probably the most important part is user feedback. Ask your users to report problems they find with the password system on your site, and suggest ways to improve the system. Only a native speaker can really identify weak passwords ahead of time.


Why Nessus freezes at 0% and how to fix it? Does anybody know why Nessus freezes at 0%?
I am not sure that I've done the right configuration, but it is becoming painful
How long approximately takes to scan one machine?

A couple of things to look at.

Try a basic scan of one machine on the same subnet as you, if that hangs for a long time it could be a problem with the system that's doing the scanning or the install of Nessus
Are you running from the VMWare appliance?  If you are check the networking on that.  If you run nessus over a network card in NAT mode it will go very slowly and may not complete at all.  Bridged mode is the best one to use for that.
as @D3C4FF says how long is it hanging for?  depending on the number of hosts and network connectivity to them it can take a while to get going.
Lastly if you've not already, try posting on the Tenable security forums, they're usually pretty responsive over there and if it's a specific nessus problem they may well be best placed to solve it.


Why do people still use/recommend MD5 if it has been proven weak since 1996? It's still a commonly recommended way of hashing passwords, even if its insecurity had been proven in 1996:

Therefore we suggest that in the future MD5 should no longer be implemented in applications like signature schemes, where a collision-resistant hash function is required. According to our present knowledge, the best recommendations for alternatives to MD5 are SHA-1 and RIPEMD-160.

(The Status of MD5 After a Recent Attack, CryptoBytes, RSA Laboratories, VOLUME 2, NUMBER 2 — SUMMER 1996)
Even after this study, and all upcoming papers about its defects, it has been recommended as a password hashing function in web applications, ever since.
It is even used in some Certification Authorities digital signature (according to rhmrisk link below )
What is the reason why this message digest algorithm has not been prohibited for security purposes?

Links:

http://viralpatel.net/blogs/java-md5-hashing-salting-password/
https://rmhrisk.wpengine.com/?p=60

To complement the good answer from @D.W.: for password hashing, MD5 is no more broken than any other hash function (but don't use it nonetheless).

The full picture: MD5 is a cryptographic hash function which, as such, is expected to fulfill three characteristics:

Resistance to preimages: given x, it is infeasible to find m such that MD5(m) = x.
Resistance to second-preimages: given m, it is infeasible to find m' distinct from m and such that MD5(m) = MD5(m').
Resistance to collisions: it is infeasible to find m and m', distinct from each other, and such that MD5(m) = MD5(m').

MD5 is thoroughly broken with regards to collisions, but not for preimages or second-preimages. Moreover, the 1996 attack (by Dobbertin) did not break MD5 at all; it was a "collision on the compression function", i.e. an attack on one of the internal elements of MD5, but not the full function. Cryptographers took it as a warning flag, and they were right because the actual collision attack which was published in 2004 (by Wang) was built from the findings of Dobbertin. But MD5 was broken only in 2004, not 1996, and it was a collision attack.

Collisions are not relevant to password hashing security. Most usages of a hash function for password hashing depend on either preimage resistance, or on other properties (e.g. how well the hash function work when used within HMAC, something which cannot be reduced to any of the properties above). MD5 has actually been "weakened" with regards to preimages, but only in a theoretical way, because the attack cost is still billions of billions of times too expensive to be really tried (so MD5 is not "really" broken with regards to preimages, not in a practical way).

But don't use MD5 anyway. Not because of any cryptographic weakness, but because MD5 is unsalted and very fast. That's exactly what you do not want in a password hashing function. People who "recommend MD5" for password hashing just don't know any better, and they are a testament to a Truth which you should always keep in mind: not everything you find on the Internet is correct and trustworthy. Better solutions for password hashing are known, and have been used and deployed for more than a decade now. See this answer for details and pointers.


Critical sub-packets in OpenPGP not used OpenPGP in RFC4880 allow to tag signature sub packets as "critical" by setting the high bit 7 in the packet type. I checked a few keys generated with GnuPG2 and all the sub packets are not critical, even for things like "9 - key expiration time".

So I wonder:

can I control which packet is marked critical when using GnuPG CLI to create a key signature,
are the interoperability issues expected
is there an agreement to not use critical for well known (i.e. specified in the RFC) packets?

The Critical Bit

  OpenPGP in RFC4880 allow to tag signature sub packets as "critical" by setting the high bit 7 in the packet type. I checked a few keys generated with GnuPG2 and all the sub packets are not critical, even for things like "9 - key expiration time".

OpenPGP, RFC 4880, 5.2.3.1.  Signature Subpacket Specification defines the critical bit. It can be set to inform older implementations of OpenPGP that if they do not understand a subpacket, they should consider the whole signature as invalid.

  Bit 7 of the subpacket type is the "critical" bit.  If set, it
     denotes that the subpacket is one that is critical for the evaluator
     of the signature to recognize.  If a subpacket is encountered that is
     marked critical but is unknown to the evaluating software, the
     evaluator SHOULD consider the signature to be in error.

So if a new release of OpenPGP defines new kinds of signatures, and a signature is restricted in some way that older implementations will not understand, you could have the newer OpenPGP implementation have the critical bit set to denote "If you don't understand the signature subpacket, consider the whole signature as invalid".

As all those subpackets have been defined at the same time the critical bit was defined, fully-fledged implementations should support those anyway.

  Is there an agreement to not use critical for well known (i.e. specified in the RFC) packets?

The RFCs relevant for OpenPGP (especially 4880) do not mention details on when not to use it.

Setting the Critical Bit in GnuPG

  Can I control which packet is marked critical when using GnuPG CLI to create a key signature?

man gpg2 shows up some use cases, in which you can set the critical bit for notations and key server/policy URIs by prefixing !:

  --sig-keyserver-url string

  Use string as a preferred keyserver URL for data signatures. If you prefix it with an exclamation mark (!), the keyserver URL packet will be flagged as critical.

Interoperability

  Are the interoperability issues expected?

Well, the critical bit is meant to prevent "broken" interoperability, when an older implementation does not implement important new features. So to some extent, it prevents operability, but at the same time this is why it was set after all.


Is it safe to use a PHP script to load a Base64-encoded PNG? As part of a bigger project that I am working on, I need to write a PHP script to convert a Base64 string into an image. The way I would like to go about passing the Base64 string into the script via a GET query, so...

example.com/base64ToPng.php?base64=thisIsTheBase64ForTheImage

I would then like to convert the Base64 that is passed in to a PNG image and display it as if the PHP file itself were an image. While this is not an issue from a development standpoint, I am concerned about the safety of doing this. Would I put myself in any danger since the Base64 is going to be created by the user? (Or more accurately, the Base64 is going to be created by a program based on the image the user provided it.) I am particularly worried about the user crafting a malicious image that could execute arbitrary code, but I do not know if this is a valid concern given that the image is only going to be recreated by the PHP script but not stored on the server.

<?php
    if(!isset($_GET['x'])) {
        die();
    }

    $image = base64_decode($_GET['x']);
    header ('Content-type: image/png');
    imagepng($image, NULL, 0);
?>

It isn't safe to use URLs longer than about 2000 characters. While the URL RFC doesn't specify any particular limit, most browsers limits the number of characters in a URL to less than 2000 characters.

Another problem is that using base64 is very space inefficient, as you'll be encoding three bytes with four bytes. This means that the maximum size of image you can practically attach reliably o most browsers is less than 1.5 KB.

You also have to consider that running this service will make your webserver log files fill up really quickly, as it'll be logging the entire URLs. It may be possible to truncate/hash the logged URL, but that'll make troubleshooting issues more difficult.

Appendix:

Unless you want to actually edit the image data, your implementation can just echo the image data, no need for imagepng():

<?php
if(!isset($_GET['x'])) {
    die();
}
$image = base64_decode($_GET['x']);
header ('Content-type: image/png');
echo $image;
?>


Security of a desktop application's source code How easy is it to get the source code from a desktop application?

Are there any protections in place to stop someone from viewing an application's code?

How easy is it to get the source code from a desktop application?

If it is open source software it is easy. If not it is harder.

  Are there any protections in place to stop someone from viewing an application's code?

This depends on the software. Usually you cannot get the full source back because in the process of compiling the original source is translated to machine code or byte code. But you can often decompile the code to get at least an idea how this software works and find bugs in it (i.e. reverse engineering). Some applications have added obfuscation and other methods to make reverse engineering harder.


How to avoid Spotify malware I use Spotify (the free desktop version) and was repeatedly served suspicious web pages launched by the application itself. Reading online reports, it seems like Spotify has been serving malware through its ads-supported free version.

What steps can I take to mitigate the risk if I still want to use the application?

I don't have any good solutions, but I have a couple of bad ones:

Upgrade to premium to get rid of the adds. But pay to not get malware? Doesn't feel right.
Uninstall it until they fix the mess, then reinstall it and hope they don't mess up again.
Run it on a VM. Just a tiny bit unpractical to have to start a VM just to listen to music...
Harden your browser (update to latest version, uninstall Java and Flash, etc) and hope for the best. Not bulletproof exactly, but better than nothing.
Change your default browser to a program that does absolutely nothing. That way Spotify will not be able to open a browser, but on the other hand no other program using the default browser will either...

As I said, not very good solutions. Perhaps someone else has some better ideas?


Whitelisting DNS vs. Packet filtering Firewall I am an information security intern for a MSP.

The company is set up to work remotely a few days a week. As I was gathering information for the assessment, I found out that one of the employees does not have a packet filtering firewall. She is running a Cisco Umbrella DNS agent and an SSL VPN when working remotely. She is adamant about telling me that she does not need a firewall because of the DNS agent and SSL VPN.

I always learned it was necessary to have a perimeter firewall to manage traffic. How can I articulate why she needs a firewall along with the other security controls?

I assume she expects that Umbrella will protect her from any unauthorised outbound connections because Umbrella whitelists common domains and blocks suspicious domains. A firewall also protects the machine from outbound connections.

The problem with Umbrella is that it only works on domains and not IPs. If malware on her machine is configured to reach out to an IP, Umbrella will do nothing.

Umbrealla will also not protect her from incoming connections, although that risk might be minimal if she is not running any services that can be connected to.


Setting Same-Site cookie attribute to Lax Is setting Same-Site attribute of a cookie to Lax the same as not setting it at all? If there are differences what are they?

Is setting Same-Site attribute of a cookie to lax the same as not setting the Same-Site attribute?

In Google Chrome < 76 – no. Setting SameSite=lax is safer than omitting the attribute. (But if your implementation currently relies on cross-origin requests, double-check that adding the attribute doesn't break anything.)
Here are the differences:

When you don't set the SameSite attribute, the cookie is always sent.

With SameSite=lax, the cookie is only sent on same-site requests or  top-level navigation with a safe HTTP method. That is, it will not be sent with cross-domain POST requests or when loading the site in a cross-origin frame, but it will be sent when you navigate to the site via a standard top-level <a href=...> link.

With SameSite=strict (or an invalid value), the cookie is never sent in cross-site requests. Even when clicking a top-level link on a third-party domain to your site, the browser will refuse to send the cookie.

Starting with Chrome 76, your browser has an option to make no SameSite behave like Samesite=Lax. This will be default in Chrome 80. From the feature description:

The Stable version of Chrome 80 is targeted for enabling this feature
by default. The feature will be enabled in the Beta version only,
starting in Chrome 78. This feature is available as of Chrome 76 by
enabling the same-site-by-default-cookies flag.

Also have a look at the RFC draft and Sjoerd's blog post.


Is a hosting company right in disabling all but TLS 1.2 as acceptable protocols to do SSL with? I've had a few complaints from visitors to a site I manage that they are unable to connect to their website due to TLS settings of their browser. When checked the devices in question were set to run TLS 1.1.

Is it common for clients to not have TLS 1.2 or have it disabled in 2017?
Can a LAMP Webserver be configured to handle TLS 1.1, alongside offering the more secure 1.2?

I'm considering switching hosting provider which is more compatible.

Is it common for clients to not have TLS 1.2 or have it disabled in 2017?

All modern TLS clients support TLS 1.2. It is not that common that a client supports TLS 1.1 but not TLS 1.2 because most major TLS stacks like OpenSSL (Unix, Android), SChannel (Windows) or NSS (Firefox, older Chrome) started to support TLS 1.1 and TLS 1.2 at about the same time. A reason for this is that TLS 1.1 was standardized 2006 and TLS 1.2 2008, i.e. shortly after and most TLS stacks did not start to support either of these protocols until 2012..2014 so they then implemented both at the same time.

It is still common that some clients support neither TLS 1.1 nor TLS 1.2 (older Android, older Windows) but supporting TLS 1.1 and not TLS 1.2 is uncommon.

On the server side most sites offer TLS 1.0, TLS 1.1 and TLS 1.2 while some sites with higher security requirements (like Paypal payment API) require at least TLS 1.2.

  Can a LAMP Webserver be patched to handle 1.1 TLS, alongside offering the more secure 1.2?

If you have full control of the server (which usually requires root on the system) you should be able to enable TLS 1.0 and TLS 1.1 and also only TLS 1.1 alongside TLS 1.2. If you don't have full control and only share the same web server with other users you cannot do this.


Can a Windows or Linux password be brute-forced on a public network? I am at a hotel that has a public network. I have a Windows machine with a wired connection to it. "Network and Sharing" has network discovery on. No folders are shared except "Users", which is shared by default. Is it possible for someone on the same network to gain the password for an administrator account on a Windows or Linux machine through a brute-force attack? Let's assume that all users' passwords are strong.

If you assume that all passwords on the system are strong, then no.

The definition of a "strong" password is that the time to complete a guessing attack, whether brute force or with a "common passwords" list is long with respect to the exposure.

Unless you live in the hotel, you'll be gone (and the exposure will end) before an attacker could have acquired your password through a brute force attack.  (Um, unless the attacker has physical access to the machine, which wasn't part of the question.)  On the other hand, if your password is cracked by brute force, it wasn't "strong."  There's a nasty amount of circular reasoning in there.  Let me see if I can get rid some of it.

The strength of a password is measured in bits of entropy, or randomness.  If your password is on the list of 500 most common passwords, you have about 9 bits of entropy because log2(500) is about 9.  Put another way, 29 = 512.  If you use a password that is five Dicewords, you'll have about 55 bits of entropy because each word is drawn from a list of about 2,000 words and log2(2000) is about 11. (211 is 2048.)  You get eleven bits of entropy for each of the five words, total 55 bits of entropy.

If one can make G guesses per second against a password with n bits of entropy, then the average time to guess is 2n-1/G because, on the average, the attacker will "hit" about halfway through the possible values.

So, an example: a password with 28 bits of entropy and an attacker can make 210 guesses per second, assuming an online attack.  (Offline attacks can be much faster.)  That will take about 227 guesses, or 227-10 seconds, or about a day and a half.  If you have 55 bits of entropy in the password, that's 244 seconds, or about 557,000 years.

Now you have a fairly rigorous definition of "strength" and can figure out how strong your password must be to withstand a sustained attack over a three-day hotel stay.  (There's a pretty big assumption about G in there, though.)

Edit: This answer addresses a brute force attack on the operating system's login interface, which is, I think, the question.  There are many other kinds of attacks.


Uploading sensitive data, Should I user memoryStorage (buffer) or save and delete file? I need to save very sensitive data from an Excelfile that the user uploads. The data will then be saved to mySQL. All is done in Node.js.
Now I wonder what is the most secure way to upload the file.
Should I use Multer (https://expressjs.com/en/resources/middleware/multer.html) which has a memoryStorage option (a buffer of the entire file), or should I save the file to a folder and then delete it as soon as all data is added to mySQL?
From a security viewpoint, what is the best option?

In general memory-only leaves less cruft behind, particularly if you explicitly overwrite the memory when finished, assuming you can handle it all in memory.
Deleted files are recoverable to a large degree, but then again so is the mySQL content.
Realistically I think other factors are the main issue. How are you protecting the server and its content independent of the upload handler.


Is sharing the Membership Provider with other devs a security risk? I hope this is a good place for this, but I am looking to be safe while sharing my ASP MVC project. If a page was designed with a membership provider is is possible to share this project with out leaking information about your membership provider? From my understanding it would be very difficult for another developer to work on the project without this piece.

Your question seems to be about keeping files secret for security reasons, not for intellectual property protection reasons. You should not be worried about sharing your files, especially your membership provider code. If you have custom built a membership provider, then it is especially important that you let other people review it for potential security flaws. If you have used the standard membership, such as Identity or SimpleMembership, then there is no benefit in hiding that fact.

In practical terms in any ASP.NET MVC project I have worked on, the membership aspect is so deeply coupled with the rest of the code it would be next to impossible to remove it without rendering the project useless to your collaborators, or putting an overly large integration burden onto yourself for changes that are made by them.


Are the details about the Widevine bug now public? There was a bug in Widevine last year which enabled downloading Encrypted Media Extension Content.

They stated that they would give full details after 90 days. Was this meant for public disclosure or full details only to a set of parties?

The problem is that if the bug is publicly disclosed, I don’t see how using an old version of Widevine for viewing Videos wouldn’t prevent to bypass the fix.

From reading the linked article the way they phrase the sentence regarding the disclosure appears that they're talking about full public disclosure, however after a few searches I couldn't find such a thing, no paper, nothing.

The article states the below, personally, the way I read that is after 90 days they will release a full public disclosure.

  The researchers say the bug is very simple but won't reveal details about it until at least 90 days after their disclosure to Google, since they don't want to provide anyone who doesn't already know about the vulnerability with information that would allow them to steal movies. - Wired 26/06 - Bug in Chrome makes it easy to pirate movie

It then goes onto say

  Ninety days is the minimum that Google's own security researchers in its Project Zero project give vendors to fix vulnerabilities they uncover before they disclose the bugs publicly. Wired 26/06 - Bug in Chrome makes it easy to pirate movie

Which furthers my idea that they meant public disclosure, however, as I stated other than a few blogs from a guy not linked/related to David Livshits and a whole bunch of news articles, plus a bug note from Google I do not see any "public disclosure" here.

It's very likely this comes down to phrasing or poor research on the journalists part. The problem with this article you're using as a reference is, it's published by a journalist, a journalist that might not even specialise in InfoSec or anything related to this field, you have to take articles like this with a pinch of salt - E.G don't trust their word on everything. (Perhaps research into the journalist a little and see if they're credible, etc)

From my point of view, as I couldn't even find a paper, I would put this down to the fact that the journalist simply didn't know, thus they based the "after 90" days off the second quote I referenced from the post.

I would not bother trying to get a response from Wired, they probably will not answer and even if they do I doubt they will actually know the answer you're looking for if they did they would have most likely mentioned the paper in their article. Your best chance of finding out whether or not public disclosure will ever be released/if it's been released would be to contact one of the researches involved in the project, they will know better than anybody else about their intentions for public disclosure (if any) for obvious reasons, if it helps the research was based out of Ben-Gurion University of the Negev in Israel so perhaps a good start would be to see if you can find a contact there.


In which country can you host a service which honors privacy? Recent events like the Lavabit case have shown that it is no loger possible to host a server in the United States and guarantee your users that you will keep their data confidential, because the US government can force you or your hoster through a National Security Letter to spy on your users for them while forbidding you to say that you are being forced.

Which countries are still an option when you want to be able to guarantee your users that their data will be confidential but also offer reliability and performance to users in North-America and Europe? Maybe Canada? Are EU countries save?

Realistically none.  That's the point of cryptography.  If the government asks, then most (effectively all) companies are going to comply if sufficiently legally threatened.  Cryptography makes it so that the information isn't accessible even if hardware is seized, but you have to be ready to pay the consequences of not cooperating in unlocking it.


Someone is accessing my data, what can I do about it? I recently set up something called "canary tokens" (https://www.stationx.net/canarytokens/) to help detect if anyone is accessing files/emails/domains that I don't want to be accessed. They are meant to email you info about IP numbers anytime your file, email, link, URL is accessed so that you know if someone is accessing or trying to access your stuff.

One of the tokens is meant to "get [you] notified whenever someone opens browses a Windows directory in Explorer." I downloaded the zip file for that, extracted to my desktop and changed the folder name to something like: "Passwords and important files".
Now I should get an email containing the time and the ip number every time the folder is opened.

I tried it a few times and noticed that I got an email but the emails didn't have the IP number I get when I google "what is my IP". Furthermore, I keep getting emails (while the laptop is on and connected to the wifi) every 2-10 minutes saying that a random IP has accessed the folder. The first Ip numbers were located in my city, but now most of them are from a different country. Some of them share all except the last two digits of the IP number.

Can anyone tell me what may be causing this and what I can do about it?

nb. I've also tried using this for links in email, urls on my domain, and Word files on my computer but those don't seem to make notifications so often and when I try accessing those, I get my IP number.

EDIT

Just noticed that whenever I access the folder, the email reads:

Channel: HTTP

but when the unknown IP accesses the folder, the email reads:

Channel: DNS

Does that change anything?

Have you considered that an Antivirus Program or a Windows App may be accessing, uploading and inspecting your files on a remote server behind your knowledge?

What you've "uncovered" using canary tokens may lead to interesting findings regarding privacy issues on Window$.
I'd start by knowing the owner of the IP address from where files are being accessed. This may give you leads about the programs accessing the files.
From there, you may seek legal counseling, just make sure that you haven't agreed to what's happening by clicking "yes, yes, yes" while installing an app or accessing a website without fully understanding the terms and agreements.

I'm not a privacy expert, but I'm positive that in some part of the Microsoft Services Agreement there's a clause allowing MSFT to upload and inspect your files on a remote server.

  "Some of them share all except the last two digits of the IP number".

Companies like GOOG, AMZN, MSFT or Dropbox own large IP address blocks. Find out the current owner of the IPA using ARIN, RIPE, LACNIC
 or APNIC.


I recently discovered that dsniff had been installed on my computer. What do I do? I have recently discovered that a co-worker (who has sudo privileges on my machine) has installed dsniff, and it has been there for a while. I have no idea when they ran it (if at all), the only command I found in their bash_history with dsniff is apt-get install dsniff although bash_history doesn't show commands run with a screen session. Could my emails and other accounts be compromised even if they use SSL? Is there anyway to get more information about what sort of information the program has been collecting about me?

DSniff is a set of tools which do traffic analysis on the network. A machine which has DSniff installed can spy upon the local network and reveal every data element which is not protected. Nominally, SSL protects against that; that's what SSL was designed to do. One of the DSniff tools is webmitm, which purports to intercept and crack SSL connections -- it can do that only by making the client accept a fake server certificate, as part of a Man-in-the-Middle attack. If you never got a warning from your browser (the big scary warning which tells you that the server's certificate looks fishy) and clicked through it, then you should be safe. The validation of the server's certificate is the part which prevents MitM attacks.

However...

Your real problem is that potentially malicious people have administrative access on your machine. If they wanted to read your files, grab your passwords and generally plunder your secrets, then they could have perfectly done it and then removed their traces. That you find in their .bash_history file an installation command for dsniff does not mean that installing dsniff is the only thing they did. Having "sudo privileges" implies being able to run arbitrary things without any restriction on the machine. That kind of power includes the power to edit log files to remove all traces of funky activity.

To sum up, if your co-workers want to see your emails, then they already have them and there is no guarantee that you could find any trace of the act.

That's why in most workplaces they have this wonderful thing in place, called trust. Personally I would not accept to work with people that I could not trust with not trying to read my personal emails.


Token-based group invitation link I've searched this site and the web for an answer to this question, but haven't found what I'm looking for, so here goes. Pointers to existing relevant answers are much welcome as well.

I'm building a web app where users can be in private groups. In order to join these groups, existing members can send to-be members a link to the group with a token in it. I'm wondering what precautions I should take regarding this token, so random people can't guess it and join a group. I'm currently generating a 256 bit random number (from a cryptographically secure random number generator) associated with the group that is then serialized to a string and sent as part of the URL (using HTTPS of course).

My question is, would I gain anything by hashing this token using e.g. bcrypt, and comparing the hash server-side in the group join operation? Would the answer to this change if I add a time-based component, so invitations are only valid for a certain time interval?

I've decided to not use bcrypt, since it looks like it is designed for weak passwords that need salting, which a cryptographically random 256 bit number definitely isn't. The current approach is:

Create a token based on a SHA256 sum of the 256 bit secret plus a serialization of the expiry date.
Send this token to the user that wants to invite others, as part of a link.
The receiving user that wants to join a group clicks the link, and the server validates that, given the SHA sum and the expiry date, the token is not expired and the sums match when doing the same calculation again.

Any comments on the validity of this approach are greatly appreciated.


NAT Mac address leak to Internet Recently in the leaked 0-day exploit for Tor browser, whole shellcode's purpose was getting user's MAC address and sending it to the servers which people are suspecting that exploit was developed by Law enforcement to unmask some TOR users real identity.

My question is, these days everyone is behind some kind of ADLS/VDSL/Fios router. So 99.9% of internet users are behind NAT. So if I'm behind my router, my MAC address AFAIK would never leave my network.
So considering that, what's the benefit of sending MAC address of my PC inside my network to outside? Who and how they can track that MAC address to me?

Maybe my main question is, why and how my NATted device's MAC address is transferred to lets say ISP or internet? Please explain what am I missing. I know ARP packets carry these messages, but I assume NATted devices ARP packet won't reach ISP.

You're mixing stuff up. The Tor browser runs locally, on your machine, the machine with the network card that has the MAC address. So, that MAC address never by itself leaves the local network. The internet doesn't care you're using Ethernet locally.

As you said, this might have been done to strip people of anonymity. It doesn't matter that you can't be recognized on the internet by your internal network hardware address if all that's necessary is proof that you've been the one doing something via Tor.

Since you brought up the law enforcement aspect: Your MAC address might not be worth anything on the internet, but when it's used to prove that it was in fact you, and not your flatmate on the same LAN, who did something, it might make the difference between being sentenced and being let go due to lack of undeniable proof.

Consider the fact that one of the motivations to use Tor is to evade state surveillance. If you had to scare away people from doing so, how else than via a deliberate leaking of identification providing info would you do that?


Best way to handle identity theft incident? A user's email is hacked, contacts copied, and similar emails (look alike emails with minor spelling differences) are created by the attacker with the same name and avatar, sending relatively well crafted and highly targeted emails to his contacts, mostly of the type "this is an emergency, send me some money now".

This happened to a friend months ago. He was able to retake his email, however the attacker is still very active. In one incident, the attacker was very close to convince my friends' bank account manager to transfer a hefty amount of money to a Western Union account in Thailand! The account manager called my friend because the money transfer details were missing one little information, and that is how it was stopped.

What's the best way to handle such a case?

Here's what I have and what I tried:

Calling Yahoo to block impersonating emails - after a 25 minutes international call, they said they cannot help (?)
The bank account manager email has a Western Union address, with name, address, and phone all in Thailand. What's the proper way of reporting this? does it help to do so?
I have text-dump of the email headers -- I'm not an expert but wouldn't that include the attacker's IP? assuming this is correct, should I attempt to report this IP? to whom?
In some of the emails, the attacker instructs recipients to go to a phishing website where they are asked to login using their email credentials. The website is hosted on free web hosting service 3gb.com

I can share all details (WU details, email dumps, website) in a paste bin if it is acceptable per SSE policy. The fraudster have been a major pain. Any suggestions are welcome.

The best advice I can give you is to contact a lawyer or law enforcement agency in your country to seek advice. The laws regarding such matters vary from country to country so it is best to contact a professional in your country.

Legally and practically speaking, there isn't much you can actually do to stop the fraudster, especially if he is located in a country not known for their computer laws. You might consider changing your email address to something totally different and cannot be confused with, and inform all your friends/contacts about the possibility of them receiving a scam email.


Penetration Testing Vocabulary The Terms and Conditions on Amazon's AWS prohibit activities called, "White cards" and "Red team and blue team testing". What do these terms mean?

White card:

  white card is a simulated event in an operational test. White cards are used when a system is too fragile or operationally critical for the adversarial team to pursue an exploitation, or when the adversarial team is unable to penetrate the system, but there is still a desire to evaluate the ability of the system to react to a penetration. White cards should be used only when necessary

Source

Red team / blue team:

  Red team-blue team exercises take their name from their military antecedents. The idea is simple: One group of security pros--a red team--attacks something, and an opposing group--the blue team--defends it. Originally, the exercises were used by the military to test force-readiness. They have also been used to test physical security of sensitive sites like nuclear facilities and the Department of Energy's National Laboratories and Technology Centers. In the '90s, experts began using red team-blue team exercises to test information security systems.

Source


Unknown Service Identification How can one identify a service running on a non-standard port? I'm not talking about services like webserver or FTP since nmap can do that without any problems. I'm talking about services that are not that common, like Java RMI, X11, ...

What I found till now is amap and the NMAP+V patch and some standard strings like:

version
?
\r\n\r\n
help
...

Is someone aware of any kind of list/paper for a good start?

nmap+V and amap are old patches and forks of nmap that was used before nmap added version scanning into the core build. Both tools are mostly obsolete now. Even the AMAP website agrees.

nmap -sV -V -ip address-

The -V flag increases the verbosity of nmap's output, giving you the exact header information that nmap uses to determine what service/version is running on the port.

In the case of non-standard programs, your best bet would be to use Google to search for more information about a particular header or other information that nmap returns. There is really too many obscure programs for anyone to provide a comprehensive list in one place.


Authenticating without a database I've been inspired by a question over on Code Review, which boils down to: What is the proper way to authenticate a user without a database?

Would it be the exact same process if you stored credentials in an array, or an XML file, or even just a plain ol' text file?

For example, let's examine the following PHP code:

$credentials = array(
    'UserA' => '$2y$10$PassForA',
    'UserB' => '$2y$10$PassForB'
);

$username = $_POST['username'];
$password = $_POST['password'];

if (isset($credentials[$username]) && password_verify($password, $credentials[$username])) {
    // Successfully authenticated
} else {
    // Permission denied
}

Is this a perfectly acceptable way to store credentials? If we were to grab the username and hashed password from an external file (XML/txt), would things need to be treated any differently?

An XML file holding user credentials is a database. The definition of a database isn't limited to MySQL (or whatever it is you had in mind).

How users are authenticated and where exactly their credentials are stored are two entirely separate concerns. A bcrypt hash is a bcrypt hash, regardless of whether it's stored in a plaintext file, a MySQL table or a MongoDB document.

Of course different types of database systems work differently and required different ways of updating and loading data, but this has nothing to do with user authentication specifically. Those are general issues of data storage.


Securing a LAN that has multiple exposed external Cat 6 cable runs? We're evaluating putting in an IP-based CCTV system for a third-party upcoming project (part of a wider networking project). The CCTV system is cabled as follows: Cat 6 running from each external camera to a POE switch, patch cable from switch to NVR (network video recorder basically HDD enclosure that records the CCTV).

My concern is that there will be multiple long external Cat 6 runs that are essentially very easy entry points into the network. All some one would need to do is cut the cable, put RJ45s on both ends of the cut, place a small switch in-between and then patch themselves into the switch... Apart from the couple of minutes downtime, the CCTV camera could even carry on working.

What can I do to secure the network? I can't just not connect that switch to the rest of the LAN because there are third-party apps (home automation controllers like Crestron) that we use that sit on the local network and access the NVR as well as other local area network-attached devices.

Options that come to mind:

Use a Managed Switch to provide access control by physical port.

For each physical port, only a specific IP address can be allocated (i.e. that of the camera) This may help detect attacks because if the attacker tries to create an IP conflict to access the rest of the LAN then that will likely interfere with the camera connection. More advanced attackers can probably avoid such detection though.
For each IP we now know it can only come from a particular physical port. We then create access control lists by destination IP and TCP port number.

Ideally the cameras should use HTTPS and that your receiving station is secured against MiTM by verifying the camera's HTTPS certificate fingerprint. At the very least the cameras should have some kind of authentication before releasing their video stream and configuration interface.
If modern WiFi is an option it has a built-in authentication before accessing the LAN based on a shared secret. However, it can be DoSed wirelessly and its security is less easily validated by another party. (proving physical cables secure is easier than proving that a shared secret was not compromised)
I've heard of an authentication method designed for restricting Ethernet use but I'm not sure its scope (or if your camera supports it) or whether it will help you without updating all the other devices on the LAN. Perhaps a Managed Switch would help contain the need for updating configuration.
Overall review the security of the other devices on your LAN. Windows computers should treat the networks as Public Networks so they do not assume trust. Each device on your LAN should be considered and secured.
Of course do not leave any default credentials in place. The passwords must be  reset on all new devices both for the CCTV and other devices on your LAN.
Don't forget physical barriers :-)


Can my G Suite admin see my browsing history if: I am in incognito mode on iPad Chrome? Can my G suite admin see by browsing history if: I am in incognito mode on iPad Chrome?
iPadOS beta 3.
I'm signed in with a G Suite account.

If they are monitoring me, is it visible? Is there any way to make it invisible?

I am not on their network and there are no Chrome extensions installed. No monitoring software is visible when I go to the apps menu, and the security section in the Google Account page shows no third-party apps with account access.

The answer to this is very simple, and follows from the ten immutable laws of security

  If a bad guy can persuade you to run his program on your computer, it’s not your computer anymore
  A computer is only as secure as the administrator is trustworthy

In your case you have a device someone else administers. If you don't trust your administrator, you cannot trust the device with whatever you are about to do. This universal to absolutely all computer systems.


SSD enrcyption with ATA password - AHCI mode? I have seen articles advising that in order to make the most of an SSD, it should be connected in AHCI mode.

Some SSDs allow the ATA password to encrypt the encryption key so my question is this - does this ATA password work in AHCI mode? I have a feeling it doesn't.. in which case, is there an alternative?

I only have an i3 so want to avoid software encryption.

Thanks!

The disk lock is a built-in security feature in the disk. It is part
of the ATA specification, and thus not specific to any brand or
device. The disk lock can be enabled and disabled by sending special
ATA commands to the drive. If a disk is locked, it will refuse all
access until it is unlocked.
Source

Based on that I believe that it is not part of the AHCI/SATA standard, however as other comments have suggested, Full disk encryption using software like true-crypt is recommended.
Furthermore:

While the ATA disk lock is intended to be impossible to defeat without
a valid password, there are workarounds to unlock a drive. Many data
recovery companies offer unlocking services,[25] so while the disk
lock will deter a casual attacker, it is not secure against a
qualified adversary.
The drive is simply 'locked' whereas TrueCrypt actually encrypts the data on the drive.

In addition, You should be aware that ATA mode has noticeable performance loss over AHCI. There are a number of comparisons available online between the performance benchmarks of the two. It might be that any performance impact on your system from FDE may be negated by using AHCI mode. You will need to test for your own system.
Hope that helps,


A stranger asks for my delivery address, how much information should I give? There's this person online with whom I have only interacted a few times. They had asked me for a small favour, which I did.  They then wanted to give me something in return as a thank you. They were going to post it, so they wanted my address.

I am countries away and I'm not used to mail, especially international mail. I hate that I'm paranoid like this when I genuinely look forward to their gift, but I need to know to what extent do I share my details?

In the end, it all comes down to trust and risk. How much do you trust this person and how much do you want to give as far as details goes, what can someone do to harm you when they have your data? That you're asking here tells me you're not really sure if you can trust this person. There are risks involved (such as real life threats or maybe a possible scam) but it is not easy to identify risks without knowing the full situation, as you explained it rather vaguely.

To me the whole situation sounds kinda phishy to be honest. Are you sure you didn't fall for a phishing or scam attempt by helping this other person?

Most countries do have PO boxes and other rent-able post solutions such as Poste Restante (as suggested by Molot in the comments) so you don't have to give out your own personal details.


Restore GPG key after exported to a smartcard After exporting my private key, I moved my private key on a smart card using keytocard. This worked fine, and I could sign and use GnuPG as expected.

Now I would like to go back to have the private key in my GnuPG data base. Since I have the private key backed up, I thought this should be easy, and tried to simply import it:

gpg --import-ownertrust mybackup

However, this seems not to help. The key has still the card-no attached, and when I try to sign something GnuPG asks for the card.

Even deleting the key and reimport seem not to help:

$ gpg --expert --delete-keys <KEYID>
$ gpg --edit-key <KEYID>
gpg (GnuPG) 2.1.11; Copyright (C) 2016 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: key "<KEYID>" not found: No public key
$ gpg --import-ownertrust mybackup

gpg: key <KEYID>: secret key imported
gpg: Total number processed: 5
gpg:               imported: 1
gpg:              unchanged: 1
gpg:       secret keys read: 5
gpg:   secret keys imported: 1
gpg:  secret keys unchanged: 2

With that, it seems that GnuPG imported the key. But if I try e.g. signing,  GnuPG still asks for the smart card. Also --edit-key still shows "card-no". It seems as if this information is not removed using the delete-key operation above. How can I restore the private key without a reference to the smart card?

The owner trust export is no private key backup, but contains trust you issued.

If you exported the private keys (--export-secret-keys), --import them. GnuPG before version 2.1 cannot merge private keys, so you'd need to completely remove the key and import it again (don't forget to --edit-key the key and check whether it still has ultimate trust assigned through the trust command).

If you mixed up the ownertrust export and the secret keys export, and do not have exported the secret keys (or have some other backup), you're stuck with the private key on the card. The OpenPGP smart cards do not allow to export private keys.


Is it possible to Spoof Another Machine's MAC Address on LAN? Is it possible to Spoof Another Machine's MAC Address on LAN?

I know we can spoof mac address of machine that we are currently on, using macchanger or ifconfig wlan0 ether de:ad:be:ef:ca:fe. But I want to make another host on LAN to pretend that it has certain mac address? Is it possible to do via anything? ARP?

And, A little about ARP: The router will broadcast a message "Who has the this MAC Address?" and the host replies. And in ARP Spoofing, Attacker intercepts and responds instead of actual host. Can we spoof this and let router know that another host(Host B) has diff. MAC Address?

PS: I don't have access to Host B, otherwise I could get on that machine and change its MAC.

You cannot change the MAC address on the remote machine. The method you are looking for will keep answering the arp requests and fullfil them your supplied MAC. Ettercap is the tool used. Here is great description of how arp poisoning works. This does exactly what you are asking.


Do any crypto libraries take advantage of Windows GPU API "Direct Compute"? Are there any encryption (decryption?) libraries that take advantage of the Windows GPU API?

As Paulo quite rightly says in the comments, many encryption operations do not lend themselves well to parallelisation. For example, consider the two AES modes ECB and CBC. ECB consists of applying the AES transforms to each data point using various elements of the key schedule according to the position of the data modulo the key schedule length. Essentially, once you've generated the key schedule, you could easily parallelise AES in ECB mode.

Except that ECB is not a great mode of operation security-wise, because for larger amounts of data you begin to reveal patterns in your ciphertext. Wikipedia explains all of this much better than I can.

CBC mode can basically be described as "take the output of the last operation, xor it with the plaintext and encrypt the result". Typically, you start by xor-ing the first plaintext with an IV. For encryption, you must calculate each block at a time and so the operation is not at all suitable for parallelisation; however, for decryption, you can parallelise the process since a pair of blocks are all that are required to decrypt a block (i.e. if you have block 1 and block 2, decrypt block 2 according to its position in the key schedule and xor with block 1).

These are just some examples; some algorithms do lend themselves to parallelisation. Consider you want to try many passwords against some hashed password you have. Each hash calculation is hard to parallelise, since each block must be fed into the hash function by turn; however, what you can do is to do many hash operations at once - imagine setting off a thread for each hash attempt. Graphics processors are good at this kind of work as they're essentially designed to transform whole sets of co-ordinates in 3D space according to a mathematical result - basically, to do 3D graphics.

A good paper on this topic is Cuda compatible Gpu as an efficient hardware accelerator for AES. Bruce Schneier covers speeding up password cracking. Distributed hash cracking tools have also been studied and google turns up a number of implementations.

I expect that as more work is done, more and more methods will be found to take advantage of parallelisation, both in terms of cryptanalysis and in terms of cryptography. I am not a cryptographic researcher, however, so you'll have to take that with a very large dose of wariness.


Forwarding an SSL connection My general question:
Can a two-way SSL connection be forwarded to a 3rd server?

The specifics:
I have a WebLogic server supporting two way-SSL, client side's cert is from their CAC card.  The weblogic server acts as a gateway to an Oracle Database.  Oracle can authenticate the user via Username/password or, preferably, by SSL.  Is there a way the weblogic server with an established SSL connection can re-use the client's cert to connect to the db?  Assume control over all machines (Database server, Weblogic Server, and Client PC via Java applet).

Is there a way the weblogic server with an established SSL connection
  can re-use the client's cert to connect to the db?

No, there is no SSL equivalent to SSH Agent Forwarding; the SSL server cannot forward the client certificate credentials to another server.

Now, that's not to say you can't leverage the credentials.  If your weblogic server validates the client certificate, and then inserts an "X-I-Authenticated-The-Client: username" header, the backend DB can then treat that as an authentication if, as you say, you have control over and trust between the weblogic and the database layer.

(That's harder if you're not using something like HTTP, but even database connections can do it; consider PostgreSQL 'Trust' or 'Ident' authentication methods.)


Are fields of a root CA certificate checked? During SSL server validation, it seems that the only fields of X509 certificates found in trust stores that are actually used are the "Common Name" and the "Public Key".

I'm not talking about any specific certificate validation implementation, but let's use OpenSSL as an example.

It seems that normal checks that happen to intermediate CA certificates do not apply to those present inside the anchor store, for example that basic constraints are not checked, dates are not checked, cipher weakness is not checked etc.

So I have two questions:

Is the behavior I described correct? Are there any other fields being used?
Should such 'extras' be checked according to the relevant RFCs ? From a casual read, it seems that everything in the anchor store is a priori trusted; no further checks should be done.
This means that a CA certificate that lacks the CA:true constrain can issue other certificates and be the root of a valid chain.
It also means that a CA certificate that has expired can also be root of a valid chain. Thoughts?

This means that a CA certificate that lacks the CA:true constrain can issue other certificates and be the root of a valid chain

From my experience at least OpenSSL will verify that the CA:true flag is set, i.e. that the certificate can be used as CA at all. But I doubt that it checks expiration. It does not check for revocation since root CA are usually self-signed anyway thus revocation check would be impossible (you cannot trust a certificate to issue a revocation if you don't know yet if you can trust the certificate).

EDIT: based on the feedback of @Georgi it looks like that it will assume that the certificate can sign others if no constraints are set. But if an explicit CA:FALSE is set on the issuer certificate validation of certificates signed by this issuer will fail.


SSL stripping in home network I am  trying to monitor the traffic of some "smart devices" in my home (TV, coffee machine, ...) but most of them communicate over SSL.

What possibilities are there to look into SSL encrypted traffic without paying a lot of money for some appliances?

I do have the possibility to import my own certificates in some of the smart devices but I don't know how to handle all this in a somehow useful way. I even have a little Intel NUC between my ISPs router and the switch used for these smart devices, so I could use this one for SSL stripping - I am just not sure how to start with it.

Any advice would be highly appreciated.

If I am not mistaken, importing your own SSL certificates is just for the connections which you make to the device's own web interface so that won't help you to accomplish your goal.

What you would need to do is:

Create your own root CA
Make those devices trust your own root certificate
Redirect all SSL traffic from those devices to your proxy
When a device tries to connect to spy.samsung.com present an SSL certificate for spy.samsung.com signed with your own root certificate.
Forward requests to real spy.samsung.com and replies back to the device.

The hardest part is #2, which requires access to the device on a level which will allow you to modify its trusted certificate store.

The complexity of that task may range from trivial, such as logging in through SSH and appending your root certificate to curl-ca-bundle.crt or a similarily named file somewhere on the device, to the extremely difficult, such as having to defeat boot-loader lock and code-signing verification to patch an executable in the device's firmware so you can insert your root certificate or even having to find and extract its private key if the device is using mutual authentication with the server.

Depending on your place of residence some of those activites (such as reverse-engineering the device) might even be illegal, not to mention that if you already have to resort to reverse-engineering you might as well look at the code to see what is being sent/received.


What happens when a Firefox blocked extension is already installed and enabled/disabled? Mozilla has been busy blocking Firefox extensions from their ecosystem due to security and privacy concerns.

What happens when a blocked Firefox extension is already installed and enabled?
What happens when a blocked Firefox extension is already installed and disabled?

By following the first link on the site you've mentioned I came to a short document describing why Web Security and others has been blocked. This document refers for detailed information to this support article. I think this document provides most of the information you want to know in detail. To cite:

Once a block is implemented, Firefox will block the unsafe add-on from loading. Blocks can be issued at varying levels depending on the severity of issues found.

Soft blocks disable an extension by default, but allow you to override and continue to use the add-on. Soft blocks are issued for non-malicious add-ons.
Hard blocks disable an add-on and do not allow you to enable it or override the block. Hard blocks are used when add-ons are found to be malicious.
Click-to-activate blocks disable a plugin by default, but allow you to enable the plugin for particular sites. This type of block is issued for non-malicious plugins.

I cannot see any information how it deals with already disabled plugins. But I'll guess it works the same as with previously enabled plugins, i.e. depending on the type of block you might be able to re-enable it or not.


Trying to create cert for RSA and Not ECDH I have an old application that needs the obsolete RSA key and not the ECDH. I know the ECDH is newer. I have tried this
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem

I create my csr
I import the csr in CA to create cer and the chain. After doing all this I still get the new version of the ssl cert.
The connection to this site is encrypted and authenticated using TLS 1.2, ECDHE_RSA with P-256, and AES_128_GCM
I want this:
The connection to this site is encrypted and authenticated using TLS1.2, RSA, and AES_256_CBC with HMAC-SHA1
The application servers are Windows.

You got this: TLS 1.2, ECDHE_RSA with P-256, and AES_128_GCM, but you wanted: TLS1.2, RSA, and AES_256_CBC with HMAC-SHA1
There are two different but related things here: the algorithm in your certificate, and the configuration of your TLS server.
So you made yourself an RSA signing certificate, and you configured your TLS to offer cipher suites with ECDHE key exchange and RSA signature. You are looking for a cipher suite that does RSA key exchange, which is probably not going to work with the certificate you created.
I won't do all the work for you, but I'll give some pointers: first, to get a certificate that can work with RSA key exchangeyou'll need a certificate with keyUsage = keyEncipherment. Check the cert you have; I would bet it's keyUsage = digitalSignature, in which case you'll need to edit your openssl ca config file to list (see this article)
keyUsage   = critical, keyEncipherment

and then you'll need to edit your openssl tls settings to add the RSA key agreement ciphers (see the openssl man page). Good luck!


Is transaction history stored on credit card a security risk? I installed an NFC reader on my android and scanned each of my bank cards to see what they would reveal through their contactless feature (NFC).

Unsurprisingly they reveal the card number and the expiry date, these are required for the transaction and they did not reveal the cv2 which is comforting.

I was surprised to find though my Mastercard credit card revealed a transaction history with the charged amount and the date and time of the transaction, I tried this out with another card and found the same.

Does this present a security risk to the owner of the card if a malicious actor read their card with an app like this or if the card is lost. It does not reveal who the payment was made to, but this could be enough information to socially engineer the card holder. What is the benefit of storing this transaction history on the card itself?  Only the Mastercard credit card seemed to do this, so it does not appear to be an industry standard practice.

There is some risk. Whilst the merchant isn't listed the amount, time & currency does leak information. Combined with other easily obtained data it can give more.

Considering some card issuers use transaction history as part of their security verification process leaking the info isn't ideal. With regards to social engineering it doesn't really give you much more than just following someone.

Transaction history is I believe part of the EMV standard. Visa disable it by default whilst Mastercard don't. Issuers can override this. If you are concerned then complain to your card issuer.

  What is the benefit of storing this transaction history on the card itself?

One possibility would be with something like TFL in london. You can tap into and out of the transport network with a contactless bank card. TFL have inspectors on random trains/buses that ask you to present your payment method - for contactless cards they scan them with a reader. For cards offering transaction history they could verify immediately whether the card was tapped in. Without this they have to compare inspected card logs against transaction logs when they are processed at end of day - meanwhile if the card was fake/stolen the holder is long gone.


What are the downsides of BrowserID/Persona compared to OpenID/OAuth/Facebook? Mozilla went live with a new service called BrowserID/Persona (announcement, background). It is intended to replace current single-sign-on solutions such as OpenID, OAuth and Facebook.

One advantage is that a future integration into the browsers will reduce the phishing risks. Also, the identity provider will not be notified about the sites someone logs in to, which is good from a privacy point of view.

What are the issues with BrowserID/Persona compared to OpenID/OAuth/Facebook?

I like the idea, but I too have many questions left open. Please do not see this as any form of bashing, because I wrote it trying to apply my authentication experience to this new scheme.
I am concerned about (in no particular order) :

Unauthorized use of the private key
Rich client support (Outlook, Notes, etc.)
Using from multiple computers
Private key protection or encryption (on the client)
Authentication of key generation requests
Privacy

Details below. First a one line summary (in bold italic) and some clarifications.
1. Unauthorized use of the private key
The private key will be protected by the client, with varying degrees of security.
I am worried that any the private key will be used without my consent. When trying to authenticate, a signing operation will take place. I must be prompted before it is used, or else a rogue script could get my browser to sign a logon ticket and submit it. Rogue script could come from a widget, add or other XSS. Implementation of this mechanism will vary in every browser, and even on different platforms for the same browser, or different versions, etc. With a somewhat inconsistent visual, users are at a greater risk to being lured to approve a logon request.
2. Rich client support (Outlook, Notes, etc.)
It was desinged to work with web mail accounts. Enterprise "fat" mail clients are somewhat left behind.
For Browser ID to work, you need a browser that supports it. In the meantime, some browserid.org issued "JavaScript shim that implements the missing functionality using standard HTML5 techniques and cryptographic routines implemented in JavaScript".
Users in a corporate environment who use fat mail client (Outlook, Notes, Thunderbird) will be late adopters, because the protocol will have to be implemented in those clients too. Not to mention that Outlook does not share a keystore with Firefox, or Thunderbird with IE.
3. Using from multiple computers
It leads to a proliferation of private keys, because the scheme does not to have a central authority.
And there is a mobility problem. I will have to register (generate a private key) for every computer I use. How will I go about deleting my private key in an internet kiosk, or a borrowed computer ? Even with a single computer, how will I revoke a key stored in a stolen computer ? Since for a single user, multiple signature keys are valid (because each of my computers have its own valid private key), from the service provider point of view, any access token signed by a known authority must be valid.
4. Private key protection or encryption (on the client)
Access to the key must be authenticated, which brings passwords back in the picture.
It can protected by a password (limiting its malicious reuse), but if I ever change my password somewhere, it will not synchronize unless I use some browser/cloud based sync network. Having a password to remember somewhat defeats the purpose of this scheme. Chances are the same password will be used to secure every key, much like the same password is used now to authenticate to multiple websites.
5. Authentication of key generation requests
There is a gap between the access request and key generation, wich an attacker could use for phishing.
It is unclear to me how the email provider/certificate authority will handle CSRF issues. How will they know that a request for key generation is legitimate ? Will my spam folder be filled with certificate generation requests ? Or will key issued only with DKIM email servers ? What if the request was intercepted on its SMTP way to the server, could it be modified ?
6. Privacy
Using a  tag allows browserid.org to break the same origin policy.
And using a script tag to include the browserid.js allows them to bypass the same origin policy. BrowserID.org will (have the power to) know about every logon attempt you make. Or you will have to host the script yourself (assuming it is self contained), and upgrade it if/when security flaws will be identified in it.


What's the risk if I accidently type my password into a username field (Windows logon)? I'm used to logging into my personal Mac which is a password-only field (like waking from sleep mode). Sometimes I have to use a Windows network on which I have an account, but of course I have to type my username first. Still, going right into my password is a natural habit.

In a careless moment recently, I woke a machine on that Windows network and, by habit, typed my password and hit enter. It actually put it into the username field.

I've changed my password since then, but was the old password compromised? How does Windows (7) handle such a login? Does it actually send the username out even though no password was supplied, or even log the event?

If you have access, check the Security Event logs: eventvwr.msc .

Look for failed logon events and you will see your password as an unknown user account if the logging is set up to record those kinds of events.

EDIT

I just tested this on Win7 SP1. It requires that Failure Auditing is enabled. I tried to log in with a bogus username, and this was the result:

Account For Which Logon Failed:
    Security ID:        NULL SID
    Account Name:       **PASSWORD!** [emphasis mine]
    Account Domain:     HOME

So, if failure auditing is in place, then mistyping your password in the username field exposes your password to those who have access to the logs.


How can a website know my private IP address? I recently came across this website called whatsmyrouterip.com. How does this website know both my private and public router IP address?

It looks like it tries to fetch the web page at each of a list of common router local IPs with JavaScript, deciding that it's found it when one responds. It uses jQuery's $.get(), but there are lots of ways to fetch one a web page from within another1. This assumes that the router has a web administration panel on port 80, but they usually do.

The relevant code is on and around line 2495 of the source code for the page (view-source:http://whatsmyrouterip.com/):

2463   var ips = [["10.0.0.10", []], ["10.0.0.100", []], ["10.0.2.1", []], ...

       <snip>

2495   $.get('http://' + currentIp[0], function () {
2496     foundIp();
2497   });

1Well, getting the content may be tricky because of Same-Origin Policy, but a request that fails because of SOP and one that fails because the site doesn't exist look different so you can still tell if there's something there or not.