Check Point SSL Certificate Interception Can someone please explain how Check Point enterprise firewalls are able to read SSL traffic? My boss briefly explained that our company's firewall, which is Check Point, is able to intercept SSL certificates and reissue them to the end user, thereby retaining a copy of the public key and inspecting all HTTPS and general SSL traffic.

In addition, if the company firewall is capable of this, is my ISP likely doing this as well?

Generally this is possible because the corporation controls the devices subject to monitoring, therefore they can instruct the devices to trust their own CA certificate.

  To make the PC trust the gateway CA certificate:

  Export the CA certificate from the SmartDashboard (on the HTTPS
  Inspection window of the Security Gateway, or on the HTTPS Inspection > Gateways pane).

  2 . Install the certificate on the user's PC:

  Manually put the certificate file in the user's PC. Click the file and
  follow the wizard instructions to add the certificate to the trusted
  root certificates repository on client machines.

  Use GPO or group policy to distribute the certificate to a large group
  of users. See the documentation for more details.

https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk65123&partition=General&product=HTTPS

They can then intercept the TLS handshake and substitute the certificate with one they generated and signed themselves, and which your device will trust. They can then act as a man-in-the-middle, decrypting your traffic before sending it onto the legitimate destination.

  is my ISP likely doing this as well?

No, your ISP isn't in a position where it has access to your devices, therefore they cannot install their own trusted CA certificate.

Additionally, some clients (eg. some mobile apps and some browsers in some circumstances) will "pin" certificates, meaning they will only accept a certificate signed by a particular CA. In that scenario they won't accept the certificates generated by your company.


Can a Bitcoin Seller steal my Identity? I was trying to buy some bitcoins on https://localbitcoins.com.  However, the seller was looking for a copy of my ID and a photo of my debit card (long number covered).

I'm curious as to how open this would leave me to some kind of identity fraud?  Or more specifically could the seller access my bank account?  For information I'm in the UK.

They would have the following details about me:

Full name
DOB
Address
Licence number
Copy of photo
Copy of signature
Account number
Sort code
Bank
Debit card expiry date

Any info appreciated!

Using full name, DoB and signature some banks will allow resetting of login details. Essentially, take the perspective "how accurately can this information prove I am Jon Smith" enough to convince an organisation that you are Jon Smith.

Government issue ID with proof-of-address will generally be enough information to allow for bypassing most authentication systems. Although, without an NI number credit/loans typically cannot be taken out.

However, to answer your initial question, identify fraud is less likely, but a potential issue with the government issue ID and proof-of-address. Furthermore, accessing your bank account is very unlikely, and would require access to mail delivered to your address on file, although this should be confirmed for your own bank.


How to find whether a site uses SET How could I know whether the eCommerce site I use uses SET (Secure Electronic Transaction). I know SET is a standard. But I see only an SSL connection

I know SET is a standard

As Avid pointed out, the SET standard was abandoned in favor of the 3-D Secure scheme; so no, it isn't really a standard. If I recall correctly, the protocol never really gained wide-acceptance due to its complexity and cost versus simply using SSL.

  How could I know whether the eCommerce site I use uses SET?

The chances that your ecommerce store use SET are very low (<1%). However, there is a simple way you can check to see if the ecommerce store uses SET... if you need to install an "e-wallet" client-side application, then you can rest assured you are using SET. However, not having to install the client-app won't tell you much because SET can be implemented on the backend server, in which case the problem of having to use an e-wallet is offloaded to the server in a way that is transparent to the user.

In the end, there isn't a 100% accurate way to tell whether or not you are using SET, but I think it's a moot point given its lack of acceptance or use.


Docker: when to use apparmor vs seccomp vs --cap-drop Docker seems to support both apparmor and seccomp. Docker also allows to drop capabilities when running a container.

However I couldn't find any documentation or guideline on when to use which approach.

There seems to be a significant overlap in what they can be used for, I couldn't figure out any general guideline on when to use which of these options.

Can someone provide any guideline?

In my case, I have to run a lot of students code on the server. I want to allow them to run Java and c++ programs. Allow write access to one directory (data volume). They don't need network access, or anything complicated.

Please provide some guideline how to secure.

You can use all of them.
Each of these security features have different purposes, and there is actually little overlap. They all function to reduce the damage that a process can cause once it has been compromised. They are all very low-overhead and can be used to significantly improve the security of software.
Seccomp is a Linux feature that allows a userspace program to set up syscall filters. These filters specify which system calls are permitted, and what arguments they are permitted to have. It is a very low-level filter that reduces the attack surface area of the kernel. For example, a bug in keyctl() that allows simple calls to that syscall to elevate privileges would not necessarily be usable for privesc in a program which has restricted access to that call.
AppArmor is a Mandatory Access Control framework that functions as an LSM (Linux Security Module). It is used to whitelist or blacklist a subject's (program's) access to an object (file, path, etc.). AppArmor may be used to allow a program to have read access to /etc/passwd, but not /etc/shadow. The policies can also be used to restrict capabilities, or even limit network access.
Capabilities and capability dropping is a general technique whereby a privileged process revokes a subset of the privileges it is endowed with. A root process can drop, for example, the capabilities required to create raw connections to the network, or the capabilities required to bypass standard UNIX file permissions (DAC), even though it remains root. This technique is not very fine-grained as there are only a limited number of capabilities that can be dropped, but it reduces the damage a program can do if it has been compromised nonetheless.
In general, you should know that:

Seccomp reduces the chance that a kernel vulnerability will be successfully exploited.

AppArmor prevents an application from accessing files it should not access.

Capability dropping reduces the damage a compromised privileged process can do.

See also How is Sandboxing implemented?


Should I get an antivirus for Ubuntu? Considering the recent thread regarding anti-virus for the Mac I wonder how many of the arguments put forth are relevant today to Linux systems, specifically Ubuntu.

There are no known Ubuntu desktop malware in the wild.
GNU/Linux is a very tempting target for botnets, considering that powers a substansial fraction of webservers. Additionally, these webservers are generally higher-provisioned and have better bandwidth than potential desktops botnets.
Anti-malware packages for Linux are mostly targeted to Windows infections that may 'pass through' Linux, such as on a mailserver. This is not relevant for an Ubuntu desktop.
Some of the available Linux anti-malware applications seem just as shady as their Windows counterparts.
These solutions may or may not protect against macros in LibreOffice documents, web browswer or extensions' flaws (Flash), XSS attacks, Java vulnerabilities, and other userland software.
People are stupid. Someone might run nakedgirls.deb if an ambitious malware dev were to promote it. I'm sure that this is only a matter of time.

Note that though there are many other distros and desktops based on GNU/Linux, in the interest of keeping on focus I would like to limit this thread to a discussion of standard-install Ubuntu desktops only. Think "desktops for grandma". Users of Slackware, those running mail- or web-servers, or those using their desktops for other purposes would presumably (ha! I'm not really that naive) know what they are doing and the risks involved.

You can install an antivirus if you want. It should not hurt your machine, but don't expect much protection for your system and don't consider yourself entirely safe. The efficacy of antivirus software is very relative, and they're mostly in use to avoid propagate old malware especially if you have Windows machines in your ecosystem. You should expect a performance decrease, though there are no benchmarks of AV performance on Linux as of today so it can't be quantified.

Why is it that you're not safe with just an antivirus? Because they're only one part of the needed mechanisms. At the moment there are a lot of missing tools for desktop security on Linux. What are the different security mechanisms relevant to desktops?

Graphic stack security (to prevent keyloggers, clickjacking, screen recording, clipboard sniffing, etc)
App distribution schemes with security checks (app stores and repositories with static analysis on the apps) and fast security updates
Malware detection: signature-based (to protect from identified threats) and  heuristics-based (or so they say, I've never used any heuristics-based AV and I suspect this is mostly marketing talk to say "we'll throw tons of security warnings at your face when you use a new app")
Sandboxing (which consists of isolating apps from one another by design)
Contextual authorisation to use devices and user data with security by designation / user-driven access control / powerboxes / contracts ; requires sandboxing

Currently the only decent thing on Linux is the app security updates, through repositories. All the rest is substandard.

Graphic stack security

We're all relying on the X11 graphical server. X.Org existed for 30 years and the original design is still in use in the server. Back in the day there were no desktop security issues and you won't be surprised to learn that it's not secure at all. You have APIs right out of the box for implementing keyloggers, doing remote code exploitations if the user has any root console open, replacing the session locker to steal passwords, etc, etc.

It's hard to evaluate how Windows 8 and OS X fare on this topic because I could not find any detailed explanations on their graphic stack implementation. Their sandboxed apps have restricted access to most obvious attack vectors but it's really unclear how well designed and implemented this all is. It seems to me that Win 8 forcing Store Apps to run fullscreen and one at a time hides issues in designing a full scale secure window manager. There are lots of issues to take into consideration wrt. window position and sizing, use of transparency and fullscreen, etc. when implementing a window manager with security in mind. I have no idea how OS X does.

Linux will be switching to Wayland in the coming years, which is designed with security in mind. We have a clear model of what capabilities should exist and a general idea of how these will be enforced and how authorisation can be obtained. The main person behind this work is Martin Peres though I happen to be involved in discussing the user and developer experience behind the capabilities. Design and development are ongoing so don't expect anything any time soon. Read this post for more information. Wayland will provide security seamlessly when used in conjunction with app sandboxing.

App distribution

Linux has a system of repositories with various levels of trust, which trained our users to rely only on provided apps and to be wary of proprietary code. This is very good in theory.

In practice I don't know a single distributor that enforces even the most basic security checks on their packaged apps. No static analysis whatsoever for weird system calls, and for anything community it's really not clear whether pre- and post-install scripts (which run as root) are verified at all for obvious bad things.

The security checks done on extensions to GNOME Shell are very light and manual, but at least exist. I don't know about KDE's extensions or other apps.

One area where we shine is that we can pull security updates very fast, usually within a few days for any security flaw. Until recently Microsoft was much slower than that, though they caught up.

Malware detection

The only antivirus software I know on Linux is ClamAV. It seems to me that it only works based on signatures, but then again as you pointed out, we don't have any identified desktop malware to protect against.

There probably are people writing Linux desktop malware in the world of Advanced Persistent Threats. See Mask for an example. It's unlikely that standard AV can do anything against those since APT malware authors are usually talented enough to come up with zero-day exploits.

Now, Microsoft advertises fuzz-testing all of its software for tens of thousands of hours, as opposed to virtually no secure coding practices at all in the Linux ecosystem. From personal experiments with fuzzing I'm absolutely convinced that there are a handful of low-hanging zero-day exploits in some popular Linux software. This will come to hit us on the day we have a financially-viable user base for commonplace malware authors, and then we'll see how good ClamAV turns out to be, but I suspect the app update mechanism will have a bigger impact at dealing with discovered vulnerabilities.

Needless to say both Windows and OS X do significantly better than Linux on this criteria.

Sandboxing and contextual authorisation

Both OS X and Windows 8 provide sandboxing for the apps hosted on their store. I'm not done looking into the quirks of OS X, but Windows 8 Store Apps have very serious limitations in terms of languages and APIs supported, available features and general user experience that can be provided with them. That means unsandboxed desktop apps are here to stay and Microsoft's sandboxing will not protect against malware, only against crafted documents in buggy (Store App) software. OS X seems to do much better though any non-store app is not sandboxed, as well.

Linux has no GUI app sandbox working seamless enough at the moment. We have the underlying confinement technology (the best candidates being Containers based on Linux namespaces, see LXC and Docker, and the next-to-best being MAC enforcement systems that would need to be developed to support some amount of dynamicity). We almost have the IPC and process management mechanisms needed to deploy and handle those sandboxed apps thanks to amazing work on kdbus and systemd. There are a few bits missing, with a few proposals being pushed mostly by the GNOME Foundation (see this video on Sandboxing at GUADEC 13). I'm also involved in discussing how access to data and authorisation can occur but there's no consensus between the few interested people, and design and development take time. It'll probably be a couple more years before decent prototypes exist and before sandboxing is deployed to Linux on any relevant scale.

One of the big issues faced on all platforms is finding out how to authorise apps to get access to data and device capabilities at the right scale. That means, how to let them do what they need to do without pestering users with authorisation prompts whilst preventing apps from abusing privileges. There are serious loopholes in how Windows 8 lets Store Apps handle recent documents and apps' futureAccessList. At this stage securing document access further without aggravating the cost of security for developers and users is an open question, which a bunch of people happen to be working on as well :)


How do we call a website that perform things without doing in requests? How we call a website that perform things like translating or anything else, without performing an action/request or JavaScript event ?
Take for example this site, the cipher text is generated without making any requests (You can see it in the network tab in dev tools). How do we call this type of site ?

Your browser makes at GET request for that page, which loads a combination of HTML and JavaScript.  The JavaScript function start_update is called nearly immediately:
window.setTimeout('start_update()', 100);

start_update in turn calls upd():
upd();

And upd() applies encryption if there is new text, doesn't if there isn't, and calls itself either way:
window.setTimeout('upd()', 100);

So upd() is effectively a busy loop that will call itself every 100 milliseconds, allowing the page to update itself "magically", all through the JavaScript running in your browser.
This isn't really AJAX because the JavaScript isn't making XMLHttpRequest calls and isn't getting text, JSON, or XML from any other source.  It's simply an HTML page with embedded JavaScript which runs in a busy loop rather than being event-driven.


How do I revoke my OpenPGP keys if I do not have access to my private key? I have lost access to my PGP Private Key. However I still have the revocation certificate, the passphrase (and the public key).

Is it possible to revoke my key pair from the Public Key Servers using this information? If so, what are the steps?

I tried looking this up but this does not seem to be well-documented anywhere.

First you import your public key into your keyring, if not already there, then the revokation certificate.

gpg --import my_key.asc
gpg --import my_revocation.txt

Your key is then revoked locally. You just need to push this to the keyservers.

gpg --keyserver pool.sks-keyservers.net --send-keys [YOUR_KEY_ID]


Is this Wikipedia article about SCRAM wrong? At my Company, we put a honeypot in our network and it raised us the Lansweeper SSH password used to connect to the scanned assets (and it is reusable over many boxes...).
So it is a way for an attacker to get sensitive passwords in a corporate network.
I was like "Does SSH not use challenge-response?". Then I thought a little and said "I guess if you use challenge-response, then the hash is the secret, so if it is compromised, the attacker can perform pass-the-hash".
I read a little bit on the Wikipedia article about challenge response and found this:

"Since the password itself is not stored, a challenge-response
algorithm will usually have to use the hash of the password as the
secret instead of the password itself. In this case, an intruder can
use the actual hash, rather than the password, which makes the stored
hashes just as sensitive as the actual passwords.
SCRAM
is a challenge-response algorithm that avoids this problem".

I read about SCRAM on Wikipedia and I don't see any reason why it could avoid pass the hash. The server sends the salt and the number of iterations of bcrypt and the client must reconstruct the good hash. The server stores that hash.
So if someone compromises the server, he can reuse the hash as a password (pass-the-hash).
The one who added this sentence about SCRAM pretends that "plaintext-equivalents can be avoided with simple C/R schemes" in the Wikipedia discussion. He takes his article as a reference: https://openwall.info/wiki/people/solar/algorithms/challenge-response-authentication.
In this article, he talks about an alternative where the server stores a hash of the hash. So, okay, if you compromise the server you cannot reuse hash, but what the client sends is the direct entry of that hash, so it is not anymore a challenge-response approach.
EDIT with answer:
My point was:

if the server stores H(pass) and the client sends H(nonce,H(pass)) then H(pass) is as sensitive as the original password
If the client sends H(nonce,pass) the server needs to store the plaintext pass to compute H(nonce,pass) on its side
If the server store H(H(pass,salt)) and the client sends H(pass,salt), then H(pass,salt) is as sensitive as the original password (it's enough to authenticate) so this scheme transmits something as sensitive as a plaintext password, this is not better than sending plaintext password and storing H(pass,salt)

In fact the scheme is more like this:
The server store H(H(pass,salt)) (let's call it X)
The client sends R = H(X,nonce) XOR H(pass,salt)
The server checks the authentication by doing H(H(X,nonce) XOR R) == X
This way, knowing X is not enough to authenticate on another server (no pass the hash) and R do not reveal the password if the server is a rogue one.

The reason SCRAM prevents pass the hash is that the factors of the hash change due to the challenge.
(the counter should be a nonce thereby making it trivial for the real secret holder to calculate a new hash but hard for an attacker to calculate a new hash.)
Repeating the hash (as a Pass-The_hash attack does) should have an extremely small time window / be impossible to do silently. If the attacker has compromised the server all bets are off, regarding security (they have won by that point).
So the Server validates the authenticity of the connection/user by sending a nonce & Iteration count to the client. client uses this to calculate a hash response with the known and unknown elements (password hash) resulting in a once valid hash that the server validates by comparing it with the values it knows (hash of the password and the nonce / iterator).
You could  employ another level of hashing. this would ensure that just having the key as stored on disk is not enough to calculate the hash, but since someone probably also has the way you hash it again at that point it is a small difference.
Basically it all boils down to what threats are you trying to protect against, at what cost.


Extract pre-master keys from memory I want to get pre-master key from OpenSSL application (in order to decrypt traffic).
Details:

OpenSSL version: 1.0.2l, statically linked, no debug symbols
I'm able to debug the application (hit breakpoint inside SSL_connect(SSL *s) method)

Is there any way to get the pre-master key from there? I'm using x64dbg.

From https://stackoverflow.com/questions/36240279/how-do-i-extract-the-pre-master-secret-using-an-openssl-based-client

I recommend using the master key, which is easier to get at. To the best of my knowledge the pre-master key only exists ephemerally on the stack in OpenSSL. The master key is available in ssl_session_st (defined in ssl.h in the 1.0.2 branch but moved to ssl_locl.h in a later version). The SSL member variable session is a pointer to its ssl_session_st (aka SSL_SESSION).


Gmail spam from contacts. How does it work? I don't know why it seems IMPOSSIBLE to find a blog or any security expert explaining the procedure of how this 'hack' works.

My wife is receiving emails from people she's emailed through Gmail telling her that she they are getting spam from her email address (3 people, one forwarded the email with single link spam).  Some interesting features of these emails:

the email contains her correct email (yes I know this can be spoofed)
the email contains the contact's correct email

So in order for this 'hack' to happen, the spammer needs access to:

Her Gmail Contacts list
Her sent emails directly
Facebook friend emails
1-3 for one of her Contacts
1-3 for a mutual contact of both her and her contact and the spammer just tries mass guessing

My questions are:

What are the most likely steps for how this 'hack' occurs?
What are other possible ways this 'hack' occurs?
Are there ANY resources online which explain how this works: Wired articles, SE posts (I've searched, only a YAHOO CSRF), ANYTHING which gets in any more detail than future prevention?

I'd love to see ANYTHING with more technical detail than 'what you do next' posts.  (A Google search brings back nothing.)

I have helped people who have experienced exactly the same thing that you are describing and it was simply the result of an infection. A program connects to her gmail account, and searches for emails in her contacts and folders, including the deleted items folder. Then, spam is sent out.

I know that you have scanned her machine, but scans do not always catch the very new variants of malware. In the last case I worked on, I was able to trace the infection to a file the person opened that was also sent to her by one of her contacts.


Can an XSS exploit on a subdomain steal the cookies of the parent domain? As per my understanding, if a cookie doesn't have a domain attribute (explicitly telling where this cookie can be used), by default that cookie will be used by the domain which issued it and all its subdomain, but the parent domain of the domain which issued the cookie can't use it.

So if foo.example issued a cookie, it can be used by the subdomain bar.foo.example.com but not it's parent domain i.e. example.com.

Now, suppose I found an XSS vulnerability on foo.example.com and I want to get the cookies of example.com. By any means is that possible? Since by default cookies issued by a subdomain can not be used by it's parent domain, I am not able to figure out any way.

A subdomain can only share a cookie with its parent domain if it is explicitly given in the set-cookie header issued by the server like this:

Set-Cookie: name=value; domain=www.parentdomain.com

Otherwise the cookie is "host only cookie"

To answer your question an xss should not be possible
Or i am wrong


secure Microphone Blocker for Apple devices (macOS and iOS) Quote from Hardware for Protecting Privacy and Security

Microphone Blocker
A microphone blocker is a device that prohibits audio hacking, in the form of a hardware accessory for a smartphones,
laptops etc. It functions as a dummy mic jack, so the device thinks it
has a microphone plugged in, and hence disables the internal one

I decided after this recommendation also to block my microphone.
With a DDG search I found guide to disable the microphone with settings menu. But I trust Hardware solutions more and found mic-lock:
Questions

How to securely disable microphone for macOS and iOS based devices without opening the device (destroy a chip)?
Can you recommend the product Mic-Lock? The only product I found with DDG. They use aggressive marketing slogans.

Edit, after rereading the original source:

Note: This section is intended just to be a bit of fun, it is entirely
possible to stay secure and anonymous, without having to build or buy
anything. Now that more devices have been added, it's not been
possible to test everything here, so these products should not be
taken as recommendations, just interesting ideas, and a bit of fun

The dummy, i.e. unconnected, microphone plug was a commonly recommended security method many years ago. It worked by mechanically breaking the circuit to the internal microphone in order to connect to the non-existent external microphone.
Those days are long past, despite this now misguided security recommendation.
Nearly all modern devices use software controlled ports and connections. Mechanical disconnects no longer work. In fact, plugging in a working external device does not preclude the internal device from being activated simultaneously.


Is there a security advantage or risk in removing disabled user accounts? So I'm having a debate with someone about whether or not to remove disabled accounts.  My stance is that it is good network hygiene, reduces the amount of  noise to sift through, etc.  However, the argument is, what is the risk being addressed.  I have been racking my brain on this one but I don't see a risk that this practice would address.  Yes, the wildest of scenarios, someone could compromise the SaaS platform, reactive the account and use that for their awful deeds.  But likeliness is extremely low. Even looking through all the governance frameworks state "Remove or Disable".

Is there any security risk that removing disabled accounts addresses?

In general, it is always best to reduce your attack surface. No system is ever perfect and your deactivation protocol will be no exception due to both programmatic and potential human error.

Risk 1: Let's say all your terminated employees accounts have been properly de-activated, for example via altering their role in the employee table in the database (or however they are stored). In this hypothetical scenario your administrator account has been compromised. A smart attacker may use the administrator account to re-enable a past terminated employee's account and use that account to conduct malicious activity on the system. By doing so, they are less likely to be discovered by intrusion detection systems (i.e. admin always logged in from Texas, USA but all of a sudden admin is in Brazil?). This could increase the attack surface and potentially give the attacker more power. Never a good thing.

Risk 2: Human error exists. What if one day you accidentally de-activate a still valid employees account and type Alex instead of Alexander when you wish to re-activate and now re-activated a terminated employees account? Or maybe you did not even mean to re-activate an account but one day when your computer was frozen and you were angrily spamming your mouse clicking at anything for a response, you clicked the reactivate flag?

Both cases are unlikely but why take the risk?

Unless your system has the need for a sophisticated audit trail that relies on still existent accounts in the system to work (i.e. does more than just print name of user and action to log but rather still actively accesses users info), there is no good reason to leave this bloat data in your system.

I always check after I leave a company (while working as a co-op in the past I frequently spent spurts of time at various companies) if I can still login to my accounts and more often than not, one way or another, I could.

Always err on the side of cyber-safety.


Internal storage scheme for storing private keys inside an HSM I am trying to understand the internal storage scheme used by HSMs to store the private keys. My question is: are keys stored in plaintext inside an HSM? Are there any variations?

Every HSM will be a unique implementation.

I know that the IBM PCIe Cryptographic Coprocessor stores master keys inside the HSM, which are used to decrypt the keys that are kept encrypted in an external database.  The older version used 3DES to encrypt the keys; I don't know if V2 still uses 3DES or if they're using AES now.  Tampering with the HSM (or even violating its environmental envelope of temperature and humidity) securely destroys the internal keys and certificates, as well as rendering the HSM itself physically inoperable.

Inexpensive HSMs, such as a PIN pad you'd find at the grocery store, maintain their key state in battery-backed RAM.  Note that because PIN pads are out on countertops where they can be stolen or tampered with, they aren't trusted with a "master" key that's the same for all PIN pads.  Instead, they follow a key generation protocol called Derived Unique Key Per Transaction (DUKPT).  DUKPT specifies that each pad has a unique key injected at a secure facility before being shipped to the stores.  The PIN pad's unique key is derived from the system's base master key and the PIN pad's serial number, and DUKPT implements a "future key" generation scheme, which continually rotates forward with every use, destroying the old keys as it goes.  Attempting to violate the case will result in the CPU quickly scrambling the RAM and then cutting power to it, wiping the future key state.

I'm sure other HSMs have different variations on the theme, but they all behave in a similarly self-protective fashion.


Approaching a steganalysis challenge I am currently doing one of the Honeynet.org challenges, specifically the 13th forensic challenge dealing with steganography. Several PNGs have been provided and participants are to find and extract steganographically hidden messages from said files.

Since all files seemed to have been edited with paint.NET, I suspected that a plugin had been used. Further, most of the available plugins seemed to embed messages by changing the least significant bit of the color values. Therefore, I wrote a small Python script. For every pixel in the image, it collects the least significant bits and concatenates them. If the result can be converted into a number that lies in the printable ascii range, it will be converted and is then added to a string. For each image, this string is printed.

Sadly, this didn't yield any results. I could obviously just try different things, for example parsing the image horizontally instead of vertically. To me, this seems like brute force. I'd much rather like to ask, if somebody here could think of a better way to approach this.

However, please refrain from just posting the solution. I know the challenge is already over but IMHO, one should always try to come up with his own solution first.

The best way to approach this is to look up HOW you could hide something in an image. I'll give you a hint, it has to do with how pixels are defined. Also have a look at these sites:

http://openstego.sourceforge.net/
http://mark.goadrich.com/courses/csc350f08/labs/lab1.html


Is it important to keep my pastebin developer key private? I would like for my application to enable users to save their programs to Pastebin through the Pastebin api.  This requires a developer key, which is automatically created with each account.  Keeping the developer key secret would be an inconvenience, both because my project is open source and because the most natural place to submit data to Pastebin from is the browser client, from which it would be easy for a user to intercept it.

Someone who misused my developer key would not be able to delete or (worse) modify users' pastes.  The worst outcome I can think of is that a malicious user would spam Pastebin, and I'd have to get a new account and key, but is there a more serious outcome that I need to protect against?

When you host the app yourself, you obviously use your own developer key.

But don't ship your developer API key in your source code; have people who download and run your code use their own.

That page you linked states clearly that all Pastebin users get a developer API key.

  Everybody using our API is required to use a valid Developer API Key. You automatically get a key when you become a member of Pastebin. Please login to your account, and return to this page to find your Developer API Key.


Unknown wired device on home network I noticed on my router one or two hours ago that there were two new devices connected to it that I did not recognize. In a normal situation I would think that my WiFi password was just compromised, but I noticed that one of the connections was, according to my router, wired i.e. connected to my Ethernet.
The wired device was named Amazon-Linux-COMPUTER. I attempted to ping the IP address of the wired machine, but received no result.
I tried to perform a port scan about 15 minutes later and received a message that the host was offline; I rechecked the router and the wired device had disappeared.
What does this mean? Is someone really physically connected to my network, or can this be spoofed? Is there an intruder within my residence? (I know how ridiculous that sounds, that someone would come in for the sole purpose of connecting their Linux device to my Ethernet and nothing else, but I'm not sure if there is any other explanation.)
Here is the device as it appears in my router:

Amazon-Linux-COMPUTER: F8:54:B8:41:38:DE

I cannot ping the device nor perform a nmap on it (host offline), but my router says it is there.

You could try to use WireShark on your network and see if there is any traffic passing through from that device, and also see what kind of traffic (ex. is it going through Facebook, Twitter or anything else).


do password managers count as a MFA authentication factor When users store complicated and unremembered passwords in password manager service such as lastpass, what authentication factor does the lastpass access represent? Does forcing the need for a password manager make the secret no longer a knowledge factor but only a value to the URL key stored in an external system?

Combined with the hardware token, do we have 1.5FA rather than 2FA or is it only 1.05FA? Once the password is leaked/stored the factor appears unknown, or does it still count as knowledge?

The purpose of this question is to evaluate a 2FA policy of 'knowledge' and 'possession' that is allegedly juxtaposed with a complex password policy.

FYI here is a google doc of the full password policy I want to pitch.

You could say that the password manager has MFA, because you have to have the database and know the master password.

However, the attacker can still gain access to the application by obtaining your application password. Actual MFA would prevent him from accessing your account, because he doesn't have access to your phone or keyfob. This is missing with a password manager.

So it depends on the attack scenario. An offline password manager such as KeePassX has two-factor authentication in the sense that you need both the database and the password. But this does not change anything about the applications where you use those passwords.


How to block WhatsApp traffic in TP Link router? Can anyone tell me how to block Android WhatsApp traffic in a TP Link router?

When ever someone builds a public service, their goal is to make it available for everyone. That's why it's way easier to find guidance for allowing traffic than denying it and do the opposite. Facebook has published information for WhatsApp Business API Network Requirements, but that page has a link to a downloadable IP address/range list for WhatsApp servers. (The link has removed from the citation intentionally as it seems like a changing one.)

  WhatsApp uses a wide range of IP addresses for its servers. You can
  try to allow all of the IP addresses. However, it is best to just
  allow all outgoing traffic and connections from the above ports.

  List of WhatsApp Server IP Addresses and Ranges (.zip)

From that information we can also deduce that it would be easier to block the ranges on a consumer grade router, as WhatsApp is able to fallback to HTTPS port 443. The IPv4 ranges on the list are from /32 or /26 are are likely to change. If you need to add them to current TP-Link router's Access Control > Target one by one you would have lots of work.

Most of the IP addresses are from Facebook's range 31.13.64.0/18, but that would block all the other Facebook services, too. Furthermore, some of the addresses seems to be random addresses from softlayer.com etc. Pretty much a Game Over for that approach. (For allowing WhatsApp through a firewall, TCP ports 5222, 5223, 5228 and 3478 to 31.13.64.0/18 have been enough.)


GPS vs Telecom companies My phone is able to give me an exact position of my whereabous, using Google Maps I am able to pinpoint my exact location. However, what can the phone telecom company see?

I've read many different forensics cases in my country, and none are able to see the location, only which CellID was used to make the connection. Wouldn't this help in an investigation? Why is the operator collecting this information? Integrity issues? Not needed in order to fulfill their purpose as a vendor?

The phone provider isn't specifically collecting location information, usually. They're collecting usage data about their phone masts, so they can upgrade bandwidth to heavily used ones, plan maintenance out of peak usage hours, and other technical reasons. This includes details about devices which are connecting to a given mast at a given time, since it's useful to determine things like handover.

Google will try to collect more accurate positioning data. They can use GPS to pinpoint phones to within a few metres or so reliably. This can be sent to Google to enable various features like preparing offline maps of commonly visited locations, being able to notify you about travel delays on commonly used routes, and being able to tell you about local services when you search on terms like "restaurant" or "police station". In order to get that data to Google, there needs to be some kind of internet connection active - WiFi or mobile data.

If a criminal is using a phone, and they are sensible, they'll make sure that they've disabled the precise positioning data upload (they can still use Google Maps, if they've got an offline map - that just requires the phone itself to know where it is, and be able to find that on a pre-downloaded map file). That means that the precise positioning data isn't available. However, the cell level data is still around - that doesn't require any data connection, just a standard mobile signal. If the criminal wants to use a mobile during the crime, they can't cover that up. And it doesn't even have to be active use - mobile phones try to connect to nearby masts on a regular basis, so they can receive calls. They'll sometimes try and see if another mast has a better signal, too.

There isn't any particular reason why a phone provider couldn't collect more precise location data - they could pre-load phones they supply with monitoring software, for example. However, it would be a bit of a PR nightmare to deal with. There also isn't any particular reason why criminal investigations can't ask Google for the information, but it tends to be harder to tie a specific device to a location - the data tends to be collected on an account level - and may well involve international requests to get the data, whilst phone provider data will usually be available with a local warrant from a judge in the source country.


Use the public key of a certificate as the key for HMAC SHA Consider the following scenario. A company has several computers for each users on the same domain. They purchase an RSA certificate from a recognized authority which will be deployed with private / public key on all workstations. So all the stations have the same certificate and therefore the same public and private key.
Let's say that for the needs of an application, without going into details, there is a need to be able to hash data and to do this we would like to use HMAC-SHA256.
Is it possible, correct and secure to use the raw public key of the certificate (as a string) as the HMAC-SHA256 password?
Thus, only the holders of the certificate (of the public key) will be able to hash with this same password, in order to be able to compare their hash with each other.
In this diagram we trust that the certificate is internal, non exportable and deployed by an administrator. So external people could not access it.
Thanks for your advices.

TL;DR: "Using a public key as a secret key is not a good idea. – MechMK1"

I think you're mis-understanding how certificates work.

which will be deployed with private / public key on all workstations. So all the stations have the same certificate and therefore the same public and private key.

It's not really "private" if every employee in your company has a copy of it. Non-exportable helps, but you should really be issuing a unique certificate to each device; imagine the mess you'll be in if one of your devices is stolen / hacked and you need to revoke the certificate!

Is it possible, correct and secure to use the raw public key of the certificate (as a string) as the HMAC-SHA256 password?

Remember that public keys are intended to be public. Even if you are intending to treat them as a super-secret value, there is no guarantee that all of the software that touches them will. Two examples:

When a publicly-trusted CA issues a cert, they log it to public Certificate Transparency servers. For example, here is the CT logs for all *.stackexchange.com certificates, notice how many dev., qa. and test. certs there are in that list? By clicking into any of those, you can get the public key. If your certs came from a public CA, then I'll bet you can find them on https://crt.sh as well. This is not considered a problem because publicly-trusted certs are intended to be public in all aspects except the private key.
When establishing a TLS 1.2 connection, the certificate (and public key within it) is sent un-encrypted over the internet (@dave_thompson_085 pointed out that in TLS 1.3 the certificate is encrypted).

Never assume that your certificates will be a secret.

So your question "Is it ok to use a public value as a password?" is a bit like "Is it ok to use my name as my banking password?; no, no it's not.
Sounds like you need to figure out a different way of (securely) distributing an HMAC key to your apps.


How to prevent USB flash drive viruses Can anyone tell me what is the safest way to use flash drive in a secured network( I am not looking for a way to block it). i need a safe practice to use flash drive in a windows network.

My Imaginations About This:

I was thinking to deploy a Linux based USB Server with updated antivirus, as entry point of flash drive into my windows network.
Benefits:

Linux doesn't understand exe file so virus will not be executed and spread all over the network.
Windows virus will be as a dead-body on Linux file system, so it can be easily removed by antivirus or manually.
Concern: - But still there is chance someone copy virus files by mistake to a windows machine to make it alive. So i need your advise on this topic if someone using any solution to prevent spreading viruses coming from usb drive.

You would need your Linux server to have anti-virus that scans for Windows viruses. As far as I know, there aren't many such AV's. Furthermore, what's to stop someone from putting a Linux virus on the flash drive, instead? Your idea does raise the bar, mostly due to its obscurity, but I don't think you are getting enough for the effort and complexity of this solution.


Defense in depth vs single security architecture Traditionally, we have been that defense in depth is the best practice approach if we want to secure our premises from security breach. However, I recently read about DoD's Joint information environment (JIE) and one component talks about single security architecture. However, after reading up a bit, I still could not grasp what the JIE actually is and what SSA is. Can you simplify JIE and SSA? Is it about using the cloud? What is the advantage in moving into JIE architecture instead of defense in depth?

If I look at a presentation about the topic it does not look like replacing defense in depth, but replacing a heterogeneous environment containing lots of different mostly independent and sometimes incompatible security solutions with a more structured environment where all parts work together to better detect and deal with the risks. It still contains defense in depth, i.e. the idea is not to restrict the risk management to a single perimeter. But the major point is that the different security layers now work with each other so that information collected at one layer might be used to optimize protection at another layer.

Example: different layers detect different kind of suspicious behavior. While each of these information separately is not enough to detect an advanced attack, it could be detected by combining the information.


Selling HDD - wiping I am selling my HDD and I want to erase it. I would like to use DBAN, but it doesn't erase HPA and DCO, my question is, does it matter? What data can be here? And my second question - if I wipe HPA with DCO, can I normally install Windows afterwards, doesn't it damage the disc? Thanks.

Many different types of hardware write-blockers (e.g., wiebetech brand) will identify the HPA and DCO and remove them for you if you choose. Once the HPA and DCO are gone then wiping the disk, e.g., with dd, will remove all the data. E.g., supposing the disk to be wiped is at /dev/hdc:

sudo dd if=/dev/zero of=/dev/hdc

will get rid of everything if there is no DCO/HPA.

The information stored in the HPA/DCO is usually put there by the manufacturer and so the HPA/DCO should not contain any of your personal data. I.e., you're probably fine just not worrying about the HPA/DCO and wiping with DBAN.

If you wipe the HPA/DCO you should still be able to install Windows afterwards, it should not damage the disk... I'm pretty sure of this... although I wouldn't bet my life on it...


Library or service for rate limiting credit card transactions by IP I have a simple product ordering form.

A hacker is attempting to validate stolen credit card numbers by making two orders per minute with a bot.

99% of the orders are declined but some are completed. Which tells the hacker that credit card is a valid and active card.

Using a CAPTCHA or similar to prevent these attacks is unfortunately not an option.

Here is my strategy for limiting the attack:

Set a rate limit of one order per IP per five minutes. Do not allow multiple submissions to the same form from the same IP within five minutes.
Record every IP address that submits to the order form.
Fetch the recent order data from the shopping cart API.
Correlate the recent order IP's with every new order's IP.
If the rate limit is exceeded for a matched IP then discard the order
submissions.
If the rate limit is exceeded for a matched IP then block the order
submissions IP.

Is there a pattern that already exists for this kind of credit card transaction rate limiting?

Recommendations for existing libraries which use this pattern would also help me to research how others have solved this problem.

Thanks!

I would say: Ask your acquirer. If you roll your own library or use a 3rd party service, the rate limiting might not Count towards you in "fraud fighting score" at all, and you will still be liable if the order makes it through.

If you select such services by your acquirer, then the acquirer knows that you are actively fighting against fraud, and the acquirer might swallow any fraud that happens to originate from you, and you might also even get lower rates.

I would say, one great thing to do is block so the issuing country of the credit card must match the IP country of the visitor. Then you have closed the door for a large amount of fraud.
If your service is only usable in a few countries, you can also lock down so only those countries (both when it comes to IP and card issuance country) is permitted.

Another thing you can do is to use Verified by visa/3DSecure. VBV/3DS will trigger even if the expiry date or CVV is invalid, so the customer will not get to know if the card is valid unless the customer does authenticate Verified By Visa/3DSecure correctly.

You can use VBV/3DS in 2 modes: Either you use it in the "normal" mode, where cards without VBV/3DS will go through without problems. But you can also ask your acquirer to set your service to REQUIRE VBV/3DS, eg if the card issuer does not support VBV/3DS, the transaction is rejected. Not all acquirers might have this service available.


The security of sending emails with SPF/DKIM, but not signed We're using an email sending service (fairly known) to send our emails. We made DNS changes so that emails going through them would pass SPF and DKIM.

A few days ago we noticed that they allow any account with them to send emails on behalf of domains that do not belong to that account. For example, let's say my domain is mycompany.com, and now I want to add mycompetitor.com to my account. This service would now allow me to send emails from @mycompetitor.com.

I brought this up with them and their solution was to no longer "sign" the email, but still allow me to add whatever domain I want. So now I can still send from @mycompetitor.com except that Gmail, for example, would show "via email-sending-service.com". SPF and DKIM would still pass, and the email is not marked as spam.

So, am I being paranoid? I feel that using this email service it would allow anybody with an account to send emails that sort of look like they come from us.

They argue that this is "standard practice" and that anybody with a box somewhere could do the same. But, would SPF/DKIM still pass in those cases?

I feel that by making DNS changes I authorize this email sending company to send emails on my behalf, and then the company goes ahead and allows anybody with an account to send on my behalf (without the signing part); am I off?

Thanks

SPF on your domain is not about preventing you from sending forged emails; it is about preventing other people from sending emails with your domain. To be more precise, if you own domain foo.com, you can document in SPF that "every email which purports to come from an @foo.com address should exit from machine smtp.foo.com and none other". Email servers who receive an email with an alleged sender with an @foo.com address may then lookup the SPF records and check whether the email seems to come from the legitimate server (yours) or some other.

SPF processing is not mandatory so it is up to each email server to enforce it, at their leisure.

The SPF records on your domain (foo.com) will not prevent you from sending an email with a fake address, e.g. an address ending with @bar.com. In that case, it would be the SPF records on the bar.com domain which matter.

DKIM has a somewhat similar goal. When your server uses DKIM, then it signs every email that goes through it. The DNS for your domain documents that fact, and publishes the public key (the one used to verify the signature). Supposedly, when an email server receives an email with an @foo.com sender, that server will see your DKIM key in the DNS, and thus verify the signature. If the signature is absent or does not correspond to the mail contents, then the receiving email server will know that something is amiss.

There again, DKIM processing is up to each email server. And, there again, nothing in your domain will prevent you from sending emails with @bar.com as alleged sender -- but if the bar.com owner uses DKIM himself, your forgery will be revealed.

Summary: the DNS rules related to SPF and DKIM, added to the domain foo.com, document how an email should normally be sent/signed when it pretends to be sent by someone with an @foo.com address. The DNS rules in foo.com tell nothing whatsoever about emails which claim to originate from another domain.


Is there a way to steal PHP or ASP code from a web server through the HTTP(S) protocols? I am working on a web application that would include some custom development and got a bit concerned about code theft.

So the question I wanted to ask is whether it is - generally speaking - possible to steal PHP or ASP code from a running web server using the HTTP or HTTPS protocols?

My understanding is that getting PHP/ASP files from a web server would require BOTH:

that the attacker would have to get the server to somehow cough up files
that it normally does not send to the client, and
that the attacker is exploiting some security flaws in the web server
software

I am mainly asking for confirmation that it is not possible to get PHP/ASP files through some "normal" operations (operations that does not require the use of unpatched security holes).

Also, if there is some (roundabout) way to retrieve these kind of files through HTTP or HTTPS without the use of security holes, what can to be done to block that?

You are correct that this is not possible without mis-configuration or security vulnerabilities that allow it.

Generally, the most likely culprits when it comes to coughing up application code are commented out code, backup files that have extensions allowing them to be delivered directly to clients without processing, and probably more likely that all other culprits combined, are overly verbose error messages.

So, it's not just a matter of making sure that your application behaves correctly when you use it correctly, but also that it behaves correctly when abused.

That said, code theft is, generally speaking, a highly overrated risk.  Your code isn't that special.  I say that merely because in my experience, there's very little code that is.  It's highly unlikely that anyone really wants to steal it.   It's far more likely that the sort of flaws I enumerated above would be used in order to obtain sensitive information such as database credentials, or to expose the existence of weaknesses in application logic that could lead to exploitation by common vectors such as SQL injection.


Trusted (sealed) execution environment in Linux Is there any trusted (or sealed) execution environment for Linux that can guarantee the integrity of executable applications?

My use-case is like this:

I have an executable that reads a file and applies crypto operations on the file. The attack model is that the hosting system can be compromised by an attacker which can try to reverse engineer the executable or even probe memory. To ensure it does not happen, the executable needs to be executed in a trusted or sealed or isolated environment. Thought of using Intel SGX, but ruled out because it does not support I/O in the enclave. Any suggestion will be highly appreciated.

Thanks in advance.

No, this is not possible. Not in Linux and not in any other computer environment. It isn't a limitation of Linux, it's a limitation of physics.

If you run your code on someone else's computer… it's their computer, so they control what runs on it. If they have your code then they can see it run, inspect its memory, make it do different things if they like. They can run your code in a virtual machine for easier debugging. You can try to detect that but whatever you do they can bypass by giving your program the right responses, if they're sufficiently motivated.

Intel SGX works because when I buy a processor with SGX, it isn't really my computer, it remains partially Intel's computer. Intel retains control over the software that runs in the SGX enclave. You ship code encrypted and signed with a key that belongs to Intel; the SGX enclave decrypts and verifies the code with a key that's only accessible by the enclave. The enclave doesn't belong to me, it belongs to Intel, hence if you don't want your code reverse-engineered you need to trust only Intel and not me. I only get an encrypted blob from you and I can't run it elsewhere because I can't decrypt it.

You can use SGX for applications that require I/O. You just have to split your application into two parts: the trusted part that runs in SGX, and the user interface (and storage backend) part that runs outside.

Keep in mind that defenses against reverse engineering are very expensive (in terms of debugging and support costs, and also development time and performance loss). Reverse engineering and modifying a program is expensive; it's usually cheaper to pay you to do the modification than to do it and maintain it in-house.


Is there a secret-sharing public-key-encryption-based service? I need to share some sensitive information with someone else who can only communicate via E-mail.

I don't love the idea of sharing this information freely over email in plain text, so I was considering encrypting it using asymmetrical encryption (It's not a nuclear missile launch code, I just want to prevent someone finding a copy of the email in the 'sent' folder). I don't mind creating my own keys and so on, but this other person might find it difficult.

Is there a trust-worthy service on the internet that makes it easy to share sensitive pieces of information securely with others (via public key encryption or any other secure method)?

Citrix ShareFile is one such service. It is primarily used for transferring large files, but you can encrypt them.

It's not free, though.


Certificate services will not start with "server is offline" error I have a subordinate CA. The Enterprise root service was uninstalled from the network by accident and then migrated to a new box using the same key. This new server has a different server name. It worked for a few days and now the subordinate has two Delta-CRL locations and one is expired with an incorrect location pointing at an incorrect domain controller. How can I resolve this? The service will not start.

When AD Certificate Services starts up, it insists on validating its own certificate (the subordinate CA certificate). This entails verifying that the CA certificate has not been revoked, by obtaining the CRL referenced from the CRL Distribution Points extension found in that certificate. If the CRL have been moved, and not up-to-date CRL can be found at these location, then the validation will fail, and the service will refuse to work.

At this point, you have the choice between four strategies to recover the situation:

Put back the root CA, or more precisely the CRL issued by the root CA, where the subordinate CA expects them to be. By default, in an Active Directory context, CRL will be in a location which depends on the machine name (start the "Sites and Services" tool, activate the "show the services node", then find the "CDP" node). These are AD objects, which can be copied and moved (an AD object is "just" a collection of attributes) so you could script that process to do it automatically.
Push the CRL from the root CA into the local machine store of the subordinate CA, so that Certificate Services may see them even if it does not find them at the designated distribution point. This can be done with the GUI (mmc.exe console), or programmatically (CertAddCRLContextToStore())(I have done the latter, invoking the Win32 function from a piece of C# dynamically recompiled from a PowerShell script...).
Renew the subordinate CA certificate, reusing the same name and key, but with a new certificate with CRL Distribution Points pointing to the location where the root CA now publishes its CRL.
Scrap the subordinate CA and install a new one, reusing the same name and key. This is a variant of the previous strategy, but more thorough. To avoid losing control of all previously emitted certificates (these are still valid and you still want to be able to revoke them), you would have to push them back into the new CA using certutil (certutil -importCert to reimport a certificate, certutil -revoke to make the CA again aware of a past revocation). This is high and desperate surgery; don't do this until all other strategies have failed.

Generally speaking, ADCS has been designed so that it integrates quite deeply into Active Directory structures, and the complete ramifications are intricate and poorly documented. Things work "magically" by default, and you discover why when you do a seemingly unrelated change and they break.


Do modern GPUs have memory protection? What mechanisms (if any) modern GPUs implement to prevent different processes from accessing each other's memory (on graphics card)?

Yes.
Source: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/gpummu-model
That's the first result in a search engine while looking for "MMU GPU".


What secure alternatives do I have to storing postal addresses/telephone numbers in MySQL? I am working on a site that has an online health and safety course where you buy x number of serials to use. 1 serial per candidate. We don’t store credit card details and payments are processed securely by a third party. At the moment we do collect/store the address of any sign-up in a mysql database.

Even though it is still quite a new site with fairly limited budget I, as the developer, am trying to make the site as secure as possible. I would like to remove the address/telephone numbers from the database so if there was an intrusion there is less and less for the perpetrator to attempt to steal. We don’t need the address/tel stored in the db for any of the functions to work and as it is a digital product we don't need to send out to postal address. But we do want to keep the info and store locally if/when needed for marketing.

It's easy enough to remove the address/tel from the DB and update the payment process so these details are emailed instead to my client, who could then copy and paste all addresses as they arrive into a local spreadsheet and delete the email. But as I have read, it is taboo to send plain text passwords etc via email.

So, would it be acceptable to email 'addresses/telephone numbers' after payment in plain text which my client could promptly transfer to a local spreadsheet? Would this be considered more secure than storing such info in a database (which potentially could always be compromised)? Or is there some other method one would recommend in this situation?

While I think it's great that you're trying to secure your application, I am wondering: You're trying to protect your users from a database breach, and you're worried about postal address and telephone number. Are these two items really the most important things to secure? Usually, if you have a firstname and lastname, you can get these two data points from a public phone book. This doesn't strike me as very valuable data, unless your service is trying to keep users anoymous (but then you should also remove a user's name and username from the database and just identify him by a random number).

What I do like is the idea to not store data you don't need at all. André is right about pointing out that mailing addresses to someone in plaintext isn't very secure either, but I do like the idea to move the data to the person that actually needs it, and then remove it from your posession. This means you can't be held responsible in the event of a data breach, because you simply don't have the data.

Three ideas

1) What you could do to solve your problem is to create a second database on a different host that basically just stored the personal information of your clients, and build a microservice around it to store and query adresses based on a user id.

This would isolate the address database from the rest of your application and add another layer of protection, but it still wouldn't really solve the problem, because an attacker which can gain access to your database will probably also be able to figure out how to query the remote address service.

2) You can get an almost equivalent amount of additional security by encrypting the addresses and phone numbers in your database. If an attacker just steals the database, he won't be able to do anything with the encrypted fields, but obviously, he could also steal the encryption key. There's no way around that if you want to store data and keep it accessible.

3) The third solution uses public key cryptography to protect the addresses and phone numbers: You encrypt the addresses and phone numbers on your server using a public key. You don't keep the private key on the server. Only the owner of the private key can then decrypt the encrypted data, and since the private key isn't available on the server, it means that an attacker can't get at data that's already encrypted (but he could install a routine to pick up the addresses and phone numbers of new customers before they get encrypted). The downside of this solution is that your application has no access to the encrypted data, either.


Nmap reporting the status of a port as both opened and closed If I do not define any range (or if the range is large like a hundreds of ports), Nmap is returning ports as opened. However, if I put a smaller range or just scan a specific port, it says it's closed.

For example:

nmap -sV
1110/tcp  open     nfsd-status?
1111/tcp  open     lmsocialserver?
1112/tcp  open     msql?
1113/tcp  open     ltp-deepspace?
1117/tcp  open     ardus-mtrns?
1119/tcp  open     bnetgame?

nmap -sV -p 1110-1120
1110/tcp closed nfsd-status
1111/tcp closed lmsocialserver
1112/tcp closed msql
1113/tcp closed ltp-deepspace
1114/tcp closed mini-sql
1115/tcp closed unknown
1116/tcp closed ardus-cntl
1117/tcp closed ardus-mtrns
1118/tcp closed sacred
1119/tcp closed bnetgame
1120/tcp closed unknown

You are not providing much information about the target host. Is it a host you own and configured yourself? Or is this a scan of a 3rd-party host?

Assuming it is a 3rd-party host, I would suggest that the reason you observe this sort of behavior is because this host is behind some sort of network Intrusion Prevetion System or stateful firewall that implements Port Knocking.

When you perform nmap scans without explicitly specifying the port range, nmap scans by default the most common 1000 ports. During this scan, nmap accidentally* connects to the right sequence of ports in order to trigger a "knock", which results in dynamic modification of the firewall rules in order to allow connections to the ports you mentioned.

When you explicitly specify the port range, the "secret handshake" of connecting to a specific port sequence never happens and the firewall keeps dropping any traffic destined for those ports.

Given the fact that you observe such behavior both with top 1000 common ports and with other arbitrary large ranges, I would assume that the "knock" is a collection and not a sequence of ports -in other words, the order of connections to those ports does not matter.

[*] This might not be entirely accidental if this host is part of some network security challenge or a honeypot. It is highly unlikely for someone to roll-out such mechanism without bothering to test it with mainstream network/security scanning tools.


Why are there more research papers on Android malware than iOS malware? Based on this question.
Why are there more research papers on Android malware than iOS malware?

Android has 87% market share. Even if attackers manage to infect small percent, that is still lot of devices they can cover in small time frame they get before the vulnerability is fixed or malware is detected.
Android suffers from infamous fragmentation problem due to which most android devices lose security updates after 3 - 4 years and forever become vulnerable to new vulnerabilities. This gives attackers large timeframe to spread malwares through various channels until they are caught by Google Play Store and anti-malware agencies. So more malwares are built for android devices.
Android allows flashing of custom images which can used to gain root access. This is useful for researchers to disable some SELinux policies, customise kernel, attach debugger with the malware, dump its memory and analyse post exploitation behaviour of malware in real environment.
Qualcomm, Samsung and MediaTek release platform tools for their SoCs which can reflash even hard-bricked devices. This lowers research cost and if experiments go wrong, there's a safe state to go back to without requiring specialised hardware programmers. Using these tools, the process can also be automated to test malware samples in different OS versions and in generic system images.


Checklist for securing JBoss Is there a security checklist for auditing JBoss configuration files ?
CIS and DISA provides security checklist only for Tomcat and Apache server. Is there any other ressources ?

You do not specify what version of Jboss you are referring to, or if you're talking about EAP from Redhat, or the Community Edition.

The configuration is quite different from for instance Jboss CE 6 to 7.

These are some starting resources for both EAP and CE:

https://docs.jboss.org/author/display/AS72/Hardening+Guidelines

https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.3/html/Security_Guide/index.html


What is the purpose of a fuzzer? I've heard of these tools and from what I understand, they just send tons of random data at different services and observe their reaction to it.

What is the purpose of a fuzzer? How can it be applied during a pentest?

What is the purpose of a fuzzer?

A fuzzer tries to elicit an unexpected reaction from the target software by providing input that wasn't properly planned for. It does this by throwing "creatively constructed" data as input to software. Expecting a phone number? Ha! I'm going to give you 1,024 characters of 0x00! Random hex! Unicode! A zero-width field! Just the punctuation: "()-"

The goal is to get an error response that isn't clean... extra access, a buffer overflow, etc. Improperly handled input is essentially the crux of just about every security problem, whether by extending into unwanted memory ranges or any number of other reactions. An SQL error came back from the phone number field? SQL Injection time!

So, for all that, fuzzers are useful in finding flaws, and particularly during a pentest for using those flaws as a point to try and launch exploits from.


Does a network behind a NAT\modem firewall need a firewall? Would it be justified for a business that is behind a SOHO router\WIFI to run a firewall such as PFSense, or is the firewalling capabilities in the router "good enough".

For the most part the router acts as an NAT with all ports locked down unless explicitly forwarded.  Most of them even allow you to block outbound ports as well.  This is the bulk of what one needs a firewall for.

So tell me, what other capabilities, or "needed features" would one get out of running a "real" firewall in addition to their NAT router and why would one purchase that.

Routers are, internally, computers. They run an operating system (often a Linux or VxWorks derivative), with code. Like any substantial piece of software, they have bugs, some of which being remotely exploitable. However, unlike computers, they are rarely updated, so whatever security holes they have tend to be long-lived. And that's without counting more basic issues like default admin passwords.

While, conceptually, the router can be your firewall and thus any other firewall would be redundant, you would be well-advised to run an additional protection layer, such as a small PC with two ethernet interfaces, acting as a router/firewall, with a Unix-like operating system (some Linux or BSD flavour, for instance). The important point here being maintenance: don't consider the box as an opaque appliance to be installed and then forgotten. You have to check for security updates, preferably daily.

I thus recommend installing another firewall in addition to your SOHO router, not because the router would structurally be bad at firewalling, but because adequate security is reached only if proper system administration is applied, and you cannot really do that with a SOHO router; whereas you can with a PC and an open-source, maintained operating system.


Is it preferable to perform encryption using database functions or code? Several databases I am familiar with provide functions or modules for encryption. Examples include dbms_crypto for oracle databases and built-in functions for MySQL.

Most of the commonly used programming languages have cryptography libraries available.

From a security perspective, are there any issues that would lead to choosing one over the other? Is one method highly preferable over the other?

The algorithms provided are almost the same.  The choice would depend on your use cases.  Some things to consider:

If the encryption is on the servers side, considering encryption at the client
side to avoid cleartext transmission over the wire.
Deciding on reversible or non-reversible encryption based on type of data.
In the case of non-reversible encryption, is hashing just to avoid
tampering or using hashing as a subsequent comparison?


My Usage of Snapchat via a VPN So, say I am using Snapchat, can my internet provider see that I am using it?

Today practically all of the information sent on the Internet is encrypted. There are only a few exceptions.

This encryption is typically unbreakable by an ISP (you see warnings in browser windows, or your applications don't work et al). They might be breakable by some governmental agents. There are only a few exceptions.

However, even an encrypted communication gives some information to a possible eavesdropper:

Only encryption still does not hide, with whom are you communicating. Snapchat communicates with some central servers in the USA.
Only encryption still does not hide, when and how many data packets did you sent.

These might be enough to collect a surprisingly many information from your communication.

If you use VPN correctly, they can't see that you are snapchatting, but they can probably see from (2) that you are chatting. They can also see that you use a VPN.

If you use snapchat without a VPN, they can see that you are snapchatting, but they can't see what.

Note, governmental security services have significantly more power than an induvidual ISP. For example, without a VPN, they can estimate with high probability, with whom are you snapchatting. Induvidual ISP can do this only if your partner is the customer of the same company (and it is mostly an irrelevant info for them - they want your money, not your chat messages).

Of course any governmental agent (or any agent with the same power) having power over the snapchat, can ask them to simply give them their logs. Thus, you have more reason to fear them. Snowden's surprising results is that they are doing it automatically, with practically all internet users of the world.


Why do we need WTLS? Please excuse my probably gross misunderstanding of how all this works.

I just started reading SSL & TLS Essentials by Stephen Thomas, and in chapter 1 he talks about how TLS is a separate protocol layer below the HTTP application protocol, and since it is a separate layer, different application protocols may use it (such as FTP).

My question then is if wireless devices use HTTP (they do right?), why do we need a separate protocol for WTLS? Why can't regular TLS be used for wireless devices using HTTP just as it can with wired devices using HTTP?

According to Wikipedia, WTLS is part of the Wireless Application Protocol (WAP) stack, but again if TLS can be used in conjunction with multiple application protocols, why couldn't TLS be used with WAP?

WTLS is a derivative of TLS with optimizations for size, especially for the handshake messages (suppression of redundancies, more efficient encoding, compression...). WTLS also tries to be more "packet-friendly" (TLS works over a bidirectional stream and ignores any notion of packet, thus it breaks data into records based on its on internal needs; WTLS tries to make the TLS-like layer more aware of the size of individual underlying packets).

Apparently WTLS has been superseded with "plain TLS"; so says this document (slide 19). I guess that the purported optimizations where not really effective in practice.

Also, there is a more standard packet-aware TLS derivative called DTLS.


Man in The Middle attack on secure key exchange protocols I am going through CISSP materials and I got stuck on Secure Exchange Protocols such as Diffie Hellman and RSA. It is known that DH by itself is vulnerable to MiTM. So the answer is to use authentication methods such as certificates. That's fair and square because that's what https is based on. But how does that make it MiTM proof if we have things like SSL inspection? SSL inspect is by nature a MiTM attack designed to intercept encrypted traffic by injecting its own certificate and looking like the CA for the destination's certificate. Most modern AV solutions today do the same thing. If you check certificates of the https websites you go to, they will be signed by your AV vendor.

These are the sources I have used

https://www.emc.com/emc-plus/rsa-labs/standards-initiatives/what-is-diffie-hellman.htm

How do RSA fingerprints protect from MITM attacks?

https://stackoverflow.com/questions/10471009/how-does-the-man-in-the-middle-attack-work-in-diffie-hellman

The RSA article says "Even though Carol is still able to intercept messages between Alice and Bob, she cannot forge signatures without Alice's private key and Bob's private key."

My question is, why would she need to do that? If she is intercepting their data, she can simply use a certificate signed by her and pretend to be either party. She can use her own private key for signing and decryption because she already provided both parties with her own public key. Then re-encrypt the data with the destination's public key and pass it on. Isn't that exactly how SSL intercept works?

The only way around this I can think of is that her CA used to sign the fake certificate would not be in the trusted certificate root stores of the victims. But when I think back to all the L2L VPNs I have created using Diffie Hellman, neither of those things (certificates or cert root stores) were used.

I must be missing something here.

The reason is the one you highlight at the bottom. You are trusting the certificate. Certificates used for performing MiTM on a corporate level, such as when doing SSL inspection, relies on having an internal CA deployed that is trusted by the computers in the domain. Often the trusted CA is pushed down by the domain controller on the domain machines.

L2L VPNs use IPSec which implements DH for key exchange (IKE):

Phase I: The peers authenticate, either by certificates or via a pre-shared
secret. Authentication.
Phase II: A Diffie-Hellman key is created. The nature of the Diffie-Hellman
protocol means that both sides can independently create the shared
secret, a key which is known only to the peers. Key exchange.

Have a look here for a more in-depth discussion


What options are there to clone or image a disk to an encrypted drive? To ensure that cloned or image disks remain secure and are not accessible by others, there is a requirement to have these stored on encrypted drives.

When attempting to use tools such as Macrium Reflect, Acronis, O&O Software, there doesn't appear to be an option to mount an encrypted volume.

The primary tool of choice is O&O DiskImage as it supports cloning or imaging disks that are encrypted via BitLocker.

Since disks are often cloned or image in locations with no network connectivity, the only option is to use encrypted external hard drives. The devices are booted using a bootable CD as this negates the need to install the software e.g. O&O DiskImage.

How can disks be imaged or cloned to encrypted external drives?

You can boot into a live Linux CD to do this. The drive encrypted with Bitlocker will be exposed as a regular block device which you can access like any other. If the destination drive is already encrypted with VeraCrypt, you will need to first open it and map it to a block device that you can mount. This can be doing with using a modern version of the cryptsetup utility like so:

cryptsetup open --type tcrypt --veracrypt /dev/sda veracrypt
mount /dev/mapper/veracrypt /mnt

This creates a new block device at /dev/mapper/veracrypt from an already encrypted VeraCrypt filesystem from /dev/sda, and mounts it. Assuming the Bitlocker drive you want to image is located at /dev/sdb, you can then directly copy it to the encrypted block device's mount point as a file:

pv /dev/sdb | tee /mnt/bitlocker.img | sha256sum >/mnt/bitlocker.img.sha256

This will create a bitwise image of the encrypted Bitlocker drive and put it on a file on your VeraCrypt filesystem, while simultaneously generating a SHA-256 hash and writing it to a text file. Make sure to save the hash it generates to a safe place, as it is necessary to use to prove the integrity of the encrypted Bitlocker drive if it becomes necessary.

If you want to copy the Bitlocker image back to the drive, you can write it directly back:

pv /mnt/bitlocker.img > /dev/sdb

Naturally, this will overwrite the drive with the disk image.


How to configure Kismet to redetect same BSSIDs in a loop? So I am working on a tool to detect any wifi device using Kismet.

When I use Kismet, it works fine, but my problem is, it detects a device once, and until the MAC changes, it wont detect it again. However, I want to see, if the device is still around me and using wifi for something... I don't care if it is a access point, a cell phone or anything else, all I want is to enable kismet re-log it, even if it has the same signal strength, MAC address and name.

Basically I want Kismet to re-scan and re-log everything automatically in a loop, even if the device have been logged before. In a script I can do this maybe but I wonder if there is a easier, more stable way... Maybe a Kismet command that I missed out?

There really isn't a command for this. Your best bet is to script a scan every few minutes, or find an app which functions more like a spectrum analyzer.


What stops a malicious DNS subdomain provider from impersonating my website? First, some background: The DNS-01 verification method of Let's Encrypt requires you to add a TXT record to a special subdomain your domain name to prove your identity. With ACMEv2, this can allow you to get a wildcard certificate, which worries me (see below). The HTTP-01 verification method proves your identity by requiring you to add a file to .well-known/acme-challenge diretory. The HTTP-01 method does not allow the issuing of wildcard certificates.

Let's say that I register a domain with a DDNS (Dynamic DNS) provider. I get a subdomain (mysite.dnsprovider.example) and I secure it using a Let's Encrypt certificate using the HTTP-01 challenge. I install it and go on with my day, assuming my site is secure. But couldn't the DDNS provider request a certificate for *.dnsprovider.example using the DNS-01 and pretend to be my website with that certificate? There seems to be nothing stopping them from doing that and this seems to be critically detrimental to the security of my website. If anything I've made it easier for the provider to MitM my website since I've told them the IP address of my server. A potential way I've found to secure it is HPKP. I've read into HPKP but it's deprecated now and I highly doubt any major browsers still support it after so long. I know that I could always purchase a separate domain name, but assume that purchasing a domain name is not a viable option in this case. Besides getting a new domain name or HPKP, is there anything else I could do to avoid or at least mitigate this type of problem?

Note: I understand that Let's Encrypt's certificate issuance process is meant to be automated, but please also assume that manually configuring something on the server every time a new certificate is issued is feasible.

This question is similar to Is the _acme-challenge subdomain protected? but the key difference is that this question assumes that the second-level domain operator is the potential bad actor instead of someone requesting a third-level subdomain.

Yes, the DDNS provider could issue a wildcard certificate. It could also send your visitors to another IP address, because the provider has control over the DNS entries of your subdomain. (Without a complicated MitM setup)

Given the constraints (no own domain name), you have to trust your DDNS provider to not spy on your visitors.

However, all new official certificates have to be documented in a certificate transparency log (rfc6962) to be trusted by Chrome and Safari (Firefox sadly does not offer this feature as of today). By checking these logs, you can find out if someone (e.g. your provider) has issued a certificate for your domain (or a wildcard certificate that includes your domain). You can check these logs at crt.sh.

To sum up, you can't prevent it, only detect it.


Large / Over-sizesd HTTP Header Lengths and Security Implications Wondering if there are any security implications / risks involved with a server returning relatively large (100+) HTTP header lengths?

Several firewalls (or IDS, IPS, UTM, NGFW - whatever you call them) have limits on the length of content they analyze for malware (usually around 10MB, but sometimes even lower). Some include the length of the HTTP header into this computation. In this case the analysis of the HTTP body (containing the malware) can be bypassed when the HTTP header is already larger than the inspection limit.


How does an attacker authenticate to a service using just the hash of the user (after performing a "pass the hash"-attack)? Let's say the attacker got the username and the hashed password. How can he use it when authenticating to some service in its domain with for example NTLM?

How can he send the request as the compromised user? What tools and techniques should he use?

In a pass the hash scenario there is no salt mixed in with the password when a user authenticates, because of this an attacker can get the hash of the users password when they authenticate to a service and then pass it along to authenticate to more services that use the same authentication scheme without knowing the password. NTLM is an example of a authentication scheme that is vulnerable to this.

https://en.wikipedia.org/wiki/NT_LAN_Manager


Does sending image files in http in a secure application pose any risk? I came across this scenario recently, where a mobile application used for banking is sending HTTP requests for GIF images and HTTPS requests for all other transactions. But the requests to the GIF images are sent to a different domain and requests to bank related transactions are sent to another different domain. Does this behavior of this application pose any security risks?

I mean, can the http request & response be tampered to perform any kind of attacks?

If possible, how can this be exploited?

If HTTP resources are loaded into an HTTPS page, then the padlock icon will disappear from the client's browser because the page isn't secured properly.

This is very bad because users will be unable to distinguish between the real banking site and a phishing website. (Hopefully most users will notice the absence of a padlock and exit straight away.)


SSH from a shared workplace computer The main question: How can I securely connect to my personal computer at home from a workplace computer?

Background: I do much of my work on a university computer, but the computer itself is not fantastic, so I SSH into my home machine to run computations. This system works well, but I am facing a dilemma about how to properly secure my home computer. On one hand, I would like to disable password SSH login and only use SSH keys. However, that would require generating an SSH key on my university computer that could relatively easily be seen/copied/used by others. I also don't want to keep my username/IP address in a config file that is easily viewed by others.

The university computer I use is "mine" in that it is at my desk, but anyone with an account can SSH into it and has read access to my home directory where the SSH keys are stored and I don't have sudo privileges to protect against that.

What do you recommend in order to be able to securely connect from a workplace computer to a personal server?

Given that you have a stable computer, I would go ahead and do use ssh keys instead of a password for ssh access (even if you were using a different lab computer each time, a ssh key in a portable usb would probably still be preferable).

The ssh key could be stolen, but using a password on it should provide a similar security to a ssh password, except that you need the key file, too. Yes, the ssh client can be compromised to steal the key passphrase, but the difficulty would be equivalent to that of compromising the client to steal the ssh password. Do remember that you may load ssh identities into an agent in such way that they require confirmation before being used (as well as unloading/not using a ssh-agent at all, although I recommend it).

A hardware token (as recommended by Luis) would be best in protecting the ssh key, but it might not be an option.

As for not showing the IP address you connect to, if you are using the openssh client you want the HashKnownHosts yes ssh_config option (for some distros that's even the default). Probably not really worth hiding, though, it shouldn't be "secret stuff", and cold be easily extracted from network logs.

On the server, as a way to further protect the login from unauthorized random hosts, you could:

Disable password authentication (that you wanted to do)
Restrict the users that are able to log in (to the only one allowed)
Use a non-standard port
Restrict the IP address that are allowed to connect. Being an University, 'your' computer will have a static outbound IP address, probably even a public IP address just for you. Worst case, restrict to the University range.

These are mostly "additional measures", since they can't deter a determined attacker that abused his superuser power on your computer,¹ but I feel it's good to at least list them for future readers.

However, the important solution to your problem is you don't give general access to your home computer. Since you want to connect through ssh, I assume your home machine will be a Linux/BSD/MacOS one.

You will probably have a user account there from which you perform daily tasks such as browsing the internet, writing (personal) emails, or watching youtube videos. However, you don't need access to any of that, as you only care about computations. So you set up a separate, limited access for running computations. You could be connecting to a Virtual Machine or a container, but just a separate account should serve for your needs. You only need that the hardware is fast(er), an account with a little space and the needed programs installed on the machine would do fine. Some basic Unix permissions that didn't allow other users to access your "home files" would be enough.² Obviously, keep your home computer patched against local escalation exploits.

A second potential issue would be that an attacker that accessed that low-privilege account were to compromise other devices in your local network. As well as securing adequately the other devices, you could either negate all network access to that low-privilege user, or restrict that to outside addresses only.

¹ E.g. the ssh key wouldn't work from other machines, but they could proxy through yours to access

² There are all kinds of processor sidechannels but mostly not relevant, you can disable sshd when accessing it locally, and shouldn't leave sensitive things running anyway (no, you shouldn't leave a CA running there ).


How to specify virtual web hosts in Nessus (host header/SNI) Say I have the web server 198.51.100.125 in Amazon cloud that I want to scan, which is hosting two domains example.com and example.org.

In Nessus, I have configured the targets like so:

198.51.100.125[example.com]
198.51.100.125[example.org]

This is so Nessus can send web requests with host: example.com and host: example.org when testing the two sites for vulnerabiliites, instead of scanning the default website. Ditto for SNI when using HTTPS.

However, the Nessus results are showing the web vulnerabilities on the reverse DNS host of 198.51.100.125, which is http://ec2-198-51-100-125.eu-west-1.compute.amazonaws.com and https://ec2-198-51-100-125.eu-west-1.compute.amazonaws.com instead of the http://example.com, https://example.com, http://example.org and https://example.org sites.

I'm sure I've successfully done this previously, however it is not working this time.

What gives? Is there anything to check in configuration?

It appears you may have the format reversed.  According to this post by the creator of Nessus, the format should be

example.com[x.x.x.x]


Self-teach pentesting/CEH skills ethically I am a Software Engineer currently and have done quite a bit of systems work as well. I love the idea of Penetration Testing and would love to work towards becoming a pentester/Certified Ethical Hacker. My question is: what are some ways one can learn basic skills in this field while remaining ethical/legal?

Self-teaching programming was an easier task for me--I could learn a language by building small applications, scripts, etc. I learned Linux by installing it on my personal computer and hacking around on it. Pentesting however requires a machine to test, which can quickly become a legal issue. I can certainly create a small application with known security issues that I can pentest myself, but that would take away from the aspect of actually finding the bug.

My main questions then are:

What ways can an aspiring pentester/CEH get hands-on learning experience without turning to black-hat hacking?
I have heard of sites that are online that are "designed to be hacked" and are practice for hackers. Are these legal/useful?
Is it worthwhile/ethical to offer free or low-cost pentesting services to improve skills? (Another great way to learn programming, sounds totally sketchy though to offer free hacking! ;) )

Thanks in advance!

There are many "boot to root" and "vulnerable by design" challenges you can have a go at completely legally. You'll need some VM software, and make sure you set the network settings on it so that the machine can only be seen from your internal network!

http://www.kioptrix.com/blog/?page_id=135 - Has several challenges which can be done this way.
http://hackingdojo.com/pentest-media/ - As above

Holynix is another (I can't link more than 2 due to new account here).

If you search for g0tmi1k's blog, he has the solutions up for most of these - don't look even if you get stuck in my opinion. Just use them to work out how you could have done it faster/better afterwards.

Good luck!