How can you I detect low frequency brute forcing over multiple connections?

Low frequency against a specific login:

Monitor so that after x attempts over a specific login, one can only try it after x seconds / minutes.

Low frequency against a specific login, using CAPTCHA:

After x trials, begin to ask for a CAPTCHA, perhaps slow it down after x tries.

Just notice that slowing down some attempt by using delays is almost equivalent to enabling a DOS attack against that login. If someone tries to access your account, and fails, it'll end up adding a delay to your attempts, and you, the correct user, might get bored.

Low frequency against multiple logins:

If the overall load of your server increased, in a very detectable way, add CAPTCHAs. If it didn't, your unique alternative will be detecting how many failled attempts you have on your site, and again will have to use captcha. Or to add a small delay for all your logins, and that won't do any good to real users...


Is email between 2 parties secure if both mailboxes are on the same server and both clients use SSL?

Generally yes. Assuming that 'configured properly' applies of course (I'm not going to get into the subtleties of configuring a server securely).

Also, you rightly focused the question to those 2 parties, and correctly noted the fact that other aspects might cause security issues / information leakage (e.g. if the client or server are somehow exposed or compromised). If the message was sent by one of the parties to an external email address on a different server, then the same level of protection is not likely to apply. (This concern might also apply if one or both parties set a forwarder or auto-reply)

However, one major point that is missing from your question, is how the email later gets delivered to the recipients. SMTP handles sending emails. A different protocol is usually used for picking up email from the mailbox. Typically POP3 or IMAP4, but there are other possibilities of course (webmail, Unix mailboxes etc). Is this part of the communication also configured properly and secured in the same way?

In addition, confidentiality of the communication may not be the only concern. In some cases, the parties want to validate the origin of the message, and that the contents hasn't been tampered with. SSL/TLS on the SMTP channel aids in protecting against it, but it might not be sufficient in certain situations. Are those two parties trustworthy? do they trust each other?? I guess there are many hypothetical questions and directions to look at this, but on the pure technical side, of whether the communication layer between both clients and the server are protected from eavesdropping, I think you've made a fair assessment.


How to know what's the type of an attack and from whom is sent?

The short answer is that you need more data. You need firewall and server logs to determine what happened at the time of the event. You can also run a packet capture and analyze the pure traffic for anomalies (use Wireshark for packet captures, Snort for IDS, etc).


how does a return to system allow an attacker to evade a non-executable stack?

When a function exits, execution jumps to the address which was saved on the stack. "Classical" exploits of a buffer overflow alter that saved address so that it points to, precisely, the contents of the stack buffer which was just overflown. This assumes that the attacker gets to choose the contents of the buffer, and places there the code he wishes to get executed.

When the stack is non-executable, the classic exploit no longer works. However, the buffer can still be filled, and overflow over the rest of the stack, which includes the return address, but also other things. Consider that the stack looks like this:

address     contents
0x07fff8c8  ...
0x07fff8c4  ...
0x07fff8c0  ...
0x07fff8bc  ...
0x07fff8b8  ...
0x07fff8b4  return address
0x07fff8b0  ...
0x07fff8ac  ...
0x07fff8a8  buffer
0x07fff8a4  buffer
0x07fff8a0  buffer
(...)
0x07fff858  buffer
0x07fff854  buffer

In this rough diagram, the stack grows downwards (as it happens in most architectures); addresses are fictitious but realistic for a 32-bit little-endian architecture on a Unix-like system. The attacker will try, by inserting maliciously crafted data in the buffer, to obtain this situation:

address     contents
0x07fff8c8  ...
0x07fff8c4  0
0x07fff8c0  0x07fff854
0x07fff8bc  0x07fff854
0x07fff8b8  ...
0x07fff8b4  address of execlp()
0x07fff8b0  ...
0x07fff8ac  ...
0x07fff8a8  buffer
0x07fff8a4  buffer
0x07fff8a0  buffer
(...)
0x07fff858  0x0068732f
0x07fff854  0x6e69622f

If the attacker can get this, then, when the attacked function returns, the stack pointer is set to 0x07fff8b4, then one word is popped from the stack, and interpreted as the "return address", i.e. the point where execution shall continue. In this case, this makes the CPU jump to the standard library function execlp() (that's a Unix function). This function is, by definition, located in an area of RAM which is amenable to execution.

The code of execlp() expects to find the stack populated like this:

address     contents
0x07fff8c8  ...
0x07fff8c4  arg2
0x07fff8c0  arg1
0x07fff8bc  arg0
0x07fff8b8  address of calling code

execlp() will interpret arg0 as a pointer to a zero-terminated character string which is the path of an executable file, which execlp() will run. arg1, arg2... shall be pointers to other strings which are the arguments to be passed to the executable file.

In our situation, execlp() has no idea how it was "called"; all it knows is that the CPU is now entering it. It finds as arg0 the value 0x07fff854 that the attacker arranged to put at this place on the stack, with his buffer overflow. That value, 0x07fff854, happens to be a pointer to the area of RAM which formerly contained the buffer, and still contains the data that the attacker placed in it because while this area is "free", the stack has not yet regrown into it. At address 0x07ff854, the attacker placed the two 32-bit words 0x6e69622f and 0x0068732f, which happen to be the encoding of the ASCII string "/bin/sh" (with a terminating 0).

Thus, execlp() finds properly formed arguments which instruct it to run a shell, and so it does.

Summary: a buffer overflow which overruns the return address is used to make the attacked code jump to an arbitrary place. The attacker wants the CPU to run some code which gives the attacker some advantage (e.g. code which runs a shell). Since the stack is non-executable, the attacker cannot put his code in the stack. But the standard library is a collection of functions which are, by nature, executable, and some may do just what the attacker wishes to obtain. It then suffices for the attacker to make the return address point to the library function which corresponds to the desired effect, and the same buffer overflow can be made to place on the stack the "arguments" that the library function will use, right at the place where that function expects them. Since none of this uses the stack area as code, only as data, the non-executable property of the stack does not matter.

Notes:

There is no need to jump to the start of a library function. Jumping to the middle of a function also works. The possibilities are almost endless.
Things work similarly for overflows which replace pointers to functions, e.g. vtables for C++ objects in the heap. What matters is that the target library code finds on the stack what it expects as arguments.
Non-x86 architectures make things a bit more complex because the calling conventions for most RISC architectures (ARM, Sparc, PowerPC, Mips...) define that the first arguments are taken from conventional registers, not read from the stack. The basic principle remains valid, though, but it means that it is harder to make a one-size-fits-all exploit code. The attacker has to tune more details with regards to the exact application he attacks.
The attacker must be able to predict, with good probability, where the library code will be loaded in the application address space. ASLR is a security feature which chooses the loading address more or less randomly, precisely to make such games harder for the attacker.


Why do smartphones limit the amount of fingerprints that can be recorded?

No, theres no specific security reason to limit the number of fingerprints stored.

However, given that these fingerprint modules normally is a HSM, like a smart card, storing fingerprints, the number of, and the size of the secrets such a fingerprint module can store, is limited.

Note that a fingerprint template can also become quite a large, because storing a fingerprint template is not like storing a password hash in a password database. Everytime a fingerprint is read, this will give a completely different result than the previous read, because you are not putting the finger exactly as you did when you registred you, or "enrolled" yourself.

Now, the fingerprint reader needs to make a difficult calculation, on the input fingerprint image, and the template image, to come out with a conclusion if the fingerprint just read, is enough similiar to the fingerprint currently registred, to succeed authentication. This similiarity, can be expressed as a input to the authentication function, where you can select how "sensitive" the authentication should be (too sensitive = it will reject your finger too often, too weak = it may allow a unauthorized person to log in as you)

This is also the reason the fingerprint reader asks you to put your finger multiple times to enroll, because the reader uses these to calculate a optimal "sensitivity" value for your finger, that is stored inside the template.

Think like this:
You take out your camera and take a photo of your house.
This photo you put in your portfolio and store as "this is my house".
After a couple of days, you see a house, and want to know if its your house. You take a photo of the house.
As you might understand, you can't just bitwise compare these 2 images, or compare its SHA256 hash, as the images will be slightly different angles, rotation and light, even if they are a picture of the same house. If you did, "authentication" would always fail.

You need to make a complex mathematical calculation on the picture, to find out if the pictures are of the same object or not.

This means the "template" of a fingerprint reader, can get quite a large, depending on the algoritm used in the fingerprint reader.

There ARE fingerprint readers, that can encrypt a template using its internal key, and then export the template as a AEAD (Authenticated Encryption with Associated Data) that is then stored in standard unprotected memory (that it exist gigabytes of).
But think of the security consequences of this. This would mean, that you could "steal" this AEAD with a enrolled fingerprint image, and later, lets say when you have sold that phone on Craigslist and the new owner has enrolled his fingerprint, just use the stolen AEAD along with your finger, to unlock the phone.

Thats why the phones must store the fingerprint templates inside secure memory, and thats why the number of fingerprint templates are limited.


HTTP Basic Authentication - password missing

The request you captured indicates that the username user with an empty password was used for HTTP authentication.

As you stated correctly, the Basic authentication scheme works by base64-encoding <username>:<password> in the Authorization header. So the rest of your capture likely doesn't belong to the HTTP request or the authentication protocol. In general, GET requests are very uncommon to contain a message body - which had to be signaled by a Content-Length or Transfer-Encoding header in the first place.

That said, it is hard to draw conclusions from the rest of your dump because all bytes without an ASCII representation are displayed as dots. A hexdump might be more informative.


How to securely set a cookie on another subdomain?

Use an iframe that loads a simple page hosted on learn.example.com that listens for JS message events to pass info between domains. You can trust message.origin, which makes it easy to filter with the JS. It basically subscribes a message event and when one happens, ask if the sender is on the list, and if so, sets the cookie. 3 simple steps.

This actually rides on top of a lot of other battle-tested techs like SOP, CSP (optional), and sandboxing. This leaves a lot less to the imagination and doesn't require extra server handling, provisioning, configuration, patching, testing, etc.


Does storing two components of a secret in two places increase safety?

Yes, storing parts of secrets in multiple locations helps prevent against their unauthorized use.  An attacker would need both parts (in the scheme you describe) to make use of your secret.  As you point out, it also doubles the risk of you losing access to your secret.  In the world of the CIA triad (Confidentiality, Integrity, and Availability), you've traded off lower Availability for higher Confidentiality.  If you're comfortable with that ratio, you can stop here.

If you want more control over the ratio of Confidentiality and Availability, then you can use a scheme invented by Adi Shamir (the S in RSA).  Shamir's Secret Sharing Scheme is essentially "RAID" for secrets.  You store multiple pieces such that some number of pieces is necessary to reconstruct it.  For example, you can "split" the secret into 5 pieces, but in a way that only 3 are necessary to recover the original secret.  Assuming you have enough places to put the keys, this means you'd need 3 failures to lose access to your key, and an attacker would need to compromise 3 hosts to gain access to the key.


What Are Good Code Signing Environment Guidelines?

The major principle to consider is this: the private key should never move.

In no way should the code signing environment be accessible to the build/test environment.  If the build environment can fulfill code signing requests directly it means compromising the build/test environment (a space with an enormous attack surface) would compromise your code signing.

The code to be signed must be relocated to the signing environment, the key cannot be moved to the build environment.

One solution I can think of for this is for the build system to publish qualified build artifacts and for a key custodian (an actual person) to get those build artifacts, sign them in the signing environment, and then publish the signed artifacts to an artifact repository.

Preferably the signing environment would be physically isolated, but for business reasons the level of protection you place on it needs to not exceed the risk of key exposure multiplied by the cost of key exposure.  The signing environment in a very low risk scenario (you only have code signing for deployment convenience and accept the risk of reputational damage and legal liability if maliciously used) could be the key custodian's own workstation if it is sufficiently secured.


Understanding ANSI/AAMVA encoded data (pdf417 data matrix) on back of NYS ID card

This is really basic stuff and is addressed in the AAMVA  DL/ID Card Design Standard.   You can find it on AAMVA's website.  I've written a parser in PHP if you would like it.

All the data..starting with ANSI is sort of a table-of-contents.. it shows the IIN (government authority ID#), AAMVA version, how many subrecords are in this record.. the starting position & length of each sub-record..and probably some other stuff i'm forgetting.   the "table of contents" ends when you reach the position of the first sub-record.

Some tags like DAC are/are not used based on what version of AAMVA this record is.  so its important to read the AAMVA version number.. and based on that, look for the tags which were used/defined in that particular version of AAMVA.  Most tags are the same across all versions.. but some tags like first name and last name have changed over the years.

The ZN sub-record is proprietary to the issuing authority..  NYS has publishes what ZNA is.   ZNB is a mystery..probably a hash of the DL# or name or birthdate, etc... or some combination


Not sure if this is how it is done, but it is one way to do it.
Key A is derived from the first password, and key B is derived from the second password. A random key X is encrypted twice, once with key A and once with key B. Both are stored. The PDF is encrypted with key X.
When the user enters a password, it derives a key from it and tries to decrypt both verisons of X with it. Once X is known, it can be used to decrypt the entire PDF.


Why does gpg --list-keys modify my keyring?

When you use --list-keys for the first time, GPG implicitly performs a trust database check (because you haven't done one before). This also shows up in your log:

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model

Checking the trust DB is not a read-only process. It will at least change a timestamp in the trustdb.gpg file. Here is what the check is for:

--check-trustdb
       Do  trust  database  maintenance  without user interaction. From
       time to time the trust database must be updated so that  expired
       keys or signatures and the resulting changes in the Web of Trust
       can be tracked. Normally, GnuPG  will  calculate  when  this  is
       required  and do it automatically unless --no-auto-check-trustdb
       is set. [...]

  Taking the hashes of these files to verify their authenticity would make my job easier.

Key files contain more than just the key parameters, they have metadata attached. It's not guaranteed that two files containing the same keys always produce the same file hash. Hence, instead of hashing the files you should --fingerprint the specific keys if you want to compare them.

Also, if you don't want to preserve your ownertrust settings (or don't have any), then there'd be no need to backup the trust DB at all and you could just delete the trustdb.gpg file (although it would reappear with the next check).

(I couldn't reproduce any changes for pubring.gpg when using your script.)


Assuming you're building a ROP chain that needs to manipulate the stack, you can always go for semantically equivalent gadgets, e.g. PUSH/POP, MOV ESP XXX, (SUB,ADD) ESP instructions to build the stack:
https://www.corelan.be/index.php/2010/06/16/exploit-writing-tutorial-part-10-chaining-dep-with-rop-the-rubikstm-cube/#chainingbasics
http://neilscomputerblog.blogspot.com/2012/06/stack-pivoting.html

Also, for XXX/actual constants (immediates) for SUB/ADD ESP XXX, you can always LEA a register then even MOV ESP, XXX/REG:

https://web.archive.org/web/20171107030509/http://x86.renejeschke.de/html/file_module_x86_id_176.html

Last, depending on the DLL/EXE you're searching for gadgets in, if you can't easily ADD/SUB ESP you could do a slew of things (using volatile registers):

;ADD/INC ESP SEMANTICS EQUIVALENT
POP EBX      ;semantically same as MOV EBX, ESP; ADD ESP 0x4
XOR EBX, EBX ;zeroes EBX if you wanna reuse the register

;SUB/DEC ESP SEMANTICS EQUIVALENT
PUSH EBX     ;semantically same as MOV ESP, EBX; SUB ESP 0x4

You can even get fancy and mov values into a volatile register, SHL/SHR/ROL/ROR it and then use LEA/PUSH. It's all up to you to be creative!


Detailed explanations on OWASP Zap Security scan rules

First check that ZAP actually made the POST request. Its always easier to use the desktop rather than daemon mode when debugging these sort of problems. So start ZAP in desktop mode, explore your app in the same way as before and then check that the POST request is in the Sites tree.
If it is not in the Sites tree then ZAP wont attack it. Exploring your app effectively is key to testing it effectively. If its not been found then there are various options available which we cover if thats the case.


John the ripper - creating specific rules

In the past when I've sharded password cracking across many machines, I have just split my wordlist into sections and provided each machine a section of wordlist to try.  This seems much more straightforward than manipulating rules per entry in the wordlist.  (After all, rules are meant to be applied to the wordlist, not to a single word.)


SAML assertion encryption and using same key for encryption as signing

Encrypting the SAML assertion is optional. Whether or not it's encrypted, you still have privacy through the transport layer security.

Scenarios where encrypting the SAML assertion should be considered include: the SAML assertion contains particularly sensitive user information; SAML SSO is occurring in a sensitive environment.

Your understanding regarding public vs private keys is correct. The service provider supplies their encryption public key to the identity provider.

The identity provider encrypts the SAML assertion with the service provider's public key.

Only the custodian of the corresponding private key (ie the service provider) can decrypt the SAML assertion.

Regardless of whether or not the SAML assertion is encrypted, the identity provider should sign either the SAML assertion or the SAML response that envelopes the SAML assertion.

The identity provider signs the SAML assertion or response using its own private key.

The service provider verifies the signature using the corresponding public key of the identity provider.

The only other consideration is with SP-initiated SSO the SAML authn request often is signed.

In this case the service provider signs the authn request with its private key and the identity provider verifies the signature using the corresponding public key.

The service provider has the option of using the same or different keys for signature generation and SAML assertion decryption.

One advantage of using the same key for signature generation and decryption is that there's one less certificate to distribute and manage.

The golden rule in all of this is that no party should ever divulge their private key to another party.


The answers here are good (both @blowdart and @Tate), but the important thing to take into account, is that if your website is compromised, it's gameover as far as security is concerned - you've been pwned.

The malicious takeover code can do any thing your site can, including accessing your code, running process, database, etc. That means, no matter how you do your encryption, no matter where you put your key, they can get to it and decrypt your data too. Whatever you try, its just obscurity, at best - and worst case, they can just let YOUR code do the hard decryption work and just intercept it afterwards.


Is client cert authentication with a 3rd party PKI cert any safer than using self-signed?

If you trust the security in place in the configuration of your own CA and you don't need other entities to trust you but only your nodes to trust each other, you're probably OK with your current setup.

If you want other entities to trust you, you should use a public CA or you could issue that third party a certificate such that they can trust your certificates. You could also exchange certificates and have mutual authentication whereby you trust each other.

If you don't trust your CA configuration, you should use a public CA. Note that a public CA will usually have a root HSM in offline mode which stores the root certificate and subordinate CA servers for different roles (issuing, revocation etc) and the audits and validation on these can be quite thorough.

I'm sure there are lots of other considerations but I'll leave that to those here who know better.


It is possible to analyze windows malware on linux - but you'll be limited when it comes to analyzing runtime behaviour. wine is good, but to observe the behaviour of the malware, you'll need a debugging vm with windows.


How can I scan hosted POP3 or IMAP e-mail for viruses?

Scanning POP3 traffic for viruses is mostly easy, because the mails are transmitted in full. There are free solutions which can traffic (provided that you have a virus scanner which is mostly not free) and most better (deep inspection) firewalls are able to do this.

IMAP instead is much harder, because mail clients often don't get the full mail at once but only the parts they need at the moment. Typical examples are Thunderbird which gets big attachments in parts and Apple Mail which gets first the mail structure and then each part separately. If you only do passive network analysis (like most firewalls do) you are missing context like the content-transfer-encoding which is important for scanning the attachments.

Therefore lots of firewalls either don't support IMAP at all (like Sophos UTM), have documented limits which point to serious implications in real usage once you understand them (see "Understanding IMAP Antivirus Scanning Limitations" for Juniper Firewalls) or claim to have support for IMAP but probably don't know what they are talking about (or are silent about the limits).
Secure inline IMAP scanning instead needs application level gateways (ALG) which not only inspect traffic but can manipulate it so that they have enough context. The passive deep inspection you have in most NGFW (Next Generation Firewall) or UTM (Unified Threat Management) might be sufficient for demonstrations but not for real life.

Some firewalls don't offer inline IMAP scanning but instead mirror the IMAP accounts, scan new mails and provide the mails with an IMAP server at the firewall itself. In this case the credentials of the original IMAP account need to be stored at the firewall and the user gets different credentials to access the firewalls IMAP server.


Cracking Kingston DataTraveler vault privacy - is it possible?

My flash has password protected and I do not know password. Is it possible, to crack password in some way?

Short answer: No, since neither me nor you know how the device operates inside.

Long answer: This requires a lot of knowledge on how this specific device implements the claimed Enterprise-Grade Security. My best bet would be, most of users here don't know that, and Kingston won't divulge the "commercial secrets" of how they implemented this "security".

That said, my strong belief is that there are weaknesses (poor cipher implementation e.g. leaking key data on flash), debug backdoors (specific commands that e.g. reset the retry counter, upload arbitrary firmware, or anything else -- those are always there), and other nasty things lingering in the device. We simply don't know about them, thus we are unable to exploit them to get you access to what's on the drive.

So to sum it up: for you/me this is probably not possible as we lack knowledge on the device operation. For an abstract attacker -- yes, this may be possible.

NB. If the drive is yours, how come you don't know the password?.. ;-)


can HPKP certificate pinning disable DPI inspection on firewall?

No, HPKP has not automatic affect on the firewall and how it does DPI.

  Is it possible that Firefox and Chrome disable pin validation for users who imported custom root certificates all pinning violations are ignored.

That's not only possible but this is actually the case. Pinning will be disabled if the certificate is signed by a CA which was explicitly imported as trusted. This is explicitly done to make legal SSL interception as done in firewalls but also desktop antivirus products possible.

  What is impact of that? Will browser report any warning?

The impact of this is that SSL interception is possible even if certificate pinning is used. Browsers will not show any warning. Users can detect interception by looking at the certificate details. And, they will see that sites which usually have EV certificates (i.e. green URL bar) will not have an EV certificate any longer. Apart from that no difference can be seen.

SSL interception of course have various impacts. Most of these are not specific to HPKP so I will not discuss these here. But there is one impact specific to HPKP: most SSL interception solutions will not check if the pinning information in the HPKP header match the certificate they just got and they will also not save HPKP information like the browser does and check if they get the expected certificate later. This means that the HPKP is essentially ignored in case of SSL interception, both by the SSL interception product and by the browser behind it.


Cryptographically secure password generation

Aside from length, no there is no difference at all. The former generates a 20 character password with a keyspace of 6220, whereas the latter generates a password with a keyspace of 28×bytes. Assuming bytes is at least 16, you will get 128 bits of entropy which is considered a safe minimum. Both these commands get their entropy directly from /dev/urandom. However, you do not need to use dd for this purpose which is rather inefficient. You can safely and slightly more efficiently use:

head -c"$bytes" /dev/urandom | base64


Have a look at this blog post: the author has apparently observed the same lack of SHA-256 support in the Rfc2898DeriveBytes class of .NET, and set out to write his own code. (I have not looked at that code and cannot vouch for its quality.)

Otherwise, it would not be too hard to reimplement PBKDF2 with HMAC/SHA-256, following the description of RFC 2898, section 5.2. .NET includes an implementation of HMAC/SHA-256.


What steps can I take if I know that someone [Government, Special agents,..etc] is spying on me?

How to avoid being spied on? Become someone else.
It always comes down to this solution in the end. The more resourceful and experienced the opponent is, the more you need to put dedication into it. It is easier to do if you are still "flying under the radar" undetected by your opponent.
How to become someone else? That depends who your opponent is. If it's a stalker, you might just need to change social apps accounts (cutting some social links in the process) and move from where you live. If your opponent is a national intelligence agency that is already spying on you... You might have ditch your computers, phone, friends, home, job, etc. and try to live without identification papers (or SSN if you are in the US) and associated services.
If you are tech savy, you can build from scratch one online persona per activity. Each persona should be disconnected from the others. The best is to use one internet connection and computer for each. If that not possible, the next best option is to use a new computer with the Qubes OS distribution (or different Tails configurations), configured with one Tor router per persona. Never set up Tor hidden services, because they are not hidden from intelligence agencies resources. Do not use phones for those personas. Never connect those personas with your physical activities. You would still be spied on personally, but your personas may have a chance to avoid being spied on. However, be warned that Tor is not fully reliable against national intelligence agencies. Be also warned that every connection exiting the Tor network is likely to be heavily spied on by intelligence agencies, so the personas will attract attention on themselves. Distrust VPN services.
If your main identity must be hidden from national intelligence agencies, being tech savvy will not help much. You just have to look at what happened to Snowden or Kim Dotcom, who were tech savvy. The best option is to stay safe, stay legal.
As a side note: Encryption is just a tool. It might prevent intelligence agencies to read the content, depending on how properly it is done, but alone it will not prevent them from knowing who is talking to who, and they might even guess the kind of content of the communications based on the context alone. In your question you focus on protecting your data (stored at home or in transit), but what you really need is to protect your identity ; protecting your data is just one of the steps towards that goal.


Help me understand this adware (compute-1.amazonaws.com)

compute-1.amazonaws.com  is just part of the amazon cloud services. Anybody can rent resources there so that domain is not necessarily associated with adware although of course it can also contain adware, malware but the majority is probably benign.

  Apparently whenever I have certain web pages open, those pages are sending messages back to the amazonaws server.

It is very common that companies rent resources in the amazon cloud to easily adapt their computing power to the current load. It is nothing to worry about and it is not an indicator that you are infected with adware or malware. See also What is s3.amazonaws.com, and why is Chrome blocking it? for a similar question or read here for details about the amazon cloud services.


Is there any College, State or Government ID that transmits a offline verifiably encryptable data blob?

Passports does not encrypt data, instead it uses Basic Access Control, as a authentication layer, to prevent access to passport data without authorization. The authentication data required to access the passport is written in the MRZ, so ideally, you would need to optically read the passport to get the "password" to open the RFID chip.

However, passport data is x509 signed, so you can still use it for verification if you want to authenticate a user via its passport, to ensure personal information and passport photo is not fraudulent.
Note that you must encrypt the data in transit. Note also that someone can copy the details from the passport and send to your server to impersonate a user if you only do static authentication.

However, passports also support a form of dynamic authentication to do challenge-response authentication of the passport, to ensure it has not being copied, but that requires a Active cooperation of your server, eg your server must actively talk to the passport through a link , for example a mobile phone with NFC that is held against the passport in several seconds during the "signup" process.
Basically, its the passport that signs your challenge using a certificate that is embedded in the passport, and thus you can verify the response is correctly signed, and the certificate used for signing is signed by the static certificate that you can verify against the ICAO root.

A mobile phone can be a excellent resource to allow anyone to signup for your service with a passport. They just photo the MRZ with the camera, then they hold the phone against the passport while your server talks to the passport to verify its authenticity, and then, the signup is complete. I guess you then only save the photo and name of the user.

Depending on your security requirements, it might be enough with static authentication.

Note that the password cannot be used itself for any signing or encrypting activites, so if you for example would want the user to be able to use his passport to sign or encrypt anything, you will have to create a key for the user and link it to the user.


It's not secure:

returnto=//google.com

This is a protocol relative URL, it will redirect to https://google.com if your site is https, otherwise it will redirect to http://google.com


VeraCrypt: Is it possible to change the password after an encrypted container has been created?

You don't change the random key with what everything is encrypted but just the encryption of this key. So yes, it is perfectly possible and therefore you have a menu entry under "System" for doing exactly this.

How this works in detail is basically answered here.

Implement in VeraCrypt desktop version 1.24-Update4: Menu bar > Volumes > Change Volume Password…


Is a separate server needed for remotely accesing accounting software?

As with any situation where you pay for security, it is a simple risk assessment calculation.

What could go wrong?
What would it cost me when it goes wrong?
How likely is it that it goes wrong?
What would it cost me to avoid this scenario?

When you run two applications on one server, it is possible that application A has a serious security vulnerability which will give anyone who has access to A (even partial) full access on application B. When you consider doing this, you have to ask yourself "What would that cost me"? We don't know what your business is about and how confidential your data is, so we can't do this calculation for you.

When a system hosts an outward-facing application (like a webserver or a VPN server), the whole world has limited access to it. So a small security flaw could mean that any other application on the server becomes fully accessible to the whole world. This can theoretically also happen for a software which requires authentication. When the authentication mechanism of your accounting software has a major flaw, it could allow anyone from the internet to login and overtake the accounting software. How much more expensive would the damage be when they would then also have full access to the other applications running on the server?

But when you have two applications which are only avaliable on your LAN, and a privilege escalation wouldn't give anyone the right to do anything they couldn't do otherwise, there is really no reason not to put them onto the same machine (security-wise).

Running multiple virtual servers on one physical server can save costs and improve security, but while virtualization builds a barrier between applications which is much higher than when they would run on the same operating system, this barrier isn't as impenetrable as separate hardware. All virtualization softwares had their security vulnerabilities in the past which allowed one VM access to another VM or the host.

Regarding the cost estimates by your vendor to set up a virtualization with 3-4 virtual servers (5k for a vSphere license, 25k for a redundant server, 24/7 support required), I believe these to be overdimensioned. But neither am I a sysadmin, nor is this on-topic here. You might get a much better and more detailed estimation about what you really need from the real sysadmins on http://serverfault.com


How to retrieve an IPV6 knowing the IPV4?

There is not an IPv6 equivalent for every IPv4 address. They are completely independent addressing schemes.

They also can be configured totally differently, even for the same ISP or for the same device.

You would need cooperation from the device in question to find out a) if it uses IPv6, and b) what the IPv6 address is. Still that might be subject to change though.


IP addresses aren't usually considered private information, so why you'd want to protect the data I'm not sure. If someone is trying to misuse your system the IP address is a valuable piece of data which you will want to be able to access. Checking IP addresses against a blacklist is an example of where the data is useful. Knowing where the IP address is located geographically could clue you in on who may be attacking you.

In any case you don't have a problem as your goal is to protect the data from yourself, not from others. As you say, if someone can access the database they probably have access to everything. You could store the salt on a different system and access it with some sort of API, but that could be intercepted. The data has little value to an attacker anyway, so why would they bother?


Is it possible to take down a site using javascript in the URL bar?

Yes, in theory, a site could have a javascript function that will initiate an AJAX call to destroy the site.  Then, you could just enter:

javascript:destroySite();

I can't think of why a site would have a destroySite function, but it is theoretically possible.  More likely would be some sort of search function, which is vulnerable to SQL injection:

javascript:search("'; drop table users; --");

I should add that these attack vectors rely on server-side vulnerabilities, and you should shore up your server-side code to protect against SQL injection, and make sure that you authenticate any AJAX requests that should require authentication, before allowing them to change anything on the server.

Essentially, the bottom line is:
Never trust user input, and AJAX requests are user input


No.
Probably!

Whilst there may be links back to Google in the case of Chromium, there are also many other people with eyes on the code. That's the (potential) benefit of open source.

You could possibly argue that Mozilla is more independent since they don't seem to have many significant reasons to be doing bad things with people's data. Google are somewhat more suspect in their intent. However, Chromium is used in many contexts so rogue code is very likely to be found out.

Also, lesser known browsers, though they may not have so many ties, also don't have so many eyes on the code. The Maxon (sp?) browser is a good case in point having just been discovered sending vast amounts of quite sensitive data from user PC's to some central location in China.

If you haven't yet found a trusted source of security information that you can monitor for browser related issues, that is where I would start. Then you will see quite quickly what is going on and what people are discovering.

PS: I should say, for clarity, that you've asked for opinion related answers as I don't think anyone can really know if a browser is compromised until someone discovers an issue. This is my opinion.


Best way to alert a website owner of a vulnerability?

First, I'd do it semi-anonymously if possible.  Laws against hacking are often broad and your actions could be construed as 'hacking' by a paranoid legal team/business types that are more annoyed with having to spend more on website development than having something secure.

Second, I would not explore the extent of the vulnerability due to legal issues.  E.g., can I get password hashes?  Can I get user data, etc.?

Third, do not disclose the vulnerability or threaten to do so to anyone not at their company; it may take weeks/months for them to get a designer to sensibly fix their existing code.  (E.g., the lone developer is on vacation/incompetent/etc).

Fourth, I'd try and check to see if administrator/developer email addresses exist and contact them directly.  The contact-us page could be directed to a marketing department that does not understand what SQL injection means and ignored that email.  Do the html pages have any author/company listed in the source code with email contact?  Or can you run a whois on the domain and find a technical contact?

whois stackexchange.com
...
TECHNICAL CONTACT INFO
Stack Exchange, Inc.
Sysadmin Team
1 Exchange Plaza
Floor 26
New York
NY
10006
US
Phone:         +1.2122328280
Email Address: sysadmin-team@stackoverflow.com

You could also try some of the standard emails for a domain (e.g., webmaster@example.com)

Finally, if none of that works, send another message via 'contact us' that links to articles that introduce what SQL injection is, what dangers it likely presents to their organization, why you noticed that their site was likely vulnerable to it (the same reason nefarious types will notice), and what they have to do to make their site protected against this specific attack.


What measures could be recommended to such providers

It's situational, it depends on the existing server and network infrastructure, and what magnitude of DDoS attack they're looking to protect against.

Existing DNS providers have publicized some of their solutions:

easyDNS suffered major DDoS attacks in 2005, and have since blogged about what they have done to become more resilient against DDoS. Their solution includes using Anycast'ed DNS clusters, and connectivity from providers like Prolexic who provide DDoS mitigation services. Their blog post is worth a read, and includes tips on how customers can help themselves.

Amazon Route 53 also uses Anycast, and serves DNS from 30+ locations world wide. The sheer size of their infrastructure helps.

Additionally, Amazon Route 53 is intentionally built with a large address space for their infrastructure. For example a name server lookup for a Route 53 customer might look like this:

ns-154.awsdns-19.com.
ns-997.awsdns-60.net.
ns-1334.awsdns-38.org.
ns-1660.awsdns-15.co.uk.

AFAIK each of the above name server names points to an Anycast'ed server cluster. This may help to contain simpler attacks to a subset of Amazon's customers, and gives Amazon more options to mitigate an attack.

  evaluate whether measures were effectively adopted by the provider

That's a good question. Enterprise providers like UltraDNS (Neustar) are presumably willing to provide NDA's and then discuss specifics of their implementation. But realistically, most less expensive providers aren't going to spend lots of time explaining their infrastructure to you. You can read their blogs, and maybe ask them a few relevant pre-sales questions about DDoS mitigation via email, but that's about it.

For smaller Internet based companies, who don't have lots of resources for DNS, a reasonable plan might be:

Given that pure DNS hosting can be had for a few bucks per month, use two DNS providers together to be resilient against a provider failure. (NB: If you need proprietary features like Route 53's latency based routing, then this isn't possible.)
Prefer DNS providers who have publicly confirmed having DDoS mitigation planning, for example by blogging about it, or who answer reasonably to presales emails on the subject.


I doubt there is a way to store any information (thus transfer information) on regular headphones. Some more advanced models (such as noise canceling) have some processing ability and firmware, but I don't see it as a viable attack vector.


How does Thunderbird quarantine downloaded emails? Is it dangerous to download emails and store them offline?

So how does Thunderbird quarantine email attachments?

Not at all.

  (For example to prevent other programs from executing malicious
  attachments.)

Again, not at all. There's no way this is possible without taking over the OS. Any normal program can read the files where Thunderbird stores it's mails.

If this is a problem because a program could execute malicious attachments, you already have a problem because there's a malicious program already running.

  would storing emails offline be a dangerous thing to do?

From a technical point, no. (Depending on the content of your mails, there might be legal problems if mails are found, or anything like that).

In theory it's possible that the text content of the mail contains text that triggers a critical bug (in Thunderbird or in the OS or...), but that's true for all programs, and not likely in case of email text.

However, one thing that you didn't mentioned: Viewing HTML mails.
It would be better to not do that, ie. configure Thunderbird to always display raw text (and ignore senders that are too stupid to include text versions). With any "active" (JS) or external (CSS, images, ...) content, there are plenty harmful things that can be done. And even with things like image blockers and so on, it's still a risk.


Compare fingerprints of gpg --verify for files download with / without TOR

This is not what "separate channels" means.
Separate channels refer to different ways of communication. By using Tor instead of directly connecting to the server, you still communicate via HTTP with the webserver in the backend and ask it to deliver a file to you.
Imagine if the file you are trying to download was modified by an attacker with access to the webserver. They could easily create their own signing key and sign the malicious file with the forged key. If you have no way of verifying the key with the author, or by using the "Web of Trust" approach of PGP, then you would not detect the forged key, since they key you received and they key the webserver displays are identical.
So what does "separate channels" mean?
A separate channel is any channel of communication where compromise of one thing would not affect the other. For example, a letter sent via the post can be intercepted, but it would not affect what is sent via HTTP or spoken via a phone call. All of these are separate channels, and they can be used to verify they validity of a key.
For example, if you had downloaded a malicious file and a forged key, then called the maintainers and asked if the key was correct, you would have seen the key was forged and the attack would likely have been identified. This is impractical in person, because nobody aside from people trying to prove a point would call up the maintainers of a project to ask for the thumbprint of their signing key.
How can I verify this in practice?
In practice, this becomes a bit more difficult. One way to do this is to obtain the key from a different source. By spreading the public key as much as possible, the attacker can never be sure if people would download the (forged) key from the compromised web server or a different source, which was not compromised.


Is it possible to steal a non secure Cookie when the Web Server (IIS) only allows Https?

Of course it is possible...

Think about it this way:

The secure flag ensures that the cookie is locked to HTTPS.
HTTPS ensures that the connection with the server (requests + responses) is tied to the server's certificate.
The server's certificate ensures the actual identity of the web server.

Now, if you remove that first step, the cookie obviously can be sent in an HTTP request...
Which can be sent to a different server....
Which is impersonating your web server.

There are many forms of attack (e.g. DNS spoofing) that would cause you to connect with the wrong server, and of course HTTPS (using TLS/SSL) mitigates that quite well.
Even if your actual application IS using HTTPS, there is no guarantee that the bogus server is, right?

But let's not stop there, there is an even more trivial scenario.

You say that your web server only allows HTTPS.
That is, it will only accept requests that are HTTPS, and it will reject outright any HTTP requests.
But that HTTP request was already sent in the clear.

If an attacker - or even just a careless programmer - can cause just a single request to be sent from the user's browser over HTTP, then that cookie WILL be sent. Over HTTP. In the clear. With no encryption. (I have actually seen this quite a bit in the wild, the 2nd type more than the 1st...)

Often, that is all that is needed.

Do yourself (and your users) a favor, always enforce HTTPS at all levels.


Is there a way to store user files without being able to decrypt them?

If you want to make sure that the server isn't able to decrypt the file, you must not reveal the password to the server. Therefore

the encryption password must not be used for server-side authentication;
the data must be encrypted on the client side.

You can build complex architectures, but fundamentally, if you don't trust the server, don't give it your password.

An simple web application (server-side PHP plus client-side JavaScript) that does this is ZeroBin. I recommend reading this write-up on Ars Technica about a site based on Zerobin. ZeroBin does not perform any authentication, which may or may not be what you want — this is just an (open source) example to illustrate the principle.

In order to have confidence that ZeroBin does not reveal your data to the server, you need to review the JavaScript code that is executed in the browser, and convince yourself that it performs as advertised.

Alternatively, if you want to perform the encryption server-side, you need to assure yourself that the server is secure enough for your needs. That means you need to trust (or have some third party (that you trust) verify through an audit) that:

The server does not store or leak passwords.
The server code behaves as advertised; in particular, it only stores encrypted data and promptly erases any temporary copies of plaintext.
The data in transit is properly protected.
The server is physically secure, so that no intruder can access your data or your password while it is in use.
People with legitimate access to the server (e.g. system administrators) are trustworthy.
This state of things will remain true as long as you use the service.


Why can you not trust a certificate directly?

Depends what you are testing. According to wikipedia:

  a CA is a trusted third party—trusted both by the subject (owner) of the certificate and by the party relying upon the certificate.

So if you want to test the real world scenario where there will be a CA, then it would be better to create a "test CA" and have that sign your self signed "test Certificate". This would test out the CA trust infrastructure.

Trusting the self signed certificate will also work but it is not simulating the real world scenario. If your testing scope does not require you to test the CA trust chain, then you can trust just the self signed certificate.


Within a CSR, is there a field to have the MS PKI server change the default cert filename

From what I've seen, no - usually the certificate signing requests (CSR or PKCS10) are all about what the cert should look like, or what the cert will be describing.  How it's stored when it's retrieved is a matter of the software you are using to request and retrieve the certificate.

I'm not sure quite what you are trying to do, but it's possible to rewrite the client side of the request if you have the time and money to spend - I seem to remember than the Microsoft CA and/or a fronting IIS server can be configured to listen for CSRs and respond appropriately - with that capability, you'd have the option of storing the output any way you like.


Section 37 of the United Kingdom's computer misuse act

The only thing that allows this is common sense. In reality pretty much every security testing team could fall foul of this as it is very broad.

Luckily our legal system is not yet that stupid, so 'intent' is the important point here.


User "home directory" on iPhone, Android, Windows mobiles and Blackberry

On Android, the notion of a home directory is not apparent to the user, and it is designed for only one user.

The userid and groupid mechanisms are used to enhance application security.  Each application has its own userid, and it is the job of the application to appropriately secure the data, which may be in the cloud or stored locally.

The model is intended to work even for applications which need to protect the data from the user.  Think of a medical records application, which tries to prevent inappropriate use of the data.

Android makes it pretty easy to store data pretty securely, avoiding many of the pitfalls of  traditional desktop systems.  Android also makes it pretty easy to authenticate and share data with other applications.  See details at:

Security and Permissions | Android Developers
How Android Security Stacks Up - Technology Review
Root access vs secure apps and the consensual security model - post by Nick Kralevich


Why is shared less secure than open when it comes to WEP?

Shared would send a plaintext query to authenticate clients which would be encrypted and returned. This left the key vulnerable to a known-plaintext attack.

Open would allow anyone to authenticate, but wouldn't pass plaintext around, making the key harder to guess.

Here and here are links to more details.


Is it safe if SSH and HTTPS server share the same RSA/DSA keys?

Just let the SSHD create some random keys for you.

If either of the server software or the protocols reveals to be vulnerable in a way that could leak the private key, that would compromise both SSH and HTTPS.
You don't benefit from using the same private key and certificate as SSH doesn't provide public key infrastructure like TLS in browsers. The SSH server doesn't send a signed certificate, but the client can compare a hash of the public key with the known keys:

debug1: Server host key: ecdsa-sha2-nistp256 SHA256:8R95weyGWpfk9q9u3OTP...
ECDSA key fingerprint is SHA256:8R95weyGWpfk9q9u3OTPRZYAttMFy27GW2anDQxRTYY.

SSH key hashes could be published on (DNSSEC signed) SSHFP DNS records (RFC 4255). These can be automatically validated using ssh -o VerifyHostKeyDNS=yes.

debug3: verify_host_key_dns
debug1: found 8 secure fingerprints in DNS
debug1: matching host key fingerprint found in DNS

This would require a DNS name with a valid DNSSEC chain of trust (and a validating DNS resolver), just like getting a valid signature for TLS requires a verification from a trusted CA. As this is an embedded device, it's not likely on the public Internet having a public FQDN.
As you won't be using the default configuration, you could mess something up that might become a security problem. While some other implementations (your emdebbed device doesn't probably use) do, OpenSSH doesn't support extracting data from x.509 certificates, but the keys are stored in ASCII armored files.

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key


How to make Location header invalid, on 3xx redirect resulting in showing HTML

Yes! If you also control the value of Location header. In short, if you provide an invalid port, say x, browsers don't follow the redirect and render the content if it has body.
Here's a demo -> https://cm2.pw/redirect?url=http://example.com:x&refresh

Interestingly, it also works with mailto URI as you said. So, if your injection goes beyond /, there aren't any possible ways, at least, not in modern browsers.


EDIT: Kismac2 is also no longer being maintained however the current build still works on OSX High Sierra

Kismac2 has a very large set of functions, including deauth.

https://github.com/IGRSoft/KisMac2/blob/master/README.md

Although kismac-ng (a previous incarnation) has been abandoned, kismac2 is now the tool of choice for most pentesters and wardrivers who need a quick overview of networks, and several attacks.


How to memorise multiple xkcd-style passwords for particular services?

The point of xkcd-style passwords is that: humans think in stories. A password of that kind can be remembered because the user will build a kind of "story" involving all the words in the password as elements of the story.

Along these lines, you should include the service name as part of the story. If your "correct horse" password is for Amazon, then you may remember the story as "a book about famous 'smart horses', including one who could correctly (and famously) recognize staples and batteries". Or something else. The story needs not make sense when written down; it is personal to the user.

Another completely different method to remember passwords is to type them often. This is memory in the fingers (that is, in the part of the brain that controls the fingers), and it works well.

Yet another point is that if you are on the other side of the Internet but still want to access your passwords, then you are about to type your password on some machine. So:

Either this is your own laptop, then why don't you have a copy of your passwords, encrypted with a strong master password ? That's something I do (this is safe if the master password is strong, and you apply some care on the decryption, e.g. deactivating swap space and doing the decryption in a RAM-based filesystem).
Or you are about to type your password in a third-party machine, e.g. in some "Internet café", and well, you should not. Really. Because such a machine could have a key logger.


Crunch password list, no duplicate characters

Crunch is not designed for that option. It also doesn't make sense that it would. Password list generators need to create very large lists that match patterns. Your request is a constraint.

For password lists that require such constraints, it is better to write your own script.


Could once infected machine be ever trusted again?

Theoretically, no, an infected machine cannot be trusted anymore. In practice, wiping out the hard disk (or just removing it and inserting a new one) is often sufficient, although some virus have been known to reflash part of the BIOS, for pure wanton devastation, or to make the virus resistant to disk formatting. Some motherboards will not allow reflashing unless a specific jumper is physically plugged in, which at least protects against hostile reflashing; if unsure, consult the documentation of your motherboard (if you use a laptop, you are probably out of luck).

Apart from the BIOS, other devices can have flashable firmwares. A demonstration has been made in the case of some Apple keyboards.

While all of this means that a once-corrupted machine can never be really trusted again, it begs the sister question, which is: how come you could trust the machine in the first place ? You don't really know where it has been (at least not with more precision than "some factory in south China"). A possible answer is that if the attacker managed to plant some malware which resisted a complete machine reinstall, then he probably deserves to stay there. At least, this piece of malware has been written by someone who is technically competent, which is refreshing. It would be a great day if you could say the same of a majority of the other software you run on your machine.


Replacing images on HTTPS sites with MITMf?

For sites like google and facebook several browser have preloaded HSTS (enforce HTTPS) and HPKP (certificate/public key pinning) settings. This means that the browser knows that these sites should be reachable by https only and how the certificate should look like. And this means that stripping SSL and the HSTS header (i.e. your --hsts option) will not work against these sites. It will only work against sites where the browser does not know (yet) that HTTPS is mandatory.

What you would need is to do real SSL man in the middle where you have a HTTPS connection from browser to your man in the middle proxy and from the proxy to the real server. In this case the HTTPS connection to the client is signed by certificates created by the proxy and the relevant proxy CA needs to be explicitly setup as trusted inside the browser/OS.

But from a look at mitmf I don't see that it offers an option for doing real SSL man in the middle, it can only do SSL stripping (i.e. downgrade to plain HTTP) which does not help in case of preloaded HSTS/HPKP. Thus you would need to use other tools like mitmproxy.


There is no best practice, it's entirely based on a risk assessment. Risk is typically a relationship between Impact and Likelihood, lessened by Mitigations. Mitigations lower the Impact and/or the Likelihood. Each scenario and context for risk is different, which is why there is no one way, or best practice, to look at the problem.
Then you start brainstorming the effects of mitigations:

What could happen if you did not do mitigation X?
How much does X cost (in money, effort, etc.)?
What other risks get introduced by doing X?
What can be done to minimize those risks?
... repeat ...

But as a part of all that, you need to look at the operational impact of doing X at all.
You have an anti-virus on the firewall that is impacting critical business function every once in a while. You are worried that an infected file might slip through.

How often? Can you mitigate by manually extracting the file and distribute it yourself to those who need it?
Can you whitelist the file and confirm that the file is the approved file from the source? (checksums, signatures, etc.)
Can you add a temporary exception or do exceptions need to be permanent?
Can you scan the exempted file using a local anti-virus?

These are all questions with different impacts on your business function, and the likelihood and impact of the exemption causing a problem.


// is just the start of a protocol-relative URL. From this site, //google.com would take you to https://google.com. From a plain old http site, //google.com would take you to http://google.com (which would likely bounce you to the https site, but that's not tangential).

The  tag itself will set your relative URL interpretation to another domain. so with that above base tag in effect,  Login on your site would not take you to your login page, it would take you to http://google.com/login. While google is benign, you can see the potential problem.

In terms of your exact question, I'm not sure what the point of either example you provide is, as-shown, other than just to break your site's links. A malicious use would have to list another destination in the base tag. to be of use.


How to know, in Windows XP, if files were copied, deleted or moved from a pendrive?

There could be some more information in your question to help us answering it. Ideally, which Operating System (OS) you have (Windows? any Mac?).

And if I understood correctly, you have a pendrive (flash drive) with some sensitive / important files on it, and it's connected to a computer during some time. And you want to know if someone, using that computer, did copy, move, etc., files from or to the pendrive.

In general, you can't know. Just some OS have ability to create a log of this kind of activity. In those systems, you enable logging for all files access that is made, and then you can erad the log to see if something was read. I'm assuming that you are using Windows home-edition...

To avoid loosing information from your pendrive (someone deleting), the protection is to have a backup somewhere else.

To avoid having sensitive files read from it, the solution is to protect those files with some encryption, so that anyone who copies the file won't be able to read its contents. For example, you can password protect Word / OpenOffice files, you can zip your files using password protection, you can use Truecrypt to create a virtual protected drive inside your pendrive...

Give more details on what you need, and people will be able to give better ideas.


Wipe free space or take image and wipe entire disk?

I would recommend you to use something like dban which is a bootable linux distro specialized for exactly that purpose. It might take some time to securely erase your disk.


Benefits of placing WAF reverse proxy/transparent in front of web-based honeypots?

Would an inline WAF make the honeypot appear more attractive by making it more difficult to attack?

Many websites are built out having load balancers/WAF in front of the actual web servers. It’s quite common. They’re also used for SSL/TLS termination to boost performance. That said, it does add complexity in that a vulnerability in your WAF implementation could result in the attacker having an alarming level of access. A great example of this is HeartBleed.

  Can consolidating WAF and honeypot attack vector logs though SIEM aid in adding context to the data generated?

Sure, however rules need to be created for the SIEM to digest/correlate the two additional data points.

WAF Benefits

There are two major advantages with placing a WAF in front of your web application honey pot.

SSL/TLS termination. This is pretty much required so the request/response can be inspected.
Prevent the hacking others. The honeypot deployment shouldn’t send malevolent traffic out to the Internet. Nor should it be a place for an attacker to send unsuspecting users. An example being a persistent XSS. Both of these should be prevented so you're not aiding the attacker.

Legal

I'm not a lawyer nor is this the place to seek legal advice.

With that out of the way, there are legal concerns with running a honeypot as brought up in a prior post:

What is the current U.S. law regarding the building of and deployment of honeypots?


Open source firmware, namely OpenWRT and dd-wrt are supposed to be more secure and "open" than the stock firmware. After all, they are based in open source. And poised to over time, having more regular updates than the stock firmware. They also have a very strong and active community.

They are supposed to improve you security outlook, and you can disable/customise much more things than in the original firmware.

They often also bring more functionalities than the original firmware; on the other hand they can miss others.

dd-wrt is strongly oriented to more unexperienced users, openwrt to die hard system administrators and developers. With openwrt, you manage it pretty much like another Linux distribution system; on the other hand you can manage dd-wrt even in your iphone with a nice interface. However, openwrt already gets a nice web interface, and if it has a far much more recent version than dd-wrt, I would advise considering it.

I myself have a TP-Link with openWRT, and have customised it a lot in the command line. The installation was painless. OpenWrt allows to use VLANs in the switch chip at will, which was not certainly the case with the default stock firmware, however does not allows to handle NAT in some accelerator chip, which makes absolutely no difference to me as I am doing NAT in another router.

Nevertheless, it would not make much of a difference even doing NAT there. Openwrt also allows me to install software for debugging problems more effectively, and eventually using a more interesting 802.1X setup than the default hardware, which has some limitations handling 802.1X.

On the wifi side, the protocols attacks are pretty much the same. On my model default firmware and in openwrt, you can create an isolated guest network and give a different password to visitors, your mileage may vary.

I myself trust more openWRT than the stock firmware that came with the TP-Link. The security records of appliance vendors is not one of the brightest - and backdoors are aplenty - ; often they only care about sales, and stop supporting updates after a very short while.

As a last side note, my own OpenWRT administration IP is in a VLAN that is not allowed to talk with the Internet.

disclaimer: I am not saying I do believe it is completely secure, however I am inclined to trust it more than the firmware from the vendor.


Generate cryptographically secure token in mySQL

This is a bad idea. GUIDs are designed to be unique, not random.

The GUID generation algorithm was designed for uniqueness. It was not designed for randomness or for unpredictability

Also from https://stackoverflow.com/a/2621604/569090:

  Do not assume that UUIDs are hard to guess; they should not be used
     as security capabilities (identifiers whose mere possession grants
     access), for example.  A predictable random number source will
     exacerbate the situation.


Why is there a redirect to the native app in PKCE?

Because it is still extension of OAuth2 Authorization Code Grant.
If the application is trusted with end user password then it can use Resource Owner Password Credentials Grant and as you say only have direct (TLS protected) call to authorization server.

In Authorization Code Grant application is not trusted with end user credentials so it have to force user to interact with authorization server directly (by performing redirect). The  authorization server confirms identity of resource owner and granting access to OAuth client and then have to return the access token to the Client. In Authorization Code Grant it is done by redirect using resource owner user agent, passing the authorization code. The OAuth client then calls authorization server directly and exchanges authorization code for access token.

The two redirects are simply the way how the OAuth2 Authorization Code Grant is defined.
Now if we do not want to trust the application with client credentials then the redirects are hard to avoid - as apart of the payload that is passed there is one more "thing" handed over - the person in front of device.

The application is saying to authorization server "Here is some person, who claims to have resources managed by you, please arrange access to those resources for me."

After some time authorization server "The person you sent me confirmed your access, here is a way to obtain it."

In no place in exchange the shared identity of the person is established.

So if we get rid of first redirect, we would get "Some person claims to have resources managed by you, please arrange access to those resources for me." - clearly request impossible to fulfill.

Now for second redirect the authorization server is the initiator so it would be very hard to call back specific mobile app instance, and even in server to server scenario there is still a problem with matching response with the request.


Is bcrypt safe with the 64-bit block cipher birthday attack?

Yes, bcrypt is still safe.  Blowfish is used in a fundamentally different way inside of bcrypt than for symmetric encryption.  The birthday attack requires that an attacker be allowed to encrypt hundreds of gigabytes worth of data under the same key, and then examine the hundreds of gigabytes of ciphertext output in order to find a colliding ciphertext block.

These conditions simply don't exist in the bcrypt hashing function, so even though the underlying algorithm is Blowfish, the attack is not applicable.


mod_nss vs openssl behavior vis-a-vis key storage vs use

When using an HSM with TLS all cryptographic operations involving the private key are executed on the HSM. This means the private key never leaves the HSM. In fact, the HSM is specifically designed to protect exfiltration of the private key using software based attacks and sometimes even hardware based attacks (i.e. tamper resistant). This exactly is the reason a HSM is used at all.

This means that an HSM would not be worth its money if it would be possible to extract the private key using OpenSSL or other tools or even by using specifically designed hacking tools. Thus the answer to your question for all existing HSM is hopefully: No, it is not possible to extract the private key using software.

Which means: if you need both more performance and the security of an HSM for every TLS connection then get a faster HSM.


Is there anything like a standard GUID to identify a PC?

There is no universal GUID that uniquely identifies a computer. It's not possible either, strangely for philosophical reasons.

If you know what the Ship of Theseus is, then feel free to skip this part, as you know where I am getting. Otherwise, imagine me having a computer. As it gets older, I sell parts of the hardware (e.g. graphics card, RAM, etc.) to upgrade it. At some point, none of the original parts remain. Is it still the same computer?

Further, what if someone happens to buy all the obsolete parts to assemble another computer. Would that be my computer then?

It's not a question we can answer, because "a computer" is not an atomic entity. It's a composition of various pieces. Each individual piece can uniquely be identified (serial number, etc.), but the composition can not.

Of course, you could take one piece of hardware (e.g. the motherboard) and use that as the identity, but at that point you require every motherboard to have a unique identifier.

What could they possibly have used?

That's a tough question, and it depends on the details of the scope. One possible candidate would have been third-party tracking cookies. ISPs can use the connection being used to identify customers (not individual devices though), and there have been several instances where ISPs have been found to use such things to track customers.


Elcomsoft Advanced Office Password Recovery may be what you're looking for; you'll need at least the Standard edition for GPU acceleration, and the Professional edition if you have more than one GPU or you want certain other features.

John the Ripper Community-Enhanced (Jumbo) also has this capability.

Note that brute force is a poor cracking method once passwords reach reasonable lengths; mask attacks and rules-based dictionary attacks are much more efficient at many passwords humans choose.


Is using a VPN or Proxy the only explanation for a wrong location being displayed?

Yes, it is possible that the location reported is wrong.

How does an IP show location?

The binding between IP addresses and physical locations is very, very loose. The way they work is by seeing which ISPs give out which IPs, and where those ISPs are located. Depending on how wide of an area that ISP serves, and how consistent they are with their IPs being allocated, the better or worse your accuracy is.

Imagine that there was an ISP which would only serve New York City, and they would give out IPs in the block 200.0.0.0/7 (meaning anything from 200.0.0.0 to 201.255.255.255 would be valid). Any IP assigned in this range, e.g. 200.103.10.5 would thus likely be in New York City. Somewhere.

Now imagine a second ISP would serve all of the US, and would just assign IPs to customers from anywhere in their IP address range (let's say 100.0.0.0/3, from 100.0.0.0 to 131.255.255.255). A device with the IP 104.140.92.6 would likely be somewhere in the US. Where exactly? That's impossible to say from this information alone.

What causes inaccuracies?

The data which IP corresponds to which ISP or location is not from any official source. It's being collected and corrected by whoever has an interest in keeping such a database. This means that naturally, there are some holes in the database.

IP address ranges are being bought and sold, causing this data to become outdated. Data can be added wrong, too specific or too loose. ISPs could give out public IPs to which they don't have the rights, although this should not happen.

What does this mean for me?

In general, nothing. Given that Johor and Kuala Lumpur are relatively close together, and that Kuala Lumpur is the larger of those cities, that the ISP your boyfriend is connecting to has its head office in Kuala Lumpur, thus the connection being displayed as coming from there.

On a more personal level, unless you have a specific reason to assume your boyfriend would lie to you, I see no reason to be suspicious. If you indeed assume this, then I highly recommend you to have a look at Interpersonal Stack Exchange to find a way to rebuild the trust between you and your boyfriend.


Strongest cryptographic algorithm available in PHP 5.3

As encryption primitive I'd use AES. Both AES-128 and AES-256 are strong enough. Numerically AES-256 is stronger, but it's very unlikely that AES-128 is the weakest point in your system.

Since php doesn't seem to support an authenticated encryption mode, you need to build that yourself. I'd use HMAC-SHA-256, possibly truncated to 128 bits.

To combine these operations I'd:

Generate a new random IV with mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)
Encrypt the message with AES in CBC mode with that IV
Note that AES is always MCRYPT_RIJNDAEL_128 even with 256 bit keys
PHP uses zero padding by default which cannot unambiguously removed. A better padding is PKCS#7, but you'll need to add/remove it yourself. There are many existing implementations for that.
Concatenate the IV and the ciphertext
Calculate HMAC-SHA-256 on the result of step 3 (MAC must include both IV and padding)
Concatenate the result of step 3 with the MAC

To decrypt:

Verify the MAC in a way that's resistant to timing attacks
Extract the IV from the ciphertext
Decrypt the message

This is an encrypt-then-MAC scheme. It's recommended to use different keys for MAC and encryption. I recommend deriving both from a master key.


Why do ALGs restrict traffic on a given TCP port based on the protocol?

Traffic inspection (particularly for Application Filtering).

If I am an employer and I keep HTTP proxy logs of the websites you visit (and block some of the undesirables on work-time such as Facebook), I don't want you connecting to a VPN or other SOCKS proxy and bypassing my restrictions or uploading my confidential business information which is why I've bothered to lock down which TCP/UDP ports can be used in the first place because you happen to know that TCP port 80 is a free-for-all on our firewall.

So while on a firewall I may typically block everything from the workstations to the Internet apart from port 80.. but then you go and find a proxy that is running on port 80 to connect to.. ensuring that the only traffic going through is valid HTTP traffic ensures I can inspect and malware scan it.

Additionally I don't want you connecting to BitTorrent clients on TCP Port 80 and using my network connection for BitTorrent.

I agree with the commenter that Application Layer Inspection is not terribly common. There are too many ports for various applications in use now (particularly on mobile devices) and too many proprietary protocols floating around (which I speculate is perhaps one of the reasons Microsoft decided to bin Forefront TMG, they probably got bored of writing the application filters) that Application Layer Inspection is often too restrictive for most environments and causes more support issues than it's worth (verses the small number of people that would try and have the technical knowledge to exploit my firewall rules).

What'sApp will try to connect on TCP port 443 (typically used by TLS) over its own weird protocol (i.e. NOT TLS) to specifically bypass any firewalls that don't allow its usual port of TCP port 5222.

Finally, encrypted connections won't typically reveal what the application is anyway (Is my TLS connection one to a web-server or to my mail-server or to a TLS VPN?) and a blind "Allow all TLS traffic on TCP port 443" rule still leads you open to some abuse unless you have some TLS Visibility appliance.

You may also want to look at Application Level Filters section of the Stateful Firewall article and its associated Application Firewall article on Wikipedia.


How far is my Access Point BSSID sent in my internet packets?

You access point is not sending your BSSID anywhere on the internet. It is just broadcasting the BSSID locally so that any WiFi devices nearby can see it (and connect to it if they want and have the credentials).

These WiFi devices might have a known location (for example determined using GPS) and thus can create a mapping between the known location and the visibility (and strength) of the BSSID around this location. These WiFi devices (and not the access point) then can upload this mapping to some central place where these information gets accumulated into a central database. Such central mapping then could be queried later to map visibility of specific BSSID's back to a location.


What are the FEDRAMP "complementary controls"?

What FedRAMP calls "complementary controls" are simply the classic NIST "security control enhancements" selected for FedRAMP, and that are available in the usual NIST templates.

It was just a vocabulary issue..


Can bruteforce attacks be prevented with tables of valid inputs?

"Is limiting the domain of the encryption to only valid inputs, an
  effective method of preventing bruteforce attacks?" -- No. It is
  merely limiting the search space that attackers need. – Ghedipunk

If this was a traditional encryption, GhediPunk would be correct. But in this case it is different, as explained below:

This in fact is immune to bruteforce, as it is the same as a One-Time Pad; except instead of having a static transform you apply to a plaintext, you have a static plaintext (with the agreed codewords).

Since there is no structure like grammar to impose in order to check correctness, bruteforce won't help.

Of course, while it is immune to a bruteforce attack, like a One-Time Pad it is not immune to an attack on the key-exchange or other weaker parts of the protocol. So this is basically just a One-Time Pad with a slightly impractical twist.

What this does highlight are the few cases where bruteforce is completely impractical (assuming the adversary has unlimited computational power):

When the enciphered output produces valid input for incorrect keys (e.g this cipher & One-Time Pad)
When the enciphered output is incomplete (e.g Shamir's secret sharing)
When the enciphered input has no pattern (e.g Encrypting a random bits)

(Note the last point is essentially the same as the first)

Of course in most modern practical cases, no one assumes the adversary has unlimited computation power, and generally one opts for the option where the cost of breaking the cipher outweighs the cost of the gaining the information, as it is more realistic.

Edit: Demo of one-time-pad with text swapped out with pad.


Ethics & releasing research with no viable solution

Well there's a couple of aspects to consider here, as has been said there is no clear answer.

On the one hand you've correctly identified the risks of public disclosure with no easy remediation, which is that attackers can take advantage of the issue.

However there are also risks with not publicly releasing.  For example, it's entirely possible that other entities have already discovered and are exploiting the issue you've found. By publishing you would then be leveling the playing field by allowing defenders to come up with work-arounds and mitigations, something they likely can't do without details on the issue.

Also whilst there may be no fix, speaking in general terms there are other mitigations that can be applied to most technical security issues once they are known (e.g. additional monitoring of hosts, blocking of attacking systems) etc.

What you might want to do is, is contact an agency to discuss the issue and see about involving the appropriate industry/technical people to look at co-ordinated disclosure.  If you look at some of the larger impact issues that have come out over the last couple of years, that's generally the best approach.

As to who to contact, one option would be to speak to someone like CERT who are used to co-ordinating disclosure of issues.


Why does IBM's Intrusion Detection System Show Local IPs instead of Public IPs for the Source of an Attack?

This is not an attack

The IDS is merely telling you that you have an SSL certificate with a weak algorithm. more info

The IP address is the address of your own internal server, that has the weak certificate.


The difference comes from the locking/nonlocking random beeing used (e.a. /dev/random and /dev/urandom) from the man-pages of ubuntu 14.04 (man random):

NAME:      random, urandom - kernel random number source devices

SYNOPSIS : #include <linux/random.h>
           int ioctl(fd, RNDrequest, param);

DESCRIPTION :
 The  character  special files /dev/random and /dev/urandom
 (present since Linux 1.3.30) provide an interface to the kernel's random number
 generator.
 File /dev/random has major device number 1 and minor device number 8.
 File /dev/urandom has major device number 1 and minor device number 9.

 The random number generator gathers environmental noise from device drivers and
 other sources into an entropy pool.  The generator also keeps  an  estimate
 of the number of bits of noise in the entropy pool.  From this entropy pool random
 numbers are created.

 When  read,  the  /dev/random device will only return random bytes within the
 estimated number of bits of noise in the entropy pool.  /dev/random should be
 suitable for uses that need very high quality randomness such as one-time pad or
 key generation.  When the entropy pool is empty,  reads  from  /dev/random
 will block until additional environmental noise is gathered.

 A  read  from  the  /dev/urandom  device will not block waiting for more entropy.
 As a result, if there is not sufficient entropy in the entropy pool, the
 returned values are theoretically vulnerable to a cryptographic attack on the
 algorithms used by the driver.  Knowledge of how to do this is not  available
 in  the  current  unclassified  literature,  but it is theoretically possible that
 such an attack may exist.  If this is a concern in your application, use
 /dev/random instead.

 Writing to /dev/random or /dev/urandom will update the entropy pool with the data
 written, but this will not result in a higher entropy count.  This  means
 that it will impact the contents read from both files, but it will not make reads
 from /dev/random faster.

Usage :
 If  you  are  unsure  about  whether you should use /dev/random or /dev/urandom,
 then probably you want to use the latter.  As a general rule, /dev/urandom
 should be used for everything except long-lived GPG/SSL/SSH keys.

This means that openssh will use the /dev/urandom special file, and gpg --key-gen uses the /dev/random. the GPG will lock when entropy is 'drained' until enough entropy is added, resulting in proven entropy being used, urandom rehashes its entropy pool all the time. That means it does not run out of entropy like /dev/random does. and it does this to have a known 'real'-entropy level for the random numbers. and not rely upon the entropy of the /dev/urandom.


If an IP address is known, can all of its browsing activity be viewed by an outsider?

It depends on your outsider. A normal internet connection goes from your client (like a browser) to an endpoint (like a website).
The ISP as well as the endpoint knows your IP address. However when connecting through the ISPs network through a website you often have additional routers on the path, big internet exchanges ... Just do a traceroute from your home IP to some website and you often get half a dozen hops or more.
So everyone with the ability to sniff on or between these hops could possible know where you connect to. The more close to your home the more likely they can see all the endpoints you connect to.
Assuming a local ISP or your countries three letter agency, they can see the domains (or IPs in general) you visit, when you visit them, how long you visit them, the amount of traffic exchanged with the endpoint, the OS and applications you use, the protocols you use and in case the protocol does not use encryption they can also see the content.
Based on that, they could make some assumptions what URL you visited and what you are doing online in general and how your soft/hardware stack looks like.
With encryption they can't directly see the content by just passively looking at the traffic. They could start active attacks which generally are a bit more noisy to see your content.
Also they could attack the endpoint itself to see what you are doing.
On IPv4 MAC addresses are not transmitted outside your local network. On IPv6 this is more of an issue.


I don't see any resemblance of access control in either scenario.  If you haven't been told this already:  stop using md5! it is old, broken, and inefficient,  use SHA-256 or just a simple cryptographic nonce.

In the first scenario if the attacker knows this magical "md5hash" then they will be able to always use this edit feature.  How do you keep the user from obtaining this hash?  How is this hash generated?

Scenario two seems even less secure,  it is trivial to send an arbitrary post and cookie variable:

curl http://some_vulnerable_site.com/edit  --data "post[id]=1&hash=somevalue" --cookie "hash=somevalue"

All GET,  POST,  COOKIE, and HTTP header values are under the attackers control.  A cookie should hold a session id,  which references state about that user (a user id), which can be used to enforce access control to data.

If you want to know more about security,  make sure you read the OWASP top 10.  In terms of this post, you should read: OWASP A3- Broken Authentication and Session Management.


Four eyes authentication for command execution on Linux. (OS level)

I don't know of a packaged solution to do this. I expect it would be quite tricky to do, as you need a two-step request/approve system, and there is nothing like that in standard Linux systems.

One possibility is to use an out-of-band two-man system. For example, the reboot command could require an additional password. One half of the admins know that password; there other half have the rights to run reboot. To actually do a reboot, two admins would have to work together. Even this is a bit tricky - and flawed if the second admin writes down the password.

I've never seen this done in practice though, and I'm not sure it's a sensible thing to try and do. In general it is almost impossible to lock down admins, as they need high level rights to do their job. What is more practical is locking down administrator access, e.g. an admin's account is normally disabled; it is only enabled (by a separate team) when the admin is dealing with an authorised change or incident.


Use PKCS#12 file to distribute trusted CA certificates?

Sure: PKCS#12 is an "archive" format for cryptographic objects. It can contain pretty much whatever you want: multiple certificates, multiple private keys, etc. The encryption and signature is optional so you could use it for storing certificates.

PKCS#7, however, is more commonly used for storing certificates: it's a simpler format that is specifically designed to hold X509 certificates without the corresponding private keys.


Trial certs
There are several CAs that will generate short-lived trial certificates for you.
Here's one:
https://www.instantssl.com/free-ssl-certificate.html

Short certs
And there are some CAs that will generate longer lived free certificates for you.
StartCOM/StartSSL has been doing this for several years.

https://www.startssl.com/
StartCom on Wikipedia
Instructions on DigitalOcean

Own CA
There are several tutorials online about how to roll your own CA with OpenSSL.

DataCenterOverlords.com: Creating Your Own SSL Certificate Authority (and Dumping Self Signed Certs) (Archived here.)
TLDP.org: [http://www.tldp.org/HOWTO/SSL-Certificates-HOWTO/c118.html] (SSL Certificates HOWTO)

I prefer Ivan Ristic's booklet: "OpenSSL cookbook". (Subsection called "Creating a Private Certification Authority" (Bottom third of page.)


This crossdomain.xml policy file revokes all protection that the Same Origin Policy provides.

I use the crossdomain proof of concept tool,  which has a simple interface to test SOP bypasses.


How would a keylogger bypass Wireshark sniffing?

If an attacker roots a system they can install drivers which will hide malicious traffic from sniffers like wireshark, tools like netstat, or process utilities like task manager or PS. An attacker could have keyloggers, spam bots, ddos tools, anything they like running on a system and even administrators would be completely oblivious unless they ran an external sniffer.


How do you deal with massive port scans?

I ignore them. And if you have a reasonable security posture, you should too.

Your servers should have no ports open to the general public other than those that you use to serve the general public.

For example, your web server should have open port 80, 443, and maybe 22; everything else should be SSH-tunneled or otherwise VPN'ed if you need to connect to it, unless you expect random nobodies on the Internet to be using the listening service. Perhaps you may want to remap SSH to port 222 or or something in the upper range to avoid filling your auth logs with failed logins, and that should be as exciting as your servers get.

If instead the port scan is hitting your outbound corp gateway, then the scan should show zero ports open, because your corp gateway isn't a server. And you, like a wise IT admin, run all your servers elsewhere on the internet, not inside your corp network, for a whole raft of reasons I won't go into here.

A port scan should reveal to the attacker nothing that they couldn't reasonably guess. And if this is not the case, then your problem isn't the port scan, it's the public secrets you're trying to hide by blocking port scans.


How would two people with burner phones communicate?

Burner phone numbers as an OTP 'equivalent'

You can think of the "identities" of those phones (phone number, SIM, phone itself/IMEI) as an equivalent of one-time pad encryption - you exchange the phone numbers (multiple) over a secure channel - e.g., when meeting in person; and then they're secure and provide no useful information (for network/metadata analysis) as long as you discard them after a single use.

In your proposed scenario, Jack would have picked up a bunch of prepaid phone cards and given you the list of those numbers. Afterwards, if you'd need to contact him, you would call the first number on the list, have your conversation, and after that you could both discard the phones. If you'd expect a future call, then you'd turn on the phones corresponding to the second item on your lists.


Is it secure to make user able to disable 2FA with 2 security questions if they have lost backup codes?

I wouldn't say using security questions for pretty much anything is "secure".

There have been so many compromises of personal information, ranging from financial (Equifax) to social (Facebook) it's not unlikely that answers aren't compromised.

Questions like mother's maiden name, school history, first car, etc. Could be part of a breach, or phished out of an email or dating app (commonly show occupation and education history by default now).

The ability to bypass or disable 2FA is one of the current weaknesses in how it's been employed recently. Depending on your resources I would suggest a few alternatives.

Let them pick 'nothing' (and the account is forever locked)
Consider allowing users to use their Google/Facebook accounts to login (you don't hAve to worry about 2FA as that's Google/FBs issue)
let them specify a recovery email (other than their normal email, which gets recovery email)
send a physical letter to the account on file
send an email/call/SMS then wait a period of time (days) and if you don't hear back from the account owner allow a login without 2FA (idea is they would respond if the attempt was invalid/not from them).


If a local user types in a password during a LogMeIn session on the local computer, can the remote user have it?

No, it's not possible for a remote user to sniff your password over a service like logmein. There are many reasons, the biggest of which being that you aren't connecting to each other directly. When you connect with someone over logmein you are going through a server which brokers the connections. If a remote user shares their desktop you could not record keystrokes, only see what is on the screen.

The only way you would ever be able to get their keystrokes is if they were acting on your system, as in you had given them control, and even then you'd need a keylogger utility of some sort.


There are multiple options for JWT tampering.
Some web applications do not validate the signature, or don't use it at all.
That means an attacker can modify the contents at will, insert all kind of nasty payloads (XSS, SQLi), ignore the expiration time by using an arbitrary value for the timestamp, and so on.

Another way is called signature exclusion. JWTs have only two mandatory signing-algorithms that are mandatory to implement: "none" and "HS256".
Inspect the JWT by Base64-decoding it:

{"alg":"HS256","typ":"JWT"}

If you see the algorithm being HS256, it is an indicator that the system may be using a default implementation (and probably even an outdated one). You can then replace the algorithm with "none", and remove the signature completely (the part after the last period).

If the server accepts the JWT like this, you can then start tampering the contents again, as explained above.


What tools exist to manage large scale firewall rulesets?

Tufin and Firemon are the major players here.  I do not have experience with Firemon, but Tufin makes a solid product.  (I do not hold financial interest in Tufin, but am a customer).