Malware? Or a Browser Hijack by Google? Today, clicking on links (via Chrome from my Google home page), I started seeing "https://beinternetawesome.withgoogle.com/en_us/" come up instead of the site I had attempted to load.
I'm trying to determine if this is due to typical/traditional malware, or a bug at Google, or simply an inappropriate decision by Google that appears to meet the definition of a browser hijack.
I have found one other reference to it, at: https://support.google.com/chrome/thread/76979340?hl=en
Other than that, I've been unable to find info on the unrequested redirect part of this, though I have confirmed that the site being loaded without consent is a valid Google site. Is any further info on this public yet?
Thanks in advance for any further info.

I have to admit, this is pretty bizarre. This is what I found.
beinternetawesome FAQ
It sounds like you have Parental Controls set.
Parental Controls
How SafeSearch works
When SafeSearch is on, it helps filter out explicit content in Google's search results for all your queries across images, videos, and websites. While SafeSearch isn’t 100% accurate, it’s designed to help block explicit results, like pornography, from your Google search results. Learn more about how to stay safe online at safety.google.
When SafeSearch is off, we'll provide the most relevant results for your search which may include explicit content when you search for it.

SafeSearch can be turned on for:
Personal accounts or browsers
Children’s supervised devices and accounts using the Family Link app
Workplace or school devices and networks

Turn SafeSearch on or off
Go to Search Settings.
Under "SafeSearch filters," check or uncheck the box next to "Turn on SafeSearch."
At the bottom of the page, select Save.

Change your child’s SafeSearch settings in the Family Link app
The SafeSearch setting is on by default for signed-in users under 13
(or applicable age in your country), managed with Family Link. Only
parents can turn the SafeSearch setting off. Learn more about Search &
your child’s Google Account with the Family Link app.


Are Ubuntu updates signed by a central authority? When updating Ubuntu with the default setup, do updates need to be signed by multiple people, or is it a single person who controls what updates to sign?

The reason I'm asking is that if a single person or company is in control then it's not really safe. Take Apple as an example, even if I trust Apple (or Microsoft for that matter) the updates are not really secure as they might be forced to share their private keys.

By distributing the trusted people / companies around the world we would really decrease the chance of fake updates.

How is the signing done for the Ubuntu main repository?

Answering your direct question:
You should read the pages on Secure Apt Ubuntu, and a slightly more thorough page on Secure Apt Debian.
The summary is that packages are signed using gpg (aka "gnupg") which is a distributed web-of-trust style public key infrastructure - this should make you happy. In the PGP / GPG world, people sign each other's keys to form a "web of trust". By default on a new Debian system, there's one trusted key in your apt keyring belonging to
Debian Archive Automatic Signing Key <ftpmaster@debian.org>

so anybody they trust, you automatically trust. If you add a 3rd party repository / PPA to apt, part of that process is adding their signing key to apt's list of trusted keys.
If you want to know more about how packages are vetted, and how signers are added to the trusted list, I'm sure you can find out more by digging into the Ubuntu and Debian communities.
Answering the broader question:
Is it really true that a central authority is less trustworthy than a distributed system? I don't think it is.
Whatever you may think about Apple or Microsoft's requirement to bend to law enforcement, one thing you can be sure of is that they hire good security teams, and that the server holding the signing key is very well secured against hackers - probably with hundreds of thousands of dollars of security equipment and firewalls. Can the same be said of every gpg user who has signing power on the ubuntu repositories? I don't even know how I would go about auditing that ... and that's the point because a web is only as strong is its weakest link.
So yes, Apple or Microsoft may be forced to sign something on behalf of the government (which Apple is spending a lot of money fighting in court, by the way), but distributed systems are WAAYY easier to hack into and steal a key simply because individuals can not spend as much money on security as large companies can. So what's the lesser of two evils: a large security-conscious company under American law, or a collection of individuals who are easily hacked?


TLS Connection State At the moment, I am trying to understand TLS in depth, thus reading RFC 5264. In section 6.1 the Connection State of the TLS Record Protocol is explained:

  A TLS connection state is the operating environment of the TLS Record
     Protocol.  It specifies a compression algorithm, an encryption
     algorithm, and a MAC algorithm.  In addition, the parameters for
     these algorithms are known: the MAC key and the bulk encryption keys
     for the connection in both the read and the write directions.
     Logically, there are always four connection states outstanding: the
     current read and write states, and the pending read and write states.
     All records are processed under the current read and write states.
     The security parameters for the pending states can be set by the TLS
     Handshake Protocol, and the ChangeCipherSpec can selectively make
     either of the pending states current, in which case the appropriate
     current state is disposed of and replaced with the anstehend state; the
     pending state is then reinitialized to an empty state.  It is illegal
     to make a state that has not been initialized with security
     parameters a current state.  The initial current state always
     specifies that no encryption, compression, or MAC will be used.

What I take from this excerpt is that the TLS Record Protocol requires certain parameters (encryption keys, MAC algorithms, etc. ) to be set in order to work in a secure manner. The TLS Handshake Protocol provides most relevant parameters. At the very begining of the TLS Handshake, the security parameters aren't set ("no encryption, compression, or MAC").

But I don't get this part:

  Logically, there are always four connection states outstanding: the current read and write states, and the pending read and write states. All records are processed under the current read and write states.

What do they mean by read state, write state and pending state?

From another post on this site:

  It's the state of the encryption. The pending state includes new
  encryption keys, and initialization vectors. There is a write key for
  sending data, and a read key for receiving data. The state of the keys
  and resulting IVs are the read and write states.

  So when the current read/write state is overwritten with the pending
  read/write state it means that the new encryption keys and IVs are to
  be used for future communication. Until a new Change Cipher Spec
  message is received.

  The significance of these states is that they keep track of the
  cryptographic state as data is being encrypted and decrypted. When a
  new key is negotiated these states are updated to use the new key that
  was negotiated between the peers. Key renegotiation is common among
  most cryptographic protocols.

Not much to add, that answer pretty much covers it.


Does Cloudflare masking my IP make my server more secure? I've heard in a conversation and read in some forum posts that Cloudflare will proxy your IP, hiding it from the public, and this mitigates the risk of an attacker finding your server in the first place, making it more secure.

Is there any truth to that? It seems like a trivial "security through obscurity" trick, which while I'm all for them, don't want to believe it's actually increasing my server's security if it's the equivalent of rot13() as encryption.

Here's what I found on Cloudflare's site and they even mention your IP can still be found while using this service.

So does it actually provide any additional security?

Are there other reasons this is worth doing? or is it more of a marketing talking point than a practical benefit?

Yes.  The idea is that you block all HTTP and HTTPS connections to your server, except those originating from Cloudflare's network.  Therefore, your server cannot be attacked directly - all HTTP and HTTPS requests must go through Cloudflare's web application firewall (WAF) first, before reaching your server; and Cloudflare's WAF will block any suspicious requests.  So, it's not 'security through obscurity'.


Truncating the output of SHA256 to 128 bits Suppose we need/prefer 128 bit hash output, for example to generate a 128 bit encryption key or, in other applications (e.g. file integrity verification), to consume less storage space.

I don't know of any new/standard/unbroken 128 bit hash function, so it seems we have to use SHA256.

Is truncating SHA256 output to 128 bits acceptable? Does such a truncated hash have a security equal to a 128 bit hash? I mean a 128 bit hash that has no known vulnerabilities; definitely not MD5!

I have an idea of how to accomplish this:

MD5(Truncate128(SHA256_hash))

I don't know if this will have any benefit/detriment to security.

Though SHA-256 nominally offers a 256-bit output, no weakness about it is known when the output is truncated to 128 bits, except, of course, weaknesses inherent to the shorter output length; e.g. collision resistance drops from the infeasible 2128 to the possible (but hard) 264.

This is not a generic property of hash functions(*), but it is somewhat "obvious" from how SHA-256 is defined. In particular, when NIST defined SHA-224, a hash function with a 224-bit output, they merely took SHA-256, with a distinct initialization vector, and a truncated output.

(*) It can be shown that a given secure hash function, when truncated, cannot be awfully bad, but it can still be slightly worse than expected. For SHA-256, truncation seems safe.


PHP file_get_contents vulnerability I'm assessing security of a webportal for a client and I found a vulnerability.

This is the PHP code:

echo(file_get_contents("template/data/" $_GET['id']));

I was able to successfully read ../../../index.php, config.php etc.

But I just want to be able to prove that this bug is more critical than reading configs. I read the MySQL user/pass, but I can't connect to it since its listening on localhost only. All other codes I read, didn't lead to anything. So basically all I got was just some source code which was kinda no secret.

I can't do php filter stuff because it has "template/data/" in the beginning of string.

What else can be done with this vulnerable piece of code? Any ideas?

Is the MySQL database on the same machine? If so can you just pull the database files and reconstruct the DB on your machine?

As others have stated you can pull /etc/passwd which contains a lot of information about the user layout. If you can access /etc/shadow you can attempt to offline crack passwords.

If the web application has a login portal attempt the mysql credentials as well as "admin", "root" etc. with the password.

Does the source code or config files contain any other access credentials / API keys? Is the sites SSL certificate readable - if so you can Man In the Middle connections?

You can also pull details from /proc/version, /etc/issue etc. and the webserver versions to look for other known vulnerabilities.

Finally is the source supposed to be public? If not source code is often viewed as valuable. And you can inspect that for further vulnerabilities.


Is there any system that can authenticate my device to open only select apps on it? I am looking to have an authentication system with which I can link a device to an employee, and then put in place certain privileges so that the employee is only able to open select apps on only that device.

These select, in-house apps can only run on these authenticated devices, not on any outside devices, and the apps can be diverse, like PHP based websites, email services, or other mobile apps.

Answer depends on the service you may refer.

For example if it's a web services (php as you've indicated), an authentication mechanism with authorization limits user rights. You may control the user based on the privilege assigned to the user profile.

For Apps installed on a device you may deploy password protection for applications where the user will be asked for authentication when accessing app. There are several similar apps available in market. following are some examples:

https://www.microsoft.com/en-us/p/password-protection/9nblggh1p2gx

https://www.microsoft.com/en-us/p/applocker-lock-your-apps/9wzdncrd23mg


Same SAN listed in different certificates, both valid at the same time? I am implementing a multi-master highly available service, which is deployed on two different machines. There is also third machine. It doesn't do anything other than cross-monitoring the cluster and being third voter for a quorum, so there are no public services.

Clients are directed to serving machines by DNS service. The public service name, say svc.example.org, will have two A records, both with short TTL, one has an IP of first server, and the other has an IP of second server. Cluster control will dynamically remove a record for the host if it is down and re-add it once it is up and ready to serve. My DNS service has an API for doing this. The application below is well able to handle the case where same client is using different server for next connection each time, also it is likely connections will be long-lived.

So, basically, to add TLS to this service both servers should have the certificate with this common service name, svc.example.org.

I want also to have a possibility to direct client to certain server, for testing purposes. For example, the cluster control could use the direct connection to certain server to check if it is working, to figure out, should its address to be added into common record. So, in addition to common name, each server should respond to its own distinct name, svc1.example.org and svc2.example.org, which are static.

Thus, my certificate should be also valid for svc1 and svc2.

This is the case for SAN certificate. But, machine svc1 should never look correct if queried as svc2 (by a mistake, misconfiguration, etc.) and vice versa. So, it is preferable for first machine to have certificate which is valid only for svc1 and svc, and for second machine to have certificate which is valid only for svc2 and svc. Here we have the same name, which should appear in two different certificates, both valid as same time. Having two different certificates is also perceived as a security benefit of using a different private key on each server.

I assume no respectful CA will sign two different certificates with same subject name. Typical OpenSSL routines I used to know (EasyRSA and so on) will even not allow this to happen, refusing to sign other certificate while first one isn't revoked. But, I could easily create two certificates with different subject names, and having the common name in SAN:

(to be deployed on first machine)

subject name = svc1.example.org
SAN = svc.example.org, svc1.example.org

(to be deployed on second machine)

subject name = svc2.example.org
SAN = svc.example.org, svc2.example.org

This is legal from my point of view, because each machine has a cert for names which it really serve. But, could this work at all? Would CAs (for example, LetsEncrypt) sign me such certificates? Will clients (for example, OpenSSL client library) be happy with this? Or should I revert to having a single shared certificate with all three names as SAN?

I strongly prefer to use a single CA. Using a multiple CAs is of course a known option, but it feels like an ugly mess for me. In the end, some services I intend to run like this don't need more than domain-validation, so I am going to use LetsEncrypt for them; this is single and automatic CA which is very convenient to use. There is no second LetsEncrypt to ask second set of certificates from. And, what if I decide to have three masters? I have to find third CA?

Also, it is about where and what to ask further. If this idea (of having same name in SAN of different valid certs) is tecnically possible (could work), what governs the topic, some policies of given CAs?

This is the case for SAN certificate.

To be clear, let me summarize that your case for the SAN certificate is that you want your load/HA-balanced web servers to be able to respond to (hostname).example.org as well as (service).example.org.  (hostname) in your example is "svc1" or "svc2".  (service) in your example is "svc".  You do not want individual an individual host (svc1) to respond to a request addressed to a different host's individual name (svc2).

You are not anticipating that the cert SAN should include all variants of .example.org.  (This is a valid configuration, but your question implies that you do not consider it one.  More on this in a moment.)

  But, machine svc1 should never look correct if queried as svc2 (by a
  mistake, misconfiguration, etc.) and vice versa. So, it is preferable
  for first machine to have certificate which is valid only for svc1 and
  svc, and for second machine to have certificate which is valid only
  for svc2 and svc.

If your only reason to ensure svc1 never responds to "svc2.example.org" and svc1 never responds as "svc2.example.org", then that does not imply that you cannot have a cert with "svc1", "svc2", and "svc" all as SAN entries.  It is perfectly reasonable to have this handled at the HTTP layer and not the TLS layer.  In fact, it is preferable to handle this at the HTTP layer, because that can be handled gracefully as a redirect or as a smart-looking error page.  If you enforce this at the TLS layer, then what you will get is a normal HTTP page which is only reachable by clicking through the ominous looking browser warnings which say "OH MY GOD! THIS COULD BE AN IMPOSTOR SITE!"

  Here we have the same name, which should appear in two different
  certificates, both valid as same time.

That is reasonable.  There is nothing prohibiting this, either in "best practices" or in actual practice.  There is nothing wrong with a single CA issuing multiple certificates for the same name, and there is nothing wrong and nothing preventing multiple CAs from issuing certificates for the same name (as per this potential dupe).

  Having two different certificates is also perceived as a security
  benefit of using a different private key on each server.

This is mildly true.  Security purists will insist that sharing a key between multiple servers increases the potential for key compromise.  This is by no means a universal opinion, however, and in the case of a small number of machines which are configured to serve the same application interchangeably, either for load balancing or HA purposes, sharing a key is a perfectly reasonable and acceptable solution.  We presume that the administrator practices decent operational security when sharing the key between machines - just as we assume that they practice decent operational security when copying a single key to a single server.

A single cert may, in fact, be preferable in terms of security.  If your users want to use pinning, then a single cert regardless of the backend is ideal.

There is another architecture you have not considered - if you are doing this for load balancing or HA, then you could install a single cert on your load balancer, and individual certs on the individual servers.  Have the load balancer terminate the TLS connection from the customer, and open a separate back-end TLS session.  You only need your Subject name on the certificate, and you only need the server name on the backend server certificate.  The question of intentionally directing traffic to individual backend servers, for monitoring purposes for example, may need to be handled differently - using a "X-Mr-Balancer-Please: backend-server-name" header at the HTTP layer instead of using a different DNS name and Host: header - but there are several ways to exfoliate the feline.

In short, your description of the negativity of sharing keys as a perception is spot on.  The actual security cost/benefit ratio is dependent upon the scale and operational practices, not upon any inherent superiority/inferiority of using a single or multiple certs.

  I assume no respectful CA will sign two different certificates with
  same subject name.

I disagree with this assumption.  In my personal experience, a CA will ask if they should revoke previous certs, but that is a matter of reminding the customer of sound policy in the default case, not a matter of enforcing behavior.  In every instance I've seen, the CA has accepted the reason presented for multiple certs (which may be "no, we really need multiples" or "no, we need time to migrate before we can revoke the old one.")

  Typical OpenSSL routines I used to know (EasyRSA and so on) will even
  not allow this to happen, refusing to sign other certificate while
  first one isn't revoked.

I will grant you that self-service or automated CAs are unlikely to support this by default.  That's because, as I just mentioned, the customer often needs to be reminded of sound policy in the default case.  And routines, unlike customer service reps, often take a hard line because they can't parse discussion and reasoning.

(Yes, I'm being kind to some customer service reps here.  But you can still argue with a customer service rep more easily than you can a computer!)

  But, I could easily create two certificates with different subject
  names, and having the common name in SAN

Yes, you can.

  But, could this work at all? Would CAs (for example, LetsEncrypt) sign
  me such certificates?

Any CA which has customer service reps should allow you to do this.  In the case of automated systems like LetsEncrypt, they may not (discussed above).

Again, I question your basic assumption, that sharing a certificate between multiple machines with a SAN superset of all possible names is inadvisable.  If that assumption goes away, so does the question of convincing automated and non-automated CAs to issue multiple certificates for the same Subject.

  I strongly prefer to use a single CA. Using a multiple CAs is of
  course a known option, but it feels like an ugly mess for me.

There are some use cases where multiple CAs make sense.  Your use case is not one of them, and you are correct, multiple CAs would not be a scalable solution.

As above, it should be possible for you to get multiple certs with the same Subject but different SAN sets from a single CA.  You may need a CA with humans rather than an automated CA like LetsEncrypt.

As above, your use case may be served just as well by having a single cert with a SAN set that encompasses all your machines.

  Also, it is about where and what to ask further. If this idea (of
  having same name in SAN of different valid certs) is tecnically
  possible (could work), what governs the topic, some policies of given
  CAs?

If you're dealing with a CA with human service reps and sales reps, then you can simply ask them.  If you're asking a technical resource, start with the bottom line, lay your problem out clearly, then reiterate the bottom line.

(If you're asking a service rep, go ahead and ask, then ask for a technical rep if their answer doesn't reassure you that it's solid.  If you're asking a sales rep...... ask to speak to a technical rep.)

If I may suggest - you've determined the technical solution that you think fits your problem, and are asking us to address that technical solution, rather than your problem.  That's one of the reasons you're facing 'dup' votes.

I have tried to address your technical question here, but also to push back up to what I understand your problem to be, because I think you would be better served to ask for advice about your problem than the solution you arrived at.

In any case, I hope this is helpful to you.


How to avoid referer information leakage during password reset Most password reset systems involve emailing the user a one-time link that lets them reset their password. The token needs to be in the URL, as most email clients do not allow HTML emails to perform POST requests, and asking the user to retype the token is not an acceptable experience. However, this puts the token at risk of leakage through the referer header.

One potential solution to this is to avoid any external links on the password reset page. However, most sites have a standard template that does include external links (Facebook, Twitter, etc.) and not using this template would make the page look odd - and potentially make users think it is a phishing site.

It seems browser vendors are aware of this issue and some browsers support the meta referer tag, which can be set to "never" so the URL is never leaked. However, not all browsers support this tag, so it is not a complete solution.

So, how do you create a password reset process that does not have this leak?

Browser leaking links?

Here is a screenshot of my chrome settings:

You can see that the browser may:

query another service about whether the link is legit
query another service if the link has an error

I don't know the specifics, but that means you also have to worry about those services leaking the token before the user has a chance to visit the page or in case your webserver is misconfigured.

Password reset page

If you do not want to link referer information, do not include the link.
If you want to mitigate some effects, include a strong CRSF token in <input type="hidden"> ; that way even if the link is compromised, they still need a valid CRSF token.

Why not also require a cookie?

If, by any chance, you are using github to host your website code, do not put your config (e.g. value of SECRET_KEY used to generate tokens) online.


Listing available hashes in GNUPG2? I want to use the setpref command (under --edit-key ) to set a key's prefered hash-algorithms in gnupg2, and was wondering if there is a way to list which hashes my version of gpg supports?

The supported hashes can be obtained by running the command with the --version flag.

From the GnuPG setpref documentation (bold emphasis mine):

setpref string

    Set the list of user ID preferences to string for all (or just the
    selected) user IDs. Calling setpref with no arguments sets the preference
    list to the default (either built-in or set via --default-preference-
    list), and calling setpref with "none" as the argument sets an empty
    preference list. Use gpg --version to get a list of available algorithms.


Detailed explanations on OWASP Zap Security scan rules As an example, I have installed Anti-CSRF Scanning rule in ZAP proxy and scanned a POST request which does not verify the CSRF token value from the back end. Ideally, it is a CSRF vulnerability, but ZAP proxy scanner did not detect that. I am wondering whether I have done the scan correctly, but could not find any place to verify the configuration.
Can someone help me out?

Anti-CSRF Rule

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


USBlyzer - Safe Or Not? I need to use a USB analyzer. I've been looking at a couple of different options. This one came up. As far as I can tell, it's not open source, but seems to be quite popular. Seeing that the data transfer is very sensitive, I want to make sure 100% that this is a safe app.
http://www.usblyzer.com

What process can I go through to ensure that this app is safe? I can't find any decent reviews etc. that can give me a hint.

By "safe", I mean:

Does not send any USB data to an external server without my knowledge
Does not install any key loggers or other malware like software
Does not screw up my computer. This is what I'm worried about more than anything. For example, I read that another USB debugging tool blocked all USB traffic including mouse/keyboard and rendered the computer useless until the user rolled back their version of Windows.

Edit: this is a broader question to related to how one may validate a piece of software when that software's source code is not available. I realise that a certificate helps, but even then, a certificate doesn't guarantee that a piece of software is not doing sneaky things.

There is no perfect way to ensure that a program is not malicious, short of extensive reverse engineering. Even with access to the source code, you would need to audit it pretty heavily. While major projects often do get such audits, it is not a panacea. The best you can do is threat reduction.

Does not send any USB data to an external server without my knowledge

This can be mitigated by enabling firewall rules that limit or outright prevent sending traffic over the network for the user that the analyzer is running as. You could also run the analysis on an airgapped computer with no connectivity to the internet.

Does not install any key loggers or other malware like software

While antivirus can detect some simple threats, it is easy to get around it. You could either run from a read-only live DVD, or use Mandatory Access Controls. This technique is similar in purpose to a security-oriented sandbox. MIC is a MAC for Windows, and AppContainer is a sandbox-like isolation feature for Windows. Linux and related operating systems have even more extensive isolation.

Does not screw up my computer. This is what I'm worried about more than anything. For example, I read that another USB debugging tool blocked all USB traffic including mouse/keyboard and rendered the computer useless until the user rolled back their version of Windows.

While you may be able to reduce the chance of software being malicious, knowing how bugs in it may interact with bugs in your operating system is even harder. A potential way to reduce this risk is to use USB packet capturing software and analyze the actual packet dumps using a separate, unprivileged program, allowing you to segment the privileges required to complete your task.

Edit: this is a broader question to related to how one may validate a piece of software when that software's source code is not available. I realise that a certificate helps, but even then, a certificate doesn't guarantee that a piece of software is not doing sneaky things.

There are a few things you can do to reduce the risks:

Use open source software, ideally popular software that is well-audited.
Only use signed software, and verify them using programs such as GnuPG.
If you are particularly paranoid, only use software with reproducible builds.

On Linux, you can use the usbmon kernel driver to capture raw USB traffic, then various packet analysis tools like Wireshark or Virtual USB Analyzer, both of which are open source. Using a well-known live Linux distro such as Knoppix will help reduce the chances that privileged software will cause significant harm to your installation, while preserving your ability to read and write to your disk and analyze captured USB traffic on the system. This gives you a few benefits:

The software required for USB protocol analysis is open source, making it easier to trust.
The software runs in a live environment, making it "amnesic", so changes vanish on reboot.
A Linux environment provides far more tools for debugging and low-level analysis than Windows.
All the mentioned tools are digitally signed, reducing the risk that they have been modified.


Exposing database fields names in HTML I quite often see opportunities to optimise server-side code if HTML form names are exactly the same as the database field names they eventually update.

The drawback obviously is that this is exposing information about the database structure in plain sight.

Of course this information is only useful if other weakness exist but it does seem like handing information on a plate.

I'd be interested to know if people think this is low risk and if they do expose field names like this without worrying.

It is very common to do this. As you've noticed, there is a significant benefit for keeping code simple.

If you do have an SQL injection vulnerability, an attacker can figure out your database structure using INFORMATION_SCHEMA. So hiding your database structure doesn't help you a great deal.

Another concern in this area is Mass assignment vulnerabilities. Perhaps a user is allowed to update their user details - name, email, password, etc. But they are not supposed to be able to update the field "is_admin". With code that automatically routes form fields to SQL statements, sometimes vulnerabilities like this can appear.


Can a domain name be trusted? I'm in need of some distributed processing, the cheapest way for me to get that processing power is renting some dedicated servers from a company with specialized hardware for this.

The servers that they have aren't internally connected in any way, they might not even be on the same continent as each other. All they have is an internet connection and a subdomain address (like node523.bunchofservers.com). Well I could also get dedicated IP's but that would cost extra.

Anyway, one of them would be the coordinator of all this processing and would have to be barking orders at other nodes, the data transferred is not sensitive information and doesn't need encryption.

Would it be safe for me to just hardcode the coordinator servers subdomain address into the processing nodes and just accept whatever orders come from that address without any other form of authentication?

No.  Network connections can be spoofed in a variety of ways.  The impact of this is not something that we can say with the information provided; you'll have to evaluate that; but spoofing is technically possible.  If that would be undesirable, use a suitable form of authenticated network connections, such as TLS with public-key authentication.


How to create a company culture that cares about information security? Hardened Servers, IPS, firewalls and all kinds of defenses cannot solve security problems if people leak information without knowing simply because they're misguided.

I already tried to instruct them but they simply don't care, they cannot see themselves as an important part of our intrusion prevention system.

The company deals with sensitive information, but they prefer not to think about it. Our policies are one of the best I have ever seen, but no one follows them except the security team.

What should I do? Should I throw in their faces the logs of how many attacks my team is dealing with because employees bypass all the security?

If my team fails the telecommunication system of my country can be completely affected. I thought it was a motivation to take care of security, but no one cares except us because it's our job.

Has someone already dealt with a situation like this? Should I give up?

High Level Culture

In my experience, shifting a security culture takes 3 steps:

Get management buy-in to do things differently
Get personal management engagement to lead the way on what is important
Set the tone through training, media, and in-person events that "people like us do things like this"

Here's the thing: management has to be leading the charge on this, with help with the security champions. Management has to want, and encourage, the technical controls to apply to themselves. If management gets special conditions, game over.

Get a manager, the higher up, the better, to personally and publically express their desire to participate in a properly secure environment. Get them to express the frustrations and inconveniences, too. But also communicate that the inconveniences are important for the health of the company.

  "I grumble on the mornings when I'm prompted to change my password. I think, I changed it just [1|3] months ago! But, I know that when I do, I'm cutting off a hacker's route to using my credentials to harm me and this company"

[yes, I am aware of the controversy about frequent password changes, but roll with the example for a second]

Then, once you have this great foundation, then start bringing that message to the personal level to everyone.

Teach Them to Secure Themselves

It can be easy for people to see company policy as disconnected from reality (have you filled in your TPS reports?). So pushing hard on company security can be a losing battle. Instead, consider teaching people how to secure themselves and their families. Show how hackers have and do compromise home computers and mobile devices. By doing this, you get them to really see the dangers involved. Once you have this buy-in, then it is much easier to shift the focus to dangers at work.

Get Some Teeth

If everyone is getting along with the policies, then that's great, but you need to have some worst-case consequences for people who do not comply. This is a tricky subject and you need to work with HR, GRC, and management to make this work.


Informative error messages in password reset functionality? When I am implementing password reset functionality I usually do not include informative messages about whether a user was found, because I have always believed that it can lead to user name enumeration.  So instead of showing:

Account with email "test@test.com" not found.

display a ambiguous message like:

Please check your email for instructions on how to reset your password.

regardless of whether an account was found or not.

Is this overkill or a good practice?

This is current best practice, as recommended by OWASP. One thing often overlooked though is that the return values should be identical - the layout and underlying HTML code for a page should be the same for each. It's not enough just to provide the same message if you can open the page source and see a comment <!-- Failed password --> or <!-- Unknown email address --> - I have seen these in live sites.


Why are CSRF tokens used so often? CSRF tokens are used a lot.

The server sets a token in cookie for that domain that either (1) include in the HTML form or (2) Javascript can read and include in the request. The server verifies the token in the request matches the token in the cookie.

But why not simply check the Origin header? According to OWASP, that's why it exists:

  The Origin HTTP Header standard was introduced as a method of defending against CSRF and other Cross-Domain attacks.

"Is the Origin not there? If not, OK. If it is, is it one one I trust (e.g. the same origin)? If so, OK."

CSRF tokens can be troublesome. They are

more difficult for beginners to understand -- "Wait...I send it twice? What's CRSF again?"
requires cookies (granted, not usually a problem)
more difficult to implement -- needs controller and view
less flexible -- can't ever work cross-domain
strange in non-web settings -- "Why does your API need a CSRF token?" "Oh, 'cause JS uses that too."
more cumbersome to implement globally -- "Oops, forgot the CSRF tag here among my 25 HTML form fields"

Given these disadvantages, why are CSRF tokens so commonly used, rather than the Origin header?

You can't currently depend on the Origin header, because it is not implemented in all browsers which are in active use. Apart from that, Origin is not sent in all cases relevant to CSRF, like

<img src=http://router/admin.cgi?...>


MVC 5 and Multiple AntiForgeryTokens: What is happening? I have a simple login form. In it, I put an AntiForegeryToken.

@using (Html.BeginForm("Login", "Account"))
{
    @Html.AntiForgeryToken()

        Email
        <input type="text" name="Email" value="" />

        Password
        <input type="password" name="Password" value="" />

    <input type="submit" value="Login" />
}

Next, I decide that I want an AFT available on every page so that I can execute certain AJAX calls that correspond with actions that require them from anywhere. To do this, I stick the AFT call in my layout view.

<!DOCTYPE html>

    @Html.AntiForgeryToken()
    @RenderBody()

I go to my login page. I see the "__RequestVerificationToken" cookie is set with a particular value. I examine my HTML and see that both AFTs (login form and layout page) have been rendered. That makes 3 different AFT values MVC has given me. I fill out the form and submit. I am logged in.

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Login(FormCollection form)
{
    // etc.
}

I am also able to use AJAX to submit an AFT-requiring POST as well, using one of the other AFTs.

What is happening? I thought the AFT in the cookie and the one in the form were supposed to match. How is MVC doing this? What is it doing behind the scenes?

I thought the AFT in the cookie and the one in the form were supposed to match.

You were wrong! they doesn't need to be equal - However, they have some cryptographic relations with each other...

Here you can find detailed info about this feature and how it works...


Partial decryption using untrusted decryption service While there are ways to encrypt and decrypt information, most of these seem quite computation-heavy. Because of this I am thinking about splitting decryption into two parts - one is computation heavy and the other one is computation light. First part is performed on the remote untrusted server using some kind of session key, while the second part is done on the client side knowing the actual key.

User has a key K and there's encrypted information T on the server. User generates some K1 from his K and sends it to server. Server attempts to decrypt T with K1 and gets some T1 instead. It is not yet completely decrypted and neither of T, T1, K1 allow server to compute K. However K1 is generated in a way where user can easily decrypt T1.

Is this approach possible at all? What could be potential problems?

Update: I've come up with an example of how it could be done: User generates multiple keys - K1, K2, K3 ... KN, shuffles them and adds his own key K in the mix. Then he sends all those keys to the server and asks it to decrypt T with each of these keys. Server doesn't know which key is the correct one, while user knows which of T1 .. TN is the actual decrypted information while the rest is garbage. This particular approach has a lot of inherent weaknesses, as well as it doesn't allow to use the server for encryption (i.e. it's "read-only"), but it's kind of what I'm looking for.

Update 2: (Since I've spent my reputation on bounty I can't comment on answers anymore). The idea is to have a function that can be applied to a key and it's reverse function that could be applied to a "plaintext" that are easy to calculate and that can not be predicted by server (i.e. not constant for sure). The "generate garbage" and "discard garbage" are examples of this. The "generate hash from key" and "do nothing" are not good enough - server can simply omit the encryption, so this would only work if the hash is different for each session.

I do not know if this is possible at all, but I can't also prove it impossible.

Your premise is incorrect, but conceptually I think the problem you're alluding to has been solved by server based password managers using password based key derivation functions (e.g. PBKDF2).

Reason your premise isn't right is that symmetric encryption and decryption (e.g. AES) is fast even in JavaScript. These days the cost is low especially when many consumer devices have dedicated hardware to process it.

Asymmetric encryption (based on public and private keys) on the other hand is expensive, and if its processing becomes prohibitive in an application there's a good chance it's being mis-applied.

Although with an algorithm like AES encryption and decryption is fast, if you don't know the correct key it will take forever to guess the right one because there are way too many to guess (especially with 256 bits). This is further compounded by the use of PBKDF2, which I shall explain in a bit.

Although you say the server is untrusted, you do trust it enough to receive and store your encrypted data, but I assume you don't trust it to directly receive and store any sort of confidential data in plain text. Another assumption I will make is that the server will try to ensure the encrypted data is only sent to you, and not to everyone who simply asks for it. Assuming this is reasonable I will present a scheme using PBKDF2 that many server based password manager services utilize.

What's PBKDF2? It creates a key from another key, much like your K to K1. What's interesting about PBKDF2 is that it can be made as fast or as slow as you want - the larger the number of iteration rounds the slower it is.

Registration with server in order to establish authentication credentials and submit encrypted data:

//// JavaScript client side
PBKDF2(password, 1000 rounds) => encryption key // fast because low number of rounds
encrypt(encryption key, data) => encrypted data // fast even with AES 256
hash(encryption key) => auth key

// send encrypted data and auth key to server

//// Server side
PBKDF2(auth key, 100000) => server hash // slow because high number of rounds
// store server hash and encrypted data

When you subsequently access server:

//// JavaScript client side
PBKDF2(password, 1000 rounds) => encryption key // fast because low number of rounds
hash(encryption key) => auth key

// send auth key to server

//// Server side
// verify auth key
PBKDF2(auth key, 100000) => server hash // slow because high number of rounds

// if server hash matches what was previously stored return encrypted data
// send encrypted data back to client

//// JavaScript client side
decrypt(encryption key, encrypted data) => data // fast

Note that my reference to PBKDF2 above is a simplification to demonstrate its role rather than actual usage.

I believe this proposal solves the inherent problem that I think you're asking, without needing a new type of encryption, and instead rely on known strong cryptographic techniques. Everything on the client JavaScript side is pretty fast since you know the password/key, whereas trying to get your encrypted data then breaking the encryption from the server side are expensive.

Highlights of the proposal:

Everything on the client side is quick.

PBKDF2 has low number of rounds so is fast
AES encryption and decryption is fast

Server never privy to:

Plaintext password.
Confidential (decrypted) data.

Server stores encrypted data. To get any information from here is expensive.

Authentication required to obtain the encrypted data is relatively slow. First line of defence.
If a malicious entity somehow manages to get the encrypted data, they will still take pretty much forever to decrypt since they do not know the encryption key. Second line of defence.


Can a wireless headphone (bluetooth) contain malware? Can a wireless (bluetooth) headphone store data? Also, if it can, then can someone put malware in it? I assume that the device must necessarily be able to store some sort of data, since it has buttons for skip and pause songs and buttons  to change the volume. So it must contain some software to do this built inside it.

Is there anyway to check (if it's really possible that it can contain malware) if it's infected or not?

Thank you.

Yes, but very unlikely.

A bluetooth headset has a microcontroller, EEPROM with firmware, audio circuitry and bluetooth chip (which is itself a microcontroller with its own, distinct firmware implementing the bluetooth stack); I'm pretty sure there are manufacturers that combine all of these elements on a single physical chip.

If you can find a vulnerability in the microcontroller's firmware and make it execute arbitrary code, you can write to its memory and overwrite its firmware with your own malicious version.

From the point of view of a malicious attacker, that would need to either compromise the device that's currently connected to the headset in order to compromise the headset later on, or to get physical access to the headset to tamper with it (via bluetooth by forcing it to connect to an attacker-controlled device that will exploit the headset, or directly via USB if the headset has such a port and its data pins are actually connected to the microcontroller).

The big question is, what does that give you ?

There isn't enough memory on the device to record calls for later retrieval (and that retrieval would also need physical access to the device later), so that idea is toast.

There isn't an easy way of streaming call audio to a different device, it may be possible if you manage to reimplement the bluetooth stack with some custom version that allows communicating with two devices simultaneously, the phone and your other device that will receive the data; plus you'll need to be relatively close to the device to communicate with it, especially since these headsets don't have a very powerful antenna.

The only way to compromise a computer or phone would be to know a vulnerability in that computer's bluetooth stack allowing arbitrary code execution, and then make your headset exploiting that vulnerability when connecting to the computer/phone.

In my opinion, all these attacks require some kind of physical access, and if we have physical access we can pull them off way easier by compromising the targeted machines directly (malware or just hardware keyloggers/microphones/other dark side spy device) rather than wasting our time with the headset.


How secure is switching keys if breaking the key is an intractable problem? Let's say that you create a system where a secret is hidden and revealed by a particular key.  As well, the key can be broken, but it would take thousands of years.  If you keep switching the keys frequently enough that no computer is able to break the key in time, is your system secure?  ...well, apart from getting that key stolen.

Assuming no other variables and parameters come into play than the ones that you have described, then YES your system is secure if and only if the method of hiding the secret is secure, i.e. it is not vulnerable to any ciphertext-only or chosen-ciphertext attacks. In both of these attack types, the knowledge of the key is not required.

So for example if your method of hiding the secret is ceaser-cipher, the strength of your key will be immaterial.


What risk does EC2/Ubuntu User-Data pose The cloud-init Ubuntu package accepts something called user-data to configure a machine in the cloud (eg EC2 on AWS). I think AWS also use this for their Amazon Machine Image.

My question is. What sort of risk does this pose in the context of sending sensitive data via this method (e.g passwords to repositories, private code, DB Credentials etc).

This page discusses the subject of "user data" and includes the following:

  Important

  Although you can only access instance metadata and user data from within the instance itself, the data is not protected by cryptographic methods. Anyone who can access the instance can view its metadata. Therefore, you should take suitable precautions to protect sensitive data (such as long-lived encryption keys). You should not store sensitive data, such as passwords, as user data.

This seems clear enough. The "user-data" bundle is something that you send to the cloud provider so that it can be sent to new EC2 instances. The cloud provider will not show that data to other people, but it will not be especially careful about it. It is obvious that some sort of storage is implied, and Amazon states quite plainly that it does not apply the kind of storage method that is deemed "appropriate" for sensitive data, such as private keys.


how can I find all the websites on a particular IP? When I try to find websites hosted on a specific IP using one of the online Reverse IP Lookup tools, I only get one website, but when I use Sub-domain enumeration, I find several websites on the same IP
Why does this happen? And how can I find all the websites on a particular IP?

Reverse IP Lookup usually returns the domains under the primary Top Level Domains hosted on a given  IP address (since that is what is usually placed in the PTR record), not a complete list of websites hosted at the IP. This typically does not include sub-domains since the subdomains are not directly under the primary top level domains.

And how can I find all the websites on a particular IP?

If you want to enumerate all websites including sub-domains, you can try using a reverse IP lookup to find the domains hosted on that IP and then enumerate sub-domains for all of them.


How can credit cards be encrypted and still be recalled later? Many merchants offer to save credit card info in an encrypted form for faster checkouts from their store in the future. How is it that merchants can store this information in an encrypted format and still be able to decrypt it to plain text later?

I think you are confusing encryption with hashing because hashing is one way whereas encryption is two-way providing you have the proper key to decrypt whatever is encrypted.

Short answer is: they are storing the key somewhere (in a hopefully secure location). Whenever they need to decrypt the credit card number they hand the encrypted data to a module that looks up the key, decrypts the card number, and returns the card number to the payment system.


Incident Response and when to consider an incident resolved I am currently making amendments to an IR process and the topic of incident closure has come up. The organisation follows NIST and therefore their IR process has four phases:

Preparation
Detection & Analysis
Containment, Eradication & Recovery
Post-Incident activity

My proposal is that an incident can be deemed resolved once a post-mortem meeting or meetings have been conducted and concluded. Any recommendations or activities identified as part of this phase are considered outside the scope of responding to an incident. When considering the phases above, anything that comes out of the Post-Incident activity feeds directly into the Preparation phase.
My thinking here is that in some cases, a post-incident recommendation may be significant and require project management. There seems to be an appetite for an incident to be considered unresolved as long as post-incident recommendations have not yet been implemented. My reluctance here is that this will impact SOC performance metrics.
Interested to get thoughts on this and how the topic of incident closure is handled within other organisations.

My reluctance here is that this will impact SOC performance metrics.

So, your process of resolving an incident has 2 distinct stakeholders:

the SOC team to measure "Time to Resolution"
the infosec team to ensure "Lessons Learned" are properly actioned

Those 2 stakeholders are at odds with each other. And you're trying to get clever at satisfying both parties.
I wouldn't take a NIST or even an infosec approach to trying to address this. This is a pure process design issue.
The resolution date belongs to the SOC. The ticket is theirs and their responsibility comes to an end long before the various projects end. The infosec team needs to find another tool to track the projects it wants to generate and stop leveraging the ticketing tools as its project management tool.
If that doesn't work, add a new date to the ticketing system to reflect when the Response phase ends, and use that for your SOC performance metrics.


BufferOverflow ESP too small for shellcode I want to write an exploit for a test application that provides only 12 bytes of space at the ESP. I'm not able to place shellcode in such a small space. I have no clue what I can do to solve this.
I have done the following steps.

Fuzzing
Find offset
check for Bad chars
find module JMP address
control EIP
use msfvenom for writing shellcode

I have tried to add 16 "B" but only 12 got written into the ESP space

You've run into a common problem in developing realistic exploits. Being a common problem, there is likely a solution. You just have to already know how to find it.
In this case, look into the concept of a trampoline. Trampolines are small segments of shellcode that exist to redirect execution. It is useful in this type of scenario because you can redirect to a larger block of memory that you also were able to overwrite. So in your 12 bytes, you have to craft code (start with JMP) that transfers EIP into a larger block from your overflow buffer.


OpenSSL oracle padding vulnerability (CVE-2016-2107) Hi We have a Windows 2008R2 SP1 server system running Oacle with OpenSSL.
Upon doing a security scan we have found out that we are getting:
OpenSSL oracle padding vulnerability(CVE-2016-2107) vulnerability.

Threat: A MITM attacker can use a padding oracle attack to decrypt traffic.
Impact: A MITM attacker can use a padding oracle attack to decrypt traffic when the connection uses an AES CBC cipher and the server support AES-NI.

What steps on the Windows side can we take to remediate this issue?

A 'padding oracle attack' has nothing to do with the Oracle database software.

Ensure windows is updated, and remove the insecure cipher suites that this machine was configured to use.


Encrypted password inside compressed archive File compression utilities like Winrar or ZIP or 7zip encrypt the password and store it inside the archive.

How safe is that? I mean you are giving away the archive with the password inside,it's not like authenticating against a web site where the password is stored somewhere remotely.

Can for example binary examination of the archive, given that the rar or zip file format structure is public, reveal the password's encrypted form? For example look for the header that contains the actual password and extract the encrypted string?

Say that this is plausible,is there something you can do to extract the clear password of the encrypted one?

File compression utilities like Winrar or ZIP or 7zip encrypt the password and store it inside the archive.

I don't know where you got this information (claims without source are always bad) but I'm sure you got it wrong. This would not make any sense and the question would also be which key would then be used to encrypt the password.

With ZIP you can look into section 7.2 of the specification and you will see that the password will not be stored in any way. Only various more or less random data are stored which are used together with a key derived from the password entered by the user. These random data are used to make sure that ZIP files with the same content and same password don't result in the same encrypted data.

In the RAR specification you will find optional check value for the password. This is not the encrypted password but a hash value (i.e. irreversible) derived with PBKDF2 (computationally intensive hash) from the password.

Which means the most you have is a hashed version of the password, and hashed with a really slow hash. While this can be used to detect a wrong password fast enough for a single attempt, it does not help much with brute forcing the password. Brute forcing would probably be more effective by trying to use the password and checking if the decrypted data make some sense. This can be often done faster because most file formats contain typical magical strings at the beginning or have some typical file structure. Thus if you got something which does not look random you have probably broken the password.


Lock a website login to a certain computer I've got a web based system where a specific site only shall be available on a certain computer. On that computer I have a desktop application. The desktop application and the website communicate through a database.

For example: A user tries to use this "locked" website and therefore needs to authenticate. The website creates e.g a file on the computer that the desktop application can read. If the application can read the file it shall respond to the website that everything is ok.

Are there any good ways to verify that the user is located on the correct computer?

One relatively easy approach to this would be to create a persistent cookie on the client's side after the first log in. The cookie should hold only the user's username and a generated key. During the next log in the server would verify the key against the same key stored in the database and if it doesn't match or the user doesn't have the cookie at all you can react in a way you want, for example some type of second level authentication etc..

This however brings up the question, what to do if the user for example clears cache or changes the browser? This should be something you take into account. Probably one of the most well known application which uses this system of authentication and verification on new computers is Steam. No cookies, but the principle is basically the same.


Are shatter attacks still possible in the days of User Interface Privilege Isolation? Before Windows introduced User Interface Privilege Isolation, any application could send all kinds of window messages to any window on the same desktop (a shatter attack), allowing elevation of privilege.

Now, UIPI stops low-privilege applications from sending most window messages to higher-privilege applications. Wikipedia says:

  User Interface Privilege Isolation (UIPI) is a technology introduced in Windows Vista/2008 Server to combat shatter attack exploits. By making use of Mandatory Integrity Control, it prevents processes with a lower "integrity level" (IL) from sending messages to higher IL processes (except for a very specific set of UI messages).

That sounds like it ought to deal with the problem - according to this PDF linked in that article, only WM_NULL, WM_MOVE, WM_SIZE, WM_GETTEXT, WM_GETTEXTLENGTH, WM_GETHOTKEY, WM_GETICON, WM_RENDERFORMAT, WM_DRAWCLIPBOARD, WM_CHANGECBCHAIN, WM_THEMECHANGED, and the undocumented 0x313 and 0x31B are allowed.  (The PDF does mention a possible denial-of-service attack, starting on page 57, but while a problem, that's not elevation of privilege. I also did a cursory inspection of the DLL responsible, and it seems that on Windows 8 it doesn't actually register the message that leads to the problem.)

It doesn't look like any of those have the problem created by WM_TIMER, which caused the target process to jump to an arbitrary address. However, this article by a Microsoft blogger (Raymond Chen) strongly insinuates that shatter attacks are still a problem:

  What you can do is have a service inject the program into the session, and let it run as the logged-on user. (You have to make it run as the logged-on user in order to avoid a shatter attack.)

This Microsoft document on UAC notes that some resources "are still shared between processes at different privilege levels":

  Desktop window, which actually owns the screen surface.
  Desktop heap read-only shared memory.
  Global atom table.
  Clipboard

Still, just having those things accessible from processes at different privilege levels wouldn't seem to allow the actual jump that causes the elevation of privilege. And even if the jump was made, I'd think that Data Execution Prevention would stop the injected code from actually being run.

So, does having a window from a process running as SYSTEM on a low-privilege user's desktop still give that user the opportunity to elevate privileges?

UIPI does prevent a process with a lower integrity level from sending either a WM_TIMER or EM_GETLINE message to a higher integrity level process. These were the two message types that could be abused to elevate privileges on a system. Lower integrity level processes can still send limited message types to high level processes, but they cannot be used to take control of the processes execution. As far as DEP being the saving grace, you could use WM_TIMER or EM_GETLINE to start execution of a ROP chain. In this case you would need to find opcodes that would allow you to pivot the stack (this is where the WM_TIMER callback would send execution to) to a new location containing the addresses in your ROP chain.


Is there a site like plaintextoffenders.com that shames companies that force insecure passwords? I recently came across http://plaintextoffenders.com/ and I liked the idea. I wondered if there was a similar site that shames websites that force insecure passwords?

I personally have a list of a few websites that force insecure passwords (no puntuation/symbols allowed or a silly maximum length) and would like to submit them to such a site if it exists.

Perhaps if it doesn't exist, I could even make one myself...

You can just submit them to Plaintext Offenders. They accept any type of password-based idiocy.


Self-chosen fixed RSA PIN in addition to a Password I'm using a Junos Pulse Secure Access Service (Juniper Networks), which requires to enter a RSA PIN in addition to the password. I don't know if this is always the case or if it's a custom configuration. After entering both I get an email with a generated tokencode, which I have to enter.

The PIN isn't generated, it stays the same until I change it manually. There are no restrictions on when I have to change the PIN (besides on first login), therefore it's just something I have to remember like the password.

I don't think it makes the system more secure, so what is the RSA PIN used for? Could this be a misconfiguration which could lead to a security risk?

There are several configuration for generating the PIN. If the admin has configured it to OnDemand Authentication only via user PIN so you are getting the the token code via email/sms. But it can be configured for various other options.  You can make a suggestion to the Authentication Manager to change the PIN change policy for forcing the user to change the PIN after a fixed duration or include the both security question/password along with the PIN+Token code. The consideration taken is the for the lapse of security, no one will have access to both PIN and the token code delivery method with them at the same time. Which restrict the login attempt to just 3 for either wrong PIN or the token code.


Enable TLS on SQL Server I am familiar with implementing SSL encryption for data in transit by including "Encrypt=True" to the connection string and adding a certificate in SQL Server Configuration Manager for the instance in question.

How is TLS different from SSL and how is TLS enabled on SQL Server?

How do I know whether the encryption protocol being used is SSL or TLS?

TLS and SSL are effectively the same thing, but just different versions of each other where TLS is newer than SSL. More often than not people are actually referring to TLS.

In the scope of SQL Server, TLS is enabled via SChannel which is a/the Windows secure channel implementation. This is the same system used by HTTPS on Windows. It's enabled by default on Windows, but depending on what versions of everything are in play you would need to futz with some registry settings to enable things:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\***

Where there's Client/Server options with flags DisabledByDefault/Enabled. This KB goes into detail about enabling TLS 1.2 on the servers.

Which version of TLS you're using is dependent on a number of factors such as OS, server, and client versions. For instance SQL 2005 doesn't support TLS 1.2, and anything newer requires explicit configuration before it'll be activated. See the above-mentioned link for specifics.

I'm not aware of a way to extract the exact version used via API or configuration. You may have to check the TLS handshake via wireshark or similar.


What is an endpoint in the context of TLS? What is the purpose of endpoints in mutual TLS authentication? Actually, what do we mean by an endpoint? I am following this OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens
If a Client A wants to gain access on a protected resource hosted by some other Entity B, then wants an access token from the authorization server. Most specifically it "talks" to the token endpoint of the authorization server.
But also the entity that gives the protected resource to the client cannot considered as an endpoint?
i am confused here.

The endpoint of a network communication is the computer, program, or function which initiates or ultimately receives the communication. Since TLS is "designed to establish a secure connection between a client and a server communicating over an insecure channel" (RFC 5246), it's probably safe to assume the paper you linked to is talking about client & server endpoints.
So, without endpoints, TLS itself would have no purpose. I think that's the best your question can be answered.


Is my online bank password security policy good enough? My bank has an online password security policy which seems to me 100% wrong at all levels. Since it is one of the biggest banks in my country, I'm giving it the benefit of the doubt, and consider the possibility that I'm not seeing the full picture...

The way I access the online portal is using my ID card number (issued by my country) as username, and the same PIN from my main credit card as password. This seems wrong for several reasons:

The password I use for accesing online banking features is a 4-digit PIN.
I cannot easily change my online banking password, I have to go to an ATM and change my PIN.
If I happen to lose my credit card, which is bad enough, also my online banknig features would be compromised.
Even though some of the most "risky" features require an aditional so-called "digital-firm" which is chosen by me, this digital-firm must be an 8-digit PIN.

Is this bad enough as it seems (like get out of that bank bad enough)? Could they be using any security policies which I cannot see to mitigate possible attacks? Are these kind of bad policies common whithin big banking firms?

This is wrong on so many levels I don't even know where to start...

Four digits? Seriously? Even if you implement all the brute force detection in the world, someone could easily break into an account on the first try just by being lucky!
You can't hash four digit numbers in a meaningful way. No matter how high cost factors you set for bcrypt, it's not going to help much. That means that all the PINs must be stored in a reversible manner. If that database leaks, there is nothing protecting your account...
Having people enter the PIN to their credit card on a computer is a horrible idea to begin with, no matter what you use it for. Your PIN should be entered to credit card readers, nothing else. Teaching customers to give it away on websites isn't a good idea.
As you say, a credit card PIN is harder to change than a password.
An 8 digit PIN is better than a 4 digit one, but still not nearly good enough. Why not allow people to use real passwords? Or 2FA?

No, there are no excuses for this. There are no clever protections that can make this fine. Consider changing to another bank.


can I identify the origin computer for a program? I am Developing a program in several platforms and languages, But I don't want anybody to discover the origin computer where the program was developed, is there any way that someone can discover that ?

Source code consists in a bunch of text files. The contents of a text file are exactly what a text editor shows, so you can control that "visually". Beware of revision control systems such as CVS or Subversion: they can automatically replace some specific tags in source code (like "$Id$") with an identifying string which may contain the current date and time, your login name, and other information -- that feature is considered to be good for traceability, but I understand that you would not like it in your specific case.

Compiled code is quite something else. Some compilers may automatically added identifying strings like what revision control software does, as "comment" fields in the executable structure. This needs not even be a deliberate spying device: traceability is really a good idea in the general case; no need to imagine a government bribing compiler developers into adding such things in compilers just to be able to spy on programmers. Also, executable formats often include some "blanks" -- unused parts added for alignment reasons -- which the compiler might not have bothered with filling with zeros, instead of just writing what was in RAM at that place. This has occurred with an older version of lcc-win32, which was thus writing out random excerpts of the RAM contents which could contain confidential information (I think this has been fixed for lcc-win32, but it could happen with other toolsets).

Other file formats can also embed (and thus leak) some information. For instance, PNG images can include "comments" (which do not change the visual aspect of the picture in any way). GIMP, an image manipulation program, uses the comment field to state that it was involved in the image processing; any tool could also add some information which, in your view, would be less benign.

Many potential leaks can be detected visually, by looking at the files as if they were text. But this does not cover the possibility of one of your tools being voluntarily bugged so that it includes incriminating evidence in its output (such tracing information would be encrypted so as to "look random" except for whoever knows where to look).

Unfortunately for the state of the World at large, "a revolution in my country" is not a very precise indication. There currently are armed insurrections or similar unrest in quite a few countries just now, including, but not limited to, Afghanistan, Yemen, Syria, Somalia, parts of Libya, Colombia, Sudan, and Southern Sahara; and things are not completely clear in Egypt, Iraq or Iran, just to include the few I can think of from memory.


Can't connect to fake AP with airbase-ng I use kali-rolling on a virutal machine and I try to set up a fake access point using airbase-ng, but my devices won't connect to it whatsoever. My steps are:

I put my wirless adapter in monitor mode with airmon-ng and then run airbase-ng to clone my original AP, then I set up the configuration for the dhcp server in /etc/dhcp/dhcpd.conf as follows:

authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0
{
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name-servers 8.8.8.8;
option routers 192.168.1.1;
range 192.168.1.10 192.168.1.100;
}

Interfaces in /etc/default/isc-dhcp-server:

INTERFACESv4="at0"
INTERFACESv6=""

I then fire up the interface at0:

ifconfig at0 up
ifconfig at0 192.168.2.1 netmask 255.255.255.0
route add default gw 192.168.1.1 at0

And to give my clients network access I set up iptables to forward traffic sent to my fake AP to the interface eth0 which is bridged to the ethernet interface of my host machine.

iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD -j ACCEPT --in-interface at0
echo 1 > /proc/sys/net/ipv4/ip_forward

After that, I try to connect to this AP from any device, and none is able to connect to it, just says "Obtaining IP address" and that the AP is saved and then nothing. Could someone help me figure out what is going wrong?

Yes, work on switching from monitor to managed mode:

Stop your AP
Type sudo airmon-ng stop wlan0mon
Start it again


Determine All Possible Fields in HTML Form Is it possible to determine, from the client-side, all the valid fields for a given backend form processor, even if they are excluded from the webpage containing the form?

For example:

Assume a form processor that has multiple HTML forms which submit to it.  One form only has 5 fields, a more 'privileged' form might have 10.  Nothing prevents the client from submitting all 10 fields by editing the 5-field form, except that they don't know the fields without having seen both forms.

So in this case, the web app developer is attempting to control access to certain functions by excluding specific form fields from a page. Can a user identify which fields are available, but not shown, if they only have access to the limited version of the form?

If the answer is "only through guessing" then is this "security" model considered security through obscurity?

OP Edit - Hopefully adding some clarity.

One application I work with is segmented into multiple modules available to admins for various functions. Admins can be granted access to modules on an individual basis (eg adminA can be given access to module1 and module3 and not given rights to module2). The application then allows admin rights to be managed on a more granular level by adjusting view/edit rights by individual items within the module. However, I have realized that the read only permission is controlled (on client-side only) by disabled form fields and the exclusion of form fields. By knowing the ID of a missing field, I can submit and change values even if the field is not in the page’s source.
I can exploit this because I know the name of the missing fields, but how vulnerable is the application to exploitation by individuals who are unaware of the missing field names?

This is not secure! It's security through obscurity, and not nearly enough to protect anything of value. There are many ways an attacker could guess the field names:

Guessing. If you write good software your names are descriptive and easy to guess. If I want to delete  something, why not try setting delete to 1 and see what happends?
Brute force.
Having a look at the source code if it's available.
If a user has had access to admin level, but get it revoked, she may have saved the names of the fields.
Check your collegues browser cache.

Before taking any action, the server must check that the current user has sufficient priveligies to take that action.


How did an attacker spoof (or add to) this myspace's login form? In the attack detailed here, I see that a hacker has actually added a malicious post link. What I do not understand is how the attacker added it to the actual myspace.comdomain.

Obviously this is an old issue but I'm still curious if there is an attack that can spoof the domain name itself.

According to the article a user created a user named "login_home_index_html" then they used HTML and CSS to hide stuff on their profile page and make it look like it was the legitimate login page.  From what it looks like is MySpace didn't sanitize its user's custom HTML properly.


Security and privacy concerns about "IMEI check" websites I know there are few questions about the risk of IMEI with various answers from rare risk to none. But my question is regarding the kind of websites that provide IMEI check services for free with some services are paid. An example is this website: https://www.imei.info/
The stats at below the page are staggering. The website has access to all these valid IMEI numbers and keep increasing. I tried to enter my IMEI and I got some accurate information like model, specs, warranty, purchase date, carrier, etc.. They are obviously not an authorized body. Or are they?
I did some research online and on academic papers and IMEI does pose a minor risk in privacy and spoofing by counterfeiters.
I am asking is disclosing millions of IMEI numbers to such websites has any serious risks? Am I vulnerable after I used it?
Thank you.

I tried to enter my IMEI and I got some accurate information like model, specs, warranty, purchase date, carrier, etc.. They are obviously not an authorized body. Or are they?

The GSM/3GPP standards specify the purpose of the IMEI as identifying the mobile equipment (the device, not the person using it). These are industry standards.

I did some research online and on academic papers and IMEI does pose a minor risk in privacy and spoofing by counterfeiters. I am asking is disclosing millions of IMEI numbers to such websites has any serious risks? Am I vulnerable after I used it?

To properly answer whether you are "vulnerable" would require more context. But I suspect the answer is "no, you are not."
Remember, the purpose of the IMEI is to uniquely identify the device--the actual physical electrical/radio equipment used to connect to the tower/network--not the person using it.
The SIM card is used to identify the mobile subscriber (e.g., person with billing information). You can use different SIM cards with the same device (same IMEI).


Is there a way to save state in burpsuite without logging sensitive fields like password? At my workplace we are implementing a process so my colleagues can share the burp states of the security assessment of the project.

The issue here is, sometimes we have to use personal account information to check productions issues.

My question is about is there any option provided in burpsuite tool that I can use it to remove such sensitive data in logs before sharing it with anyone?

Not without a lot of manual effort.

But the fact that you have to use personal accounts is the actual problem. Whenever you test an application, demand a dedicated test account (preferably one per role). That way, the burp state can be shared without any problems.

If you absolutely have to use personal accounts for some horrible reason, you will have to remove every mention of your passphrase from the burp state before sharing it. This may be tedious, depending on how the application works. If it's HTTP Basic Auth, which shares the plaintext credentials every time, you may as well not share the burp state at all and just copy individual requests.


Cleartext password in HTML Is there any problem with outputing a user's password to the HTML in an hidden field (see use case below before flaming xD)?

The use case is a registration form with two steps. The user fills in the password in the first step, but in order to avoid storing the field's values somewhere in the server, the application sends the values back to the client in the HTML as hidden fields. These fields are resubmitted on the server when the client submits the second step of the registration. This way, the server receives all the values at once and the logic is simpler.

This basically just splits the registration request into two requests where the second one is the only one that matters. The problem is I'm not too confortable with having the password sit there in the HTML, but I can't evoke a good enough reason for this to be wrong...

Edit

Just to make things a bit harder, let's assume that HTTPS is used everywhere, and X-Frame-Options is being used to prevent Clickjacking. Can anybody think of any attack that wasn't previously mentioned that works with this setup?

I see a few reasons why not to do that:

The client browser may (and probably will) cache the received HTML page into some file on the local disk. It is usually not a good idea to have passwords "as is" in files on the disk.
Since you store data on the client side (in the HTML), you must think about what happens when the client does not cooperate, i.e. sends back something other than what your server wrote in the HTML. Depending on your context, this may or may not be an issue, but at least some thinking must be done about that.

The generic, safe way to do this kind of thing is to send back to the client an encrypted blob, which contains the state data you want to store on the client. The blob should use both encryption and a MAC to protect against alterations from malicious clients. Where you actually put that blob is not very important; you can put it in a hidden field in the HTML, or in a cookie -- it won't really matter since, through encryption and MAC, you don't actually trust the client machine for anything.


How to prevent MITM session fixation attack over plain HTTP upon first request? Websites has various methods implemented to tell browser to always use HTTPS - HSTS header, server redirec to HTTPS, CSP policy. However, the first time a user visits the site it can be over palin HTTP. Only after then browser knows that the site should be over TLS will it always use it.

But what if an attack has access to traffic during the first visit, and is acting like man in middle?

For instance, the attacker could perform a session fixation attack. The attacker visits the site, and gets assigned a cookie with a session id. When the user visits the site over HTTP, the attacker responds on behalf of the server and assigns his cookie to the user. Then the attacker lets all traffic through onwards. The user makes requests with the attacker's session id, give away information and so on. Now the attacker can make requests with that id and get the user's information.

What can be done to stop this kind of attack?

Assuming that you always redirect the user from HTTP to HTTPS, you can put your session identifier in a secure HTTP-Only cookie which the server never sends via HTTP.

Actually, in my case the HTTP to HTTPS happens in Apache, so my server code just can't send the cookie to a user with HTTP only.

At least, this will work in the scenario you described in your question. However, I've never heard of a MITM attack that stops at the first request. The HTTPS requests can also be proxied by the MITM so at that point the hacker gets the secure cookie anyway.

As mentioned by StackzOfZtuff, you could force requests to only be done in HTTPS by registering your site with HSTS by adding this HTTP header:

 Strict-Transport-Security: max-age=63072000; includeSubDomains; preload

Of course, that means you need to make sure that you have a valid certificate at all time or your site won't be accessible for a while. You may also not want to include sub-domains.

With HSTS, the first HTTP request never happens (at least from browsers that understand that HSTS list. But more and more browsers are now first testing with HTTPS instead of HTTP when the protocol was not specified.)


security concerns when configuring Windows 10 to automatically log into a Microsoft account-linked user account I have just configured my Windows 10 desktop PC at home to automatically log into my Windows 10 user account that my Microsoft account is linked to on startup. My desktop is in my bedroom upstairs and I trust my parents who I live with to not snoop around. However, I was wondering if this could have any security concerns beyond "your account is essentially passwordless when starting your PC". For example, could someone abuse this usability change to steal my Microsoft password after logging in? Could someone do so through a malicious website? Could someone do so through a backdoor in an app?

In other words: which security risks does enabling automatic authentication on startup on a Windows 10 machine using a Microsoft account bring beyond guaranteeing an attacker with physical access to a non-booted machine can access my machine?

The main implication is what you said, an attacker with physical access has full access to everything on the PC and your Microsoft account.

For security-relevant operation on your Microsoft account, MS still asks for the password, so the most important operations (like changing password or email) can not be done via auto-login alone.

If do you have a password set and autologin enabled I see just one issue in a normal private household environment where targetted attacks are highly unlikely.

If there is a break in and someone steals the machine, they also have access to it.

How much this risk means to you, only you can decide.


Using John the Ripper to crack SHA hash w/ partial knowledge Group, I have a SHA1 hash that I would like to brute-force. I have knowledge of several characters before and after the password (ie, if the hash is derived from "xxxpasswordyyy", I know both xxx and yyy).  I'd like to somehow input the xxx and yyy values as constants, so that they are always included in the crack attempt but the "password" portion is brute-forced.

Any examples of how to do this?

Check out the wordlist rules documentation. Based on this, you'd add a line to your rules that read A0"prefixed_text"Az"postfixed_text". Refer to KoreLogic's rules info for more examples of configuration lines and the format to specify the rule in. You can either add it to a set of existing rules you're already using or specify a new ruleset and use just that.


Why hasn't push notification authentication replaced SMS for 2FA? So we use DUO for 2FA at work and it uses push notification authentication as the second factor for 2FA. It's so quick and easy! I enter my username and password, get a push notification on my phone, tap Approve, and that's it! No fiddling with codes from an authenticator app or SMS, and definitely much more secure than SMS authentication. It also doesn't introduce the complications U2F does (specialized hardware, a browser that supports it).
Google already implements it for both Android and iOS with Google Prompts, Authy already provides support for it also on both Android and iOS using Google's and Apple's push channels. So why are we still using SMS's as the main form of 2FA (especially at BANKS)? I mean, it's so user-friendly, I don't see why the movement to get rid of passwords hasn't hailed this as the replacement for passwords when using only 1FA; it seems viable even for that.

SMS works on any phone.
Push notifications require installing an app and configuring the account in that app.


What are the real physical risks of casual social media publishing? aka "how to scare my family into stopping publishing their life online?"

I do not publish personal photos / opinions publicly online as a rule. I never gave hard thoughts about that but I believe that one should either explicitly put information to the world (typically professional data such as LinkedIn), or do not put anything. Again, this is a personal subjective opinion.

My (extended) family does publish stuff online, though. This is not obviously dangerous information (nudes, drunken parties), nor strong political/philosophical/religious/ethical standpoints. What they put online falls roughly in the categories of

we are on vacation, look how happy we are (1)
look at this cat (2)
my children are cute (3)

The risks I can imagine for the various categories are

(1): "we are not at home, burglars welcome".

This assumes that their address is known (this is not a directly available information, though possibly available through reverse-engineering of some photos which may have some recognizable landscapes, or maybe GPS information) - but not pleaserobme.com-level known.

The fact that there is nobody home is also visible through casual observation of the house so it would be much easier to target them that way than to do some state-sponsored invigilation.

(2): no risk beside understandable social ostracism

(3): "paedophiles everywhere" or "they will track them down and abduct them"

This is a possibility but I am not sure that the fact that an image is online particularly increases the risk. Children go outside on their own, they can be observed, etc. Their children are also not particularly good looking or come form a wealthy family so there is no more risk on them than on somebody else.

Generally speaking, I am looking for elements (data points) which would show that online presence increases physical risks.

I am specifically not interested in digital tracking which brings in targeted advertising or similar soft threats - except if they bring in a physical components.

When looking for actual physical risks, doxing and the results are most important.

There are examples of the hivemind of Reddit and 4chan where peoples exact locations, addresses, names and anything else might useful for actual physical attacks (or swatting) available online to which I will not link for obvious reasons.

The amount of information that can be found and linked is astonishing. Examples of 4channers whos lives got destroyed that way might help you discourage your family from posting this kind of information.


What are the roles of the "PACKAGER" in a digital rights management system? I am studying about the basics of DRM systems. I recently discovered that the term packager is the application that encrypts the original content from the creator. Is there any other work this packager does?

Encrypting the original content from the creator is a packager's main job, yes.
There's a few more things it typically does:

Add a "DRM header" to the content itself. This is usually an unencrypted blob (can be text or binary) that provides DRM-related metadata about the content. For example, the URL where the DRM client will need to go to in order to retrieve the DRM license, or the "content ID" from the DRM system's point of view.
Interface, via an API, with the license server. This is because both the packager and the license server will need to share key material.

There's more to packagers, which is however not germane to this question... for example, they can be standalone or they can be part of an encoder toolchain. If you need to know more, I recommend you ask a separate question.


Membership.GeneratePassword I am looking for a method to generate a onetime password for provisioning purposes in ASP.NET-MVC. I came across the Membership.GeneratePassword which is in the System.Web.Security namespace. Is this a secure way to generate a one time use password?

Yup, it's fine.  Underneath the covers it users the RNGCryptoServiceProvider to generate the password data, which is .NET's wrapper around the CryptoAPI's CSPRNG to generate the data for the password.   It's good enough for strongly random key material, so its certainly also good enough for a one-time use password as well.


Network security: Public and Private keys In Pretty Good Privacy, it is said that Sender sends compressed message and encrypts the message with the private key of himself. And then Receiver will decrypt that message with the public key of the Sender.

So, my question is that Public key is known to everyone, so how it is secured?

So, In this scenario confidentiality do matters that's why in later scenario of Pretty Good Privacy,

  Confidentiality is observed with one-time session key. So, Receiver decrypts the shared session key with the help of his private key. Then, uses this session key to encrypt the rest of the message. Then, matches the hash of the message with the digest created by the Sender.


Limiting the number of duplicate character types in crunch I'm trying to generate a password list of 10 character passwords containing only a combination of 3 - 6 numbers and 3 - 6 uppercase letters.

I see option -d which allows a set limit of duplicates of individual characters but I'm looking for an option that applies this to an entire character type/set.

I don't want to generate 10 character combinations that have less than 3 numbers or uppercase letters or more than 6 numbers or uppercase letters.

For the sake of clarity:

Accepted:
HAA6A51GQI
1JAK6195G1
8QLLLLA328

Unwanted:
ALQBZFT2GA
1652B547B6
ASH6UEWVH6

Might this be possible in crunch or any other software?

I don't know how to do it in crunch, but I just wrote a python script for you that will do it.

from random import shuffle, randint
from sys import argv

charset = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','8','9']

if __name__ == "__main__":
    if len(argv) < 2:
        print("Error: please use like this:\npython rand_pass.py <number_of_passwords>")
    else:
        num_pass = argv[1]
        passes = []
        counter = 0
        while counter < int(num_pass):
            num_chars = 0
            num_nums = 0
            passwd = ""
            i = 0
            while len(passwd) < 10:
                c = charset[randint(0,len(charset)-1)]
                if num_nums < 6 and c.isnumeric():
                    num_nums += 1
                    passwd += c
                elif num_chars < 6 and not c.isnumeric():
                    num_chars += 1
                    passwd += c
                i += 1
            passes.append(passwd)
            print(passwd)
            counter += 1

Usage:
python file_name_gen_pass.py <number_of_pass_to_generate>

It will generate num_pass passwords randomly via a list shuffle and tracking the number of chars/nums. You can refine it probably to reduce false positives but it if you are just doing some baseline brute force testing this should be sufficient to prove your point to a stakeholder.

Edit:
Wrote a C++ implementation for you to appease everyone :)

#include <iostream>
#include <vector>
#include <random>
#include <string>

const char charset[] = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','8','9'};
int main()
{

    std::cout << "Please enter the number of passwords to generate here: ";
    int num_pass;
    std::cin >> num_pass;
    std::random_device dev;
    std::mt19937_64 rng(dev());
    std::vector<std::string> passwds;
    std::uniform_int_distribution<std::mt19937_64::result_type> dist(0, sizeof(charset) - 1);

    for (int i = 0; i < num_pass; ++i) {
        std::string pass = "";
        int num_nums = 0, num_chars = 0;
        while (pass.length() < 10) {
            char c = charset[dist(rng)];
            if (isdigit(c) && num_nums < 6) {
                pass += c;
                num_nums++;
            }
            else if (isalpha(c) && num_chars < 6) {
                pass += c;
                num_chars++;
            }
        }
        passwds.push_back(pass);
        std::cout << pass << std::endl;
    }
    std::cin.get();
}

Just run it, enter the amount of passwords to generate and it'll fire off. It's pretty fast for small amounts. Just run it like so:
gen_pass.exe > pass.txt

Then open that file and remove the first line and run this command: awk '!seen[$0]++' script.py