How did hackers compromise my EC2 instance? My EC2 instance was hacked recently. It doesn't really matter as I'm just starting my website and there was no sensitive information on my server yet, but I do plan for there to be in the future. I am going to terminate the compromised server and set up another one in order to secure my website.

My issue is that I want to make sure this never happens again, and the only way I can convince myself that my new server is secure is by knowing how the first server was compromised and making sure that the new server cannot be compromised by the same method. However I am having trouble identifying/understanding how the first server was hacked.

The stack used is Rails 4.2.4 + Postgresql 9.3 + Puma + Nginx 1.4.6. The server I'm running is Ubuntu 14.04.2 LTS on an AWS EC2 t2.micro instance. My AWS access keys have not been published anywhere, and I am the only one who should have SSH access to my server.

Now I'm no hacker, or even a good sysadmin for that matter (though I'm learning) so I have to keep an open mind about how the server was infiltrated, but since the only way I access my server is by SSH, I'm assuming that is how hackers got in too. I had erroneously left an inbound security group rule for the SSH port 22 to have a source of 0.0.0.0/0, which also makes me think it is likely this is how hackers got in.

I access my server by ssh using a private key with command similar to

ssh -vi "/home/me/.ssh/my_private_key.pem" ubuntu@my_aws_instance.com

I was notified of the compromise from an ec2-abuse@amazon.com email that my server had been making DDOS attacks. Although I couldn't verify this by looking around my logs, I did find some hidden php scripts in /var/tmp which looked as if they were designed to send out phishing emails which convinced me that the server had indeed been hacked.

There is no password set up for ssh which was confirmed by hydra when I tried to attack my own server. This implies to me that the attacker must have guessed my RSA private key... except I understand this is not realistically possible.

I don't know of any other possible ways that the server could have been compromised. Does anyone have any ideas? Are any of my assumptions or steps wrong?

Inbound Security Group Rules (at the time of being hacked):

HTTP               TCP    80      0.0.0.0/0
PostgreSQL         TCP    5432    0.0.0.0/0
SSH                TCP    22      0.0.0.0/0
Custom TCP Rule    TCP    9200    91.216.55.150/32

Thanks in advance for your help. I'm sure that I have left out a lot of useful information so if there is anything more you'd like to know just ask.

EDIT:

The website does contain some fairly standard Rails data input functionality. Mainly through html forms and there I also allow for image upload using a gem called carrierwave.

The stack used is Rails 4.2.4 + Postgresql 9.3 + Puma + Nginx 1.4.6.
The server I'm running is Ubuntu 14.04.2 LTS on an AWS EC2 t2.micro
instance.

Ruby on Rails 4.2.4 is vulnerable to a directory traversal attack when the render method is used (since Puma runs on RoR, this could potentially an issue). While this does not give an attacker access on its own, it can be escalated into a remote code execution attack. Upgrade RoR to version >= 5.0.0.beta1.1 to protect against this.

Postgresql 9.3.x is vulnerable to several attacks, ranging from DoS to the more serious buffer overflow attack. Upgrade PostgreSQL to the latest version to protect against the various vulnerabilities in the version you are using.

Nginx 1.4.6 - I don't actually see a record of version 1.4.6. Regardless, there are at least two known vulnerabilities that affect versions 1.4.x. Upgrade to the latest version to protect against these vulnerabilities. (Actually, the latest vulnerability was announced last month, and the newest mainline version [1.9.9] is still vulnerable. It is a DoS attack, and can be prevented with targeted firewall rules)

I access my server by ssh using a private key...

Unless you have edited the sshd config to allow password login as well, this is sufficient in ensuring a remote attacker cannot bruteforce your SSH login. If the computer you use as an SSH client is ever compromised however, you should consider the keys compromised as well.

How did hackers compromise my EC2 instance?

Difficult to say without more information. A list of running services, firewall rules, and a stack of log files would help.

My issue is that I want to make sure this never happens again...

Tough cookies. As long as you have a publicly facing web server, it will get attacked. The better approach to take is accepting that this can happen again in the future, and prepare for it. Some realistic things you can do are keep software fully patched, tune your firewall rules (do you really need to give access to the whole world?), implement an IDS/IPS on the AWS local network and route all traffic through it, and finally log all traffic and forward to a hardened logging server.
This is perhaps the most important step in understanding how you were hacked, and how to prevent it in the future. Grepping through log files is an option, but having a clean visual representation of your server's logs makes it much easier to detect anomalies, and to later search when a server is attacked. Having a separate, hardened log server is important because if your web server is compromised, the attacker can erase traces of the attack locally.
If you wanted to go one step further, you can automate the process of detecting anomalies, and define reactions based on that.


Pros vs Cons of Secure Remote Password We are setting up an authentication system using Cognito and Amplify. We noticed that Amplify suggests Secure Remote Password as the default.
I can understand the benefits of SRP for protecting against man-in-the-middle and such attacks. But it seems there is a downside too: for example, the server is unable to perform strength checks or to call Have I Been Pwned to check if the password has been compromised. By choosing SRP, it seems like we are opening ourselves to more of our users choosing "Password123!" as their password. Edit: To clarify, we would still perform client-side password strength validation, but there are limitations compared to what can be achieved on the server-side.
I haven't been able to find much discussion on whether SRP is really a good choice or not. Does anyone know of standards or best practices I can refer to?

Not really a direct answer, but it is way too long to be comment.
In the end, your question will boil down to: who is responsable for the security of a user password? And you fall in a quasi religious war... Many system admins think (know?) that most user do not care at all about the security of their password and they do their best to invent rules to improve that security (minimal length, forced or forbidden patters, maximum lifetime, minimal differences between consecutive passwords, etc.) And some other security actors think of that like a bandage on a wooden leg. Because it leads to users forgetting their passwords and secure password recovery is hard. And because in the end users just write down the password on a paper (post-it) sticked on the screen. So for those other people the only way to obtain security is to educate users so that they are aware of the risk involved by poor security practices, including poor passwords. Additionaly, they say that most of the rules actually (slightly) lower entropy which is bad, and tend to let the system process the plain text password longer which is also bad, specially is it leads to keeping plain text copies of previous passwords.
So if you tend to believe that the admin is the one that knows about security and that trusting users is stupid, then you should avoid any solution that let the end users choose their password without control. If you think that the users should be responsable for their own security and all that you can do is informing them of best and poor practices, then SPR is for you.

Apart from religion, I must aknowledge that some objective things can matter, mainly who the users are (corporate users, users interested in IT or security, or just anybody), and what is the sensitiveness of the application and its data...


How common are UTF8 strings in X509 In theory, names in X509 certs are defined as:

CHOICE {
  teletexString     TeletexString   (SIZE (1..ub-state-name)),
  printableString   PrintableString (SIZE (1..ub-state-name)),
  universalString   UniversalString (SIZE (1..ub-state-name)),
  utf8String        UTF8String      (SIZE (1..ub-state-name)),
  bmpString         BMPString       (SIZE(1..ub-state-name)) }

But what's the current state of certificates in the world? Everything I've seen so far uses just UTF8String for all the fields.

I'm writing a service for signing recent CSRs generated of new Linux systems, used in internal networks only - not in the wild. Is there any risk in always outputting UTF8String in the signed requests and dropping any CSR which isn't using that encoding?

The answer is actually included in RFC 4630 and various later ones. It looks like 2003 was the last year when other encodings were relevant. These days UTF8String (or potentially PrintableString) are the answer.


Why does OpenSSL show different CAs for mail.google.com:443 than what Chrome/Firefox shows? Why does openssl show different certificate chain for mail.google.com:443 than what Chrome/Firefox shows?

$ openssl s_client -connect mail.google.com:443 < /dev/null | head -10
depth=2 /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
verify error:num=20:unable to get local issuer certificate
verify return:0
DONE
CONNECTED(00000003)
---
Certificate chain
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=mail.google.com
   i:/C=US/O=Google Inc/CN=Google Internet Authority G2
 1 s:/C=US/O=Google Inc/CN=Google Internet Authority G2
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority
---

The above output shows that the top-level certificate belongs to GeoTrust Global CA and it is issued by Equifax Secure Certificate Authority. The server certificate is issued to mail.google.com.

But Chrome and Firefox shows that the top-level certificate is a self-signed root certificate by GeoTrust Global CA. The server certificate appears to be issued to *.google.com.

Even after disabling QUIC via chrome://flags, I still can't see the Equifax certificate in the certificate chain, although the server certificate now appears to be issued to mail.google.com.

Why do I see different Equifax certificate in OpenSSL but not in Firefox/Chrome?

Chrome is not using HTTPS as you are doing with openssl s_client but it uses the QUIC protocol to access the site. In the Security Overview (developer tools) you can see:

  The connection to this site is encrypted and authenticated using a strong protocol (QUIC), a strong key exchange (X25519), and a strong cipher (AES_128_GCM).

This means it accesses a different service which provides a different certificate. For why they offer a different certificate there you have to ask Google.

Once you disable QUIC in chrome://flags and relaunch the browser you get the same certificate as openssl, i.e. the one for mail.google.com. And the Security Overview now shows:

  The connection to this site is encrypted and authenticated using a strong protocol (TLS 1.2), a strong key exchange (ECDHE_ECDSA with X25519), and a strong cipher (AES_128_GCM).


Value of DNSSEC with allow-downgrade option Does setting up DNSSEC in client (systemd-resolved) with allow-downgrade option have any value? Does it improve security at all?

Yes, as the man page of resolved.conf states:

  Client programs looking up DNS data will be informed whether lookups could be verified using DNSSEC, or whether the returned data could not be verified (either because the data was found unsigned in the DNS, or the DNS server did not support DNSSEC or no appropriate trust anchors were known). In the latter case it is assumed that client programs employ a secondary scheme to validate the returned DNS data, should this be required.

Thus, client programs can make appropriate use of the response, either warning the user of no dnssec validation or showing dnssec validation.


Gaming Mods Security Risks I read the following post, and while the questions was specific to SkyRim, the more general answer was that it depends on the game. I wanted to pose a more generic question here to the security folks.

The main concern seemed to be the type of file extension and language that was being used for the mod. I was under the impression that any code can do almost anything it likes, so I'm not sure how the language would matter. Also, I understand that an executable is more dangerous than perhaps a simple text-based config file.

How dangerous are gaming mods, does language and file-type matter, and how can I decide these for each individual game?
Also, does the maliciousness/exploitability depend on the mod file I am downloading, or the type of files the mod-file is modifying?
Will a decent AV with signatures/heuristics pick up a malicious payload?
Can mods be examined in a debugger (OllyDBG) or other tool (which type)?

To sum: How can I mod safely?

Mods certainly can be used as infection vectors. A lot of it comes down to a question of trust. A mod with tens of thousands of downloads and nobody suggesting they've had any problems is likely to be OK (though still no guarantee!).

In an ideal world:

Wherever possible, avoid mods that have an installer. There are some situations that this can't be done, but mods with installers are probably the biggest threat. A lot of users will happily click through a request for administrative privileges from an installer.
Download mods from reputable sources. Ensure you're always downloading the mod as the creator released it, and not repacked by anyone else!
Check comments sections for the mod, and do a quick google search with keywords like "virus".
As per the first section of this answer, favor popular mods over ones with barely any downloads.

Sections of your question are not possible to answer with any real useful information, as there are so many different types of mod available with great differences between them. However, generalizing:

  How dangerous are gaming mods, does language and file-type matter, and how can I decide these for each individual game?

How long is a piece of string? Mods can be very dangerous or not dangerous at all. File type certainly matters. Mods that just replace textures, or add new models etc are pretty unlikely to cause you any problems. Mods that use .exe installers are something to be wary of.

  Does the maliciousness/exploitability depend on the mod file I am downloading, or the type of files the mod-file is modifying?

Both. If the mod you are downloading is a .exe, it's a bigger risk than if it's a .zip or .rar (generally). If the mod file just replaces some textures or config files, it's a much smaller risk than if it replaces the game executable...

  Will a decent AV with signatures/heuristics pick up a malicious payload?

Hopefully, but don't rely on it.

  Can mods be examined in a debugger (OllyDBG) or other tool (which type)?

Again, this would depend on what the mod is and what it does. You can certainly check .exe files in a debugger, but frankly I just wouldn't run them at all. Or run them sandboxed in a VM if you really must run them to check them in a debugger.


Padding of 802.11 packet with 0's in libpcap I am trying to send probe request to Access Points.But whenever I send a probe request packet it is padded with 0's i.e I see two packets on wireshark for every packet I send : a non-padded packet and a padded packet with 0's at the end.The padding changes the meaning of the tags in the packet and wireshark declares the second packet as a malformed packet.How do I remove this padding.Also why do I see two packets even though I am sending only one.

Here is the packet function that creates the packet:

int build_beacon(char *buf, struct network_t *n) {
    char *b = buf;
    /* prepend a minimal radiotap header */
    memset(b, 0x00, 13);
    b[2] = 13;
    b+=4;
    b = append_to_buf(b, "\x04\x80\x02\x00", 4); /*Set flags*/
    b = append_to_buf(b, "\x02", 1); /*Set bit rate*/
    b+=4;
    b = append_to_buf(b, "\x40\x00\x00\x00", 4); /* IEEE802.11 probe request */
    b = append_to_buf(b, n->dst, sizeof(mac_t)); /* destination */
    b = append_to_buf(b, n->mac, sizeof(mac_t)); /* source */
    b = append_to_buf(b, n->mac, sizeof(mac_t)); /* BSSID */

        /* sequence number */
    *(b++) = n->seq >> 8;
    *(b++) = n->seq & 0x00FF;
    n->seq++;

    *(b++) = 0; /* tag essid */
    *(b++) = strlen(n->ssid);
    b = append_str(b, n->ssid);

    /*supported rates*/
    b = append_to_buf(b, "\x01\x08\x02\x04\x0b\x16\x0c\x12\x18\x24", 10);

    /*add channel*/
    b = append_to_buf(b, "\x03\x01", 2); /* the channel we are currently on.*/
    *(b++) = n->channel;

    *(b++) = 10; /* tag request info element essid */
    *(b++) = 3;  /*size of request info*/
    b = append_to_buf(b, "\x00\x07\xdd", 3);

    /*HT capability*/
    b = append_to_buf(b, "\x2d\x1a\x3c\x09\x17\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 28);

    /*extended supported rates*/
    b = append_to_buf(b, "\x32\x04\x30\x48\x60\x6c", 6);
    return (b-buf);
}

Here is a snapshot of the two packets:

Here is the packet without padding:

Here is the packet with padded 0's.The colored mark is where padding starts.

While i was reading your question i assumed you'd be on wireless, which is a broadcast medium. I assume you're also capturing on all interfaces.

Take note b = append_to_buf(b, "\x32\x04\x30\x48\x60\x6c", 6); there are six times 00 appended


Find the Encryption Key (used for network encryption) assuming a Trust Chain is being used on Windows? If I double click on a .crt file, in Windows, I'm presented with three tabs General, Details, and Certification Path.  I'm aware that the Certification Path tells you the details of which root and intervening CAs as well as your own certificate, but how do you find the encryption key used for network encryption?

I think you mean what Microsoft calls Your Public Key Used for Encryption here.

And in that case you're simply looking for the Public key field.


Are there any Common Weakness Entries (CWEs) applicable for hardware security weaknesses? I can't seem to find a suitable CWE for classifying hardware-specific security weaknesses. Particularly, I'm looking for a CWE that applies to power glitching or clock glitching against a microcontroller or microprocessor.

Are there any CWEs suitable for this case? I'm aware of the hardware entries in CAPEC, but I specifically need a CWE in this case.

Yes. There is now the Hardware Design CWE View.
It lists CWEs such as:

CWE-1247: Missing or Improperly Implemented Protection Against Voltage and Clock Glitches
CWE-1248: Semiconductor Defects in Hardware Logic with
Security-Sensitive Implications
CWE-1232: Improper Lock Behavior After Power State Transition
CWE-1245: Improper Finite State Machines (FSMs) in Hardware Logic

Have a look at the view - specifically this page for the issue you mentioned. I believe it is still a "draft" at this point, but may be useful for you.


Uploading Disabled for executable file during change of Extension As we know, uploading of executable file is not safe. But if we change extension of file exe to txt, then file get uploaded. How to prevent this??

You can not block the upload of executable files. That's it, there's no way around it. However, you can change the way you think of uploaded files.

First thing you need to do is to know where your users upload files, and then lock down that directory. If you're using Apache, you can prevent it from asking to execute files in a certain directory by adding the following to your http.conf.

<Directory "/var/www/my-upload-dir">
  AllowOverride None
  Options -ExecCGI
</Directory>

Other things you can do include using random names for the files once uploaded, only serving the files via a proxy script and storing the files above your document root.

Finally, a very important thing is to never include, use or import any user-uploaded file.


Which HTTP status codes are interesting from a security point of view? I'm looking to extract interesting information from webserver logs and I wonder which HTTP status codes should I filter out?

For example, 200 hits can be considered to be 'regular behavior' whereas lots of 404 hits from a certain IP probably means someone is up to no good (automated scanning)..

So, which of these that I mostly see in logs:

304 - Not Modified
404 - Not found
302 - Found
206 - Partial content
301 - Moved permanently
500 - Internal Server Error
403 - Forbidden
501 - Not implemented
406 - Not acceptable
416 - Requested Range Not Satisfiable
other?

should I filter out, and which ones do usually give insightful info? Which ones are known to be used by bad guys for information gathering? Probably the most "interesting" one is 404, but I would like to get more opinions on this if someone else dealt with this in the past. Thanks..

HTTP 200s can be awesome for an attacker when he is requesting URIs that should be protected by authorization (http://cwe.mitre.org/data/definitions/862.html).

Attackers pay notice to HTTP 500s – they often lead to offensive success.  Observing lots of HTTP 500s can be interesting.  If the app likes to redirect (HTTP 302) upon errors, then lots of HTTP 302s can be interesting.

To catch nefarious activities it may be best to observe numerical changes (min, max, median, mean, standard deviation) of some or all of the HTTP status codes.  Observing 50,000 HTTP 200s in a short time span from an IP block can mean your databases are on their way to public fame.  Lots of unusual HTTP 200s can also mean an attacker has found a way to send malicious requests successfully that are answered with HTTP 200s.

If you have lots of time to play you could model the activity of "normal" users (i.e. how many of each of the HTTP status codes does a normal user generate during a session, for example) then look for variations that cross tolerance thresholds.  Search for anomaly algorithms and try ones you think may work to identify unusual activity by analyzing only HTTP status codes.  Could be fun research actually.

On a side note if you are looking at Apache logs for attacks, check out http://code.google.com/p/apache-scalp/

  Scalp! is a log analyzer for the Apache web server that aims to look for security problems. The main idea is to look through huge log files and extract the possible attacks that have been sent through HTTP/GET (By default, Apache does not log the HTTP/POST variable).


Best Practice for Suppressing Fortify SCA Findings I have been searching for an answer as to how you should treat false positives in Fortify scans.

For a long time, if something was determined to be a false positive, I would document the reasoning behind why that issue was a false positive and suppress the issue.

One of my colleagues interviewed a former Fortify employee and was told that you should never suppress issues as it could prevent particular new findings from being displayed.

Now, I have personally run scans with suppressed issues and have found that is not the case.  Even with suppressed issues, new findings under the same category are being found.

I found this post and one of the contributors points out that if vulnerabilities are being relayed outside of the security team to suppress them.

What is the best practice here? Is the way I have been doing it the right way?

In general you should not suppress the issues unless you are really really sure, in the case of Fortify I dont consider a good tool for c/c++ projects for example, but I know that works for other languages quite well. You should make an analysis of the issue and decide if you want to suppress or not with a minimum of two persons for evaluate the risk of fixing or not the issue.

Another approach will be to use another tool and check if both of them agree on the same code line, that is another indicator.


Preventing OS fingerprinting I am working on a project and I need to hide my Linux OS from nmap or other OS identification tools. I read many articles about TCP/IP stack and changed many properties such as TTL and packet size but it doesn't seem to work and it creates many problems within the machine.

How can I hide my OS from identification or force it to be identified as a Windows machine?

Instead of changing the settings on your machine, why not send your traffic through another machine?

Use a Windows machine as a proxy and send all traffic through it. If you virtualise the process, you can have many machines, all with different configurations and OSes, and you can switch from one to the other at will.

And if that can work, then why not just use all those disposable VMs as your machines and not proxy at all? Remote into those VMs, do what you need to, and switch as needed.


Will a printer refuse HTTP connections from a non local address? One of my printers, an HP m605 enterprise printer, is connected to one of 4 ethernet ports on my business class Comcast cable model. My service class has 5 static IPs. The administration for the printer can be accessed locally by using the local address from a web browser. For example, if I access the hub wirelessly and type http://10.1.10.45 (the local address of the printer) in a browser then the web administration page comes up.

Will the printer accept access to this page from external addresses? For example, if I go another network and type http://x.x.x.x into a browser where x.x.x.x is the static IP address associated with that ethernet port will the administration page come up?

The answer is “no, your printer will not refuse connection attempts from an external system.” That’s not its job. It will happily accept connection requests from any system that manages to find its way through the Ethernet cable.

It’s the job of your network to prevent attackers from passing through your router and reaching your printer in the first place. Tools such as firewalls block external attacks inside your router before they can get inside your network. And it’s your responsibility, as owner/administrator of your router, to make sure that it’s properly configured to keep your network secure.


How to avoid data discrepancy between multiple parties with dependent financial interests? Generalized problem
say there are 2 companies/parties A and B (there may be more) and there is an event E which is recorded by both A and B.
Let's say the occurrences of event E according to A is 'E by A' and according to B is 'E by B'.
B has to pay to A per event E ('some rate' multiplied by 'occurrences of E')
So assuming bad faith:

A wants to show that 'E by A' is more than the actual value
B wants to show that 'E by B' is less than the actual value

How to make sure that the data is authentic and no one is cheating?
Specific problem
Say there is an advertising company A and another company B that hires A to manage their ads for them and B agrees to pay per click on their ad, shown by A.
If A records the clicks on their system how to make sure that A is not exaggerating the number of clicks?
And if B is recording, then how to make sure that B is not understating the number of clicks?
And if both are recording, then both problems apply.
My thoughts
I was thinking is there some cryptographic way to solve this problem. I understand that if they hire a 3rd neutral company to record the clicks it would be OK? but what if I don't want a 3rd party?

Cryptography is not going to be of use. What you have is a matter of objective assurance. How does one party assure the other that the data is accurate and that it could not possibly be any different? Cryptographically, I could assert anything. What you are trying to battle is a "conflict of interest".
3rd parties who do not have an interest in one outcome or another is the typical way this is handled. An uninterested observer makes the assertion. Both parties are bound to the observer's assertion.


Prevent Handler From Starting On Exploit Ok, I want to be able to start up my handler in the background, and then attack multiple targets without each exploit starting its on handler...

For instance, when I am attacking a target...

[*] Exploiting target 192.168.1.2
[*] Started reverse TCP handler on 192.168.1.1:4446
[*] 192.168.1.2:7001 - Sending handshake...

I dont want the reverse TCP handler started when I exploit, I want to use a background TCP handler to catch all of the incoming shells if that makes sense...

And I will tell you why, right now, when I execute this exploit, it completes but no session is created, then 10 minutes later, a session will be created for a previous target while attacking another target, so I just want to do a catch all in the background, while I loop through my targets...

Is there anyway to do this?

Run the listener as a job and set exit on session to false

set EXITONSESSION false

then

exploit -j

then view all active sessions with

sessions

and interact with specific session with

session -i n         # n being the number of the session


Section 37 of the United Kingdom's computer misuse act Section 37 of the United Kingdom's computer misuse act states you are not allowed to produce, obtain or supply articles which can be used for computer misuse.

How do UK information security bloggers and conference speakers go about this, as technically, even with non-malicious intent, there is a violation of the CMA.

The only thing that allows this is common sense. In reality pretty much every security testing team could fall foul of this as it is very broad.

Luckily our legal system is not yet that stupid, so 'intent' is the important point here.


Validate XML-DSig by DVCS Is it possible to validate an XML message (with XML-DSig or XAdES signature) by a Data Validation and Certification Server (RFC 3029)? Should it understand XML signatures or not? Could it parse XML? Or message must be in a specific format to be validated by DVCS?

According to RFC 3029:

DVCSRequest ::= SEQUENCE  {
    requestInformation         DVCSRequestInformation,
    data                       Data,
    transactionIdentifier      GeneralName OPTIONAL
}
Data ::= CHOICE {
      message           OCTET STRING ,
      messageImprint    DigestInfo,
      certs             SEQUENCE SIZE (1..MAX) OF
                            TargetEtcChain
}

  The requester fills the 'data' element as follows:

  For a vsd service request, the requestor encapsulates a CMS
   SignedData object in the value octets of the 'message' choice.
   It is up to the requester to decide whether and how to provide any
   certificate that may be needed to verify the signature(s) in the
   signedData object.  A requester MAY add certificates to the
   encapsulated signedData object or in the certificate list of the
   request.

Does it mean that DVCS doesn't support XML-DSig? Message must be in a CMS SignedData format?

An RFC 3029 compliant server must process CMS SignedData format messages, not any sort of XML messages.

That being said, converting between ASN.1 and XML is a common use case.  A modern implementation would/should probably accept various types of input messages, not just CMS SignedData.

I believe that it's also important to note that RFC 3029 is of type 'experimental' and is now 12 years old.


Should I be worried if I accidentally entered my password in a username field? Occasionally I will fail to hit Tab properly when entering a username/password combination.  This results in me submitting username "myUsername$ecretPa$$word" along with a blank password.  I always try to change my password shortly after doing this, fearing that it's entirely possible that someone maintaining the site is logging failed login attempts.  It seems reasonable that someone (even a security-conscious admin) would consider logging attempted usernames both useful and safe.  But if this happens my password would be stored in some unencrypted log somewhere, right along with my username.

Is this a reasonable concern?  Am I being too paranoid?

The short answer is that it is very, very likely that your concatenated username and password exist on an unencrypted log somewhere that a larger group of people would conceivably have access to than the restricted logs.

You are not paranoid to change your password and should change it when this happens.


Problems with l0phtcrack I recently wrote a website for my company and have been asked to Pen test it as well as the server. Have run SQL map and no vulnerabilities there, however I want to check if my hash and things are good enough as well as any vulnerabilities to the server its self. When I trained we had a working copy of L0phtcrack. Downloaded the trial to see if it was still as good.

I set it to the following:

>  · Retrieve passwords by sniffing the local network   · Perform
> 'Strong' password audit   · Display domain password belongs to   ·
> Display passwords when audited   · Display password hashes   · Display
> time spent auditing each password   · Give visible notification when
> done auditing   · Show method used to crack password

However this gets me:

  No encrypted passwords were imported. The l0phtcrack 6 wizard cannot
  continue. Please try another password retrieval.

So I run the wizard again to check my local PC just to see if there is a problem, And I get the same response I cannot do anything.

So I have two questions:

1: What am I doing wrong? It has been a fair few years since I properly pen tested and am very rusty.

2: Anything better out there currently to detected and crack packets? I know about wireshark for sniffing.

---update---

I do now realize that it has stopped being supported and developed, in that case good alternatives for packet sniffing and cracking

I haven't used l0phtcrack in a long time, but I would suggest trying out John the Ripper.

I would also recommend grabbing one of the community enhanced version, for windows, here is a direct link http://www.openwall.com/john/g/john179j5w.zip.

I should also mention that you will want to grab a decent wordlist as the built in one may not be enough. There are a few good wordlists to start with at https://wiki.skullsecurity.org/Passwords.

The JTR syntax can be a bit confusing, but it is really powerful if you want to really get into password cracking.


How does shellcode really run? I read the book "The Shellcoders Handbook", and in it there is some C code which will execute shellcode (it will only call exit syscall).

char shellcode[] = “\xbb\x00\x00\x00\x00\xb8\x01\x00\x00\x00\xcd\x80”;

int main(){
    int *ret;
    ret = (int *)&ret + 2;
    (*ret) = (int)shellcode;
}

Im interested about these three lines in main function. What exactly are they doing and how do they execute the shellcode?

I might have figured it out: Before main was called on the stack were pushed ebp and return address from some previous stack frame, so here we are overwriting that address and placing our shellcode there. Is that right?

TL;DR This is a way to execute shellcode which no longer works.
What is a function?
Shellcode is just machine code in places where it is not normally found, such as a variable of type char. In C, there's no distinction between functions and variables. A function is just a variable that points to executable code. This means that, if you create a variable that points to executable code and call it as if it were a function, it will run. To illustrate how it is just a variable, see this simple program:
#include <stdio.h>
#include <stdint.h>

void print_hello(void)
{
    printf("Hello, world!\n");
}

void main(void)
{
    uintptr_t new_print_hello;

    printf("print_hello = %p\n", print_hello);
    new_print_hello = (uintptr_t)print_hello;
    (*(void(*)())new_print_hello)();
    print_hello();
}

When compiled and executed, this program gives output like so:
$ ./a.out
print_hello = 0x28bc4bf6da
Hello, world!
Hello, world!

This makes it easy to see that a function is nothing more than an address in memory, compatible with type uintptr_t. You can see how a function can be referenced simply as a variable, in this case by printing its value, or by copying it to another variable of a compatible type and calling the variable like a function, albeit with a bit of casting magic in order to make the C compiler happy. Once you see how a function is nothing more than a variable pointing to some executable memory, it's not a stretch to see how a variable pointing to some bytecode you manually define can also be executed.
How do functions work?
Now that you know a function is just an address in memory, you need to know how a function is actually executed. Once you call a function, typically with the call instruction, the instruction pointer (which points to the currently executing instruction) changes to point to the first instruction of the function. The location right before the function is called is saved to the stack by call. Once the function is finished, it is terminated with the ret instruction, which pops it from the stack, saving it back to the IP. So a (somewhat simplified) view is that call pushes the IP to the stack, and ret pops it back.
Depending on the architecture and OS you are on, the arguments to the function may be passed in registers or the stack, and the return value may be in different registers, or the stack. This is called the function call ABI, and it is specific to each type of system. Shellcode designed for one type of system may not work on another, even if the architecture is the same and the operating system different, or vise versa.
What does your shellcode do?
Let's look at the disassembly of the shellcode you provided:
0000000000201010 <shellcode>:
   201010:      bb 00 00 00 00          mov    ebx,0x0
   201015:      b8 01 00 00 00          mov    eax,0x1
   20101a:      cd 80                   int    0x80

This does three things. First, it sets the ebx to 0. Second, it sets the eax register to 1. Finally, it triggers interrupt 0x80 which, on 32-bit systems, is the syscall interrupt. In the SysV calling ABI, the syscall number is placed in eax, and up to 6 arguments are passed in ebx, ecx, edx, esi, edi, and ebp. In this case, only ebx is set, meaning the syscall takes only one argument. Once the 0x80 interrupt is called, the kernel takes over and looks at these values, executing the correct system call. The system call numbers are defined in /usr/include/asm/unistd_32.h. Looking at that, we see that syscall 1 is exit(). From that, we can see the three things this shellcode does:

It sets the first argument of the syscall to 0 (which means exit success).
It sets the syscall number to 1, which is the exit call.
It invokes the syscall, causing the program to exit with status 0.

When you look at the big picture, we see that the shellcode is essentially equivalent to exit(0). It does not need ret because it never returns, and instead causes the program to terminate. If you wanted the function to return, you would need to add ret to the end. If you don't, at the very least, use ret, then the program will crash unless it terminates before it reaches the end of the function, as in your example with the exit() syscall.
What's wrong with your shellcode?
The method of calling shellcode you are showing does not work anymore. It used to, but now days Linux does not allow arbitrary data to be executed, necessitating some arcane casting. This older technique is explained well in the famous Smashing The Stack For Fun And Profit article:
   Lets try to modify our first example so that it overwrites the return
address, and demonstrate how we can make it execute arbitrary code.  Just
before buffer1[] on the stack is SFP, and before it, the return address.
That is 4 bytes pass the end of buffer1[].  But remember that buffer1[] is
really 2 word so its 8 bytes long.  So the return address is 12 bytes from
the start of buffer1[].  We'll modify the return value in such a way that the
assignment statement 'x = 1;' after the function call will be jumped.  To do
so we add 8 bytes to the return address.  Our code is now:

example3.c:
------------------------------------------------------------------------------
void function(int a, int b, int c) {
   char buffer1[5];
   char buffer2[10];
   int *ret;

   ret = buffer1 + 12;
   (*ret) += 8;
}

void main() {
  int x;

  x = 0;
  function(1,2,3);
  x = 1;
  printf("%d\n",x);
}
------------------------------------------------------------------------------

   What we have done is add 12 to buffer1[]'s address.  This new address is
where the return address is stored.  We want to skip pass the assignment to
the printf call.  How did we know to add 8 to the return address?  We used a
test value first (for example 1), compiled the program, and then started gdb

The correct version of your shellcode for newer systems would be:
const char shellcode[] = “\xbb\x00\x00\x00\x00\xb8\x01\x00\x00\x00\xcd\x80”;

int main(){
    int (*ret)() = (int(*)())shellcode;
    ret();
}


What is the difference between "missing function level access control" and "privilege escalation"? I was going through a web application from my account and I was able to view some confidential information about my other account. I want to know if this is a case of missing function level access control or privilege escalation.

Say my URL is: www.example.com/user1/info/1 This URL contains my profile information. Now, I change this URL to www.example.com/user1/info/2 This gives info about the profile of another user which should not be accessible to me.

Privilege Escalation means that your rights have been elevated throughout the environment. In your scenario, your rights have not been changed. The problem is that everyone can see everyone's data. This scenario is a classic access control problem.


How does the Fake Authentication Attack from aircrack-ng work? I'm making a school project about the AP attacks and I'd like to know how does the Fake Authentication Attack from aircrack-ng actually work and how to prevent it?

I read a lot of articles but nothing goes too deep into it. Thank you for your answers!

In fake authentication attacks, there are two types of WEP authentication (Open System and Shared Key) you can only do  fake authentication for WEP enabled AP. This useful when you need an associated MAC address in various aireplay-ng for example in WEP cracking attack when there is no associated client.
It should be noted that the fake authentication attack does NOT generate any ARP packets
How it works:

It sends an Authentication Request
It gets Authentication Reply, if successful it would send (3)
It gets an Association request
Association response it will make it successful

ARP-Replay attack is when an ARP packet is re-transmitted back to the access point. This, in turn, causes the access point to repeat the ARP packet with a new IV.
When this is complete and successful you can know do the Arp-replay attack so you can generate more ARP packets so that the IV can be revealed. This works because for an AP to answer to an ARP packet it has to have the MAC address of the wireless card that is doing that is replaying the captured ARP. That is why we do fake authentication.
To prevent this i only know of one way which is to stop using WEP and use WPA and WAP2. Because remember Fake authentication only works with WEP enabled AP.


MySQL 3306 open port security I know that having the MySQL 3306 port is unsafe even if you restrict the user access based on IP. But what if you really need remote access to your database ? Maybe two applications reading and updating data at the same time.

If we have two applications one on the same host as the database and another one remote what would be a viable and secure way of sharing the same data ? Should we host the database some other place ? Should we have two local databases for each application and keep them up-to-date ? What would you suggest ?


Can the server detect when a client has disabled certificate pinning? Many mobile applications enforce certificate pinning in order to make a man-in-the-middle attack difficult to accomplish. However, with a jailbroken/rooted device, it's possible to disable the certificate pinning on the client. For example, by using SSL Kill Switch on iOS.

A previous question asked how to "prevent bypassing certificate pinning." I understand how prevention is effectively impossible, since as long as the client has root on the client device, any prevention is limited to "security by obscurity" and reduced to playing a cat-and-mouse game.

However, I'm interested in whether it is possible to detect, from the server side, when a client has disabled certificate pinning.

Specifically:

1) Is it possible, using only low level SSL functionality, to detect when certificate pinning has been disabled by the client?

2) If not possible with low level SSL functionality, then is there some information the server could require from the client in order to prove that certificate pinning remains enabled?

No, it is not possible to determine the state of SSL pinning at the client. SSL pinning is part of the certificate validation done solely inside the client and the only feedback the server gets is if the validation succeeded (connection continues) or not (connection closed, maybe TLS alert).
Also there is nothing fully reliable the server could to to "ask" the client about the state of pinning because you cannot expect a true response from an application which runs on a device fully controlled by the "attacker".

But one can make it harder to disable pinning undetected.
If you are building an application and want to detect if pinning is disabled you might make connections to two different hosts. For one of the hosts you expect a valid and pinned certificate and for the other a valid but not pinned certificate. If both connection succeed you can conclude that somebody tampered with the pinning. Of course if the "attacker" knows this behavior of the application he can work around your detection but without the knowledge it gets harder. And more complex (and maybe even dynamic) schemes like this should be possible to make it even harder.

But the question remains what you get from knowing if pinning is disabled or not. If you make sure that pinning is not possible you might deter man in the middle sniffing. This still leaves the option to sniff the data inside the application, i.e. before they get encrypted and after they got decrypted. This means analyzing and even modifying the data is still possible by an attacker in control of the device.


Is this hybrid (cookie, jwt) authentication method for web applications known and practical? I have been working with web applications for a while, some months ago I found a possible approach to get the security advantages from Browsers while using cookies for authenticating requests, with the stateless advantages of JSON-Web-Tokens (JWT).

I'm looking to known whether this is a known and possibly broken approach.

Details:

It is well-known that cookie-based authentication can be secure against XSS but introduces the complexity of CSRF, also, JWT is handy unless you need to invalidate tokens (XSS is a problem too).

The approach:

When logging in, the user receives a JWT that has a very short validity period (like 3 minutes).
After logging in, the user also receives a cookie that allows to renew the JWT.
The user keeps calling the server attaching the JWT (the cookie is attached by the browser), the server authenticates the requests using this token.
When the server gets a expired token, it loads the session from the cookie and returns a new JWT (or the request is rejected and the user renews the token with another request), then, the original request is retried with a valid token.

Some of the advantages:

Token invalidation, if the JWT is ever compromised, it lives for a very short period of time.
CSRF protection, on a successful CSRF attack, the browser gets a new short-lived token without performing any sensitive operation on the server. - There could be lots of efficient stateless authenticated requests.

Refresh tokens
This is quite similar to the refresh token pattern. In it, you have two JWTs - one short lived for ordinary requests, and one long lived for renewing the short lived one. The short lived can not be revoked, but the long lived can. This is a pattern that is commonly used, giving a good trade off between revocability and performance.
Your approach is different in that the long lived token has been switched for a cookie. Let's think some about the benefits and drawbacks of that.
CSRF
If you check that the expired token is valid before you issue a new one based on the cookie, it should technically protect you from CSRF. A CSRF attacker could not create a token, and hence not make a succesfull attack.
Still, I feel a bit uneasy about this. First, you must make a special JWT check that accepts expired tokens. That's a bit messy with room for implementation mistakes. Second, expired tokens suddenly become sensitive data. That doesn't feel so good.
XSS
You could mark the cookie as HTTP only, hence limiting the power of an XSS attack somewhat. This seems to be what motivates your scheme?
I would say this is not worth much, though. The attacker could do a lot with just the token for a few minutes. If more time is needed, just run some JS on the client constantly refreshing tokens, sending new ones to the attacker. Or just run whatever requests you want to run from the client.
Basically, if you have an XSS vulnerability it's game over. You can't really limit the impact of that with a scheme like this. You might stop a script kiddie, but not more than that.
Conclusion
I can't find an exploitable fault with your scheme, so I wouldn't label it "unsecure". But I can't really see a big benefit either. But maybe I am missing something.
What you do create, though, is more complexity. You create new patterns, new things to implement, and you mix different sort of solutions (cookies, tokens) together. It's not very clean, for a lack of a better word.
So for that reason I would go with something more standard instead, like refresh tokens.


Virtual Machine Introspection for VirtualBox Is possible use Virtual Machine Introspection (VMI) for monitoring system calls and internal system operations in Oracle VirtualBox machine (if I use Linux as quest system) in this time? I have read few research papers about VMI, but unfortunately these projects are dead today... I know about LibVMI project, but it does not have support for VirtualBox. I would use it for monitoring of high-interaction honeypot.

Thanks for replies...

you should check the Winbagility project which provides the VMI APIs for VirtualBox (called FDP for Fast Debugging Protocol).

A library similar to libvmi has been written on top of it:
icebox.

I don't believe that they will make a libvmi driver for FDP.
The reason is that they used VirtualBox because it is a cross-platform hypervisor, so no need to be compatible with other hypervisors.

It's a late response, but it may help someone.


IIS 7 World Wide Web Publishing Service service account We have a security requirement for IIS 7 (Windows 2008R2) that reads as follows:

  The service account ID used to run the web site must have its password changed at least annually.

    Go to Start, Administrative Tools, then Services.
    Right click on service name World Wide Web Publishing Service, Select Properties, then select the Log On tab.
    The username next to this account is the web service account ID.  If any other user than IUSR is listed, continue to step 4.  If the service account IUSR is used to run the service, this is not a finding.
    Open a command prompt and enter Net User [service account ID], press Enter.
    Verify the values for Password last set and Password expires to ensure the password has been changed in the past year, and will be required to change within the coming year.

  Configure the service account ID, used to run the web-site, to have its password changed at least annually or use the service account IUSR.

There are no specific implementation details and it seems like guidance carried over from earlier versions of IIS.  IUSR is not available for selection as a "log on as" service account for the World Wide Web Publishing Service and attempts to change the account have failed.  ("Error 1079:  The account specified for this service is different from the account specified for other services running in the process.")  An attempt to use the same account for the Windows Process Activation Service and the World Wide Web Publishing Service also failed ("Error 1068:  The dependency service or group failed to start.")

I'm admittedly not an IIS 7 expert, so if anyone has step-by-step instructions for accomplishing this, I'd appreciate the help.  Let me know if I've left out any necessary information.  Thanks!

We have a security requirement for IIS 7 (Windows 2008R2) that reads as follows:

I am sorry you are saddled with this highly questionable policy. It's a lot of operational bother and risk of downtime for very little security win. Service passwords are subject to different risks and limitations to user passwords, it's not appropriate to apply user-password controls like rotation requirements to them.

  IUSR is not available for selection as a "log on as" service account for the World Wide Web Publishing Service

You shouldn't touch the WWWPS's WinNT-Service account at all, I don't know where this approach has come from. The service will need to remain root (LocalSystem) so it can impersonate the accounts that the application pools are running under.

Setting service users for the apps themselves should be done by setting the application pools, usually to a built-in user such as the default ApplicationPoolIdentity (but don't use LocalSystem!). Unless it needs to access network resources in which case you will need a domain service account, and then you will need to check the password that service account is using if it is subject to a horrible password rotation policy.


Is it safe to use TrueCrypt inside an encrypted Virtualbox guest OS? In order to minimize potentially compromised software from reading what I'm writing in Veracrypt I want to use the software inside an encrypted guest OS with no Internet, specifically Ubuntu 16.04. Does this minimize the chances any piece of software in the host OS will compromise TrueCrypt?

Not in any way. Host software (eg. kernel rootkit) still has access to everything ie. your encryption keys inside VM's RAM.

Usually you use virtualization to protect the host against hostile code, so that the code running inside the VM can't harm the host (and there are still loopholes). There is no way to protect a VM against the host.


In PubKey Encryption, can a secret encrypted by a public key be validated by same public key? I'm creating a messaging system where users send encrypted messages encrypted by the receivers public key. The receiver would decrypt the message using his/her private key. As the messaging service, is there any way that I can validate that the encrypted message has been properly encrypted by the receivers public key? Assuming I do not have access to the original plaintext message, is there any validation that can be done on the secret message to return an error to the sender if the message will not be able to be decrypted by the receiver's private key? The public keys will be accessible by my system.

Integrity is what you are looking for. With integrity, the receiver can check that the message is valid. One can use Message Authentication Codes like EAX and GCM. Take care of the order of operations if you insist on this. Also, take care of proper padding if you are using RSA. For encryption PKCS#1.5 and RSA-OAEP and for signature RSA-PSS.

Normally, we don't send messages with the public key cryptography. We use hybrid cryptosystem in which the public key cryptography is used for key exchange as in Diffie-Hellman Key Exchange, DHKE, in fact, the Elliptic Curve version is better, ECDHKE.

Once a key is exchanged, the parties can send messages with AES-GCM. The GCM mode is an Authenticated Encryption (AE) mode that gives you confidentiality, integrity, and authentication. You can also use chacha20-poly1305 AE.


How can I find the default KDF for my version of GPG? I am trying to find the default KDF for my version of gpg:

gpg (GnuPG) 2.2.6
libgcrypt 1.8.2

Does anyone know how?

GnuPG uses an algorithm called S2K (String-to-Key). This isn't unique to GnuPG, and is actually part of the official OpenPGP standard, specifically RFC 4880 § 3.7. The strongest version of this KDF, version 3, works by repeating the key and the salt many times and hashing the whole result.

The specific hash algorithm used is specified with --s2k-digest-algo.


Spoofed number sending threats to students. Can it be traced to sender? A SMS message was sent to several students at my son's school claiming to be my son stating that he was going to shoot up the school.  My family didn't receive this message but I have the phone number it was sent from.  I did a reverse lookup of the number and it looks like the number was spoofed using VOIP protocol and possibly owned by Google or Bandwith.  Can this be traced to the actual sender and how?  There were at least 4 students how received the message.  I don't know what providers they use for their phones.  The police are involved but I don't know how motivated they are.  They don't believe its a credible threat since my son has had previous incidents with rumors and posting on social media that he was going to shoot up the school.

From what we understand, someone used the services provided by Google or another host to create an anonymous threat message and signed it with your son's name. Hosts such as Google usually have logs that indicate who they lent out the "temporary service" to at any given time. They would have the IP address or some other form of identifiable information associated with the entity who sent the message. It is highly unlikely that they are not maintaining any logs at all. Logs are maintained for cases such as this where improper use of services is observed.

The real question is -- can you obtain this information from the host. The short answer is -- not really. Hosts such as Google are reluctant to share such details with just anyone due to privacy concerns. Your best bet is if the law enforcement involved requests these details from the host. They are more likely to comply with the request if law enforcement demands it for a valid reason. Unfortunately, there is not much you can do as an individual. Anonymity is the nature of many Internet services.


An alternative to traditional passwords: is there some merit to this idea? If you've got a website aimed at people that are not necessarily technically proficient, letting new users choose their own password isn't very secure because of the simple fact that a lot of people don't choose secure passwords. Some methods of dealing with this problem are:

Most common: have a 'password strength checker' or demand that the password contains a certain number and different kinds of characters. These often aren't very good and result in passwords that are not actually very secure and/or difficult to remember (of course this doesn't mean you can make a very good password checker, although that is pretty difficult).
Generate a random sequence of characters: very impractical and insecure because people tend to write these down because they can't remember them.
Two phase authentication through SMS or e-mail: not very convenient for the user.

I've thought of a different approach that is inspired by this XKCD comic. It works like this:

When a new user registers, they are presented with 20 randomly picked dictionary words. They are asked to make a secret sentence (let's call it a passphrase) that contains at least five of these words. They are encouraged to create a nonsensical sentence that is hard to guess but easy for them to remember. They have an option to refresh the 20 random words multiple times if they can't think of anything.

This passphrase will simply function as their passwords. You only have to check they use at least five of the provided words and take the usual security measures you would for regular passwords.

I personally think this is a pretty user-friendly way of letting people choose strong passwords; and the problems I mentioned for the other methods appear to be avoided. Of course I could be completely wrong and might be overseeing something important. So I'd really like to hear what the smart people here think about this system.

That sounds great to me.

The entire point of generating passwords is to pick one that is extremely hard for an attacker to guess, and easy for the authorized users to remember and type in.
Ideally a password generating process should generate such extremely hard-to-guess passwords even if the attacker knows exactly which password generating process you used ( Kerckhoffs's principle ).
If the "perfect knowledge" attacker finds it hard to guess the password, then other attackers will find it even harder.

I'm going to assume that you use a /dev/random that is not broken (it's connected to a hardware random number generator or a cryptographically secure pseudorandom number generator).

Many people seem to feel that a so-called "10-random-character password" formed from a randomly selected uppercase letter, randomly selected lowercase letters, followed by a randomly-chosen digit, a total of 10 characters long, is more than adequate for many purposes. That gives ln2( 26^9 * 10 ) = 45.6 bits of password strength.

If you completely randomly pick words from any list of 7776 words ( 6^5 words ), such as the the standard Diceware list or the easier-to-type-on-a-phone Dialdice list, and the attacker knows exactly what wordlist you use,
and your user chooses the first 4 words you select, in the order you select them, the user gets ln2( (6^5)^4 ) = 51.7 bits of password strength.

increasing randomness?

If the user hits the refresh key a random number of times, and then rolls the dice to randomly selects 4 words from among the ones you present, and then rolls the dice to shuffle those words into a random order to generate the 4-word Diceware passphrase, then (again assuming /dev/random is not broken) I can a priori calculate that it has no effect -- the user still has 51.7 bits of password strength.

If the user thinks that's not enough password strength, then I think your system should allow the user to add additional letters, symbols, words, etc.

effects of non-random selection

Your user is unlikely to make a completely random selection, but that's OK. In the worst case -- your user puts things in alphabetical order or chooses some other order, and the attacker somehow knows exactly what order that is,
you've lost -ln2( 4! ) = -4.6 bits of password strength from a 4-word Dialdice passphrase.

If we assume the user always rejects certain words, and keeps refreshing until he can make a passphrase without those words, and those words make up about 1/6 of the dictionary, and somehow the attacker knows which words those are, then for a 4-word Dialdice passphrase we've lost about -1 total bit of password strength.
(The worst case is a loss of N bits of password strength for every 2^N times the user pushes the refresh button -- but that doesn't seem to be realistic to me).

The combination of these two effects results in your users having 46.1 bits of password strength with a 4-word Dialdice passphrase -- stronger than the 10-random-character password, and much easier to memorize.

If you later think that's not enough password strength, it's pretty straightforward to increase the minimum number of words in the passphrase,
or switch to a wordlist with more words in it, or both.
(You could use the approach in "Migrate old md5 passwords to bcrypt passwords" to force everyone with old, low-strength passwords to upgrade to new, higher-strength passwords).

That sounds great to me.


PHP gethostbyname security implications I'm working on a PHP application.
There is a requirement to find IP's by hostname and i have to resort to gethostbynamel for that.
Looks like there is no other way.

I was wondering if there are any security implications related to this.
I am validating the hostname given as input from end-user by using regular expressions.

I have two options:

When user submits a form with hostname, validate it and use gethostbynamel
When user submits a form with hostname, validate it store it in database and use cron job which runs gethostbynamel

Will there be any difference in the above methods?

Security is top priority for the application.

The php function gethostbynamel is a wrapper over the native OS gethostbyname function.
The implementation can be seen here.

So the same vulnerabilities that apply to the gethostbyname syscall will apply to your code.
I don't see any existing gethostbyname vulnerabilities that would bother me.

So basically as long as you are validating the hostnames accurately, you should be fine.
See this SO answer and this text for help on regex.

Amongst the two options you posted, they don't make any difference so far as the security implications are concerned. gethostbyname is a network call, so there is a non-negligible time associated with it. This can be one of the differentiators why you'd choose to use one over the other.


How to automate publication of CRL and CRT files to CDP and AIA location? I'm setting up Two-Tier PKI for the first time in our Windows Server 2012 R2 environment and I've read several tutorials on setting this up.  Some of the methodology is very different, but I've chosen to go with the guide at http://www.rebeladmin.com/2018/06/step-step-guide-setup-two-tier-pki-environment/.

One thing that several guides I've read agree on is that a copy of the Offline Root CA and Enterprise CA CRT and CRL files should be made available via IIS/HTTP, for example - http://pki.mydomain.local/CertEnroll (and also published to Active Directory).  Obviously I'm going to have to manually copy and publish files from the Root CA, but how should I manage publishing the CRL and CRT files to the CDP/AIA location for serving up via HTTP?

The tutorials suggest creating a shared folder at C:\CertEnroll and copying files from C:\Windows\system32\CertSrv\CertEnroll\ into that directory, for hosting via IIS/HTTP, but why can't files be published to that directory in the first place, so that I don't have to manually copy them each time the CRL is updated - every 13 weeks as they've suggested?

EDIT: On a side note, is it even necessary to publish CRL and CRT files via HTTP if they're also in Active Directory / LDAP?

You shouldn't really install the webserver (IIS in your case) on the same server as the CA any more than you should install the CA on a server which provides other services (DCs are a common one).

Instead, stand-up another server for IIS. Better still, stand-up two and load balance them.

Create a share (such as cdp$) on the IIS (or IISes if that's the correct term) and make sure that this share is writable by members of the CertPublishers group.  This group is automatically created when you install ADCS and populated with all CAs in the forest.

On the ADCS CA's properties dialogue on the Extensions tab, add the path to this share, as well as the variables that create the CRL filename, as a CDP entry.  Something similar to:

file:\\iis1.example.com\cdp$\<CaName><CRLNameSuffix><DeltaCRLAllowed>.crl

and ensure that Publish CRLs to this location is ticked for this entry.

Every time your CA publishes a CRL, it will push a copy to this share.  That share needs to be published in IIS and a URL which points to the CRL file published in the certificate issued by this CA.

Therefore, on the same dialogue as before create an entry similar to:

http://iis1.example.com/cdp/<CaName><CRLNameSuffix><DeltaCRLAllowed>.crl

and ensure Include in the CDP extension of issued certificates is ticked.  Note that if you want a more generic name and/or you're using a load-balancer, you can change the hostname element above to anything as long as you configure DNS so that it resolves to the correct server or load-balancer.  Maybe something generic, such as pki.example.com?

So that relying-parties can find the Enterprise Issuing CA certificate when misconfigured servers don't send them, add something similar to the following to the AIA extension on the same tab as above:

http://iis1.example.com/cdp/<CaName><CertificateName>.crt

and ensure Include in the AIA extension of issued certificates is ticked.

You do not need to add a file:// entry for the AIA extension as the CA certificate only changes once every x years, so you can manually upload the Enterprise Issuing CA certificate to IIS.

You also manually upload the CRL from the Root CA to this same IIS server, but you should:

Have previously added a similar http entry to the one above on the Root CA so that the correct URL is embedded in the enterprise issuing CA certificate.
Ensure that the CA Names differ so that you end up with different filenames (to avoid overwriting CRLs).

You do not need to publish the Root CA certificate in IIS as every relying-party should have this certificate in their trust-anchor store already.

Finally, you should avoid AD/LDAP or any other directory service for publishing CRLs as not all relying parties can access them - stick to HTTP.


Why use WPS on an unsecured WiFi AP? I was searching for my home WiFi AP (router's broken and am trying to fix it), when I found a WiFi access point that does not have any security but does have WPS enabled:

Thinking that it probably had a MAC address filter, I tried connecting to it. I was able to connect successfully and Internet worked.

WPS is weak by design, but having it enabled on a secured WiFi AP (such as the one above NETGEAR_EXT) makes sense. Having it enabled on an unsecured AP where anyone can connect doesn't; it's like having a lock on a door, when the door is open already.

Does using WPS on an unsecured WiFi AP improve security. If so, how?

You've hit it pretty hard on the head of the nail here and driven it home. It doesn't make sense. This really only matters if some sort of other filter is in place to prevent connection, and it wasn't present on this one. Even then you'd still probably have a key in place to make sure no one can snoop on plaintext. It just doesn't make sense to do this.


Burp configuration to allow SSL connection I'm trying to capture Request/Responses using Burp on Mozilla.
I've configured Burp Proxy on 8080 and have set same proxy settings on Firefox however when trying the Gmail link, Firefox gives "This Connection is Untrusted" error message.

While other pages are allowed like Google which also work on HTTPS. Help me with this so that I can run Burp to capture request/responses ?

You will get that error when you access Gmail, and there isn't really anything you can do about it, except to try different browsers.

This is due to HSTS (HTTP Strict Transport Security) which Google has implemented along with the option to include certificate pinning.  This means that in order to access their sites without this warning, you need not only a certificate that your computer believes is valid, but specifically a certificate that Google has said is valid.   Without an actual cert that Google has pinned, the connection won't be trusted.

HTST is generally implemented as a header so if you're an active man-in-the-middle you might have a chance to strip the header (or at least modify it to not include cert pins) before it gets to the browser, preventing it from thwarting you, but not even this method will work with Gmail, since Google properties (among others) are pat of the preloaded HSTS set that comes with some browsers, including Chrome and Firefox.  This means that your browser comes pre-installed withe the knowledge that Gmail requires HTTPS and specific, pinned certificates.

So, try different browsers, and try to strip any pinned certificates off the Strict-Transport-Security response header before it gets to the browser so that they won't impact your ability to MitM in browsers that don't have Gmail in a preloaded HSTS list.


Is it possible to modify SSLStrip such that the client has an HTTPS connection? I've only seen examples of this type of MITM attack stripping SSL completely and this isn't ideal as most devices warn their users when the connection is not secured.

So is it possible to create the following system:

Website <(HTTPS)> Attacker <(HTTPS)> Victim

Where the attacker gets one set of credentials from the website and is therefore able to decrypt the connection and creates another set of credentials which are passed on to the victim.

That way the attacker can decrypt/modify the packets as they come, encrypt them again with the credentials s/he passed created for the target and the connection looks legitimate.

No, to be able to perform that the attacker must have the private key associated with the certificate of the website (private key used to generate the public key in the certificate).  The client will send a challenge to the website during the SSL handshake and if it does not come back signed with the private key of the website it knows it is not talking to the website in it is trying to talk to.

The attacker cannot generate a different key-pair because the client has a CA certificate (in the browser or as part of the OS) that sings the website's certificate.  The certificate signed by the CA relates the domain of the website to a public key and only the private key of that specific domain (i.e. that public key) would be able to sign the challenge text correctly.

On the other hand, if the attacker can get hold of the private key of the website (to achieve which he would likely need to copy it from the website's servers) then he would be able to perform HTTPS to the client.

Yet, this is not an SSLstrip attack anymore, this would be a plain compromised certificate.  And, if the website discovers the compromise, will likely add its certificate to a database of compromised certificates.  For example the OSCP database which several browsers will check (of course the attack may be ale to spoof the OSCP request).

Another option is to fool the client (thanks @crovers).  If and attacker can make the client to accept a new root CA certificate, he can sign the domain with his own CA and provide that as a certificate instead of the real one.

This again is not SSLstrip, this is a form of phishing the user into installing bogus CA certificates.


Ring -3 exploits and existence of other rings Concept of Rings

Rings were introduced in the forerunner of UNIX, Multics, and had 8 rings for reading, writing, executing and calling (I don't quite understand why it needed 8 rings to do this, if anybody does consider that a bonus question!).  The x86 architecture by Intel incorporated the idea of rings into hardware, with 4 rings corresponding to ring 0 being for the kernel, 1 and 2 for device drivers, and 3 for applications.

Situation in 2019

Ring 0 and 3 are typically the only ones used in modern x86 operating systems for most users, with ring 0 being reserved for kernel-level operations and ring 3 for user-level, although there are some exceptions; for example, VirtualBox uses ring 1 to allow the use of virtual hosts.  Generally, code in ring 3 can't access memory or operations in ring 0, although that was at the root of issues from Spectre and Meltdown disclosed in January 2018.

'Ring -1' has also been introduced for hypervisors - Intel VT-X and AMD-V add 9 machine code instructions, introducing the concept of ring -1.  Ring -2 is typically called SMM (system management mode) and is used for very low level operations such as power management and used only by system firmware.  It has been used with multiple exploits for rootkits to reside in without the operating system being able to interefere.

'Ring -3' was coined for levels operating below that after an attack was demonstrated by Invisible Things on the Intel Q35 chipset (fixed in Q45 and later).  This worked by remapping the first 16 MB of RAM reserved for the Intel Management Engine and operated even with a device in an S3 state.

ARM processors seem to use only 3 rings, ordered the other way around; PL0 being user, PL1 being operating system, PL2 being hypervisor.  See Figure 3.20 and this page from ARM.

Summary and question

There have been several exploits over the years demonstrating exploits on rings outside those originally described by the x86 architecture. What would an even lower-level ring look like (ring -4 in Intel, PL3 in ARM, or ring -3 in AMD) and has there has been any work regarding exploits in this area.  Additionally, I've tried to follow the guide on good suggestive questions so that explanations on the 'how' and 'why' are applicable.

Negative rings are false rings. They are not actual privilege levels of the CPU. The way rings work is simple. Some instructions have privilege checks where they verify that the current privilege level, or CPL, is sufficient and if it is not, the instruction fails with a general protection fault. CPL0 is ring 0, CPL1 is ring 1, etc. Some instructions will require a certain privilege level depending on the value of its operands (for example, mov may return a GPF if the CPL is insufficient and the memory address given to it requires ring 0 to access, or if a register given to it is privileged). Others always require a higher privilege level. Still others can be configured to require CPL0. An example of that is the RDTSC instruction. It will throw a general protection fault unless either the TSD bit in CR4 (the fourth control register) is unset, or the current privilege level is zero, or the system is in real mode (determined by checking if the PE bit in CR0 is unset). This instruction is internally defined as:
if(CR4.TSD == 0 || CPL == 0 || CR0.PE == 0) EDX:EAX = TimeStampCounter;
else Exception(GP(0));

I wrote a bit more about rings and their uses in this answer.
There is no such thing as a negative privilege level. They don't exist. Ring -1 is merely a nickname for hypervisor functionality (VT-x on Intel). Ring -2 is a nickname for System Management Mode context, or SMM, which executes isolated code when a special interrupt called an SMI occurs. Ring -3 is a nickname for the code that runs on the CSME, an i486/i586 hybrid co-processor inside modern Intel chipsets that, indirectly, has access to system memory (I say indirectly because it's not designed for full memory access, but it does expose a virtual PCIe device, and it turns out that it can also interfere with DMAR, used by the IOMMU). Using protection rings as an analogy for these super-privileged contexts can be helpful, but the analogy breaks down when you start looking at x86 in detail.

What would an even lower-level ring look like

The only thing that could be thought of as lower than any of these is called probe mode (which is, again, not a real ring). It is initiated by JTAG and provides an extreme amount of control over the entire CPU. Probe mode is not nearly as powerful as it used to be, but there may be ways to unlock a more powerful version of probe mode with access to special Intel hardware and credentials.

has there has been any work regarding exploits in this area

Not really. JTAG requires physical access and, for Intel, a password specific to the CPU's serial number. It's also possible that modern commercial Intel chipsets have JTAG and related debugging features disabled on non-development boards by burning specific OTP (one-time programmable) fuses built into the chipset. Someone more familiar with Intel may be able to clarify.


Nmap port scan and FTP bounce Suppose that there is a network of machines, and there is a server with ftp server that allows ftp bounce.

I do a nmap scan on the network nmap -sC -some other parameters network address.

Does nmap use ftp bounce to attack the network?

If not, how do I use ftp bounce to check/attack ports?

It is possible to use FTP bounce using nmap to port scan the network.

E.g. :

nmap -v -b -P0 <username>:<password>@<ftp_server_address> <address(es)_to_scan>

we use the -P0 so we don't try and ping the server prior to the scan.

To see if ftp bounce is possible, check this script.


DHCP Exhaustiation / Rogue DHCP interrupted by real DHCP NACK I was trying to run a Rogue DHCP Server which should cause a MITM attack. I did the following

Exhaust the real DHCP Server using DHCPig (worked)
Run a Rogue DHCP Server using the auxiliary/server/dhcp module (runs)
Cause a device to send a DHCP request

I see the incoming request in wireshark but the real DHCP Server which has no more leases is sending a DHCP NACK Packet which causes the client to cancel his request instantly. This results in the client ignoring the DHCP Offer from my Rogue DHCP Server.

I can thihnk of not exhausting the DHCP Server and "just" be faster which did not work out very well when I tried it.

What is the best way to move the client to accept my DHCP offer?

Plan A: Try using another ip range than the real DHCP server.

A DHCP server is not supposed to NACK a request for an ip outside it's IP range.

Plan B: it is a race condition, so flood the client with DHCPOFFER messages.

Plan C: use arpspoofing, it's much easier.


Can bruteforce attacks be prevented with tables of valid inputs? Can this method of encryption prevent bruteforce attacks?

If I had a hypothetical table (or function) where every grammatically valid sentence (limited to some number of words) was given an associated number, e.g:

"Good morning, how are you." = 3283
"Today is a nice day." = 2183

Then added a number (as a key), e.g:

3283 + 1234 = 4516

Wouldn't this final output of 4516 be effectively protected against bruteforce attacks?

Ignoring the difficulty of producing a hashtable/function capable of reducing every valid input into a single number, and the issue of sending the key 1234 securely.

Is there any way of finding the original input only from the output?

Is limiting the domain of the encryption to only valid inputs, an effective method of preventing bruteforce attacks?

If so is there any practical example of this? Why or why not?

"Is limiting the domain of the encryption to only valid inputs, an
  effective method of preventing bruteforce attacks?" -- No. It is
  merely limiting the search space that attackers need. – Ghedipunk

If this was a traditional encryption, GhediPunk would be correct. But in this case it is different, as explained below:

This in fact is immune to bruteforce, as it is the same as a One-Time Pad; except instead of having a static transform you apply to a plaintext, you have a static plaintext (with the agreed codewords).

Since there is no structure like grammar to impose in order to check correctness, bruteforce won't help.

Of course, while it is immune to a bruteforce attack, like a One-Time Pad it is not immune to an attack on the key-exchange or other weaker parts of the protocol. So this is basically just a One-Time Pad with a slightly impractical twist.

What this does highlight are the few cases where bruteforce is completely impractical (assuming the adversary has unlimited computational power):

When the enciphered output produces valid input for incorrect keys (e.g this cipher & One-Time Pad)
When the enciphered output is incomplete (e.g Shamir's secret sharing)
When the enciphered input has no pattern (e.g Encrypting a random bits)

(Note the last point is essentially the same as the first)

Of course in most modern practical cases, no one assumes the adversary has unlimited computation power, and generally one opts for the option where the cost of breaking the cipher outweighs the cost of the gaining the information, as it is more realistic.

Edit: Demo of one-time-pad with text swapped out with pad.


Format String Exploitation with limited number of characters possible? Is the exploitation of a format string vulnerability possible if the number of characters you're allowed to enter is limited?

Let's say I'm just allowed to enter input with 23 characters. I can read the stack like this of course:

AAAA%1$08xBBBBBBBBBBBBB
...
AAAA%576$08xBBBBBBBBBBB

But is it possible to exploit it somehow? (Shell, ...)

The system behind is a Linux Server I am accessing with netcat. It is running a simple ELF which makes the string length check and then calls the vulnerable printf function.

PRINTF is not vulnerable on its own, so probably need to explain what it does with the output.

looks like you only need 2-3 characters

Read this: https://www.owasp.org/index.php/Format_string_attack


Would this form of more seamless e-mail confirmation be secure? When you ned to confirm that an email address belongs to a certain visitor to your site, would it be insecure to do it as follows:

When the user visits your site, you give them a session token as a cookie, and send them a confirmation email
Within the email is an image, hosted by your site.
The mail also contains a confirmation link, with the message 'if you don't see an image, please click the link below.
When the browser sends a request for the image, you check if the request contains the cookie you gave before sending the confirmation email, and if there is such a cookie, send back the image.

This makes it easy to confirm your e-mail address without clicking a link in the e-mail.

Just like any other email confirmation system, there is still also some token in the confirmation link, or the image source.

so, is this still secure?

Ah, but the user is "clicking a link in the email". It just is an "automated click". The danger in "clicking a link in the email" does not come from the physical action of pushing the button, but from the downloading of data from a link found in the email. If this downloading occurs automatically, the risk is not reduced; quite the contrary, in fact. Most emailing software offer, at least as an option, a possibility not to automatically download pictures; this is an improvement because it, at least, gives a way for the user to prevent the download to occur (namely, by not clicking).

In that sense, your proposal is equivalent to a click-in-email system, and shares the same security issues. At best, it improves user experience, in that it removes the physical click in the cases where the user is careless (i.e. his software follows image links automatically). To some extent, what you suggest boils down to: "yeah, user is vulnerable, but at least we can leverage his vulnerability to make his life easier; he cannot be protected, but let's fill his world with blissful ignorance instead of dread".

Now, if you take the server's point of view, the system indeed guarantees that whoever received the cookie in his Web browser is also able to read the emails sent to the specified address, since the browser followed the image link from the email. You should still make sure that the link in the email contains a non-guessable random component; otherwise, an attacker could simply get the picture by typing the link in his browser, thus simulating reception of the email. As usual, even the best security systems contain enough room to totally botch them, if implemented without due care.


TLS encrypted passwords on my Android - safe? i just get an answer from IM+ (instant messenger client android app) support and they told me that my auto saved ICQ, Googletalk, YM passwords are encrypted using TLS, so i want to ask if i need to worry?

I mean i cant use full disk encrayption on my old android so when i loose mobile what is the chance of someone be able to decrypt/crack the TLS? Or do i understand it badly? Im an amateur.

Anyone already cracked TLS?

No, don't worry. The latest version of TLS is not cracked and your passwords sent using it will be safe.

But the TLS is not related to Full Disk Encryption (FDE), FDE is only applicable to data at rest (when your phone is off), whereas TLS is used to handle data during communication. So if you have stored your passwords in your phone in some text file or database etc., then TLS won't help you. But if you enter your passwords in IM from your brain, then you are protected by TLS and will be ok :)


Setup network with IoT devices I bought a new router and I'm thinking to make my network a bit smarter from the security aspect.
My question is now: How can I make sure that an attacker cannot get into my "secure" network with properly insecure IoT devices (like SmartTVs, IP-Cameras, printers, smart speaker or zigbee gateways).
For example I have a NAS with 2 LAN ports which should be accessible from e.g. an untrusted SmartTV and my "secure" computer. I would create a read only account for the TV, and only read write access for my trusted devices. On the other side I might want to sync files from the internet to my NAS so that devices needs access to the internet and the intranet.
That TV can be easily plugged into a different port on my router so I could build some kind of DMZ (not sure if that make sense).
Then I have also a couple of WiFi devices like smart speakers which should not be able to harm my trusted devices, but should be able to be controlled by my "trusted" mobile.
I have also a "untrusted" printer which I need to access from my "trusted" computer how should I handle this?
How would you setup a network where are devices with different trust levels? VLANs? Routing? And how can I make sure that I still can control my "smart" devices while they cannot harm my computers or NAS?

To keep attacks out of a secure network, limit the ways they could break-in. For example, don't put a WiFi router on the secure network because anyone can connect to it even from outside your house. Also if the devices on either network don't need to talk to each other, create a firewall that restricts that traffic.
If you're creating VLANs on the router, make sure that you can't access the admin interface over WiFi. Anyone can just hack your wifi signal and login to the admin interface, and undo all of the security, and jump between VLANs. Look into VLAN hopping if you're creating VLANs on the same switch.
https://en.wikipedia.org/wiki/VLAN_hopping
All smartphones should be put on an untrusted network because any device that you walk around with every day in unknown environments can never be trusted. If you need to access something on the secure network from your phone, create a firewall rule if your router supports it.
I would recommend installing a dedicated router like pfSense or OPNSense on an old PC and use that as a router instead of a WiFi/router combo. Then put your WiFi router in bridge mode (which means it gives out IPs from pfSense and assigns them to the devices on WiFi).
IP cameras should also go on the untrusted network and shouldn't have internet access or access to any other device on your network. A firewall rule should take care of that easily.
https://www.forbes.com/sites/zakdoffman/2019/08/03/update-now-warning-as-eavesdropping-risk-hits-millions-of-chinese-made-cameras/?sh=1930561d6bf2
Make sure your router is secure by ensuring your Wifi network has a strong password. And installing the latest firmware (should be on the manufactures website). Don't buy routers from companies you've never heard of, however, even routers from reputable companies can also be plagued with security vulnerabilities.
https://www.fortinet.com/blog/threat-research/fortiguard-labs-discovers-vulnerability-in-asus-router
https://nakedsecurity.sophos.com/2020/07/24/asus-routers-could-be-reflashed-with-malware-patch-now/
To regulate who has access to the network, most routers have a feature where you have the router only give out IP addresses to devices that you have whitelisted. That way if someone were to plug in an untrusted device, it wouldn't get an IP and couldn't connect to the internet.
https://helpdeskgeek.com/networking/how-to-whitelist-specific-devices-on-your-home-network-to-stop-hackers/
https://docs.netgate.com/pfsense/en/latest/services/dhcp/ipv4.html#mac-address-control
Here's a diagram of what I was talking about above.


DDoS Detection devices available in the market? Wanted to know what DDoS detection devices are currently available in the market.My organisation has its dedicated firewalls and routers.But we wanted to know if there are any devices in the market which can prevent DDoS.We are already in talks with the ISP to see if they can help us on this.But also wanted to know if there is something that i can use in my infrastructure.

Detection is fairly easy and a well-known problem that your security and incident event monitoring solutions (SIEM) should be able to shine light on, AlienVault (OSSIM) is an example of such a solution, as is Prelude, via event correlation. It's worth keeping up on correlation as an art unto itself:
https://scholar.google.fr/scholar?hl=en&as_sdt=1,5&as_vis=1&q=event+correlation+for+ddos&scisbd=1

The short answer regarding prevention is probably 'no' at this present time albeit vendors like Juniper, Qualys and Cisco will claim to provide DDos mitigation features:
http://www.juniper.net/us/en/products-services/security/ddos/

Depending on the bandwidth available to your infrastructure, at some point you would need to replicate the ability to prevent an attack as per commercial offerings that employ scrubbing centres such as Akamai (formerely Prolexic), Incapsula, CloudFlare, Nexusguard, ArborNetworks and so on.

Scrubbing centers explained and pitched by Akamai/Prolexic:
http://www.prolexic.com/why-prolexic-best-dos-and-ddos-scrubbing-centers.html

These companies can mitigate attacks of significant size. More information on size here:
http://www.csoonline.com/article/2876763/network-security/ddos-attack-size-up-50-fold-over-past-decade.html
http://blog.radware.com/security/2012/02/ddos-attacks-myths/

So the question is also one of risk, i.e. the likelihood that your particular company should expect an attack and the scale of that attack based on your activities, locations of operation in terms of markets and where your infrastructure is located as well as the financial impact to you or benefit to the attacker(s) such as brand damage:
http://www.ccul.org/research/2013/13_0531ARiskBasedApproachtoDDoS.pdf


How can I be sure that an intranet app is absolutely not accessible from the internet? I am developing an intranet application using Apache/MySQL. The server hosting it does not have a public IP address itself, but can access the internet through a router. There is not any sensitive information involved, but for good practice for future projects that may be more sensitive, I would like to make sure it is completely unaccessible externally.

Currently, the application can be accessed internally using either the internal IP address (192.168.etc.etc) of the server, or the NetBIOS name. I could not find any way to access it externally to the network it exists on, but I'm sure some potential invaders would have more resources/attacks to try.

Granted this is a very low sensitivity application for a small business, but I don't want to be satisfied with "security through obscurity". What things should I check so that I (and the business owner) can be absolutely certain that this application (including its web-based front-end, apache server, and mysql server) can only be accessed from the internal network?

Some configurations that come in my mind:

Don't place the server in a DMZ
Accept connections on 192.168.0.0 addresses in the Apache configuration.
Place a deny from all + accept from with the correct range of IP in your apache configuration
Deny forwarding of VPN connections (?) in your firewall (if applicable).


weak cipher suites Qualys SSL Labs test I was wondering when running tests using let's   Qualys SSL Labs against for example say  a cloud based web service and as a result it says that the site is using weak ciphers does that mean that the web service has this suites enabled ? I mean if I have a browser and it has all the weak cipher suites disabled would the test still give a warning because the web service still "supports" this ciphers  ?

thanks
adam

The SSLLabs test does not use your browser for testing but their own special client which supports more ciphers than the browser does. This means it looks only at server side problems and not at problems which might only happen when the server is used with your specific browser.
Thus the test will give out a warning about weak ciphers if these are configured on the server even if your browser does not support weak ciphers.