Should current DNS servers respond to obsolete DNS records? Here is a list of obsolete DNS record types.

Should I restrict my DNS server to not respond to these query types?
Why are current public DNS servers responding to these query types?

Should I restrict my DNS server to not respond to these query types?

So long as you don't have any DNS records of these types in your zones -- which you probably don't -- there's no need to "restrict" anything. If your DNS server is queried for records of these types, it will (correctly) respond that none exist.


How can I see whether the e-mails I exchanged with someone have been encrypted? In my understanding (please correct if applicable),

The e-mails sent through a secure server are encrypted in the route between me as client and the mail server, whether this is a local or remote one.
The server-to-server transit across the web is generally insecure.
At the other end, the recipient' server may again have a secure connection with his/her client.

So there is a potential gap of security in the middle.

Is there a way to ascertain whether an email has sailed the web, server-to-server, securely? This question applies to all parts of a mail (header, content, attachment).

Many (but not all) SMTP server report receiving over encrypted channel in Received: header.
You may use it to check encryption over "the last SMTP hop" if your incoming/MX server reports it.

Sample Received: header with encrypted link indicator:

Received: from mail.mpap.mp.br (HELO webmail.mpap.mp.br) ([186.249.223.20])
          (envelope-sender <x@mpap.mp.br>)
          by mx.example.net with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP
          for <x@example.net>; 30 Sep 2017 07:39:42 +0000


Email hacker, what to do now? Throughout the past 2 years; I have received email messages (about 6 or 7 cumulative) in which I responded to about 3. Which were personalized messages from a series of 3 email addresses. Nothing offensive is written within them; just weird within one or two sentences regarding my business or an off the wall job request. Written in terrible English, 99% sure its a Russian person. (Which is the capital of email hacks I hear)

Anyway I had set my spam filter to trash them immediately; but had responded to about 3 prior; telling the person I am not interested and to stop emailing me. Since I had responded; am I at risk of being hacked here?

From the way they are written; and the fact that it's not stopping - I certainly feel it is a hack attempt. And each message seems like a big attempt at getting me to respond.

Now that my spam filters are in place; just wondering if there is anything else I can / should do.

Cheers!

It's a broad question, and here is a broad explanation. I believe you're at low risk to be hacked, assuming you follow good computing habits, and don't have any other risk factors you haven't told us about.

An email itself is just text. Assuming you haven't given away any personal or technical information when you replied, the recipient only knows that:

the email account is active
your email provider, and their mail server details
your ISP (maybe, if you are using an email account they provided)

This isn't enough information to effect a reliable attack on your computer. They would need additional details like:

your OS, browser, and browser plugin versions and patch levels (to use unpatched exploits)
your firewall settings (to attempt brute force attacks against SSH or RDP or similar)

Alternatively, they would need you to run malware on your computer (usually emailed to you disguised as something else. e.g. anna-kournikova-naked.jpg.exe)

Furthermore, we assume you have no traits that would interest an attacker, hence no motive for a targeted attack.

So keep your OS and software up to date, don't run malware (accidentally or on purpose), and it should be fine. It's unlikely that the person you replied to has enough information to target you specifically.


PKI integration in MAC OS I have setup an ejbca pki and integrated certificates in MAC OS for S/MIME signing and encrypting. I have also set up a CRL distribution point and put the CRL online available on an HTTP server.
Unfortunately, it appears that when I revoke a certificate and update the CRL, neither outlook or Mail clients seem to detect that the certificate is actually revoked.
Does anyone has tips or advice that I could use to debug this?

the only option I found in MAC OS to check for CRL is in keychain options:
preferences -> certificates :
OCSP: check if certificates needs it
CRL: check if certificate needs it
priority: OCSP

what else should I check?

it worked after clearing the MAC OS CRL/OCSP cache which is located in
/private/var/db/crls/.


Verify that data submitted by user was produced by my app I'm designing an app (for PC), that is intended to run on users' machines and generate a file with some data. The user will then upload the file to the server, and I want to verify that this file has been produced by my app and hasn't been modified. Can it be done reliably at all?
Things that I have considered:

generating a public key on server and sending it to the app (key can be sniffed and used to sign arbitrary data)
stream data from the app as it is generated (but still, arbitrary data can be sent)
store secret key inside the app and use it to generate unique token (app can be decompiled and key retrieved)

App sources are planned to be open for the user, but in case there is a solution that relies on user not knowing the sources, they can be closed. There is, of course, an option to run everything completely server-side, but we are considering user-side now too.

You will need to run it entirely server-side. Client-side security is not a viable option.
There's no way (easy way nor hard way) to control software running on client's side. Storing keys on the client, no matter how protected, is useless against a dedicated attacker.
Having the user get into an online application hosted on your server is the easiest way: you control the server, you control everything the user can access, and you can verify the data on the server before signing.


How MiTM attack got performed on self-signed certificate while private keys is generated by ourselves? On MongoDB I have enabled SSL/TLS feature to encrypt data transmission between client and server. But what I have done is to generate a self-signed certificate using openssl in linux.

The question is how someone can perform man in the middle attack while I own the private key and no one else has it? Why MiTM cannot be performed when it is purchased from a CA?

My MongoDB connection implementation is easy as below:

pymongo.MongoClient('172.15.141.190:27017', ssl=True, ssl_crlfile='ANY_KEY.pem')

And mongoDB config is:

net:
    port: 27017
    bindIp: 0.0.0.0
    ssl:
        mode: preferSSL
        PEMKeyFile: /etc/ssl/mongodb.pem

TL;DR: Using self-signed certificates does not mean MITM is possible and using a certificate issued by a public CA does not mean MITM is impossible. But, it is more likely that MITM is possible if self-signed certificates are used because the clients dealing with self-signed certificates often deal with these in the wrong way.

Using a self-signed certificate does not allow MITM in general and using a certificate issued by a public CA does not protect against MITM in general. Apart from keeping the private key private the important protection against MITM attacks is not what kind of certificate is used on the server but how this certificate is checked on the client, i.e. if the server gets properly authenticated using a certificate or not.

The established way to authenticate a server using a certificate signed by a public CA is to check the subject of the certificate, trust chain, expiration etc - see SSL Certificate framework 101: How does the browser actually verify the validity of a given server certificate? for details. But if a client is not doing this checks or not doing these checks properly an attacker in the path might instead provide its own certificate and the client will not notice. In the past such kind of errors happened due to ignorance or due to bugs, for example not checking certificates at all, not validating the subject, not checking basic constraints etc.

With self-signed certificates proper authentication of the server is doable too: if the client knows the certificate to expect (or its public key, or a hash of it...) up front the client can check that the delivered certificate matches the expected one. This kind of verification is actually properly done in many use cases. But in many other cases it is done wrong: it is not uncommon that clients simply have all certificate checks disabled completely if they expect a self-signed certificate instead of expecting a specific self-signed certificate. With such broken clients MITM is easy since the attacker could just use an arbitrary certificate and the client will accept it.


Is it dangerous to serve unescaped user input as HTML response to the same user? I understand why allowing arbitrary JS code enter persistent storage (e.g., in a database table that contains user comments) is a huge vulnerability since it may end up being served to other users.

But let's say the unescaped user input is never used or stored anywhere apart from being substituted into the HTML response immediately sent back to the same user? Does this open any vulnerability?

In other words, is there any harm in sending back to the user the HTML response that contains (in the worst case) arbitrary JS code created by the same user?

You definitely shouldn't do it. Why do it wrong if it is so easy to do right? You should have mechanisms in place that automatically HTML encode all output variables (which will catch most but not all XSS issues); If you have to consider the dangers for each and every output, you will make a mistake at some point.

XSS in a user area can still be exploited if other vulnerabilities exist as well, either by using CSRF or by placing the XSS payload into an account the attacker controls and then forcefully logging the victim into that account (via Login CSRF, Session Fixation, or various other vulnerabilities).

Reflected XSS in a user area may also still be exploited via CSRF, or possibly via ClickJacking, if the browser allows drag/drop into a frame. Depending on the application, there may also be further corner-cases which allow an exploitation of this issue.


Should one use separate SSL certificates for front-end and back-end? I have a website hosted by Apache on a Linux server. I also have a Node.js back-end/API that is hosted on the same server, which serves all the front-end's requests. Today I set up SSL for the front-end and got an error that a request to the back end was not over SSL and thus blocked.

Now I'm in the process of setting up SSL for my back-end, but I'm wondering something: Do I need a separate certificate for my back-end or is it okay to share it between the two applications?

Thinking about this raised another question: An SSL certificate is issued for a domain name. My back-end is not hosted on any domain, just on my server. Do I need to register it to a sub domain to be able to implement SSL for it?

As for the question "Should one use separate SSL certificates for front-end and back-end?", the answer is NO

  Secure Sockets Layer (SSL) certificates, sometimes called digital
  certificates, are used to establish an encrypted connection between a
  browser or user's computer and a server or website. The SSL connection
  protects sensitive data, such as credit card information, exchanged
  during each visit, which is called a session, from being intercepted
  from non-authorized parties.

Why? Because as you said, both are running on the same server.
Although You can use multiple SSL certs on different sub-domains but its usually the BEST to stick to one SSL Certificate per domain.


Is Qubes OS more secure than running a set of activity related VMs? I'd like to skip the argument about Linux being more secure than Windows, and purely focus on the security boundaries between Host OS and VMs.

Is Qubes OS theoretically more secure than say - Windows 10 running a few isolated activity related VMs (Banking, Work, Home use etc.)?

And if you think it is, why is that? I realize things like clipboard redirection aren't possible and prompting to copy files is a nice feature in Qubes. But that could also be turned off in Windows.

Joanna Rutkowska, leader of the Qubes project, does a great job into documenting the concepts on which Qubes is relying. I therefore strongly suggest you to get the information at the source, and in particular to read the two following documents:

Software compartmentalization vs. physical separation (Or why Qubes OS is more than just a random collection of VMs)
How is Qubes OS different from...

Qubes not only brings user experience improvement compared to running several VMWare instance, but it also brings a more fine-grained isolation.
To explain it roughly, the model you describe is like putting a set of smaller boxes (the VMs) inside a single big box (the host system). All VMs will go through the host system to access any device (network, USB, DVDs reader, etc.), and the host system both controls the VMs, the devices, user's interface and is directly facing Internet.
The idea behind Qubes is not to store the small boxes into an overpotent big box, but instead configure the small boxes in a kind of virtual local network so that, together, they look like a big box without being one and without using one.
The need to look like something users already know is important for user's adoption. But behind the scene all parts of the system is meant isolated from each other. Among the main differences are the fact that the user interface is not facing the network and has no Internet connection. The VM dedicated to facing the network is isolated from the rest of the VMs by another VM dedicated to firewalling. Qubes 3.0 brought a long awaited feature allowing to have a VM dedicated to USB devices.
To see this from and attacker point view:

If I want to hack your Windows based solution, all I have to do is to manage to exploit your Windows host (single point of failure). Once I get it, I get power on everything and this should be relatively easy since it is facing the network, allowing a wide range of possibilities from remote exploits to reverse shell trojans.

If I want to hack Qubes, I will have no choice but starting at a guest position since neither Xen nor the main Dom0 domain has any direct link with the outside world, and from there find a way to migrate from guest to guest or manage to exploit Xen core or reach the user's interface running in Dom0 (knowing that the guests have their X server replaced by a specially designed hardened display server to precisely avoid such possibility. All inter-VM communication in general has been carefully designed to reduce any exposure area to the minimum), and build the appropriate tunnels in order to still be able to communicate with your malicious software (going in is not sufficient, you also want data to be able to go out, which is trivial on a network facing system, but much more harder on isolated guest systems).

I just want to add that while Qubes OS is the most well-known and most documented as being, as far as know, the only open-source initiative implementing this concept, the concept itself is not something completely new and revolutionary. Polyxene for instance is a proprietary system taking exactly the same approach in order to secure defense-level desktop systems. I say this just to highlight the fact that discussing such technology goes beyond discussing open-source and proprietary OSs.


Is opening port 3389 on a router and forwarding this to a Windows SBS 2003 server secure? I know of a company who has port 3389 open on their router and forwards this to a Windows SBS 2003 server. The server has the Windows firewall switched on, is patched and has an up to date antivirus program, the router is a Draytek 2820.

Is this a secure combination?

Thanks

By "open on their router" I assume you mean open to the Internet. I'd advise against this. Remote Desktop Protocol is susceptible to known attacks. Also you say "patched", but even as recently as last week Microsoft issued a security bulletin against RDP:

  This security update resolves two privately reported vulnerabilities
  in the Remote Desktop Protocol. The more severe of these
  vulnerabilities could allow remote code execution if an attacker sends
  a sequence of specially crafted RDP packets to an affected system.

I would strongly recommend putting some kind of security gateway (e.g. authenticated firewall, VPN...) in between users and the RDP service.


How can we get the second id for sqlmap I'm trying to find some vulnerable points in my website. My website like, www.example.com/index.php?menu_id=1002&news_id=5. When i trying to find these points with sql map, it tries for menu id. But i want to check the news id. Is that possible?

By default, sqlmap tries all possible parameters, hence it should include both menu_id and news_id in its execution sequentially.

If, on the other hand, you'd like to skip menu_id and go straight for the second parameter, you could run it as follows:

./sqlmap.py -u "http://www.example.com/index.php?menu_id=1002&news_id=5" -p news_id


OAuth Authorization Flow without external user agent for iOS application We are developing an iOS application and server where a user will be able to store some personal information and top up money.
I have been reading about the OAuth Authorization flow using PKCE and seems to be the right thing to do. Still from the user experience point of view I don't like that the iOS app needs to use an external user agent to get the authorization code.
I would like to receive feedback about concretely two points.
Issue 1 - Avoid using a browser at all.
This seems to be what almost every app out there is doing. Checking Facebook, Instagram, Connect and other applications, I am never redirected to a browser to authenticate myself. What is the deal here?
My idea would be to perform a normal REST GET call and catch the Authorization Code in the HTTP redirect response.
According to:
https://auth0.com/blog/oauth-2-best-practices-for-native-apps/

The user's browser is the recommended external user agent. Embedded user agents must not be used for authorization requests. Authorization servers may detect and block requests from embedded user agents, as they are unsafe for third parties, such as the authorization server itself. The reason for this is because the app can then access not only the OAuth authorization grant, but also the user's full authentication credentials. The app could then potentially record or use this information maliciously. In addition, embedded user agents don't share authentication state with other apps or the browser and therefore disabling single sign-on benefits.

So the bigger security risk seems to be that the app has direct access to the user credentials.
To mitigate this issue with our iOS apps, my idea was to hash it as soon as the user wants to log in, or even when the user types it in a text field. A good answer about this is described at: https://stackoverflow.com/questions/3391242/should-i-hash-the-password-before-sending-it-to-the-server-side
Still an attacker could catch the hashed PIN. In any case:
Which are the real world scenarios where an attacker has access to the mobile device of a victim exactly at the point in time where the user is performing a login?
Issue 2 - Keeping the Access Token safe.
Once an app receives the access and refresh token there is no way to fully protect those tokens from external attackers.
My idea here is to make the BE expose two API scopes:

API Scope 1 - Provides READ access to the user's resources only. This API can be accessed using the Access Token. If an attacker manages to get the access token there is no "WRITE" damage they can do to the user's resources.
API Scope 2 - Provides WRITE access to the user's resources, for
example top up money. For this use case the Access Token is also
needed, but the POST request will be signed using Asymmetric PKI. The
public key would be sent to the BE during user's registration. Since
the signing operations would happen in the device's Secure Enclave (2FA), it
would be very hard for an attacker to make the user top up money or
any other "WRITE" request.

How does this structure looks like? Thank you.

Issue 1 - Avoid using a browser at all.

First important thing to understand is that originally, OAuth2 was designed for 3rd-party API access, which is why flows and security models are designed for use by a third party.

However, in your case, it seems that the OAuth2 tokens will be used only by your application.

The Authorization Code flow is indeed the recommended flow for native mobile applications by the RFCs. The main security mechanisms in place are:

Use of a redirect URI, to make sure that only the intended application will receive the tokens
Use of an authorization token, to mitigate risks of interception of tokens between the browser and the native application (in opposition to the implicit flow, in which it is sent direct in the URI's fragment)
Use of PKCE, for the same reasons

However, regarding the first point:
 - Custom URL scheme: you cannot guarantee that another app on the device will claim the Custom URI scheme
 - Universal URI: it involves bad UI and additional complexity

Using the Authorization Code flow has 3 benefits:
 - Single Sign-On (SSO) with other native or web apps using the same authentication service
 - Allow third-party apps using your authentication service (the OAuth2 way) without leaking user credentials (such as password) to the third-party app
 - Some authentication schemes are available only in the browser, such as WebAuthn

However, if it's tour own app, and you don't need SSO, and you think native UI is better, then my opinion is that it is acceptable from a security perspective. You can use the OAuth2 Resource Owner Password credentials if you just need login/password authentication, otherwise you'll have either to extend this OAuth2 flow or to implement it on your own.

Note that since you don't use redirect URIs at all and a mobile app is not capable of keeping a secret, well, secret (called public client in OAuth2 terminology), you basically can't guarantee that it's really your native app that is calling your authentication endpoint.

Therefore, you have 2 solutions:
- enroll your application with a secret. For instance, it could be a secret that is embedded in a QR-code that is sent by letter to your client
- protect your authentication API against brute-force attacks, and apply strict throttle limits. In addition, do not allow weak passwords, and / or ask for a second factor for more sensitive data

But since it's your app, and it's unlikely you'll install a keylogger on your own app (!), I see no point hashing the PIN (weak password with low entropy by the way). If your mobile OS is hacked and the "virus" has access to your application memory and code, there's nothing you can do anyway.

Issue 2 - Keeping the Access Token safe.

The best practice is to keep the refresh token in the KeyChain, and the access token in memory. When the access token is lost or expired, just request a new one using the access token.

To mitigate risks of stolen tokens for sensitive data, you can:
* limit the lifetime of such tokens
* ask for a second factor for such tokens
* binding them cryptographically to the calling application. This mechanism is called Proof-of-Possession (PoP) and is surprisingly still experimental. You can find more information at: enter link description here and enter link description here


Generating salt for hash that occurs on server and client Let's say I have an API call which is supposed to check if email address exists in the DB, without transmitting the actual email address.
For that purpose, I've decided to store SHA256 hash of the email address in the DB, and updated client to send SHA256 hash of the email in the API call (instead of plaintext email address).

How can I make this more secure using salt when calculating the hash?

As per my understanding, having a fixed salt is pretty much the same as not having salt at all. Is there any way I can have unique salt per email address, but in such a way that both server and client can calculate them?

Would something like this make sense? If not, can you please explain why?

salt = sha256(email)
email_hash = salt + "|" + sha256(email + salt)

Consider the following quote:

  The salt value is not secret and may be generated at random and stored
  with the password hash. A large salt value prevents precomputation
  attacks, including rainbow tables, by ensuring that each user's
  password is hashed uniquely. This means that two users with the same
  password will have different password hashes (assuming different salts
  are used). In order to succeed, an attacker needs to precompute tables
  for each possible salt value. The salt must be large enough, otherwise
  an attacker can make a table for each salt value.

I'm not sure if I'm missing anything or not, but does this mean that even if salt isn't a secret nor random, and everyone knows how to calculate salt for an email address, it would still prevent the attacker from recovering email addresses from hashes using rainbow tables. Because each email would be hashed uniquely. Is that correct?

Would something like this make sense? If not, can you please explain why?

The process would probably require a hashmac instead of plain sha256. Plus, I would head up to crypto-hashing functions of your language instead of simple hashing functions (ie: password_hash in PHP instead of md5).

Last, you didn't salt your hash in your example: your salt = sha256(email) is the unsalt hash that attacker would like to know.

  Does this mean that even if salt isn't a secret nor random

By definition, salt is random, so question is contradictory

  it would still prevent the attacker from recovering email addresses from hashes using rainbow tables

No, because the salt must be random (and unique for each field).
If salt is not random and predictable from your original data, or if the salt is not unique, then rainbow table can be used (maybe attacker will need to forge that table first, so that's harder than no salt, but that's still doable).

  Because each email would be hashed uniquely.

But two calls of the hashing method with same data yields the same result, and therefore is a threat. If your "salt" is not random, you'll still have unique hashes (otherwise, write down your email because you've found a collision)but a rainbow table is meant to match one hash to one corresponding plain raw value, so you'll still be vulnerable (even if attacker will probably have to forge that rainbow table first instead of reusing one from the web).

So to fall back on your case, what you want is:

  An API that can tell if an email "exists" (is on a server's whitelist) without sending the email itself

If the servers knows the plain email, then you can let client generate a random salt, do a password_hash of that email+salt, and send this hash and the salt to the server. Server will then take each email it has, do the hash process, and if a match is found, then server returns "email exists" to the client.

If the server does not know the plain email, but only a salted hashed version of it, then you can treat this email like a password, which is sent in clear over secures connection.

If you still don't want to send the email in clear over secured transport, then you cannot send a random salted hashed value (it's the goal of random salted hashed values: have a unique result for each call, and not being able to get any information from that value, so server won't be able to get the information "this email is on whitelist"). Then, you will need an id for every hash, that will act as a unique public identifier of that hash (the same way login is a public identifier of server's hashed password). Server would then return the hash for this id and client will be able to password_verify it using the email it knows (so email is not transferred, but the hash is).


Can an OpenPGP master key decrypt something encrypted for a subkey? When creating OpenPGP subkeys, the master key signs and certifies that a subkey belongs to that master key. Can be used master key to decrypt something encrypted using an encryption subkey? I guess not, but I want to be completely sure. Am I right or I missunderstood?

The OpenPGP primary key and subkeys are cryptographically different keys and simply bound to each other by special signatures defined by the OpenPGP protocol. They cannot be used to decrypt information encrypted for the other one.

This also implies you should never completely delete your old (encryption) subkeys but simply revoke them; otherwise you'll lose access to your old encrypted documents and messages.


Is Telegram E2E Still Insecure? This was already asked here, but I have questions about the answer.
https://security.stackexchange.com/a/49802/118071

I'm not sure if that answer applies to the full E2E mode. Another answer states:

  Diffie-Hellman End-to-end encryption is known to be practically
  unbreakable when used properly even if one does not trust the server
  passing on the messages.

  Therefore, Telegram's secret chats are unbreakable assuming they were
  used properly and assuming there isn't a serious flaw with the
  Telegram client software or the crypto. However, as stated earlier,
  the crypto needs more peer review.

So which is it? Does Telegram use homebrew encryption for everything or does the E2E "Secret Chat" make use of D-H (for the key exchange at least). Does anyone know if the app been updated to use name brand encryption or if it's in the works?

2017-11-01 update: MIT Security analysis of Telegram finds it to be insecure.

Quote from the following paper ...”our survey shows that Telegram has had serious and simple issues in the protocol (e.g. modified buggy Diffie-Hellman key exchange) that any knowledgeable security expert could penetrate.”

https://courses.csail.mit.edu/6.857/2017/project/19.pdf

They also end their paper with a well-worded statement about the Telegram:

“Finally, our conclusion is that Telegram, just like any other application has vulnerabilities. Users have to be aware of this fact, but unfortunately the claims by companies make non-tech-savvy users to believe that their messages are unreadable by third parties.”

Previous update with interesting input: Snowden doubts security of Telegram
https://www.rt.com/news/326565-snowden-durov-security-telegram/
Snowden has a great point here. Why should the server ever have access to the message in cleartext stored or not.

Lots of questions here:

Secure in transit ?  Nothing is perfect but the use of a non-standard implementation increases the risk for human errors and probably increases the attack surface. Note: The use of Diffie-Hellman protocol does not mean the implementation of data in transit is secure at all. I could use DH for supposed key generation then promptly ignore the results and use Rot-13 or some other broken encryption scheme for data in transit.

You need to evaluate the system as a whole to determine the strength of the combined controls.  Just looking at one part and saying since that's secure the whole thing is secure is a flawed statement at best.

Secure from anyone who has access to the phone or mobile devices operating system ? No, the types of security controls needed are not present on modern mobile operating systems.

Does Telegram use DH or homebrew ? It's not either/or the answer is both.

It appears they are still using, and defending, their home grown implementation. Note: I'm not saying this is a bad thing, progress is made by change, but it's notable that there is no third-party validation of their process on their website. To me this is a ripe situation for the statements on a website to be "technically true" but not painting the whole picture. They claim that messages are safe from "hacker attacks" and in one sense that may be true but is that the only scenario you are concerned about ? Do they answer the question related to the threats you are concerned about ? If not, why not ? Is this safe for people living in countries with repressive governments that do heavy monitoring of communications ? That's a different question entirely and one which they don't address.

https://core.telegram.org/techfaq

Personally I'd be curious about their key handling and it's implementation more than anything. Other questions I'd investigate are :
Could they share keys with service providers and governments without the end users knowledge ? (I know they say they don't but could they ?) How do they comply with warrants ? Have they ever publicly complied with a warrant for such information ? Do employee monitoring systems offer support to decrypt Telegram communications yet ?

Ultimately security is somewhat relative and I think for most people their solution probably works well.


Secure USB (unique identifier) There is a requirement for an unattended, publicly-accessible machine that I have to only allow company-approved USB devices (e.g., USB mass storage, keyboard, mouse, Bluetooth, etc.,) and block all the rest (non-approved).

Even though PID, VID, serial number are unique identifiers to USB devices, but, if somebody knows those information he/she can easily create a USB with the identifiers mentioned above and produce an approved USB.

Is there any way that I can add unique and secure identifiers to USBs (except VID, PID, S/N) and set up a mechanism to differentiate between company approved USBs and non-approved ones and allow only the approved ones?

Expected result: Secure USB for devices that are left unattended (e.g., kiosk) in public places.

You probably need to block things that might be harmful while still allowing people to get their jobs done.

Instead of trying to call out specific devices, consider blocking or approving USB devices by class types.  For example, you might approve all HID devices (class 03) and Audio (class 01), which might be required by people with special needs (custom mouse pointing hardware, keyboards, hearing aids, etc.)  Similarly you might block all Mass Storage (class 08) and Networking (class 02) devices so that hackers can't perform malicious acts.


Linux security modules (LSM) and reference monitor implementation as far as my understanding goes, an OS needs to implement some sort of reference monitor, as the entity which grants or denies permissions as an access control decision.
Furthermore, I think the Linux kernel does this by providing Linux Security Modules (LSM) or more precisely "hooks", which enable arbitrary "reference monitor concept implementations" to decide on access control decisions.
Among others, SELinux and AppArmor are officially included in the Linux code base. SELinux for instance is pre-compiled and shipped with Debian. However, as stated in the official Debian documentation it is not enabled by default. AppArmor is not even pre-compiled and shipped.
Hence, the following questions results: If neither SELinux nor AppArmor (and not the other less widley adopted LSMs) are enabled by default, is there even a LSM enabled by default? If not, what happens to the hooking-interface and how are access decisions made then? Which access control mechanism (DAC, MAC; RBAX, ABAC etc.) is used by default (assuming Debian)?

I've found out by myself.
By default, so without an activated LSM, Linux uses a discretionary access control (DAC) model, as the user (e.g. john or even root) decide by his own whom access is granted.
On the other side, those LSMs (like SELinux or AppArmor) can be activated and configured.
They are managed by an "outside" party, like an organizational administrator, which is not part of the OS users.
This administrative entity specifies access policies, which overpower the DAC ones. This is implemented by the Linux kernel hooks, which are triggered for certain events like file open or write and are then evaluated.
The resulting access control mechanism is dependent on the the particular LSM implementation. So in case of SELinux it is MAC (as an administrative entity specifies mandatory policies).


Can an attacker modify data so that the hashing technique cannot detect the change? I'm just curious as to if this is possible or not?

Not for any well-known hashes, not even the extremely broken MD5. You're describing a second preimage attack, but virtually every hash known to be "broken" is only vulnerable to collision attacks.

Caveat: if the attacker had any control over the "good" data, then they could use a collision attack to accomplish this.


What kind of attack? I was able to find the Teardrop Attack.
However, there is another one but I couldn't explain it. It keeps getting the warning: Source MAC must not be a group address. Is this some sort of ARP spoofing to steal data?

Edit 1: Could there be a chance that a botnet auto-generate MAC address for packets but didn't work as expected?

capture file

Bit 0 of the first octet, 0D in this case, indicates single device or group. It's analagous to multicast at the IP level. If the first octet is odd, as in 0D, it indicates group.

If your application needs to send to multiple devices, it sends to a goup address.

It does not make any sense to originate from a group address.

This would be a poorly configured packet generator on your local network.

As to what it's trying to accomplish, I'm not sure. From the IP addresses, I'm guessing this is probably a VM based lab you're using.


Possible to bypass this regex for XSS? When testing for XSS, is it at all possible to bypass the below regex? I doubt it because it only accepts uppercase and lowercase letters, but maybe?

/^[A-Za-z]+$/

Well, this regex is simple enough to be sure that you won't be able to inject any special character in your input. You won't be able to perform any XSS, unless there is another vulnerability elsewhere.


What's malicious about file links? Why did Chrome and Firefox disallow file:/// links? I can imagine an iframe opening a local resource, but which resource is the scary one? They could have just disabled iframes to file:///? Ajax requests don't work because of the origin issue, which makes sense. Local links used to be a very useful tool for intranets with shared drive mappings.

Was there a known exploit or is this just a protective measure from a theoretical, not yet existent threat?

Remote and local file access don't mix. Remote sites should know absolutely nothing of what's on your hard drive, except what's carefully exposed in controlled ways, such as HTML5 local storage and cookies.

Anything that gets loaded into the DOM can be examined by scripting, which means that allowing file:/// inclusion would effectively give any remote site read access to all the files on your computer. Malicious sites could then levarage this hole to covertly steal secrets from you, which could then possibly lead to further exploitation.


SSL encryption process and its security I know the basics of SSL encryption and how certificates work, but there are some points that are not clear to me regarding the SSL security:

If there is a intercepting proxy between the web server and the client, mostly the proxy uses its own signed certificates which the client may or may not trust. Then why don't proxy just take the certificate from server and forward it to client so the client will trust it. Also if the private key is only held by the server, then how come an intermediary give its own certificate and decrypt the message?
The signature hash generated by the private key can be decrypted with a public key. Can't someone decrypt that other then the client and can see the signature?
Does the client already has the public key with which it starts the encrypted message or do it first ask the server?

If there is a intercepting proxy between the web server and the client, mostly the proxy uses its own signed certificates which the client may or may not trust. Then why don't proxy just take the certificate from server and forward it to client so the client will trust it. Also if the private key is only held by the server, then how come an intermediary give its own certificate and decrypt the message?

If the intercepting proxy uses self-signed (or signed by it's own CA) certificates generated on the fly, the certificate passed to the client won't be trusted, as it has no valid certificate chain. If the certificates or the used CA is trusted by the client (which is often the case in internal networks), all traffic can be sniffed without suspicion by the gullible user. However, you can detect the interception by looking at the certificate (chain) in your software.

If the proxy does not use its own certificate but the certificate of the server, it can't decrypt the traffic. The public key in the certificate always corresponds to one specific private key, which is not known for others.

The server certificate contains a digital signature of the CA (mostly an intermediate certificate), which is a signed hash value. The signature is generate with their private key and can be verified with the public key using the next certificate in the key chain. This can be repeated several time, until a certificate is given, which has no parent and is trusted by the client (Root-certificate)

  The signature hash generated by the private key can be decrypted with a public key. Can't someone decrypt that other then the client and can see the signature?

The signature does not contain any confidential information. Usually the signature is based on a hash value of a file, message or (parts of) a certificate. Everyone with the public key can verify the signature and compare the hash values. If they do match, the signature is valid, otherwise not.

See also What is the actual value of a certificate fingerprint?

  Does the client already has the public key with which it starts the encrypted message or do it first ask the server?

Unless the client uses certificate pinning, it does not have informations about the servers certificate and public key. The server sends the certificate at the beginning of a TLS session.


Utilman.exe command prompt hack prevention? This trick to hack windows and reset passwords(or create new logins)has been around for ages and still works on windows 7 and windows 8. Is there any way to disable the key combination that brings up the 'Ease of access' dialogue box WindowsKey+U?

I've got other safeguards in place like full disk encryption and a locked down BIOS so people can't boot CD so easily, but those are possible to circumvent with relative ease, especially if I leave my computer turned on and running unattended for long periods of time.

You're very wrong in your last assumption; full disk encryption is not "possible to circumvent with relative ease". It is especially not "possible to circumvent with relative ease" to reach the goal of this workaround IF you're behaving securely.

As you've probably figured out by now, this is a physical-access problem. If somebody has physical access to your machine, they don't really need the utilman.exe trick. They can simply modify your SAM file. In this case, they went with a less technical method. Nevertheless, they're both possible through the same vulnerability - unauthorized physical access.

Assuming you're using full-disk encryption solutions like TrueCrypt, let's examine the two possible scenarios:

You left your computer turned off and unattended for ages: The attacker won't be able to do anything to modify the structure of your files (copy cmd.exe as utilman.exe) or modify your SAM file.
You left your computer locked: A determined adversary can eventually (although not easily) recover your encryption keys and access/modify your system, including but not limited to the trick you mentioned and modifying the SAM file.

As you can see, any unauthorized full access will lead to the, expected, compromise of your system. The utilman.exe is not your problem.  You're looking into the wrong corner.


Is there a difference between a rainbow table and a dictionary attack? I'm trying to learn a bit more about the different types of attacks but as far as I understand it, a rainbow table is a large collection of prehashed data which is then compared to hashed data gathered from a target. A dictionary seems very similar but I'm struggling to find anything that can specify the differences between the two, if there are any.

In a rainbow table attack, the tables contain already pre-computed hashes of commonly used passwords. You compare the hash directly to the hash in rainbow table so it's faster than using a dictionary where you compute a hash of the word and then compare it to the password hash. If a salt is used in the hash, a dictionary attack would be better than computing a rainbow table before cracking.

I must add that what I wrote is for Hash tables and Rainbow tables are more complex than Hash tables, but the general idea is the same.


What are the benefits of logging the username of a failed authentication attempt? From time to time, some users can accidently type their password in the username field, either because they missed the tab key or because they thought their account was simply locked, not logged out (on Windows for example).

According to some questions on this site, if passwords of failed authentication attempts should not be logged, usernames often are.
That question even states that:

  It seems reasonable that someone (even a security-conscious admin) would consider logging attempted usernames both useful and safe.

How is it useful or safe?
Are their other benefits to logging the username of a failed authentication attempt?

Clarification: I'm mostly interested in the logging of unknown usernames, but answers to the more general question are welcome.

The reason you log failed login attempts to accounts is to determine if they are under brute force attack. If the account is sensitive enough, you might then consider putting in additional protections for that account.

Note that brute force attacks do not have to happen all at once and then stop. The clever attacker will try 4 attempts, then wait 15 minutes, then try again.

If you do not log the account name, then you would not know this was happening.


Do serial numbers for X.509 certs need to be strictly sequential or can they be timestamps? Serial numbers need to be unique for X.509 certs. But do they need to be strictly sequential or is making them equal to the time that the cert was generated sufficient?

They do not have to be sequential. Furthermore, there are some issues with using predictable serial numbers, as described in this post:

https://crypto.stackexchange.com/questions/257/unpredictability-of-x-509-serial-numbers


Display all packets but not these TCP packets? I'm trying to filter packets with wireshark, I would like to display all packets but terminal service communications, but if I do:

tcp.dstport != 3389 && tcp.srcport != 3389

It would implicate TCP packets only, what should the syntax be like?

The Whole != thing doesn't work very well. If you notice your expression filter text area is yellow when you do that.

Try this instead.

!(tcp.dstport == 3389) && !(tcp.srcport == 3389)

I recommend reading the wireshark user guide. Section 6.4.4 specifically references the problem you had.

User Guide -- Filter Section


How does Windows Hello recognize me with a mask on? The first time I forgot to take my mask off before using the facial recognition login to my Windows 10 computer, it wouldn't work (which I expected). After a couple times, though, it started logging me in before I had a chance to take my mask off. Is it a security issue that the facial recognition can recognize me with a mask? If, say, one of my brothers who look very similar to me (not that I have issues with them accessing my computer, but someone else might look sufficiently alike) were to put on a mask and wear my glasses, would the facial recognition know the difference?
I'd be interested to hear what exactly Windows Hello takes into account when scanning your face, that might help me know whether whatever is hidden by the mask is important to its algorithms. All that I can think of that's out of my mask are my eyes... Can it recognize me only from that? How accurately?

Any kind of biometrics (actually any measurement), including facial recognition, is subject to False Positives and False Negatives . In practice the algorithms are tweaked to favor one over the other as a function of context.
A super secure Alien Autopsy Lab at area 51 would favor False Negatives as the preference is to block even a few people who are authorized rather than take the chance of admitting uncleared people.
A general purpose user access system like Windows Hello favors False Positives because with a huge number of users (many millions), blocking out a significant percentage of valid users would be a firestorm of complaints.
I'm not sure of exactly what criteria Windows Hello uses, but it's almost assuredly very weak criteria.
As for IR, that's near infrared in the 1 micron region, i.e. barely redder than red. It's not capable of peering through a mask.
-- addendum --
Microsoft has some very specific statistics on these rates, but they are too specific to be reliable. Actual testing of facial recogniton systems vary widely, specifically they vary with Race and Gender so a single statistic is questionable.


What are the security risks of using add-ons in Google Docs / Spreadsheets? I am looking into using some add-on that automated a mail merge from Google Spreadsheet data, via Google Doc templates, to PDFs that get emailed out.

Several add-ons that I looked into (such as autocrat) require, when attempting to install them, extensive permissions including full access to all of my Drive files and the ability to send email as me.

What kind of risks are there in installing such an add-on? Can it e.g. email back to its developers sensitive files from my Drive? And how can I mitigate some/all of these risks? (E.g. is it possible to extract the add-on source, verify it doesn't contain any funny stuff, and then install my own version of it?)

I had the same question. Here are some thoughts I found. https://spinbackup.com/blog/security-risks-google-add-ons/

The gist is these are not made by Google and therefore there is always some risk. In fact it sounds a bit like apps on a phone, except seemingly without any Google recommendations.


SSL Cert Types and Key Usage I want to use OpenSSL to create a CSR and submit it to my CA (which uses Microsoft PKI) and receive certificates that can be used for both Server Auth and Client Auth.  I'm not clear on a couple of things, which may simply be a a link between keyUsage and nsCertType.

Is it enough for me to include in the CSR
keyUsage=digitalSignature,keyEncipherment and
extendedKeyUsage=serverAuth,clientAuth ?
Can the signing CA choose to ignore these requested attributes and
    grant me only Server Auth usage?
Is nsCertType used for requests (eg, CSRs) or only when OpenSSL is
    used to sign certs?

Regards,
Mike

nsCertType is an old Netscape-specific extension, which was used by the Netscape browser at a time when that browser was still alive. You can forget it nowadays.

The signing CA, by principle, acts in any way as it sees fit. It can put whatever it wishes in your certificate. Your certificate request is just a suggestion. You can more or less count on the CA to take the public key from your request and use that public key in the certificate; for everything less (including name, key usages and other extensions) this is completely up to the CA to decide. Microsoft's Certificate Services uses "certificate templates" for its configuration, and the templates decide what goes in the certificates. According to my own tests, the key usage and extended key usages which you put in the certificate will be completely ignored.

What extensions are needed for client authentication, and/or for server authentication, depends on the involved software. You will find some information in my past prose, e.g. this, this and that.


Any real world examples of GPS location data being used with authentication? Are there any examples of how GPS coordinate (or any location data really) can be used to detect suspicious locations or validate well known locations?

Specifically

Highlighting new or unusual locations
Simultaneous / concurrent usage (a session in the US and also in China may be indicative of an attack)
Reduced PW challenges for "known" locations

I'm interested in using Browser Location data, source IP, GPS (on phone devices) or any other metatata that can be used to identify and separate "good "authentication sessions from "bad" sessions.

By the way: Confused deputy attacks are out of scope for this, since that attack will likely have valid location data.  I'm mainly focused on validating good sessions, or challenging risky sessions instead of or in combination with a permanent cookie

What I hope to learn is how the implementer has addressed roaming users, VPNs and other data validation techniques.  I'd also be interested in seeing the "user story" on what process flow would look like.

I attended a workshop for Splunk a few months ago. Splunk, if you are unfamiliar with it, is a type log viewer. You can find more out about them at their website: http://www.splunk.com. Essentially, you dump all of your log data into one place, and then analyze it, correlate, report on it, etc.

One of the use cases for Splunk was to correlate VPN logs with Physical Badge access logs. An alert was drafted so that if a user was signed into the VPN and used their access badge in the building, it would flag it and notify on that event. You could use really any sort of logs, I could see an example case where a user signs in from an IP address in Kansas and had done so for the last 30 days, now all of sudden they sign in from an IP address in Canada. Splunk could detect that and alert on it.

Splunk is free for up to 2 GB of data per day, so if you have the data, you could begin testing something like this. The trick is getting the log data in a location so that you can dig through it.


Would you typically want to monitor all ports for NIDS monitoring? If so, is span port or network tap the way to go? We're setting up NIDS monitoring and the bosses want to monitor all the ports, but I'm wondering if this actually makes sense.

The switch we're currently using can only mirror 4 source ports to one destination port, so we don't have enough spare ports to monitor all of the currently-used ports.

Would a typical NIDS setup involve monitoring only important ports (VMs, internet port), or is it common to monitor all ports?

If monitoring all ports is standard, what is the best way to do this? Are there 24-port network taps that could connect to all of the switch ports? Are there better switches that will monitor all ports on a single span port?

Thoughts?

Port mirroring, while possible even on cheap switches such as the Unmanaged Plus NETGEAR ProSAFE GS105Ev2 or the even better Easy Smart TP-LINK TL-SG108E, is a gamble due to timing and loss. It is very possible to configure a scenario where a long-term-running port mirror can continue to copy frames for months at a time without losing frames. You probably want to use an undersubscribed network with high-end Juniper Networks or Cisco gear, though, with good clocks and/or NTP configuration.

For taps, you can avoid oversubscription and switch max-CPU problems. If the switched network becomes problematic such as a spanning-tree event, you can still capture all of the relevant frames. Port mirroring can also cause a lot of packet de-duplication which may raise the CPU of switches to unwanted levels.

There are many tap vendors with a variety of different layouts and configurations. I suggest that you read this article -- http://packetpushers.net/practical-visibility-fabric-part-1/ -- which mentions the four major players in that space as well as gives plenty of background on how to go about building a visibility fabric, i.e., a place where you can configure a set of monitors such as network intrusion detectors.

An additional suggestion is to monitor and test the performance of your capture infrastructure with a tool such as -- https://github.com/adulau/netbeacon


Can NSEC domain enumeration happen for zones with wildcard records? In DNSSEC, NSEC records are used to provide proof of nonexistence. The trouble is that these records provide pointers to existent domain names (the closest known domain in either direction) constructing a chain that can be "walked" to eventually disclose all domain names in a given zone through further failed queries.

The method as I understand it relies on crafting queries for domains that do not have a corresponding record. Are zones with wildcard DNS records still somehow susceptible to this attack?

They should still be vulnerable, since the wildcard record is signed as literally "*". The details of how wildcard results are handled are covered in RFC 2535 (DNSSEC), RFC 3845 (NSEC RDATA format), and RFC 5155 (NSEC3 hashed responses).

This simple description was helpful to me in understanding how a wildcard response can be proven: "The receiving nameserver can derive from this that the record 'www.example.com' was synthesised from '*.example.com', and check the signature accordingly."

It is possible that some tools and scripts designed to conduct NSEC-walking would fail in the case of wildcard responses, but this would not prove that the attack is not still possible.


Certificate Authentication from untrusted IP address When I launch my Windows, certificate revocation checks are performed. These occur once when explorer.exe is launched then periodically, every 40 minutes approximately, to 5 IPs. Most of these target Microsoft, Google or Akamai hosts usually geolocated in the Netherlands and US. Disconcerting however is the call to crl.microsoft.com which resolves at an IP controlled by my ISP. I do not use my ISP's DNS and apply a third party DNS (OpenDNS@208.67.220.220) at the OS level using Windows Internet Options.

According to the DNS reply, the host names resolve as follows:
CNAME crl.microsoft.com -> ms.akadns.net -> a1363.dscg.akamai.net -> Address 62...*** (ASN: 5089).

But this IP address is registered to my ISP, not Akamai or Microsoft. I don't have any reason to believe my ISP is partnered with Akamai or Microsoft.

After, a Certificate Revocation List is obtained from my ISP's "crl.microsoft.com" address.

When doing a domain-name look-up elsewhere ms.akadns.net resolves to other subhost names and addresses, so the problem is occurring at the ms.akadns.net > a1363.dscg.akamai.net translation step.

a1363.dscg.akamai.net fails to resolve to anything when looked up directly.

My system is clean and I don't use any ISP software. My (ISP-locked) modem is the only ISP hardware on my network.

A very similar problem is described here but I'm not in Romania. The novice user "solves" their problem by disabling the "check for certificate revocation" options on their system.

I was wondering whether somebody could explain what I should do next to gauge the extent of the problem. I would like to cross reference the certificates that I'm getting from the untrusted address against what they should be.

Edit:
So other people can find this issue. The outgoing connections are made Svchost.exe using the CryptSvc and DNScache service. Requests to certificating servers are made using the Microsoft-CryptoAPI header.

Obviously Microsoft is using the services of Akamai to direct clients who are asking for crl.microsoft.com somewhere. The whole purpose of the services which Akamai is offering is to load balance traffic on the Internet as intelligently as possible. This is what Akamai's customers (both ISPs as well as content providers) are paying for.

So simply speaking, is works the same way as 8.8.8.8 (Google DNS), which is by no means one single DNS server machine on whole planet earth, but it is a mechanism (IP anycast to be exact) which translates to: Ask the server which is providing Google DNS which is closeby as in the definition of your ISP.

Same thing here for CRL instead of DNS. There is not the Microsoft CRL server, there is for sure one authoritative certificate revovation list maintained by Microsoft, but it will be distributed by replicating over a number of machines throughout the Internet.

You are surprised that the final server you end up connecting to is located in your ISPs ASN; but just that makes a lot of sense for your ISP, Microsoft and Akamai. I have no idea how big or small your ISP is, but by setting it up that way your ISP does not have to load his phyiscal lines to other ASNs with traffic to crl.microsoft.com, but instead they run a mirror on their own network. This is common with a lot of services.

If you are asking if you should trust that mechanism: You are basically trusting your ISP and Akamai here or not. Of course, it would be possible that for whatever reason the CRL mirror at your ISP's network is not updated in time and you will miss a certificate revocation or your ISP might theoretically even manipulate it by purpose.

In case you want to mitigate that risk, find out if you can point your browser to any other CRL service or override crl.microsoft.com in your DNS resolution mechanism (for example through the hosts file; see https://en.wikipedia.org/wiki/Hosts_(file)) not to be a CNAME to ms.akadns.net but to a different service with appears more trustworthy to you.


How to securely store user-specific mail server credentials at the server side of a web application I have an asp.net web app that generates emails when users perfrorm actions...these emails are generally notifications to other users that they should see/do something. The users can be internal to the company, or external (subcontractors).

These emails are stored in the database, and picked up by an email service. The database and email service are often, but not always, on a different server to the web app.

The email service up till now has been sending the emails from a generic account, or setting the sender as the user's email so it looks like it's come directly from them.

The problem I have is that some of our newer customer setup's don't allow emails that are claimed to be sent from somewhere, and actually sent from somewhere else.
The solution I am looking at is to have the user enter their smtp settings and then the service will use these settings to actually send the email from that user.
...however, I need to be able to store the smtp settings securely, including password, so the service can retrieve them.

Can anybody please suggest how I can securely store the settings, or if it's not possible then how else I may tackle this issue?

thanks in advance.

Don’t. Don’t take the risk.

Jira, for example, sets the From: <user name> noreply@jira.com and reply to: user@realaddress.com

Then the user sees the right person’s name in the from, replies to the correct email, and the message comes from your domain (replace Jira with your domain). Then on your domain, ensure you use DKIM, DMARC, and proper SPF (Amazon SES and Sendgrid are great options to outsource properly configured SMTP delivery).

Now the receiving mail server can decide to trust email from your domain because your domain has a good reputation. And the users get email that looks like it comes from their friends.


Is this code vulnerable to DOM based XSS jquery animate? Is this code vulnerable to DOM based XSS?

The application is using jQuery 1.12.4 and i noticed that Data is read from window.location.hash and passed to $() via the following statements:

var target_ = window.location.hash.substr(1);
$('html, body').animate({
    scrollTop: $("." + target_).offset().top - $(".site-header").outerHeight()
}, 1000);

What payload could I use to trigger an alert box or execute any JS code? Is this code vulnerable or 100% safe?

The code snippet you shared above is not vulnerable to DOM-based XSS. jQuery version 1.12.4 is not affected by the selector XSS bug. I highly recommend using http://research.insecurelabs.org/jquery/test/ to determine if a specific version of jQuery is affected by any publicly-disclosed vulnerabilities.


Malicious Links that Respond to Browsers but not curl or wget There are some emails with links to people's cracked websites with a malware download

Like this kind of email:
fake DHL pack station email

... the links often take the form of:

http:// www.mandyhank.com /sbfdiqr.php?get_info=ss00_323
http:// sasfamily.com /fpxlcaj.php?get_info=ss00_323
http:// tfdesignsandpcrepair.com /dinwnle.php?get_info=ss00_323

And, until the site is taken down or fixed, going there with a browser will download a zip file containing an exe trojan.

But trying to wget or curl it gets:

Not Found
The requested URL was not found on this server.

I've tried to use the same user-agent string from my browser in curl. How can I get a copy of the landing page HTML so I can follow it the rest of the way? I doubt it's a JS thing, my browser runs with JS disabled.

The website seem to be be only checking the User-Agent. I tried the following

wget --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" "http://tfdesignsandpcrepair.com/dinwnle.php?get_info=ss00_323" -O file.zip

and it seems to be working

One possibility is that you might have tried so many times without a valid User-Agent that eventually the server blocked your IP and now it's giving you 404 regardless of your request.

Update: Yes, that seems to be the reason. After 3 successful attempts to download the file, the server started throwing me a fake 404. I used a proxy, and I noticed the same behavior; 3 successful downloads and then a response with the length 153 containing:

<title>404 Not Found</title>

Not Found

The requested URL was not found on this server.


Man in the middle using HTTPs downgrade to HTTP In general browsers attempt to establish a HTTPs-Connection if possible. How would you force a browser to fallback to HTTP when somebody enters asdf.xyz in the search bar of his/her browser without specifying a protocol?
Therefore: sslstrip is probably not helpful as there are no links to "fake". Furthermore, it is assumed that the site does not use HSTS.
Assuming one can perform MITM - how would the routing with iptables be performed/which commands would you need to make the browser believe that HTTPs is not available and to fallback to HTTP?

I think you may have a slight misunderstanding in the premise of your question.  If the site does not use HSTS, and the user enters example.com in the address bar of their browser, the browser will default to http://example.com, not https://example.com.
See the following questions on security.stackexchange.com, and elsewhere on stackexchange.com, for more information on this behavior:
Why do browsers default to http: and not https: for typed in URLs?
Why is HTTPS not the default protocol?
https://superuser.com/questions/799464/how-does-a-web-browser-know-if-destination-is-http-or-https
This is precisely why we now have HSTS.  HTTPS Everywhere is another attempt at solving this problem.


Does pppd encrypt traffic? There is pppd program that can be used to create point-to-point conections over various channels (including other network).

It supports authentication and compression. But does it encrypt traffic or encryption is only used at authentication phase? Where can I see the algorithm and key size?

PPP has several extensions for that, e.g. RFC 1968 and Microsoft's MPPE. At least this pppd for Linux knows how to use MPPE, provided that the kernel was configured to support it (the bulk encryption work is done in the kernel). See the man page for how to configure algorithms and key size.

Of course, you will get encryption only if both ends of the link support it.


Are there any statistics about packet filtering to prevent IP spoofing on the internet? DDoS attacks via spoofed DNS(sec) are daily news for the last few years, but packet filtering should prevent IP spoofing on the internet.

I tried (as an exercise) to spoof a packet on my VPS and on my local ISP (With NAT disabled) but both were filtering out these packets (Wireshark did not show the packet on either opposite sides, any other ways to test this? like a online service?).

Anyway, I was wondering if there are any statistics/information about the usage of packet filtering usage? Why are there still so many attacks meanwhile I get the impression that most direct connections to the WWW are filtering out these packets?

The reason that you were not able to spoof your source IP address is probably because your ISP uses uRPF (Unicast Reverse Path Forwarding) or some other type of IP validation filtering before routing your traffic.

uRPF Info: http://www.cisco.com/web/about/security/intelligence/unicast-rpf.html

Quote block from the uRPF page on Cisco: "Network administrators can use Unicast Reverse Path Forwarding (Unicast RPF) to help limit the malicious traffic on an enterprise network. This security feature works by enabling a router to verify the reachability of the source address in packets being forwarded. This capability can limit the appearance of spoofed addresses on a network. If the source IP address is not valid, the packet is discarded."

Since you're not using a sketchy ISP that does not provide these services, you're not able to spoof your IP address successfully. At this time, IP address spoofing can be exploited on around 25% of ISP's worldwide (http://spoofer.caida.org/faq.php.)

The biggest issue is that there is no way for legitimate ISP's to verify that all inbound traffic is legitimate (not spoofed).

You're looking for spoofing stats? Here's the place to look:
http://spoofer.caida.org/summary.php

You're wanting more info about spoofing and why it's an issue? Here's the place to look: http://spoofer.caida.org/faq.php

Also, if you're looking to test to verify that your ISP's DNS servers are not vulnerable to DNS spoofing, check out GRC's DNS Nameserver Spoofability Test: https://www.grc.com/dns/dns.htm


How to secure a ActiveMQ? Does anybody have experience with securing/hardening ActiveMQ?
Check lists or guides would be welcome.

In my option you need to think of atleast two factors when implementing the message services. These are authentication and authorization.

Broker authentication

Authentication is the process of making sure the entity's intregrity is intact. Usually this is done by supplying a password. ActiveMQ supports JAAS and also has an API that supports custom built authentication plugins.

The easiest way to implement this is to configure your broker xml file to only allow authenticated users. Example which could be placed under the <plugin> tag in your xml:

<simpleAuthenticationPlugin>
    <users>
        <authenticationUser username="admin" password="password"
        groups="admins,publishers,consumers"/>
    </users>
</simpleAuthenticationPlugin>

The groups provided will be usefull for the authorization of the user. Very usefull when you need to only allow some services to some user groups. Use the createConnection(username, password) method for the authentication procedure.

Broker authorization

Authorization is all about allowing an entity access to a secured resource. Often implemented with the help of ACL's. The following sample XML will provide authorization on a destination:

<authorizationPlugin>
    <map>
        <authorizationMap>
            <authorizationEntries>
                <authorizationEntry topic=">"
                    read="admins" write="admins"admin="admins" />
                <authorizationEntry topic="YourTopic.>"
                    read="consumers" write="publishers"
                    admin="publishers" />
                <authorizationEntry topic="YourTopic.Stats"
                    read="guests" />
            </authorizationEntries>
        </authorizationMap>
    </map>
</authorizationPlugin>

Note that the > wild card provides the authorization scheme recursively to anything under that path.

Message level authorization

Sometimes it can be usefull to add authorization at the message level instead of at the connection level. This is done by creating a java class MessageAuthorizationPolicy thus forcing you to implement the method boolean isAllowedToConsume(ConnectionContextcontext, Message message) . Here you can implement your own criteries of authorization.

To put the authorization policy in good use you need to install and configure it into your ActiveMQ setup. Basicly it is done via these steps:

Compile your class into a JAR file
Put the JAR in ApacheMQ's lib folder
Add a proper messageAuthorizationPolicy element to your configuration
Restart ActiveMQ


Is VLAN Hopping through switch spoofing possible without DTP? I've been reading about Switch Spoofing for some homework, and found that the attack is based on Cisco DTP protocol.

In case I want to replicate the attack in class, I would use HP switch 2510 from our lab, which doesn't use DTP because it's a Cisco protocol, but it uses LAPD to dinamically configure trunk ports based on LAPD packets.

Is it possible to replicate the attack with this device?

Some references I've been reading:

https://github.com/nccgroup/vlan-hopping---frogger

https://howdoesinternetwork.com/2012/vlan-hopping-attack

https://en.wikipedia.org/wiki/VLAN_hopping

Short answer: Yes. As long as you can get a trunk link between your device and the switch.

Long Answer: This attack takes advantage of how the native vlan works with dot1Q packets. A trunk link negotiates the encapsulation protocol of the link, which is usually 802.1Q. If you just send dot1q packets to the switch they are going to be dropped so that is why you need to create that trunk link between the devices, so as long as you can do that then you can replicate the attack. You will have to do some more research on how LAPD works and its default settings. For example, in Cisco's Catalyst family of switches, DTP is set to 'desirable' by default, meaning that it is willing to trunk and all you have to do is tell that port that you want to trunk and it will create that trunk link and negotiate the encapsulation protocol (Usually 802.1Q). I demonstrated this using a tool called Yersinia. So, you will have to see if LAPD does something similar. You will also have to make sure the other correct variables are in place to make this attack work as well but overall, if you can create a trunk between your device and the switch then it is possible to replicate the attack.

Things to think about:

Make sure to research the default configurations of the HP switch and the different modes of LAPD if you are going to make a practical case for this attack. For example, how I outlined above about the default configuration of DTP and why it works.
If you are going to target LAPD then you might have trouble finding a tool that does this as Yersinia attacks DTP because Cisco is much more popular. If you need or have the time to create your own tool, then you can accomplish this with the Scapy library for Python which allows you to create and craft packets at the each layer of the TCP/IP hybrid model and let's you to implement and define specific protocols and parameters.
For this attack to work in demonstration make sure you get a trunk link, you are sitting in the native vlan as an attacker and the target is in a different vlan.

If this is just to demonstrate the VLAN -hopping attack itself and not HP LAPD specifically then I recommend you try to get your hands on a Cisco device even if its virtual through GNS3 or Cisco Packet Tracer. It would be much easier to demonstrate as Yersinia is an already created tool that can attack DTP and craft double-tagged packets.


Avoiding SSL handshake for each call My application interacts with many other HTTPS based services. As we use them at considerable frequency, I am worried about the performance impact of using HTTPS.

Is there any mechanism ( time bound or any other permanent) which I can use to prevent the HTTPS handshake and other potential bottlenecks ?

Ofcourse I do not want to go with HTTP :)

In SSL there are connections, and there are sessions.

A connection starts with a handshake, and ends when either party states it by sending a close_notify alert message. Typical Web browsers and servers will maintain connections open for some time, closing them after one or two minutes of inactivity; one or several HTTP requests and responses are sent over that connection. In normal HTTPS contexts, there is a one-to-one mapping between the SSL connections and the underlying TCP connections: for each TCP connection (to port 443), there will be a single SSL connection, and when the SSL connection ends, the underlying TCP connection is closed.

A session relates to the asymmetric cryptography which occurs in a "full handshake". The handshake process, which occurs at the beginning of a connection, is about establishing the cryptographic algorithms and keys which will be used to protect the data for that connection. There are two sorts of handshakes:

The full handshake is what a client and server do when they don't know each other (they have not talked previously, or that was long ago). In the full handshake, certificates are sent, and asymmetric cryptography (RSA, Diffie-Hellman...) occurs.
The abbreviated handshake is what a client and server remember each other; more accurately, they remember the algorithms and keys that they established in a previous full handshake, and agree to reuse them (technically, they reuse the "master secret" and derive from it fresh encryption keys for this connection).

A connection with a full handshake, and the set of connections with abbreviated handshake who reuse that full handshake, constitute together the session.

The abbreviated handshake is more efficient than the full handshake, because it implies one less network round-trips, smaller handshake messages, and no asymmetric cryptography at all.

For performance, in all generality, you want the following:

Keep connections open as much as possible. An "open connection" uses a few memory resources (both parties must remember the keys) and system resources (for the underlying TCP connection, which is kept open). However, there is no network traffic involved in keeping a connection alive, except possibly the optional "TCP keepalive".
When connections cannot be kept open (e.g. to free system resources), it is best if the client and server remember sessions so that they may do abbreviated handshakes if they reconnect. Web servers have various default and configurable policies. For instance, Apache (with mod_ssl) uses a cache which is defined both for size and for duration; the server "forgets" a session when either its cache is full and it needs some extra room, or when the timeout has been reached, whichever condition occurs first.

If you have control over the servers' configuration, then you may want to increase the "inactivity timeout" for connection termination, and also to increase the session cache size and duration. If you do not have control over the servers, then your question is somewhat moot: whatever you do, it will have to be compatible with what the servers offer. You can somehow force a server not to forget a session by regularly opening a new connection with an abbreviated handshake, but that is not necessarily a good idea (usually, when a server forgets sessions, it is for a more-or-less good reason).

Anyway, you shall make measures. This is a question about performance; abstract reasoning cannot give definitive answers. The usual rule of thumb is that performance issues do not exist until they have been duly measured in real life, or at least in a reasonably representative prototype system.

In any case, it is hard to obtain the same security functionalities of SSL with a smaller cost. Replacing SSL with "something custom" is unlikely to provide much improvement performance-wise without sacrificing security in some way.

For a walk-through of SSL, see this answer. Having some knowledge of the SSL internals really helps a lot in thinking about any design involving SSL.


Encrypting my hard drive using bitlocker I would like to encrypt my C drive using bitLocker which is the only partition on my windows 10 computer. Is it better to separate the disk into partitions, for example: a partition for the OS and another one for the data and then encrypt them separately? Or encrypt the whole disk at once?

I have read somewhere that it is good to have your data separated from your OS. Is it more secure to do this? Would it be easier for encryption? Or it would complicate things?

All I can think of for an advantage to separating your OS and Data for encryption would be if your OS was compromised with malware but your Data was still "locked" and encrypted. It's definitely a benefit, but can be more headache than it's worth. If you're looking to prevent data access when the device is physically lost/stolen then it's not going to help much if any there.

Bitlocker works really simply and well as a full disk encryption solution if your PC has a TPM key built in anyways. It even lets you back up your encryption recovery key to your Microsoft Account (hopefully properly secured with two-factor) if you want so you can't lose it. This guide works well as an overview and helps if you have any questions on setup.


How to verify SHA256 fingerprint of APK I have downloaded the signal app from https://signal.org/android/apk/. To verify the download, there is a fingerprint provided. But how can I verify this fingerprint with the file? I know that I can use sha256sum to verify a hash, but I guess for a fingerprint I need a certificate or something similar?

You've missed a key word in the download page:

  You can verify the signing certificate on the APK matches this SHA256 fingerprint

(emphasis mine)

APK files are just ZIP files in reality, so open it up with whatever archive tool you want (I use 7zip) and extract META-INF\CERT.RSA from it. You can then verify that the certificate fingerprint matches what is written on the site. Note that this isn't the same as the hash of the whole certificate either! You'll need to use keytool to check it.

The keytool binary is included in the Java JDK (usually in the %ProgramFiles%\Java\jdk_<version>\bin\ directory), and can be used as follows:

keytool -printcert -file X:\Path\To\CERT.RSA

Output looks like this:

Owner: CN=Whisper Systems, OU=Research and Development, O=Whisper Systems, L=Pittsburgh, ST=PA, C=US
Issuer: CN=Whisper Systems, OU=Research and Development, O=Whisper Systems, L=Pittsburgh, ST=PA, C=US
Serial number: 4bfbebba
Valid from: Tue May 25 16:24:42 BST 2010 until: Tue May 16 16:24:42 BST 2045
Certificate fingerprints:
         MD5:  D9:0D:B3:64:E3:2F:A3:A7:BD:A4:C2:90:FB:65:E3:10
         SHA1: 45:98:9D:C9:AD:87:28:C2:AA:9A:82:FA:55:50:3E:34:A8:87:93:74
         SHA256: 29:F3:4E:5F:27:F2:11:B4:24:BC:5B:F9:D6:71:62:C0:EA:FB:A2:DA:35:AF:35:C1:64:16:FC:44:62:76:BA:26
         Signature algorithm name: SHA1withRSA
         Version: 3

You can see that the SHA256 fingerprint matches what we saw on the site.

Once you've verified this you can go ahead and install the APK onto your Android device. Since you've verified that the signing certificate inside the APK matches the one that Signal expects you to see, you can then rely upon the Android operating system to validate that the APK is properly signed - it won't allow you to load it otherwise.


Help Prevent Videos From Being Downloaded or Hotlinked ~ OpenLiteSpeed Server How do I protect videos on my server from being downloaded or hotlinked on a different site but accessible on/by one website only. I'm open to utilizing any integration either via .HTACCESS or CORS

For example, I want a website on one server to access videos hosted on a different server.
Any attempts to download the videos by a user be blocked.
Any attempts to hotlink the videos on a different website other than the one stated above 1 be blocked.
If possible but not necessary; redirect anyone trying to do (a) or (b) to either the homepage of my website or show a static (I'll use a funny one of cos) image/gif

The videos in question are in MP4 format.

Forget point 2. You can't stop a user that can watch a video from downloading it - because watching implies downloading.

What you can do is to check referer. This will provide mild security, effectively stopping anyone from embedding your content in their web page. It will not stop any attackers.

An more advanced version, that is marginally more effective, is to use some kind of authentication to validate the origin; this may for instance be by signing the URL with a HMAC or similar. But it will not stop someone from copying your video.

So in short, I would probably implement referer checking. That will stop embedding in other sites, which would be my big concern - as this would cost me bandwidth. It's trivial to implement, and has almost no overhead, except having to maintain a list of allowed sites.


How practical is a laser microphone and how to protect against it? A laser microphone is a "surveillance device that uses a laser beam to detect sound vibrations in a distant object". - Wikipedia.

It's also known as a Laser Based Listening System (LBLS).

Firstly, how practical or easy is it to use a laser microphone for surveillance and how effective is it?

Secondly, what can you do to protect against such surveillance? I've heard something about vibrating windows.

Thirdly, are there known cases wherein this was or is effectively used?

Lastly, in what circumstances (like weather, distance, target material) can this device be used?

Some examples

I found a webshop that used to sell this device: https://www.dpl-surveillance-equipment.com/2181255.html.
I found another device sold here: https://www.alibaba.com/product-detail/Laser-Listening_50011848821.html with a demonstration video here: https://www.youtube.com/watch?v=NuyMRp0yc4w.
Also, this video demonstration seems impressive: https://www.youtube.com/watch?v=h7O-xiZcOAo

Laser Microphones like any other eavesdropping equipment has pros and cons.

Pros

Can be invisible if using infra-red (IR) beam
Will not be detected with typical radio frequency (RF) finders
Can be turned on/off at will - avoiding further detections

Cons

The beam (laser or other) needs to be in within line of sight of the target
Is affected by rain / snow (more explanation below)
IR beam can be easily detected using the Front-Facing Camera on an iPhone

Recent History

These devices were all the rage in the 90s - you can see this by seeing the style of websites selling them (here and here are examples)

For a while they fell out of favor with the rise of networking/computer eavesdropping technologies which provided more value per dollar.

Recently though, they have been having a semi-resurgence with anti terror units having use for them. Here is an example of one such company marketing it.

Laser Microphone History

The earliest recording of a "Laser" microphone is by an inventor named Léon Theremin.

He created something named the Buran eavesdropping system which essentially used an low powered infra-red beam to detect vibrations made by sound-waves. He demonstrated this device on a pane of glass.

Operating Principles

Laser microphones work by shining a light on an object that vibrates (think: glass, plastic cup etc.) When someone speaks (or any other noise is introduced) it pushes the air around it causing the object that the laser is shining on to vibrate.

When the object vibrates it causes minute differences in the distance traveled by the light as it reflects back to a receiver. These difference are detected using something called Interferometry.

These signals are then translated back into sound which allow you to hear what is going on.

Mechanics - the moving parts

Here are the pieces involved to make this work:

Laser beam

This is the device that will 'shine a light' on the object in the room (or on the window. Modern versions of these systems can work at distances of 500 meters

Reciever

This is the device that picks up the reflection of the beam (typically placed at about a 90 degree angle to the originating beam)

This processes the light signal and sends it to the next piece of electronics for processing.

Demodulator

This is the device that actually turns it into sound for you. This device can be controlled with software to remove noises such as wind etc. to provide a clearer sample.

A Laser Microphone can be pretty effective if used properly and in ideal conditions

But remember that the information you are looking for may be in a digital device and not in voice spoken format.

Countermeasures

Detecting a Laser microphone is relatively easy in many cases (mentioned earlier in the answer)

Vibrating the windows is not always effective as software can (and has) been written to remove the frequency from the vibrating noises.

However, one can create a device that vibrates the windows with frequencies that used typically in human speech. Such a device could if done correctly render the laser microphone useless.

Known cases of use

Though there isn't any official documentation of its use, there are some places that discuss its use during the cold war (here is an example).

There has also been speculation whether government agencies used such a device during the Snowden investigation.

Usage Limitations

In order for this system to work you need line-of-sight to an object that vibrates.

This object obviously has to be within reasonable distance to the source of the noise.

Rain, Snow or any other weather that interferes with an IR beam would affect the ability to eavesdrop.

One last thing to mention is the need for both the shining laser and the receiver to be stationary the whole time and not move. Usually, this is achieved by using a pair of tripods (like in the image posted in the question)

Some interesting links

http://www.instructables.com/id/Laser-Surveillance-System-for-under-%2420/

http://hackaday.com/2010/09/25/laser-mic-makes-eavesdropping-remarkably-simple/

http://lifehacker.com/5961503/build-a-laser-microphone-to-eavesdrop-on-conversations-across-the-street

http://www.lucidscience.com/pro-laser%20spy%20device-1.aspx

https://web.archive.org/web/20180305115138/http://www.williamson-labs.com/laser-mic.htm


CSRF on GraphQL endpoint I am currently doing bug bounty on a company which uses GRAPHQL for their query language and would like to check if CSRF is possible. After playing around with burpsuite I have conclude the following;

Company doesn't use csrf token when fetching data
Origin and Referer can be erased and request will still work

If the company is using JSON, I would be able to produce a PoC for CSRF but because they are using GraphQL, I could produce CSRF PoC for the following reason;

Everytime form 'Content-Type' is set to 'text/plain' and every data has been setup inside of my input form, a '=' is appended at the end of body request, like this:
POST /HTTPT/1.1
--- Request Body ---
[
{...}
]=

- This equal sign caused the request to fail
IS there anyway I could bypass this? Been looking for a while but got nothing. Thank you in advance!

There are two ways to fix the additional = sign:

use a standard form CSRF payload and "hide" the = sign in a JSON attribute string context
use AJAX

You can use the following form to create a syntactically correct JSON POST request:
<html>
<form action="https://example.com/graphql" method=post enctype="text/plain" >
<input name='{"query": "[the query]","additional_parameter": "additional_value", "x":"' value='undefined"}' type='hidden'>
<input type="submit">
</form>
</html>

This will create the following request:
POST /graphql HTTP/1.1
Host: example.com

{"query": "[the query]","additional_parameter": "additional_value", "x":"=undefined"}

Some applications may reject the request if you have additional parameters though. In that case, you can use a standard AJAX request:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$.ajax({
    url: 'https://example.com/graphql',
    type: 'POST',
   // contentType: "application/json; charset=utf-8", // we can't change the content type unless CORS allows it
    xhrFields: {
       withCredentials: true
    },
    crossDomain: true,
    headers: {
        //'Accept': 'application/json, text/*' // we can't change the accept header unless CORS allows it
    },
        data: '{"query": "[the query]","additional_parameter": "additional_value"}'
    ,
    success: function (result) {
        console.log(result);
    },
    error: function(result) {
        console.log(result);
    }
});
</script>

This will work because for POST requests, no preflight request will be issued. You can't read out the response because of the SOP, but the request will be sent.
The application may still reject the request though because of the non-JSON content type header, which you can't usually modify using AJAX. You can modify it using flash in some (older) browsers (often oos for bug bounties) or if there is some CORS misconfiguration.


Can cellphone towers triangulation work in 3D or is it 2D only (e.g. longitude/latitude) So,
Most of us understand that cellphone towers are constantly listening for cellphone broadcasts and we also know that triangulation is possible (even retro-actively, as connection records are permanent) by basically using the different signal strengths from your 3 nearest cellphone towers.
Q:
Does triangulation, in 2020, allow for 3 dimensional (height) location tracking? (E.g. if your device is located on the ground floor or at the 84th floor)
My guess is no, but I would not be surprised if I'm missing something.

The way cell phone triangulation works is basically just intersection of spheres. The only thing that cell towers can measure is distance between the device and the tower, and the possible locations that are formed here by a single tower forms a sphere (except if the tower uses directional antennas, which can reduce the number of towers needed to pinpoint the device location).
In three dimensional space, when two spheres intersect, you get a circle. With three spheres you get two points. And with four spheres, you isolate the locations to just one.
The minimum number of cell towers to triangulate to a single point is usually three, because the earth surface will be the fourth sphere and the other point is usually impossibly deep under the earth surface or out in the outer space, so they can be easily ruled out. However, with four towers, you don't need to rely on the earth surface and can pinpoint any single point in a three dimensional space, including height. Any more towers connected beyond three or four are redundant, but they can be used to further increase accuracy in case some of the towers have poor accuracy.
The accuracy of said triangulation though, is another matter, because cell towers aren't specifically designed for triangulation like GPS, these are just emergent functionality that happened to be possible due to the way cell towers work. The accuracy is highly dependent on the accuracy of measuring devices, the weather, whatever obstructions exists, the density of towers, whether the tower uses directional antennas, etc. In densely populated urban areas, there are higher density of cell towers which also can increase accuracy.
According to this, the accuracy of cell tower triangulation is usually about 500m-1km. So if we take that face value, cell tower triangulation can probably figure out if you're likely near the top or ground floor of a skyscraper like the Burj Khalifa which stands at 828m, but not really pinpoint the exact floors you're in. Since most buildings aren't as tall as Burj Khalifa, this doesn't even look practical in most places. Except if the skyscraper actually have a cell tower at both the top and ground level of the building itself, in which case, then maybe.
Much more practical though, to detect your height in a building, is Wifi location. Wifi has such a small radius that being able to see an access point at all is a good indication that you're either on the same floor or at most one or two levels around the access point. Having good signal from a Wifi access point is a very good indicator that you're on the same floor.


Merge a second OpenPGP key pair into user id of other key I have OpenPGP key pairs for two of my email addresses. When I created them, I did not know that it was possible to just add another user id to the first key pair. Then I found out it is possible from the GnuPG documentation.

Is there a way to somehow merge my second key pair into a user id on my first one? I'm not sure if that even really makes sense. I was just wondering if that would be an option to only have one key pair in the future.

Merging the user ID packets would be indeed possible -- but you'd have to create a new self-signatures afterwards for the user ID. You could use gpg-slit to cut apart the individual OpenPGP packets, and reconcatenate them using cat while putting the user ID packet at the right place (be aware: this requires deeper understanding of RFC 4880, OpenPGP).

But the use is rather limited: simply creating the same user ID has the exactly same effect, as all the certifications from others are created on a (primary public key, user ID string) tuple and thus will not be valid if the public key changes.

Decide which key should be the only one and create a new user ID. Sign that key with the superseded key, and revoke the superseded one instead (don't forget to upload both keys). Maybe notify those who certified the revoked key of that change, so they update your keys.