Security scan result - Server leaks inodes via ETags After automated scan on my web application I have the result that "Server leaks inodes via ETags, header found with file /icons/README, fields: 0x16a4 0x438c0000000".

I've read about ETags but I don't see any security risk related to this. INode defined as
"The file's i-node number will be included in the calculation" is one of the standard configuration."

First of all, this is a false positive. Nikto reports this issue "Server leaks inodes via ETags" if there is a dash in the ETag header, which is by itself not an indication of anything.

An inode is a data structure used by the Linux file system. Every file and directory has an inode which stores its name, size and other data. Every inode has a number which uniquely identifies it. Apache HTTPD used this in the ETag for a while. The ETag is an identifier which should uniquely identify a file on the webserver, and the inode number is a number which uniquely identifies a file on the filesystem, so it seemed to make sense to use one for the other.

The inode number is technical information form the file system. If exposed, it cannot be used to exploit anything useful. Furthermore, it is only exposed on files that you can already download. It doesn't seem to a real security risk to me if a server exposes inodes.


Is there anyway at all people on my wifi could see I use TOR? When I use TOR, is there any way that the family could see I use it?

Assuming a family member is technically savvy enough, yes, they could probably tell you are using TOR.  The easiest way to do this would be to sniff the outbound packets on the network and analyze them using the TOR dissector in Wireshark. TOR packets are easily identified, as are TOR entry nodes.


WiFi Router, current status of security options? I'm about to buy a new WiFi router tomorrow (probably) & I'm wondering what kind of security features I should choose (Like: AES, WPA2, DMZ, TKIP, SPI, ...)

What is the current status of what is considered to be secure?

As I understand it, eg. WPA encryption was cracked MANY years ago, how is it with WPA2?
Or AES? I also have an options for AES-128 bit, how is that?

For your convenience, this is a list of what the store is offering in terms of router security

128-bit AES
AES
DMZ
NAT
SPI
TKIP
WEP
WPA
WPA-PSK
WPA2
WPA2-PSK

Many of those are going to be irrelevant to you. As mentioned in a comment, the only important point is that it has WPA2 and AES. Every modern router has this, so from that perspective it doesn't matter what home wifi router you choose.

Generally the differentiation is on non-security features such as the admin interface, management tools etc.


I'm having a DDoS attack, my hosting company is not giving me a solution, and I need to know what is hapening So ok, right now my windows 2003 dedicated server is under attack by some guy who's flooding UDP packets (~90.000 packets/sec) on my 100Mbps server for the last 8 hours.

I'm on a shared port, so I'm guessing there is one 100Mbps router, or cable shared with about 50 to ~100 other machines on the same network. (I guess all of them suffer from this attack too)

When I'm having this attack, it's eating ~90% of my network (I seet it in the taskManager) but nothing changes in the CPU... Cuz does UDP packets are not targetting any application in my server, the're just random packets.

My hosting company said that I could buy some software or hardware solutions, and they said it could work. And that upgrading to 1Gbps internet speed won't do any good.

I think they're wrong.

Since 100 Mb/s is all what that shared port can handle, if I buy a cisco hardware firewall (~400$) it will just not send bad trafic to my machine, but the port will still be busy and full of maximum trafic from the DDoS, which I think will still be slowing down my server anyways.

And software solutions is just stupid, I don't see how it could help in this case.

I'm I wrong here?

Have a good look at this question on DDoS mitigation - it is not something you will be able to solve by buying a faster switch, as an attacker can always get more traffic sources than your network can cope with.

All the workable solutions manage it with routing or dropping packets within the ISP - if your ISP doesn't offer a solution you should consider looking around for one which will.


Suricata Ripple20 rule for IP-in-IP resulting in 100M alerts I found too many events in Suricata after recent update regarding this rule:
alert ip any any -> any any (msg:"ET EXPLOIT Possible CVE-2020-11900 IP-in-IP tunnel Double-Free"; ip_proto:4; metadata: former_category EXPLOIT; reference:url,www.jsof-tech.com/ripple20/; classtype:attempted-admin; sid:2030388; rev:1; metadata:signature_severity Major, created_at 2020_06_22, performance_impact Significant, updated_at 2020_06_22;)

This is strange because it matches all packets with IPIP protocol (ip_proto:4)!!
Also i found another rule from Carnegie Mellon University's CERT (link):
alert ip any any -> any any (msg:"VU#257161:CVE-2020-11900 IP-in-IP tunnel Double-Free https://kb.cert.org"; ip_proto:4; sid:1370257161; rev:1;)

But the same issue exists here!
I want to know if my understanding is right or not.
Why Suricata has matched more than 100M events in the last 3 days?
How can I fix it?

At first, I thought that ip_proto:4 was going to match on IPv4, but that's not correct.
IP protocol number 4 is IP-in-IP, which is what the rule is supposed to report on.
So, for both rules, it is inspecting all IP traffic, regardless of direction or destination for IP-in-IP traffic.
Suricata's documentation on ip_proto.
Why are you getting 100M alerts? Because, according to your comments, you are using IP-in-IP. So, this is not surprising in the least.
This one rule is only going useful in networks that do not use IP-in-IP. All the rest of the rules for Ripple20 can still be useful for you.


Bypassing the GFW with IPv6 and proxying all IPv4 traffic I hope I'm in the right forum for this kind of question. I'm in China and as you're probably all aware, the Great Firewall (GFW) blocks a lot of websites. Surprisingly, when using the IPv6 connection provided by CERNET (academic university network), I can bypass GFW and access blocked websites such as google, youtube, facebook, twitter, ...

Unfortunately, not all websites support IPv6 yet, so disabling IPv4 is not an option as it makes lots of websites inaccessible (also Skype won't work without IPv4).

Is there an easy way to proxy/tunnel/whatever all IPv4 traffic through my IPv6 connection? I found a website, sixxs.net, that kinda does what I'm searching for, but I'd like to have this functionality on an OS-level (like a VPN).

Any tips are welcome!

You are asking for how a client which is effectively IPv6-only can connect to IPv4-only sites. NAT64 is designed to allow IPv6-only clients to connect to IPv4-only servers. In order to use NAT64 you also need to use DNS64 and/or 464XLAT. It is possible for 464XLAT to be autoconfigured using information from DNS64.

There are public NAT64 installs in various places around the internet, sometimes these will also provide a public DNS64. The first showing when I did a search was this deploy360 page which lists three DNS64 addresses. Of those 2001:67c:27e4::64 was the only one working for me.

If you configure your device to use 2001:67c:27e4::64 as your DNS server and disable IPv4, you will be able to access IPv4-only sites through the NAT64. You can also do your own search for providers, the one I found is certainly not the only public NAT64+DNS64.

This relies on the client software you use to support IPv6. If you need to use client software without IPv6 support, you need 464XLAT support on your device. 464XLAT will translate IPv4 traffic from the application to IPv6 and send it to the NAT64 which translates it back to IPv4.


What percent of publicly posted databases implemented password security? I am trying to get some statistics on databases that were a part of data breaches, namely, I would like to be able to find out what percentages of publicly posted databases (from a data breach) had passwords stored in plain text form, hashed, salted hash, and so on, and informally report statistics on the password storage characteristics/practices in publicly posted databases.

Are there any such sources or information currently available?

As a start, try this paper, which assesses 34 password database breaches. It states the following on page 2:

  While absolutely no information on how the passwords were stored could be found in 26.5% of the cases, we found 11.8% reported passwords were “Hashed and Salted”, 5.9% used salted MD5, 14.7% used unsalted MD5, 11.8% used salted SHA1, while unsalted SHA1, SHA256 salted, crypt(3) salted, and bcrypt each accounted for 2.9%. Plaintext use was noted in 17.6% of the site breaches.

I'm not aware of a larger scale resource that tracks these figures.


KRACK Attack vs sniffing Trying to learn....

The ultimate difference between the vulnerability outlined in the answer posted here and KRACK attack is that with KRACK attack, the attacker does not need the AP pass phrase?

The primary difference between the two is that the KRACK attack targets the end-user and not the network itself. The attacker essentially creates a clone of a network that has already been associated and trusted with the target user's device. The attacker then "forces" the victim to connect to their rogue access point at which point they are in a Man-in-the-Middle position. They are now in a position to eavesdrop on traffic and potentially implement an SSLStrip attack to eavesdrop on TLS connections.

The linked question refers to an attacker joining a wireless network for nefarious purposes. At no time during the KRACK attack does an adversary join a network, nor do they compromise the network password. They impersonate that network.

EDIT : It should be stated that the KRACK attack is a form of sniffing, though the method you use to be in a position to sniff is different from the WPA2 sniffing question you linked to.


I emailed someone a picture of a check I wrote for them. What now? On a whim, I emailed the intended recipient of a check I wrote a picture of that filled-in check to indicate I was about to mail it out. The full front of the check, with amount, my signature, account number, and everything else is plainly visible. I sent it via Yahoo-based webmail to a privately-owned domain, versus to another large webmail provider (due to this, I'd assume any assumptions about security that could have been made are no longer valid). The image was of my hand holding the check at an askew angle, not a perfect Office Lens-type image with the edges neatly squared (that would provide some protection against bots scanning for check images sent out by idiots like me).

Having done this, am I screwed in some way? If so, how screwed am I? What should I do to prevent or mitigate any expected issues arising from this?

I disagree with @quietsigns answer.  There are other people that could potentially see your email.

For one - email can be sniffed while in transit.  Probably not super likely but still possible.

Second - if the destination email is ever compromised (or is currently compromised) then it's likely that this email will just be sitting there.  If you are really worried about it you could always ask the receiver to delete the email since it contains sensitive information.

While these scenarios might be unlikely, @quietsigns assertion that "The only people who might see the photo of your check are the system admins of the lines and servers your email went through..." is not accurate in my opinion.


Starting with sandbox development I am looking for some security related project in which I can contribute and also learn something. Since I am new with this stuff It will be better if that project is less complex and digestible for a beginner. I was searching for such project in GSoC and found a opensource sandbox project called "Cuckoobox".

I tried to get hold of its source code but that proved to be futile attempt.I realized that first i need to know the windows OS environment and API and why they are so susceptible to infection, common methods and tools for attacking such DLL injection and solution for them. Please point me to some study material to get all the basics required to be able to contribute to such projects.

I have one more question. Which OS should I start with, Linux or Windows?. I think Windows should be the one as it is the most widely used OS and also the most widely infected (compared to Linux).

Microsoft has had a horrific security track record.  But the real problem in 2011 isn't operating systems,  its web applications and web browsers.   You should explore projects like Damn Vulnerable Web App, OWASP WebGoat  and especially Google Gruyere.  You can find pre-built VM's for all of them,  and Google is hosting theirs so you don't have to install anything.


Difference between audit log failure/success? I am working on event logs. I receive different logs such as 1. Success audit 2. Failure audit For same type of events(Login,logoff) etc. What exactly is the difference between these two types of events?

A success audit entry is created in the event logs when a user logs on onto the computer/network with correct credentials, often, a username and password, and passes authentication.

A failure audit entry is created in the event logs when a user fails to pass authentication, with or without the credentials.

That said, a number of failure audits in succession of each other, against the same username, may also indicate someone is trying to brute force the password of the account.


How does a CSRF token prevent an attack, and how can I safely use/avoid it for my JSON API? I'm trying to make an iOS app communicate with a Ruby on Rails website using JSON. While trying to post a login to create a user session, I discovered I was missing a CSRF token. I had no idea what that is at all, so I started looking into it, and found some solutions that say to remove the CSRF protection if the call format is 'application/json'. But that sounds like that leaves the website vulnerable?

Some results came up about JS forms having the same issue. The answers there were to add in the CSRF token. Which upon inspection, also appears to be in meta content tag in page headers.

So this leaves me in confusion, here's my questions:

How does the token help protect anything if it can be read in prior call to the attacking call? Can a malicious site not simply make a request, parse the received message, and send another request with the token?
Would it be safe to disable the token-check on the login post action, and have it send back the token along with the success response? If not, any better suggestions?

A summary of how CSRF attacks work goes like this:

You, the good user, while logged into a web site A, visit some other site's page B.
That page does a GET (can be a POST, a little more complex to set
up) to a page X on site A (which you are logged in to), with e.g.
. Your browser obliges, using your already authenticated session/cookie
Page X by design causes change in state of your account -
classic examples are "transfer X dollars to B" (less realistic) or
"set user status line to PWNED" (more realistic)

There are a number of ways a CSRF token can be implemented, but the idea is that a simple GET request to a state-changing URL X will not work unless an additional changing piece of information (the token) is included, e.g. it has to be "X?token=123123213". Since the token changes reasonably often, the step 2 above will not work. The would-be attacker does not know the current token.

Your question 1 - the attacker does not see the content of the page X, he only forces you to visit it.

Your question 2 - since this is all about actions when already logged in, it is more or less ok to not use CSRF protection on the login page. There is a chance that you can be forced to log in as someone else and not notice it, though.

http://en.wikipedia.org/wiki/Cross-site_request_forgery

A more general class of issues is http://en.wikipedia.org/wiki/Confused_deputy_problem


Are GPG Tools Keys Just Plains GnuPG Keys? I generated a key pair with GPG Tools for Mac and exported the public and private key to a safe place.

I assume that I can decrypt my stuff with this USB in any OS (e.g. Linux) and any GnuPG software.

Is that correct?

GPG Tools is a distribution of GnuPG with some front end and integration addons. All key management and cryptographic operations is handled by GnuPG. You can also verify this by running gpg --list-keys on the command line, which will show the same keys the frontend tools know of.

Furthermore, GnuPG does implement the OpenPGP specification, so I'd rather call those keys "OpenPGP keys": they're also interoperable with other implementations of OpenPGP (PGP, OpenKeychain, the Monkeysphere development library, ...).


Does TLS rotate the shared secret periodically? After the initial shared secret is agreed upon between the client an server through the TLS handshake does the shared secret get rotated periodically ?

The client or the server may request a renegotiation at any time.  That renegotiation would include a new shared secret.

The Server can send a Hello Request to trigger renegotiation (emphasis mine):

  The HelloRequest message MAY be sent by the server at any time.

  Meaning of this message:

  HelloRequest is a simple notification that the client should begin the
  negotiation process anew.  In response, the client should send a
  ClientHello message when convenient.

To quote RFC 5246 on Client Hello (empasis mine):

  When a client first connects to a server, it is required to send the
  ClientHello as its first message.  The client can also send a
  ClientHello in response to a HelloRequest or on its own initiative in
  order to renegotiate the security parameters in an existing
  connection.

How likely an application is to request renegotiation is going to vary, but (unscientifically) I expect the answer is "most won't ask."  But it can be done.


Session Hijacking - regenerate session ID Does regenerating the session ID on each request mitigate the probability of a session hijack enough to be worth implementing?

I would imagine combining a check for REMOTE_ADDR vs the REMOTE_ADDR stored in the session variables, along with a 30 minute inactivity timeout and a constantly changing session id should mitigate the risk to an acceptable level.

Additionally, are there any other concerns with regenerating a session id? Do I need to explicitly destroy the old session for each new regeneration?

Finally, would regenerating the session id on every request become too resource intensive on a large deployment to justify vs the security advantages?

I've seen implementations that tried this approach and ended up pulling it because yes it can cause resource issues and race conditions across Web farms.  It sounds like a good idea at first, but can also make your application more prone to denial of service attacks if the regeneration process is too cryptographically intensive.  Answer there is to pregenerate session IDs periodically and keep a cache available, but then you have to manage the cache securely.

Some more common solutions to securing session ID variables is to

use SSL
only generate the authenticated session ID after successful login over SSL, else you become vulnerable to session fixation
generate cryptographically random and unguessable tokens
expire session IDs frequently
properly expire then server-side on log out
mark the session ID cookie as HttpOnly and 'secure'


How to effectivily block torrents on my network? As per the network policy, we have to block all torrent traffic from the network. To do this, I used to block all ports above 1024 on my firewall/proxy devices. But due to this, many other applications which use non-standard ports are not able to function, especially mobile applications, and users are complaining because of this.

Is there an effective way of blocking torrents on my network?
A minimum number of ports, or few specific ports, or application level filtering?

We have Cisco Iron Port Security and Cisco ASA 5500 Firewall devices.

You have a number of ways to restrict torrents:

Blocking ports: this doesn't work, because p2p traffic can use pretty much any port (even ones below 1024)
Deep inspection: looking at traffic and blocking based on type can help you a lot, however encrypted traffic all looks alike
Destination filtering: this may also help a bit, but you'd have to maintain a large blacklist
Volume: if a user is downloading/uploading large amounts of traffic then investigate
Controlling the applications installed on the computers on your network through Group Policy or a real world policy. Disallow all p2p applications, and if anyone breaches the policy don't let them use the network/fire them/fine them/whatever


Evaluating the security of home security cameras My parents have a vacation home out in the country and are looking to setup a home surveillance system for remote viewing.  I've heard that there can be serious vulnerabilities in these products. What are some guidelines I could use to help evaluate these products?

I have a software development background, so I'm comfortable with technical answers, but I'm certainly not a professional as far as system administration or network configuration. My parents are looking to spend under $300, though they can spend more if that's unrealistically low for a well protected system, so my financial resources to perform a security evaluation myself are limited.

Like most embedded hardware (routers, etc), their firmware often sucks, and unless you have unlimited time I'm afraid there is no way to thoroughly check every single camera out there. And even if you do find one that's currently secure, what guarantees that you'll get updates for vulnerabilities that will be discovered in the future ?

Instead, I suggest just creating your own IP cameras by using USB webcams (or cheap/insecure IP cameras) and connecting them to a Linux/BSD computer that will actually handle all the authentication/security and then rebroadcast the camera's video feed (preferably over something secure like HTTPS). That way the internet-facing part of your home-made "camera" can be updated and hardened just like any computer, and behind it you are free to put any camera you want, including the cheapest garbage since it won't be exposed to the Internet anyway.

Finally consider putting the camera system on a separate network air-gapped from the Internet - I know it doesn't apply in your case but I'd still like to mention it - the requirement for physical access is a pretty good security measure, as someone who wants to spy on you now has to physically break into your home rather than being thousands of miles away. If off-site recording is required, video could be encrypted and then streamed outside of the air-gap via a one-way Ethernet cable with the key kept securely, so that the data leaving the air-gap is meaningless unless the correct key is provided.


Spoof publisher info on Windows applications Let me start by acknowledging that I have absolutely no experience with Windows development and this is purely for academic purposes. I apologize for incorrect terminology and welcome corrections or good resources.
When we run a program from an uncertified vendor we get a security warning from Windows indicating that the software comes from an unverified publisher. (i.e. https://www.remosoftware.com/info/wp-content/uploads/2016/06/Unverified-Publisher.png)
Is it possible to set the publisher info displayed there? I don't care whether or not windows displays warnings and alerts telling the user that it is unverified. I don't mean to spoof a certificate or bypass the warnings. An example would be the user running the program and receiving the warning above with  "Apple Inc." instead of "Unknown Publisher".
I have seen many different Stack Overflow posts on the topic but overall I am very confused by the Windows ecosystem and different types of projects/templates that can be used. I ended up creating a Winforms project and I am using Installer Projects. I tried setting the deployment project properties fields but it did not work. I created a temporary certificate and I am signing the ClickOnce manifests as well as the assembly on the Winforms project.
In the end, I just want to know whether or not it is possible.
Any help is appreciated!

It seems very unlikely that you will be able to set the "Publisher" field in that dialong without getting a code signing certificate and applying a signature to your software.  That would be a big security risk for people who are going fast and not reading all the words in these dialogs.
If you are distributing this software to the public and you can afford it, I recommend getting a real code signing certificate.  I wrote a lot about how to do this:  https://www.davidegrayson.com/signing/
If you are only distributing this software to people you are closely affiliated with, you might be able to convince them able to install a certificate from you on their computer (as a trusted root certificate or a trusted publisher), and then Windows would show you has a verified publisher without you needing to pay anything.


Patching Mechanism and security holes Let me clarify two methods of patching softwares and then I will go straight to the question:

I am using both MAC OS X and Windows and different mechanisms of these two famous operating systems in handling software updates are interesting to me.
 When an update is available in OS X, usually a complete renewal of the troublesome part is available and it seems to me that it completely renews that part, but when there is a hotfix for windows available, this hotfix is usually so tiny (in comparison with what we download from apple site).

I am wondering about cons and pros of such mechanisms (toward security goal of that software) and I don't care about who is right or wrong, I need a comparison of security affects that these patch management techniques can cause and the amount of labor and side effect in different patch management strategies (If it is so broad, a reference may suffice to give me a clue on how to start).
{Please provide constructive answers and avoid blaming any software vendor esp those two mentioned above in any part of your answer. This is the policy of this forum as long as I am concerned. Thanks}

So essentially this comes down to whether the patch is delivered as a set of replacement files, or a set of "binary diffs" to be applied to the existing files.

It's usually easier to update an arbitrary earlier version of the software from the replacement files. For example if you have 1.0.2 of a component and the patch delivers 1.0.7, with the replacement you just go ahead and install that. With diffs you must (often) go via 1.0.3, 1.0.4 etc. I remember Solaris' patching mechanism having this interesting feature (and having to install each part manually, before PatchPro was released).
It's usually quicker to download the binary diff updates.
A replacement component install is more likely to succeed if the original files have been modified somehow. However, you shouldn't be relying on the patch manager as your integrity checker anyway.

In fact, in my experience the "security" of a patch comes down not to the installation mechanism (except that automated usually beats manual), but to these two things:

Most importantly, the latency between availability and installation of the patch. See, for example, the Slammer worm.
The amount of testing done by the vendor before distributing the patch.


What do I do, I got a virus warning on a webpage I went to the web address (hxxp://www.asanka.com) (WARNING: BE CAREFUL WHEN VISITING) on Safari, then suddenly I got a warning message [image below]

What do I do? I'm freaked out. I have a lot of personal stuff on my Mac that I don't want anyone to see.

Edit: in response to @Freedom

I believe when I clicked Ok which is when those messages appear.

I think it's just a scary tactic from the site to make you download something that can be just an annoying adware to a very bad malware. It can be also a common method called Clickjacking where a user is tricked into clicking something which will then execute a malicious action or start a malicious download.

Do you have any AV on your OS? Did your browser downloaded anything automatically?

If you have AV and haven't downloaded anything I would say you are safe. Just ignore this kind of messages.

They are just a scary tactic, no different than messages like " you just won $1000 dollars" or pop-ups saying you are "infected with a nasty virus"  so ignore every message like that on websites: they are fake and aim to trick you to do something malicious.

But anyway since you are using Safari, I recommend this amazing open-source Blocker for Safari. I recommend going to its settings to add more lists to it. (Just don't use EasyList without element hiding rules or  Anti-ThirdpartySocial list since they can break lots of pages). While I'm doing recommendations I could say you should also use https everywhere.

It appears to be Safari specific, because when I visited it with other browsers I didn't see anything. However I still think this is a fake pop-up intended to lead you to download their software. Macupdate.com appears to be a store for apps for MAC.

I visited the website with my iPhone too and I couldn't reproduce what happened to you. I'm not sure why this but I would keep the usual : if nothing has being downloaded on your PC then ignore these "warnings".

Some useful tools if you happen to come to another websites like this one : Google Safety Report and VirusTotal.

Do not execute or open any file that you did not expected to download. Keep your browser updated and use ad-blocking software if possible.


Android Stagefright Google Zero Day Exploit doesn't run. How to fix? Exploit is posted here, however it is missing several things, for example shellcode and it binds to localhost for exploitation, cannot access it from Android device when started on my computer. I modified the two in my version.

To run the exploit I copied the libc.so from Android to the working directory. However pop_r0_r1_r2_r3_pc and pop_r4_r5_r6_r7_pc cannot be found. I hardcoded them to 0xffffffff just to see if it runs further. How to properly get those values? Which libc.so should I use?

Example Execution:

./mp4_stagefright_release.py

[*] memcpy : 0xb6ecdc08
[*] mmap64 : 0xb6ed42ed
b6ecd034:       e280204c        add     r2, r0, #76     ; 0x4c
b6ecd038:       e8927ff0        ldm     r2, {r4, r5, r6, r7, r8, r9, sl, fp, ip, sp, lr}
b6ecd03c:       e33d0000        teq     sp, #0
b6ecd040:       133e0000        teqne   lr, #0
3068973108
[*] stack_pivot : 0xb6ecd034
b6f0f784:       e49df004        pop     {pc}            ; (ldr pc, [sp], #4)
[*] pop_pc : 0xb6f0f784
[*] pop_r0_r1_r2_r3_pc : 0xffffffff
[*] pop_r4_r5_r6_r7_pc : 0xffffffff
b6f1015c:       e59de040        ldr     lr, [sp, #64]   ; 0x40
b6f10160:       e28dd048        add     sp, sp, #72     ; 0x48
b6f10164:       e12fff1e        bx      lr
[17/Sep/2015:22:21:01] ENGINE Listening for SIGHUP.
[17/Sep/2015:22:21:01] ENGINE Listening for SIGTERM.
[17/Sep/2015:22:21:01] ENGINE Listening for SIGUSR1.
[17/Sep/2015:22:21:01] ENGINE Bus STARTING
CherryPy Checker:
The Application mounted at '' has an empty config.

[17/Sep/2015:22:21:01] ENGINE Started monitor thread 'Autoreloader'.
[17/Sep/2015:22:21:01] ENGINE Started monitor thread '_TimeoutMonitor'.
[17/Sep/2015:22:21:02] ENGINE Serving on http://0.0.0.0:8080
[17/Sep/2015:22:21:02] ENGINE Bus STARTED

I'm also dealing with this exploit trying to make it work, I download it from exploit db.

I think the libc.so is from your architecture instead of the Android one because if you see in the code it uses 64bit architecture.

So make a search in your directory for libc.so.


How should I store and secure self-signed certificates? I'm fairly certain I shouldn't commit certificates into source control. Even if the repository is private and only authenticated coworkers (for example) have access to it. That would allow for accidental exposure (thumb drives, leaked credentials, whatever).

But, how should I store and secure certificates? I don't suppose I should just plop them on the network file server, for some of the same reasons I wouldn't put them into source control, right?

Is there some kind of secure certificate store that I can run? Does the Java "keystore" do that generally or is it specific for like weblogic servers or something?

This answer applies to SSL or PGP type digital certificates, which bind an identity to a public key.  It has been pointed out to me that the question as originally asked did not specify what kind of certificate, so my answer may not fit the question.

Digital certificates which bind an identity to a public key do not need special security because they contain only the public key.  There is no reason not to store a copy in your source code control system.

The corresponding private key does need to be kept secure, but will need to be installed in the server(s) or email client(s) which are identified in the certificate.  So, the private key is necessarily exposed to anyone who has administrative access to those machines.  Also to anyone who has access to backup tapes, etc.

You absolutely do need a backup of the private key; if it is lost, as through a disk failure, you'll need to replace the certificate with the corresponding public key.  I keep mine on an encrypted volume for which a very few people have the key.  (More than one person needs to know that decryption key.  People really do get into accidents, quit their jobs, etc.)


Can't see ARP poisoning packets on Wireshark and Scapy I'm trying to create a python script to detect ARP poisoning on WiFi networks. I'm using scapy and wireshark to check scapy's output. I'm stuck trying to see all ARP traffic on the network, I can only see packets sent by me and broadcasted ones. Is this correct or should I see all traffic? My intention is to see a ARP response saying IP 192.168.1.1 is at attackers_Mac and based on this, alert about attack.

Thank you.

Yes, you are correct.

You will only be able to see ARP traffic sent to you or broadcast to FF:FF:FF:FF:FF:FF.

If you want to see ARP traffic over the whole network then this depends on the network architecture. Wireshark shows some ideas on how this could be achieved such as MiTM or using a hub.

If capturing WiFi traffic, your wireless adapter could be put into monitor mode where it would then capture all wireless traffic nearby.


Is this acceptable login security? I was logging into a VM on a computer at work. The VM was Linux Debian 2.30.2.
I discovered that I could input my password, followed by garbage, and it would be accepted.
How is this considered acceptable password authentication?
I mean, cow and cowabunga are NOT the same word.

How common is this, sort of half assed authentication?

There was no Debian 2.30.2 release; there was a Debian 2.0, 2.1, and 2.2 that were released more than 10 years ago.  I'm guessing you are talking about the version of GNOME (your desktop environment) which has nothing to do with authentication.

Most Debian systems use PAM for authentication.  Your password is checked against a salted key-strengthened hash that is stored in /etc/shadow next to your name.

You'll typically see a line in that file (this is not a real password; just dumbpass created for a fake account that's already deleted):

fake:$6$qaPTEvGg$XCMFzng5TQotiK4Whr4a0F/87.h5KK3kTO1R4Ysr6G8Ej42JZaJynYSG1uBWikQwlWhOPNNHOQgMFd6Kt.1rx/:15725:0:99999:7:::

where the account name is fake, followed by the salted-hash of the keystrengthened password in the form $id$salt$encrypted encoded in a base64-like encoding (base64 using the symbols  [a–zA–Z0–9./]), followed by a colon and then some more numbers (these numbers relate to settings about when the password was last changed/needs to be changed/will expire/etc.)  The id=6 above means that I am using SHA512-crypt, which basically does 5000 rounds of SHA-512 salted-hashes before saving my password.   See man 3 crypt and man shadow for more details as well as this page on SHA512-crypt.

Most modern systems (e.g., anything from this century) use stuff similar to this; possibly using MD5-crypt (which still will check against the entire password).

It seems however you are using a very antiquated DES scheme to check against your password that is known to only check against the first 8 characters (bytes) of the password.  From man crypt:

  In the MD5 and SHA implementations the entire key is significant (instead of only the first 8 bytes in DES).

Your salted hash should start with a $1$ (MD5-crypt), $2a$ (bcrypt), $5$ (sha256 crypt), or $6$ (sha512 crypt), and if it doesn't that means you have a DES hash (which is a scheme dating back to the late 1970s and should not be used any time after the late 1990s when it became feasible to break DES in days).

You can begin using a better solution by altering your PAM password settings and then updating your password using the command passwd.  The settings are in /etc/pam.conf or possibly in the directory /etc/pam.d/ in a file named common-password (may vary slightly by distro).  The relevant section of my file looks like:

password    [success=1 default=ignore]  pam_unix.so obscure sha512

This enables pam_unix.so for password authentication, using sha512-crypt as the algorithm to check passwords against.  (obscure forces passwords to pass a couple checks to reject overtly simple passwords -- e.g., words from a dictionary).  Now if pam_unix.so is not find-able on your system it may default back to using DES passwords (you may have to install "libpam-modules" which has pam_unix.so though any reasonable distro will come with this preset up).  Personally, I think this mistake is huge that modern systems could potentially be set up to use DES with raising huge red flags of weakness after each successful login; similar to what happens if you try making certain secure files world-readable.

Additionally there is a very small possibility you found a new bug in crypt/PAM; e.g., possibly if your password contained certain unicode characters in an unexpected encoding with null bytes.  (Note DES passwords not being able to handle unicode properly is one of their known flaws; but again a modern scheme like sha512crypt unicode passwords should be securely handled.)


Is it possible to extract secrets from a TPM without knowing the PIN? I understand the general operation of a TPM, and in particular the interest of using a pre-boot PIN: if someone gets access to the machine (turned off), turning on the computer will not be enough to get the keys stored in the TPM and thus decrypt the data.

I wonder how this PIN is used by the TPM? And how effective is it? For example, I know that it is possible to carry out physical attacks on the TPM, and some of these attacks can potentially extract secrets.

But naively, I imagine that if these secrets (let us say the master key of a BitLocker drive) are encrypted with the PIN, it is virtually impossible to obtain these secrets without knowing this PIN (unless attacking directly the encryption algorithm underlying). Is this how it works? Or the secrets are stored in clear, and the TPM releases them simply after checking that the PIN is correct?

Finally, I know that in a scenario where an attacker obtains total physical access, it is always possible to circumvent such measures (physical keylogger to retrieve the PIN, etc.). But the scenario I have in mind is that an attacker steals a laptop that is turned off (so no DMA attacks, cold boot attacks, etc.) with a disk encrypted with the key stored in the TPM with a PIN. Assuming this attacker is able to perform a physical attack (bypass anti-tamper protections, etc.) can they recover the secrets without knowing the PIN and without interaction with the legitimate user?

I have worked with TPM and HSMs in the realm of PCI PTS PED devices and certifications, so that is what I will use for the basis of my answers. They don't all work the same, and usually the datasheet is not publicly available.

Usually what I have seen is there is a sort of key derivation that isn't encrypted in the strict sense of a qualifying symmetric algorithms, but isn't clear text either, it is usually the result of a key derivation method

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

The PCI standard, for example defines key derivation methods, storage, and zeroization. At some point at the top the master key has to be non encrypted as you pointed out, but can be stored in multiple parts, salted and hashed or XORED with a pin or any combination.
A good TPM or HSM should only ever have the master key non encrypted, and the master key should never be used for any data encryption, only key derivation as to limit the chance for brute force discovery. It is not uncommon for the master key to be generated internally upon programming so that the master key cannot ever be output from the device.

The only attack vector I know of don't come from the TPM/HSM it self, rather the environment that they are used. I have done extensive SPA/DPA testing professionally. In this scenario you only have to convince the device to use the key many times(at least a few thousand) and you can moniter E/M emissions from the processor, or power, and do statistical analysis to determine the key.

I will attempt to illustrate this, Master top level key X is stored encrypted by an aes 256 key that the user has memorized and has to input each time to decrypt the OS.
I make an assertion of 1 to 4 bits of the pin used. I then generate 5000 different pins that varry about 4 to 8 bits of the pins and leave the rest static. It only takes about 4 bits to make the processor look sufficiently random. I put in these 5000 pins and capture the EM signals and keep track of what pin they were for. I thin split them into 2 piles, 1 pile makes a particular sbox bit 1 and the other makes sbox bit 0. If there is any statistical correlation I then know that my bit assertion was correct, and I can continuously break the pin bit by bit.

Most new security modules now attempt to mitigate by putting in clock stretching, random delays and other erroneous operations.

And then more advanced DPA look at second order and higher correlations which take exponentially longer and the race continues

My example is assuming your pin is a full aes key but the same theory can be applied to virtually any mathematical algorithm.


HIPAA compliant on Azure cloud? We are using WebRoles to host our api, Table storage to persist PHI and Blob Storage to persist MRIs and CT images.

What is required to become HIPAA Compliant?

-- Edit 2014-02-17 --

I just want to know where to start

You need to start with understanding your obligations under HIPAA and HITECH.  After that, you can read Windows Azure HIPAA Implementation Guidance.  You should also refer to 19006 Federal Register /Vol. 74, No. 79, Guidance Specifying the Technologies
and Methodologies That Render
Protected Health Information
Unusable, Unreadable, or
Indecipherable to Unauthorized
Individuals for Purposes of the Breach
Notification Requirements Under
Section 13402 of Title XIII (Health
Information Technology for Economic
and Clinical Health Act) of the
American Recovery and Reinvestment
Act of 2009; Request for Information
, which delineates certain other documents that pertain.

FIPS 140-2 Annex A algorithms (exclusively - 3-key TripleDES, AES (any length), SHA-1 and SHA-2 (any length), and RSA only, unless you really like Skipjack) are a bare minimum.  NIST SP 800-131A offers additional guidance (which boils down to: no more SHA-1, no more RSA less than 2048 bits, no more DSA with a |p| less than 2048 bits or a |q| less than 224 bits).

You should also find a consultant who is an expert in both HIPAA and HITECH, as well as whatever other regulations cover what you're doing.  Highly regulated areas like PHI storage are not places to wander into lightly or blindly.


Is a cookie safer than a simple HTTP header? I was recently told that a cookie is "safer" than a regular old HTTP header, which is safer than a URL parameter, particularly when passing around access tokens. What is the reasoning behind a cookie being safer than an HTTP header?

Also, I'm pretty sure I understand why a URL param is unsafe: because it is visible all the time and can easily be grabbed. Is that correct?

Cookies are HTTP Headers. The header is called Cookie:, and it contains your cookie.

But cookies are in fact safer than URL parameters because cookies are never sent to other domains. URL parameters, on the other hand, will end up in the Referer: header of any site you visit directly from the one with the URL parameter.


What is this address I received from wireshark? ______source____________destination___

41:9c:7f:78:b1:0c |     08:00:d0:58:59:4c

I am trying to identify those addresses, the source and the destination, I thought it was IPv6 but then I realized it's too short to be IPv6, I don't know if this is the right forum for this. So if it's not, mind redirecting me to one?

They are MAC addresses. These are Layer 2 addresses while IP is Layer 3. It shows MAC because IP is not known/used in this message.


What security problems are exposed by running untrusted macros in excel? Here's a 2015 article arguing that Macro-based malware is making a comeback.

Obviously running untrusted macros is bad news, but what are the specific problems?

As far as I understand, VBA can do things like read files, delete files, monitor keystrokes (probably not globally, but definitely within excel), and make web calls.  Those are a lot of problems right there.  Are there any others?

Macros can do anything that the user context of the program itself can do. They are executable programs. For example, they could contain a native executable, which is dropped onto the filesystem and then executed. If the user runs the program (e.g. Word) as an administrator, then the macro's payload now has full control over the system.

In general you should avoid macros like the plague. They're difficult to properly audit, since event callbacks can be used to hide code all over the place. Untrusted documents should be opened in a sandboxed environment (e.g. via Sandboxie, or in a VM) and the office application should be configured to block macros by default, either entirely or with a prompt to allow once.

Since vulnerabilities common document applications (e.g. Adobe Reader, Microsoft Office, etc.) are widely targeted, it can be useful to use alternatives (e.g. FoxIt or LibreOffice) that aren't as common. This is a security through obscurity method, but it has a tangible use-case here. I also highly recommend installing Microsoft EMET and configuring it for any application that commonly accesses untrusted data, including web browsers and office programs. This will usually prevent a huge portion of exploits from working properly, as long as they haven't been explicitly written to target EMET-protected systems.


what does "HasSession" means in bloodhound tool I'm exploring the Bloodhound Active Directory reconnaissance tool. There are few labels in this tool such as "AdminTo, MemberOf, HasSession" the first two is obvious to me. However, I didn't get the concept of "HasSession". Does it mean a user has RDP connection on that machine or executed something on that machine with psexec or totally something else?

This corresponds to the "User-Hunter" Powerview script that finds admins who are authenticated to resources. Yes, I have confirmed that only RDP sessions are logged, and not PSExec or any other sessions, which is unfortunate, because those sessions are often just as valuable.

However, you can find SMB sessions using the PSLoggedon.exe Sysinternals tool. The Nmap script "smb-enum-sessions.nse" uses the same method and may also work.


Is AES+hash rather than HMAC problematic? I will now ask a strange question, but bear with me. I can't share the entire usecase, but the point is to allow the holder of a secret key to create "strings" (used in other systems). The strings should be: non-reversible (=> hash) and should nobody but the key holder should be able to create them based on a known plaintext.

I know this sounds like an (H)MAC, but the goal is not message authentication.

So, to achieve that result (a non-reversible string that only the key-owner can generate), is encrypt(AES)-then-hash a good option as an alternative to HMAC?

A clarification - since it should be reproducible, the AES encryption (in CBC mode) should use a constant, rather than random initialization vector. This is in general wrong, but since the result of the encryption will be immediately hashed, the drawback of constant IV might be mitigated.

HMAC is faster than AES+hash (on my machine around 5 times), but both are fast enough for that to not be relevant.

HSMs support both encryption and HMAC. AWS KMS does not support HMAC.

Are there other drawbacks or benefits of AES+hash over HMAC? Or is there another canonical way to achieve to same goal - "irreversible result that only the key-holder can generate"

I'm not allowed to comment yet but you don't specify if somebody is supposed to be able to check if a string was created by a specific user.

If that's unnecessary you should probably simply use authenticated encryption.
If somebody should be able to check then I don't know how they would achieve that given your scheme. Even if they have the key, how will they know what was encrypted?

I don't think this can be reasonably answered without more details about your use-case. With the information you have given so far it just sounds like a pretty bad idea.


How to securely read a physical memory address in Linux? I am trying to read a physical memory address in a device running embedded Linux with our application. The widely suggested method is to use mmap, convert it into virtual address and then read the value.

Now I would like to know if it a man in the midde attack is possible by replacing the standard mmap library with a spurious mmap library? That is, can a hacker prevent me from reading the intended value from the underlying hardware? Is there a secure way to read the physical address?

In other words I am looking to read a physical address and I would like to know the value that I read is from the actual hardware and not a spoofed value.

Don't worry about it. If an attacker can replace system libraries that are being used by your application, then you have been totally compromised and can't trust anything in your app. It's not a situation you can really protect against.


Trying to understand how to use comment in SQL injection I'm trying to inject basic query but I think I'm missing how to comment the end of those query.

I tough using # or --' would work but I'm still ending with those kind of error:

  Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE user ;--' ORDER BY c2_.creationDate DESC' at line 1

So what is the proper way of bypassing those security?

What am I doing wrong when I wrote:

http://esgi-3.futest.com/subject/12%20UNION%20SELECT%20*%20FROM%20TABLE%20user%20;--'

And this is the whole error I get :

  An exception occurred while executing 'SELECT s0_.text AS text,
  s0_.creationDate AS creationDate, s0_.private AS private,
  u1_.firstName AS firstName, u1_.lastName AS lastName, s0_.user AS
  user, c2_.userId AS userId24, c2_.subjectId AS subjectId25 FROM
  subject s0_ INNER JOIN user u1_ ON s0_.user = u1_.id LEFT JOIN comment
  c2_ ON s0_.id = c2_.subjectId LEFT JOIN user u3_ ON c2_.userId =
  u3_.id WHERE s0_.id = 12 UNION SELECT * FROM TABLE user ;--' ORDER BY
  c2_.creationDate DESC': SQLSTATE[42000]: Syntax error or access
  violation: 1064 You have an error in your SQL syntax; check the manual
  that corresponds to your MySQL server version for the right syntax to
  use near 'TABLE user ;--' ORDER BY c2_.creationDate DESC' at line 1

There are multiple errors here:

The syntax of a select statement is SELECT [COLUMNS] FROM [TABLE], but you are writing SELECT [COLUMNS] FROM TABLE [TABLE].
You are injection a ;, but that is not required or valid for most APIs.
While you can use * in a union select, it is highly unlikely that both tables have the same amount of columns, so it will likely not work.
You are correct that you cannot just use --, but have to append an actual comment. However, I wouldn't use '. It is likely valid, but it may be filtered, etc. Either use # or append a different string, eg -- -, -- foobar etc.

Giving this, this should work:

1 union select 1,2,3 from user -- -

The column count is likely wrong and needs to be adjusted by you.


what is the relation between ISO IEC 15408 and Protection Profile? I've been researching on EAL tests. there are some questions and i can't make heads or tails of them.

I read ISO/IEC 15408-3 standard. I can't understand the numbers in the matrix table in page 33 (Table 1 - Evaluation assurance level summary).
I read Protection Profile for Network Devices, one of the requirements name is "FCS_CKM.1.1". Is there any relation between these numbers in requirement name and "Component taxonomy" topic in the page 23 of ISO/IEC 15408-3?
I know I have to write Security Target based on Protection Profile, but what requirements are needed for each EAL level? For example what difference between requirements for EAL 1 and EAL 2? Is there specific Protection Profile for each EAL level?

Thanks a lot for your answers.

Answer to 1. The table gives an overview of which security assurance components (SARs) are included (must be included) to meet a certain EAL level. Suppose you are writing a security target or protection profile targeting EAL4. Then you take a look at the column for EAL4 and screen each row. The first row is for ALC_TAT, and the entry in the EAL4 column is 1. This means that for EAL4, the assurance component ALC_TAT.1 will be included in the evaluation process. If you want to know what that means for the product developer and the evaluator, you can scroll down to page 151.

Among other actions, the developer has to ensure this for example:

ALC_TAT.1.1D The developer shall provide the documentation identifying each development tool being used for the TOE (target of evaluation, i.e. product).

The evaluator has to also do things, like for example:

ALC_TAT.1.1E The evaluator shall confirm that the information provided meets all requirements for content and presentation of evidence.

Including ALC_TAT.1 means that also all dependencies must be included as well. ALC_TAT.1 has a dependency on ADV_IMP.1, for example. An EAL level makes sure that all dependencies are met and everything is consistent including all potential circular dependencies. For example if you take a look back in the row ADV_IMP and column EAL4 you see a 1, i.e. ADV_IMP.1 must be included as well. Thus the dependency is met.

Note that SARs are stacked hierarchically, where each hierarchy level adds some more requirements. One can also "overachieve" the EAL level. For example including ALC_TAT.2 instead of ALC_TAT.1 would mean for the developer:

ALC_TAT.2.3D The developer shall describe and provide the implementation standards that are being applied by the developer.

When you include SARs that are not needed/higher than a predefined EAL level, one usually adds a + at the end. For example EAL4+ could be EAL4 but ALC_TAT.2 instead of .1, as well as all dependencies that are introduced by ALC_TAT.2 but are not required for ALC_TAT.1. In this case, the depencies for ALC_TAT.2  and ALC_TAT.1 are exactly the same, namely only ADV_IMP.1.

Answer to 2. The PP includes the security functional requirement component (SFR) FCS_CKM.1 . This component is defined in part 2 in CC in the chapter Class FCS: Cryptographic support. FCS_CKM is the family, then the component is leveled into 1, 2, 3, and 4. If you include FCS_CKM.1, then the only subcomponent is FCS_CKM.1.1, and hence this is included in the PP. This leveling and subdividing components is similar to the approach for security assurance components (SARs), defined in part 3. But don't mix

SFRs (describing requirements on what is subject to evaluation in the product) with
SARs (describing the depth/extent of the evaluation of the security functionality described by the SFRs).

Answer to 3. A protection profile is a description of the target of evaluation together with a fixed combination of SARs and SFRs, where all dependencies among these are met. The set of SARs could be

implicitly defined by just choosing one EAL level - then the set of SARs is defined by the table you mentioned in your first question.
The set of SARs could also be different, for example choosing an EAL level and augmenting the EAL level with additional SARs, or
simply directly choosing a set of SARs which are consistent.

Approach 3 is used in the protection profile you refer to. If you take a look at the table you mentioned in your first question and the list of SARs in the referred protection profile, you can see that not all SARs that are needed for EAL1 are included. So looking at this from a EAL level, this PP is EAL0+, where the + is ADV_FSP.1, AGD_OPE.1, AGD_PRE.1, ATE_IND.1, AVA_VAN.1, ALC_CMC.1, ALC_CMS.1.

This is the general approach with PPs. As mentioned, collaborative PPs don't adhere to the predefined sets of EALs and usually define their own sets/combinations of SARs in one PP with ignoring the preset EAL levels. This has advantages and disadvantages: The cPP approach allows to leave out SARs that are not relevant for the specific product type/industry segement, or are difficult to meet due to involved costs. From an end-users perspective the disadvantage is that you have to know the underlying cPP and involved SARs to assess whether the product is actually secure. Whereas in the standard approach you know that for say, EAL level 4 you will always have a thorough vulnerability assessment (AVA_VAN.3 or higher).

The result is that in practice the cPP approach is usually used mostly for low-security products (some kind of "network device") where the product-development cycles are short, whereas high-security products with a longer development cycle often still fix an EAL level (i.e. typical smartcard chips are usually EAL5 or higher).


Connecting to my VPN via IP or domain name? Background:

So I use a private VPS to host my own VPN, rather than pay/trust another company to host it for me. I am an intermittent traveller so it is cheaper for me to spin up or down my server as I choose.

The main reasons I use a VPN are 1. To stay secure in WiFi networks I don't trust 2. Avoid filtering services 3. Avoid DNS logging in countries that now use it.

I do not use it for or care about sophisticated attacks against me or high-level government investigations against me. (I just want to be left out of broad-brush surveillance techniques like DNS logging/snooping)

Since I spin the server up and down as needed, it is a pain to change the IP address in the OpenVPN config files for all my devices each time. As such I have pointed a subdomain I own eg vpn.mydomain.com (A record) at my VPN server, and all I need to is make sure that it points at the VPS's IP every time I spin it up and I'm good to go.

Question:

Since the domain name vpn.mydomain.com will be resolved by DNS un-encrypted anyone can look at my traffic see that the last DNS request sent was for vpn.mydomain.com and then all they will see is encrypted VPN traffic. All they then need do is look up the IP of vpn.mydomain.com and look at the DNS traffic of that IP and they will have aa 100% capture of my DNS traffic. completely undoing reason 3?

Is this logic valid? The only solution I can think of is to host the VPN server in a distant country with no snooping, keep manually changing the IP addresses or use some fancy re-direct methods that will probably make auth fail.

Message to mods:
I know "Is it a bad idea to use a domain name to access my VPN?" is a very similar question, but it doesn't address this point.

TL;DR: They can get the VPN IP anyway. Use DNSCrypt.

There is actually a bit better solution to hiding your DNS requests, using DNSCrypt. Of course, you need to find a DNS server you trust that supports it. This can be in addition to VPN.

As for point 3, yes. If the people spying on you can spy on your servers connection, then they will see your traffic and it could be arguably easier as that VPN server is probably easier to associate with you than a random public wifi connection. On the other hand, this depends on where your VPN server is, as foreign countries would not be able to simply spy on a server in your home country (maybe? hopefully? Paranoia kicking in...).

As for using vpn.mydomain.com to get IP of your DNS server, it is not really relevant. Attackers inspecting your traffic will most likely be able to say, that you are connecting to a VPN and get the VPN IP directly.


Subdomain Scan protection I have seen that all our subdomains can be eaisly be scanned with help of websites like dnsdumpster.
What is the best way to protect subdomains of any website from getting scanned or revealed via sites like dnsdumpster.

Even if we add it in Robots.txt the subdomain url is still available for anyone who knows the website URL.

You are using the wrong tool for the Job!
Subdomains are not private. They can't be made private either. The reason why they can't be is because of DNS, or Domain Name System. Without going into too much detail, DNS is a database of all domains and subdomains, and values associated to them. A very simple example:

User: "DNS Resolver, which IP does security.stackexchange.com have?"
DNS: "Hello User, I have the following addresses for security.stackexchange.com:"

151.101.1.69
151.101.65.69
151.101.129.69
151.101.193.69

User: "Thank you!"

What if you wanted to make sure that a subdomain would remain secret? Well, you couldn't, because the DNS database would still need to know about it. How else would anyone connect?
How to design it instead
What you actually want to do is secure a subdomain so that only specific people have access to it. One way to do it is a traditional password-based login, which gives you a session and authenticates and authorizes you to access the protected content.
Another, perhaps more elegant way, would be to use Client Certificates. You can generate a Certificate Authority and sign as many Client Certificates as you need. These Certificates would only be valid as long as you want them to be (e.g. 2 weeks, 1 month, 1 year, etc.) and can be revoked whenever necessary.


Can the FiddlerCore library be used for Malware (e.g. MitM attacks)? I've used the excellent Fiddler web debugging software before and have recently come across the Fiddler Core headless .NET library which gives you all the abilities of Fiddler in library form. It's able to sniff and modify HTTP and HTTPS requests and responses. So what's stopping someone from writing malware with this library e.g. for a MitM attack? Was it a good idea to release such a library like this?

I think you may misunderstand the difference between malware and MitM attack tools. The former runs on the victim, the latter runs on the attacker.

If (through other means) you were able to get the victim's HTTP requests routed to you instead of their intended destination, sure. But there are other better tools that both perform the full process, not just the modifying you said was capable. So what's stopping people? Better alternatives.

The morality of the issue is a separate question, part of a an existing heated debate. My opinion? Even the tools that automate the full process are ethical in my opinion. They can/are used for testing and educational purposes. Furthermore, a lack of them will not deter determined attackers from creating their own. Believe me, it's a constant game of catchup and libraries like this aren't fueling the threat. Please though, that debate can occur elsewhere.


Will my hosting provider be able to see my SSL private keys? I'm trying to learn the best way to implement a secure web and e-mail server. Getting SSL certificates is a must, but what happens with the private keys? I've seen that you have to store them on the server but does it imply that my hosting provider will have access to them?

If I would own the hardware, I would simply encrypt the hard drive, but in this cloud/shared/VPS services world it doesn't seem to be possible. Is there a workaround?

Yes, your hosting provider is necessarily able to see your SSL private key, if the fancy takes him to do so. Because that SSL keys is used by his software running on his machines. (This still holds in the case of a hosted virtual machine -- in practice, a malicious host could simply take a snapshot of your running VM and analyse it at his leisure, and you would not know it.)

But note that, for the very same reason, the hosting provider can see all your site contents, i.e. everything that the SSL protects, so the possible exposure of the private key does not substantially change things here.

If you had your own hardware, and the hosting provider simply rented space, power and network bandwidth, then you might hope for some level of privacy and security against the provider. The provider would still have physical access to your hardware (it is located at his premises, not yours) but breaking into a physical machine takes a bit more effort than making a VM snapshot, and, more importantly, is hard to do without leaving physical traces. It really depends on how much the evil hosting provider is intent on doing things discreetly.

For very sensitive machines (e.g. a Certification Authority), you could rent an isolated cage, with padlocks for which you have the key (not the provider), and with in-cage security cameras that continuously send pictures to your remote control facility. That way, you could gain some reasonable assurance that the provider is not trying to physically break into your machines. Of course, this kind of setup tends to be expensive.


What is the security impact of removing scripts tags in a website during page load? I discovered recently, that in chrome, if you write out your scripts in

In this example, the script is removed as soon as the script starts parsing code, and then an interval is set, for a server side random number generator, that constantly returns a different number into the div. It will keep changing every second into infinity, but the script tag is gone.

Onto the point: Does doing this have any pros or cons? Does doing this secure your javascript code in any way? Obviously javascript can be disabled, and then the user could see the code, but I can think of ways around that.

TL;DR:
Does removing a script tag cause any problems? Does it have any drawbacks, or advantages?

Reason for asking: I'm thinking about it and thought I'd ask because I'm working on a project with someone who is anal about security and something they did was at the top of every script tag, have a jquery statement to remove the script (by ID or otherwise). They also never use .js files

I can see no benefits with doing that.

It does not hide your source code. It is still sent to the client, and can easily be read. Besides, the security of your app should not rest on the source code being secret.

I fail to see how it would have any impact on XSS, which is the exploit it seems most related to. XSS is about inserting new scripts, not about using old ones.

But who knows. There might be a corner case out there where this will save you. Just because I can't imagine it, doesn't mean it doesn't exist. But unless you have a clear idea what you are defending against with this, I would not do it. It adds complexity without delivering any clear benefit.


What happens once a vulnerability has been added to a database? (CVE) What happens once a vulnerability has been added to a database? That is, what can we (security/IT professionals) do about it? How do we find out what to do?

Giving it a CVE number (and adding it to a database) is just giving it a common name that can be used to refer to it. By itself, it does nothing.

But by that point, the people who have requested a CVE number be assigned to the vulnerability, have studied it and have prepared recommendations: a patch, a configuration workaround, a recommendation to shut off some software/hardware pending a fix.

What you do as a professional is up to you. You can decide to do nothing, or to apply the patch to all nodes, or to apply the patch in lab and see if it breaks something, or to switch vendors.


Dom based Xss Query - location.hash I was just looking at Dom based xss and wondering if hash value is written to a variable in javascript context can lead to Cross site scripting. The code looks something like this:

<script>
var myhash=window.location.hash;
</script>

Is the above code vulnerable to xss?

XSS only happens when data is output.

In your code sample you are setting the variable myhash to the hash value in the address bar. As your code doesn't contain any sinks and your variable is not output, the above code, in isolation, is not vulnerable.

However, to check for XSS vulnerabilities you need to focus on output to your application rather than input. Here application encompasses both the server-side and client-side.


Reduce Noise when Penetration Testing Recently I participated in a capture the flag competition which was attached with SOC analysis teams monitoring our traffic.

There we were told that many tools were very noisy. Eg Sqlmap which has its full header.

As all of us were new so we weren't able to have the understanding besides doing nmap -sS scans. What else could be less noisy in the process of penetration testing? Or to be more specific what tools and approaches should be preferred to achieve this goal of being least detectable.

You want to increase signal and reduce noise during a pen test?

Great! Here are some things to ponder on:

For answers to the questions you have -- are they already answered somewhere else? For example, does Nmap data from a previous pen test provide an accurate-enough view of the data you would expect today? Would csrecon or similar provide that data? If you are on the local network, does ARP provide it? Can you speed up the ARP discovery (netdiscover, arp-scan, arping, etc) and packet-capture/MITM (e.g., bettercap) techniques or combine them with Nmap via xerosploit?
Can you scan from a trusted or third-party source and note the results before you start your own scan from your own infrastructure? Would scanless or similar provide that perspective? How about using the ipidseq NSE script to pivot towards idlescanning? Or how about using dnmap from tons of sources?
Can you modify Nmap so that it isn't picked up by IDS or blocked by IPS? Can you use a tool such as sniffjoke with a prepared configuration? How about using a different means of scanning that appears more-normal and more-TCP friendly/efficient, such as pbscan? Can you perform both Nmap and MetaSploit simultaneously with metasploitHelper?

If you already have creds, then go poking around with SPN scanning before IP/ICMP/TCP/UDP scanning. Then pivot with tools such as portia, autoDANE, and CrackMapExec.

Sometimes, other protocols are in-use on the network, such as DCE-RPC over Ethernet (as opposed to TCP/IP over Ethernet), but you could build a bridge between the two using Piper or similar. Want to create a backchannel (e.g., C2, covert channel) over ARP? Then test out slarpd/slarpc.

Other times you can create a covert channel in existing protocols, such as by using the phcct tool for TCP/IP protocol hopping or even the Forkitor method over SSH. Hide in plain sight!

How about IPv6? Is it enabled on the network but the blue team isn't looking for it? If you want to see if IPv6 is enabled, grab a local stack and use ip -6 neighbor show, ndp -an, to passively show those networks, or even actively with ping6, e.g., ping6 -c 2 ff02::1 or ping6 -a ag, ping6 -a al, ping6 -N. Run this module from the metasploit-framework --
 auxiliary/scanner/discovery/ipv6_neighbor_router_advertisement

Try these techniques -- https://www.ernw.de/download/newsletter/ERNW_Newsletter_45_PenTesting_Tools_that_Support_IPv6_v.1.1_en.pdf -- to build a bridge between your IPv4 tools and the target IPv6 networks.


What are the advantages in using LUKS + hardware encryption on SSD? I can't see what the advantages might be, but I think this would slow data transfer down while providing no extra protection.

Am I right or am I overlooking something?

Do you trust the hardware encryption on the SSD? If you do then it's fine. If you don't trust it then you're better off with LUKS since not many vendors provide sources for the firmware, so you won't be able to audit it.


Is it okay to use random OpenVPN config files? I notice that there are sites on the internet that offer free VPN services via OpenVPN. Is there any danger in downloading and trying the .ovpn files that they offer for download?

A VPN endpoint is able to read and manipulate all your traffic (a Tor exit node too). Thus using some .ovpn file you just found on the internet means that you offer all your traffic to some unknown party for easy sniffing and manipulation. This includes sniffing passwords, injecting advertisements or injecting malware.

  Is it okay ... ?

If you are used to just use any random free WLAN you can find then there would not be much more of a problem to use some random free VPN endpoint too. I myself prefer it to be more secure but others might prefer that it is free.


Performance of biometric authentication on cell phones as of 2014? How well do the various biometric authentication methods currently perform in regards to precision and recall? Can anyone cite a relevant research article?

Though this is not measured science with hard figures, it is known that the "security performance" of the iPhone fingerprint reader sucks.

Now the question might be the wrong one. A scanner is a scanner; it takes a "picture" of the finger (the iPhone scanner is supposed to use some longer-wave emission which very slightly penetrate into the skin, but that's still a kind of picture). What makes a "good" fingerprint scanner is its resolution, and also whether it will also measure temperature, blood pressure and other such data elements which can be strong indicators of an abnormal situation (fake finger; real finger no longer attached to a living body; finger owner is under heavy stress;...). As a rule, phone readers will offer decent resolution but nothing more.

Yet the most visible "performance" indicators of a fingerprint-reader system are the false negative/positive ratios:

How many good fingers are unduly rejected
How many bad fingers are incorrectly accepted

Beyond the scanner resolution, nothing in the scanner impacts these values. This is all a question of processing of the picture, and that's not done in the reader itself.


WPS. Output messaging translation to "human readable" I'm trying to test the wifi security of my router at home. It has WPS activated. I know WPS should deactivated, I'm only testing...

Reaver is "spitting" a lot of messages, the question is:

What is the meaning of all of that messages?

This is a connection which worked:

[+] Waiting for beacon from XX:XX:XX:...
[+] Associated with XX:XX:XX... (ESSID: WifiTesting)
[+] Trying pin 12345670
[+] Sending EAPOL START request
[+] Received identity request
[+] Sending identity response
[+] Received M1 message
[+] Sending M2 message
[+] Received M3 message
[+] Sending M4 message
[+] Received M5 message
[+] Sending M6 message
[+] Received M7 message
[+] Sending WSC NACK
[+] Sending WSC NACK
[+] Pin cracked in 6 seconds

Why sometimes it loops over error messages? What they mean?

[!] WPS transaction failed (code: 0x02), re-trying last pin
[!] WPS transaction failed (code: 0x03), re-trying last pin
[!] WPS transaction failed (code: 0x04), re-trying last pin

A very short answer could be:

[+] Waiting for beacon from XX:XX:XX:... -> searching for Access Point
[+] Associated with XX:XX:XX:... (ESSID: WifiTesting) -> Connected by radio
[+] Trying pin 12345670 -> Testing PIN
[+] Sending EAPOL START request
[+] Received identity request
[+] Sending identity response
[+] Received M1 message -> Router sends its identity / public key
[+] Sending M2 message -> The client sends its identity / public key
[+] Received M3 message
[+] Sending M4 message
[+] Received M5 message -> Confirmed, PIN1 is correct
[+] Sending M6 message
[+] Received M7 message -> Confirmed, PIN2 is correct
[+] Sending WSC NACK -> The client closes communication because it's finished
[+] Sending WSC NACK
[+] Pin cracked in 7 seconds -> The program says the final complete PIN

For the errors:

[!] WPS transaction failed (code: 0x02), re-trying last pin -> no response from AP, timeout
[!] WPS transaction failed (code: 0x03), re-trying last pin -> incorrect packets order, no right answer, usually on M1 or M3
[!] WPS transaction failed (code: 0x04), re-trying last pin -> AP doesn't want to speak with you :)

To understand this, you must know the PIN is divided in two parts (and the checksum of final digit). Please read this interesting info about how WPS works.
There explain the three logical components involved in WPS, I extracted an image from there:

This is logical, on common home scenarios like yours, router (registrar role) is usually same device as AP.

Hope this helps


What's the point of EMV when only the card is needed to shop online? In many countries, EMV is used to prevent credit and debit cards being cloned. But given that it's possible to perform online transactions using the details printed on the card, how does it add security?

Thats what the VbV and Mastercard SecureCode solutions are for (also known as 3D Secure)

With merchants that implement these solutions, a secondary password, or a OTP is required to complete the transaction. This secondary password\OTP is entered on the banks site and not on the merchants site.

This PDF describes the system (and its limitations)


internal proxy server vs DMZ proxy server What would be reason for placing a proxy server in a Demilitarized Zone (DMZ)?

I understand that a DMZ is a separate network to your internal network (lies inbetween internal network and firewall). I know that you would add a computer which hosts services to the DMZ e.g. web server, to increase security (if your web server gets attacked, then your internal network will be safe). I have seen proxy servers in some business which are placed on the internal network and not the DMZ.

"Proxy server" is an imprecise term.  You have to think about what the proxy server is protecting to determine where it fits on the network.

For example, web proxy servers used to channel outbound web surfing are often placed on internal networks rather than DMZs - their connections are outbound and they pose no additional "threat" to the internal network - an internal user doesn't gain anything by attacking it in order to leverage its access; they're already internal.

On the other hand, application proxy servers which accept traffic initiated from the Internet and heading inbound are usually placed in a DMZ.  The assumption is that a connection initiated by an attacker could somehow breach the software on the proxy - a buffer overflow, for example - and that once that happens the attacker can use the proxy as a hopping-off point.  Such a proxy is kept in the DMZ to limit the damage a successful breach of that first layer can cause.


Malware known for stealing private ssh keys The ssh private key file, stored under ~/.ssh/id_rsa in many *nix distros, is typically owned by the user, allowing any program invoked by that user to read the file, and perhaps upload it to a remote server.

Is this accurate? Are there examples of malware known to have done this? How common is this?

Has been done, you can find a few reports online: Careto and Windigo. That said, it isn't your classical "let's own this machine and then use it for DDoS" kind of malware - people who operate the above are interested in long term peristence.


Transfer of packets in a VPN connection I am trying to figure out how a computer communicates with a website when using a VPN connection (specifically, how packets are transferred) as compared to a computer that's not using a VPN connection.

If my computer is not using a VPN then I know that the TCP protocol will be used to exchange packets between my computer and the website I am trying to visit.

So what happens when I use a VPN connection? How are the packets transferred between a website and the computer that's using a VPN? And what protocols are used?

How are the packets transferred between a website and the computer that's using a VPN?

A VPN is just another connection. Your computer makes a connection to the VPN server, and the VPN server makes a connection to the website you want to access.

From the website point of view, your VPN server is making the request. If you are using a popular VPN server, that means that your request and a vast number of another requests will appear to come from that single IP address.

The VPN client usually creates a network interface with a private network range, and add a default route pointing to that interface. As soon as your browser sends the request, the packets will go to that interface and will be intercepted by the VPN client, encrypted, encapsulated and sent to the VPN Server using your default internet connection.

On the VPN server, the packets coming from the VPN client will be processed, decrypted, and the server will establish a connection to the webserver you wanted to contact, changing the TCP source to point at him, not at you. As soon as the webserver sends the response, the same process will occur: the server will encrypt and encapsulate the response, send to you, your VPN client will decrypt the packet and send the result to your browser.

  And what protocols are used?

The protocol used by the VPN does not matter much. The main issue is how secure is the encryption of the traffic. PPTP and L2TP are not considered very secure. OpenVPN can be very secure, depending on the configuration options. IpSec can be very secure too.

The protocol used will depend on the VPN server type you are using. If you are using OpenVPN, the protocol will be TLS encapsulated on TCP or UDP. PPTP will use a GRE tunnel over TCP. IpSec will encrypt the IP packet.


Is this way of client-side SSL secure enough, to keep hackers away from my web app? I'm wonderying if the following steps are enough to protect my cloud service, in a meaning that non-authorized users can not play with my web app?

In other words, is it possible to bypass this kind of protection?

So the steps are:

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt

Create the Client Key and CSR

Organization & Common Name = Person name

openssl genrsa -des3 -out client.key 4096
openssl req -new -key client.key -out client.csr
# self-signed
openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out client.crt

Convert Client Key to PKCS

So that it may be installed in most browsers.

openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12

Convert Client Key to (combined) PEM

Combines client.crt and client.key into a single PEM file for programs using openssl.

openssl pkcs12 -in client.p12 -out client.pem -clcerts

Install Client Key on client device (OS or browser)

Use client.p12. Actual instructions vary.
Install CA cert on nginx

So that the Web server knows to ask for (and validate) a user's Client Key against the internal CA certificate.

ssl_client_certificate /path/to/ca.crt;
ssl_verify_client optional; # or `on` if you require client key

https://gist.github.com/mtigas/952344#create-a-certificate-authority-root-which-represents-this-server

My virtual host look like this:

SSLVerifyClient require
SSLVerifyDepth 1
SSLCACertificateFile "cert/ca.crt"

Any sugesstions?

Yes, this is enough secure.

I would suggest checking for:

perl: $ENV{'SSL_CLIENT_M_SERIAL'}

in your web app.
This means you will have to have a database of valid users, and possibly which rights they have in the web application.

Doing this instead of doing revocations the "PKI way" is better, since then you first, does not need to manage a CRL, and also, its easier to put in what users are really allowed to do, so you can have users who have different rights, for example some users might be admins, some might be moderators, and some just regular users, and some are limited users.

So first, their certificate must be signed by the client CA, but also, their certificate serial needs to be in database as valid. Make sure and be careful so you don't generate multiple user certificates with the same serial. The serial can also then be used as a numeric UserID in modules that require a numeric UserID.


If an attacker is intercepting all of my traffic, will he be able to listen on my VPN session? If I am a remote user, connecting to my firm from home, using IPSec VPN tunnel or through SSL, and an attacker is intercepting all of my traffic, will he be able to watch my VPN session on the clear (he is there before the IKE phases and all of the exchanges). And will it differ on SSL and IPSec?

[MY Firm]--->[My Firm's Firewall]--->[Internet]--->[Attacker]<---[Me]

The cryptography involved in the VPN is designed precisely to keep your data safe even in the situation of an attacker who can intercept all traffic; the best an attacker could do in that situation is to disrupt traffic (namely, cutting off the wires).

Both SSL, and IPsec-with-IKE, use cryptography in proper ways, so there should be no qualitative difference between the two.

A few points are noteworthy:

Both SSL and IPsec (in the "handshake" and "IKE", respectively) rely on certificates to make sure that they use the "right" public key (the key of the peer). So the safety of the certification authority that you trust is paramount (these correspond to the "root certificates" aka "trust anchors"). If a CA is corrupted by the attacker, then he can emit fake certificates and, through interception, build a successful Man-in-the-Middle attack.
The crypto is sound, but you still have to deal with implementations. Implementations can have exploitable bugs, leading to leak of confidential data or even downright buffer overflows and the like. Most SSL and IPsec implementations have suffered from this. The usual rules of keeping the systems fully up-to-date and patched apply here.
Side-channel attacks are attacks which try to take advantage of data unwillingly leaked by implementations; in the case of a VPN over the Internet, the main leakage channel would be time: the attacker might try to deduce things on the involved cryptographic keys based on the average time taken to perform some computations. SSL is the protocol which has been most often used to demonstrate side-channel attacks, so good implementations of SSL are now aware of what they must do to avoid such leakage. While side-channel attacks may apply to both SSL and IPsec, I would personally trust slightly more a random SSL implementation than a random IPsec implementation to have included the necessary protections, just because of that tradition of using SSL as main example.
In all cases, the attacker will be able to observe the amount of data exchanged over the VPN. That observation may be a bit blurred because of padding, depending on the used symmetric cipher. Nevertheless, the attacker will be able to deduce things such as the exact time at which you read your emails, and also the individual size of each email, and other similar information. This is traffic analysis. This may or may not be a problem in your particular situation.
If the mighty attacker is really after you, specifically, he will steal your laptop and/or break into your house and plant a keylogger on it, at which point the VPN protection disappears.


USB device security in Windows Am I really understanding things correctly if I claim that:

If a USB stick/device is inserted into a PC running Windows, currently in "lock screen" mode (that is, somebody has pressed WinKey + L), it will auto-mount it behind the scenes?
If a USB stick/device is inserted into a PC running Windows, currently NOT in "lock screen" mode, it will auto-mount it by default?
In both cases above, will it ever run any kind of executable found on it by default? (Like which I believe used to be the case for setup.exe on CD-ROMs back in the day.)
Regardless of all of the above, will Windows ever auto-install DRIVERS found on the device itself when inserted into the PC (with or without lock screen)? Or is just the "device id" grabbed from the stick/device and then the appropriate drivers are downloaded from Microsoft's secure, curated servers based on the device id?
Why exactly are "drivers" needed whatsoever? Isn't it using the USB standard? And also the "mass storage" standard? I don't understand why it would ever need special "drivers" for a standard device...?
Is the idea that sticking a USB stick/device into a PC is insecure in itself complete nonsense? Is not the truth that the user would have to actively select "Yes, please install the drivers from this random unknown device" or "Yes, please run this untrusted EXE found on this stick you just inserted and which I auto-mounted for you but would never run anything on without your active consent"? I get the same feeling as when people claim to get "hacked" constantly, but then it turns out they ran some binary e-mail attachment or clicked a big red box saying: "WARNING! Do you really want to run this EXE from sketchy-hack-toolz-4-u.example?"... but nothing would surprise me at this point, frankly.

I wonder this both for the current Windows 10 and also for all previous versions of Windows.

If a USB stick/device is inserted into a PC running Windows,
currently in "lock screen" mode (that is, somebody has pressed
WinKey + L), it will auto-mount it behind the scenes?

Yes it does! I had originally said "No" but it dawned on me that I had not actually verified that so I tested it this morning. It turns out that it does indeed mount even though the screen is locked. I also tried it on a screen locked Linux machine and found that the physical device can be accessed but the partition is not actually mounted.

This is how I tested:

I took an absolutely clean (verified via Linux) thumb drive formatted in Fat32 and plugged it into a screen locked Windows 10 machine and waited several seconds before unplugging it. Then I examined the thumb drive on my Linux machine.

Windows (and Macs) default write hidden identifiers to thumb drives when plugged in if they don't already have one. Sure enough, the previously clean thumb drive now had the hidden Windows identifiers on it. This showed that Windows not only mounted it but performed both a read and write to the thumb drive.

If a USB stick/device is inserted into a PC running Windows,
currently NOT in "lock screen" mode, it will auto-mount it by
default?

Yes! It will also enable USB devices that are not block storage devices.

In both cases above, will it ever run any kind of executable found
on it by default? (Like which I believe used to be the case for
setup.exe on CD-ROMs back in the day.)

No, under normal configuration now days it will not auto run a file from a block storage device or a USB connected CD. However Human Interface Devices (HID) such as a keyboard are enabled.

Previous versions of Windows did auto run files from CD's but never thumb drives, however manufacturers produced U3 thumb drives that were actually two devices in one, mass storage and a faux CD device that would auto-run files, so it looked like the thumb drive was auto running.

There are USB devices that look like thumb drives but are not. The classic example is a Rubber Ducky. It looks like a thumb drive but is actually a pre-programmed keyboard that can auto type any command that you could from a keyboard, and it auto runs upon being plugged in. There are similar devices, such as a Bash Bunny, that can act as multiple devices at once, becoming both a mass storage thumb drive and a programmed keyboard, allowing it to store the results of the commands issued as a keyboard.

All of the similar devices I'm familiar with are designed to function under USB-2, which does not support DMA bus mastering. Firewire supported bus mastering which made it possible for a master device to directly access computer memory on some machines that failed to securely initialize their their DMA control maps. USB-3 supports DMA, but I have no idea if something similar to Firewire is possible.


GOST cipher test vectors Does anyone know where to find test vectors for the GOST cipher? I have been looking around for quite some time, and have been unable to find anything. I know that the sboxes are dependent on the implementation, so hopefully the test vectors you know of has them too. the rfcs dont have anything

i have found this, but there is no way to tell what sbox they used, short of reverse engineering it, so that website is not very helpful

The official specifications seem to lack of test vectors but there are libraries including some:

Crypto++ Library http://www.cryptopp.com/
Bouncycastle Library http://www.bouncycastle.org/ (in class org.bouncycastle.jce.provider.test.GOST28147Test)

Hope this helps.


What does "sandboxing" mean for Chrome OS? I read about Chrome OS in the security section, and I was wondering what the meaning of "sandboxing" that they keep mentioning is. Is this sandboxing like Selinux or Apparmor ?

Google Chrome OS is a Linux-based operating system on which Chrome is the browser and focuses on  the use of the online applications that belong to Google (Google Drive, Youtube ...). It is the direct competetor with Windows OS of Microsoft.
Centos OS is also  a Linux-based operating system but unlike Chrome OS which runs on mobiles, Centos OS is widely used for servers.
Sandboxing is a concept that you see frequently in  Chrome Os because it is the commercial version of the free and open source project Chromium OS which relies on sandboxing mechanism. Sandboxing, in very simple terms is related to security, especially to prevent from malware effects on the OS. You can for example visit a website with the browser of Chromium OS: if the URL hosts a JavaScript malware (drive-by download attack), there is no chance for the malware to affect your OS given the principle of sandboxing notion which is better explained here:

  The sandbox is a C++ library that allows the creation of sandboxed
  processes — processes that execute within a very restrictive
  environment. The only resources sandboxed processes can freely use are
  CPU cycles and memory. For example, sandboxes processes cannot write
  to disk or display their own windows. What exactly they can do is
  controlled by an explicit policy. Chromium renderers are sandboxed
  processes.

AppArmor and Selinux have the same goals as the sandboxing notion, but the principle of their functionment is different. Mainly sandboxing does not allow its security boundaries to be breached unlike the 2 other Linux softwares.


Current best practices to prevent persistent XSS attacks I have a text field that allows the user to type whatever he/she wants. After saving, the results are later displayed on the screen to potentially many people.

XSS seems a bit like black magic to me, so I am wondering what the current best practices are for handling this situation (from specific ways to sanitize input to specific ways to encode html to display)?

Since you want current best practices and the latest answer here is August 2012, I thought I might as well weigh in and update this.
Best practises to prevent any type of XSS attack (persistent, reflected, DOM, whatever).

Strictly validate all input. For example, if you're asking for a UK postcode ensure that only letters, numbers and the space character is allowed. Do this server-side and if validation fails, display a message to the user so that they can correct their input. Do this for all variables outside of your control, including query string, POST data, headers and cookies.
Add yourself some security headers. Namely

X-XSS-Protection: 1; mode=block to activate reflective XSS browser protection into blocking mode instead of filtering mode. Blocking mode stops attacks like this. Edit 2021-01-28: This header is now deprecated due to browsers like Chrome discontinuing their inclusion of XSS auditors.
X-Content-Type-Options: nosniff to prevent JavaScript being inserted into images and other content types.
Content-Security-Policy: with strict script-src and style-src's at least. Do not allow unsafe-inline or unsafe-eval. This is the daddy of headers for killing off XSS.

Follow the rules in the OWASP XSS (Cross Site Scripting) Prevention Cheat Sheet when outputting values, however for rule #3 I'd do the following instead:

Use HTML data attributes to output anything dynamic on the page.
e.g. <body data-foo="@foo" />
Where @foo will output an HTML encoded version of the variable. e.g. " /> would give <body data-foo="&quot; &#x2F;&gt;" />
Grab these values out using JQuery or JavaScript: var foo = $("body").data("foo");
This way you don't need to worry about any double encoding, unless your JavaScript later inserts as HTML, however things are still simpler as you deal with the encoding there too instead of mixing it all together.
Use a function like below to HTML encode if you're using document.write, otherwise you could introduce a vulnerability. Ideally though use textContent or JQuery's text() and attr() functions.

Tackle these in reverse order. Concentrate on #3 as this is the primary mitigation for XSS, #2 tells the browser not to execute anything that slips through and #1 is a good defence-in-depth measure (if special characters can't get in, they can't get out). However, #1 is weaker because not all fields can be strictly validated and it can impair functionality (imagine Stack Exchange without the ability to allow "<script>" as an input).

function escapeHtml(str) {
    return String(str)
        .replace(/&/g, "&amp;")
        .replace(/</g, "&lt;")
        .replace(/>/g, "&gt;")
        .replace(/"/g, "&quot;")
        .replace(/'/g, "&#039;")
        .replace(/\//g, "&#x2F;")
}