Exporting a JKS entry to X509 certificate - why public key differs? There is a JKS file containing an entry named "mycert": https://filebin.net/l93faa9qa3rkt32h
Password is test123
Based on the following screenshot, mycert has a public key (RSA 2048 bits) and in X.509 format encoded it starts like this:
30 82 01 22 30

I need to export mycert from this keystore to have a single X.509 certificate.
For this purpose I'm using KeyStore Explorer but opened to any other open-source alternative.
So, I did export mycert into a single certificate in X.509 format (Test_Test.cer), it succeeded:

Opening Test_Test.cer and checking it's public key (still RSA), it differs based on the following screenshot:

30 82 01 0A 02

What is the reason for this? Is it intended? (How) can I export mycert and still keep the public key?

What is shown is not the raw key bytes only but the key inside a specific container. There are various containers for an RSA key. To reproduce it on the command line:
# extract the certificate from the JKS
$ keytool -export -keystore test.jks -alias mycert -file test.cer

# extract the public key from the certificate
$ openssl x509 -in test.cer -inform der -pubkey -out pubkey.pem -noout

# show the bytes of the pubkey in the RSA specific container
$ openssl rsa -pubin  -in pubkey.pem -RSAPublicKey_out -outform der | xxd
writing RSA key
00000000: 3082 010a 0282 0101 00bb be14 4111 577f  0...........A.W.
...

# show the bytes of the pubkey in the more generic container suitable for various kinds of keys
$ openssl rsa -pubin  -in pubkey.pem  -outform der | xxd
writing RSA key
00000000: 3082 0122 300d 0609 2a86 4886 f70d 0101  0.."0...*.H.....
00000010: 0105 0003 8201 0f00 3082 010a 0282 0101  ........0.......
...

As you can see, the output in the RSA specific container reflects what you see in your second output while the output in the more generic container reflects what you see in your first output. Thus it is just a difference in displaying the same key.
You could also see that the length of the keys differs. This is because the more generic container has more information inside. If you look closer you could actually see in the second line of the second output the start of the "inner" container which is exactly the output in the RSA specific format.
00000010: 0105 0003 8201 0f00 3082 010a 0282 0101  ........0.......
                              ^^^^^^^^^^^^^^^^^^^


Preventing access to encrypted files at all Suppose I create an encrypted container using VeraCrypt and want to upload it to Google Drive/One Drive for storage. The container is encrypted with AES-256.
I know that no one can extract any meaning from that random data.
But I am a very paranoid person!
I know that the random data doesn't make any sense, but those people can still read all of that (random) data. And that's where I get uncomfortable!
It's like I have stored my important belongings in a very strong locker and sent the locker into the "wild". The adversaries can see through it, but the locker camouflages the things inside. BUT, the things are still there in their hands, somewhere hidden inside the locker.
I don't want anyone to read any of my data at all, whether encrypted or not.
Is there any way of preventing the adversaries from accessing the (encrypted) data at all, even after releasing the data?
Note: Though I have specifically mentioned the above 2 online storage companies, but for me everyone is an adversary, from Google/Microsoft to the very capable Three-letter-agencies and their powerful governments. And I don't want them to access any of my data, even if it's encrypted.

Here is what you asked: "I want to hand the encrypted data to this party to store and process, but I don't want them to see the encrypted data."
That's not possible or realistic.
If you don't want them to have access to the data, then don't give them access. Don't give it to them.
You could try multiple levels of different encryption, but that's just encrypting in layers. They still see the encrypted data, just higher levels of it.
You could hide the encrypted data in other data so that they don't notice the data, but they could still notice it, if they looked for it.


Who other than my ISP can perform man-in-the-middle attacks? I've heard that not using https is dangerous because of man-in-the-middle attacks.

Now, if I connect to a server from my home computer, I assume traffic passes through my ISP, so they could eavesdrop if they are malicious.

But how can a random IP address "order" my traffic to go through their IP so they can scan it, as well?

Do hackers have the power to just start snooping on traffic between any 2 random IP addresses if they wish to?

Government agencies can do so (if they really want to) by using a subpoena on any of the intermediary providers or on any of the end nodes. A "random" IP "somewhere on the internet" cannot just listen in on your traffic. If it can not re-route traffic past himself then there is no chance of eaves dropping onto the connection.

Anyone who  has access to your transfer medium can theoretically snoop on your connection. This can be someone who's also connected to the same wireless AP as you or any of the ISPs between you and your end point.


Is it possible to make a login safe without a TLS certificate? I'm using free hosting and I would like to know if there is a way to have a safe login system without a TLS certificate.
All I do with this server is:
POST HTTP Request with username and hashed password, then search for those values on server, and reply with "x" for yes and "y" for no.
It's my first week working with databases and servers, this is why I'm not paying for a hosting service.

If the information is transmitted as hash to the server, and the answer from the server is NEVER the same (I mean, "x" is ALWAYS a different value and "y" is ALWAYS a different value), do I still need a TLS certificate?

The login is made on a desktop application and then is hashed and sent to the server.

There is no credit card info or any sensitive information, only username and password for MY application.

Please don't say "I don't know why you want to do it without TLS certificate because they are free" and such, I already talked with their support and they don't support TLS.

If you control the client and server software completely, you can re-implement enough of TLS for security without bothering with public key infrastructure (PKI) - the certs and such - by hard-coding the trusted public key(s) into your client. This is a terrible idea, though; TLS is really, really hard to get right (witness the constant stream of bugs in libraries like OpenSSL) and contains a lot of stuff learned in decades of trying to perfect transport-level security (SSL 1 was so insecure it was never published, SSL 2 was found to be insecure pretty shortly after publishing, SSL 3 was found to be insecure a few years ago and is deprecated, TLS 1 - essentially SSL 3.1 - has in turn been deprecated by newer versions, etc.).

Trying to do authentication without TLS or something like it is not going to be secure. Technically there exists a protocol, Secure Remote Password, for authenticating securely over an untrusted network, but it doesn't support registration (you need to have some other secure way to tell the server the user's credentials) so it is probably unsuitable for this. There exist ways to be secure against a passive eavesdropper, such as HTTP Digest authentication, but an active man-in-the-middle - which is easier to get than you might think - can still compromise such schemes.

If your hosting provider genuinely won't permit HTTPS (and dear $DEITY what is wrong with them?), find a different one. For hobby projects or small-scale prototypes, there are tons of free providers. While you're at it, have a care for how you store and look up passwords; simple hashing (even with a salt) is insufficient, and beware of issues like SQL injection. Additionally, if the server and client exchange any information other than the login request and response, make sure the other endpoints have adequate security (HTTPS or similar, but also proper authorization checks, no XML attacks, deserialization attacks, etc.; web services are easier to secure than web sites, but there's still a ton that can go wrong).


Exchange compromise affected company - should we 100% change administrator password? We host exchange on premise (exchange 2013).  We believe following MS's guides and guidelines that we were compromised regarding the exchange zero days hack.  We did find some .aspx files that did not appear to be from us in our inetpub directory.  From the article listed we followed this to find these aspx files:

To determine possible webshell activity, administrators should search
for aspx files in the following paths:
\inetpub\wwwroot\aspnet_client\ (any .aspx file under this folder or
sub folders) <exchange install path>\FrontEnd\HttpProxy\ecp\auth
(any file besides TimeoutLogoff.aspx) <exchange install
path>\FrontEnd\HttpProxy\owa\auth\ (any file or modified file that is
not part of a standard install) <exchange install
path>\FrontEnd\HttpProxy\owa\auth\Current\ (any aspx file in this
folder or subfolders) <exchange install
path>\FrontEnd\HttpProxy\owa\auth<folder with version number>\ (any
aspx file in this folder or subfolders)

We have patched the server immediately and ran the MSERT tool that microsoft has released across all of our servers.  We also took some additional security precautions like blocking the IP ranges listed from the article above on our firewall, as mentioned in the article:

Volexity has seen attackers leverage the following IP addresses.
Although these are tied to virtual private servers (VPSs) servers and
virtual private networks (VPNs), responders should investigate these
IP addresses on their networks and act accordingly:
103.77.192[.]219
104.140.114[.]110
104.250.191[.]110
108.61.246[.]56
149.28.14[.]163
157.230.221[.]198
167.99.168[.]251
185.250.151[.]72
192.81.208[.]169
203.160.69[.]66
211.56.98[.]146
5.254.43[.]18
5.2.69[.]14
80.92.205[.]81
91.192.103[.]43

All other servers were scanned and we are also using a tool called SentinelOne on all of our servers.
I'm not a network administrator but wanted to know if it is required to change our administrator password.
What is the probability that an attacker could somehow get this password?

Successful exploitation of these vulnerabilities allows an unauthenticated attacker to execute arbitrary code on vulnerable Exchange Servers, enabling the attacker to gain persistent system access, as well as access to files and mailboxes on the server and to credentials stored on that system. Successful exploitation may additionally enable the attacker to compromise trust and identity in a vulnerable network.

This is an excerpt from your link https://us-cert.cisa.gov/ncas/alerts/aa21-062a and given this I cannot think of a reason to not change administrator passwords as a minimum and immediately. As it says, credentials were potentially jeopardized and if these belonged to a domain admin (and not local admin on the exchange box) this could lead to compromise of the entire domain.
I am not a lawyer, but I do of course advise to follow whatever legalisation and company processes are set in place for a potential breach.


Security related code in Open Source projects? I have recently heard that most of the PHP code is confidential, because if attackers know your database structure or the hash function used to encrypt the passwords, there is higher chances of a breach.

I was wondering, if it's so, then what about open source projects where everything is wide out in the open?

This is called "security through obscurity", which is generally considered to be a bad security model for most (if not all) purposes.

There are two main terms focusing upon this concept:

Kerckhoff's principle:

  A cryptosystem should be secure even if everything about the system, except the key, is public knowledge.

Claude Shannon reformulated this later, in more generic terms, as Shannon's maxim:

  The enemy knows the system.

The point is that security should come from solid security concepts, rather than trying to hide information and algorithms. Cryptographically strong operations ensure security, whereas private code only ensures obscurity.


GET, "mailto" warning - how can I tell if a site is secure? My password manager is giving me a warning when I go to certain sites. They say if I think I can trust the site to go ahead and use it .... this leaves me concerned I'll miss something.

The pop-up warning I get when I go the sign-in page on the site:  "WEBSITE says 'LastPass detected a login form that is insecure. Would you like to continue?"

Here's the documentation.

My problem is I have no idea whether or not I should continue.

Questions:

How can I determine if a site is INSECURE because it is using GET or mailto: methods?
How can I determine if a site is SECURE if it is NOT using GET or mailto:  but LP thinks it does and it is a false-positive, etc.?
I followed up with one site where I was getting a warning and they said they are using AJAX and not GET ... is that an issue and how can I verify because they go on to say they will be addressing this issue soon which leaves me wondering if I can safely use the site?

I've asked LP about this and they don't go further than what I've shared above.

If the LastPass documentation is kept up to date with their source code, then you don't have to worry about false positives. (You may want to be concerned about false negatives instead.) Detecting a form which is sent via GET or mailto: is a comparatively easy task.

A GET request in HTTP (and HTTPS) is the most simple and widespread request method. It transfers (almost) all your data in the URL, i.e. in the same line of letters which is displayed in the address bar of your browser. Sending a form in an HTTP(S) GET request is not safe: here are the possible consequences.

The other method, dubbed mailto, is not actually an HTTP(s) request method, but rather a way to send your data via e-mail instead of a browser, HTTP and World Wide Web. Sending sensitive data via e-mail instead of an HTTPS POST request might be even less safe.

If you really have to use a Web site which does it either way, better a) evaluate your options and try to choose a site's competitor instead; b) read two links just above and evaluate your risks.

Regarding AJAX, it's basically an abstraction layer on top of HTTP(S). It might easily be implemented with GET requests: Wikipedia has a perfect example of this. So using AJAX alone isn't relevant to the question.

Some clarifications:

LastPass authors most likely are well aware of the fact that there are (sometimes, important) Web sites which do not follow best security practices. Thus, LastPass is not going to prevent using those Web sites at all costs, it just highlights an issue and leaves the burden of decision making for the user.
Sometimes, indeed, using GET or mailto: is somewhat (arguably, but) less of an issue. E.g. when the e-mail message is being sent to a device on
the local network, or when a GET request ends on the localhost. LastPass cannot reliably detect those exceptions, here's why it only displays a warning.
I believe that if LastPass has detected usage of those methods, you can be pretty sure that either of those methods is, in fact, being used. Developer tools ("network" tab) may help to track it down.
Once again, using AJAX alone doesn't mean that the form isn't being sent in a GET request. It might be either way. Pretending that a Web site isn't using GET requests because it's using AJAX is plain silly.


Metasploitable ports closed and web server unavailable I have setup a fresh VirtualBox install of both Kali Linux and Metasploitable.  I did an ifconfig on the Metasploitable VM and tried to access it through the browser, but that gives the message The 10.0.2.15 page isn’t working

From Kali I am able to successfully ping the Metasploitable VM, but can't access the web server.  When I run nmap it reports All 65536 scanned ports on 10.0.2.15 are closed instead of showing the expected open ports.

The problem is that Kali's nmap is trying to scan your HOST system instead of metasploitable.  This is the only solution that worked for me, hope it helps you, as I also had a inet addr: 10.0.2.15.

Click on Metasploitable in VB
Click settings
Select network
Change NAT to Bridged Adapter
Repeat with Kali
Enjoy a working nmap!


Rainbowtable - Start with plain text I know how to use rainbow tables. I've already read the other questions this topic here.

Well but there is still one question left. As an attacker, I usually have a hash value of a password and everything I read says that you have to start at the end of a chain and then apply the reduction function, the hash function an so on, until you find the given hash value.

Another way to get the password could be to start with the plaintext, calculate the hash, reduce the hash until I find my given Hash value. So there is no need to reconstruct the complete chain.

Why do I have to start with a hash value and not with a plaintext?

Rainbow tables and hash tables pre-calculate password hash data. The point of them is to greatly reduce the time it takes to recover passwords by using computing resources before they are needed.

I'm not sure what you mean by start with a hash value, so here are multiple answers:

You may be asking why you match a pre-calculated hash to a target hash, rather than looking at the password possibilities first. If you are talking rainbow tables then you cannot pick a specific list of plaintext values to try, that's now how rainbow tables work. With hash tables if you want to find out the password for a given hash the most efficient way to do it is to do a db lookup on it. If you were looking for specific passwords in a list of hashes then you could limit the lookup to specific password plaintext, in my view that would be a bit pointless.
If you are talking about calculating hashes and comparing them to hashed passwords then you are describing a completely different technique, either a brute force or dictionary attack. If you have rainbow tables and hash tables that would be a complete waste of time, kind of like turning a speedboat's engines off and using oars instead


.onion entries in hosts file I opened my %WINDIR%\system32\drivers\etc\hosts file & I found the following entries there

0.0.0.0 gx7ekbenv2riucmf.onion
0.0.0.0 57g7spgrzlojinas.onion
0.0.0.0 Xxlvbrloxvriy2c5.onion
0.0.0.0 76jdd2ir2embyv47.onion
0.0.0.0 cwwnhwhlz52maqm7.onion
0.0.0.0 sqjolphimrr7jqw6.onion

Now, I open my hosts file quite frequently & this is the first time I have seen this. So this is quite recent.

Googling, I found that this has something to do with TOR. Now, I have never installed TOR on my machine, so how did I get these entries in my hosts file - is it some malware which has added this?

I googled the first onion address and found this: https://blog.cyren.com/articles/wannacrypt-ransomware-spreads-via-nsa-exploit

Those are WannaCry command and control servers. It appears that some protection technology is blocking WannaCry from downloading to your computer (by setting 0.0.0.0 as the destination).


Is context establishment a repetitive process in standard ISO 27005? I am writing our internal information security risk management procedure. This procedure should describe how exactly we do our risk identification, assessment, treatment and monitoring.

I wanted to follow ISO 27005, but I am stuck in Context Establishment section. Is this a one time process that I have to define in my procedure or is this a repetitive task that has to be done in the beginning of each risk assessment process (given that risk assessment conducted for certain limited scope such as a web service)?

If you have one could you share an example of your procedure or at least the part that matches Context Establishment section?

TL;DR:

  [...] is this a repetitive task that has to be done in the beginning of each risk assessment process (given that risk assessment conducted for certain limited scope such as a web service)?

Exactly. But the part you put in brackets is really important. Take a look at this picture.

You can see here that context establishment takes place before every risk assessment. The scope is defined within the context establishment.

Long answer:

First of all, we have to answer the following question:

What does 'context' mean within the ISO/IEC 27005?

Consider the following note:

  ISO/IEC 27001:2005 does not use the term “context”. However, all of Clause 7in ISO/IEC 27005 relates to the requirements “define the scope and boundaries of the ISMS” [4.2.1 a)], “define an ISMS policy” [4.2.1 b)] and “define the risk assessment approach” [4.2.1 c)], specified in ISO/IEC 27001:2005.

and the output of the context establishment process:

  Output: The specification of basic criteria, the scope and boundaries**, and the organization for the information security risk management process.

These three "items" establish the context.

Basic criteria

Basic criteria are the criteria that detail your risk management process. These criteria follow your risk management approach and this approach follows the objectives and the scope of your risk management.

Basic criteria can be:

Risk evaluation criteria
Impact criteria
Risk acceptance criteria

I don't want to go into these criteria too much, because they are all well described within the norm.

Scope and boundaries

The scope and boundaries always refer to the information security risk management. They need to be defined to "ensure that all relevant
assets are taken into account in the risk assessment. In addition, the boundaries need to be identified to address those risks that might arise through these boundaries."

This part is crucial and probably the most complicated in the whole process. If your scope is too wide, the gathering of information can take so much time, that once you are done you have to start over again, because so much has changed in the meantime. The more time you need, the more money and ressources will be spent. If your scope is too narrow, you will exclude a lot of and important information and therefore a lot of possible risks. The worst part about this: there is no standard or "good" recipe for this. If you have never done this before, get help from the outside and go through this process step by step.

Important note that is often forgotten: "Additionally, the organization should provide justification for any exclusion from the scope."
Do not just leave parts of your organization out. This isn't only meaningful for an audit, but it's also helpful for you and your team. Why would you choose a scope the way you did and why does it make more sense than any other way?

Organization for information security risk management

This one is pretty easy (to understand): your risk management process has to be organized. Roles and responsibilities have to be alloted, and all formal activities that come with a risk management process have to be conducted. This is all very straightforward and highly formalized.

All quotes as well as the figure are taken from ISO/IEC 27005, Second Edition 2011-06-01


How does formal verification guarantee secure, error-free code? I've read that code is formally verified by constructing a mathematical model of the code, and then a formal proof is provided to demonstrate that this model meets certain requirements. How does formal verification ensure that the resulting code is free of any vulnerability?

It doesn't guarantee that the code is free of vulnerability.  However, if verification is used appropriately, it can increase assurance (confidence) that the application is secure.

Speaking from a very broad perspective, there are two aspects of this problem:

Verification. Given a mathematical model of the system and a mathematical specification of the requirements, does the system meet the specs?
Validation. Do we have the right set of requirements? Does the mathematical spec accurately reflect the true requirements? Does the mathematical model accurately and completely correspond to the code?

Sometimes people focus only on verification, but both matter.

In your situation, if the specification incorporates all relevant security requirements, and if the mathematical model correctly corresponds to the code, and if the verification is done appropriately and is successful, then we may have a basis for significantly increased assurance that the system will meet our security requirements.

In the best case, verification can be a powerful tool to help assure security, one of the most powerful that we have.  However, as with anything, it is possible to misuse the technology or get a false sense of security if it is not used appropriately.  One of the most common failure modes is that the verification process does not verify all relevant security requirements (some are overlooked or omitted).

To say much more might require delving into the details of the system, the security requirements, and the nature of the verification that was done, but hopefully this gives you an overview.


Security implications of shared credentials on private APN It is common for public APNs to use shared credentials - nearly all mobile networks in the UK use the same credentials across all phones (see here for an example).

In M2M applications such as intruder alarm signalling, remote plant monitoring and smart metering, it is common for private APNs to be used instead of the network wide APNs used by phones. I am not sure what the motivation is behind the use of a private APN over a public APN (this previous question doesn't provide much insight)

The use of private vs public APNs is frequently pitched in marketing material as being more secure. Most of these same systems have no additional security (e.g. using a VPN, HTTPS or otherwise) and rely of the security of the GSM/GPRS communication channel.

In addition to this, for the systems I have been reverse engineering, I have found that they all use the same APN credentials across all devices. For example, all the usernames are 'triplecomgprs' and all the passwords are 'Q87363546'.

What are the security implications of all devices using the same credentials for the APN?

The only significant difference that I can find is using the APN itself as a level of authentication, vs using additional information such as your device's hardware IDs.

In practice, it's easier to have a single image, with a single config file pre-setting the APN you want to use, then use your hardware ID (MAC, IMEI, etc.) for authentication and determining what you're allowed to access (and log it accordingly).  This also makes support easier, since a single help entry (like the one you linked) will provide the answer for all users, without thought; requiring they know / look up their own information, find where to put it in, and manually enter it, is far more complex, and often results in more support requests.

So using private APNs would result in increased security (or rather, increase the potential maximum security), but using public significantly reduces support burden and improves ease-of-use by less-technical users.


Is it bad if somebody gets a hold of my public root CA? We're in the final stages of launching a moderatley complex IoT solution, and unfortunately there's nothing resembling a security expert on board. But so far everything looks reasonably secured... everything except for the SD-cards in the distributed devices, that is, and I'm debating whether it is worth to encrypt them, or if it's wasted effort. Which is where I need advice from people more experienced than I am.

Basically, if somebody were to steal a device and/or its SD card, he'd have access to the following things:

A root CA certificate common to all devices that is used in a two-way handshake with an MQTT broker.
A public and private key used for encrypting that communication, only used by the specific device. These two can be revoked as soon as we know that a device disappeared.

A root CA certificate common to all devices that is used in a two-way handshake with a VPN server, used for remote maintenance.
A public and private key used for encrypting communication with the VPN, only used by the specific device and bound to its hostname. Again, these two can be revoked in a heartbeat without changing anything in the rest of the system.

A public SSH-key common to all devices used for remote maintenance.

As far as I understood things, the encryption keys for vpn and mqtt-broker are worthless once revoked, and the public SSH-key does not compromise the security of the other devices even if they share it.
What I am unsure about are the CAs... From what I've read they are useless without the private key and valid encryption certificates, but I'd really like to be certain on that point.

Given the situation, what would you recommend? To encrypt or not to encrypt the SD-card? Since this is an already rather computation-heavy IoT solution running mostly on RasPis, I don't want to take the additional overhead of an encrypted partition unless security would really be compromised if somebody got a hold of it.

A public and private key used for encrypting that communication, only
  used by the specific device.

This suggests the private key is present on the devices as well. It has to be, otherwise decryption and signatures are not possible. It does pose a security major threat. Nothing stops someone from copying the private key, and together with the public key are worth a whole lot. Now, an attacker can sign new certificates, decrypt all traffic, alter data and so on.

  Again, these two can be revoked in a heartbeat without changing
  anything in the rest of the system.

Revocation is no rescue and you should be careful relying on this alone. CRLs are (almost) never checked realtime, and can be blocked by an attacker. You'll have to setup the entire OCSP (stapling) infrastructure before you can put some trust in a revocation solution. Same is true for the VPN certificates, probably worse since an attack could easily gain access to the server as well, causing even more trouble.

Encryption can help you. For example you can encrypt the SD card, then decrypt the card once when mounted. The key is stored in memory, which is not without problems either, but prevents someone from removing the SD card and read the confidential data. Obviously this only works when the device itself is 'secure' and cannot be accessed via other ports.

As an additional security measure you could require a stapled OCSP response every so many bytes/hours/days. If this window expires without confirmation of the certificate still being valid, then destroy the private key and notify an administrator.


Website attack: What is the attacker's goal? A bot network(?) has been after my website for quite a while now. Here is a breakdown of what they do:

They register several accounts using random characters for building a first and last name which look like this:
HludvkxTGVIwP oBScrLdvJ
AicSJbYk uWrVKZtSdTNAv
...

The email addresses used for these profiles seem to be valid email addresses from real people but I can not say whether they are just used by the attacker or if they have actual control over those addresses. What I do know, though: The emails are never confirmed by the link sent to those newly registered accounts.

The attacker then goes to the password retrieval page and sends "new password" requests which is weird as I think they don't receive the answer because of the lack of control over the email used in the profiles created …

I would like to understand what the attacker is trying to achieve in order to evaluate if this is a threat. Why would he send password requests for an account just created by themselves a minute ago?
The ip addresses change all the time, so it seems to be a network.

I would like to understand what the attacker is trying to achieve in order to evaluate if this is a threat.

From the points you listed, the symptoms points to DOS attack. Try captcha (only a suggestion: google recaptcha v3) as a means of protection against BOT based resource consumption attacks for web facing tech.

Why would he send password requests for an account just created by themselves a minute ago?

The accounts are all valid and password reset link works as mail bombing attempt. Kindly implement captcha or alternative control to prevent this from occurring.
If the mails are tagged spam instead of receiver hitting unsubscribe due to multiple similar pointless mails, it may hurt your reputation in long term and mails from your domain will soon be blocked my multiple spam filters regularly.


How can you be tracked using screen resolution/monitor size in Tor? Whenever I maximize the Tor browser, it shows a warning:

  Maximizing Tor Browser can allow websites to determine you monitor size, which can be used to track you...

How can screen resolution or monitor size be used to track a person?

All Tor browser users are asked to surf pages using the default window size. So if you follow this practice, you are just like other users; I mean the screen resolution won't be used as a factor to identify you.

From here, you can read an interesting comment that fits your question:

  Using an unusual screen resolution was sufficient to identify me
  uniquely to panopticlick. With my portrait mode screen resolution of
  1200 wide by 1920 high, the default window size of 1000x1765 was
  unique, no resizing or maximizing needed.

Visit browswerspy webpage that implements a demo where you can find out information about your screen including width, height, DPI, color depth, font smoothing.

Conclusion: do not distinguish yourself from others. Act as everybody else.


How to sync with multiple authentication services? I have a peculiar case to work on. We are using a proprietary product which supports LDAP integration.

However, it can be configured to use only one LDAP service. (most of the products are shipped that way).

Now, our customers want to login to this product with their own authentication authority.

So, the question is, Am I looking at single Sign-on?

We basically need some service which can sync all these authentication services (e.g. Windows Active directory, Tivoli access manager, Redhat Directory Server...and many more) and then integrate with our application.

If your application is constrained to a single LDAP server and does not have its own pluggable authentication, you will need a directory server with a pluggable back end. This architecture enables a single directory server to access multiple types of account databases/directories and expose them via LDAP. I would recommend OpenLDAP for this purpose.

Since the three products you mention are implementations of LDAP and are generally compliant, you can proxy those services using OpenLDAP's Metadirectory backend.

For services which aren't LDAP-compliant, you can use the Perl/Shell backend. The Java API may be a more stable long-term solution, but you can quickly prototype solutions with Perl by creating a module for OpenLDAP and importing other open-source Perl packages to do the heavy lifting of authentication. This backend also allows executing external binaries via the shell.


Keystrokes to text converter method? (from an audio file, from previously recorded sounds of keystrokes) I have an e.g.: WAV file that contains the sounds of a man typing on his keyboard (English or any language)

How can I convert this WAV file to a TXT file? I mean are there any scripts/programs that can convert it? (Using e.g.: statistical methods, like "e" is often used in e.g.: English, etc.)
Thank you!

This is called "Keyboard Acoustic Emanations" and I don't think there is anything available publicly as a tool.

There has been research on the subject, the most notable being this: http://berkeley.edu/news/media/releases/2005/09/14_key.shtml  (paper: http://www.cs.berkeley.edu/~zl/papers/keyboard-ccs05.pdf presentation: http://www.cs.berkeley.edu/~zl/ppt/keyboard-ccs05.ppt )

There is one real program I'm aware of that can translate from sounds of typing to text, but it works if the user types in Morse Code :-)


How do hackers use RATs without their server/IP being revealed? When hackers put trojan horses on someones PC, those programs (which are, by definition, just stealthy RATs with some... extra features) need to communicate with them somehow. A direct peer-to-peer connection to their own PC is obviously impossible due to NATs being installed in pretty much any modern Network. Even if they used port forwarding or more obscure techniques like UDP hole punching, their IP address would instantly be revealed to anyone investigating the attacked PC.

So, to my understanding, they'd need to use some kind of server. Is there a way for them to anonymously purchase servers so that they can't be traced back? Or can they use proxys/VPN's on the victim's PC + port forwarding in their own network to not only hide their target's IP to the ISP but also their own IP to anyone investigating their victim's PC? This surely must be impossible since the IP has to be stored somewhere within the binary, right?

Malware communication is today often done to some central servers where both the malware and the attacker connect to and thus can build a communication channel. Variations can include multiple servers or malware and attacker connecting to different systems which then build a connection to each other. It is thus some kind of proxy architecture and not a direct connection. But there are also P2P architectures in use for malware communication.

  This surely must be impossible since the IP has to be stored somewhere within the binary, right?

The target IP address does not need to be stored but there needs to be a way to determine it. Directly using the IP address is too inflexible and also allows to easily detect and block the malware communication by just detecting and blocking this target IP address.

Using a DNS name is more flexible since the attacker can switch the current addresses for a domain name he owns. But it can also easily be detected and blocked as long as the infected system is using a name server controlled by the defender. Some malware therefore uses a different name server (which is not too hard to detect either) and some even switches to DNS over HTTPS which is much harder to detect and analyze.

Other methods include the deterministic dynamic generation of domain names (DGA - domain generation algorithm) so that blocking of a single domain name is no longer enough. This often requires reverse engineering the malware to reconstruct the algorithm of the DGA or to detect the use of generated domain names based on their syntax or behavior (typically using statistical analysis and machine learning).

And then there is malware which uses seemingly unsuspicious communication channels to find the current location of their peers or to get instructions, like Twitter or Instagram or DNS. Communication to this seemingly innocent targets is much harder to detect and block especially if done encrypted but might be done by analyzing traffic patterns or peculiarities of the TLS handshake. But this needs even more effort by the defender then in the previous cases, which also means that it costs more performance and that the necessary equipment is more expensive.


Choosing a good password - again There are many password-related questions in here, but I failed to find the answer to mine. I'm no expert so maybe I don't have the right keywords. Sorry for any duplicate for a possibly asked 100 times question.

I'm just a regular user who wants to have good password. From what I understood, the best solution is to have a (good) password manager. The problem with password manager, is that, for the few I know, you can't access your account on a given website from someone else laptop (Unless, maybe, if you install the password manager app on that laptop and sync it with your account, which is still annoying).

Then, there is the tradeoff about basically, entropy of the password, the fact that you need to remember it, and the fact that you should not use twice the same password.

So I was wondering if there was any special added security by doing the following:

take an easy password : eg : foo
go to website website.com
apply to it a simple function that transform foo_website.com to say, 1634d6f7c5148738bfac403c2a59fdf1
use that as a password to sign in on website.com

The advantage compare to a password manager is that I can generate my password from any laptop if I remember both the password and the function. Here the password is a md5 hash and md5 which is implemented on many machines, so nothing to remember but foo.

My questions are:

Is there any password manager that satisfy the need to log on from another computer (which is not yours)
Otherwise, is that scheme providing a good compromise in this multiple trade-off situation, or is just as bad as re-using the same password whatever the entropy of it.
[NEW!] How easy is it to crack a function, be it simple, not even knowing if a function is used ? Say, I'm a target, how can one crack my password or my function ?
Finally, I've seen that some of you were using the concept of low-tech password.txt file [edit] as a mean to manage password [\edit]. What does it mean ? Is it just a plain text file with all your password ? How safe is this ?

Also, note that I don't have any smartphone, and that I'm aware that it won't be better than a password manager and that security comes at the expense usability. I'm wondering whether doing this would add a significant layer of security, compare to having different very strong password that you remember (putting aside password manager).

Your attempt to establish the theory behind the creation of the password has some shortcomings to it. Let me explain

Taking an easy password like foo and the attempt to transform for_website.com will lead to the attacker creating a set of files that would allow him to crack into the simple function and  then generate a list of all the hashes using a combination of dictionary attack and a list of most your used websites and use that as one of the input to the password cracker. Which is why crypto-graphic algorithms are somewhat complex in their working.

To answer your other question:

Use a password manager on your mobility device. Try some of the apps available on your OS store.
I would say it as bad as it. Because there is no significant gain in the security. You would be better off using other available proven methods.
Totally depends on the context. Generally means a list of passwords in a text file that could be used as input in cracking tools or could also mean a list of compromised passwords.


Can importing an .ics file be dangerous? Can there theoretically be any possible malicious code hidden in .ics files, which would steal your calendar data or something similar? For an example case, we'd be importing the .ics file into Google Calendar.

The real risk here would be the application importing the .ics file, the file in itself is harmless. Only if that application would improperly handle parts of the file content you would be at risk. With Google Calendar, I think those chances are very, very slim.


Logging into remote server via SSH using VPN (Wireguard). Is it foolproof? I have a remote server into which I login via ssh. On this server I have setup a Wireguard VPN to which my host connects. The ssh server (ssh daemon) listens on a private IP interface (the server's Wireguard interface). It seems to me that the only way to get into my remote server (even try to) would be to have my Wireguard connection file (including the shared password and the private password) + have my private SSH key + (I think that's the easy part if the attacker were to get this far) know the private interface's IP.
Oh, and another detail, I only let the private VPN IP addresses through the firewall to the SSH port.
So I was wondering - is this method foolproof or might I be missing something? Seems to me like even if I were to allow empty passwords, without my Wireguard connection to the server the attacker still couldn't get into my remote server.
P.S. Foolproof, as in, if my host's Wireguard conf and SSH private key doesn't get compromised (at which point only a password on the SSH key would stall the attacker, I think)
Thanks!

It is foolproof in the sense that someone can only gain access if they have your credentials, or if there is a vulnerability in Wireguard. But in the same sense, exposing an SSH server is foolproof.
The most attractive aspect of this setup is probably that Wireguard exposes a smaller attack surface than SSH.
Whether this is a good architecture depends on your exact goals and on your threat model. Whereas having to log in into through two separate systems (Wireguard and SSH) and reducing the attack surface can increase security, it could also decrease security aspects such as availability: there are now two critical systems instead of one, and misconfiguring any would deny you access. For the threat that credentials on your client system might be compromised, you've correctly analysed that adding Wireguard does not add security.
That an attacker would need to know a particular IP address should not be assumed to add any security (see: security by obscurity, Kerckhoffs's principle).


Logging in users automatically on a website I'm making a website that has an extended forum feature, where users can login, post comments, etc. I'm making the feature where the website stores cookies in your computer so the next time you visit the website, it logs you in automatically.

I've heard not to store explicit username and password in a cookie. So I decided to store the user id in my database as a cookie value. Essentially, all information when you use the site can be obtained by querying the database again by this user ID.

Then I just realized that if you manually edit your cookie and place a random user ID, anyone would be able to access any account! All the functions in the website such as new comment, new topic etc. are can be accessed just by supplying your user ID.

What is the correct way to have users log in automatically on my site without exposing it so anyone can log in?

Create a cryptographically secure random token and associate it with the user id in your DB
Perform an HMAC on the token
the cookie value will then be token+HMAC

This way an attacker would have to know your HMAC key in order to brute force the token and that is not possible.

For validating the cookie you first extract the HMAC, validate the authenticity of the token and then you can check your database and extract the user id that is associated to it. After a few failed HMAC validations you can block the user since not even one HMAC validation should fail and it means someone is trying to attack you.

It is important to keep the security of the cookie by:

Set HttpOnly flag to true - so cookie cannot be accessed from javascript
Set the Secure flag to true - so cookie will only be transmitted via https and cannot be sniffed over the network
Set a reasonable expiration time to the cookie so your user's don't stay logged on forever
Set the cookie domain to make sure it is not leaked to any subdomains where you do not intend it to go


Secure erase iOS devices All iOS devices from the iPhone 3GS have a hardware encryption chip, right?

When you erase an iOS device with the "Erase All Content and Settings" menu item or via Remote Wipe the encryption keys are deleted. However, the data is still present on the device in an encrypted state.

Does this mean that forensic experts or perhaps anyone with the right tools can retrieve the data and decrypt it by other means?

Has Apple left a backdoor of some kind for law enforcement and security professionals?

As an aside there is an app called iShredder that claims to use various military grade wipe algorithms that can wipe your iOS device, but I don't see how this is possible as all iOS apps are sandboxed.

UPDATE: I know understand what iShredder does after Jonathan Garber's and Lucas Kauffman's comments.

When you do a remote whipe on your iphone, the encryption keys are deleted making the data unreadable. However, if you later find your iphone you can restore your data using mobileme to re-download the encryption keys. So the encryption keys are still stored on Apple servers.

Hence, it would make sense that law enforcement can certainly ask Apple for the encryption keys stored on their servers. Also, I am not sure what sort of encryption algorithm the iphone uses, it might not be so hard to intelligently brute force the encryption keys.

EDIT: by doing some googling, I cam across this: http://www.iosresearch.org/ and https://viaforensics.com/resources/white-papers/iphone-forensics/. However, it looks like Zdziarski method requires the hardware encryption keys to be present on the device.


Could this login form be "hacked" to allow access? We have this legacy website which has horrendous code in it. I have just been looking through the login form/code and can see un-sanitised sql queries. E.g. in a nutshell:

$email=$_POST['email'];
$password = $_POST['password'];

$query = "SELECT aes_decrypt(password, 'asdasdasd') AS password FROM users WHERE email='$email'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);

if($password == $row['password']){
    // set cookies and redirect user etc etc
}
else {
    // error not correct login details
}

My question is, I realise that this is bad because of SQL injection. And I know the basics of that. i.e. You could put '; DROP ALL TABLES; -- and that would "cause havoc".

Can anything more "interesting" or "useful" (to the potential hacker) be done? I.e., can you output a list of passwords, or download the tables with this? Or could you manage to log yourself in as a user of the site, for instance if you only know their email address?

Mainly for interest, but also for better insight (and therein finding better approaches to coding).

Well, with this, you can easily login with just the email, here's why :

The default query is :

SELECT aes_decrypt(password, 'asdasdasd') AS password FROM users WHERE email='$email';

Which mean, if :

$email = "bob@gmail.com";
SELECT aes_decrypt(password, 'asdasdasd') AS password FROM users WHERE email='bob@gmail.com';

Now, If I do this instead :

$email = "dontcare' UNION SELECT "mypass" AS password FROM users WHERE email='bob@gmail.com' LIMIT 1, 1";
$pass = "mypass";
SELECT aes_decrypt(password, 'asdasdasd') AS password FROM users WHERE email='dontcare' UNION SELECT "mypass" AS password FROM users WHERE email='bob@gmail.com' LIMIT 1, 1

Your code will receive the second query, get the password that will match "mypass", return true, so will auth me for the bob@gmail.com account.

Now, with "just" the code you showed us, an attacker can't display a whole table, but since the author of the code didn't take care of securing user input, I'd say that if it's not in that piece of code, there is a high probability that it's still possible some place else.


What is the best way to perform penetration tests for free with and without software? Is there any software or hardware that will perform penetration tests without a paid subscription? i.e. Free to use like Kali-linux etc. I would like to learn how to perform penetration tests. If there are any websites or guides that you suggest I would appreciate it.

I would like to carry out penetration tests on wireless routers and servers such as Windows, Mac OS X, and Linux devices.

Is it possible to pentest from an Android, iOS, Linux, Blackberry device?

Thank you.

What is a penetration test?

A penetration test, or a pentest, differs from vulnerability scanning, and from vulnerability assessments.

What's a vulnerability scan?

A vulnerability scan uses automated scanning to perform breadth-first identification of vulnerabilities. This is to say that the scanning attempts to identify vulnerabilities through misconfigurations, such as leaving the Tomcat manager interface available, web applications that have XSS or SQL injection vulnerabilities, and various network and web application issues. A number of products exist for this on the market. Some are free, some are not.

This is often the first part of an enterprise information security program to identify, quantify, and classify risks. It does not go any deeper than identification of potential vulnerabilities. It is up to a human to confirm if the issues are real or not.

What is a vulnerability assessment?

A vuln assessment is often manually done by a human. This is breadth-first testing. Like the scanning done above, it does not go any deeper than identification of vulnerabilities. The difference is that a human is looking for problems rather than a scanner. This is a benefit as well as a con. The benefit is that a human is able to determine complex application logic flows and look for issues that a scanning tool cannot look for, either because it doesn't have the right signatures, or because of safety, such as a service unable to handle a scanning tool. It is not a penetration test.

What is a penetration test then?

A penetration test is a depth-first test. It includes vulnerability assessments, but goes deeper. The pentester, the human performing the engagement, not only identifies issues, but exploits them to go as deep as possible. For example, this would be not only confirming that SQL injection is present, but exploiting it to steal data, execute malicious server commands, or to modify data.

Because of this intensive process that requires human skill, only parts of the engagement can be automated. A human is very much required to perform the engagement.

So can I get hardware or software to do a pentest?

No. Tools exist for automating scanning, but not for automating penetration testing in its entirety. Kali Linux and similar distros provide tools that are necessary (eg masscan or nmap) and tools that are useful (eg metasploit), but the underlying human element is necessary to make sense of the tool output, explore the applications and networks, and exploit the vulnerabilities.


For remotely unlocking LUKS volumes via SSH, how can I verify integrity before sending passphrase? Although this is closely related to the recently closed question Evil maids in the server room [closed], I believe that it's more answerable.

I'd like to unlock LUKS volumes on remotely hosted servers, using initramfs with BusyBox, and Dropbear as SSH server. In the answer to the closed question cited above, paj28 notes:

 Remote boot techniques like dropbear are vulnerable to a remote variant of
 the evil maid attack. For example, someone with physical access could tamper
 with the dropbear partition, and have it leak the key on the next reboot.

The attack is also described in LUKS mermaids of remote unlock.

In the BusyBox initramfs environment, I'd like to verify the integrity of a remote server before sending the passphrase for unlocking LUKS. I can verify file integrity by checking sha256 checksums against a local list. But would that detect modification of the initramfs to capture the passphrase?

I can easily get eth0's MAC, and I can use traceroute to detect changes in the network environment. Perhaps I can add hwinfo to the initramfs to confirm the hardware environment. What changes could go undetected by those tests?

I'm not asking for a solution, but if there's an elegant one that I'm missing, please let me know.

You don't. You can't.

The best you can do is a trusted boot pathway using TPM which you make part of the partition unlocking process. But unless the hardware is locked to your personal signing key (which it probably isn't), then even that can be subverted.

Still, TPM is probably the closest you can get. This is non-trivial to implement, and it is unlikely that you'll find an off-the-shelf solution for this.


Storing info in JWT payload Currently, the access token expires in 15 minutes and the only info stored in the payload is the user id.

Each user has a balance which he can use inside the app. Should I query the database on each request so I can pull the balance? Would it be unsafe to store it the payload?

tl/dr: Although you could store the balance in your JWT and it would
  be safe from tampering, there are many ways in which the balance in
  the JWT might be technically valid but still incorrect. Therefore, you are probably best
  off checking the balance in the database everytime, and you certainly
  need to check it before making any transactions

There are two kinds of JWTs:

JWS: Payload is in "plain text" and has a signature to confirm its contents
JWE: The payload is completely encrypted.

These have slightly different use-cases.  If all you need to do is verify that the data stored in the JWT is correct and has not been tampered with, then a JWS is fine (presuming you implement it properly and verify the signature on all requests).  Therefore, you could store the balance in a JWS and later confirm that the reported balance is what you originally stored.

If you also want to keep the data private, then you can use a JWE.  The encryption will also guarantee that the data is not modified (again, assuming you properly implement the JWE).  Note that the only person who normally has access to the JWT is the end user,  so we're talking about keeping it private from them - probably not necessary for your use case (h/t EdC).

Therefore, the balance is safe from tampering.

In either case you should check the balance with the database before making an actual transaction though because:

The balance might still be wrong. If another transaction was made without updating a JWT, or if an old JWT is presented (aka a replay attack), then you can have a valid JWT that has the incorrect balance.  This is very likely even without active attackers.  Consider a user who uses more than 1 app.  In your hypothetical scenario, what happens if a balance is stored in a JWT in one device, and then the user logs into another device and makes a transaction?  The data in the JWT for the first device is now incorrect, even though the JWT itself is valid and has not expired. This is just one of many ways in which valid but incorrect JWTs may happen.

There are many possible ways to fix issues with outdated data in a JWT, but in the end those fixes might be more work then simply checking the database every time.  However, that's a balancing act that ultimately is up to you!  There isn't one right answer there.


Can someone figure out the encryption method? Is there a way to decrypt a database if I know the encrypted and decrypted state of the data? We have old software at work (VB) that needs rewriting, problem is that the database is encrypted. I can query the old software for individual entries, and see the corresponding encrypted data in the DB, but the database is about 1000 entries long and I wouldn't want to do this by hand. I can give you some examples:

Unencrypted Data   Corresponding encrypted data
0264/592636        /2Q0Z3MfVTGAgILN2krVfmp+lYs=
0264/591410        /2Q0Z3MfVTGAlWGWetMmvNarF6s=
0264/591548        /2Q0Z3MfVTGAlWNdmW96pgsiQxE=
0264/402559        /2Q0Z3MfUzia9nqAJug5dVxNbto=
0364/888890        /2Q0Z3MfakAgSr1LCbMmjJ6D6tM=

There are three solutions here:

Try to find the encryption method. It can be something custom, it can be encrypted in all sorts of weird ways, and you might need a key from somewhere. This is what you are trying to do now.
Find the code that encrypts/decrypts the data.
Write a script that simply calls the decrypt function for all records.

I'm not sure which is easier, 2 or 3, but trying to figure out what kinda code this is doesn't seem like the way to go.

Moreover, this is a problem specifically for you. It's not useful for future readers if it was solved using solution 1, thus the question would be closed as too localized.

I don't know why you didn't try solution 2 actually, can't you read VB well enough to find it or so? I don't mean it accusing, but if you can't find the code or script something to fix it (solution 3), you might want to find someone who can. It would probably save you (and anyone trying to find what encryption it is) a lot of time.


Google Analytics use of JSONP, what are the security risks? These days Google Analytics uses a JSONP request to load ga.js into user's web pages via a callback function.  According to the Wikipedia, JSONP can "inject any content into a website."

What exactly does this mean?  Is there any way to access local storage, variables in RAM (private keys for example)?  Are attacks limited to UI attacks (like a fake dialog)?

Wouldn't it be much better to have a more advanced easily readable JavaScript script on the user's web site posting to ga.js in an iframe via postMessage?  It seems like you could post anything you want this way while making it clear in a site audit what information is being sent while securing the remote JavaScript.

https://developers.google.com/analytics/devguides/collection/gajs/
https://en.wikipedia.org/wiki/JSONP#Security_concerns

Possible solution (if needed, in the form of a question)

Is Google Analytics HIPAA compliant? How can I find out?

Any time you include script from an external domain you are trusting that domain. e.g. if you site is example.com and you have the following code on your home page

<script src="//example.edu/tracking_script.js"></script>

then example.com is fully trusting example.edu not to do anything malicious inside tracking_script.js. example.edu will have full control of client-side scripting and could do anything a client-side script hosted on example.com could do.

The same goes with Google Analytics - you are adding the script code to your page that creates the external js reference. If Google wanted to, they could adapt their script to do anything client-side to your pages. The same goes for a situation where Google Analytics website is compromised - any attacker will control all domains using Analytics.

Discounting anything malicious, the advantage of this to Google is that they can update the Analytics client-side code without webmasters having to do any updates on their side. So if they update a server-side function, they can update the client-side counterpart appropriately and every site in the world will automatically run the new client-side code for their visitors.

postMessage, while it maintains a security perimeter between your domain and GA's, would not permit any client-side script updates that may be necessary for GA to function after a server-side update. (Note that you do not need an IFrame for secure cross-domain communication, CORS enabled on Google's side would allow your site to send a HTTP POST request to register each page visit.)

When using a Google product, you will be pretty safe including the script referencing - so there is little requirement for this to be done in a different manner. However, having script references to lesser known entities whose security might not be quite upto the standard of Google's may be of cause for concern. In those instances it would be prudent to rely on a more secure client-side technology rather than that of JSONP.


Do dictionary attacks only use specific entries from a dictionary, or combinations of an entry? If I wanted to crack a password, "cba", but the dictionary I was using only had abc in it, does a dictionary attack try all combinations of abc? abc, acb, bca, bac, cba, cab

Or would cba have to be specified in the dictionary in order to try it?

The most powerful feature of oclHashcat is the rule based attack. The rule engine can accept characters to rotate the passwords in the list, so using the '{' character in the rule file will rotate the word left by one char. 'abc' will become 'bca', then 'cab'. You can also reverse the word using 'r', 'abc' will become 'cba', then rotate left or right if you wish. This barely scratches the surface. Check:

https://hashcat.net/wiki/doku.php?id=rule_based_attack


How does malware avoid AV's when using a simple DLL injection technique? As far as I understand it, a simple approach for a malware DLL injection would require 2 DLLs. The first for the DLL side loading, while the malicious DLL remains encrypted. And then this 'loader' would decrypt the DLL and inject the payload into a victims valid process using VirtualAllocEx, LoadLibrary, CreateRemoteThread and all that yadda. But how do malware authors get to avoid heuristic detection AFTER the payload has been decrypted? I mean, I don't think most (if any) malware authors are actually loading their DLL's directly from memory just after decrypting the payload. Rather they decrypt it and use the DLL decrypted path in LoadLibrary. But how come that they are successful in bypassing AV this way, since most AV's use hook functions into all these Windows API functions (LoadLibrary I'd guess is heavily monitored), and so even if the malware escaped static AND dynamic analysis in the first glance since the AV won't be able to sandbox the encrypted the DLL through the hijacked one (there are hundreds of simple techniques to avoid AV sandboxing to access the decryption phase, and if it doesn't reach the decryption phase, the sandbox simulation does not raise any alarms) how does it escape it when its time to actually inject the payload into a process?
Won't the AV grab the DLL path that Windows is being requested to load through LoadLibrary and re-scan it? And this time the payload will be a completely malicious and decrypted DLL, easily recognized by static signature and/or heuristic analysis thus raising the AV alarm? How come any malware ever passed any AV with this method? What conceptual part am I missing?

Malwares decode their payloads in memory and manually map their PE structure. The PE is a very simple format, it's doesn't take long to write a PE loader from scratch.
For an AV to be able to monitor a program memory it would either need to pause it periodically and inspect every page of its working area or hook the memory allocation and protection APIs and fiddle with the permission to intercept every write.
Either way that would slow down the programs so much that nobody would use an AV.
By working on memory malwares avoid the AV signatures check, the AV could intercept a call to CreateRemoteThread (and all the one thousand tricks that exploit other APIs or call directly into the kernel) but at that point only the thread starting address is known, that's not enough for the signature check.
By the way, a malware could simply inject the decoding stage in the target process, and since there are infinitely many encoding, the signature check will always fail.
AVs typically work by intercepting malwares when they are written to disk, launched, and when they communicate over the network. These are all relatively inexpensive hooks.
With heuristics and signature checks, they can block the malwares of yesterday.
But AVs are generally useless at catching unknown and updated malwares, so be more surprised when they block a malware than when they don't.
IoCs and base heuristic like "every script interpreted or file downloaded by an Office document is malicous" are far more effective than playing a cat and mouse game with injection techniques.
Almost all malwares want what your user can already access without the need to inject a privileged process (that is probably protected by its high integrity level) and an AV can't arbitrarily block DLL injections between low privileged processes as, alas, there are legitimate use cases for them.


iphone, Electron Microscope can see the ROM cell states Just one bit gets toggled when the passcode is correct.  Why not just toggle that one charged/discharged cell?  Determine that bit through experimentation with an electron microscope.

Just one bit gets toggled when the passcode is correct.

No. It is having a different code path if the passcode is correct which involves lots of other bit. And even if this would only be one bit: how do you find exactly this one bit you would need to toggle? It is not that memory layout is that predictable so that you could easily find the needed bit. And experimentation changes the state of the system (like adding to the maxfail counter), which means that it would not be always the same bit you would need to toggle. And after only a few number of tests the phone might even wipe itself because you've had too much failed attempts.


Prevent ssl pinning bypasses I want to understand if end user is doing MITM attack on my app and i want my API server to receive this. Is there any way i can hook an SDK or some listener that tracks which certificate is being used for outgoing / incoming requests at some particular moment and if that doesnt match something i hard coded or my own server to just log it somewhere? I understand that tools such as Frida and others inject specific code that override ssl certificate with MITM software's certificate but I'm also wondering is it possible to have something that works in background that keeps checking which certificates are being used and to react accordingly if it isnt something i know off?
Best regards

You cannot win against a user running your app on their own device.
I'm not sure exactly what you mean by "in the background", but sure, you could implement all sorts of checks all over the place to try and verify that certificate pinning is working and you are talking to the real server. However, no matter what you do, it can be identified and circumvented by a competent user. Especially on a rooted device, the user has complete control over your entire process and can forge whatever information they want and bypass all checks at every level. You can make it more difficult and slow them down by adding more checks, but it will not stop a determined adversary.
It may be time to reconsider your threat model. What are you so concerned about the user seeing in transit, if the information is already sent to/from their device? Or maybe you are worried about security of the API service itself, in which case your efforts are better directed towards reviewing/auditing that component.


using netcat as a handler for windows/meterpreter/reverse_tcp payload How we can use netcat as a handler for windows/meterpreter/reverse_tcp payload. I am getting the connection but unable to run any command.

You need to use the meterpreter handler rather than netcat. The issue is that meterpreter uses multiple stages. The reverse_tcp payload is only used to connect back to the client and load the additional shellcode needed to spawn the meterpreter. When you are using netcat this doesn't work.

If you want to have a payload that runs with netcat you need to consider using a regular reverse TCP shellcode rather than meterpreter.


How to protect my ubuntu linux computer from screen capture programs or keystroke loggers? I have a Ubuntu home PC. I often use this system to enter passwords to various websites. Some sites also offer a graphical on screen keyboard to protect from keyloggers. However, I suspect that even the on screen keyboard is not safe from malicious software which records the computer screen. I want my passwords to be safe from such programs. Of course, I do ensure that I don't install insecure programs but I would like to have an additional layer of security.

If the device is compromised to the level where the attacker can record your screen, the attacker can replace whatever they want on your screen as well. You simply cannot trust that device at all at that point. Almost all scenarios assumes that the end user device is somewhat trustworthy.

However, two factor authentication may assist a bit. It may stop an attacker from authenticating using your password - but if they have screen recording access, they can probably just steal your session cookies anyway.


BBM pin to pin security If a BBM message is intercepted over unsecure Wi-Fi and the PIN of the intended recepient is known. Can it be decrypted easily.

BBM messages are encrypted with 3DES, but based on this CSE page the key, at least in 2011, was common to all Blackberry devices meaning a device could potentially decrypt a message not destined for it if the device can spoof it's identify.

Apparently Blackberry even mentions that [you should] "consider PIN messages as scrambled, not encrypted".

The answer to your question is still probably No, it would take substantial resources and knowledge to do intercept and decrypt your messages, it wouldn't be 'easy' like cracking a WEP key, but I wouldn't use it for secrecy.


What's the purpose of the client nonce in SSL? I'm having difficulty understanding the impact the client nonce has. I understand that the server nonce can prevent the replay attack. Isn't the client nonce an unnecessary part of the replay attack prevention? For example, a client that has the intention of initiating a replay attack can just use the same nonce that they were replaying.

In what scenario does the client nonce in SSL prevent a certain type of attack?

There is no "client nonce" in SSL/TLS. There are some "used only once" numbers created by the client, like the IV for the symmetric encryption or the "client random" for the TLS handshake. In the following I will assume that you mean client random instead.

Client random is for example used to build the message the server has to sign with the private key belonging to the server certificate as part of the initial server authentication. If client random would be repeated then some attacker might replay a previously captured reply of the server containing the appropriate signature and thus successfully claim to own the private key, i.e. authenticate as the server.


Ken Thompson's compiler hack I have gone through Ken Thompson's compiler hack paper; can't we just go through the compiler's source code and check for any backdoor, what was the article's point?

Can we be sure that there are no backdoors if we check the language's latest source code like Python or PHP?

No, because the source you can see doesn't necessarily match up with the binary you're using. The specific attack described in that paper involves multiple compiler source versions: there is a malicious one, which contains the code to inject backdoors into anything compiled using this compiler, and a clean one, which doesn't contain this code.

The attacker first compiles the malicious version, generating a compiler which inserts a backdoor into any future builds of the compiler. They then compile the clean version, using the malicious compiler. The output of this is now also malicious, even though the source code was clean - the source and binary no longer match up, but checking that is difficult. You would need to reverse engineer the binary, looking for malicious commands. The added complexity here is that if the reverse engineering tools were compiled with a malicious compiler, they could well hide the additional functionality in the binary when used.

So, an option might be to use reverse engineering tools from a completely different machine, compiled with a different version of the compiler. However, it's entirely possible that the different machine's compiler is also malicious, depending on when the original backdoor was made. For example, if they both run the same OS, they may well have the same compiler built in, which is compromised on both devices. If they don't, there may be earlier versions which were bootstrapped from a compromised compiler, or cross-compiled from a different OS which had a compromised compiler.

The only way to be sure that the whole chain is uncompromised is to manually build a binary which the processor can run, then incrementally improve this to allow extra features: you can't rely on any third party software (the text editor might insert malicious code, then hide it from view when you look at the source code, the shell might hide the file sizes of modified source files, etc...). In fact, you can't even rely on third-party hardware - the CPU might backdoor anything that looks like a compiler being built, or the RAM, or the motherboard, or the network adaptor, or any other point on the network where the compiler code or binary passed through...

Now, this is getting a bit paranoid, but in each case, as soon as there is a distinction between what source is written and what actually runs, you can't be 100% sure that the source you see and the binary that runs match up.

Note that this doesn't mean the hack has happened, but suggests that there is no way we could verify if it had without building a computer from scratch and using that to verify everything - from scratch in this case means from raw materials, for absolute certainty, without using anything which could influence the output. A hammer is probably ok, but a CNC device might be malicious, or a fab plant, or those wires, or...

puts on tin-foil hat, then realises it was made by someone else who might be compromised


Does FB share button contain trackers? I am considering putting a Facebook share button (shown below) on my website to encourage people to share content to their FB page.

However, I do not want cross site trackers "bloating" my website or tracking users. This is the code I would need to put in the HTML to add the share button to my website.

<iframe src="https://www.facebook.com/plugins/share_button.php?href=https%3A%2F%2Fmywebsite.com&layout=button&size=large&width=77&height=28&appId" width="77" height="28" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>

Does this code contain trackers?

Yes.  For years, Facebook has been using its 'like' and 'share' buttons to collect data on users that visit sites where these buttons are installed. This enables Facebook to collect data on people that don't even use Facebook, when these users visit sites where these buttons are installed.

See https://www.technologyreview.com/2015/09/16/166222/facebooks-like-buttons-will-soon-track-your-web-browsing-to-target-ads/ for more info.


Why do testers often use the single quote ( ' ) to test for SQL injection? It has been seen that security testers input either ' or ; into the application entry points to test for SQL injection. Why are these characters used?

The character ' is used because this is the character limiter in SQL. With ' you delimit strings and therefore you can test whether the strings are properly escaped in the targeted application or not. If they are not escaped directly you can end any string supplied to the application and add other SQL code after that.

The character ; is used to terminate SQL statements. If you can send the character ; to an application and it is not escaped outside a string (see above) then you can terminate any SQL statement and create a new one which leaves a security breach.


How and what information does TRIM reveal when using encrypted Veracrypt volumes? According to Veracrypt's documentation,TRIM operations can reveal unencrypted zeroes or other undefined data (unencrypted).

Additionally it notes that;

  In those cases, the adversary will be able to tell which sectors
  contain free space (and may be able to use this information for
  further analysis and attacks)

The solution/recommendation is to avoid using system encryption on drives that support trim and/or under Linux, either configure VeraCrypt not to use the Linux native kernel cryptographic services.

What are unencrypted zeros and what information can they reveal?
What constitutes undefined data and what information can it reveal?
What are Linux native kernel cryptographic services? According to a post on Quora, it suggests AES-NI.If yes,is the configuration disabling the hardware acceleration? What impact can this have from a security perspective?

Answers to the comments:

first of all some real life example that helps to clarify how both works
Think the hard disk (not ssd) as something like this:
https://www.zerorelativo.it/item_files/5/9/2/4/3/item_434295.jpg
https://i.pinimg.com/736x/19/0c/a1/190ca1d14a5eb7c52a762326042996dd.jpg
where the pieces of wood (bits) can be rotated front(1) or back(0).
there is no third state that we can call "deleted/empty".
you can edit that data in place, just by rotating the pieces of wood

ssd are differnet:
think them like a school blackboard, or a piece of paper, you can write it only once, you can't overwrite in place a piece of paper. to do that you have to use a rubber to delete the old data and only after this operation you can write on paper again.
On a pice of paper (or ssd) there can be 0,1 (data) or can be empty (three different states).
an empty/deleted block/sector can be written, once the operation is done you can't edit that data anymore.

  empty state? Is it specific to a block of storage

  Why would some parts be explicitly marked empty?

i was referring to sectors, not the whole drive.
let's take a real example (https://nesos-ita.github.io/hacks/fixing-bricked-pc/), i have programmed a spi flash memory (bios chip):
-the smallest programmable(=writable) data is "page" where a page size is 256 bytes
-smallest eresable part is a sector, where sector size is 4kb (larger than a page, 16 pages exactly)

if i want to edit one byte of that chip i have to:
1- read 4kb of data=16 pages (1 sector) (16 read page operations)
2- delete that sector (4kb) (1 erease sector operation)
3- reprogram 16 pages where 15 will contain the old data and one differs from one byte (the edited one) (16 page program operations)
total operations count: 16+1+16 not the best...
but what if that chip part was empty?
i could skip step one and two saving 17 operations and i could be faster!
note that even if there was 4kb of useless data i could skip read part but i must delete 4kb of data to wrtite a byte (actually a page of 256 bytes)
there is no "edit operation".
if when you delete a file the actual data is deleted in that moment is better, because when i will need to write on that disk part the disk will be in "deleted/empty" state and i will only write my data on it. it's faster!
this is what trim does, it deletes data when you delete a file, the scope of this is speed
this doesn't happens on hdd because hdd are faster if you don't delete data as explained if you keep reading:

  Can you please clarify how would one determine if the drive has been securely wiped?

as we saw, hdd works like the photo above, since data can be only one or zero you can't wipe them, it's not like a piece of paper that if you watch it you can say is written or it's empty.
the approximation of a delete operation can be writing all 0.
1010101111100010110101010 <-- this is probably data
0000000000000000000000000 <-- this is probably empty (but this is still data, it's only a logic concept of empty, the disk is full of zero)

as always people want pc (and hdd) to be fast so in both hdd and ssd we want them as fast as possible. the goal is reached in two different ways with the two different technologies:
before continuing we need some concepts:
How a filesystem works (logic level, not hdd level)? how files are stored?
there is an index of files where there is a name, and a location
exactly like in a text book
how a file was deleted in past (hdd)?
it was removed from the index by overwriting it's index with 0
there was no point in deleting the actual content of the file, after deleting the index the physical file location is automagically free (since is no more in the index of used data)
it would be a big waste of time overwriting the whole file data with 0000000
and in fact it doesn't happens. in this way the hdd is faster:
- cut & paste operations are fast (you edit only the index)
- delete is fast (you edit only the index)
- copy & paste is slow (you have to actually copy data)
the "problem" is that you can restore deleted data if hasn't been overwritten by some new file, but this historically wasn't a problem, the hdd was faster in this way and everyone was happy.

Now the actual answer is near :)
Now that we have the concepts and we know why securely erease data might be necessary we can asnwer how to do it:
An appoximation of "deleting data" can be:
-writing all zero (or all one)
-writing random data
in both way the old data is gone but with all 0 or all 1 and reading the hdd as analog vlaues and not digital you might still recover data (more a theoric attack, needs lab, can't be done with sw), for example:
we know that the disk is magnetic, let's say that logic 1 is "magnetized" and 0 is "not magnetized" if we have a magnetic vlaue sensor that read from 0% to 100% magnetic value; we can say that 60-100% means logic one and 0-40% means logic zero.
supposing that you write from 1 to 0 the magnetic value will go from 97% to 15%
supposing that you write from 0 to 0 the magnetic value will go from 13% to 2%
thus if you read the hdd as analog values you might find out if a 0 was a 0 or if it was a 1 (more or less like reading rubber-ereased piece of paper, old data might be still visible).
a better way to delete data is writing garbage/random data (maybe more than one time) on the whole hdd, in this way the above trick doesn't work anymore.

and here is the actual answer!!
given that writing random data is the best way to wipe a disk if you find a disk that is full of random data you can say "this has been securely ereased!"
but given that a good cipher will look as random data you might also say "this is an encrypted drive"
you can't tell if it's encrypted or if it's securely ereased, but you can be sure that one of these two operations have been applied on that hdd/ssd.

  If some are marked empty, how would someone determine the disk is encrypted and not secure erased?

  Isn't the statement "with trim enabled attackers can know for sure:-that your disk is encrypted (but not read the content)" true for external hard drives as well regardless of trim?

i think i implicitly answered the question above but let's clarify it:
encrypted disk=full disk looks like random data, because good cipher without having password, looks like random data
securely ereased=fill with random data the whole disk!
now, if you use the encrypted ssd disk, and delete a file, the sector is marked as deleted/free/empty (by trim operation, on ssd only, for future write speed reasons).  If i see a deleted sector it means that it's encrypted, the fact that a sector is empty it's a proof that you have deleted a file and you are using that disk, you can't use a disk full of random data/ereased, but you can use an encrypted disk!
this would not happen on hdd, as they don't have trim operation and they don't delete data, it's just left there
also note that even if the file index is "deleted" by writing all 0 on the index veracrypt will intercept that write operation end encrypt that all zero so on the disk you wll see something different (random data again).

  What do you mean by it is in fact 0 or 1? How does changing state constitute undefined data? What is undefined data?

Let's take again real life example, the spi flash bios chip that i have written:
as you know computers works with binary data that can be 1 or 0
as i explained above flash memory must be deleted before writing, well i have tried to read a deleted sector and it returned:0xFF, 0xFF, 0xFF, ... that converted in binary means that it was full of 111111111111...
as you can see the deleted state is not a magic third state but practically it's all one.
but note that this particular model of memory has the deleted state=all one, another model might be electrically wired differently and have the deleted state=all 0.  thus we can say that after a delete operation the data is "undefined".
but it's not a magic different state, it's just a way to say that there is meaningless data inside it.

  My understanding is the TRIM command is subject to the SSD drive controller's internal routines e.g. garbage collection and it may never delete data since data can be stored across multiple blocks

The fact that data might never be deleted or might be stored in multiple locations it's a different thing, it's called wear leveling and the scope is different: increase life
suppose that you store a photo, that photo will never change so that flash cell will be written only once and never again.
now take a log, for example windows update log: it will be written every time you boot the pc with things like "today no updates", "updated to xyz", "failed to update"
so that cell will be written over and over...
since the number of write operations is limited you will have a broken cell and a new one, not the best...
the idea? move the data! swap every x days the windows update log flash memory cell and photo cell and you automagically doubled the life of your ssd.
combine this with multiple cell and you will have an ssd that degradate slower and in a more uniform way.
this is helped by the trim operation, swapping as i said above is expensive as you have to read the photo and the log, keep both in memory, delete both form disk and write both in inverse locations.  if you have a free/deleted part you can just write a copy there and delete or ignore the original one.
there is another used trick: i have a 1gb usb flash memory that has inside a 2gb flash chip.

  With "they could undelete data if they have an old copy where the data was there", is this only possible if the drive was not encrypted before?

No, also if encrypted, suppose that:
1 i get a copy of your encrypted disk
2 you delete a file
3 i get another copy where i see that a sector is deleted (i can notice this because it's an ssd and trim phisically delete data with a delete opreation)
4 having the old data from old copy (point 1) i can write it exactly where it was before and maybe your file will be undeleted when you boot the pc.
maybe it's important because filesystem it's a complex structure, what's is sure is that if i replace your disk with my old copy you will bot old copy, i can also edit any sector i want, but when decrypted will be garbage and probably crash something.
a more important thing to remember is that changing password doesn't change master key, so if:
1- i get a copy of the disk (encrypted)
2- you find that i got a copy and change the password
3- you tell me: ahah i found out you got my disk, i changed my password to a more complex one, the old one was "secret password123"
4- you write some other data on disk
5- i get an encrypted copy of your disk, i can decrypt EVERY copy of the disk, even after you changed the password!!


Why practical risk analysis tutorials do not exists? To says things simple ; when someone wants to learn offensive web application (or system) hacking, one could just download OWASP DVWA or register to Hackthebox and watch Ippsec videos to see "how to walk the walk". This is very tangible and practical (no theory circle)
But what about risk analysis (ex : ISO 27005, NIST SP 800-30, EBIOS, etc...) ?
The only thing I see on the internet is tons of theoretical paper about why those methods are so great etc... There is no practical use case showing how it was applied in more specific situations.
I understand it may be not a good idea to publish your organization risk analysis results on internet but how are we (beginners) suppose to do it ?
Any idea where I should start or look into to get a more realistic practical overview of IT security risk analysis ?

Indeed, your point about publishing public risks on critical assets of an enterprise is probably the main reason why the practical side of risk management is not as visible compared to offensive security for example.
However, if you are interested in that particular subject, there are multiple resources that you can refer to in order to gain experience. For example, the book Security Risk Management is a great reference to actually start a risk management program for a company from scratch, it has a lot of real-life examples and concepts that can be directly applied.
You can also get certifications or courses from experienced instructors (for example CRISC) this kind of training will put you in very similar risk assessments situations so that you can gain tangible experience in information security risk management.


Information Transfer Between Browsers and Tabs Is it possible for a webpage to detect or otherwise be aware of what other tabs in the same browser, or even other open webpages in other browsers are doing or transmitting?
I am well aware of cookies, and their ability to store information placed by the web dev for local use.  This link and this link were also helpful, although I don't particularly like Chrome and I am not just asking about extensions. I am also aware that with a compromised machine or browser anything is possible.
 My concern is that with marketing and all the other reasons that promote extensive information gathering (legitimate or otherwise), it may be desirable for a website to try and glean information about any and all usage by reaching outside of its browser's tab, so to speak. With sandboxed tabs, this seems unlikely, but I am sure there are ways around this (if not yet discovered). This would definitely be considered nefarious and possibly illegal for a company to be doing this regularly, but this hasn't stopped many companies from doing all that they can to gain an advantage, or take advantage of users' ignorance. TO BE CLEAR: I am not not referring to full-fledged real-time active hacking of a user's browser. Just data "leakage", so to speak. Sometimes I prefer to do banking in one browser and shopping in another for fear that the central piece of software (the browser) may allow some type of crosstalk. I think this may be unnecessary. If this is not possible, please describe what safeguards are in place within the browser in addition to sandboxing. I am looking for software level details if possible, or anything else that is relevant in addition to the links I posted above... but didn't want to post this on another SE site such as the StackO. Thank you.

Hard to answer because we can have a lot of horizons here.

Short answer:

I will use your bank as an example.

Let's say you open a new tab and enter on your-bank.com.

If your bank has not explicitly developed any code to communicate with other tabs, no other tab could say that you are browsing your bank and what you are doing there.*

EXCEPT if a malicious tab is using a browser exploit (0-day), which is very expensive, rare and exceedingly illegal.

I am not considering you clicked on your-bank.com through other site, and I am considering you don't have any browser extension/plugin or malware in your computer.

  (...) please describe what safeguards are in place within the browser in addition to sandboxing

Same-origin policy (SOP):

  "In computing, the same-origin policy is an important concept in the
  web application security model. The policy permits scripts running on
  pages originating from the same site – a combination of scheme,
  hostname, and port number1 – to access each other's DOM with no
  specific restrictions, but prevents access to DOM on different
  sites.1 The same-origin policy also applies to XMLHttpRequests
  unless the server provides an Access-Control-Allow-Origin (CORS)
  header. Notably, WebSockets are not subject to the same-origin policy.

  This mechanism bears a particular significance for modern web
  applications that extensively depend on HTTP cookies to maintain
  authenticated user sessions, as servers act based on the HTTP cookie
  information to reveal sensitive information or take state-changing
  actions. A strict separation between content provided by unrelated
  sites must be maintained on the client side to prevent the loss of
  data confidentiality or integrity."

  From Wikipedia (http://en.wikipedia.org/wiki/Same-origin_policy).

Edit:

Considerations about this post (I will use again your bank as an example):

The document.domain method

Here we can assume that subdomain.attacker.com can talk with subdomain.attacker.com AND attacker.com.
But is impossible to subdomain.attacker.com talk with your-bank.com or even with subdomain.your-bank.com.

Why? attacker.com can not set its document.domain to your-bank.com.

The Cross-Origin Resource Sharing method

Here your bank needs to explicitly permits Cross-Origin Resource Sharing with attacker.com, because it is not permitted by default.

Settings of a vulnerable domain:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT

The window.postMessage method (or JSONP, etc.)

Again your bank needs explicitly permits communications through javascript postMessage.

My conclusions:

Same-origin policy is, nowadays, very reliable, but like anything, it is not flawless.

But if you could find any flaw in the same-origin policy implementation of Chrome or Firefox (like U-XSS, etc.), you will receive a nice reward.

So it is not easy to find a bug.

Mozilla and Chrome Bug Bounty Programs:

http://www.google.com/about/appsecurity/chrome-rewards/
https://www.mozilla.org/en-US/security/bug-bounty/

Article about some old same-origin policy weakness:

http://powerofcommunity.net/poc2008/kuza55.pdf

  Is this the only in-browser mechanism/defense that is preventing
  tab/browser crosstalk?

Yes, it (Same-origin policy) is the only mechanism to prevent cross-origin talk.

Edit 2:

  Are the exploits you detailed above persistant across browser
  closings, or do they only affect simultaneous connections?

Both! We can have persistent and nonpersistent exploits.

Daniel Divricean reported this nonpersistent exploit three years ago. An attacker could read informations of other sites, like your bank balance, but only if you had logged in your bank before. In this case, closing the malicious site would stop the attack.

I reported this persistent exploit to Google one year ago. An attacker could use it to install a malicious extension on the victim's browser, without user interaction and knowledge. In this case, closing the malicious site would NOT stop the attack.

  So is logging into the bank website -> logging out -> closing browser
  -> opening exploit site -> closing browser -> logging into bank... now safe?

Is safer, not fully safe.