How to filter PCAP for TLS "application data" packets? I have a pcap file containing encrypted traffic.

I want to filter SSL packets that contain application data. Note that I do not want to decrypt the traffic, but just want to note the packets that have encrypted data. Initially, I was using content type field (value = 23) in TLS record to filter out such traffic.

However, in the pcap file I observe packets with different content type such as 12, 108, 73 etc. I could not find what do they signify from the RFC.

I've checked the provided pcap file and counted the used ContentType's in the SSL traffic:

$ tshark -O ssl -r youtube_song_wireshark.pcap tcp.port == 443 |\
grep 'Content Type' | sort | uniq -c

This gives me 64 x Alert(21), 86 x ChangeCipherSpec(20), 362 x Handshake(22), 2188 x ApplicationData(23). It does not give any of the ContentType's you've seen in your analysis.

In a comment you provide the following snippet of the results returned by your scapy based analysis:

<SSL records=[<TLSRecord content_type=51 version=0x70c2 length=0x3c44 |<TLSCiphertext ...>

Given that there is no SSL/TLS version 0x70c2 but that the version should be in the range of 0x0300 (SSL 3.0) to 0x0303 (TLS 1.2) I suspect that you parse data as SSL which are not SSL at all and that you get such a strange result then. There is several non-SSL traffic in the pcap you've provided.


Is it dangerous to have a credit card payment page without authentication? The client wants a payment page that anyone can browse to, put in their information and id from a previous registration, and make a payment. The problem is that the id is from a different system and I wont have access to the information before hand.

This would be the first time we allow payments without authentication. Is this too risky to becoming exploited? Could people use this for malicious purposed? (Using my page to check whether stolen cards are blocked etc).

Thanks!

The only problems I can see here is that someone could DDOS by entering random creditcard data, especially if you do not have access to the information and id at the time you accept the payment request. The service handling the payments would have tons of errors afterwards.

Still, realistically, there is no reason for this to happen unless you have someone who wants to damage you. And in this case, its probably also possible to just create an account and do the same. If you have a captcha in place, it shouldnt be a problem.

If the information and ID entered by the users is not checked before payment, there could be problems with assigning payments to the correct person.

But from a security perspective, I don't think that there is a vulnerability for a user entering his data.


Are there any quick-erase devices with a small memory available for storing key information? I would like to set up my computer's full disk encryption to unlock with a key file (preferably one that uses the SD card interface, but I'm not particularly picky) because it's annoying to enter in long passwords every time I boot my computer, but I don't like the idea of anyone with the "key" being able to open my computer.

My preferred compromise would be a memory card / stick that has a small key file on it, with a random 100-200 character password that I could easily and securely wipe by flipping a switch. This way, I could keep the password backed up for manual entry elsewhere, and use the key for convenience during day-to-day life, if I feel like I'm going to be in a situation where someone might demand the key of me (or if I'm otherwise going to be separated from the key), I could easily and surreptitiously wipe its memory. Ideally, it would err on the side of failing (e.g. fail closed rather than open), since it's not the only place the information is stored.

For hopefully obvious reasons, it would need to be something that I can wipe without putting it in a computer, so something like a powered device that stores the key in volatile memory would work well, I imagine, or something that has a small battery that can be used to erase itself.

Does anyone know if such a device exists, and if so, what are they called?

Try to make your own key from ATMega/STM32 ARM chip:

you make it as an USB slave (peripherial) device
it has an EEPROM with the key, so you have a jumper you're removing after storing the key
it has a battery inside
an "emergency wipe button* starts an EEPROM filling with random data circuitry
(optional) after some wiping cycles it uses an overvoltage techniques to burn an EEPROM chip to hell and/or overheating its case top surface to make it unrecoverable even with a newly described method of removing a chip's top cover layer by layer

It's not an obvious Google-it task, but should be no problem. Good idea, by the way! Maybe I'll make such a device myself!


What are the risk of NOT using a host key for SFTP using pysftp? I've put together an ETL process with Python where I move some files from an SFTP server to a local sever. I'm following the directions from here: http://pysftp.readthedocs.io/en/release_0.2.9/cookbook.html

I was having a hard time getting the key encryption to work so I followed the directions to set it up so it doesn't check for a host key. It explicitly says that's a bad idea so I only did it for testing with full intention of using a host key later.

When it came time to put our public key on the server, the provider said that that wasn't something that they did. Plot twist, we don't own the server so I can't put it there myself.

Even without the key, the connection is still encrypted right? The reason I'm confused is because I use tools like WinSCP and that doesn't require that I use an encryption key.

What are my risk if I DON'T use an encryption key?

Sharing code per request. The values of the parameters are pulled in via a yaml format config file.

import pysftp

cnopts = pysftp.CnOpts()
cnopts.hostkeys = None

with pysftp.Connection(host, username=username, password=password, cnopts=cnopts) as sftp:

You confuse your account public key, that you use for authentication, with a host/server public key, that you should use to verify the server.
These are unrelated, while serving a similar purpose, just in an opposite direction. The server uses your public key to verify your identity. While you should use the server public key to verify server's identity.
See my article on understanding SSH keys.

Even if you use a simple password authentication, you still have to verify the host key. The host key verification protects you from man-in-the-middle attacks.

See my answer to Verify host key with pysftp to learn how to verify the hostkey with pysftp library.

Note that neither of the two above mentioned public keys are encryption keys. That's just another thing. See How does SFTP function without a manually generated public/private key pair.


Will RSA parameters be sent in a Server Key Exchange Message in TLS 1.1? The TLS 1.1 (RFC 4346), the section for Server Key Exchange Message (7.4.3) says

  It is not legal to send the server key exchange message for the
  following key exchange methods:

       RSA
       DH_DSS
       DH_RSA

But, below in the same section for structure of the message, it gives the structure as follows:

  struct {
      select (KeyExchangeAlgorithm) {
          case diffie_hellman:
              ServerDHParams params;
              Signature signed_params;
          case rsa:
              ServerRSAParams params;
              Signature signed_params;
      };
  } ServerKeyExchange;

In which condition will the ServerRSAParams be sent? Why is it needed? In the TLS 1.2 (RFC 5246) specification, I find that the ServerKeyExchange structure doesn't indicate any parameters to be sent for RSA. Snippet from RFC 5246 below:

  struct {
      select (KeyExchangeAlgorithm) {
          case dh_anon:
              ServerDHParams params;
          case dhe_dss:
          case dhe_rsa:
              ServerDHParams params;
              digitally-signed struct {
                  opaque client_random[32];
                  opaque server_random[32];
                  ServerDHParams params;
              } signed_params;
          case rsa:
          case dh_dss:
          case dh_rsa:
              struct {} ;
             /* message is omitted for rsa, dh_dss, and dh_rsa */
          /* may be extended, e.g., for ECDH -- see [TLSECC] */
      };
  } ServerKeyExchange;

As TLS 1.2 puts it:

  The ServerKeyExchange message is sent by the server only when the
      server Certificate message (if sent) does not contain enough data
      to allow the client to exchange a premaster secret.

Therefore a ServerKeyExchange message containing a RSA public key would be used when the server's public key is not fit for key exchange (e.g. it is in a certificate which is marked as signature only) but client and server wish to use RSA for key exchange nonetheless.

Sending a RSA key like this is a feature which has fallen out of use, but it was used in TLS 1.0 with the RSA_EXPORT cipher suites. At that time, there were rather stringent regulations in the USA, limiting the size of cryptographic keys that were used for encryption in systems which were exported outside of the USA (these regulations were lifted in 2000); in particular, RSA encryption was limited to 512 bits (and 40 bits for symmetric encryption). The RSA_EXPORT cipher suites complied with these export regulations. When the server has a RSA public key, the client and the server agree to use one of the RSA_EXPORT suites, and the server's public key is larger than 512 bits, then the server must send a ServerKeyExchange message with a RSA key of at most 512 bits, and use its permanent RSA key (the one from its certificate) to sign the ServerKeyExchange message.

Dynamic RSA key generation is a bit cumbersome and expensive; a given SSL server can reuse such a key with several clients, but it is still heavier than DHE. The main use case was to support feeble clients who can do RSA only; however, even if RSA public key operations are very fast, ECDHE (Diffie-Hellman with elliptic curves) is competitive and much easier for the server. TLS 1.1 clients are allowed to advertise support for the RSA_EXPORT suites, but only for backward compatibility with SSL 3.0 and TLS 1.0 (section A.5 of TLS 1.1):

  TLS 1.1 implementations MUST NOT negotiate
     these cipher suites in TLS 1.1 mode.  However, for backward
     compatibility they may be offered in the ClientHello for use with TLS
  1.0 or SSLv3-only servers.  TLS 1.1 clients MUST check that the
     server did not choose one of these cipher suites during the
     handshake.  These ciphersuites are listed below for informational
     purposes and to reserve the numbers.

The ServerRSAParams structure in TLS 1.1 is thus a survivance from TLS 1.0 which somehow evaded the wrath of the RFC 4346 editors, but was finally removed when RFC 5246 was produced.


SIM card used with smart card user certificate Is it possible to put a smart card user certificate (Windows) on a SIM card? (SIM card already has telecom info on it).

I'm using Win 2012 and have tried, but I am getting this error "smart card cannot perform the requested operation..."

If not, what smart card do I need to have to install a smart card user certificate? I will use smart card to log in to Windows VPN.

The SIM Card is not able to fulfill the requests sent to it when trying to place a certificate on it. The required commands are not available. Most (nearly all) SIM-Cards are not able to be extended in functionality either.


Is advanced mathematics relevant to security beyond cryptography? Short question. The title says it all... is advanced mathematics (i.e. beyond the classic college level calculus sequence) relevant to any field of computer security besides cryptography? By relevant, I mean to be at the edge of the science one must have advanced mathematical training.

If so, what branch of security and what branch of mathematics--and why?

Please note that I am not looking down on any branch of security, at all, just curious what other branches of security advanced mathematics is essential for.

Edit: In lieu of some comments in the answers: I consider the "classic" college calculus sequence to be something like: calculus 1, calculus 2, multi-variable calculus, and differential equations. Of course, one can branch off into other mathematical fields before reaching differential equations.

Yes, math is a tool and it can be useful in the realm of computer security.  A fair amount of math is required to obtain a degree in Computer Science, and hackers prey on software developed by computer scientists.

Algebra can be used to fool GPS, and detect doctored photographs.

Computer Science theory is a branch of math and has applications to security.

There are also Algorithmic Complexity Attacks which is an attack pattern rooted in algorithmic analysis.


Linux OS with encryption including hidden volumes? I've just come across hidden volumes in Veracrypt, where a user is able to keep a second password in the event that they are forced to open up their encrypted volume, and the second password unencrypts only specific files that the user has made sure can be seen in such a situation, with the other important stuff still hidden.

I use Linux Mint and encrypt my drive, but this made me wonder if a similar option is available when logging into Linux Mint or any other Linux versions? So when under duress one can enter the second password in order to unencrypt the drive for the OS. Just to be clear, I am not asking if Veracrypt is available for Linux Mint.

It might not be as convenient as Veracrypt's hidden volumes. But you can encrypt your drive and remove the header from it (If you are using LUKS) as detailed in:
https://superuser.com/questions/823922/dm-cryptluks-can-i-have-a-separate-header-without-storing-it-on-the-luks-encry

As it says there, the drive will then look like random data and will not be able to be identified as your system.

The way you could use this, is having two drives one password protected. The other with the header moved onto a USB. Under duress you'd be able to claim that was a drive you were working on to recover, and be able to show your password protected system as your working platform.


How to check for duplicate passwords? Is it possible to check if a given number of people are using the same password, without risking anyone's password getting out? I heard that Google does this, not allowing the user to set a password 1000 people are using. What if users have access to their own records (e.g. distributed database)?

EDIT:  The number of users for what I'm doing right now is 10-10K. What if we ask each client if their password matches a given text anonymously (I can do it with some RSA encryption and stuff)? Would it work? Or should I give this idea up for good?

The only practical ways to do that are to use the same salt for hashing all passwords (bad) or to store the passwords in plain text or reversible encryption (very, extremely bad.)

Since those approaches are big and bigger security problems, I'd guess Google isn't doing either of them.  What they might be doing is disalllowing the 1,000 or so most common passwords.  There's a list of common passwords here: https://xato.net/passwords/more-top-worst-passwords/  (Note that if you disallow the top 10,000, for the "ordinary" user, you've disallowed everything.)

Edited to add: I guess you could store the last n passwords and their (different) salts.  Seems like a lot of trouble.


Strongest cipher suite in apache 2.4 I am trying to use only the strongest ciper suite available, from the documentation I tried:

SSLCipherSuite HIGH:!aNULL:!MD5

But the browser says that it is obsolete:

What is the strongest one available at the moment?

THE strongest is perhaps not well determined. But Chrome wants to see something like TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, i.e. the cipher suite has to use DHE or ECDHE and AES in Galois Counter Mode.

Alternatively you can use CHACHA20_POLY1305 as the symmetric algorithm.


what info can web bugs track? From EFF's Web Bug FAQ(point 6),

  What information is sent to a server when a Web Bug is viewed?

  The IP address of the computer that fetched the Web Bug
  The URL of the page that the Web Bug is located on
  The URL of the Web Bug image
  The time the Web Bug was viewed
  The type of browser that fetched the Web Bug image
  A previously set cookie value

I understand how (1), (3), (4), (5) can be fetched. Even (2) could be arranged by making sure that the pages that you want to track (which have the tracking pixels in them), have a one to one web bug url.

But what I clearly don't get is how would you get (6)? If you have a web bug on trackee.com/page that makes a request to tracker.com/pixel.gif, how can tracker.com identify a cookie stored under the domain of trackee.com? Is there something I am missing here?

The URL of the Web page where the bug is located is obtained with the Referer HTTP header: when the browser downloads the "bug" picture, it simply says to the server "I found this link in that page". There is no need for a one-to-one mapping, although it could certainly be done.

For the point (6), it is not about a cookie from the host server (the one which contains the Web page which links to the bug) but a cookie from the bug server itself. In your notation, a cookie which was sent from the tracker.com server, and is sent back by the browser to the tracker.com server. Fortunately, obtaining the cookie values attached to trackee.com is not that easy ! Otherwise, plundering cookies would be trivial for any site which allows users to include links to external resources (e.g. all the StackExchange sites).

This cookie management is still a worry because it allows the bug administrator to reliably track people. Namely, the first time a given browser downloads a bug, the bug server sends back a unique cookie value (e.g. randomly generated). Every subsequent download of any bug from any page pointing to the same tracker.com server will contain that cookie value, so the tracker.com can easily see that it is the same browser as previously.


How do I know that the ISO image of the Linux distribution I have downloaded does not contain the NSA backdoor? I have downloaded the ISO image of Kubuntu 20.10 and installed it.
I am afraid that the ISO image may have been tainted (for example, by the NSA) to insert a backdoor into it.
As I see it, there are two ways to insert a backdoor (I mean an intentional one, not an OpenSSL bug):

Directly in the source code that is published on the internet. I don't think this is feasible. I don't have the time to read all the 10M+ lines of the Linux kernel, and, even if I did, I don't nearly have the skill to understand most of it. Moreover, I would also have to check all the source code of all the libraries on top of the kernel (qt, all the apps, etc.). But I am not worried about this for the following reason: I think a lot of people and companies work on the kernel (for instance, Google with android, Red Hat with its for-profit Linux OS, etc.). It would be in their financial interest, if they spot a backdoor, to blow the whistle and then sell their own backdoor-free kernel

But, I don't know whether the binary I have downloaded results from the compilation of the source code published on the internet, or of some other source code (the idea, of course, is for the NSA to download the kernel source, add the backdoor, compile, and publish that binary). I don't mean that Canonical necessarily sold me a tainted binary. What I am telling here can be achieved in multiple ways. For example, the NSA can spoof the DNS records I use, and, when I digit ubuntu.com, they have me connect to their own website, which looks exactly like the official website, but the NSA binaries are provided instead of the correct ones.

How can I avoid the risk illustrated in number 2, and check that the ISO image I have downloaded was compiled from the source published on the web?

You've specified that you don't care about source code vulnerabilities, so then the question really is "How do I verify that I've installed a legitimate binary?".
This depends on your distribution.  Most of them have some level of cryptographic signing of packages; for instance, there will be a package that installs the GPG keys for the distro packagers, and every downloaded package is checked against your keychain.


What do Msgsrvr and Scientia-ssdb do? I'm having a task in a computer security class in school where I'm supposed to scan a host for open ports in order to find out what services are being run there. I have found out (among other things) that the scanned host has an open port 8787 and "Msgsrvr" is being run there, along with Scientia-ssdb on port 2121. What are they, and is it a potential security risk, i.e. should the ports be blocked by the scanned host?

It's an FTP server from "scientia-ssdb":

http://www.linuxquestions.org/questions/linux-newbie-8/unable-to-list-the-directory-after-changing-ftp-port-from-21-a-4175454098/


In what situations can a hacker try to break passwords millions of times? I keep reading about situations where a hacker could "easily" brute force a password (most recent example) but I'm confused about when some has an opportunity to do this kind of thing. If it is a website/web service, aren't attempts like this rate limited? I.e. I can't try my Amazon password 50 million times per second, even if my internet connection were more awesome than it is.

What needs to happen for someone to even have the opportunity to brute force their way into a system? And if systems can effectively throttle attempts to dozens or fewer per minute why is there such an emphasis on saying that GPU attacks can generate millions or billions of passwords per second if these are effectively useless?

Mass brute force is usually done after the attackers have somehow seized a list of hashed passwords. This can happen in several situations; most common being:

A SQL injection attack which allows attackers to push some more or less constrained SQL expressions to be evaluated by the target database. Depending on the site structure and local constraints for the attack, attackers might not be able to do what they wish with the database, but still be able to dump some parts of it.
Data is extracted from a discarded medium, e.g. an old hard disk; possibly an electronically broken hard disk, that the attacker retrieves from a dumpster and repairs.
Indelicacy from an employee or intern, who stealthily grabs a copy of the database and stores it on a USB Flash drive.

The common trend here is that cracking passwords is used to extend an attack:

Attacker got a read-only glimpse of the database, and wants to escalate that into read-write access.
The original breach is risky (e.g. attacker had to be physically on the premises) and wants to come back to the server, but from the network and without incurring the risk of an encounter with security guards.
Attacker wants to get the password from one server because he knows that most users will reuse the same password on many other servers.

The third point is probably the most common motivation for attackers.


Would chip-and-PIN have prevented the Target breach? Would chip-and-PIN have prevented the Target breach?

As we all know, Target was breached and the hackers stole lots of credit card numbers.  Target is now advocating for chip-and-PIN, as a way to provide better security for credit cards.  This makes me wonder.  If chip-and-PIN had been in place, would it have prevented the breach?  Or would the attack still have been possible (merely forcing the attackers to shift their methods slightly)?  Is this just PR, or would chip-and-PIN have made a significant difference against the kind of attack seen in the Target breach?

Recall that, in the Target breach, the attackers were able to compromise Target's point-of-sale terminals: not just one of them, but all of them.  Is chip-and-PIN secure in that threat model, where the attacker controls the point-of-sale terminals?

Does it depend upon whether credit cards contain both a chip and a magstripe (for backwards compatibility with legacy systems), or if they contain just the chip (and no backwards compatibility)?  My impression is that the way this gets deployed is: first we have credit cards that support both chip-and-PIN as well as a legacy magstripe; then after some period of time, when there is sufficient deployment of the chip-and-PIN terminals, then credit card companies might start providing credit cards that have only the chip but not the magstripe.  Does that affect the analysis?  For instance, is the answer that if credit cards had both the chip and the magstripe, then a compromised point-of-sale terminal can steal the credit card number and CVV off the magstripe nad then clone the card, but if credit cards had only a chip, then they couldn't?

That depends on what you mean by "prevented".

EMV is only used for transactions where both the card and the cardholder are present; it wasn't designed to improve the security of card not present (CNP) transactions. This has some implications on what an attacker can do with stolen credit card data.

Physical transactions

If all merchants and cards were using EMV exclusively today, then the stolen magstripe data would be worthless for physical transactions – there would simply be no opportunity to use a cloned magstripe.

EMV transactions are active in the sense that there is a "conversation" between the card's chip and the issuing bank, mediated by the terminal. Basically, the bank asks the card to sign the transaction details using a cryptographic key that never leaves the card. Making a copy of an EMV card is therefore assumed to be impossible. (Magstripe cards are passive in that anybody who knows the contents of the magnetic stripe is able to authorize transactions; it is trivial to create a duplicate of such a card.)

Unfortunately, EMV is widespread, but still not ubiquitous; as long as there is a single remaining magstripe-only ATM or merchant on the planet, cards will continue to be equipped with a magnetic stripe, and skimming will continue to be a problem.

Remote (CNP) transactions

The problem is that the credit card details on the magnetic stripe can also be used for CNP transactions in some cases. CNP transactions usually require the card number, cardholder name and expiry date; all those values are stored on the magnetic stripe as well. To address this problem, card networks have designed the CVC2/CVV2; a number that is only printed on the card, but not included in the magnetic stripe data.

However, not all merchants use that value – for example, Amazon (at least in my country) doesn't require it. Thus someone performing a card skimming attack would be able to use the captured card details to make fradulent purchases at any online or phone/mail order merchant that doesn't require the CVC2/CVV2.


With tcpdump dst port 53, you select explicitly everything that goes to port 53, the traditional DNS port.
DNS over HTTPS uses Port 443, which is the standard port for HTTPS traffic.

    Apparently, this doesn't look encrypted.

The tcp-dump shows that you are doing normal DNS requests, not DoH. The DNS requests are resolved by 192.168.1.1, what probably is your router to the Internet. Because you limit your tcp-dump to port 53, we cannot see whether there are any DoH packets; we just see the traditional DNS packets on port 53.

And the DNS packets on port 53 suggest that you are not using DoH.

So, that is why they do not look encrypted.

    When I changed my DNS server to Cloudflare, I could only see the entries for Cloudflare's DNS server (which is what I expect from DoH).

So how did you do that? Change it in Firefox? What did you see? DNS packets on port 53? In that case, you are not using DoH. Or port 443 calls to the DoH server from cloudflare?

    So, what's wrong with NextDNS?

Nothing. It works (except for some IPv6 issues).

    How is NextDNS different from unencrypted DNS?

NextDNS provides (also) DNS over HTTPS. If you have configured your DoH with NextDNS correctly, you should see the DNS requests with

tcpdump host 45.90.28.0

You will not be able to read the contents of your DNS query, ofcourse

    And, am I missing something here?

As I can see it, you are making a number of assumptions that are wrong.

DNS=port 53. Although this is true for traditional DNS, DoH uses, as I stated above, TCP port 443.
192.169.1.1 is NextDNS. It is not.
You assume your Firefox config is such that it uses DoH with NextDNS. The TCP-dump you provided shows that this is not the case. You probably made a configuration error.

    But, why am I not able to intercept my regular traffic when I use Cloudflair?

Apparently, your DoH configuration is correct then. You might be able to see them with

tcpdump host 104.16.249.249

or

tcpdump host 104.16.248.249

    which result will be entrusted by the browser in case they happen to be different?

The first that is used for resolution. Once the hostname is resolved, Firefox will look no further.

    Why are unencrypted requests even generated by FF when I've asked it to use DoH?

Seems like a miss-config

    And how do I know that my router doesn't forward this unencrypted requests to my ISP if it's not able to resolve the query

I am positive that your router will forward the DNS requests to port 53 unencrypted to whatever DNS resolver you have configured in your router.


Are the Linux community/universe repositories significantly less safe then the main repositories? If so what makes community/universe less safe? Is there less testing or is it simply less safe because more people could put malware in them.

No, it shouldn't scare you if you're worried about safety of packages. Though I do not recommend using it since it's not officially supported.
Universe is community maintained software, that is to say "not officially supported software".

I recommend you read this article so you'll understand the differences between Main, Restricted, Universe, and Multiverse repositories.
Good Luck


Does using unicode or (at) actually stop spambots? I want to make my email address available on my website and I was wondering if there was any point in using the "(at) (dot)" convention these days. If I was writing a script to trawl for email addresses it would definite contain a match criterion for this. Similarly, for the same reasons it seems unlikely that using the html unicode version of my email would actually be an effective protection. It seems like it wouldn't be worth the inconvenience of not providing an actual link (and not being able to use an image).

The different ways of writing email addresses seem like security though obscurity, but not obscure at all.

So,

will using the "(at) (dot)" convention actually affect whether people get my email address?
Will modern spam filters make the answer to (1) irrelevant?

Some spam bots, yes.

All spam bots, no.


How to use one time pad if the key is shorter than the plaintext? I understand that one of the requirements (and a major drawback) of OTP is that the key has to be as long as the message is.

What happens if I have a key that is shorter? The message would only get encrypted partially, right?

For example if my Key was "The" and my message was "Hello, there" the resulting ciphertext would have to be only three bytes long. Right?  In this case only "28 13 9" (in decimal format).

I just want to confirm that my understanding is correct and that the key doesn't wrap around or something like that.

"One-Time Pad" is more a concept than a strictly-defined algorithm. If there was a specification of an "OTP encryption algorithm" (say, in RFC format or similar), which tells where each byte goes and when, then that specification would tell you what happens when the key length does not match the data length. Moreover, if, in the case where the key is shorter than the data to encrypt, that specification told you anything else than: "if the key is shorter then encryption must be aborted"; then that specification would not qualify as a true implementation of the "One-Time Pad" concept.

In that sense, there cannot be any "key wrapping around" for a One-Time Pad because then the "pad" (i.e. the key) is no longer "one-time".

An OTP algorithm specification would be quite simple, but there is still room for variants. When the data to encrypt is a sequence of bits (as is typical in computers), then it is customary to talk of the OTP with XOR as operation for encryption and decryption. However, any group operation can do the job. For instance, if the data is a sequence of octets (aka "bytes"), as is also very typical in computers, then you can do an OTP with a byte-by-byte integer addition (modulo 256), while decryption would use subtraction. This also works well and fulfils the One-Time Pad concept. Many pre-computer uses of OTP (with papers and human brains) worked with letters, in which the operation was mathematically equivalent to addition modulo 26 (the underlying group being, in that case, Z26, mapped to the A to Z letters).

I am not aware of any established, well-defined specification for a computer-based one-time pad, because, let's face it, for practical usages one-time pad tends to suck. We can find traces of the OTP concept in some degenerate cases (for instance, ElGamal encryption can be mathematically described as a Diffie-Hellman key exchange resulting in a shared key, which is then used to encrypt the short message to send with a custom one-time pad operating in the same group as the DH part).


Sending sensitive data over HTTPS and not sensitive data over HTTP? An idea came to my mind about using encryption only for sensitive data while transferring data.

Here's an example: When opening a web page you can see a lot of stuff that's accessible to other users. But a small portion of information on a website is user specific which needs to be protected. You send and receive this data through protected channel, all other are redirected to normal channels (non protected).

With that we can have less overhead that's caused by encryption.

Is this feasible and secure? Has this already been done?

EDIT: I understand from the comments that using two channels is a bad idea.
I got another idea: You secure the non sensitive data with computational less demanding crypto algorithm. With sensitive data you use computational more demanding algorithm which provides better security. The data is send trough a single channel.

This is a bad idea.

Unencrypted data can not only be read by a man in the middle. It can also be modified. So if just a tiny part of your HTML is unencrypted, an attacker can insert malicious JavaScript that reads the sensitive data once it is decrypted in the browser. Boom, the entire encryption is defeated.

This is also, by the way, why you need to serve your whole site and not just the login page over HTTPS.

As for your second idea, it doesn't really help anything with performance but have the same kind of troubling implications for security as your first idea. The content as a whole is not safer than the weakest link.

So why doesn't it help with performance? The main reason crypto can hurt performance is that it complicates cashing. Weaker crypto would not solve that. There might be some algorithm that is slightly faster than say AES-128 but less secure, but that would be a very marginal gain in performance that you pay for in terms of security.

And I haven't even mentioned all the work you would have to go through to separate the "sensitive" data from the "unsensitive"...

Edit: One should not be categorical... If you are e.g. programming a game you might want to send the realtime game data (who shoots what where) over something fast like unencrypted TCP, while you have a separate HTTPS connection for e.g. sending username and password to the server. But that is quite far from the HTTP webpage use case.


Should security question answers be case-sensitive? Question
In the case of security questions being used to reset an account password, what is considered best practice for handling case-sensitivity on the security question answers?

Scenario
An account password reset process I'm working on works in three steps. The first step asks the user to provide three pieces of identifiable information, including their user name, birth date, and identification number. Once they've passed that check, they are asked their security question(s) (which they set up previously). If they've passed that check, they set up a new password.

So, should we require case-sensitivity on the security question? Some internal discussion is pointing us in the direction of "no." One justification we have come up with is, say we used that same security question if the user called us as a check to verify their identity. If they get the answer right, they get the answer right. They're not spelling out the case of the answer to us verbally. So, should we do it on a web form?

I can't seem to find an "industry standard" or a "best practice", so I'm hoping to get some feedback from people with experience in this practice or from security matter experts.

"Security question answers" are akin to auxiliary passwords, which users will not use on a daily basis. Remembering a password that you almost never type is hard. Requiring exact case is likely to make the user fail to answer properly.

On a theoretical point of view, a "security question" is already a huge weakness, which you tolerate because some users will forget their password, and you want to handle that case with as much automation as possible, and not asking any security question would be even worse security-wise. Hence, the added value of security questions is that they allow a not-totally-open password reset process which can nonetheless be conducted automatically, i.e. at minimal cost for the server. Case sensitivity would probably remove much of that value. Actually, I would even recommend normalization by suppressing whitespace, punctuation and accents.


How do I associate an SSID to a device? In other words I am referring to the wlan.fc.type_subtype==0x04 filter in Wireshark while using a WiFi adapter in monitor mode.

How can I associate an SSID to an Android device (for example) if that Android device was in the past connected to that specific SSID?

Is there any tool to do that?

Can I output it in terminal (without using Wireshark)?

Well yes this is possible. Devices will send probes for any network currently in their wifi configuration, which for most users are all the networks they have signed on to in the past. So your home network for example is in the config of your mobile and your mobile will constantly probe that network while wifi is active. You just need to listen for the Probe Requests they send with Wireshark.

If you want to keep track in which networks which device has been, you need to analyze the traffic dump in order to put each device and each SSID into a DB. You can then query the DB for any given device about all the SSIDs it has been connecting with. This will allow you to track them. But there is no tool I know of which automates this.

There's also a nice tutorial for BT/Kali Linux for this: https://blog.rootshell.be/2012/01/12/show-me-your-ssids-ill-tell-who-you-are/

The only way to defend against this is disabling auto-connect on your device, so it stops sending probes randomly when you turn it on. This is also the reason you dont always get all past SSIDs from a device, because some devices do not connect automatically or only at certain intervals (which you can miss).


How does Activesync security policy affect the usage of the iOS fingerprint scanner? An Activesync IT administrator has the ability to choose if the phone should require a password, and also how complex it should be.

Since the fingerprint scanner appears to replace the traditional password screen, how does that affect an Exchange-connected phone with traditional password policies?

The Exchange ActiveSync Policy Engine gives administrators the option to allow biometrics. See http://technet.microsoft.com/en-us/library/dn282287.aspx for details.

In addition, it seems almost certain that using a PIN code or passphrase instead of biometrics will remain an option. It turns out that you must set at least a PIN when using TouchID. When you reboot, or have not unlocked the phone for 48 hours, the phone requires the PIN to unlock. See http://blogs.wsj.com/digits/2013/09/11/apple-new-iphone-not-storing-fingerprints-doesnt-like-sweat/


Is information gathering usually authorized? Is it usually authorized to run systematic information gathering tools ?
I'm talking about tools like nmap, knock, dirb and so on. I'm obviously talking about running them on public websites without consent.

On a general basis, as long as you are not using a website the authorized way, then you can assume it is unauthorized by default.

Some websites may explicitly authorize the use of automated scanning tools. A classical example of this is Nmap's ScanMe page. In this case the page clearly state the authorization and the associated limitations.

Some general websites also offer bug bounties allowing to some extend the search of vulnerability on their systems. Such website may or may not authorize the use of automated tools, this is usually clearly stated in their bug bounty details.

The "authorized" and "unauthorized" statements however have to be distinguished from the "legal" and "illegal" statements. In some cases, the first ones may have nothing to do with the later ones. In particular, before engaging in any activity which may, even remotely, be considered offensive, ensure that the explicit authorization has been issued by someone in measure to issue it and in full knowledge of any potential consequences (in particular, before allowing such use, the target must check if his hosting company allows it).

Laws controlling such activity are far more complex than one may think, even more when the scanning source and destination (either its HQ or its servers) are located in different jurisdictions. Things may quickly go wrong and out-of-hand. What if the server you were scanning crashed during your scan and the local sysadmin made no backup? Even if your scan may be technically unrelated to the crash, expect to be designated as the main responsible for all the damages and the associated losses.

In doubt, either contact a lawyer before doing anything or abstain.

As a side note, you remain free to scan your own devices on your own network. Simply using virtual machines in your own LAN is usually enough for most personal tests.


Thousands of 28000 "no pg_hba.conf entry for host" logs from Postgres - is this an attack? Since yesterday afternoon my production Postgres database hosted on Amazon EC2 has been logging thousands of errors (averaging one or two per second) that all follow the format:

sql_error_code = 28000 FATAL:  no pg_hba.conf entry for host "xx.xx.xxx.xx", user "postgres", database "postgres", SSL off

The host address is very different every time; none of the four numbers are consistent. Since "postgres" is commonly the default user and database name for Postgres, this seems like it could be be an attempt to find low-hanging fruit for data theft.

My webapp which uses the database is working fine and isn't reporting any abnormal latency, and I haven't pushed any code changes over the last week, so I'm pretty sure it's not me.

Does this follow the pattern of a hack or DDOS-like attack? If so, what's the likelihood that it's targeting my database specifically?

If it helps, the URL to my EC2 instance is not public, I've never shared it anywhere.

I've seen the same behavior in a few of the apps I manage. I also saw this tweet - https://twitter.com/testflyjets/status/1102410441723015168 - so I don't think these are targeted attacks, but rather an un-targeted effort to find vulnerable Postgres databases.

Most of the attempted connections were with the username "postgres", but I also saw attempts with "root", "pgsql" and "pgbouncer".


New EU Data protection Law and small businesses I'm aware of the new EU law changes regarding data protection. As a security consultant for an IT company who manages multiple other companies systems, i was hoping someone might be able to clarify a few things for me.

1) I'm aware that the new law can impose a 5% of annual turnover fine up to 5 million pounds on a company found to not be taking adequate measures to protect their data. Does this also scale for smaller businesses who hold ~100 clients? And would this fine be as severe for say a ~5 employee company who sustained a leak of information?

2) How does this scale in with a smaller companies budget, for example things like data encryption is cheap, however more comprehensive anti-malware systems and IDS/IPS systems are more expensive, how does this requirement scale for a smaller company who can't afford to spend thousands on this?

Thanks for any insights/clarification.

The data protection law requires companies to protect personal information in a reasonable secure way. The fine is scalable as it depends on the company's annual turnover. It's a bit more 'fair' than on a per-employee basis (e.g. a 5 man company can have 100k but als a 5 million euro turnover).

First of all note that this is not entirely new, so if you are suddenly thinking about data protection, you are probably not compliant with local regulations.

Data protection acts have existed for several years, the issue why a European DPL was created was mostly affecting larger companies with entities in different countries who all had their own set of laws with regard to DPP. There are more advantages for companies who were already complying. The companies who will have issues  are the ones who are currently not complying with the DPL.

The advantages for companies are:

One continent, one law: The Regulation will establish a single,
pan-European law for data protection, replacing the current
inconsistent patchwork of national laws. Companies will deal with one
law, not 28. The benefits are estimated at €2.3 billion per year.
One-stop-shop: The Regulation will establish a 'one-stop-shop' for
businesses: companies will only have to deal with one single
supervisory authority, not 28, making it simpler and cheaper for
companies to do business in the EU; and easier, swifter and more
efficient for citizens to get their personal data protected.

The one thing a lot of companies are worried about is this:

European regulators will be equipped with strong enforcement powers:
data protection authorities will be able to fine companies who do not
comply with EU rules up to 2% of their global annual turnover. The
European Parliament has even proposed to raise the possible sanctions
to 5%.

Companies who are worried about this are mostly companies which are part of a European country who do not have strict or not enforced data protection regulations.

The directive doesn't require you to purchase expensive hardware, it requires you to have controls in place to, within reason, make sure you are adequately protecting your data. This is quite broad and leaves it open for interpratation (mostly not by you, but by a judge). IDS and IPS needn't be expensive. There are free open-source based HIDS as well. It's up to you to perform a risk assessment and see what software/hardware you will need based on the chance that a threat might materialize.

It will require companies, also small once, to think about data governance and how they manage access to certain personal data. It also gives incentive to remove personal data once it's no longer required. The directive serves as a reminder and incentive for companies in general to think about their data security and what the consequences might be.

Small to medium size enterprises will be excempt for certain requirements:

Data Protection Officers: SMEs are exempt from the obligation to
appoint a data protection officer insofar as data processing is not
their core business activity.
No more notifications: Notifications to supervisory authorities are a
formality and red tape that represents a cost for business of €130
million every year. The reform will scrap these entirely.
Every penny counts: Where requests to access data are manifestly
unfounded or excessive, SMEs will be able to charge a fee for
providing access.
Impact Assessments: SMEs will have no obligation to carry out an
impact assessment unless there is a specific risk.

The rules will also be flexible. The EU rules will adequately and correctly take into account risk. In a number of cases, the obligations of data controllers and processors are calibrated to the size of the business and to the nature of the data being processed.


Checking for installed background processes in my phone I came from Russia recently. The security officer asked me to open my phone. When I handed it over to them, I saw there was a black screen with Russian writing on my phone when the officer was checking it.

How do I make sure there is nothing running in the background?

In all honesty, there's no way to be sure, other than by getting a new phone and deleting any iCloud backups that exist of your old phone. Restoring your iPhone to factory settings is a way to be reasonably certain, but if they've installed something on your phone, chances are that they don't want you to find out about it or remove it.


Encrypt a file in the server and decrypt it in the client without risking the user accessing it? How can I send an encrypted file from a server to a client, encrypt and use it in the client without risking the user to access it?

I saw an answer where the server saved a file in its memory, and thought that I maybe could use the same idea but for the client. Namely, use the file directly without saving it. Although, I'm not sure if this is safe or even possible to do.

This question was orginally posted on Stackoverflow but I was told to post it here instead.

You can't do this securely. You're running into the same problem that DRM systems do. The user owns the system, so any data that goes onto it can and will be read by a determined user no matter how many safeguards you put in place. You can put the data in memory and avoid hitting disk, but the user can just dump the process memory (Spotify's DRM was originally bypassed this way).

As an example, BluRay DRM uses High Definition Content Protection (HDCP) to prevent users from ripping content. The data on the disk is partially encrypted (only some lines in each frame get encrypted, the rest is cleartext to allow low-res playback on non-HDCP devices) and only gets decrypted by a special piece of dedicated decryption hardware in the monitor or TV, which prevents you from just capturing the HDMI output. This is a complicated end-to-end encryption scheme where the computer, BluRay player, games console, receiver, and any other intermediate hardware does not have access to the decrypted data. Regardless, a few dedicated people got together and worked out how to break HDCP and leak the decryption keys, so now you can rip the media. The same thing happened with the Xbox 360 and the PS3. Regardless of how much time and money you spend on these solutions, you're never going to beat a few dedicated researchers.

If you only need to do some very specific operations on the data (e.g. multiplication, addition, or xor) without revealing the value of the encrypted data, you could use homomorphic encryption, but such schemes are largely still at an academic stage rather than something you can rely on for production systems.


How to generate a highly unpredictable random bytes void
 vncRandomBytes(unsigned char *bytes)
{
int i;
unsigned int seed = (unsigned int) time(0) + getpid() + rand();

srand(seed);
for (i = 0; i < CHALLENGESIZE; i++) {
    bytes[i] = (unsigned char)(rand() & 255);
}
}

Can above code consider a secure random string genarator?

No, sorry, your generator is awfully bad. You seed it with values which do not have much entropy (the PID fits on 16 bits...) or are highly guessable (the "current time" is not exactly a secret value, everybody can know it with remarkable accuracy). And the generator hiding under rand() is known to be breakable (it depends on the actual operating system, but many system use a linear congruential generator which can easily be inverted).

You will get something which vaguely looks randomish at first sight, but will not resist successfully attempts at cracking it, i.e. predicting future output of the generator. Resisting cracking attempts from smart attackers is all what security is about. Your generator might be appropriate for some non-security-related usages, though (although rand() is known to be quite bad at those too).

For correct random number generation, you need:

an initial seed with enough entropy;
a cryptographically secure PRNG which will expand that seed into a long stream of bytes which will be indistinguishable from randomness (even in the eyes of a smart, powerful individual with big computers who is intent on predicting the next random byte).

The initial seed must come from some hardware events ("physical" randomness), because software is, down to the transistor level, deterministic. The operating system is in ideal position to gather physical events (that's its job, after all). Therefore, use the OS. This means:

On Unix-like systems (like Linux, FreeBSD, Solaris, MacOS X...), use /dev/urandom (not /dev/random; see this answer for details).
On Windows (Win32), call CryptGenRandom().
On Java, use java.security.SecureRandom.
On .NET, use System.Security.Cryptography.RNGCryptoServiceProvider.


SSL - Enabling Forward Secrecy with or without RC4 I'm running an Apache 2 server with Ubuntu 16. Here's my current configuration:

SSLProtocol All -SSLv2 -SSLv3

SSLHonorCipherOrder on

SSLCipherSuite

I'm a bit confused as to what I should use for SSLCipherSuite. I'm taking it from this article here: https://www.digicert.com/ssl-support/ssl-enabling-perfect-forward-secrecy.htm

Should I configure it with RC4 or without RC4?

An SSL technician told me that "with RC4" is very weak. I'm wanting to confirm and see if there are other things I should know about it.

Questions:

What is the different between "with RC4" vs "without RC4" and the pros and cons of each?
Which one should I use?

Thanks!

Should I configure it with RC4 or without RC4?

Definitely without. From Wikipedia:RC4:

  As of 2015, there is speculation that some state cryptologic agencies may possess the capability to break RC4 when used in the TLS protocol. IETF has published RFC 7465 to prohibit the use of RC4 in TLS; Mozilla and Microsoft have issued similar recommendations.

Apart from that you best use the Mozilla SSL Configuration Generator to generate an appropriate TLS configuration for your setup.

  I'm taking it from this article here: https://www.digicert.com/ssl-support/ssl-enabling-perfect-forward-secrecy.htm

While I cannot find any date when this article was written it is a shame that DigiCert has still such an article online which explicitly promotes the use of RC4. At least the information regarding RC4 in this article are outdated and following this article would lead to insecure configuration.


Can you fake the Host attribute of a C# URI? I was wondering if you can fake the Uri.Host value of a string. For example, given the following code:

new Uri(url.ToLower()).Host == "example.com"

Is there anyway to have this boolean comparison be true, but at the same time the URL go to a different server than example.com?

There's no intentional or known way, and probably (hopefully) no way at all. If there were, it would be a very serious bug in the .NET framework.

However, note that this only guarantees that the host is actually example.com; it doesn't guarantee that traffic for this URI destined for example.com will actually make it there without interception.


Android APK analysis I got a suspected .apk file which seems to steal my data and send over internet. I want to analyze its traffic. Do you know which tools are suitable to check behavior of this .APK file or check its traffic?

There are a few options that could come in handy. Our aim, I assume, is to monitor the traffic of this app:

Route phone traffic through a proxy or analyze traffic. One option for analyzing traffic is using Wireshark. Or you could manually set your phone to route through a proxy like Burp sitting on a specific IP and port.
If a lot of apps are connecting to the internet, it might be tough to zero in on just this app's traffic (not too difficult, but tedious if the not experienced with the proxy/MITM tool). In this case, use an Android emulator and debug/analyze traffic just for this app.

Using an emulator could be a quick fix if you're ok with it not dealing with real-time phone data (is it fudging with my Facebook data?), but make sure your choice of emulated ecosystem is right.


A scammer placed a remote file on a Wordpress website? A previous developer I have used has got upset and start compromising the files of my website on daily bases (such as changing the index of the site with weird messages, deleting the .htaccess, renaming folders, modifying DB tables). I suspect while he was working on the site, he placed some where in the files option to get remote access to the website's files?!

Because of this I have:

changed the FTP user/pass/DB pass
blocked the access from his country's IP range using .htaccess...
backed up the entire DB and the FTP files
the permissions of the files has been chmod to 644 & 755 (as required)*

This morning when I woke up and try to access my site, I was shocked that access to my site was denied...lol. When I checked the files I have discovered that he modified the .htaccess and placed "allow from" his IP and "deny from" my IP.

Any suggestions on how to solve this hassle would be gladly appreciated.

* I can search with grepwin for any malicious scripts/files/lines/words in the backup files I have, if I know what to look for.

Sounds like he has a PHP backdoor as you suspected. There is very little you can do to be sure that you have completely removed all traces of the attacker's presence. He might have multiple backdoors, he might have scripts that email him new FTP passwords, he might even have a Windows rootkit installed. The only real solution is to reformat the machine and revert to a backup.

However, if we are working on the assumption that you do not have a backup, and that your attacker is lazy and is just relying on a PHP backdoor, then you would want to grep your entire docroot for things like;

system exec passthru shell_exec proc_open popen fopen fwrite

Of course, your attacker might be using a backdoor written in something other than PHP, which is yet another reason this whole process is fairly meaningless. Nevertheless, you might just be able to kick him out.


Would a multilingual Diceware password be more secure than a monolingual one? I've been reading up on Diceware recently, and I'm wondering if using a mix of languages would make it even more secure. On the face of it, it would force a potential attacker to consider an even larger search space, even if they know that you speak e.g. English and French. Using even more languages would increase the search space further.

The main issue I can see is usability. Would this be harder to remember than a monolingual passphrase, and would the difficulty of remembering your passphrase depend on your level of fluency in that language?

Using different languages together would increase the entropy, however that would defeat the main objective of Diceware - which is easy to remember passphrases (that are also secure).

Each Diceware word adds ~12.9 bits of entropy. The NIST recommendation for secure passwords is to use at least 80 bits of entropy. Therefore it would be much easier to simply use 7 different words from the Diceware wordlist and have the same security.

As a guide, it would take a determined attacker 109,527.95 years to run through the whole keyspace of an 80 bit password, which would give an average cracking time of 54,763.975 years.


PGP: How is it possible for me to read a sent mail, encrypted by me with the recipient's public key? I'm quite new to OpenPGP and am just starting to use it with Thunderbird.

When I encrypt a mail with a recipient's public key, using Thunderbird + Enigmail + OpenPGP, and send it, I can find the encrypted mail in my sent-folder. It is possible for me to decrypt (happens automatically) and read it, which is fine, but I wonder; how is this possible? Isn't this ciphertext only decryptable with the recipient's private key? Is it also decryptable with any of my keys (my public or private key)?

In the normal Thunderbird configuration, the emails are stored the way you send them, so if you send an encrypted email, it's also encrypted in your sent folder. (Note: there may be a way to configure Thunderbird or Enigmail differently, I don't know much about their configuration possibilities.)

Enigmail has an “Encrypt to self” preference (in the Sending tab; extensions.enigmail.encryptToSelf), which is on by default. With this preference turned on, all the emails you encrypt are encrypted for you (with the key configured in the applicable per-identity settings). Unless you've configured Thunderbird in an unusual way, this is what you're observing.

The underlying OpenPGP/GnuPG implementation can be configured for this as well, with the encrypt-to option in gpg.conf.


How do I find .asmx files? I have a web service (ASP.NET) running on my application server. It can be reached via
http://xxxxxx/Servercomponents/servercomp.asmx

Is possible to find this even if you don't know the file name and directory location? Could you scan for it with e.g. nmap or wget? Or could a spider tool like skipfish find it?

Brute-Force

Scanners can brute-force guess the names of files and find it that way, although if the names are non-standard, it might take a while.

Spidering

If the asmx is linked to by another page that is discoverable (like index.html), then a spider will find it easily.


How to track down an IP spoofer? We just installed a SonicWALL NSA 3500 and I've noticed a few times per day there will be an alert entry like this:

Time: 01/02/2013 9:00:41.000

Priority: Alert

Category: Intrusion Prevention

Message: IP spoof dropped

Source: 173.115.237.234, 123, X0  (My note: nslookup tells me it belongs to some Sprint/PCS network, but the X0 interface is our LAN-facing interface.  I also see 10.0.0.4 here sometimes with the same MAC address, and we don't have a 10.0.0.0 network.  It's always that same MAC address!)

Destination: 192.168.x.x, 123, X0 (My note: This has shown as a few of our internal servers' IP's)

Notes: MAC address: 00:b0:d0:74:13:74 (My note: Appears to be a Dell MAC address, but doesn't match any of our known Dell computers on file)

When I perform an "arp -a | findstr 74-13-74" on my Windows PC I don't show that MAC address in my ARP table.

Is there a way I can track down what this is?  We do use SonicWALL's SSL-VPN to tunnel into the X0 interface, maybe somebody uses a Sprint aircard and something is messing up?  Maybe we have some malicious device somewhere?  I'm very open to suggestions, this is puzzling me.

If I were you, I'd port mirror, tap, or hub that network attached to the firewall and use accurate packet capture, such as "tcpdump -vvenXs0".


Can you add random useless code to a virus to change its hash so that no 2 users have the same hash? I'm not sure how antivirus software works exactly, but from what I understand it just checks the hashes against its database of known viruses (how it decides that something is a virus is a different story).

So is it possible that an malicious site would add some random useless code to its virus so that when it compiles the code into an executable it'll always have a unique hash, thus the antivirus would not have a hash reference for it?

If so, why isn't it done, and what's the point of antivirus software that works using only hash comparison?

Antivirus is only ever going to catch broad attacks, or default payloads from commonly used tools.

A skilled attacker will be able to modify, encode, or obfuscate his payload to avoid this type of detection.

That being said, most antivirus will also search the executable file for strings known to only be found in the malware. For example, here is a snippet from Invoke-Mimikatz.ps1:

$e_res2Field = $TypeBuilder.DefineField('e_res2', [UInt16[]], 'Public, HasFieldMarshal')

Antivirus can search for strings like this within the file, and then flag it if it detects a match. This can also be defeated fairly easily. One example would be to take the file and break it up into small strings. Like this:

"$e_res2Fi" + "eld = $TypeBui" + "lder.DefineField('e_res2'," + " [UInt16[]], 'Public, HasFieldMarshal')"

(not trying to be syntactically correct here, but you get the idea)

And then use a wrapper script to piece the strings together in memory and execute the original code.
Another more common example would be encrypting the primary payload and then have a stub decrypt and execute the payload in memory.

Some antivirus will also conduct dynamic analysis, where the file is ran in a virtualized or simulated environment to detect the actions that the executable would perform, or to analyze post decryption memory.

This type of antivirus can usually be bypassed simply by consuming enough of either time or memory before decrypting the primary payload.


If I create a website using a VPN, am I safe from law enforcement finding out I made the website? If I created a website online using a VPN, can law enforcement still find out I made the website? What other forms of identification could potentially give away that my computer made this website, and how can I protect myself from that? The VPN I use does not carry logs (PIA VPN)

Under the assumption that the blogging service provider doesn't request any personal identifiable information from users (or doesn't check the correctness of the information it does require) and that the suspect only accesses the website from a VPN, the blogging service should not be able to deanonymize the suspect.

But there are two other paths which could be used to deanonymize the suspect:

Following the money. Did the suspect pay for the service? Did the suspect make any money from the website (advertisement revenue, for example)? Then that money must somehow come from / go to their personal banking account. In most places of the world, banks must cooperate with law enforcement.
The VPN provider could assist in finding the suspect. A VPN is not an anonymity panacea. It just shifts the trust from the ISP to the VPN provider. If the VPN provider gets a subpoena forcing them to deanonymize the suspect, they can and likely will do that.

  What other forms of identification could potentially give away that my computer made this website?

When someone gets physical access to the suspect's computer, there are several ways to notice that it was used to create the website. For example:

The password might be in the password manager
The admin portal might be in the web browser history
A cached version of the admin portal might be in the web browser cache

Using full disc encryption can protect their privacy, unless the attacker acquires the computer while it is running or they can force the suspect to reveal the decryption password.


Sql database password encryption opinion needed I am trying to understand if my database password encryption structure is good, or not much use.

So when i register, the php will generate a 50 character random key, and that key will be put into a db table called hash tagged against the user id, then the hash will be used to AES encrypt the password and the password will be stored in another table.

When a user login, the hash will be pulled out and use for decryption. And if the login is successful, the hash key will be replaced with a newly generated one for next use etc.....

I am not sure if this is good idea or not, any feedback is good thanks!

No, this is not a good idea!
As Lukas pointed out in an comment, you want to hash a password, never encrypt it!
With your schema, it would be possible to get the plaintext passwords from an database dump without any effort. Don't let that happen!


Encrypted data at rest when decrypted I was reading about encryption and had a question about it in general.
If I have a laptop with an encrypted SSD which I decrypt on boot up, it means it is all in plain text/data right?
If I do a hard shutdown or snatch that laptop while running, it means that the confidentiality of my data on that disk isn't ensured? If so, are there any safeguards on how to prevent attackers from reading the data?
That means encrypted data at rest should only be decrypted when needed.
Am I correct in this thought?

The way hard disk encryption usually works is that the data stored on the disk is always encrypted.  When you boot the system, the decryption key is loaded into memory by the kernel and when data is read off the disk, it is decrypted.  As data is written back to the disk, it is encrypted first.  Therefore, there is usually never any data on the disk that's unencrypted (unless you have an unencrypted partition), so a hard shutdown is not a problem for security.
However, if the machine is powered on and booted, then the key is in memory, and data can be decrypted.  This is usually true even if the system is suspended (but not hibernated).  As mentioned by multithr3at3d, this data can often be recovered from memory for a few minutes after the machine is powered off.  Beyond that, the key is usually not recoverable, and the data is safe.
If you know you are about to go into a risky situation, such as when passing through customs, you may wish to power off your machine reasonably well in advance to protect its data.  If you do an urgent forced shutdown, your data will probably be unrecoverable unless someone can open the laptop and extract the key relatively quickly; it's far better to do that than do nothing.  Similarly, if you're concerned about a snatch-and-grab, power off (or on Linux, hibernate) your machine before traveling with it.
If you have especially sensitive data that you do not normally want to be decrypted when using your laptop, then put that data on a separately encrypted partition and decrypt it only when you need to.  This makes it much more likely that if a rogue process or human intervention compromises the system that your data won't be accessible.  Most people using an encrypted disk are willing to accept the fact that all data can be decrypted when the machine is on and so don't feel the need to do this, but your circumstances or level of comfort may dictate otherwise.


Why timestamping chain is better than "code signature" chain? Timestamping is recommended as the way to prolong signature validity after its certificate expiration date. One just need to add new timestamp signature before previous timestamp is expired.
But what's the purpose of introducing special kind of signature if you still can do the same with main signature resigning data with fresh certificate while the last is alive?

Timestamping is a special kind of signature already.

TS = Sign(Hash(info | X) | time)

The renewal is :

TS' = Sign(Hash(TS | info) | time)

Of course, you could sign the original info with the new certificate and not using this technique. But this sometimes might not be possible or practical. For example when dealing with a contract, you would want to prolong the validity without having the party to meet again. Furthermore, the timestamping prolongation also ensures that the content of the original document remains the same during the procedure.

See source


What does "revoking" a key actually do? I am currently encrypting some personal information using gpg (gpgdir actually). I have a copy of my private key printed onto a sheet of paper in the form of a data matrix lest I lose the digital copy of my private key.

However, in reading up about encryption best practice I've often come across the notion of "revoking" my key. In gpg, I can generate a revocation key using gpg --gen-revoke KEY, which can later be used to "revoke" my key.

But what does that actually mean? And how is it useful? I have found a plethora of information online about how to revoke my key and generate revokation keys, but none on what actually happens when I "revoke" my key.

Is this functionality useful if I am the only intended user of the encrypted data?

Think of revoking a key as a comment added to the key file. This comment, if present, will tell others users of your key (someone that send you encrypted gpg emails for exemple) that the key have been revoked and that they shouldn't use it !

Revoking a key is only useful when you send it on key servers, to make others know it's revoked.


How to communicate with a random service after a successful netcat connection? Let's say I perform a nmap scan and discover a list of open ports.

If port 80 is opened, I will do this:

$ nc IP_ADDRESS 80
GET / HTTP/1.0

This will be a simple HTTP protocol request.

But what about other ports? Let's say I found a random port like 51236 is open.
How do I communicate with it after a successful netcat connection?

You would need to communicate with commands that this service can handle. Let's say that you manage to connect to an open SMTP port, you would need to use SMTP commands (HELO, EHLO, MAIL FROM, RCPT TO, etc.) to interact with it. Same thing if you connect to a MySQL port, Redis port, etc.


Are there consumer-grade VPN services that support two-factor authentication, like SecurID? I'd like to increase my VPN security, and Google hasn't turned up anything with regard to VPN services and SecurId.

Does anyone know of services like this?

You could roll your own easily for cheap or free using Amazon's micro EC2 instances (http://aws.amazon.com/free) and our free two-factor auth from Duo (http://duosecurity.com) - either SSH-tunnelled (e.g. ssh -D 1080 my.ec2.host and set your local SOCKS proxy configuration to localhost:1080), or else using OpenVPN, etc.


Is it a good idea to expire passwords after a time relative to their security? If a user has to change their password ever so often, is it a good thing to check it against zxcvbn or similar library and assign a expiration date relative to the risk of the hash being cracked?

No. Password expiration is not to protect against hashes to be cracked. Password expiration is rather to prevent that a hacker does not have unimpeded access to a previously compromised account - that was compromised lets say due to shoulder surfing.

If a hacker does have such a access to a system so he could obtain the password hashes, it often means the hacker has sufficent access to the system in question so the hacker wont need to authenticate.

I would suggest instead using variable expiration times that is in sync with access level. Eg, a regular user that does not have access to anything except a workstation with internet access, can have a password with less requirements and no expiration.
A medium user that has access to some confidential data, could for example have a stronger password policy and expiration lets say each 6 month.
And limited/local sysops/sysadministrators then have a even stronger password policy and password expiration after 90 Days.
And global administrators could simply have the strongest password policies and 30 Days of expiration.

If the system in question is custom one, for example a custom web interface or such, you could code that the password expiration and complexity requirements is directly derived from the encoded access level for the user in question.
(And of course, you could create a complexity factor out of password length and complexity, allowing a longer password to replace a complex one and vice versa)


How secure is a virtual machine and free VPN? I'm running a windows 8.1 machine. On it I have bitdefender free av and Malwarebytes free that I scan occasionally. When I think a site may be sketchy to go to, I start my cyberghost VPN free version then start a virtual machine through virtualbox of a trial win 8.1. On that it has bitdefender free av and Malwarebytes premium trial. Typically after going to the sketchy site I reset the modem and router after closing the VM then closing the VPN. Is this over kill? Or is this not enough? I feel like the set up is pretty unpenetrable but I'm also starting to question that. Is it possible to infect my network by going to something sketchy even with this protection? Others use this network that's why I'm asking. Are there any suggestions of what else I can do? I started doing this because I was watching videos on reverse engineering viruses and they said to do it in a vm. Any help is appreciated, thanks.

EDIT
I use chrome browser with ublock origin. When I use the virtual machine I have several snapshots that I revert back to after usage (several because after Malwarebytes premium trial ends I revert to before install, change Mac address and install again). My primary concern is I don't want malware or to infect my network, I'm not super concerned about privacy (meaning I understand a free VPN can still sell my info potentially) I just use the VPN to hide my network from malicious sites, is this not right?

I feel like the set up is pretty unpenetrable but I'm also starting to question that

Never assume you're invulnerable. It's probably good to be paranoid, but you should define the threat first. What are you worried about getting?

  On it I have bitdefender free av and Malwarebytes free that I scan occasionally

This tells me you're worried about malware, right?

Let's look at what you're doing:

  I start my cyberghost VPN free version then start a virtual machine through virtualbox of a trial win 8.1

This is wrong. You should be starting the VM, taking a snapshot of the VM, then starting the VPN from inside the VM before browsing to the site. Then, when you're done with the "sketchy site," turning off the VM and restoring the snapshot to a previous time.

This effectively wipes the virtual machine back to the state before you went to the site. "Like it never even happened."

  Typically after going to the sketchy site I reset the modem and router after closing the VM then closing the VPN. Is this over kill

This is pointless in terms of securing your machines after "visiting a sketchy site." It's more important that your VPN provider does not keep any logs of personally identifiable information. See also: Which VPN Services Keep You Anonymous in 2017?.

A VPN hides your current address. It does not provide security against viruses. Your router is simply a connection upstream. If your VPN collects info on you, resetting your router is pointless. It's also not relevant.

  Is it possible to infect my network by going to something sketchy even with this protection

Yes. Zero day flaws in the operating system make everyone vulnerable. Spear phising and other targeted attacks make you vulnerable. Your humanity is probably your weakest link, but if you're not the active target of a state or bad actor, you probably don't have to worry about this. If you are keeping your hypervisor, operating system and VM operating system up-to-date, you should be pretty well protected.

I also seem to notice that you don't have security installed on your VM? THis topic is a bit of a holy war right now since AV increases the attack surface and relies on hooks in the OS, many people think that 3rd party AV is a bad idea. Still others highly recommend it (Lawrence Abrams from bleepingcomputer.com did an interview with Leo Laporte on TWiT stating he thinks people still need it).

You should (at least) be running Windows Defender on the VM.

You fail to mention what browser you're using... right now Chrome appears to be the most secure, but you should have uBlock origin, https everywhere, and privacy badger running in it... in the VM.

Still one other thing you can do if you're really paranoid ... Tor Browser on top of the VPN with all those add-ons.

But quite honestly, you could very much simplify your life by getting an old laptop, and running Tails from a USB stick from your local Starbucks. Of course, the sketchy site must really be appetizing to make you want to leave the house. But then again ... security is diametrically opposed to convenience.

You could always just ... not visit the sketchy site too.


Do Linux systems need antivirus against ransomware? I use Linux to store private data and backups for my team because it is said that Linux is itself very secure from malware and doesn't need antivirus.

But now as ransomware is spreading and has started affecting business PCs that run Windows, so it won't be too long that a new variant of ransomware is released or there might already be that can affect Linux systems also.

I don't want to risk our data getting encrypted by ransomware just for bitcoins. Do Linux systems need anti-virus now for protection against this threat?

There are actually multiple parts of the question:

Is Linux affected by malware and especially ransomware?
Do antivirus products exist for Linux?
Do these products help against this threat?

To answer the first:
Yes, there is malware for Linux and there is also ransomware. Currently it is usually propagated in a different way compared to Windows: Malware on Windows is mostly distributed by phishing mail and web and makes use of platform specific vulnerabilities and features, i.e. currently mainly windows scripting host, macros in office documents and vulnerabilities in Office. On Linux systems instead it is usually installed by attacking the server, often by using security issues in Wordpress and other CMS. But this is mainly because server use of Linux is large while desktop use is still rare. The capabilities and vulnerabilities needed to spread ransomware in a similar way to Windows do often exist on Linux too although some differences (like the need to explicitly set the permissions of executable files) make some exploits harder.

As for the second, i.e. are the antivirus products for Linux:
There are both free products like ClamAV and commercial products available.

And finally, do these antivirus help against malware/ransomware targeting Linux?
They mostly don't. These antivirus products care mainly about protecting against attacks targeting Windows and are usually used to scan files or mails which might be served to Windows systems. Thus they are for example useful on a mail server or file server and also on a web server to make sure that the server is not used to spread malware. But they don't even protect fully against attacks targeting Windows. They might have some code in it to detect some well known (and sometimes only proof of concept) malware against Linux but they will not protect against new things. There are also products which scan for traces of existing system compromise and sometimes these are called antivirus but often not.


Theoretically, what are the best "reverse social engineering" methods for your password, and how good would they be? I just saw this SMBC comic: http://www.smbc-comics.com/index.php?id=3955

I realize that this is not actually "reverse social engineering" as typical usage of the term. However, I'm wondering in theory how effective a method like this (or a variant thereof) would be.

Specifically, I'm wondering how effective it is to leave some sort of message (or perhaps code?) inside your password so as to deter hackers from actually using your password. Is there a way to make this have some utility, or is it just completely silly?

It is pretty completely silly, if we ignore the lowest level of those capable of retrieving your password (e.g. your teenage kid).

For anybody else - they are unlikely to ever see your password with their own eyes, since the whole exploit process is typically scripted, if not fully automated.
So the whole usage scenario would be moot regardless.

And, hypothetically, what could you possibly say that would deter criminals from doing criminalish activities? E.g. even see the votey image... Perhaps "ImBatmanAndIKnowWhereYouLive".

And yet another aspect to consider - if that statement was really so powerful, it would still not be useful: there is the downside that the password owner still needs to be typing in his password, and the maternal disappointment effect would backfire.

That said, I did find it amusing, but @Zach is a very smart guy, so I don't think he meant it to be taken seriously in any way.


Randomizing MAC addresses on bootup Since it is possible to set custom MAC addresses, wouldn't it make sense to have a new one as often as possible/convenient (i.e. on bootup)?

It would seem that is useful to both attacker and victim (harder to log/less problems with undirected attacks). Is that the case? If it is, why isn't everyone doing it?

MAC addresses are link-local only. Most attacks don't (have to) come from the same subnet, so most rely on higher-layer addressing. Changing your mac address does little to hide you.

There are a variety of problems with changing your MAC address often. One, off the top of my head, would be that DHCP reservations wouldn't work. It could be marginally less efficient for switches. Also, it makes troubleshooting marginally more difficult; the first 24 bits of your MAC address identify the hardware vendor, and programs like Wireshark helpfully decode this into a friendly name. That would be nonsense for a random address.

Attackers may want to change their MAC addresses, but that's a very different (and very specialized) circumstance.

But mostly, I just don't think it's that useful.


Why is DNS-over-HTTPS such a big security nightmare compared to DNS-over-TLS? I've heard the argument against DNS-over-HTTPS that it is supposed to be a security nightmare for network defenders because it enables encrypted DNS over port 443, compared to DNS-over-TLS which goes through port 853.
I don't understand this argument because, how is malicious traffic on DoH practically more difficult to detect and block than, say, a VPN connection over port 443 or a proxy connection via HTTPS over port 443? If you're a network defender, and you allow third-party VPN and proxy connections in your network, why would DNS-over-HTTPS make your job any more difficult than it already is, and why would DNS-over-TLS be so much better?

Again, it's all about the threat model!
Technologies are just technologies and can be used both for good and for evil. DNS over HTTPS (DoH) intends to solve the privacy concerns there are with unencrypted DNS, whereas DNSSEC can solve the integrity concerns without a need for encryption. Together with DNS over TLS (DoT) they are all fighting the threath of a malicious network operator that spies on your DNS traffic or forges responses.
On the other hand, both monitoring the DNS traffic and forging records can also be used for good intentions like detecting and blocking malicious traffic that is depending on DNS resolution. This is where solving these technical threats can actually decrease overall security, especially on corporate networks. The threat models of an organization are naturally different from the threat models of any individuals working for the organization.
Not so easy to detect
It's true that being unable to block DoH is rather irrelevant, if VPN connections are allowed. On corporate networks VPN connections (as well as DoH) can be either forbidden by policy (weak) or blocked by TLS inspection (efficient, but sometimes illegal or requires special privacy considerations).
Compared to DoH, DoT is easy to block, as it has a dedicated port 853 (tcp&udp) per RFC 7858.
For more detailed insights on the subject I'd recommend: Drew Hjelm: A New Needle and Haystack: Detecting DNS over HTTPS Usage (SANS Institute 2019). It also has some examples of the real security issues:

2.3. Public Threats from Encrypted DNS
Organizations need to start evaluating the risk associated with the
DoH protocol because attackers have already begun using DoH to look up
command-and-control (C2) servers. The best-known example of DoH as a
C2 mechanism came in April 2019 with the Godlua backdoor (360 Netlab,
2019). A newer variant of the Godlua backdoor runs on Linux and
Windows and uses a DoH request to grab a part of its C2 information.
Another way an attacker could use DoH in an attack is to trigger a
redirected webpage as part of a spam campaign. Researchers at
MyOnlineSecurity (2019) found a sample where an email attachment had a
Base64 encoded string that would query Google DoH for a TXT record.
The TXT record would have a JavaScript redirect to a spam webpage
whose address often changed.
Numerous DoH C2 proofs-of-concept are publicly available, meaning that
the threat of malicious actors using DoH is likely to increase soon.


What is the purpose of anti-rollback protection in IoT devices? The OWASP IoT top 10 and the ASVS appendix C warn to protect against firmware rollbacks:

C.22 - Verify that the device cannot be downgraded to old versions (anti-rollback) of valid firmware.

What is the purpose of this? In what scenario does this offer protection? Is this supposed to protect against accidental installation of old firmware, of a user hacking his own device, or of an attacker installing old firmware and then exploiting a vulnerability in it? Isn't the device already totally compromised if the attacker can install old firmware?

It is to prevent the exploitation of old vulnerabilities which have been fixed in newer versions.
Assume that there is a web interface which allows installation of new firmware versions and some configuration.
There also is a vulnerability that allows root access to the device and full control in V1.
As responsible vendor, of course you produce V2 very fast and automatically update all devices OTA.
But if Mallory is in the internal network at your customer, he could just use the webinterface of the device to downgrade to V1, gain root access and then update back to V2.


What can happen if my Flask SECRET_KEY becomes public? I use OpenID Connect to let my users login. What could happen if Flasks SECRET_KEY becomes public?

If the openid connect relies on flask's session manager, then the session cookies are predictable.

Flask uses the SECRET_KEY for session management, so if I know you SECRET_KEY, I can make a bogus session cookie and impersonate another user, even the admin user.

https://github.com/pallets/flask/blob/1351d0a56580df36872b466eb245e7634c20dab5/src/flask/sessions.py

This seems the only place SECRET_KEY is used in the source code. I went to github and searched for SECRET_KEY and this is the only code that uses it. The rest of the 15 references were docs, tests, or configuration files.


Remember me feature: do we need a server side token if the cookie is signed by the server? Every resource I find (I, II, III) about how to implement in a secure way the typical "remember me" login feature, recommends storing a user identifier and an associated unique token in the cookie, and then the hashed token associated to the user in the database. This way we are safe of:

User impersonation. Should we store remember_me_user_id=93 in the cookie, it would be quite possibly to log in as admin crafting a cookie with remember_me_user_id=1. Adding the unique token to the cookie prevents from that.
Timing attack. The user identifier is used to look up the user, so the time elapsed is indifferent because it is searching but not authenticating. Should we look up by the unique token, the time information could be used to craft a valid token character by character.
Rainbow attack. The token is stored hashed in the database, so if the table information gets compromised it is useless.

But what about if we just store the user identifier in a cookie signed using a server secret? As far as I see, it prevents from the very same kind of attacks:

User impersonation. The cookie is signed, so an attacker can't craft another valid one without the server side secret.
Timing attack. The cookie is signed, so the attacker can't create it step by step.
Rainbow attack. No token stored in the database, no worries.

And, as far as I see, it has the same dangers that the cookie with the token:

You have to trust that the browser will expire the token when the time arrives. Solution: Timestamp the cookie and compare the time in the server.
XSS attack. Solution: Mark the cookie as http_only.
Eavesdropping. Solution: Mark the cookie as secure and use https.
Having a long lived cookie which is able to authenticate a user is very dangerous. Mitigation: 1) Refresh the cookie and token at every X requests in a server token based solution (it will still last all the period if the user does not come back). 2) Refresh the cookie and extend its timestamp at every X requests in any of both solutions (then you are "remembering" for a shorter period if the user doesn't come back).

Is my rationing correct or am I missing something?

Congratulations!  You've just invented the JWT :)
A "remember me" feature isn't practically different than a simple session token, and the entire point of JWTs is to not have store tokens server-side while still validating users.
No need to implement this yourself of course - every language has good libraries for JWTs. You should also read up on their limitations, the biggest of which is the inability to revoke them. That is why they have an expiration, which is usually quite short, and so are combined with a refresh token, which lives longer.
Helpful reference: https://jwt.io


Hidden TrueCrypt Container containing the Tor Browser Bundle I'm considering using a hidden TrueCrypt container to keep a Tor browser bundle copy which could save bookmarks.
In this case, would the TBB leave traces on the OS it started with?

E.g. I use my flash-drive to start TrueCrypt on some random Windows machine that contains the extracted TrueCrypt. I use it to mount my hidden container that has an earlier installed TBB and then browse with it, save bookmarks, download things to the hidden volume and so on.

I assume an alternative would be to use Tails and save bookmarks - if really needed - on a flash drive's hidden volume.

It's unlikely that Tor browser will leave any trace outside of the Tor browser folder.= unless you tampered the configurations. Even if you switch downloads to a folder outside of it, it will still download within it's own folder.


Can LastPass local password store (on a Android device) be brute forced in a usual way? I' trying to figure out how secure LastPass is if you have it on your Android device and it gets stolen. If I'm not mistaken there has to be a password vault stored somewhere locally on the device.

Would in that case be enough to just keep trying to brute force the LastPass password until successful? Does this answer my question?

What about when using two-factor authentication, would that make it any harder (with no access to two-factor authentication) in this case?

Making brute-force attack the only possible option is a desired feature of a security system.

This "only" would mean there are no weaknesses in the algorithm or implementation and the system could be broken only by trying all combinations of possible passwords.

On top of making sure brute-force attack is the only possibly, it should also be made difficult to perform.

In case of LastPass' database (an offline, encrypted file) the countermeasures are limited, but both the system design and user have influence over the effectiveness of an attack.

First: the database is protected with a key derived from a password using PBKDF with a specified number of iterations, which increases the time required for confirming each guess attempt.

Users need to set the number of iterations of PBKDF high to the point they can bear the time required for opening the database on their devices (this can vary for PCs and mobile devices).

Second: users must use strong passwords to make the brute-force attack harder (possibly to the point of infeasibility).

Two-Factor Authentication in LastPass does not protect the password database, but the access to the online service which provides encrypted user's password database.

Once the database is downloaded it is a static encrypted file and 2nd factor authentication is not necessary to decrypt it.


Redirection - Different Website from Different Computer There are URLs which its only purpose is to redirect the HTTP requestor to a correct website. Say, if I tried to access example.com/0wa/RaNd0m from my computer, it would redirect me to wikipedia.com. But if I tried it from my Virtual Machine in AWS, it would redirect me to a malicious site. Why is the final web page different for every different computer? Can you explain the step-by-step (technical) process of how this works? I believe this happens because the redirection proxy is checking the IP address and then sends the requestor accordingly. Please correct me if I am wrong.
If I wanted to analyze the malicious website, I would frequently have to log in to one of my AWS virtual machines (each having different Public IP) and then visit the URL. Is there a better way of doing this?

There are various ways of redirecting the requestor to the site you want. Your idea is a good option because you are able to focus people from different countries depending on the focus of an attack. If it needs to be a bit easier you can check the User Agent, OS, Language and other variables that will be sent by a browser. If you want to focus a Windows PC you check the agent and redirect to the malicious site. If an iPhone is surfing to the same site there could be another reaction depending on the attackers needs. This method generates not that much overhead as it doesn’t need to involve other servers to check the origin of the IP address.

If I wanted to analyze the malicious website, I would frequently have to log in to one of my AWS virtual machines (each having different Public IP) and then visit the URL. Is there a better way of doing this?

If you want to analyze a Webpage on their behavior it depends on the language of the Page (PHP,JS,…) If it is written in JS it’s easy because you can request the page and look into the source code. If the redirecting function is server side implemented you have to try all User Agents, different IPs and mixtures to get the full information what combination redirects you to which page.