How does screentoaster.com capture your computer screen from the browser? - java

How does http://www.screentoaster.com capture a computer screen from a browser using Java Applet? Any suggestion or a lead in how to accomplish this? Is there other way to do using using different technology such as Flash?

You can do it with just 5 lines of code.
1 . Create one rectangle representing
screen. 2 . Create one BufferedImage
to store image of the screen. 3 . Take
snapshot using new
Robot().createSnapshot() method. 4 .
Save the bufferedImage in file.
Robot class is part of java.awt package
You can see more detail in the below link.
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Robot.html

I haven't tried it (I don't want to risk it!!!), but the indications are that it screen toaster uses a signed applet, and you have to explicitly accept a certificate (which gets added to your browser's trusted cert store) to enable the applet to break out of the normal Java security sandbox. (I'm also taking your word for it that it does use an applet ...)
I would hope that other methods of capturing the user's screen via a web-browser are similarly protected.
I would also like to hope that most users are not crazy enough to install random browser plugins or accept random certificates. But sadly, this is not true.
This whole idea strikes me as being very risky. What is to stop the Screen Toaster guys from taking their own copy of what is on your screen, installing a key-logger, ferreting around for sensitive files, installing a rootkit, etc? And assuming that they are entirely honest, how do you know that their applet doesn't have a security flaw that could be exploited by someone else to do the same thing?

Related

Javacard get applet AID of installed applets through Java code

I have a javacard and it has 2 applets installed. Now I would like to select one among the two. Currently how I do is that, I provide the cap file of the applet from which I get its AID. But I don't find this method satisfactory. So
Is there a way or steps to get the AID of the applets installed in a java card without having the cap file?
Is there a way to select the applet without its AID? By this I mean that is there a way to make an applet auto selectable after reset?
Are there any other ideas or insights over this?
For the questions you have asked,
Yes. PyApduTool can make you reach you goal. This tool can help you get all the packages' or applets'AID in java card even though you don NOT have the cap file.
Just press the "Refresh" button. the things you need appears in the right text field.
You can set you applet as "Default Selected" when installing it.
In this way, you can make you applet selected by default without having to know its AID.
For convenience, it should be better to know the applet-AID.
Only one applet can be the default selected.
The answer from Andy is good but i feel that its missing an important part of the question:
Javacard get applet AID of installed applets through Java code
If the question refers to finding installedf Applets from the code of one java card applet itself than this answer might apply:
First, it is possible to get the AID of the applet itself by JCSystem.getAID().
Second, it is not possible to "detect" other applets from within an installed applet.
Although if you know the other applet's AID you can get a hack of useful information about it using JCSystem and GPSystem.
So apart from inside JavaCard code, the Card Manager is able to list of installed applets with all their privileges and so on. You can use a tool of your choice. If you are working with JCOP, I recommend JCOP Shell. If you work with freeware I recommend Global Platform Pro from Martin Paljak.
Beside selecting AIDs and default selection there is no direct way to select an applet. There is an indirect way by using the SharedObjectInterface mechanism from JavaCard which lets you change control flow to a different applet.

Screensharing via Java Applet

I am looking for an addition for our "livestream and podcast" solution, which uses a camera to film speeches in our house.
It has been requested to view the slides of our speakers directly as a image in the webbrowser instead of the video stream. We don't want/can not install software on the speakers laptop, so I thought about a Java applet, which the speaker can just run via a webbrowser.
So what I need is technically this:
[speakers laptop] -> [Screencapture every N seconds via applet on a webpage] -> [Displaying the screen of the speaker on a different webpage for the external viewers]
I know there are Java applications which do record the screen, but save the file output locally. I need something that does the same, but sends the image to the server. On the server side I thought about a websocket.js accepting and displaying the image (other suggestions are welcome).
It would be great if somebody could help me out here. Btw, I never programmed in Java, so telling me which frameworks I need won't really help me.
Thanks!!
I was recently asked to evaluate possibilities for live screen-cast via applet. Most video APIs do not support codecs that have high enough compression (e.g. JMF). Some APIs can do advanced formats (JFFMPEG, Xuggle) but also use natives. While natives are normally no problem for an app. launched (free floating) using Java Web Start or a Plug-In 2 applet, the makers of Xuggle identify 'the order of loading natives' as a problem (e.g. won't work) for both JWS and applets.
It is a pity that more than a decade into its development, Java has no reasonable API for video capture/processing that can be deployed for a wide use (applet/JWS based - for the 'general public') GUI.
Perhaps you can find a solution using Flash.
Update 1
In fact, I do not need the screen to be recorded as a video.
In fact, you mentioned much of that in your initial question, but I focused on just a few keywords before drafting a reply. My bad. :P
OK.
Getting an image is relatively easy. An applet would need to be trusted in order to get a screenshot, but once trusted, it is just a few lines of code to get the image.
Encoding the image to JPEG of particular quality/compression setting (in memory) is also doable.
Sending the image to the server would depend on the size in bytes and connection speed, but one image with a high compression, every 10 seconds, should be doable. The server would need to implement functionality to accept the image.
As far as displaying the image on the client, it seems you already have some ideas based around JS. If you can make that work that would be optimal, since it can then be viewed in browsers with no Java.
I would still recommend you deploy the app. to the 'speaker' using Java Web Start, rather than embed an applet. A JWS app. will give you less deployment & maintenance troubles, and the JWS launch is ..nicer. Further, a free floating frame launched using JWS can minimize itself (or in later JREs, become transparent), during the action of taking a screen image - thereby capturing everything on the screen except itself.
Update 2
I actually found this code here.
That is ..horrible. Not the code, the site. When I visited it I got a message saying a pop-up had been suppressed (fair enough). Then there was the irritating 'vibrating dialog' hovering in the middle of the page (and following the scroll). You click the little x to see - another tab opened with yet another floating dialog, saying some other rubbish about how "You've won.." - with sound loud enough to drown out my high volume trance/dance playlist.
Then after closing that the hell out of my FF, I go back to the original page, close the damn 'dialog', scroll down & see.. a red background to the code (shudder). That is as far as I could manage. I closed the page with the code.
Try this code instead, for a single screen-shot.
Would it be possible to use this on the client side..
Yes.
.. and receive it with javascript on the server side?
Not really. Unless you mean an IIS based server running Microsoft's JScript. JavaScript is a client side technology.
For security reasons, servers need to protect themselves. E.G. From:
Someone creating a slavebot that uploads all the 1000s of docs on the slave machine's to the site - to make it crash.
People high-jacking your server for storing and serving bestiality porn (or worse).
Because of things like that (bad people have lots of imagination), while servers can easily accept uploads, they are generally not configured by default to allow them.
.. (I don't want Java on my server ;-)
It can be done using PHP, ASP, CGI etc. It does not need Java specifically, but it does need some active involvement from the server, if only to check the size of what is being uploaded and abort if it gets too large!
..Will take a look at the link you posted, but as I said, I can't program in Java, though I can understand some of it. Thanks!
It sounds like you'll need some help getting the server-side of it ready, as well. It is trivial for someone that knows how (not me), but a potential security nightmare for the inexperienced.
Update 3
where do I add the function to send the picture?
Sorry. I've not tried to implement that - you'd want to want to encode it to JPEG before sending, to reduce the size. See this code for how to provide an adjustable compression/quality where the user can see the effect.
There are various ways to get an image to a server. E.G. sockets, HTTP, FTP.. AFAIU it would depend on how the server is accepting it. I am unfamiliar with the specific term 'websocket' or the node.js script. Can you link to what you mean?
..the old code added to pastebin, so it's readable
Smart thinking. I notice it uses sockets, it was in the back of my mind that sockets would be best for this, since they have low overhead and short wait times.

file upload in form field for mobile web app

i am developing mobile web app using spring(spring mvc). I need to devlope a form which enables the user to upload file(resume) and on submit it will be stored in database.
I am not getting the idea how to finish that!
In the form when i use input type as file, it's working in diffrent manner on diffrent browser. If any one have did it ,please tell me the steps or some working demo at any site.
yes i don't want to use some third party tool.
thanx.
Sorry dude, your kinda SOL on this one. The file input type is a different beast than most. Each browser implements it in their own way, so it will never look the same on multiple browsers. Also, for security reasons, you can't trigger the file inputs with JavaScript, so you can't make an invisible file input that you would interact with through other standard inputs. Many before you have tried, all have failed. I spent days researching possible alternatives when I had nothing better to do, and they all came up against the security issue. Jquery provides the closest thing but still required a browser switch for one of the major browsers (can't remember which one off the top of my head).
So now that the bad news is out of the way, here's what you can do. Put a button on the screen and style it how you like. Put a file input on the screen and using absolute positioning and a higher z-index put it right over the top of your button. Now make it transparent (not display none, but using opacity and filter:alpha styles), now the user thinks they are interacting with your standard button, but the invisible file input above it intercepts the click. Will be the closes you can get to a file input that behaves and looks the same in all browsers.

Capturing image from webcam

I'm trying to capture images by using webcam in an applet. The applet makes use of JMF. But I managed to run applet without actually installing JMF. I kept a button in HTML webpage so that when the button gets clicked, the applet should capture the image.
But for me it is giving a java.lang.RuntimeException: No permission to capture from applets. How can this exception be resolved so an applet can capture image using webcam in HTML page?
In order to capture images in an applet, it is necessary:
For you to digitally sign the code.
For the user to click "OK" when prompted to run the signed code.
If the functionality is being called from a button using JavaScript, wrap the Java code in one of the AccessController.doPrivileged(PrivilegedAction) variants.
AFAIR the installer for JMF does not have the 'allow capture from applets' checked by default. That needs to be reconfigured in the JMF options. I forget how.
Update
I dont want to give client package to extra overhead of the installation of JMF.
That is just silly.
The components of the JMF must be available on the run-time class-path of the applet, for it to function. If they are downloaded by the JRE using the applet element (or whatever), then the user has incurred that 'overhead'.
But perhaps you mean you don't want to make the end user run the installer that advises to 'reboot' at the end. In that case, you are missing my point while avoiding answering my question. That question, again, is "How did you get the DLL?".
Applets run with very limited permissions and that might be causing the issue.. Here is an old post which has information about signing an applet to get the necessary permissions..hope this helps
I think flash is a much better option. There are really easy solutions for that even using Javascript + Flash.
Take a look at this: http://www.xarg.org/project/jquery-webcam-plugin/
This question asked Too many times in this forum..
Anyways..Here is the solution: Java swing Program to capture webcam images
you have to modify it for applet which takes only 30 minutes

Pasting a Screen shot into a text area on a web page

Is it possible to take a screen shot (using the Print Screen) and paste it from the System Clipboard directly into a web pages text area field (which I would create)? Do I need a browser plug-in? Can Flash do this?
**The solution only has to work in Internet Explorer.
This is not possible without a plugin.
It's not possible in Flash or Silverlight either, although it is possible in AIR.
I think you will have to write a custom ActiveX Control in order to do this. The control should automatically take a screenshot and send captured image to server-side code..
There is one more option - create a java applet, which will do the job, and also will help you to avoid cross browser issue.

Categories

Resources