Threat modelling - including threats one cannot mitigate? When threat modelling, should you include the threats a system cannot mitigate?

If so, where should you stop? It could be very time-consuming to list all the threats one cannot mitigate.

While I think Jonah B covered things pretty well. Just to be more direct.

I would say "Yes", certainly.

Risks you cannot mitigate are as important as any other risk.

Residual risk is the important measure. This is the risk that remains after mitigation. You take all of the residual risks into account when working out the overall risk. Where there is no mitigation, the residual risk is the same as the initial risk.

Then, as Jonah says, you need to have an open discussion within the organisation about the residual risks and what they mean to the business. You also need to understand the risk appetite. How much risk will the organisation want to carry? This needs all organisational risk to be managed holistically of course.

UPDATE: Where should you stop? When the risks are irrelevant.

This also depends on who you are doing the modelling for. Senior and C-level people will only want the big ticket items that impact the business as a whole. Project Managers will want anything that could impact project delivery. Service managers want risks that will impact live running, SLA's etc.

If you are modelling a system change that will improve an organisations bottom line by $2m pa, you may be interested in risks that might have a monitory impact of a few hundred dollars in a year - unless they also have some other important impact such as customer trust or legal issues.

There is no single, one-size-fits-all solution for risk management.


Where can I get more info about these viruses? I've been using Airtel 3G Dongle (Data Card) on Windows and ClamWin has detected the following viruses in the dialer software of Airtel:

C:\Program Files\airtel\TCPOptimizer.exe: Win.Trojan.Swrort-4757 FOUND
C:\Program Files\airtel\UpdateDog\QueryStrategy.dll: Win.Trojan.Agent-1154787 FOUND
C:\Program Files\airtel\UpdateDog\RunOuc.exe: Win.Trojan.Agent-1384356 FOUND
C:\ProgramData\Mobile Partner\OnlineUpdate\QueryStrategy.dll: Win.Trojan.Agent-1154787 FOUND

But I couldn't find any more information about it online. I found this page for Win.Trojan.Agent-1384356 that seems to suggest that a lot of other AV like TrendMicro and MalwareBytes don't consider this as a virus. Does that means its a false positive?

I'm using ClamWin because its a light-weight and offline scanner and I don't want to use any resident "heavy" scanners as they could strain my computing resources. But is there a way to disable/quarantine these exe files or should I just delete them?

You can upload the files to VirusTotal yourself and see what other AVs think about them. (I saw your link, but you should upload your copies as well) Also check malwr.com to see if it has any more info. There is also HerdProtect.

Side note: malwr.com allows you to search by MD5 hash (you can get this from VT when you upload your files)


Modsecurity Encrypted traffic in 3 tier architecture The scenario is that we have 3 tier architecture DMZ > BEA > DB with end to end encryption the data is encrypted within DMZ > BEA > DB.

I have read that modsecurity doest deal with encrypted traffic it is positioned in Apache in a way that after mod_ssl decrypts the traffic, modsecurity analyze the un-encrypted traffic.

Now after modsecurity analyze the decrypted traffic, in three tier arch it will be passed to BEA, now will that traffic be encrypted? Like after modsecurity does its thing, will that traffic again pass through mod_ssl to encrypt and send to BEA or it will be send directly to BEA after modsecurity as unencrypted?

Thanks

That depends entirely on your configuration and your wishes.

Your setup certainly could re-encrypt  after analyzing with mod_security and before forwarding to your application server. You would do so by using the ProxyPassReverse and SSLProxyEngine configuration options - see this question for an example.

So that begs the question: should you use TLS between your webserver and your application server?

To answer this question you'll need to assess your network and determine if you actually trust it sufficiently to retransmit your requests in the clear.


When brute-forcing DES, does knowing something about the plaintext help? Data Encryption Standard (Wikipedia)

I know that with brute force there are 2^56 possible keys to check (56 bits, each either a 1 or 0). But let's say I know the message itself is only made up of letters (a-z, A-Z).

Would knowing things (like the limitation to just letters) about the plaintext make breaking the encryption easier?

In a standard brute force search it is assumed you already know at least one plaintext and its associated encryption with a given key. So having the plaintext be from a restricted set is not going to help unless there is some other weakness you are taking advantage of.


Must the CN of a certificate (self-signed or otherwise) be DNS resolvable? I'm trying to get Bareos working with TLS encryption using a self-signed certificate.

I have used the name of the server for the self-signed certificate CN. The server does NOT have a domain set.

But I'm getting an error...

# bconsole
Connecting to Director Server-Name:9xxx
Authorization problem with Director at "Server-Name:9xxx"
Most likely the passwords do not agree.
If you are using TLS, there may have been a certificate validation error during the TLS handshake.
Please see http://doc.bareos.org/master/html/bareos-manual-main-reference.html#AuthorizationErrors for help.

Also from the log...

05-Oct 10:23 bareos-dir JobId 0: Fatal error: Authorization problem: Remote server did not advertize required TLS support.
05-Oct 10:23 bareos-dir: ERROR in authenticate.c:283 Unable to authenticate console "*UserAgent*" at client:17.x.x.x5:9xxx.

I'm curious if this has to do with how TLS resolves the hostname to match it to the certificate. The CN/Name-of-the-server is in /etc/hosts, but is not resolvable via DNS.

I.e.

root@Server-Name ~ # hostname
Server-Name
root@Server-Name ~ # domainname
(none)
root@Server-Name ~ # ping Server-Name
PING Server-Name (17x.x.x.x5) 56(84) bytes of data.
64 bytes from Server-Name (17x.x.x.x5): icmp_seq=1 ttl=64 time=0.042 ms
64 bytes from Server-Name (17x.x.x.x5): icmp_seq=2 ttl=64 time=0.034 ms
64 bytes from Server-Name (17x.x.x.x5): icmp_seq=3 ttl=64 time=0.040 ms
^C
--- Server-Name ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.034/0.038/0.042/0.007 ms
root@Server-Name ~ # nslookup Server-Name
Server:     2x.x.x.x0
Address:    2x.x.x.x0#53

** server can't find Server-Name: NXDOMAIN

No DNS is involved in comparing the subject of the certificate (CN or Subject Alternative Names)  against the given hostname. It will only check if the expected name matches the subject, i.e. either exact match or wildcard match.

DNS is only used for getting the IP address to the hostname. This IP address is needed to make a TCP connection to the destination and then run TLS on top of this TCP connection.

In your specific case DNS is not used to get the IP address for a hostname but a fixed entry in /etc/hosts is used. How exactly the resolving of a hostname to an IP is done is usually transparent to the application and also depends on the system and system settings. ping in your example will transparently use the entry from /etc/hosts since it is using the resolving functions of the libc. nslookup instead will fail to resolve the name since by design it will query a name server (hence the name of the program) and not look into /etc/hosts.

As for your specific problem .. I don't know about Bareos but the error message suggests that the client is configured to use TLS while the server is not (properly?) configured to provide TLS. This has nothing to do with certificate validation since the client can only validate a certificate if the server supports TLS in the first place, which does not seem to be the case here:

  ... Authorization problem: Remote server did not advertize required TLS support.


Does a 'mailto:' hyperlink spoil any preceding email obfuscation efforts in PDF? Assume there is a PDF file which contains the example@example.com email address as an image (the classic obfuscation method).  However, what if this image is made clickable with a hyperlink which would contain mailto:example@example.com?  In this case, in SumatraPDF, for example, I can

hover over this image and see the mailto:example@example.com tooltip;
hover over this image and invoke context menu to choose the "Copy Link Address" action (after what, mailto:example@example.com ends up in the OS clipboard);
click this image to invoke the corresponding (OS configuration-dependent) action on mailto:example@example.com.

Since, SumatraPDF is capable of displaying and copying mailto:example@example.com, I assume that this information could be easily extracted by harvesters, couldn't it?  Nevertheless, simple grep example@example.com <pdf> and grep mailto <pdf> over such PDF file do not yield any matches.

NOTE:
I have no idea how PDF stores such data.  Thus, any details on this, which would accompany and support the answer to the main question, are extremely welcome!

Should one avoid providing a mailto: hyperlink to improve protection and/or not spoil any preceding obfuscation method (whatever it was)?

Certainly all private information in any file that is published online and accessible by a potential adversary is at risk.

Regarding spam this is not the likeliest scenario, as they are plenty other sources of email adresses that require far less effort, such as leaked databases, mailing lists, public profiles of website showing your email address and any kind of public record such as DNS or in Germany the Impressum (which contains contact information of the webmaster and is legally required).
There are many more source, and mailto: is harvested specifically from scanned websites containing contact information. I have not found evidence that email harvesting is also done from PDF, but it certainly would be possible.

The conclusion is that it certainly makes sense to remove mailto:, in general treat any information that is contained in a publicly accessible file as analyzed by someone. So if some content is private and you do not want anybody to misuse it, don't put it in. What is removed cannot be misused.


how to protect my data from malware/spyware that infected my BIOS? we all know that some countries do their best to spy on their citizens and the citizen of other countries and that countries maybe have specialized spying agencies wither they are known or not, and, from my basic understanding that the most effective ways is to infect the HDD or BIOS firmware.

Now the infected HDD can be avoided by using another storage media e.g. USB pendrives and to use live boot OS that uses RAM instead of HDD e.g. Tails OS, But, the real problem that worries me is the already infected BIOS and my question is :

What can I do in order to protect my encryption private keys in case of infected BIOS? please note that I assume that the BIOS is already infected since the governments can modify and temper with BIOS firmware before it is being sold in their country.

The only way to get control over your computer, that works always, is to physically replace the infected BIOS flash chip with a non-infected one (provided that only the BIOS is infected). It is possible that the flashing utilities aren't infected by the government, so you can perhaps even flash a non-infected BIOS from inside a system, which comes with its own problems to solve like how to acquire such a firmware, or by accessing the needed flashing bus via hardware tools, but generally, there is no cheap way to "bootstrap trust" out of distrust about hardware.

You will have to find out how exactly, and how deeply the government infects your computer with their spyware, and then try to counter that, the only general answer to this is to replace the actual hardware parts.


Having web client do requests with User's 3rd party API key? I am trying to figure out the best way to do this. I have done some searching and all I have found is about storing API keys in a back end, nothing like my use-case where there is no back end.

Background:

I am writing a web app which only runs client side, no back end. In essence the app is a visualizer for the responses from a 3rd party API. Each user would provide their own API key and the app would make the API calls on their behalf, then visualize the responses client side.

There is no logging in by the user into anything. The site is an SPA in React which runs totally client side. The only calls the app makes to the wider net is to this 3rd party API (not counting calls to CDNs for resources when the app is first loaded).

Question:

How do I store the API key for the user? I also asked this on r/webdev and the answer I got was in plain text in localStorage which does not feel like a good idea.

Since the keys are not leaving the client except when making API calls which are HTTPS I would assume the only way to get the keys would be via an XSS attack?

Generally browser's local storage and cookies are considered safe, since if user's machine is compromised we can't do anything. However you can (somewhat) increase the security of data at rest with a layer of encryption.

To store the keys securely on user's machine you can request a password from user, which (after passing it through KDF, for example PBKDF2) would decrypt an encrypted container with API credentials (AES+MAC, something like SecretBox from libsodium) which is stored in localStorage.

Any other way I can think of requires you to store encryption key somewhere on the user's device, which only obfuscates the data.

  the only way to get the keys would be via an XSS attack

Also check if your site needs to be iframe-able and if not - deny it in server headers. Iframes should be safe, but they have been abused many times in weird and wonderful ways.


How to use 'key material' so that multiple people can access protected files? I'm not sure if this is the right SE to ask this question, but it seems more I have a database of files that needs to be encrypted such that multiple people with different passwords/logins to this remote system can access the same files without entering a second set of credentials.

Specifically, I need to be able to support:

multiple users accessing the 'plaintext' version of a single file that's been encrypted once
revokation of a single user's rights (if they get fired, etc)
allow a user who has forgotten their password to get a new password (ie, password resets)
ideally, allow for remote searching/sorting of such encrypted files while minimizing the ability for an attacker to intercept credentials.

My knowledge of security is theoretical at best; I've done some dongle encodings (well aware that crackers will destroy the security given enough time), but this kind of distributed system is a bit beyond me.

My current idea is:

have a certificate file that serves to decode the remotely encrypted files.  This certificate is encrypted by the user's username/password.
users log in remotely prior to trying to decrypt the certificate, so if they cannot log in (ie, they are no longer working there, whatever), then they can't get at the certificate.  This is extremely weak, since they should be able to decrypt the certificate anyway if they're savvy.
for remote searching/sorting of these files, do date range presorting of the files.  This technique is only valuable because we do not expect more than 5-10 additions to the database per user per day (and even that is ridiculously prolific), so getting entries from the last three days, three weeks, etc, supports our most expected use case.  Then  decryption/searching/sorting of these files can be done locally.
for password reassignments, they need to get another encrypted certificate with the new username/password.  That means that someone else on the site (the administrator, or whomever) must have access to a plaintext version of the certificate to provide the user with a new certificate, which means that new passwords must be assigned by an administrator.  Which I'm OK with.

This approach is bad for a few reasons:

savvy users can decrypt their old certificate using their credentials and knowledge of the encryption/decryption routine.  This is not too big of a deal, because they cannot access remote data anyway, since their logins will fail.
remote searching/sorting will be painful.
if everyone on the site loses their password, they lose all their data.  I'm tending to think that if customers want this level of security, then they also want this kind of consequence.

So I ask this community — does this approach sound feasible?  Is there a package or group of utilities I should be looking at for this (or some other, more improved) approach?

To be clear, this system will store encrypted data remotely, and the user will then access that data.  I can make the user client be on any system, but the idea is that it will be a program that we give to the user to access the remote data.  The server should never have plaintext data.

So, if the user is on Windows, then they will have a client, a certificate, and login credentials.  The certificate would be encrypted with those credentials, so that it can be decrypted and used to read data from this remote system.  I cannot change what OS the user will have.

These are different security levels and they need different solutions:

Encrypting file ensures that anyone - without the proper key - could steal it but not read it.
Having a bunch of users to access some files with some credentials is a different matter.

If a user can access the plaintext version of a file then it does not matter if that file was ever encrypted as your system (and file encryption) is transparent to the user. When she logs in, she sees all the files she has access to, and she won't even know if those files are encrypted or not.

A linux system can provide everything you need here. Create different users, even set them up to log in with certificate then allow them to access files with proper user/group rights.
If a user should be able to upload encrypted files then create an RSA keypair, and distribute the server's public key to the users. With that key they can encrypt a file, and it can be decrypted on the server side.


Key derivation inside secure container of HSM I have to implement custom key derivation function which basically works as follows:

I have encryption key K in secure container of HSM. K can't be exported and the only way how to use it is through HSM command or PKCS#11 function.

The derived key DK is the output of encryption data with key K, so DK = E(data, K).

My problem is when I implement this function through commands or PKCS#11 function, I will get a clear-text of DK outside of HSM secure container.
I need to secure the key so it never leaves the secure container.

Is it possible to implement custom functions, such as my derivation function, inside secure container of HSM so the output could be secured as a cryptographic key?
How to do it without getting the clear-text output of DK?

Some HSM are configurable enough to allow adding functionality within the HSM. However, this will not be doable through PKCS#11, which is an API meant for invocation of cryptographic algorithm on externally provided data. What PKCS#11 offers and is closest to your problem is C_UnwrapKey() that can take as input an encrypted key (key is encrypted with another key) and decrypts it. However, chances are that the custom key derivation function that you must implement does not match any of the key unwrapping formats that your HSM knows of (if only because you derive your key with encryption, not decryption).

As for extended the HSM functionalities, it happens outside of the scope of PKCS#11, so if this is supported at all by your HSM, it will be done with methods specific to that HSM. I have some experience with Thales HSM (formerly known as "nCipher"): some of them allow custom code to be pushed into the HSM, provided that you activated (i.e. paid for) the relevant option, called CodeSafe. When I was doing that (now some years ago), development was done in C, with a much reduced subset of the standard library; the HSM CPU was not fast at all (think megahertz, not gigahertz); but there was a substantial amount of RAM (dozens of megabytes), and, most importantly, the cryptographic accelerators could be used for crypto operations.


Types of attacks outside of AppSec and Vendor-Specific Systems? I'm reading up on the OWASP Top 10 for helping me defend my web app against common "app sec"-type attacks (SQL Injection, CSRF, etc.). And in a recent question I was prompted to not only use OWASP Top 10 for appsec vulns, but to also list all of the applications and tools I am using as part of my architecture and cross-check them against the CVE Database, which I will do.

But then there's other types of attacks: attacks that are not appsec related (not on OWASP Top 10) nor vendor-specific (and thus in the CVE DB). Attacks like DoS/DDoS. Where would these fit in?

I'm looking to find a list of these "other" types of attacks; attacks my software/servers/networks might be vulnerable to but aren't listed by OWASP or CVE. I'm sure there's too many to enumerate, but somewhere, someone has to have them aggregated into a list...thanks in advance.

See the CAPEC-1000, a very large list of attack mechanisms. Click "Expand All" to see them all.

Not all of these mechanisms are specific to the web, but they are applicable nevertheless.


How can hackers do a tv signal intrusion? How can hackers do incidents like the Max Headroom one?

This is related, but it doesn't answer my question.

You can substitute your own TV signal at various levels, which would differ in affected range and would require different hardware.

range: global, broadcaster detection and avoidance: very fast, cost: moderate: impersonate transmission car. You need:

satellite transmission hardware just like the car equipment,
uplink parameters: frequency, modulation, symbol rate and BISS key. They can be sniffed easily from some ongoing transmission.

You can go online during some event, but you'll shortly be put down by "please excuse us, we have some technical problems out there".

range: large, broadcaster detection and avoidance: hours, cost: very large: impersonate signal origin (transmission site). Depending on area you want to cover, you must either put your signal into satellite or fiber feed. In case of fiber you need to know the location, probably at some patchpanel (messing in the ground would alert many people very fast), for sat you'll have to know the transmission scheme and disable the original transmitter. This is mostly movie or war-scenario, I can't imagine performing such attack without using force or very much money - 4 m diameter antenna weights about 250 kg and costs about 10k$, you might need to use 7 m antenna... But using your force you could take over the origin site itself and make them transmit your signal.

2a. the easier to perform might be possible if there is an unprotected feed from the studio to the transmit site. You'll need some insider knowledge, as the link is private by design (no well-known satellites, no easy-spottable huge antennas and transmit towers, no well-known broadcasting stations).
range: regional, broadcaster detection and avoidance: hours-day or two, cost: large: impersonate signal origin at some receiving site. In this scenario you put your signal into some regional redistribution point, like DVB-T transmitter or IP eXchange point. Much cheaper than previous variant, but similar. Receivers have less staff doing maintenance, the receiving party would not block you (previously this was some IXP or sat operator, now this is the redistribution site itself), you just need to climb to their antennas or fiber with your cable, you can gather all the required knowledge from single person working at the site.
range: local, broadcaster detection and avoidance: day or a few, cost: relatively small: put your signal directly into viewers at some area. You can either tap into CATV operator fiber infrastructure:

locate any fiber,
receive and filter-out 1550 nm wave, pass 1310/1490 bands,
demodulate DVB (this would be something between 20 and 40 DVB-C channels), decode MPEG-TS of your choice, change anything you want, modulate again,
transmit your signal into the fiber in 1550 band.

This is very easy for (G)EPON networks, but if the CATV operator uses DOCSIS for n-play, you'll have to deal with providing IP services in order to be not detected soon.

Or provide stronger radio signal than the one in the area and made the receivers tune to yours. In this case you'll need only the DVB-T head-end (about 1k$ per channel), an amplifier and antenna (depending on the area you want to cover).


Smart card + GnuPG: what is stored in my keyring/how to adopt smart card? I recently bought a Yubikey Neo which can act as a OpenPGP smart card. I'd like to use this to store my private GnuPG key. I've gone through the initial setup and I am able to use the smart card to sign and encrypt files. After the setup the smart card's key shows up in gpg --list-secret-keys output.

If I lost the GPG keyring (say if my hard-drive died) or I want to use it on multiple machines, how do I get GPG to use the smart card?

You need to run:

gpg --card-status

and gpg will do it for you:

/tmp$ mkdir gpgtmp
/tmp$ chmod go-rwx gpgtmp

/tmp$ GNUPGHOME=/tmp/gpgtmp gpg --keyserver pgp.mit.edu --recv F8713BDF
gpg: sleutelring ‘/tmp/gpgtmp/secring.gpg’ is aangemaakt
gpg: sleutelring ‘/tmp/gpgtmp/pubring.gpg’ is aangemaakt
gpg: opvragen sleutel F8713BDF van hkp sleutelserver pgp.mit.edu
WARNING: gnome-keyring:: couldn't connect to: /run/user/robin/keyring-55e9Rg/pkcs11: No such file or directory
gpg: /tmp/gpgtmp/trustdb.gpg: trustdb created
gpg: sleutel F8713BDF: publieke sleutel “Robin Sheat <robin@kallisti.net.nz>” geimporteerd
gpg: no ultimately trusted keys found
gpg: Totaal aantal verwerkt: 1
gpg:               Geimporteerd: 1  (RSA: 1)

/tmp$ GNUPGHOME=/tmp/gpgtmp gpg --list-secret
*nothing here*

/tmp$ GNUPGHOME=/tmp/gpgtmp gpg --card-status
*snip boring card info*
General key info..: pub  2048R/F8713BDF 2013-09-24 Robin Sheat <robin@kallisti.net.nz>
sec>  2048R/F8713BDF  aangemaakt: 2013-09-24  vervaldatum: nooit
*etc*

/tmp$ GNUPGHOME=/tmp/gpgtmp gpg --list-secret
/tmp/gpgtmp/secring.gpg
-----------------------
sec>  2048R/F8713BDF 2013-09-24
      Serienummer van de kaart = ....
uid                  Robin Sheat <robin@kallisti.net.nz>
*etc*


Why using oAuth2 refresh token is more secure then regenerate an access_token? I'm implementing an oAuth2 authentification to secure my REST Api.
As I am implementing oAuth2, I need to generate an access_token which will give me a temporary access to my REST datas.
To do it, I simply send an HTTP request with an id and a secret, which returns an access_token and a refresh_token. That is the first time I am implementing an oAuth2, and I did some research about what access_token and refresh_token are.
It looks like everybody says that the refresh_token must be stored securely, because it allows you to regenerate an access_token. From what I understood, refresh tokens are long-lived, while acces token expires fast, and don't need as much as security as refresh token does, because it expires fast. I am able to use that refresh_token to get a new access_token, using the same id and the same secret I use to generate my first access_token.
My questions are :

Why do we use refresh tokens if they need to much security, while we could just regenerate an access each time it expires?
It is really just all about checking faster the identity of the one who is sending the request?

I apologies if I am not asking in the right StackExchange site.

It is for user convenience. Having to enter their login credentials too often is annoying to users. Of course, if that is not a concern, you can just not use refres_token, which would improve security somewhat. However, users generally dislike logging in often and forcing them to may cause them to do something insecure, such as storing password in browser or disabling 2FA, hence the use of refres_token.


Is it possible to create a self signed certificate authority? Would it be possible to create a legitimate certificate with the CA bit set? I dont have a usecase associated with this, I'm merely curious.

To explain my question : Suppose I sign a public key(belongs to "B" whom I trust), would it be possible to let "B" alone sign other public keys(beloning to "C", "D", "E" etc) such that I would be the known trusted root? "C", "D", "E" etc should not be allowed to sign other certificates that have me as the trusted root.

My understanding is that when I sign the public key, the CA bit would have to be set -- however when "B" signs it, the CA bit would be unset.

Is that so?

What you describe is a "Private CA certificate", and they are used everyday. A "self-signed certificate" is any certificate that does not have the digital signature of a higher certificate authority; the certificate basically tells someone who gets it "I am vouching for myself; you can either trust me or not". SSCs can assert that they are CAs, and so if you trust them, you trust the certificates signed with the CA certificate. The self-signed CA certificate in effect becomes a "private trusted root". Because it lacks global trust, this certificate generally isn't good enough for an anonymous client connecting to your web server over the Internet, but within the boundaries of a network of computers that you fully control, you can tell those computers to trust any certificate you like.

Without a central authority, every machine on the network would require the certificate of every other machine on the network, and implicitly trust all of them. This simple flat "web" trust structure is feasible for a small number of machines like 3-5, but in a network with, say, 100 machines, each machine must have the certificate for the other 99, and the next machine to be added to the network must somehow get its certificate implicitly accepted by all 100 existing machines. The CA structure drastically streamlines this process; all machines implicitly trust one and only one certificate - the CA's - and a CA-signed certificate presented by a new machine will tell all the other computers "the CA trusts me; you should too".

Now, this still requires your CA to be trustworthy; just because it's trusted doesn't necessarily mean it should be. The CA certificate's private key has to be protected against attempts by an attacker to steal it, and should an attacker do so, you must have a way to revoke that certificate without losing all trust in the entire network. In a small home network, as AJ's comment states, it's not a huge deal to revoke the one primary CA certificate and regenerate all the certificates on the network, but in larger networks it can bring the whole thing to a screeching halt.

Typically, redundancy and tolerance to compromise is achieved with multiple levels (at least two) of CAs in your trust chain, much like the globally-trusted CA chain works. There would be one "trusted root" certificate, a "golden key", the public version of which is implicitly trusted by the network machines. The private key is stored on an HSM, and when not generating "public-facing" CA certificates it is kept in a secured vault that requires sign-off from multiple executives to access.

Those "public-facing" CA certificates are the ones used by the PKI server(s) to generate the non-CA certificates issued to servers and clients on the network. Should an attacker compromise one of these CA certificates, that certificate can be revoked (telling all computers not to trust it or any certificate signed by it), and any computer that had a certificate signed by that CA can prove its identity in some other way to the PKI system, and get a new certificate from one of the non-compromised CA certs. Meanwhile, the execs sign off, the HSM is retrieved under the watchful eye of a lot of interested people, and a replacement CA certificate is generated to replace the revoked one in the PKI system.


Can my school see what I'm doing on my laptop at home? I'm a bit paranoid, but I want to know if my school can see what I'm browsing while logged into my school account but on my home network with my own laptop.
I have brought my laptop to school previously and have used their Wi-Fi, if that makes a difference.

I log in to my school account on chrome but on guest, so every time I exit it erases my history and logs out of my account.

I'm wondering if they can see what I'm browsing on my home account while still logged onto their account from guest chrome?

I'm not very tech-y so I don't really know how anything works, but any answers would be appreciated!

If you are using the schools WiFi to be online, then yes, everything you do can be monitored. Being a school, monitoring might not be too sophisticated, but potentially, it could.

If you are online via your internet provider at home, when you use your browser to log into a website, that website can monitor everything you do on it, but not more. Not another browser tab, not another browser altogether. Again, more sophisticated attacks exist, but they are certainly not used by your school.

A whole different thing is software installed on your laptop. This could be a VPN, proxy or any kind of monitoring software. Once locally installed, there is virtually nothing it cannot do. But software cannot be installed without you knowledge or consent (again... more sophisticated attacks exist, but are certainly not used to spy on school kids). However, whether you gave consent and installed something or let your laptop be handled by school personal unsupervised so you aren't sure that nothing was installed locally, only you can know.

To summarize:

If you are just using a web interface, like opening their webpage and
interacting with it, you are safe. At least from your school. Real
criminals are a different matter.
If you installed an actual program on your computer, then yes, they
could be spying on you. Technically. Whether they actually do is a
guess at best.


Can a smartphone’s accelerometer data be used for implementing a TRNG? I'm trying to generate a true random number from smartphone's accelerometer, then pass it as a seed to a CSPRNG to generate true random numbers.

I know that a lot of people tried it and the SecureRandom (without custom seed) remains a better choice, but I don't understand why this is not possibile.

I've read about some issues about this approach: the accelerometer can generate low entropy, an attacker could guess patterns of movements...

I've also read the Randomness extractor page on Wikipedia, and 2 methods are proposed:
Von Neumann extractor
Cryptographic hash function

Let's suppose I want to use the Neumann approach, a requirement is that:

  there is no correlation between successive bits

But have the X, Y and Z input values I collect from the accelerometer a correlation between successive bits? Why? A X value at time t1 could be different at time t2, so they are not in correlation... or not?

If the requirement is satisfied let's suppose the algorithm is something like this:

  Get an amount of consecutive X,Y,Z float values from the acceleromenter for, let's say, 10 seconds.
  Convert each value to bits and store them into different arrays => X[] Y[] Z[]
  For each arrays position use the Von Neumann extractor and create an output bit array.(ex. I'll check X[i] with Y[i], and the result with Z[i])
  Now each 3 input bits will produce 1 output bit
  At the end convert the output bit array to value.

Is the output a random value?
Can this be a reliable method?
If not, how can this be improved?

But if I choose the method 2 (the Cryptographic hash function) can I simply hash the input stream obtained from the accelerometer?

The answer depends on several factors...

What is the accuracy, sensitivity, sample rate, and precision of the accelerometer?

How often is the cell phone being moved around? How is it being moved around?

How many "raw" bits are you extracting for every bit in the seed? Only 3?

The root source of entropy
Let's assume that the accelerometer is extremely accurate, is sensitive to very small changes, has a very high sample rate, and has very high precision. Let's also assume that you are moving the device around manually. In this case, the entropy comes from the following sources:

Imprecision and "noise" in the accelerometer. More sensitivity means more noise.

Stochastic processes present in the operation of our neurons and muscle cells.

If the sensor is accurate enough, then microscopic variations in the biological processes that create muscle movements will result in a significant amount of entropy available for harvesting. The time it takes an action potential to propagate down your neurons, the time it takes to finally depolarize a neuron to its firing threshold, the time it takes a muscle cell to respond to neurotransmitters, which motor units are recruited first in a muscle... These all depend on factors that cannot be predicted by an attacker. While we are terrible at consciously producing an unpredictable string of random numbers, we are, much unlike deterministic computer algorithms, excellent at producing randomness through our naturally imprecise muscle movements.
Note, however, that you would be wise to add in the timing of each motion event, not just the value of the changed coordinates. When you operate at nanosecond precision, even a professional drummer who is trying to move with the most rhythmic patterns possible will introduce significant entropy to a system when his movements are precisely timed. This timing, if sufficiently fine-grained, is actually a more valuable source of entropy than the value of a given event itself.
Your proposed algorithm
I would say your algorithm is not safe. Creating 1 output bit for every three input bits assumes that each input has 1/3 of a bit worth of entropy, which is very optimistic, to say the least. The Linux kernel for example is extremely conservative with its entropy estimation. Only a single bit of randomness is assumed to be present after 64 consecutive injections into a 128 bit pool. A superior algorithm would be to input the raw events along with the precise time of the event (in the form of the number of CPU cycles since boot, aka the TSC) into a fast cryptographic hash like SHA-256. Keep this up until you are done collecting entropy, and use the final digest as your random seed. If you are certain that you want to implement your own RNG, this would be the way to do it. There would be no need for explicit debiasing or whitening, or entropy estimation.
If you truly insist on doing this, you should at least take the output seed and mix it with an equivalent amount of randomness from the system CSPRNG. This can be done by using a involutory operation such as XOR or addition/subtraction with overflow. that ensures that the entropy of the output is at least as good as the quality of the most entropic input. In mathematical notation, for two mutually independent entropy sources A and B of identical size, H(A ⊕ B) ≥ max(H(A), H(B)).
The accelerometer as a source of entropy by default
The accelerometer may already be used to generate entropy! While I know little about mobile device architecture, hardware generally alerts the main CPU that an event has been detected by issuing an interrupt. An interrupt is an asynchronous signal that causes the CPU to pause whatever it is doing and execute a particular handler for that interrupt. This handler may, for example, query a keyboard buffer. That way, the system does not have to continuously poll the keyboard and can instead wait for the keyboard to send an interrupt, telling the system that it is time to read from it. This may also happen with a mobile device's accelerometer. Every time a motion is detected, it may send a signal to the CPU telling it that there is data to be read. Every time this happens, the interrupt data and the exact time it occurred are used as a source of entropy. Only after 64 events is a single bit of entropy assumed to be collected. This entropy is mixed with the system pool.


PCI approved device, does it matter if my POS is PCI compliant if it just passes info to the gateway and does not store the encrypted card data? If my Hardware device is on the PCI list from here
https://www.pcisecuritystandards.org/approved_companies_providers/approved_pin_transaction_security.php

Does my POS need to be PCI compliant since the POS cannot unencrypt the data since it is a point to point approved PCI encrypted solution?   The Encrypted Point to Point solution sends the card data to the gateway and the POS receives back just the token information.

On the PCI Security Standards website you referenced you can find this video which summarises Point To Point Encryption (P2PE) for small businesses (assuming you are a small business).

The gist of the video is that because P2PE encrypts the sensitive card data and you as a merchant don't have access to it, your systems are excluded from card data protection requirements during a PCI-DSS audit. Rather, the onus on protecting specifically the card holder data shifts to the P2PE service provider. It is up to the service provider to obtain their own certification of the P2PE solution they provide to you. Ostensibly, this abstracts away the cost and effort of protecting the data if you are a merchant.

It's tempting to think that this absolves you from PCI-DSS compliance but the video does finish with the warning that you as a merchant are still bound by PCI-DSS. This is because PCI-DSS is about more than protecting just the sensitive card data. You also need to protect the environment in which the transaction takes place. For example, you are probably going to fail a PCI-DSS audit if you don't use passwords on your POS systems because then anyone could come along and subvert the P2PE solution. Or open unsecured network connections. Or simply just break the P2PE implementation to deny legitimate transactions (a DoS attack which also contravenes PCI-DSS).

Having a P2PE solution implemented on your POS means you as a merchant are more likely to be certified as PCI-DSS compliant because you are then exempt from protecting card holder data. But PCI-DSS isn't about just protecting the data, it's about protecting the transaction itself and all parties in the transaction.


What tools are available to compare a 'before' and 'after' security baseline of a Windows machine? A vendor deals in software that provides secure-messaging software to medical practices, which integrates with popular clinical systems.  To install it, they're requesting an hour of unattended remote administrative access using 'Team Viewer' to the server which holds the SQL database where all the sensitive patient data is held. As the collector of the data, our practice is legally responsible for its use and disclosure to 3rd parties

Supposing I were to permit this (which is currently not likely), what tools are at my disposal to enumerate how the system state changed after the tech has left the machine, so that I KNOW what the did, and what they didn't do?  (As regards the final state of the machine).

To make things slightly easier, the machine is a Hyper-V VM.

Such tooling would consider changes to at least:

file hashes
file-system permissions
user accounts & permissions
network shares shared
firewall rules
network ports listened on
services
registry keys & permissions

As Serge's answer mentions, you may want to consider some contractual controls for this situation, in addition to your technical approach. I am going to assume for this discussion that this action has already been approved through your company's Compliance Program and complies with your Policies. Don't grant low-level systems access to a third-party like this without first confirming the origin of the request and authorization, etc.

But since you asked for tools... ReverseDSC might be an option. It uses PowerShell capabilities to produce an inventory of the system's current settings. It's not going to catch absolutely everything, but it should give you a decent baseline for comparison.

Check out Nik Charlebois' Blog for an introduction to the tool. Or if you prefer some good audio content, RunAsRadio Episode #566 is an interview with Nik and covers some of the same concepts.

In full disclosure, I don't even work in a Windows environment, so I've never used this. But in theory, it sounds like what you're looking for.


Why not use symmetric encryption? Something very simple: most of us communicate most of the time with people we already know. Alice and Bob probably have physical contact, too. Yes, there are cases when whistle-blowers want to contact journalists for the first time, but that’s not the problem situation for most of us.

Symmetric encryption therefore is appropriate and simpler than asymmetric  – one key instead of four for Alice and Bob. But how do you share the secret key? You tell them in person, read it over the phone, use a One Time Secret or Diffie-Hellman.

Have I missed something? Or is encryption (to protect stuff in transit) just really easy?

If you talk to 1000 persons and use pre-shared symmetric keys, then you have to remember 1000 secret keys. Secret key storage can be hard. With asymmetric encryption you just have to remember only public keys, and that is easy because public keys are public, so they can be "remembered" by being published somewhere, where everybody can see them.

Moreover, you talk to machines more often than you talk to persons. In particular every time you visit an "https://" Web site. How would you, precisely, read a key over the phone with a server ? It is a machine, it has no voice that you would recognize.


Windows Server: Import HSM-backed certificate into second server Scenario:

Using Amazon CloudHSM with CloudHSM Windows Client installed and configured.
Created CSR for a Code Signing certificate with certreq.exe and provider Cavium Key Storage Provider.
Submitted CSR for signing to CA
Accepted signed certificate with certreq.exe

Now I have a certificate on one server that is linked to the private key on our Amazon CloudHSM.

I need this same certificate on another server.  I have installed and configured Windows CloudHSM client on the other server and am able to use the Cavium HSM command line utilities to connect to the HSM and see the keys for the certificate I created earlier from the other server.

I have tried importing the certificate (without private key) into this server's certificate store (success) and then linking the certificate with the private key on the HSM using certutil.exe -repairstore but I am unable to get it to work.

>certutil -csp "Cavium Key Storage Provider" -repairstore my 1
my "Personal"
================ Certificate 1 ================
Serial Number: 82af82b36ca545710000000655668982
Issuer: CN=Entrust Code Signing CA - OVCS1, OU=(c) 2015 Entrust, Inc. - for authorized use only, OU=See http://www.entrust.net/legal-terms, O=Entrust, Inc., C=US
 NotBefore: 2/12/2019 11:12 AM
 NotAfter: 3/3/2020 11:42 AM
Subject: CN=A Company, O=An organization, L=Los Angeles, S=California, C=US
Non-root Certificate
Cert Hash(sha1): f63e9db72dece2e7950c8ac878ae96388b8875c7
        SDK Version: 2.03
No key provider information
Cannot find the certificate and private key for decryption.
CertUtil: -repairstore command FAILED: 0x80092004 (-2146885628 CRYPT_E_NOT_FOUND)
CertUtil: Cannot find object or property.

In the certificate store, there is no key provider information because I just imported the certificate without the private key.

So, how do I import the certificate in a way that it is linked to the Cavium Key Storage Provider or how do I set the certificate's key provider after importing so that I can link it with certutil -repairstore to the private key on the HSM?

And if that's the wrong path, my ultimate question is: How do I install an HSM backed certificate on a second server?

Your guess about certutil is correct and certutil -repairstore should do the trick. The only requirement is that HSM middleware must be installed on a target machine and target machine can access keys on HSM.

Alternatively, you may try to use CertSetCertificateContextProperty CryptoAPI function and set CERT_KEY_PROV_INFO_PROP_ID property that will include provider name and key container name within provider. This information can be retrieved from machine where private key is recognized.


How to find who granted local admin privileges to a user? A friend of mine works in an organisation and one fine day realised that he has local admin access on his machine. He swear to me that he didn't have the privilege initially and needed to raise requests for installing any software. I verified that their written policy also says so.

Assuming that some privileged domain user added him to local admin group by mistake, how can we find the user who did that?

It would be helpful if I get specific answers on how to check the audit log and identify the user who granted local admin privilege to my friend.

You can use Powershell to filter the right events:

Get-EventLog Security -InstanceId 4732

Heres a powershell command to get all the eventlog entries for which an user was added to local administrators:

Get-EventLog Security -InstanceId 4732 | `
Where-Object {$_.Message -like "*Administrators*"}`
| Select-Object *

Sadly I couldn't test the command because I'm at home and don't have access to AD. But you should get an Output like that:

EventID            : 4732
MachineName        : localhost
Data               : {}
Index              : 165325
Category           : (13826)
CategoryNumber     : 13826
EntryType          : SuccessAudit
Message            : A member was added to a security-enabled local group.

                     Subject:
                        Security ID:            SID of the user that added the user to the group.
                        Account Name:           bob
                        Account Domain:         contoso.com
                        Logon ID:               0x59461

                     Member:
                        Security ID:            SID of your friends user account
                        Account Name:           -

                     Group:
                        Security ID:            S-1-5-32-544
                        Group Name:             Administrators
                        Group Domain:           Builtin

                     Additional Information:
                        Privileges:             -
                        Expiration time:                %11
Source             : Microsoft-Windows-Security-Auditing
ReplacementStrings : {-, some sid, Users, Builtin...}
InstanceId         : 4732
TimeGenerated      : 26.01.2017 21:08:49
TimeWritten        : 26.01.2017 21:08:49
UserName           :
Site               :
Container          :

Maybe you need to change some stuff in my script, but you should have all the information, to find the admin.

Edit: Changed my powershell command. It still needs a filter to search for the individual user.


How to secure a MongoDB instance? Does anybody have experience with securing/hardening MongoDB server? Check lists or guides would be welcome.

NoSQL databases are relatively new (although arguably an old concept), I haven't seen any specific MongoDB hardening guides and the usual places I look (CISSecurity, vendor publications, Sans etc all come up short). Suggests it would be a good project for an organisation, uni student, infosec community to write one and maintain it.

There is some basic information in Mongodb.org. All the steps in here should be followed including enabling security. The site itself states MongoDB only has a very basic level of security.
http://www.mongodb.org/display/DOCS/Security+and+Authentication

MongoDB and other NoSQL databases also have a lot less (especially security) features than mature SQL databases, so you are unlikely to find fine-grained permissions or data encryption, it uses MD5 for password hashing with the username as the seed. There are also limitations such as authentication not being available with sharding before version 1.9.1 so as always performing a risk assessment and building a threat model to work out your security needs and threats faced is good idea. Based on this output MongoDB or NoSQL databases in general may not be suitable for your needs, or you may need to use it in a different way that maximizes its advantages and minimizes its weaknesses (e.g. for extracts of data rather than your most sensitive information, or on behind a number of layers of network controls rather than directly connected to your web application).

That said, I firmly believe security principles are technology agnostic. If you analyse even the latest attacks, and a good list on datalossdb.org it is amazing how many are still related to default passwords and missing patches. With defense in depth if you follow the following practices should have sufficient security to protect most assets (e.g. individual, commercial) maybe probably not military.

Database hardening principles:

Authentication - require authentication, for admin or privileged users have two factor if possible (do this at the platform level or via a network device as the database itself doesn't support it). Use key based authentication to avoid passwords if possible.
Authorization - minimal number of required accounts with minimal required permissions, read only accounts are supported so use them. As granular access control does not exist use alternate means e.g a  web service in front of the database which contains business logic including access control rules or within the application. Minimize the permissions that Mongodb runs as on the platform e.g. should not run as root.
Default and system accounts - change the passwords of all default accounts, remove/lock/disable what you can, disable login where you can.
Logging and monitoring - enable logging and export these to a central monitoring system. Define specific alerts and investigation procedures for your monitoring staff
Input validation - NoSQL databases are still vulnerable to injection attacks so only passing it validated known good input, use of paramaterisation in your application frameworks, all the good practices for passing un-trusted input to a database is required
Encryption - depending on the sensitivity of the data, as you cannot encrypt at the database level, encrypting or hashing any sensitive data at the application layer is required. Transport encryption also via the network layer (e.g. VPN).
Minimize services and change the default listening port
Remove any sample or test databases
Have a patch  management process in place to identify, evaluate and install all relevant security patches in a timely manner
Harden the platform and virtualization platform if used
Configure appropriate network controls e.g. firewalls, VLAN's to minimize access to the database, upstream denial of service filtering service, fully qualified DNS, seperate production and non production databases
Physically secure environment
Have a change management process


What are the risks of having your data targeted precisely because you try to hide it? I'm trying to be more careful about my personal data, that I plan to back up using some secure online storage service.
I'm looking at several encrypted services that are a much better alternative than Google Drive.

However, I have the feeling that if I take this route, I could be sharing storage service with some "bad guys", and maybe this attracts unwanted attention from Governments to my very normal but private content (ie. "Umh, let's hack this service and get all the data out of it, we will filter the bad guys later").

Do you think it's plausible to be wrongly targeted precisely because you follow some steps to harden your data? Is it risky to be a server neighbour of the mafias of the world?

Can you get in trouble precisely because you try to be more opaque to the Google and Governments of the world?

There is indeed evidence that suggests that users of strong cryptography (and of services that use strong cryptography) get selected e.g. by the NSA.

I would still recommend encryption and encrypted services:

The NSA will put you in the “crypto users” selector, so what? Most likely this will be it. If you actually intersect with another group, say “left wing activist” or “young man recently converted to islam” some analyst may actually have your name on screen before scrolling on.
If they actually hack your backup provider, break the crypto and get your actual data, see previous point.
I don’t know about you, but the NSA is very low on my of list of threats. If they are really bored they can write an internal memo about me. Drone strikes to my country are unlikely... But crypto and related products may actually save me from real threats - random internet criminals, hotel wifi "hackers", private detectives hired by my company’s competitors, nosey short-term boyfriends, the person who “finds” my laptop, etc.
If the NSA has hacked protonmail or backdoored tails, they will think twice about giving out this information willy-nilly to law enforcement so they can persecute you for using a 30-day-trial on day 31 (yes, do google "parallel construction", but don't be too paranoid).


How to display HTTPS contents [Using Proxy] I'm a beginner at proxy traffic stuff and I'm struggling here with Charles Proxy

I'm trying to 'intercept traffic'. I have an HTTPS page and I want to display the data from the content (inside Charles proxy).

ALL my https are returning <unknown>

I'm currently using Firefox. I'm not manually setting the proxy configs.
I know it may seem like a dumb question but I could not figure out how to solve this.

...I know it has to do with SSL but can't resolve that problem by myself

As pointed out by Fabian and Schroeder, one has to install/trust the SSL certificate from the proxy itself (for example here is how it's done with Burp, a local proxy like Charles).

As per documentation, install the Charles certificate:

  Visit https://chls.pro/ssl in Firefox. You will be presented with a certificate import dialog. Tick the option "Trust this CA to identify websites" and complete the import.

In Firefox you can either accept a prompted certificate when visiting an untrusted website (like your local proxy https://chls.pro/ssl) or import it manually via a (.PEM) file, like here:

  In Charles go to the Help menu and choose "SSL Proxying > Install Charles Root Certificate".

In Firefox you can go to Preferences menu, then type certificate in the search box, click View certificate... then Your Certificates, then Import...

It can depend on your platform how you import certificates (e.g. Windows "installs" them).

To isolate the issue, are you able to first intercept HTTP traffic?


Where to find a fake hierarchy for a honeypot for double-dot/path traversal attacks? I would like to provide content when a hacker tries something like GET /../../../etc/passwd, but they may choose something else, other than passwd. I will install notification of when somebody does this, but in order to keep the hacker's attention in a fixed point for some time, I would like to have some fake data.

Does anyone have a suggestion on a starting point? All the data would be statically served, I was thinking maybe some linux directory structure, but preferably something more light weight. If there is something like this you are aware of, I would be interested. It does not need to be complete, just contain a bunch of files that would typically be found on a (web)server.

You could create a url rewrite rule mapping urls matching ../etc/* (or some other expression) to somevirtualdirectory/* and place whatever you like in somevirtualdirectory to be served.

Damn Small Linux would have your basic minimal *nix folder hierarchy on live CD that you could copy over and lock down (remove execute permissions and such).


Can a simple comment on WordPress harm my system (CVE-2016-4567)? What risks are associated with the WordPress vulnerability CVE-2016-4567?

  Cross-site scripting (XSS) vulnerability in flash/FlashMediaElement.as in MediaElement.js before 2.21.0, as used in WordPress before 4.5.2, allows remote attackers to inject arbitrary web script or HTML via the query string.

Can a simple comment on WordPress harm my system?

It can, but not directly. This vulnerability does not inject code on your webserver, rather it injects JavaScript that, when you visit the page, will be executed in your browser. What can happen then is that an attacker steals your session cookies and logs onto your wordpress website or redirects you to a malicious page with malware or a phishing website to lure you into disclosing credentials.


How can this xss challenge be solved? I found this :
http://research.insecurelabs.org/xssmas/

And so far my solutions were:

1.http://research.insecurelabs.org/xssmas/search.php?query=<script>alert(0)</script>
2. http://research.insecurelabs.org/xssmas/xssmas.swf?clickTAG=data:text/html,<script>alert(0)</script>

but there seem to be five solutions.Can anyone help me I'm trying to learn more about XSS.
thanks

UPDATED:

I know that two other solutions are related to this:
1.
<script>
var n = '';
if (n != '') {
    $(function() {
        $("h1").html("Merry XSSmas, " + unescape(n) + "!");
    });
}
</script>

2.

<script>
<!-- Analytics: no change below this line -->
document.write('<img src="analytics?url=">');
</script>

Update solved no2:

http://research.insecurelabs.org/xssmas/?url=maxa"><fake></script><script>alert(0)</script>

If you are trying to learn, then asking for others to answer the question for you seems counter-productive.

Check out cheatsheets and other material to work through it all.


How to hide information on a website from search engines? I have a website with many pages.
There are few lines of text on one of these pages which should NOT be visible to search engines - it means no one should be able to find my website after searching for the information provided in these few lines.
How can I achieve that?

I was thinking to exclude this particular page using robots.txt but in this case, I'm telling everyone that this page is interesting. Also, I was thinking to paste this text as an image but then it may look strange on mobile.

Is there a solution for what I want to achieve?

If you want arbitrary people, who you cannot predict or define ahead of time, to access the page, then it needs to be unrestricted. If you don't want search engines from indexing the data, then you need to block automated processes from accessing it. CAPTCHA is a standard method for doing that.

But that still means that any human visitor to your site could find the information, and you appear to not want that either.

So, you need something that blocks automated processes, and is not easily discovered by human visitors, either. A random URL can work for this, and when you need to expose the information, you provide a link to the random URL. Change the URL periodically.


Script injection on all browsers I have something injecting a script into all web browsers that I have tried - Firefox, IE, Edge, Chrome - and it doesn't look like an extension (since it is doing so in different web browsers). I suspect it's either a process injection or some silent process doing the work, but cannot pinpoint it. Can anyone advise what I should look for?

It appears it does an injection into newtab-serviceworker.js as well, changing its search form to its own. Bugga!
This is the code from that file:

var EXTRA_FILES = [
  "/xjs/_/js/k=xjs.ntp.en_US.iCI9PQB5wew.O/m=jsa,ntp,d,csi/am=BA/rt=j/d=1/t=zcms/rs=ACT90oFcUbquz13KP289MZy7OI9wPcMXiA",
];
var CHECKSUM = "r4v3sd";

var BLACKLIST = [
  '/gen_204\?',
  '/async/',
];

var FILES = [
  '/images/srpr/logo11w.png',
  '/images/srpr/chrome_ntp_white_logo2.png',
      '/' + '/ssl.gstatic.com/chrome/components/doodle-notifier-01.html'
].concat(EXTRA_FILES || []);

var CACHENAME = 'newtab-static-' + CHECKSUM;

self.addEventListener('install', function(event) {
  event.waitUntil(caches.open(CACHENAME).then(function(cache) {
    return cache.addAll(FILES);
  }));
});

I've figured out that it was an in-built Chrome search toolbar that was enabled, that I have mistakenly taken for a virus/malware. Thanks out to those who deserve it.


How should I respond to an unrecognized client in my DHCP logs? I've found a strange hostname in my dhcpd.leases file and I'm wondering what steps I should take in response.

I have a simple home network: my modem is plugged into a router running OpenBSD 6.0, and a laptop and an old Netgear router in WAP mode are connected to the router. (The router also has a wireless networking card that's been in host mode with a WPA key set and no physical antennas attached, so it should have been both secure and effectively invisible.)

Within the last 24 hours, I noticed my WAP behaving strangely. It's broadcasting on the 2.4 GHz and 5 GHz bands (both password protected), and while I could log in as usual using the 2.4 GHz SSID, the 5 GHz SSID was consistently rejecting my correctly entered password. I physically powered off my WAP and turned it back on, and everything started working normally again. I started poking around my router, though, and discovered something odd in /var/db/dhcpd.leases. There was a lease listed for an unfamiliar hostname, granted a couple of days ago. The hostname was human-readable and non-googleable -- something like "DESKTOP-F00BAR." The MAC address indicates that it's an Asus machine, and I don't have any Asus devices running in my home.

To my naive eyes, it looks like I've suffered a wireless network intrusion, albeit a benign-seeming one, but I have no idea how it could have happened or what to do next. I've searched my logs but haven't found anything relevant. What's the proper course of action in this situation? Is it possible that my Netgear device is on the fritz and somehow left the network open for some period of time? Is there some other obvious potential vulnerability that I'm overlooking? I apologize for the vagueness of this question, but it seems like I should do something, but I really don't know how to proceed.

You can leverage arpwatch to notify you the second it broadcasts on your network again and also use a tool like Wireshark to capture traffic and see what the device is communicating to (logging DNS queries sometimes works too). Sometimes IoT devices like thermostats, toys, equipment or even certain operating systems will call home on a regular basis looking for updates. This may help you figure out what type of device this is and make it easier to find.

Alternatively, you could get a directional antenna and a tool like Kismet next time the device is on-line and try to locate it via signal strength.


Can masked passwords on iOS UIs be read? If someone had physical access to my iPhone, could they see the stored passwords for my WiFi or email that are represented as black circles and not actually the password itself, e.g. under my mail settings in the password field it shows ●●●●●.

No one has had access to my phone but I just wondered. Similarly, if an iPhone was hacked during a phone call (which I have been assured elsewhere it cannot be but let's assume it could be) could the hacker remotely see these passwords, although I guess the answer will be the same to both.

The phone should know these passwords if it wants to use it, so it obviously keeps them somewhere in a readable format. If the phone is compromised the attacker would be able to read them. That's actually why some mail providers (GMail, etc) are moving to oAuth so that the phone stores a revokable token instead of the actual password.

While that is possible, I don't think anyone is going to bother modifying the UI code to get what is hidden under the *** characters, rather they would directly get the value from where it is stored even before the UI is involved.


Identifying a script used for vulnerability scan The logs of a server are showing a great number of 404 responses in a short time. Apparently somebody used a tool/script to look for known vulnerabilities by combining the server and part of the path with elements like /login or /admin.php.

Is there a way to identify the script that was used without getting and analyzing various hacking/pentest tools?

Is there a way to identify the script that was used ...

Technically, the answer is "yes". You need to look for the specific signature of the methods used and look those up. There is not much more to say about that without any more details about the attack.

Unfortunately, the likelihood of identifying the type of attack from just your web server error logs is very, very low. There is likely not enough to build a signature from and you will not be able to distinguish a custom script from well-known tools at default settings.

Years ago, I did a forensic analysis on a massive dump of packet captures and was able to determine, from the network packet details, the exact tools used, even down to the version ranges they were likely to be. While fascinating and a cool rabbit hole to fall down, the exercise was ultimately not a good use of my time.

  ... knowing that it was a common kit/dictionary with the default settings
  would be reassuring; knowing that it was custom would be alarming.

I hear this a lot from people, and while wanting to quantify your threats is often a good thing, there is not a lot of value in this particular threat analysis.

If someone is holding a gun to your head, does it matter if the attacker made the gun or bought it off the shelf? Are you aware that even the most elite hackers will use off-the-shelf tools at default settings because there is often no need to "get clever" because the basic tools work, especially at the initial stages of an attack?

How would your response be any different as a web admin if the attack came from a default kit or from a targetted attacker? You are being targetted by both types of attackers every second of every day, whether your logs show it or not. Your response to these threats is not to assume all attacks are elite hackers and then freak out, but rather to acknowledge that the Internet is an inherently hostile environment and to make sure you are running a tight ship and resilient processes, because any weakness will be discovered and exploited by someone, expert or noob.


How do you build a secure web application that is also COPPA compliant? If you are building a web application to be used by US schools,  you will probably have to worry about COPPA compliance.

Children's Online Privacy Protection or COPPA is new to me,  probably because it was passed in 1998 and then quickly forgotten.   However,  it has a number of very strict rules about storing identifying information of children under the age of 13 and the penalty is $11,000 per violation,  so this is not something to ignore.

Here is quick summary of requirements:

Post a clear and comprehensive privacy policy on their website
describing their information practices for children’s personal
information;
Provide direct notice to parents and obtain verifiable parental
consent, with limited exceptions, before collecting personal
information from children;
Give parents the choice of consenting to the operator’s collection
and internal use of a child’s information, but prohibiting the
operator from disclosing that information to third parties;
Provide parents access to their child’s personal information to
review and/or have the information deleted;
Give parents the opportunity to prevent further use or online
collection of a child’s personal information;
Maintain the confidentiality, security, and integrity of information
they collect from children.

Some of these are easy to satisfy.   Add a note in your privacy policy,  make sure you store the information securely.   But #4 makes me the most worried.  Are they expecting a backdoor such that a parent will be able to access this information?  How do you obtain verifiable parental consent?  Is any of this really possible in the context of a web application?

I've seen a similar example implemented in a site with online coursed for students.

The parent would create a "parent account", pay for the course and then be able to create a "student account" for their kid. The kid would now have access to the courses for a certain period of time and the parent would be able to track his progress, see what videos he has been watching etc.

So I don't think you have to create a backdoor, just a new type of accounts, let's call it supervisor. If a child wants to register your site, his account should be created by the supervisor.

One way of obtaining parental consent is by using credit card information and maybe a small one time transaction(1$), just to check that the data is valid.


How to uniquely identify users with the same external IP address? I have created a login module on my website. I was able to deal with simple brute force attacks since I can identify the user based on username/email and throttle their login based on failed login attempts per user account.

But when it comes to user-enumerated brute-force attacks (a.k.a. Reverse brute force attacks), identifying the user becomes pretty hard. Throttling the login based on failed attempts per IP address might not work well and annoy the users connected to the Internet through a local network since they'll have same external IP address, as they might face throttle due to failed attempts made by someone else on the network.

Is there a way to uniquely identify such users?

How to uniquely identify users with the same external IP address?
  Is there any way to uniquely identify such users?

Yes, there are lots of ways:

Cookies
Evercookies (JavaScript code that uses lots of different techniques to store identifying information, among them flash cookies, the various HTML5 storage options, the browsers visited links history, etc)
Device fingerprinting: use the HTTP header (mainly User Agent, but the other headers and their order can help as well)
Device fingerprinting with JavaScript: with JavaScript, you can get a lot of information, such as screen resolution, timezone, plugins, system fonts, etc.
Behavior: how fast do the users fill in forms, where on a button do they click, etc.

But most of these are not useful in defending against brute-force attacks, since the program doing them will probably not accept cookies or run JavaScript.

In your case, you might try:

HTTP header: these might actually already be enough to differentiate between users using the same IP address (of course, an attacker can just randomly switch them, but I would assume most currently don't).
Light throttling: you don't have to block IP addresses, you could just slow down the login process for them. That way, brute forcing becomes a lot less feasible, but real users using the same IP address can still login.
CAPTCHAs: these will annoy legitimate users, but hopefully not too many users actually use an IP address from which brute-force attacks originate (of course, there are tools to automatically solve CAPTCHAs, but it's still harder than no CAPTCHA).
You could require a user to accept cookies, and to send various identifying information before being allowed to login (such as the screen resolution, timezone, etc.). Of course, an attacker can do this as well, but I don't think any currently existing bruteforce tools can do this, so they would have to write a custom script. But this might also annoy legitimate users.


This is because what you're trying to decode is an x86 machine code.

Here is what it looks like when disassembled: https://www.onlinedisassembler.com/odaweb/d16i42cD/0


over 100 scanner requests 5 min after domain registration First off, I am no security expert!

Yesterday I registered a .cf domain, I needed it for about 10 minutes. About 5 minutes after domain registration I got over 100 scanner requests (I checked all requests, all are automated scanner requests like ZmEu etc.) in under 10 seconds.

Considering the amount in such a short period and so soon after registration, am I being targeted or is this kinda everyday business for a .cf domain?
All requests are exclusively over port 80. I had a few more ports (443,...) open. I am not sure how to interpret this?!
All my things are written in c/c++ (sockets, openssl,...), is there a up to date list or something about common attacks targeting specifically c/c++ servers and how to prevent them?

--------------EDIT

I host the things on my own, on a few server. Further the services are always the same (same ports), same static ip, but only for a short period always linked to a different domain. And it was the first time I used a .cf domain. Now I am simply a bit afraid to repeat the process, because yeah if I am really beeing targeted I should check everything twice first.

A few things, those scans might either be from your hosting company or third parties (e.g hackers). You might getter closer to the answer by clarifying if your hosting company offers some kind of automated security assessment. You probably agreed to such a service. Otherwise, your site is being probed for exploitable weaknesses by some hackers.


Making a Windows cert say it's purpose is "Ensures the identity of a remote computer" I want my cert to show up like this when I double click on it in Windows:

(source: devcentral.f5.com)

If I just double click on a random cert I get this:

The cert that corresponds to that is this:

-----BEGIN CERTIFICATE-----
MIICCzCCAXagAwIBAgIDMTI1MAsGCSqGSIb3DQEBBTBoMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxQNTW91bnRhaW4gVmlldzETMBEG
A1UEChQKR29vZ2xlIEluYzEXMBUGA1UEAxQOd3d3Lmdvb2dsZS5jb20wIhgPMjAx
MjExMjUwNzE0MTJaGA8yMDEzMTIyNTA3MTQxMlowHjEcMBoGA1UECgwTcGhwc2Vj
bGliIGRlbW8gY2VydDCBnTALBgkqhkiG9w0BAQEDgY0AMIGJAoGBAMX7X83YPC92
SGgewurwucf30AQZU4amihKls8J7Bu5l6qv8ONv3JI9qvY8vJKhj6QHZABvFSCk7
/nsilYhptD2MMUjOeosJwvNcqIo5acy/gox/nnInqnCWqhNtQ+DJDrsJEB+NxoNb
1VD9PN0pqF3EsU8EAQgSkRfbdikuFMs1AgMBAAGjDzANMAsGA1UdDwQEAwIHgDAL
BgkqhkiG9w0BAQUDgYEAMtVKyBpbvD2txhlRtA3VHoL1Zp9E7CN/EqFxpAG7bwZT
8D1gifeff4tGH0zkbGvv+5kb5exBZ+PhGsaaHVZoBQVO33Rkr32rfMeMa7PYb76L
i+f0mOp1QfPbrQuvT/uJx8AUv/Owsk5zLyE7JznsvYQ7VeGARRAike2ThHGcZQ8=
-----END CERTIFICATE-----

If I import the signing cert it'll show up like this:

That's fascinating and all but it doesn't tell me how to make a cert say "Ensure the identity of a remote computer". Any ideas?

If I could use OpenSSL I'd just add following lines to openssl.conf:

keyUsage = digitalSignature
extendedKeyUsage=serverAuth

but don't know how add extendedKeyUsage in PHPSecLib


Find out who sent email with my IP? Recently my contact list was shared through some emails recently sent from my account. I would like to find out who did this as it has caused me some financial loss.

When I look at the email header, it looks exactly like my IP address but I know I didn’t send it. How can I identify that it wasn’t me and find out who did it?

How can I prove that the IP address was spoofed/faked? What can I try doing on my own before contacting a professional?

I’m using a Hotmail account.

You either had

a guessable password
a password found in a previous data breach
you fell for a phishing attack

The attacker likely didn't spoof anything ... they probably control your Hotmail account. If Hotmail has a screen that shows you recent logins you may be able to see where the attacker is logging in from but that won't help much.

Instead you need to

change your password
change your backup / secondary email address
enable 2FA/MFA to prevent this from happening again


Is there anything standing in the way of email encryption going mainstream? PGP has been around for almost 20 years, but email encryption is not used by most 'regular people'. At the moment, with Snowden's NSA revelations (which should not be a huge surprise to anyone), the Heartbleed bug, etc. many people are becoming more interested in encryption and privacy, but email remains one of the ways in which people send confidential information, constantly, with very minimal security. Does the current state of the art (from both a technical and social level), allow it to go mainstream?

Software companies and email providers

Default support for PGP from Microsoft (Outlook.com and the Outlook mail client), Apple (default support in iOS and OSX), Yahoo and Gmail. They should make people aware, and create pgp-wizards to set it up with a few steps.

Google can make this happen, but they have a conflict of interest, bigger than Apple or MS. Maybe they can come up with a solution that keeps their business going and our mail safe.

A possible problem: the war on terror and those "thug states". Companies from the US are not allowed to export certain technologies to those countries. But I don't think this is the real problem, as these technologies are freely available worldwide.

Facebook and Twitter are not big parties in this, but they could start awareness campaigns, as privacy is something they like to promote.

Countries

I think it should be promoted by countries. The only big enough "country" that I can see this doing in the near future is the EU, although Germany could be a good start. But that will take more time.

What we can do

Install PGP ourselves and start to use it. I use it sometimes to mail stuff to myself from or to work, if only to get used to it.

Create manuals and installation methods and show how it can be used to work without hassle. So for mom and dad it should work by default when they send an email those people that use it (which probably means those addresses should be marked as having PGP), like you and me. It should even work for them without having to enter a password. That would mean the mail can be opened by anyone on that computer. On OSX you need to login to unlock the key, and I don't know how this works on Windows, but I hope it's similar.


Impersonating a computer in a Windows domain I've been trying to wrap my head around how computers are identified and granted access to a Windows domain. More specifically, I've been asking myself if whatever mechanism is involved really prevents faking the identity of a computer or not, and if so, then how?

Assuming one has full access to a computer that is already on the domain, I'm thinking that whatever information the domain controller relies on for identification could be replicated on another computer.

(As I understand it, what identifies a computer in a domain is one LSA shared secret. According to this Technet blog, LSA shared secrets can be decrypted and extracted.)

According to this answer to a question on Server Fault about re-joining a wiped computer to a domain it used to be on, and here on Information Security, this one about similar topics, it's not possible to have a computer assume even an existing identity in a windows domain.

If this is true, I would like to know the principle of behind this prevention mechanism. The answers given in the above links to me do not contain enough insight.

If the above claims are false, and it is in fact possible to fake the identity of a computer on the domain given the right circumstances, I would like in summary to know what steps would be involved.

Thank you beforehand for any effort to help me out.

When workstation joins domain, following happens:

Workstation creates some random password, asks Domain Controller to create machine account and associate it with this password. User account must have "Add machine to domain" permission, domain admins do have this permission.
Since Windows does not use names internally, but use SIDs for any account, workstation sid (may be checked with psgetsid) is stored in domain with associated password (password is stored in unicodepwd as any user password, see https://technet.microsoft.com/en-us/magazine/ff848710.aspx)
Machine stores password in HKEY_LOCAL_MACHINE\SECURITY\Policy\Secrets\$MACHINE.ACC. Only NT AUTHORITY\SYSTEM has access to this hive. Even local admin does not have (it is not registry permission, it is something hardcoded in Windows, I am sure).
DC and workstation change password periodically. Funny, but old password stored there too (oldVal subkey). Pass may be reset manually: https://support.microsoft.com/en-us/kb/260575

This process is described here:
 https://blogs.technet.microsoft.com/askds/2009/02/15/machine-account-password-process-2/

Since all passwords for accounts are stored in HKEY_LOCAL_MACHINE\SECURITY\Policy\Secrets and only NT AUTHORITY\SYSTEM has access to this hive, person from article used powershell to impersonate its process to this account. You can do the same with psexec -i -s cmd.exe, and them launch regedit from there. Open $MACHINE.ACC and check it for CurrVal.

This hive also stores information about security permissions each account have, and all this is part of Local Security Policy (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms721785(v=vs.85).aspx) managed by lsass.exe.

So, to fake PC you should at least be able to:

Log into it
Be able to run code as NT AUTHORITY\SYSTEM (be local admin and use tool like psexec)
Read its password from $MACHINE.ACC
Read its sid (with psgetsid)

And on another machine

Change its name and SID (sysprep may be used, but I am not sure if you can set sid or it is chosen randomly, see https://blogs.technet.microsoft.com/markrussinovich/2009/11/03/the-machine-sid-duplication-myth-and-why-sysprep-matters/)
Set its password for $MACHINE.ACC

I am not sure if it is enough to fake PC or not, but even this thing is does not look very easy: at least you need local admin permissions on another PC to impersonate System, and good IT whould never give you this access.


Using linux to combat windows flash drive malware? I just put an old flash drive which i used with a windows machine into my linux. I noticed many files, mostly exes which were never visible in windows (my windows does not hide hidden files and extensions). Most of those strange files had malware like names. I changed the properties of these files so that linux would allow me to delete them. It worked and now the drive seems to be fully clean.

If a windows malware in a flash drive can hide itself from windows, can it also hide itself from linux ? If not, then cleaning windows malware on a flash drive becomes easy.

Yes there's a way to hide the a file from Windows' and Linux's file explorers, which is to start the file name with a dot . and set the h and s flags. In Windows that can be done by using the command line

ren file .file
attrib +h +s .file

Now the file cannot be seen by File Explorer, Nautilus, or Konqueror in their default settings on clean machines.

When you plug your flash disk in a Linux machine and open it using Nautilus, you may press Ctrl+H to show all hidden files. A better solution is to use your favorite shell to run this command in the flash disk's mounted directory.

ls -a

Note: If you "clean" the flash drive using Linux and then plug it back in the suspicious Windows machine, you can assume that it's infected again.

Update: I'll try to address your newly expressed concerns from a real-world and practical point of view.

First, in theory. There is a chance that the Linux machine is infected with malware that forces it to hide certain files (namely other malware files). But in reality, the chances are very slim. But like anything in security, you can never be sure.

Practically speaking, plugging your infected flash disk in a Linux machine and removing all the bad files (assuming you do know what all the bad files are) guarantees with a high probability that your flash disk is now clean. As long as you don't plug it back in the infected Windows machine, it's safe to use amongst other clean Windows machines (assuming you are sure about which machines are clean).


Bots are using my own static IP to brute force DNS/Email server My email server has been under constant brute force attack for a while now, without success.
Recently, however, these bots or automated scripts have found a way to "use my own static IP" in an attempt to break into the email server.
I am running fail2ban which is now "banning my own static IP". My server is running Debian 10 with Postfix, Dovecot, MySql etc.
I see the attempts being made but I am not sure how to fight back.
Can you suggest some steps that I might take?
Here is a sample of the hundreds of attempts made daily:
3   git.example.com[192.0.2.7]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
3   git.example.com[192.0.2.7]: SASL PLAIN authentication failed:
3   cloud.example.com[192.0.2.7]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
3   cloud.example.com[192.0.2.7]: SASL PLAIN authentication failed:
2   ltf.example.com[192.0.2.7]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
2   ltf.example.com[192.0.2.7]: SASL PLAIN authentication failed:
2   unknown[192.0.2.7]: SASL PLAIN authentication failed:
2   unknown[192.0.2.7]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
2   hostname www.example.com does not resolve to address 192.0.2.7: Name or service not known
6   mail.example.com[192.0.2.7]: SASL LOGIN authentication failed: UGFzc3dvcmQ6

Simplest solution for blocking spoofed IP addresses in this situation is to get your ISP to drop packets to your IP address which purport to be from your IP address.
If they won't/can't, you can buy DDoS mitigation services from various providers.
Failing that, why don't you drop anything at the interface on your server that has a spoofed address.


Data retrieved from DNSDB I queried amazon.com using lookup API from DNSDB "https://api.dnsdb.info/lookup/rdata/name/amazon.com" and i got following response.

qlightingcontrol.in. IN NS amazon.com.

qlightingcontrol.com.tw. IN NS amazon.com.

rustaxi-cyprus.com. IN SOA amazon.com. root.example.com. 2017122837 3600 3600 604800 86400

transfer-cyprus.ru. IN SOA amazon.com. root.transfer-cyprus.ru. 2018022807 3600 3600 604800 86400

silver.buymyunicorns.com. IN CNAME amazon.com.

violet.buymyunicorns.com. IN CNAME amazon.com.

159.15.154.185.in-addr.arpa. IN PTR amazon.com.

116.213.123.195.in-addr.arpa. IN PTR amazon.com.

What does the above response indicate and what value can i get keeping in mind cyber security perspective?

P.S: Above response is truncated for illustration purposes.

Your search appears to have returned a number of records referencing amazon.com.  Of the records returned, most of them appear to be domains which aren't Amazon claiming to be resolved authoritatively by Amazon.  (Put differently, Amazon had nothing to do with most of this).

qlightingcontrol.in. IN NS amazon.com.
qlightingcontrol.com.tw. IN NS amazon.com.

"Amazon.com is the name server for qlightningcontrol.(*)" - I don't see that those domains actually exist, and it's unlikely amazon.com would be their NS if they did.

rustaxi-cyprus.com. IN SOA amazon.com. root.example.com. 2017122837 3600 3600 604800 86400
transfer-cyprus.ru. IN SOA amazon.com. root.transfer-cyprus.ru. 2018022807 3600 3600 604800 86400

Start Of Authority records, again, claiming amazon.com is the NS.  Unlikely, especially given the domain names involved, and the indication that "root@example.com" is the contact for one of them.

silver.buymyunicorns.com. IN CNAME amazon.com.
violet.buymyunicorns.com. IN CNAME amazon.com.

Two CNAME, or Alias, records, meaning "If you want to go to (*).buymyunicorns.com, look up amazon.com and go to their IP address."  These do, in fact, look real, albeit pointing off to Amazon AWS and not amazon.com:

$ host silver.buymyunicorns.com
silver.buymyunicorns.com is an alias for ec2-54-160-8-108.compute-1.amazonaws.com.
ec2-54-160-8-108.compute-1.amazonaws.com has address 54.160.8.108
$ host violet.buymyunicorns.com
violet.buymyunicorns.com is an alias for ec2-100-26-47-25.compute-1.amazonaws.com.
ec2-100-26-47-25.compute-1.amazonaws.com has address 100.26.47.25

Finally:

159.15.154.185.in-addr.arpa. IN PTR amazon.com.
116.213.123.195.in-addr.arpa. IN PTR amazon.com.

These PTR (or "Reverse DNS") records say "The name associated with 185.154.15.159 is amazon.com".  Anybody can associate any name with their IP address, as long as they are allowed to update PTR records for that IP address.  Looking at the rwhois data, though, I don't think that IP address is actually owned by Amazon.com:

inetnum:        185.154.15.128 - 185.154.15.255
netname:        NET-10-2
org:            ORG-ODL5-RIPE
country:        NL
remarks:        Server location - Netherlands, Dronten
source:         RIPE
...
organisation:   ORG-ODL5-RIPE
org-name:       ON-LINE DATA LTD
org-type:       OTHER
address:        Suite 1, Second Floor, Sound & Vision House, Francis Rachel Str.
address:        Victoria, Mahe, Seychelles

  what value can i get keeping in mind cyber security perspective?

The value you should get from this is that DNS is full of ways to reference reputable domains, like Amazon, but there is no actual connection to Amazon in many cases and the records you see should be less trustworthy, rather than more, because of this misdirection.


iPhone iOS 7 Encryption at Lock Screen Following this topic, I have a question about how the OS and apps access data while the phone is locked. Particularly in the case of iPhone 5S running iOS 7.

When the device is locked, what allows apps to access data from the flash memory? For example when receiving an incoming call, the phone app accesses your contacts and displays the appropriate information (name, picture, etc).
When first booted, iOS loads notification center, lockscreen background, etc. Are these stored in the flash memory? If yes, how does the OS get permissions to access them without your passcode?

In iOS, every file and keychain item is protected using one of protection classes. Depending on the particular class used, encryption key for files and/or keychain items is computed differently, allowing (or disallowing) access while device is locked.

Available protection classes are (see "File Protection Values" in "NSFileManager Class Reference":
  * NSFileProtectionNone: file can be accessed any time, even if device is locked;
  * NSFileProtectionComplete: file can accessed only when device is unlocked (note there's ~10 seconds grace period after device is locked during which files are still accessible);
  * NSFileProtectionCompleteUnlessOpen: file can be created while device is locked, but once closed, can only be accessed when device is unlocked;
  * NSFileProtectionCompleteUntilFirstUserAuthentication: file can be accessed only if device has been unlocked at least once since boot.

Note that all classes except NSFileProtectionNone use user's passcode to derive actual file encryption key, so key is cryptographically tied to the passcode.

To answer your questions: NSFileProtectionNone is what allows iOS to access files while device is locked. This is the "weakest" protection class of all and its use is discouraged, but there are cases when its use is necessary (like the examples you provide). Yes, all the items you mention are stored in the file system like everything else, but because of NSFileProtectionNone they are encrypted with key that is not tied to the passcode and thus can be computed when device is locked.


How the whatismyip knows real ip address? I just realize that this website knows the real ip address even if you use proxy ,i found this question, so start to test every possible way,first, this website don't have a X-Forwarded-For or X-Client-IP in its source code,second, this site don't just tell you are using proxy,it show your real ip address which it is not something that HTTP-header can tell.so how this website actually knows our ip address? is it some kind of trace back even if i disabled track data on Firefox even if we disable javascript! it shows real ip address!!

WhatIsMyIP does not need anything javascript-related to get your IP. Almost always your proxy will set the header X-Forwarded-For on your request.  WhatIsMyIP will get your primary IP from that.

Try accessing this site and see all the headers your browser sent and the headers your proxy added. If you install Firebug on Firefox, you can compare the headers sent by the browser with the headers shown on that site.

You can turn off javascript, disable Flash, Java applets, disable tracking, and it will keep getting your IP, as it depends on your proxy, not your browser.


Get client ip address that is not spoofed I am using the following source code to get a client IP address,

Public Shared Function GetIPAddress() As String
    Dim context As System.Web.HttpContext = System.Web.HttpContext.Current
    Dim sIPAddress As String = context.Request.ServerVariables("HTTP_X_FORWARDED_FOR")
    If String.IsNullOrEmpty(sIPAddress) Then
        Return context.Request.ServerVariables("REMOTE_ADDR")
    Else
        Dim ipArray As String() = sIPAddress.Split(New [Char]() {","c})
        Return ipArray(0)
    End If
End Function

But I have found that HTTP_X_FORWARDED_FOR can be easily spoofed using X-FORWARDED-FOR HTTP header. Is it correct?

Can REMOTE_ADDR also be spoofed? If yea then what can rely upon as a security point of view?

Note: My only concern with clients that are receiving the response, not the one that spoofed the IP at the TCP level and will not get the response.

This obviously only applies to HTTP, as it is a HTTP header.

It furthermore relies on a proxy server that doesn't attempt to hide that it's a proxy server. It will not work with clients using VPN. It will not work for clients using a proxy that doesn't reveal itself. It will not work for clients who establish a TLS session using CONNECT through a proxy.

In short, it provides no real security, but may be useful for statistical purposes or similar. It's like politely asking the client who they are, and expecting them to answer truthfully.

You can rely on that REMOTE_ADDR is the host that actually sends you the traffic. That's basically ensured by the three way handshake of TCP/IP.

You cannot be sure who asked the remote address to initiate the connection. You cannot be sure if that remote host is a VPN terminator. You can't know if it's a proxy. You can't know if it's part of a botnet.