How to write a good program for blocking unwanted / harmful websites [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I intend to write a simple application that will block network traffic (HTTP and HTTPS) with unwanted / malicious web sites.
Assumptions:
At the beginning the logic will be simple. After entering in the browser the address from the "black list" my logic should take control under communication and send defined by me site contents
Later I want to add some logic that will search web body looking for unwanted / harmful words
The program will be written in C++
I do not want to use existing libraries (open source etc.) only write all from scratch. J just want to learn windows network mechanism and layers
Unfortunately, I am a layman when it comes to play with the network layer in Windows.
Where do I start?
Where and how should I inject my filtering logic?

You should look into Windows Filtering Platform. This API gives you access to the network stack at a very low level.

You have at least 2 options:
Build your own proxy that filters traffic and replace unwanted content and setup this proxy in browser settings.
Create NDIS filter driver. You can start reading about NDIS here. You can also find sample driver in WDK.
I would prefer the first option.

I a working on something similar in my spare time(as if I had any).
It's not very easy.
It depends a lot on the OS version.
There's LSP(Layered Service Provider) but as I understand it it doesn't work on Win 7 or later. There is an implementation of something similar to what you are trying to achieve here.
For Win 7 and above there is the filter driver alternative but I tested it and if the site is using SSL you won't see anything. You have to somehow handle this either within the driver itself or redirect the traffic to a man-in-the-middle proxy. I didn't get that far yet.
Anyway this is M$'s official sample. And you might also be interested in this.

Related

How to compile C++ code for Roku? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have an android streaming client application which uses Java and cpp code. I want to port my application to Roku. I understand that Roku recommends only BrightScript for apps development.
1) According to this link (C/C++ development in Roku), gaming application can be written in cpp using marmalade and compiled for Roku.
2) But this link (How feasible is Roku app development with Marmalade?) clearly says marmalade can not be used for streaming application.
3) My questions are
(A) Is it possible to compile cpp for for roku?
(B) Where can I find the toolchain for building?
(C) If UI is developed using BrightScript, how can I call cpp functions from it?
You can't. Not independently from Roku Inc anyway - you will need a very close collaboration from them, which means you should be able to persuade their business development/partners department you are worth time and money. In other words, your company better be a household name.
You cannot "find" the C toolchain, it may only be bestowed to you by the Co on individual basis, after approval and under NDA.
If you don't have special relationship (project/contract) with Roku Inc, for non-games you can only develop in BrightScript. It's a mandate, not recommendation.
Specifically for your case, best option seems to be to use the already existing streaming formats/components the Roku API already provides. BrightScript is a script language, not fast enough to write a codec.
You have to use brightscript for Roku Streaming applications.

How to automatically detect bugs in a web application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a web application in Vaadin. It has got some forms, search fields, buttons, etc and supported by a SQL database. I have been using Selenium, Sahi Open Source and some other tools for automated GUI testing.
Problem is: With recording GUI actions for automated testing isn't really useful because it seems more manual work than automated because I need to record the tests manually anyway.
Question is: Is there any better way to test a Web Application? How do you test your web application? Is there any free tool which automatically detects bugs in my web application?
This won't be possible unless someone will invent sentient AI and even that might not be enough. In our company we have separate QA department (they're intelligent human beings) and they keep asking questions like "how we're supposed to test this flow" and "is this the expected response".
Without test that is aware of the business flow that you're limited to what bots do - randomly crawl trough site and try to get "500 page" and that is not enough. If you're tired of writing tests you can:
Use static code analysis tool (like jshint) to check if your code is written in "best practices" way
Use your users as testers (have streamlined release process, and mechanism of reporting error so you can address production bug as quickly as possible)
Hire someone to write the test for you
There are lots of ways to test software. None of them are fully automatic; they all require that actual behavior be compared against expected behavior, and expected behavior cannot be automatically inferred by a machine but must instead be prescribed and defined by humans, and then translated to a language that a machine can understand and use to determine whether it matches the actual behavior.
Here is a starting point to start reading about other ways to test your software:
https://en.wikipedia.org/wiki/Software_testing

Simple webserver for c++ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
My c++ server-app needs to have a port 80 open to output some json
(for other web-apps to see the status)
I saw a few web-server that i can spwan from a c++ class, but they seem rather complicated. I don't need any request/response, just a string that i time by time update and that is shown on port 80 then.
My server-app is running in a loop, so i guess this should be a thread that gets the string update every here and then. Please point me in the right direction is i am totally wrong in my planning/thinking.
The simplest solution would probably be to use a webserver to serve a static file and having your application to update the content when needed.
Just pay attention on the configuration of the server to inform the clients that the content should not be cached.
Another somewhat important part is to create a new file and move it to the destination (published) location once the file is complete (to avoid clients to download a partial file that could be invalid).
You could use some HTTP server library like libonion (or perhaps Wt or libmicrohttpd) within your C++ application.
Notice that libonion usually runs the web service in some other thread, so you need to take care of synchronization (e.g. using mutexes), and is also able to serve static content and static files.

Saving data into file at free host [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have created an app (some kind of "client" app) that will have a "bug report" feature. The feature consists with pure text area from which the text should be sent and saved to a text file on the free host. Is it possible? If so, which c++ library could give me such ability?
EDIT:
In my intentions it had to be a simple application that a user has on his own computer. After finding some bug in my app there should be the "bug report" feature that will allow him to send the data (pure text) to some place that only I could reach. I was just thinking about free hosting (because it's... free), and save the data into a text file there. I'm sorry if my question wasn't appropriate.
If your free hosting permits it (and you should check that) you might code a CGI program, or a fastCGI application. There are several C++ libraries which might help, like libcgicc etc.
If you can afford a web server, there exist C++ libraries providing HTTP service, in particular Wt or (in C) Onion etc.
You could also consider other technologies, like OpaLang or Ocsigen (but I would not recommend PHP, even if it is a lot used).
MAybe your hosting enable ssh so you could use scp ....
And if your application is free software (e.g. GPL licensed), several free software hosting (freecode, sourceforge, github, gitorious ...) may offer also a bug database facility.

Is soapUI the best web services testing tool/client/framework? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have been working on a web services related project for about the last year. Our team found soapUI near the start of our project and we have been mostly(*) satisfied with it (the free version, that is).
My question is: are there other tools/clients/frameworks that you have used/currently use for web services testing and would recommend?
(*) There are some weird GUI glitches that appear once in a while. As is mentioned by some of the answers, we attributed this to a memory leak.
I use soapUI, and it's generally pretty good. Be aware that it seems to leak memory, and eventually it will no longer save your project, so save regularly!
This is about the only hassle I have with it (other than the general ugliness that almost every Java application has!), and I can't live without it.
There's an eclipse plugin that allows you to do web service discovery, testing, etc - see Eclipse Web Services Tools.
I think it's much better than SoapUI, at least on Mac OS X.
Call it laziness but I kind of gave up looking a while after I found SoapUI - its not perfect (what is) but it does its job very well (especially given the price).
More importantly given that there is scripting to allow you to set up automated tests we're heading towards an investment in the product.
Might be nice if it was better on Windows (we do .NET development, mostly ASP.NET) but for the price... (-:
I've released an open source project for generating web service requests and making calls.
Whether something is the best is pretty subjective but give the program a try and compare it for yourself
Download it at http://drexyia.github.io/WsdlUI/
We've been using SoapUI since 1.x (will soon be adopting 3.0 from 2.5.1) and are all happy.
It's much more stable when running with native LnF (File - Preferences - UI Settings - Native LF).
I know it's available as an Eclipse plugin as well, but last I tried I failed to find how to add JAR-files to it (i.e. bin/ext in the stand-alone variant).