How can I challenge an attacker to reliably identify their hardware? I distribute a client application where I would like to identify a user's hardware specifications when they begin interacting with my server. I am specifically interested in identifying the user's GPU make and model, but I would appreciate hearing techniques applicable to other facets of the hardware such as CPU or RAM.

Users are aware that I seek to collect this information and have consented to its collection. Currently, the client is self-reporting what their hardware specifications are to my server. Most of my users are honest, but we can consider some of them as attackers seeking to lie about their hardware specifications.

My first thought is that I could issue a challenge to the client from the server that requires them to use their GPU in a manner such that I could benchmark it based on the response time, similarly to how GPU mining works. My concern with this approach is that I might not be able to achieve enough granularity to distinguish between GPUs with similar performance.

I know that the attacker in this case has physical hardware access and as such I am in fact hosed as far as perfect identification is concerned. As an example for the intents of this question, if the attacker has the capacity to solve my challenge such that I believe they are using an NVIDIA 2080 Ti when they are in fact using some specialized hardware of equivalent strength, then that is acceptable.

Any tools, techniques, or existing software options that could help me achieve this would be much appreciated. Thank you!

You may be overthinking the problem.

If you distribute a client to them, you can just query the OS directly. The best route is likely to ask users for their specs and query silently; they are unlikely to put forth the (rather substantial) effort to fabricate data if they don't know you are collecting it.

On Windows, you could query the Win32_VideoController class via WMI to identify their hardware. E.g.,

wmic PATH Win32_VideoController GET *

You could specify Name, PnPDeviceID, or DeviceID instead of * if you want to minimize the amount of data you collect.

Note that while this is a command line utility, WMI is exposed for application use; you do not need to rely on the native utility if you'd rather query directly.

This data is readable by locally-executed applications by default, and WMI permissions are rarely hardened due to their widespread use by regular applications as well as 3rd-party management tools.


Speedtest and Dnsleaktest DONT work on http or SSL proxies i am trying, whats going on? Try it yourself. Go to https://www.zalmos.com or https://www.proxfree.com on your Chrome or Firefox browser, and see if you can run a speedtest, or if you can run a standard DNS leak test.
Is there some security issue in my browser implementation that is making the sites simply deny me a speedtest over an ssl proxy, or is some error occurring somewhere else that is making these tests fail?
If anyone else can run the test and explain if it is working for them, i would really appreciate it, thank you.

Edit: forgot to add the websites for reference:
beta.speedtest.net is the one for speedtest
www.dnsleaktest.com is the one for checking dns leaks.

These are not real proxies but just sites where you can enter a URL and which then tries to get the requested site for you and display it. And they try to rewrite links in the result so that future clicks stay within the proxy. This will fail in many cases if links are created dynamically using JavaScript which is probably the case here. Also, if the target site creates cookies within a HTTP response and queries these cookies within JavaScript it will not see the expected cookies because these got rewritten by the proxy.

In other words: these proxy sites modify the content in a way which might affect the functionality of the content. This might be a problem with some sites and might be no problem with other sites. A real proxy instead gets configured inside the browser or OS so that the browser itself knows that it should use this proxy for all requests. In this case no content rewriting is needed to keep using the proxy and thus breaking the functionality due to rewriting will not happen.

Please note also that using of such proxy sites creates new security problems: since all sites visited using such proxy site are loaded within the same domain (i.e. proxy.zalmos.com) the same origin policy will no longer restrict access between different sites, i.e. original cross-site activity will now be  same-site activity. This makes it possible to read and modify the content of different sites which might result in stealing sensitive data or misuse of your identity. All these problems do not happen in case a real (browser configured) proxy is used.


Is it risky to mount tmpfs volumes in Docker? Sometimes I need to run I/O intensive operations in memory. The tmpfs facility works really well for this, but I was wondering if there are any big risks of using tmpfs mounts inside a container. Can it be used to compromise the host?

I don't think so, as tmpfs is a mature driver, and unless a strange bug appears (unlikely but possible), it's as risky as mounting an ext3 filesystem, or any network card, or loading any other driver.


What cipher suites do Mail Clients (Thunderbird, Outlook, ...) support? This question is related to this Super User question.

What cipher suites do Mail Clients (Thunderbird, Outlook, ...) support?

I know and appreciate the service of SSLLabs where I can see the browsers' capabilities in regard to cipher suites. But also mail clients negotiate TLS connections when loading content via https (e.g. images in newsletters).
But I was not able to plug the correct search terms into Google to see which mail client supports which protocol version and which cipher suites.

Thunderbird uses the NSS library like Firefox, so look at the Firefox report for the ciphers. Similar Outlook uses SChannel like IE/Edge so look at these reports. Apart from that you can simply find out what a specific implementation uses by running a packet capture and then look at the cipher suites offered by the client in the first record of the TLS handshake (i.e. ClientHello).


Prove a client sent a request - voting system Let's say I created a voting system where each voter would use an app and vote on a candidate. The app would send the vote to a server. The server would store the vote on a DB with the request IP.

Is it possible to implement something to guarantee in a future audit/forensic work, my DB represents real requests and not something was forged?

My idea is that my DB should be a proof that I had n votes and they are real votes, not something I created myself.

Each IP would allow a single vote
I won't store personal information on DB, the IP address and related data would be the only thing to store

Your specs begin with:

  Each IP would allow a single vote

Do not go further. If you can control a router for example in a corporate environment, you can:

either make all internal machines present externally the same address (and only one user in the organization could submit a valid vote)
either allow the router admin to submit a valid vote by faking any of the addresses of their organization

And as a single person, I currently use:

a private computer
a corporate computer (only presents the IP address of the corporate firewall)
a private smartphone
a corporate smartphone

Does it mean that I can submit 3 different votes or 4 in nobody in my organization has already submitted one from its corporate computer?

Above was about why I think that your idea is wrong. Following part in my opinion of how to build a voting system.

I just think that I am not clever enough to invent from scratch what others have built upon centuries, so I will just try to translate in IT world how an ordinary election work.

Rule 1: all voters are registered, and their identity must be controlled before a vote is accepted as valid - stop imagining anonymous votes for a serious election.
Rule 2: the content of the vote must be kept secret - nobody except the voter himself should be able to know what the vote contained
Rule 3: it is possible to know who participated to a vote - at least to control that dead people did not vote (it used to be common in some places)
Rule 4: the observance of the previous rules can be controlled by people representing the various candidates (a candidate can be here a human being, a full staff, or a simple proposal)

Those 4 rules are observed for physical voting, as well as post voting. For the latter, an inner enveloppe (no possible identification of it) contains the vote, and an outer one carries the name and manual sign of the voter. The outer enveloppes are opened only by the people in charge of controlling the validity of the vote.

In IT world it would give:

each voter should be informed of the how to vote
the system should be able to identify each voter. The up to date way would be a certificate on a smartcard, but depending on the importance/cost ratio a username+password could be considered
the voting system should keep a track of which user voted and when - this is the voting register
the voting system should increment counters and not store any individual votes
it must not be possible to know at what time the counter changed value to prevent correlation with the time at which someone voted (may impact the underlying counter store). Only the final value must be kept.
the counters should not be accessible to anybody before the end of the election, unless it can be proved that it does not allow to know the recent votes by polling the counters on short intervals
the system should be audited before and after the vote by the candidates or people representing them


Difference between linux hash sum utilities and online string to hash utilities When I go online and calculate a hash from a string on some generator website, no matter the algorithm or the website, it is always a different output than if I do echo "password" | sha256sum (or insert *sum there for corresponding algorithm). What is the difference between the two?

Very possibly, the newline.

Try this instead:

$ echo -n "password" | sha256sum

The -n argument to echo tells it not to print a newline.

As you can see, this changes the hash:

$ echo "password" | sha256sum
6b3a55e0261b0304143f805a24924d0c1c44524821305f31d9277843b8a10f4e  -
$ echo -n "password" | sha256sum
5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8  -
$


What are a JSON rest api's responsibilities to prevent XSS? I'm building a rest API that serves exclusively JSON. It might one day be consumed by a browser based app. Is there anything I should do on my end to prevent XSS attacks?

Its up to the data consumer to sanitize data so perhaps you supply a document of potential risks that come from using your API.

For example where does your API get its data? Are you sanitizing the data? Is that a risk the consumer might need to know and how would they mitigate the risk.


The security of an SMB port exposed to the internet I have installed a Windows machine with update 1909 (build 18363.720 (March 2020) (On which I try to find vulnerabilities with nmap), which includes smb 3.1.1 with the latest fixed bugs. I created a shared folder on this machine and made the various configurations on the firewall so that the shared folder can be accessed from the outside (private, public and domain firewall enabled and let connections access the share if the password is given). Of course with a password complex enough not to be cracked easily.
I then opened the smb port 445 (for smb 3) on my router, which I redirect to the local ip of this machine only.
(I also created a dyndns so that the ip updates of my router are updated automatically.)
So I can access my share from anywhere.
I can already see people coming from afar saying that it's very dangerous to open ports directly on the internet, and they will be right (VPN is better, obviously). But I wouldn't like to have to have a debate about VPN.
"Is it secure enough for a small home system" to reasonably imagine sharing files, media and vacation pictures with colleagues (by being explaining to them that they just have to create a network shortcut on the network path of my dyndns), without having to worry about getting hacked in 3 minutes? Of course I will patch my system  each time I find it necessary (2 or 3 times a year). It's also an easier way to set up file-sharing without having to install third-party tools like with NAS Synology etc.
Here are my target machine firewall configs associated to port 445

and here we see that domain, public and private are active

and this is what is displayed when someone tries to connect to my share from the internet (with ubuntu) with a wrong password

I did some tests with nmap in order to find possible flaws in the port I opened. Here are the results with vulscan and nmap-vulner.
Here Nmap-Vulner

Here vulscan:

Are there other tools which i can test to check the security of the smb server?
Would it be reasonable to buy extra hardware in order to enhance security?
Otherwise, should I just shut down my smb port and install a VPN with a NAS Synology or other hardware?

All your questions have nothing to do with Unix but I guess you want an input from experts so here it goes.

It's secure as long as your password is complex enough and your Windows system is patched and rebooted immediately as soon as Microsoft releases a new Windows update and that happens each month. Updating your system 3-4 times a year like you said is a very bad idea.

There are security scanners like XSpider. nmap is mostly used for open ports and services discovery - it's not a security scanner.

Extra hardware is unlikely to help you if you have CIFS ports exposed to the entire Internet. What could help you is putting your Windows host in a DMZ or in a VM to minimize the damage to other hosts in your LAN in case this particular PC gets hacked into.


Is the security of a VPN client on a Virtual Machine decreased? It's well known that VPN clients might leak their true IP, due to applications like Skype or WebRTC clients or who knows. Moreover, services like Google keep complaining that I connected from an "unknown device" and they lock even simplest services (e.g., IMAP) until manual confirmation, just because I appear to have switched to an overseas IP.

So, I'm thinking of a different setting: for private/sensitive activities, I'll use a Linux system on top of VirtualBox, which has a VPN client on it. The Linux box will have the bare minimum, won't use my regular accounts, won't use rubbish browsers like Chrome, etc. For all the rest, which is not critical and I don't mind much if they track me and send me ads based on what I browsed on Amazon, I'll keep using the host, without VPN and with more basic protection against spies (e.g., firewall, anti-spyware/malware software, using Linux and not crappy Windows).

Question is: will this setting decrease the security of that VM/VPN client? I mean, compared to a physical machine connecting the wifi or the home router directly? Is there some danger that they track the host, e.g., by inspecting TCP/IP data? Can they do other tricks to associate the VPN connection to the host, or some other device in the same home network (e.g., smartphones/tablets, which of course aren't on the VPN either)?

It is very hard to say whether or not using a VM is more secure. As you are referring to technicalities, please take a look at this page written by the maintainers of Tails (a well known Linux distribution for anonymity via TOR). These warnings apply to every VM, not only Tails.

On one hand utilizing compartmentalization can add security, however this added layer also means an extra attack vector. If you are sloppy with running patches, might have downloaded some software from weird places, having your little brother using your PC as well, etc, these things might make you vulnerable, using a VM or not. And even worse, it might have you end up with not one but two compromised systems.

If you think you can be a good 'host' for your VM, go for it as I think the risks are low (now that I made you aware of those). If you require even more security, then you probably better of using a dedicated computer for these events.


If a mobile app pins the Root Authority Certificate of a server and verifies its hostname, is it possible an attack via DNS-poisoning? I have some questions about certificate pinning.
Supposing that a mobile application has pinned only the root CA, it should be possible to an attacker to redirect in some way the victim to a malicious website with the same Root CA. Am I wrong?
What happens, instead, if an app pins the Root CA but verifies the hostname of the server which the app is connecting to?
If the attacker owns a website under the same Root CA, can he poison DNS-cache and let the app connect to his website or there are security mechanisms which prevent such behaviour?
Thanks in advance!

... it should be possible to an attacker to redirect in some way the victim to a malicious website with the same Root CA.

This will only be possible if the client blindly believes any certificate signed by this CA. This level of trust should of course not be done if the root CA might also issue certificates to an attacker, as is the case with common public CA. That's why a TLS client is supposed to verify if the subject of the certificate matches the expectation too, i.e. if the specified target hostname or IP is covered by the certificate.

... pins the Root CA but verifies the hostname of the server which the app is connecting to

That's what a properly written app will do.

If the attacker owns a website under the same Root CA, can he poison DNS-cache and let the app connect to his website or there are security mechanisms which prevent such behaviour?

The client should check the subject of the certificate with the intended hostname or IP. While DNS lookup of a domain might result an alias (CNAME) this will not change the intended hostname, but is only an internal step in getting the IP address. This means DNS poisoning against the client cannot be used to change the intended domain and therefore the attacker needs to have a certificate for the intended domain - which the CA should not issue since the attacker cannot proof to own it.
But, DNS poisoning against the CA might be use to fake the proof of ownership in domain validated certificates. In this case the attacker could get a valid certificate for the target domain which then can be used against the client, for example in a DNS poisoning attack against the client.


How can this website crack MD5 hashes? I have heard that hashing, such as MD5, is one-way and cannot be cracked. But there are some websites that can decrypt hash, like www.md5hashing.net and some scripts like findmyhash.py. I tested some hash and it was cracked successfully.
Why can it do so?

Hashes can be cracked using brute forcing. That means that you test hashing every possible input until you find one that generates the right output. To stop this a hash function used for password storage or key derivation needs to be deliberately slow (so that testing a lot of inputs take a very long time).

A site like the one you mention can also store a big list of known pairs of common inputs and outputs. Therefore they don't need to do a brute force every time someone sends them a hash to crack - they just need to look it up in the table. To stop this you use a salt (so that even a common password gets an unique hash).

You will note that they do not know the value of all hashes, just common ones. An example:

5f4dcc3b5aa765d61d8327deb882cf99 is correctly reversed to password, because that is in their database.
039c004d00c02a193144e96b3e8aa4ba can not be reversed to the random string tUGPP*yq24p+EgpQ that I just generated, because they can not fit all billions of possible random strings into their database.

So how do you protect yourself against sites like this? Use a slow hashing algorithm and a salt.


Blocking ipv6 packets with firewall, if using an ipv4 router A router doesn't support ipv6. There is a machine connected to the router, that is assigned an ipv4 address by the router. The machine uses firewall software.

Setting up the machine's firewall, all incoming traffic to the machine needs to be blocked except for one service. Is it enough for the machine's firewall to accept / reject ipv4 packets only, or should it also be set up to accept/reject ipv6 packets?

The other answers are misleading, so here is my take:

Yes, you should block IPv6 on the machines firewall or disable IPv6 on the machine altogether.

Here is why:

While the router may not support IPv6 (at this moment) and thus no IPv6 traffic is routed from external devices, the router does act as a Level 2 switch as well, so internally - because IPv6 works fine without a DHCP server - IPv6 traffic might work fine.

Now, since IPv6 is the only way to access some services today, one of your users might establish a IPv6 tunnel through IPv4 (which is possible and not very hard to do) to use this services.

If now the tunnel and/or the machine is badly configured, if may act as an IPv6 router through the IPv4 connection, turning the tides on the whole „IPv6 packets cannot reach that machine“.

It is also worth noting that even leaving the ports open to internal users might pose a security risk. This usually applies to people now knowing about IPv6 being enabled and defining firewall rules for IPv4 and think they are done, until whatever malware (android? Those are basically unpatched carriers of malware to begin with) gains access to your network.


How do you shun an IP automatically based on the number of current connections? If I have a single IP that's trying a Denial of Service attack, how can I automatically have it banned/shunned?  I go in and manually put it in a group of banned IP addresses, but I'd like for it to be done automatically, maybe if someone has 30 simultaneous connections.  Cisco ASA.

I believe this would be possible using the ASAs threat-detection commands. For example using threat-detection you could setup scanning-threat and then use the shun command.

One implementation would be to create an object on the ASA that acts as a whitelist and then using threat-detection scanning-threat shun exception insert whitelist group object name you would be able to shun anything that is NOT in that whitelist. Please be aware that is not the exact syntax you will have to use the docs & ? to find the exact commands however its mostly the correct syntax.

https://www.cisco.com/c/en/us/support/docs/security/asa-5500-x-series-next-generation-firewalls/113685-asa-threat-detection.html


How can I unlock drive without the password or recovery key of Bitlocker? Is it possible to unlock my drive without the password or recovery key of Bitlocker? If so, how? I tried Elcomsoft forensic software but I'm not able to decrypt it without using the password or recovery key.

Simply put: You can't

Bitlocker uses AES-XTS 128 or AES-XTS 256.
As long as the drive is not mounted and unlocked (whereas you could just disable bitlocker or export the password/recovery key) there is no way of bypassung this.


Following strategy using DDoS mitigation service - UDP bandwith exhaustion attack from spoofed IPs I need to defend against receiving a massive spam of UDP packets from random spoofed IP addresses. I would make it this way:

In my protocol, every UDP packet contains username and password.
Firewall(3rd party) would have updatable list of users(name and password).
It would check if packet contains valid data, if yes then it would pass it to my server, if not, then my bandwidth would be not affected.

My question is, do you know any service that would allow such solution?

Whether you use one, two or a dozen servers to handle the task, the bandwidth between the client(s) and the server(s) will remain the same.  The only part you can control is the way your server responds to invalid requests or to massive amounts of requests.

One way it could be implemented is by using fail2ban and a firewall on the server.  This way your UDP service could log risky cases that would eventually trigger fail2ban rules that you'd have to define.  It would be a good idea to quickly block repeating requests for the same IP and increase ban time when they become recidivists.

It is very important for you to note that this type of attack is usually targeting the spoofed IP, not the UDP service itself which only suffers a much weaker side-effect when properly secured.

UDP requests are usually much smaller than their response, and handling big requests would also make it harder to perpetrate an efficient attack.


Techniques for enumerating enabled apache modules A common issue noted by security testers is that the Apache web server is reporting a version in headers which is older than the latest available one.

This usually leads to CVE listings detailing the vulnerabilities present in that version of the product, and a typical challenge for black-box testers is establishing what modules are enabled on the servers, as the vulnerabilities are commonly present in modules and not the core Apache server.

So the question is, are there any general techniques which can be used on a black-box security test to identify/enumerate enabled modules on a running Apache server?

are there any general techniques which can be used on a black-box security test to identify/enumerate enabled modules on a running Apache server?

tl;dr: you cannot detect all installed/enabled modules, and you need to analyze headers manually, if you dont want to X-MISS something

we use a custom tool to investigate all server-headers; this tool, written in python, simulates a browser-request and displays everything send back from the server (examples below)

beside apache/module-version also X-Powered-by is interesting, because, if not filtered correctly, it might give you a hint on application-servers (if any) or php-version used (google: php easteregg). rack (as in ruby-on-rails), for example, leaks a lot of headers, showing that rails is used (X-Rack-*)

oh, and header-analysis is done manually; i dont know of any tool that might work
like (if header X then alert Y); it's just experience

  edit 1

detecting installed modules, based on headers

apache-only, since nginx only displays nginx or ǹginx/VERSION
please note: installed modules might also be displayed on default-error-pages, like the following extract from a html-page of a default 404-error-page, when ServerSignature On is set:
<address>Apache/2.2.22 (Debian) mod_fcgid/2.3.6 PHP/5.4.4-14+deb7u8 mod_python/3.3.1 Python/2.7.3 Server at localhost Port 80</address>
if apache displays the installed/enabled modules depends on the setting of a config-option, called ServerTokens; from the config:

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of:  Full | OS | Minimal | Minor | Major | Prod
# where Full conveys the most information, and Prod the least.

# examples
# ServerTokens Full
Server: Apache/2.2.22 (Debian) mod_fcgid/2.3.6 PHP/5.4.4-14+deb7u8 mod_python/3.3.1 Python/2.7.3

# examples
# ServerTokens OS
Server: Apache/2.2.22 (Debian)

# examples
# ServerTokens Minimal
Server: Apache/2.2.22

# examples
# ServerTokens Minor
Server: Apache/2.2

# examples
# ServerTokens Major
Server: Apache/2

# examples
# ServerTokens Prod
Server: Apache

additionally, not all loaded modules are displayed with the server-header (compare SeverTokens Full vs the following extract from apache2ctl  -S -M from the same server

Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 fcgid_module (shared)
 headers_module (shared)
 mime_module (shared)
 evasive20_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 python_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared)
Syntax OK

examples, full headers

google-headers

[+] sending now:

GET / HTTP/1.1
Host: www.google.com
Connection: close
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.7.3) Gecko/20040910

[+] lines ins answer: 17
[+] www.google.com :: 173.194.69.104

HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.de/?gfe_rd=cr&ei=GzpBU8fYBIGKtQaAo4GYCA
Content-Length: 258
Date: Sun, 06 Apr 2014 11:27:23 GMT
Server: GFE/2.0
Alternate-Protocol: 80:quic
Connection: close

server-headers, leaking php-version, vulnerable to php easter egg

[+] sending now:

GET / HTTP/1.1
Host: www.cs.utexas.edu
Connection: close
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204

> ssl-info
('128.83.120.139', 443)
('DHE-RSA-AES256-SHA', 'TLSv1/SSLv3', 256)
> do you want to check with openssl? [y|N] :

[+] lines ins answer: 14
[+] www.cs.utexas.edu :: 128.83.120.139

HTTP/1.1 200 OK
Date: Sun, 06 Apr 2014 12:36:16 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.23
Set-Cookie: SESScf56....; path=/; domain=.cs.utexas.edu
Last-Modified: Sun, 06 Apr 2014 12:33:53 GMT
ETag: "4eb53eded35299af56b68617202f579c"
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: must-revalidate
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

server-headers, reverse-proxy infront of possibly rails, leaking rack-version, possibly outdated and vulnerable to some already release exploits

[+] sending now:

GET / HTTP/1.1
Host: XXXXX.COM
Connection: close
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.3b) Gecko/20030210

> ssl-info
('1.2.3.4', 443)
('ECDHE-RSA-AES128-SHA256', 'TLSv1/SSLv3', 128)
> do you want to check with openssl? [y|N] :

[+] lines ins answer: 18
[+] XXXXX.COM :: 1.2.3.4

HTTP/1.1 200 OK
Date: Sun, 06 Apr 2014 12:38:02 GMT
Server: Apache
Strict-Transport-Security: max-age=31536000; includeSubDomains
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
X-Runtime: 11
X-Powered-By: rack 1.2
Set-Cookie: _mailservice_session=BAh7BzoPc...-; path=/; HttpOnly; secure
ETag: "813d4fb6faa576ffd22fbbe44abfa0d9"
Content-Length: 17654
Status: 200 OK
Vary: Accept-Encoding
Connection: close

  edit 2

headers might tell way more; the following snippet, gathered during a blackbox-security-analysis, lead to identifying additional servers that shouldn be visible, which lead to detecting an old-forgotten, outdated firewall with a vulnerable smtp-service running; full-root-access to that box and access to the internal network within 30 minutes

    X-Cache: MISS from proxy232.xxxx.com
    X-Cache-Lookup: MISS from proxy232.xxxx.com:80
    Via: 1.1 proxy232.xxxx.com:80 (squid/2.7.STABLE3)


Is receiving fake torrent data possible? While downloading a file via a torrent, what will happen if some of the peers send me fake chunks?

Also, can any of the peers send me a whole fake file? For example, if I download a .torrent file which should download a file with hash sum A, and a peer sends me a file with hash sum B, will the torrent client notice that and block it?

Yes, a client will notice and block.

A torrent is divided into pieces, a piece is divided into chunks.
Every piece has its SHA1 hash included in the .torrents metadata.

If a peer send fake or corrupted chunks this will be detected when the whole piece has been received and the hash check fails.
A peer that repeatedly sends bad data will be blocked, but there is some leeway because corruption may naturally occur sometimes in a data transfer.
A good client has heuristics to find out exactly what peer(s) sent bad data by comparing the chunks sent in the piece that failed the hash check, with the chunks in the same piece when it has been re-downloaded and passed the hash check.


Why is the U2F secret key on yubikeys is not programmable, and how to get a universal backup token? I'm trying to figure the best strategy for having a backup U2F token. Ideally, I want to have two identical tokens; obviously I'll have the primary one easily accessible (say, on my keyring), but the second one I'd place somewhere not easily accessible (extreme cases are: bricked up into the wall, or buried somewhere in the forest). So whenever I register on a new service supporting U2F, I just use my primary token, and I know that the second one is also automatically supported. I consider this strategy a good tradeoff for being secure and still have a reliable backup option.

But apparently, with yubikeys, the only viable option is to have two distinct tokens and register both of them manually on every service I use them for. However, this is less than ideal because I'd have to keep both of them easily accessible: it's okay if I have to unbrick the backup token in a bad event of losing the primary one, but doing that for every new service is not viable.

Actually, I was surprised to find out that even though yubikeys do support programming of OTP key material (and they even have two slots, it's really nice), they do not support programming of the secret key used for U2F.

Is there any particular reason that U2F secret key on yubikeys is not programmable, even though secret data for other modes (e.g. OTP) is programmable?

So while reading the U2F overview I realized that what I want is impossible with the way U2F is designed, because device has a counter which is incremented on every authentication (see section 8.1 of the overview linked above)

So it's not about yubikey in particular, it's about the whole U2F. That's sad to me, I really liked the idea of having a clone which is hard to access even for me. Not being able to use that strategy means that we have to come up with other recovery methods, which will be different for every service (e.g. not every service supports adding multiple U2F tokens), and overall it's anyway less secure than two devices programmed with the same secrets.

Alas.

UPD: actually, I've got an idea. There is an open-source project u2f-zero. So the plan is: get two devices, program them with the same secrets, BUT the backup device should be programmed with a small modification: instead of returning a plain counter from the cryptochip (u2f-zero uses ATECC508A), return something like counter+500000. I'm unlikely to exceed 500000 authentications during the whole life, and it's still a small fraction of the whole counter range anyway (which is 32-bit).

So, if I'm unlucky enough to lose my primary token, I go to the forest, dig out the backup token, and it should work for all of my services right away. There is even one nice side effect: after I use the backup token first time, the primary one will be immediately invalidated because its counter is lower.

UPD2: I wrote a detailed article about it: Reliable, Secure and Universal Backup for U2F Token


What to do next for this possible buffer overflow? I've been instructed to test a few of our newer applications before user release, and managed to find a buffer overflow on one of the fields.

Here is where I've run into a brick wall though, and wasn't sure what I could try next, if anything.

Initially I tried a partial EIP overwrite, but I can't find any useful jumps inside that space (nothing at all actually).

I then checked the DLLs included with the app to avoid ASLR altogether, but they don't have any jumps that I could use either.

For some temporary testing I decided to just hard code a current jump address, and worry about ASLR later. The issue HERE is that my current address space resides between 61xxxxxx and 76xxxxxx. While this isn't normally an issue, the field that causes the overflow automatically capitalizes each character, so anything in the 61-7A range is out.

Am I missing something obvious, if not, what should I try next?

There's not too much to be gained in actually exploiting it just for a demo.  You should be able to demo making your system crash from a phone borrowed from your audience, and that should adequately appall your viewers.

If you really want the dogs and ponies to bark and trot, you could rig the demo using rebase on your module.  That will let you move the address space to somewhere other than its current 61xxxxxx location, such as a nice and convenient 41xxxxxx.  It's certainly dishonest, but it's also dramatic.  If you feel guilty, tell them that it's almost no different than if someone added a new module at that address as part of a future feature enhancement.


XSS in the context of a CDN Say there is a website example.com. It hosts static content from a CDN, example.net.

This site allows uploading an image, which will then be served from the CDN.
This images can be SVGs and they are not filtered in any way, so they may contain arbitrary HTML content (including script tags).

Would you consider this a security issue?

On the one hand, it allows one to run code if someone accesses the image (say, by clicking on it in the context of example.com). On the other, it only runs under the CDN’s domain so you can’t steal cookies and such. It could be used to redirect to a malicious site though.

Another note: The image is served with Content-Security-Policy:default-src 'none'; so the code runs only under IE.

Yes, this is a major security vulnerability, but that has nothing to do with XSS.

For example, an attacker might render a fake log-in form and trick your users into handing out their passwords.

The SVG can also be used for a clickjacking attack against yourself or sites which trust you, even if state-of-the-art protection is in action. Standard techniques like the The X-Frame-Options header usually just check the top-level browsing context, and that is your site. So an attacker is likely to be able to embed other pages of your own site or partner sites in a frame and then trick the user into taking actions on those pages.


TPM and remote attestation I am currently trying to figure out just how remote attestation for a TPM works in combination with the PCR-values.

Is it true that the PCR values are only measured on system boot and cannot be changed until after we boot the computer once again?

For instance, let's assume I am starting up my computer and all of the PCR-values I am measuring are correct and safe. If my computer were to get infected with some virus after the boot process and while it is running, or if I were to change the source code of some applications while the computer is running, remote attestation would still display the "correct" values from the boot-process and I could essentially fake being a trusted platform?

Because as far as I understood, PCR-values are only measured at the boot-process and are not dynamically updated afterwards until we boot it again.

Partially. The Trusted Computing Group have a standard for what measurements must (and optionally) take place during the boot process, eg: PCR 0 is the CRTM, PCR 1 is the measurement of the BIOS etc.  PCRs 0 to 7 are set during this process. Other PCR values can be written to after boot, eg: PCR 10 is the defacto standard for Linux IMA.

The way you write to PCRs is to "extend" them: if PCR 10 contains 0xABCD and I write 0x1234 to it then PCR 10 will end up with the value hash( 0xABCD || 0x1234 ) - this prevents "faking" measurements after they've been taken.


Questions on IDS, IPS, VLANs and VPN I have a network that has a single point of entry the WAN. The WAN exposes about 10 static IP's that resolve internally to servers that are in the same subnet. Meaning that if you RDP over 3389 to SQLPrimary1 from it you can RDP to all the other devices on the network. Each server has it's firewall disabled. There is no IPS, IDS, SPI nothing. We are however running Microsoft Security Essentials on all servers (FWIW). :sigh:

I need to implement a strategy for protecting the network from inbound threats, outbound threats, zero-day threats, patch vulnerabilities and good heuristics.

If I run IDS I need it to have all traffic run through the firewall directly into my IDS (Security Onion on Linux) and then back to my network. Right?

If I run Security Onion non-stop will it add noticeable latency on my network? I think at present we are utilizing about 2% of our network. Is and IDS system something you run full-time?

Are V-LANS secure? Meaning if I isolate my mission critcal stuff on one VLAN and other resources on other VLAN's is that safest? If not how else could I partition my network so that mission critical data is still safe from beta, web servers and such? Would you use multiple firewalls? What would be the best practice?
We have customers in all 48 states and the U.K. and each of them must connect to our data and web servers. I'd like to impose VPN connections on our customers but I'm wondering:

Is that overkill?
If not would VPN clients licensed from my firewall vendor be more secure and/or efficient than Microsoft's own VPN software?
Would VPN create tons of overhead and congestion?

I have to monitor 2 server datacenters that depend on each other. We have one in the UK and one in the US. I think the easiest way to make sure both datacenters have internet connections is by establishing site-to-site VPN tunnels between US and UK.

Is that an effective way to monitor connectivity at each site or would something else me more effective?

If anyone remembers the "ILOVEYOU" virus that crushed SQL servers around 2000/2001 or so. Would anti-virus software of current quality be able to stop that kind of attack? Are attacks like that relevant anymore with IPS and SPI firewalls.

When it comes to anti-virus on database servers real-time protection is a great way to go because it doesn't lock .mdf and .ldf files. Would it be wise to schedule downtimes to unmount .mdf/.ldf and full-text indexes to physically scan them for viruses using AV software?

Are there any open source tools that you can use to run your own penetration tests and get a list of action items along with the results?

We are a total windows shop and I'd love to hear some others thoughts and ideas on how to approach these issues.

You route relevant traffic through your IDS yes. Latency will depend on your device's performance.
VLANS are secure if implemented correctly. Make sure to also use 802.1x (PNAC) to authenticate devices at layer 2. Make sure you do not start routing between your VLANS (unless appropriate)
Depends what type of VPN you employ, layer 3 or layer 2 VPN. Make sure that you also use two-factor authentication on your VPN. It's not overkill in my opinion as you are trying to prevent access to your business critical data and services in a controlled manner. Make sure you also appropriately log all connections.
This can be done by a point-to-point tunnel. If the machine is available on the internet you could also perform certain checks from the WAN using a separate, dedicated monitoring machine (ICMP, HTTP,...). You should only allow management protocols like SSH and SNMP to be used from your point-to-point tunnel. Your monitoring machine can check if the machine is connected to the WAN with the first checks and then can see if all services are running smoothly. This is also to avoid a scenario where your monitoring server starts reporting your machine is critical whereas your VPN tunnel just went down (which is also critical but not necessarily device related).
Always use an AV. Remember that the ILOVEYOU virus was a VBS script which was executed by a user. You should not be using your servers to surf the internet, download or open files sent to you by unknown people. You should only execute already tested scripts and binaries which can be trusted. (trustworthy source). Make sure to also use EMET.
This is off-topic. If you are serious about your business you should invest in a vulnerability scanner like Nessus.


Cloudbleed: is it actually important to change ALL passwords? In response to Google and Cloudflare's recent disclosures of the Cloudbleed vulnerability, some sources like TNW are recommending that people change passwords for sites and services that use CloudFlare. This seems to me a reasonable precaution.

Others are recommending that people change all passwords, even for services that don't use Cloudflare. Based on what we know so far—admittedly early in the investigation—this seems an overreaction.

As far as I can tell the rationale goes like this:

You probably reuse your passwords, you big n00b. A compromise of your Cloudbleed-affected password will compromise your other accounts.
You should change your passwords sometimes anyway. Stop whining. It's good for you.
Searching through a list off affected sites is really hard. It's so much easier to just change all of your passwords.

I won't change all my passwords lightly. There are over 400 sites in my password manager, and I don't reuse passwords. Looking up a few hundreds sites in a list, whether on Github or Does It Use Cloudflare, doesn't sound hard compared to the tedious time-suck of changing them all.

So far it sounds like Cloudbleed occasionally caused the information from one Cloudflare-supported page to leak into the output of another Cloudflare-supported page.

So am I missing something? Are there good, science-based reasons to change all passwords for all sites and services, given what we know so far (February 25, 2017)? Or is this a panic response?

While Miao is right for the case of passwords, this vulnerability also makes oauth tokens compromised. If a Cloudflare-dependent site uses Oauth, you should make an extra step resetting your oauth dependent sessions across the web.


Input-element value-assignment via console isn't enough to complete form submission This falls between Information Security and JavaScript coding:

The developers of a certain website disabled the option to save form data. Not even usernames can be saved so I tried to overcome this with a Greasemonkey script, via:

document.querySelector('#username').value = "myUsername";

I can fill all non-password fields this way but this won't be enough:

After I filled all non-password fields with a similar document.querySelector operation, and after I manually inserted my password I clicked "Submit" but I'm being told that "all fields are necessary"; seems like the value assignments aren't "recognized" by the site.

Problem 1:

The content does become recognized if, for example, I delete the last letter of the assigned value, that is, if I navigate with the mouse to a certain field (the username field in that case), delete the last letter from myUsername so it becomes myUsernam and then if I bring back the e` and repeated this action, then submit is executed properly.

Problem 2:

Either way, seems I always need to click on each form-field with the mouse (that is, trigger an onclick event per each field); doing so for all fields triggers a modal (a popup) with a small "show us you're not a robot" type of quiz.

document.querySelector('#username').click(); doesn't seem to trigger a proper response (I get "undefined" in console); Nothing is happening compared to an actual mouse click on the field.

I tried to dispatch a change() event per each field but it doesn't change the situation.

My question

How to overcome the 2 problems of unrecognized values and the need to click oon each field and how could I overcome it with vanilla JavaScript?

I tried to dispatch a change() event per each field but it doesn't change the situation.

I think the problem is indeed that the JavaScript on the page expects some event. If you enter text normally you would trigger keydown, input and other events. Any of these events may copy the value of the textfield to some JavaScript variable. If you change the value of the textfield but don't trigger the event, the JavaScript won't notice the change.

Inspect the input field with the debugger tools in the browser, and list the attached events. That will give you a clue to which event to use. Then, trigger that event like this:

element.dispatchEvent(new Event("input"));


Need to secure (and add SSL?) RPC port 443 on Win2003 server So I received an email from my system administrator who wants me to secure a server I own that seems to have a vulnerability in port 443 (which is Windows RPC over HTTPS). Disabling it I know causes some problems with the UI of Windows so I don't want to mess with that. They are saying it is not SSL enabled so it is insecure.

They suggested that I establish an SSL certificate for the service. I don't know where to begin to do this and I couldn't find any articles on this subject.

Any ideas on what I can do here?

EDIT: Sorry it is a Win2003 R2 server. And I believe 443, is the IIS HTTPS service, I don't know how to fix it so the SSL works, apparently, previous users installed a certificate, and it expired--now I don't know what to do.

EDIT2: The previous administrators installed a certificate which promptly expired in 7 days, months ago. I don't believe my site needs certificate, because it is an IP address for a test-site, and I've never heard of anyone spending money to protect an IP address with SSL unless money/personal-info is involved. My question is, is it necessary? And my other question is, why would system administrators flag this as a "server vulnerability that needs to be fixed"--when it is simply a website-access vulnerability that has no relation to gaining server-machine access.

Yes, to set up your server with SSL, you'll need a digital certificate.  If you're IT is just saying "set up SSL" and not giving you instructions for certificate generation, then it's likely that a self-signed certificate is all you need at the moment.

There should be a ton of articles on this - needing to set up a certificate and SSL on the server is a fairly common task.  I'm not enough of a Windows 2003 geek to tell you what's good from bad, but this one at least looked reasonable:

http://www.xenocafe.com/tutorials/self_signed_cert_IIS/self_signed_cert_IIS-part1.php

I agree the MS stuff is painful to dig through on this!

In general, the things you'll need to do is:
- create a key pair
- generate a self-signed certificate

(usually these two can be done with a tool that is provided by the server or downloaded for free - like Open SSL)

configure the port with SSL/TLS, point it to the newly created key pair and certificate, and configure what it will accept from the client in terms of credentials.  If IT isn't bugging you and this is within your network and therefore somewhat protected you may be able to leave these settings at a "accept all" sort of mode.

Microsoft is extremely... special (aka annoying) about all things PKI.  They never quite implement the standards the way other companies do.  As a result, if you can, stick with Microsoft-focused tools, it'll make your life a lot easier.

Also worth a check - ask your IT if you have a local Microsoft CA lying around.  It may be easier to have your server register with the local domain and get itself a legitimately signed certificate.  I believe IIS servers have configurations that let them do this automatically.


HTTP Security header implementation Does any one know if:

X-Frame-Options
X-XSS-Protection
X-Content-Type-Options
Content-Security-Policy

are for HTTP and:

Strict-Transport-Security
Public-Key-Pins

are for HTTPS?

What I mean is that if I have a blog which serves pages on HTTP and has no HTTPS redirection, then only the first 4 headers are necessary. If I host it on HTTPS, only then the remaining 2 headers are necessary?

Or is it that they are required no matter how I host the blog?

If I host it on HTTPS, only then the remaining 2 headers are necessary?

No, that's not enough. Headers aren't mutually exclusive for HTTP or HTTPS.

HTTPS doesn't eliminate the vulnerabilities that some of the headers are meant to protect you against.
E.g., the X-Frame-Optionsheader prevents cross-origin framing to stop clickjacking attacks. This risk is unrelated to an encrypted connection and makes sense for sites served over HTTP and HTTPS likewise.

Also, there are no "HTTPS headers", it's just that HSTS (Strict-Transport-Security) and HPKP (Public-Key-Pins) are HTTP headers that specifically instruct the browser how to behave for HTTPS connections.

  [ ...] if I have a blog which serves pages on HTTP and has no HTTPS redirection, then only the first 4 headers are necessary.

Since HSTS instructs the browser to only connect over HTTPS for a given time and HPKP specifies public key hashes for the certificates that the browser should accept, you're correct that these two headers wouldn't make sense for a plain HTTP website. However, depending on your application, just setting the headers from your list won't guarantee you a secure website. I'd recommend you study each header's purpose and other possible measures to protect your site.


Does it make it easier to crack the inner volume if the outer volume has an easy password? (VeraCrypt volume) When you create an encrypted volume with VeraCrypt, you have an inner and an outer volume. If I make the other volume easy to crack with a short password, does that make the inner volume more vulnerable even if it has a long and complex password?

In fact, you don't have an inner and an outer volume. You have a standard and a hidden volume. Both are completely independent of each other regarding their encryption (see https://veracrypt.codeplex.com/wikipage?title=Hidden%20Volume).


Is it necessary to setup a firewall in both PC and router? If I have the router firewall enabled, is it really necessary to setup iptables in my system? Isn't it a little redundant?

For example I add a rule in the router where the PC can't use the port 12345 for outgoing connections. Why should I add this very rule in the firewall of the PC?

You have asked two different questions, the one in the title isn't the same in the body of your question. Having a firewall software directly installed on your machine isn't the same as setting up iptables.

Is it necessary? No

Will it give you an extra layer of security? Yes

Why?

Having a firewall solution installed on your PC isn't just about blocking bad IPs and closing ports. Many firewall software employ attack signatures that are able to detect many automated (as well as targeted) attacks on legitimate ports that you might be using.

For example you may want to enable SSH access to your PC to tunnel your traffic from an untrusted network. In this case you want to open the port 22, most primitive routers can't do anything other than closing/blocking access to that port. You want something to detect attacks, automatically blacklist offending IPs (although I prefer the concept of whitelisting).

One more important point, your source of attacks might not be only from outside networks. One of the machines inside your network could be compromised and used to launch attacks on the other unsuspecting machines.


Using DOM-based XSS to redirect to different domain or execute script? I was trying my hands at DOM-based XSS. I came across a scenario where a user-controlled string from the URL is included in JavaScript as below.

var userControlled=substring of URL;
window.location="/abc/xyz?param="+userControlled;

The URL is something like http://mydomain/param1=qwerty, where I can enter any value for param1 and the  system would not complain.

Note: Value of param1 does not directly appear anywhere in the response, but it is used  by DOM.

Or the URL can be http://mydomain/param1=qwerty#sadsdsdsd.

I was just wondering, is there a way to redirect user to a different domain or execute a script or anything which can help me execute a successful XSS attack? Or any other attack for that matter.

This snippet of code does not have an XSS flaw but it does suffer from parameter splitting.  It allows the user to specify extra GET parameters which can allow escalation of privileges when the request carries credentials such as a CSRF token in an earlier parameter or authorization cookies.

For example, if userControlled is

&start-world-war-iii=true

then the browser will GET /abc/xyz?param=&start-world-war-iii=true with the user's cookies.

It's probably low risk since assigning window.location leads to a GET request which rarely have side-effects that can be abused by the carried credentials.

To mitigate this, userControlled should be normalized:

window.location="/abc/xyz?param=" + encodeURIComponent(userControlled);


Dealing with password vault recovery after a catastrophic failure as a home user I had a dinner with some friends today, and I mentioned that I use 1Password combined with Dropbox to manage my password. One of them then remarked something which I actually hadn't considered: because both my Dropbox password and the password for the email address I use for recovery are also in the vault and completely random, I have no way of recovering from a catastrophic failure where all the local copies of my vault become unusable.

Now, I do have the possibility of resetting my recovery email password, but that requires me to be connected from my home network, and I might not have that luxury. The obvious answer is an offsite backup, but I'm unsure where to place that. My instinct is to share the vault folder with someone I can trust via dropbox, but that could increase the chance of a compromise, and without the enhanced permissions from Premium Dropbox, there's a chance of vault corruption on my end. There are solutions like a notary or a bank safe, but those are not cheap, plus it's still something that might be compromised.

I am unsure of how to solve this issue affordably. It might never happen, but all it takes is a fire in my bedroom while I'm downstairs that destroys my phone, my laptop and my desktop to put me in deep trouble. How can I recover my password vault if all my local copies have been lost and the only copy left is on my dropbox, which i can't access without my password vault?

I would memorize the master passwords.  You could have a physical backup in case you forget them. I would recommend reading this topic for a full discussion.


When do I use IPsec tunnel mode or transport mode? I basically understand how tunnel mode and transport mode works, but I don't know when I should use one instead of another.

Among the two parties who want to communicate, if one computer B doesn't understand IPsec, I think they have to use tunnel mode, which puts original IP and payload into ESP and delivers the packet to a device near B who knows IPsec, and that device decrypts the packet and sends the decrypted packet to computer B.

But what if the two computer both know IPsec, can I use transport mode? Various articles mention that if two computer are in a intranet, use transport; if they are in different networks, use tunnel. Why? If two computers are in different networks and transport mode is used, what problem will happen?

(Try not to mention AH and so-called security gateway, I don't know what they are.)

From Cisco: http://www.ciscopress.com/articles/article.asp?p=25477

  Tunnel mode is most commonly used between gateways, or at an
  end-station to a gateway, the gateway acting as a proxy for the hosts
  behind it.

  Transport mode is used between end-stations or between an end-station
  and a gateway, if the gateway is being treated as a host—for example,
  an encrypted Telnet session from a workstation to a router, in which
  the router is the actual destination.

So what ARE the differences:

Tunnel mode protects any internal routing info by encrypting the IP header of the ENTIRE packet. The original packet is encapsulated by a another set of IP headers.

NAT traversal is supported with the tunnel mode.
Additional headers are added to the packet; so there is less payload MSS

Transport mode encrypts the payload and ESP trailer ONLY. IP header of the original packet is not encrypted.

Transport mode is implemented for client-to-site VPN scenarios.
NAT traversal IS NOT supported with the transport mode.
MSS is higher

Transport mode is usually with other tunneling protocols (GRE, L2TP) which is used to first encapsulate the IP data packet, then IPsec is used to protect the GRE/L2TP tunnel packets.

EDITED:

Here is a detailed read on the differences from Microsoft:
http://technet.microsoft.com/en-us/library/cc757712%28v=ws.10%29.aspx


Spectre, Meltdown to read SSH keys I've got a VPS running on Ubuntu, accessed through SSH, passwordless and with a public key.

Can Spectre and Meltdown be used to compromise it in order to get access remotely eg by reading the private key stored on the server?

Your user SSH private key is never sent to the server, so there's no risk of that being compromised by either Spectre or Meltdown on the server.  Only the public key is present on the server.  On the other hand, the server has a private key that is used to identify itself to the client.  (This is what gets you messages about server identity when connecting for the first time.)  Everything below is about stealing this host key.

Both Spectre and Meltdown require that an attacker have code execution on your host.  Since you've specified a VPS, there's 2 layers of threat here: attackers on your same physical host, and attackers within your VPS.

On your physical host, if your VPS provider has patched their hypervisor, then there should not be a risk from the specific techniques documented in Spectre and Meltdown.  If unpatched, the owner of another VPS could use Meltdown to read the full memory of the host, and then extract your SSH server private key (host key).

Within your VPS, both Spectre and Meltdown require that the attacker have code execution in your VPS.  If a malicious attacker has access to execute code on your VPS, Spectre and Meltdown should not be the thing you are worried about.  There is so much else going on, and they are already on your host.  (Which is not to say you shouldn't patch; you should, but it's not the top concern I would have at that point.)


Is it possible to get the Qubes OS security concept on other distros? I was looking at the awesome Qubes OS and I love the idea of the virtualization security setup and was wondering if it's possible to potentially get a similar concept on a standard Linux Desktop.

Can I run applications on my Host machine in separate VMs? For example have Firefox installed and have two separate Firefox instances that can't infect each other. I'd hate to install Virtualbox and have to use different Operating systems for certain tasks or purposes. I don't know if Sanboxing is similar to this but let me know if it is.
Anyway I can run a Virtual Network Adapter on my host machine?
Can I isolate certain files from the rest of the system?

Forgive me if these questions are dumb, I'm not that smart in the security field. Thanks!

I'd give you a "yes" to each of your three questions (2 being easiest, 1 hardest to achieve), but with a very large footnote.

You can get some (or most) of what Qubes OS does with the technologies you mention (e.g. virtual machines, container/sandboxing technologies, app armor profiles etc), at least if you're on Linux, because this is basically how Qubes OS does it.

However, getting it right is a tremendous amount of work, and you'll never get the same level of isolation that Qubes OS provides you with, because in order to achieve that, you'd have to run your OS as a virtual machine on a hypervisor, and you'd need to hack the windowing system.

The last is the relevant part. Qubes OS gives you a desktop with individual windows that can run in their own virtual machines, and keystrokes, mouse events etc are isolated from each other.

With current X technology, this kind of isolation is simply not reproducible while keeping the same level of usability. The X Window system is designed in a way that makes it pretty much impossible to isolate user events without code changes. Things might change once distributions come with Wayland, though.

  I don't know if Sanboxing is similar to this

There is quite a difference between Sandboxing and Virtualization. Virtualization, depending on the degree of virtualization, either simulates a whole computer in software or uses special CPU hardware to virtualize it (which is much faster). Sandboxing means that you're putting some software in an environment where it can't do much harm if it misbehaves. Virtualilzation is one specific way to achieve this, and it provides the best isolation apart from actually using a second computer. Using Linux capabilities to reduce access to specific kernel functions for a given process is another, and chrooting the filesystem so that a process sees only a specific part of the whole filesystem yet another. User Mode Linux (e.g. running a Linux kernel as a process in another Linux) and solutions such as Linux Containers (LXC) are ways to build sandboxes that aren't quite as resource-intensive as full virtualization, but still provide good isolation.


Are session keys just the symmetric keys? From what I read, in TLS, the master secret is used to generate the following:

a symmetric key to encrypt the SSL records.
an IV (initialization vector)
a key for Message Authentication Code (MAC)

I'm not sure what the term "session keys" stands for: is it the symmetric key only, or is it the ensemble of all keys derived from the master secret?

The RFC for TLS does not contain or define the term Session Key. It simply says:

  The master secret is expanded into a sequence of secure bytes, which
  is then split to a client write MAC key, a server write MAC key, a
  client write encryption key, and a server write encryption key. Each
  of these is generated from the byte sequence in that order.  Unused
  values are empty. Some AEAD ciphers may additionally require a client
  write IV and a server write IV.

Therefore, there is no official definition of a Session Key in the context of SSL/TLS. However, in general, a session key is simply a symmetric key, which is only valid for a particular communication session. Now, this key can be either used as an encryption key or a MAC key. It simply has to be a symmetric and valid for a particular session. In context of TLS, people usually use the term session keys for the four keys derived from the Master Secret (client write MAC key, server write MAC key, client write encryption key, and server write encryption key). For example: the author of this awesome blog article "The First Few Milliseconds of an HTTPS Connection" has used the term for the above mentioned four keys.

PS: I highly recommend reading the linked article, if you really want get an in depth understanding of SSL/TLS.


Why does Google 2FA not display the correct location when behind proxy? I'm on my corporate proxy and using Google 2-factor authentication to log into my machine.  When I get the notification on my phone, it says that I'm trying to connect from Moscow, Russia, even though I'm in the United States.  In the past, this has not been a problem. It only started occurring a few weeks ago. As such, I'm worried about a Man-in-the-Middle attack.

Is it normal for Google to display incorrect 2-factor login locations when behind a proxy?

I have run into a similar issue with one of my personal VPSs.

When I browse through a SOCKS5 Proxy through my vps in LA my google home page thinks I am in Hong Kong.

After some googling, I figured out that its most likely just a error in someones GeoIP Database.

I would check https://www.google.com/search?q=what+is+my+ip against the ones listed in the 2fa logs ... but its most likely a non-issue


Block Cipher Pseudocode Suppose that I have a block cipher whose key size is 128 bits. but the block length is eight bits. Let E(m’) be an encryption oracle that encrypts by running our “short” block cipher in CBC mode.

How would I write pseudocode for an adversary, A(m), that, given E(m’), can probably decrypt any input in a reasonable amount of time using modern hardware.

My thoughts: The m’ that A passes to E will not be based on the m given to A. But how would I produce a pseudocode for this...?

The relevant term is codebook. A block cipher is a deterministic permutation: for a given key, it maps input block values to output block values, such that any two distinct input block values map to distinct output block values. The "codebook" is the complete description of that permutation: for each possible input block value, it gives the corresponding output.

One can say that the key-and-algorithm is a compact representation of the codebook, which allows for evaluation of the algorithm over any given input without having to store the complete codebook somewhere. However, if you can, as an attacker, rebuild the codebook, then you can decrypt everything which is encrypted with the same algorithm and the same key: you just have a big look-up table.

With 8-bit blocks, there are only 28 = 256 possible block values, so the codebook is remarkably small: it is just a map of 256 possible values. With the encryption oracle at hand, it is easy to obtain a copy of the complete codebook, e.g. by sending 256 one-byte messages to encrypt to the oracle. There can be details, depending on the following:

Does the oracle chooses a random IV, or will it use the IV value that the attacker provides ?
Is it a goal to minimize the number of requests to the oracle ? And/or the total number of bytes sent to the oracle ?

There can be interesting analysis here. For instance, if you send an encryption request for a sequence of 256 bytes of value 0, then the encryption result will describe a complete permutation cycle; the IV selects which cycle you get. Laying out a strategy for codebook recovery which minimizes the number of distinct requests, while enforcing a low maximum size on each request, can be challenging -- thus making for good homework subjects.


Steps to make website GDPR Compliant I am working for a high traffic website developed in codeigniter. Can someone please help how to start working to make website GDPR compliant?

Till now, I was able to identify the potential cookies being used containing user personal details.

What should be the next step? Only showing a prominent consent form is sufficient?

There is no binary answer to be 'GDPR compliant'. There are however some steps you can take to be compliant to some extend. Key element to the GDPR is that you need either explicit permission from your users (or visitors) to collect, store and use their data or another legal basis (such as required by law). The request to use their data must use clear language, you cannot hide it somewhere in a lengthy Terms and Conditions disclaimer.

There are a couple of things to consider. First of all, all users have the right to access, change or remove their data. The GDPR requires everyone to provide mechanisms for anyone to receive any previously provided personal data in a commonly used and machine-readable format.

You must also follow privacy by design principles. This means you cannot check 'I accept your terms and conditions' by default, for example.

The first step is to conduct a Privacy Impact Assessment (PIA by GDPR) which basically means you should ask yourself the following questions:

What data am I collecting
Do I need this data or is it just 'nice to have'
What is my legal basis (in most cases this will be consent) to store and process this data
How long am I going to store this data
Am I going to share this data with others

Then you need to answer all these questions in a privacy agreement of some sort. There are many templates on the internet, for example this one by SEQ Legal (which I am not affiliated with).

Cookies are only mentioned once in the GDPR, but the consequences for anyone tracking users and their browser activity are significant. Recital 30 of the GDPR states the following:

  Natural persons may be associated with online identifiers […] such as internet protocol addresses, cookie identifiers or other identifiers […]. This may leave traces which, in particular when combined with unique identifiers and other information received by the servers, may be used to create profiles of the natural persons and identify them.

Which means that when a cookie can identify an individual via their device, it is considered personal data. This supports Recital 26, which states that any data that can be used to identify an individual either directly or indirectly (whether on its own or in conjunction with other information) is personal data.

To become compliant, you must stop collecting these cookies or find a lawful ground to collect and process that data. The most simple way for doing this is by consent. There are some things to consider (as can be found here):

Implied consent is no longer sufficient. Consent must be given through a clear affirmative action, such as clicking an opt-in box or choosing settings or preferences on a settings menu. Simply visiting a site doesn’t count as consent.
‘By using this site, you accept cookies’ messages are also not sufficient for the same reasons. If there is no genuine and free choice, then there is no valid consent. You must make it possible to both accept or reject cookies. This means:
It must be as easy to withdraw consent as it is to give it. If organisations want to tell people to block cookies if they don’t give their consent, they must make them accept cookies first.
Sites will need to provide an opt-out option. Even after getting valid consent, sites must give people the option to change their mind. If you ask for consent through opt-in boxes in a settings menu, users must always be able to return to that menu to adjust their preferences.

For cookies this means a simple opt-in notification or consent form is sufficient however you should still have a privacy policy in place that covers the above questions when it comes down to personal data, which most cookies are.


Is this PHP code XSS proof? Is the following PHP code XSS proof?

<?php

$site = $_GET["url"];

echo "Site";

?>

I'm generally a fan of not re inventing the wheel because people way smarter than us already did. I did a quick search for you and found the current library you can use: https://code.google.com/p/php-antixss/

Re: your code,  it looks a little too simple to prevent fully. I would use a standardized solution that is used by others and continuously contributed to as new exploits develop.

Hope it helps.


VPN multiple IP users anonymity During a support conversation with my VPN provider, I asked specifically: "is it impossible to filter out a single VPN user since your IPs are in use by many?". The answer was yes, it is impossible.

I am not convinced though. There must be a way to filter out abusive VPN users in this scenario, even if many are using the same IP. Anyone know of feasible methods for this?

NB: DNS leaking, WebRTC and such is tested and secure.

I believe this must be possible since its the same situation when a user stops paying for their service, they have to be able to deny the service to those who stop paying.

Maybe they dont have the protocols in place to assert an attacker or an abuser deserves to be denied of their service, but that is a different situation. The technical means must be in place or it would allow one time payers become life time users.


HTTP access from a single IP If I were to configure a server that would be configured to only be accessible (HTTP) from a single IP address via a port, is it safe from unauthorized access?

Access from a single address does not make it magically safe if the attacker can use this IP address. This can be done directly if the attacker has compromised this specific system. It can be done indirectly if the attacker can cause a HTTP request from this IP address, for example by sending a mail with a link to the user on this system or by including some link (might be automatically submitted) inside a web page which the user on this IP visits. See also CSRF and XSS attacks and similar.
Apart from that an attacker might reside in the path of the connection. Thus even if the data seem to originate at the specific IP they could be modified or newly generated by some man in the middle (proper HTTPS protects against this though).


Secure REST API for mobile and web application usage I have been reading about authentication and authorization for the past few days and I still have not figured out what would be a reasonable way to deal with this for both mobile and web applications.
From what I read, when it comes to a web application, using an access and refresh (JWT) tokens seems to be quite popular. Now, when it comes to storing, there seems to be a lot of different opinions. Some people prefer to store the access token in the localStorage, to avoid CSRFs, however, others point out it is a bad practice due to XSS attacks and having the access token in an httpOnly cookie, with a CSRF token in a normal cookie would be better. (tho in my opinion we still have the XSS problem here as the normal cookie can still be exploited by XSS).
As mobile applications do not have cookies, I guess the second option is gone, and if the REST API will be used for both mobile and web, when logging in (authenticating), the token should be sent in the response and saved in localStorage. How would this be handled for the mobile application?
Furthermore, how would the refresh token be stored for a mobile application? The case, where we store the access token in localStorage, I guess we would have the refresh token in an httpOnly cookie, however, as already mentioned, mobile applications are not browser based, so I guess this would not be an option. Therefor, I still do not understand, how can it be possible to create a secure REST API, which is available both for mobile and web applications.

As mobile applications do not have cookies - this is a wrong statement. The support of cookies is provided by the OS. You may want to look at CookieManager for Android or HTTPCookieStorage for iOS. Both Android and iOS apps do support cookies including httpOnly.
For JWT, the server should not care if the client is a browser or a native mobile app. If the server provides HTTP based API, it should expect that the clients do understand and do implement HTTP. This includes that clients do support cookies. Furthermore, if security functionality on the server depends on any assumptions about the client, it can be dangerous, because malicious users can manipulate the responses.
TLDR: For the REST API to support JWT there is no need to distinguish between mobile and web clients.


How do TV satellites authenticate the receiving signal to make sure its from the TV station that its claiming to be and is not spoofing? What stops criminals from jamming  a channel by sending spoofed signals to its  satellite in space, acting like they are from the TV station and therefore hijack   or jam the channel?

How can the satellite make sure the receiving signals are actually from the source they are claiming to be?

Do they use some sort of digital signature?

Almost every commercial satellite is just a repeater. They have a sensitive receiver and a powerful transmitter, a couple filters, and basically is that. They almost never employ any encryption at all, because sending a computer in the space is expensive, as more weight means more money. And you cannot just send your average Intel processor over, you must design a radiation resistant computer, shield its components with heavy metals (adding weight). So no, just send a repeater.

The security of the satellite is based on the difficulty of interfering with it. Anyone trying to jam a satellite will need a powerful transmitter, a good antenna, and internal knowledge of the receiving band of the satellite. Knowing the frequency is not enough, they need to know the protocol, and that is not just a Google search away. Most of the satellite communication hardware is protected by patents and industrial secrets. They are not usually available.

A radio antenna is not like a laser bean. It radiates on every direction, but with different power levels. It's something called Radiation Pattern. Any good antenna will radiate almost all power in the desired direction, but some power will "leak" around the antenna, even behind it.

Another difficulty is the power level. The power needed depends heavily on the bandwidth. You can send a few bytes per second over a 25mW transmitter to 700km away, but you cannot transmit HDTV to over 35k km on a sub-kW transmitter. And that is expensive and difficult.

So, a transmitter powerful enough to send data over the upper atmosphere to a satellite receiver will leak a lot of power around his antenna, not only on the main frequency, but on the neighbor bands too. That will interfere with the communications of a lot of people - the ham radio operators. And they are professionals, they hate people interfering with their spectrum, and they have knowledge, equipment and motivation to detect the source of the disturbance. Try buying any cheap transmitter on eBay, modify its amplifier to output more power, and let it transmit something for 24h. Someone will knock on your door. Fuming. So don't do that.

So while it's possible, no attackers will do this because:

it's very expensive
technically difficult
getting caught is very easy
the fines for doing so are astronomically high
and the most important: what would they gain?


How could our passwords be cracked so easily? We are saving password in a database using PHP:

return hash('sha256', PASSWORD_SALT . $password);

Recently a (fortunately) good hacker SQL-injected us and cracked some passwords including the admin one.

The story did not ended dramatically or terribly like in Hollywood movies, because he was kind enough to point us the holes. (We "thanked" him accordingly.)

Now that the holes have been patched, we are afraid that there might be some holes somewhere else as the code base is large. The questions are:

How on earth did he crack the password so fast (few hours to less than a day)? PASSWORD_SALT is quite long, stored in the source code and he did not have it. Also, a blank password is not accepted in the PHP code.
We assume we should change the hash/encryption for existing and future passwords. Which encryption do you recommend so that the exposed password is more secured?

He told us that he use some software and dozen of desktop machines available to him in his company. He said he is a bored security expert in some large firm, so he has the means to do stuff.

First of all, what you call PASSWORD_SALT isn't really a salt. A salt is different for every password, and stored in the database. What you have is something that is shared by all passwords, and stored in the source code. That is commonly called a pepper.

So how did the attacker crack your passwords so fast, without knowing the pepper? He probably created a new user for himself, so he has one user for which he knows the password. He can then try to brute force the pepper on that user, since he knows what password he should concatenate it to. The key here is that he does not have to crack the pepper and a password at the same time. He can first crack the pepper, and then crack passwords. This is much, much simpler.

A single iteration of SHA-256 is not a good password hashing algorithm. It is way to fast. According to these benchmarks for a 8x Nvidia GTX 1080  setup, you can try around 2 billion hashes per second. If we give the attacker 12 hours, that's almost 1014 hashes. On average, that's enough to crack a pepper with log2(1014) - 1 = 45 bits of entropy. That corresponds to, for instance, 10 random lower case letters.

Once you have the pepper, you can start cracking passwords. Since they probably have lower entropy than the pepper it should be much quicker.

For how to do password hashing right, see this question.


Writing a sample virus (not harmful) I don't know if such a question is allowed on this site, sorry if it's not

For educational purposes I am asked to write a small virus running on Linux, which should just be able to inject itself into other binaries (but not anything else).
I thought of injecting its code with a technique described here: http://www.securelist.com/en/weblog?weblogid=183651915 and this one (playing with the ELF format) but I couldn't find the assembly source. Do you have any links showing how to do such things? Thanks!

Here's sample code for run-time process injection on linux. This is how meterpreter does it.LibHiJack


Program claiming a dedicated user to run itself A desktop running Ubuntu Linux 14.04 LTS seemed to go slower than usual. top showed that freshclam, the database-update utility for the Unix anti-virus program, was working the hardest.

freshclam --version shows the version is from yesterday:

ClamAV 0.100.3/25835/Sat Jun  6 14:51:26 2020

This program was running under the user clamav, rather than root or user.

Is it usual for a program to claim a dedicated user profile to run itself?
Is this actually a good sign, because it adds transparency to what happens anyhow?
Is this actually a bad sign, because such an ad-hoc user can intrude upon other "stuff"?
Can I retrieve a list of the programs installed in my computer claiming this right of working with a dedicated user name? Basically, can a user oversee such behaviours?

Any common-sense tips that apply to understanding these kinds of situations are appreciated.

Clamav is a daemon. The Linux Standard Base Core Specification recommends that daemons run under individual User IDs. This way you have fine-grained access control for each daemon, and in case one of them is compromised, the attacker does not automatically have unlimited access to the system (as they would if the daemon ran as root, for example).


Content Security Policy Style Hash I have an img tag on a page with an line style that looks like this:

style="height:50px;width:180px;display:block;"

I can't move it to an external stylesheet because the img tag is generated by a 3rd party control. So I copied the hash displayed in Chrome developer tools.

Part of the Content-Security-Policy looks like this:

style-src 'self' 'sha256-7kYG54iPGE/Vf+GFqobEwpF9bfCAVA/elCz7OiSmMl0=';

But Chrome still blocks it with the following message:

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'sha256-7kYG54iPGE/Vf+GFqobEwpF9bfCAVA/elCz7OiSmMl0='". Either the 'unsafe-inline' keyword, a hash ('sha256-7kYG54iPGE/Vf+GFqobEwpF9bfCAVA/elCz7OiSmMl0='), or a nonce ('nonce-...') is required to enable inline execution.

The hash in the policy matches the required hash in the error message. Why is Chrome still blocking it?

Thanks...

It looks like that with Chrome (but not Firefox) you also need to explicitly allow 'unsafe-hashes' since giving the hashes alone seem to apply only for script and style sections and not attributes. See 8.3. Usage of "'unsafe-hashes'". With that your CSP should look like this:

style-src 'self' 'unsafe-hashes' 'sha256-7kYG54iPGE/Vf+GFqobEwpF9bfCAVA/elCz7OiSmMl0=';

For more discussions about why Chrome decided to behave this way see this Chromium issue and this W3C issue.


How to secure communications between a web front-end and the web server when/where the HTTPS protocol is compromised? A country in the Central Asia has issued a law enforcing all the ISPs to decrypt the transit HTTPS traffic and encrypt it with a special certificate issued by the government. Every client is to install the certificate to be able to access HTTPS resources (they just won't work without this). At least some other countries can be expected to follow. Needless to say this means HTTPS is not a sufficient solution to guarantee privacy of the data transmitted between the clients and the servers any more. What are some reasonable/interesting ideas of ways to address this issue practically?

I know about VPN and SSH but this seems a fairly clumsy solution - governments blocking HTTPS will probably block all the easily recognizable top-layer encryption solutions like SSH and VPN too. So, what I am generally interested in is implementing a second layer of end-to-end encryption on the application level.

I am working on an idea of a personal information organizer sort of a web app to store my personal data (including, among other data, passwords, intimate pictures and data like this) on my personal server and access it wherever I go. Needless to say I don't want anybody to be able to intercept the data when I happen to travel to a country where such an anti-ptivacy policy has been implemented.

What are some reasonable/interesting ideas of ways to address this issue practically?

GPG encryption, with steganography to hide the fact that you're using encryption in plain sight.

The basic idea you need to avoid mandatory compromise to encryption, is find any data channel that is not blocked and use non-compromised encryption over that data channel.

That data channel could be, but not limited, to any of these (ordered roughly by how practical they are):

any type of proxy, web proxy, VPN, SSH. Over custom port if necessary.
landline telephone
software modem over the voice channel of mobile network
shortwave/AM radio
satellite phone
Wi-Fi mesh network
packet switch over spam email or pastebin
use or devise protocols that can switch to another protocol mid stream in the same TCP connection
sneaker net
IPoAC
smoke signal

The encryption done on top of this is just regular non compromised encryption. Probably just HTTPS, or perhaps GPG. Doesn't really matter too much.


Can a Rainbow Table find multiple plaintext passwords to match a given hash Given that:

an MD5 hash can map to multiple plaintext strings (it is not unique)
a rainbow table may store several million plaintext passwords with matching hash
MY password is "password123", mapping to 482c811da5d5b4bc6d497ffa98491e38 MD5 hash

Can't a second plaintext string be found which hashes to "482c811da5d5b4bc6d497ffa98491e38"? And thus, can be entered as MY password into adobe.com, and thus gain illegal entry via a legitimate login?

What's the chances of this hash collision outcome? Obviously that depends on the size of the password list / rainbow table, but roughly..?

Can't a second plaintext string be found which hashes to "482c811da5d5b4bc6d497ffa98491e38"?

Yes - it's even easier than you fear with MD5, which is broken; e.g. it is possible to generate collisions on purpose, although I'm not sure whether it's already possible to generate collisions without controlling the input at least partially.

You may want to google "birthday paradox". It asks: "What's the chance that two persons in a room share the same birthday?" and it's relevant to your question.

It will also give you the math to calculate the chances of hash collisions given the size of the hash function output and the number of elements/passwords you expect to hash. I think a rough estimate that's often used is that you're likely to see collisions after hashing n passwords, where n is the square root of the your hash function output space. So, with your example of a 128 bit hash, that would roughly start to happen after 2^64 hashed passwords (which I'd think is still infeasible to do with today's hardware iff md5 isn't completely broken yet, so there's probably no need to panic yet, but I'd start walking calmly towards the next exit...).

  And thus, can be entered as MY password into adobe.com, and thus gain illegal entry via a legitimate login?

Probably not, since Adobe should know better than to use MD5 to hash passwords and not even use a salt value.

Passwords aren't hashed using bare-metal fast hash functions such as md5 or sha1 or even sha256 any more (at least not by anyone who wants to keep them safe in today's world). These hash functions are much too fast and can be implemented on hardware such as graphics cards parallel gpus (or even more specialized hardware) which can then hash millions or billions of candidate passwords per second  (depending on the hash function used) to brute force a password. You can try it out yourself using a program such as hashcat.

Better options for hash functions are hash functions designed to be slow, pbkdf2, scrypt and bcrypt for example. They do hundreds of thousands of iterations to slow themselves down. The number of iterations can be configured to account for faster CPUs.

Also, passwords aren't hashed "naked". Usually you salt them; e.g. add a random salt value to them; this will make the creation of rainbow tables much more difficult, since now one table must be calculated for each separate salt value.


Finding security consultant for doing in-depth code review? We have a PHP application that we know has poor coding practices (because the developers did not have a good understanding of PHP / programming fundamentals). This could lead to the scenario where we have severe security flaws in our code even at the "logic level".

How/Where do I locate a consulting team that would do a manual code review to actually understand what WE were trying to do and then see where we went wrong / how the process could be circumvented? We tried a consultant which did what appeared to be just an automated scan of the code, and that added absolutely no value.

This question is based off of Getting a manual security code review done - What to watch out for? - I'm the same person, but I cant access my earlier cookie based session anymore.

Code review can be an expensive use of a consultants time and therefore your budget, to ensure you are getting value for money you could look to do the following;

Triage the code you require to be reviewed. This way you may find that you can focus on code that completes specific roles such as authorisation / session management / specific business logic etc. that you are worried about. If you then have budget left over you can move on to other less critical code areas.
Estimate the time and effort required As a very rough estimate you can use the 1k lines of code = one full day of review (not including reporting). Different languages and code complexity will change this, but it provides a good starting point when looking at budget requirements.
Automation as an aid Automated code scanning has its place, but only adds value if the consultant knows how to configure the tool and use it as an aid in their manual review. Using a blended automated-manual approach can speed the engagement up and lead to a reduced cost. The consultant should be skilled enough in the language being reviewed to understand the security issues and to remove any false-positives as well as insure no false-negatives get through.
Threat Model the application If you can understand the business logic and how attackers can interact with your application to a level that enables you to model potential attack vectors, then this will help define a more specific and focused code review. This level of detail can then be passed on to the consultant to ensure that they are aware of how the application works and this will enable them to provide tailored advice and guidance rather than a generic - here are some risks.
Place the findings in to context of the application At the end of the day you will need to make a call on which issues to fix and in what order of priority. Challenge the consultant to make clear recommendations and to provide evidence to help understand if findings from the code review are actually a threat - i.e. the code found to be vulnerable is at the back-end and their is no route for user interaction then this is a lower risk than if the vulnerable code is in the main authorisation code presented to the end user. This should reduce time internally and therefore become a cost saving that can be offset against the cost of the code review.


My MP3 file is blocked, but still playable? My computer is telling me that my MP3 file is blocked:

I have no problems playing the song, so I was wondering what exactly does it mean for my MP3 file to be blocked?

The screenshot indicates that the Windows Attachment Manager has identified what it considers a possibly dangerous file from an external source and marked it. See http://support.microsoft.com/kb/883260 for information on what the Attachment Manager is and how to configure it.

The Windows Attachment Manager will mark many types of files that could possibly be a risk (without analysing the content) based on where it originated from. If you are just playing an MP3 you probably didn't even get a warning because of the way you are using the file. However if you had an .exe file instead Windows would warn you before it allowed it to run.

The additional stream information that "tags" the file as originating an external source will be copied around with the file in most circumstances (it will not if copied to some file systems such as FAT).

Ideally if you trust the source where the file originated from then you can unblock the file. Otherwise leaving the file blocked will not prevent access to the file however in some circumstances you may be presented with a warning before Windows allows the action.

Hope this helps.


do ISPs implement security measures? For example, if a user is receiving a denial of service attack, with huge amounts of packets being sent to him to disrupt his service, will the ISP notice and stop the offending traffic?

Another example, if someone has an internet-facing VNC server and a bad guy is trying to bruteforce the password with tons of login attempts, will the ISP notice and stop the attempts?

In the answers I would like to know if it would be possible/practical/likely for ISPs to implement these things, and why.

Denial of service attacks and brute force attacks on a single client are two very different things and ISPs will have different responses. Also, ISPs are not all created equal, some will be better than others at detecting and dealing with problems.

Distributed denial of service attacks attempt to flood a host or hosts with malicious traffic of some kind, and this will impact the service an ISP will be able to offer their customers as all this traffic must go through the ISP's network devices. Good ISPs will monitor their traffic levels and analyze it when certain thresholds are passed, and good ones will also have trained their staff to respond. All ISPs can run at least some filtering to reduce the levels of unwanted traffic. They'll do this to protect their own network as much as their customers.

ISPs do not typically monitor for malicious traffic like brute force cracking, although some services may offer that type of service as an extra. Many ISPs have the technology in place to monitor for that type of traffic, however it would cost them time and money to do it so they won't unless they have a financial incentive.