In Feburary 2016 18,
Open your web page to which you want to add the connection speed detection JavaScript in your text editor.
Add starting and ending script tags in the header area of the web page (after the starting
tag but before the ending
tag), for example:
Add the following code between the starting and ending script tags, replacing \'myimage.jpg\' with the file name of the image you want to use for the speed test. The \'?n=\' + Math.random() part of the address that is built and assigned to imageAddr tricks the web browser into fetching the image every time instead of using a locally cached version. Use an image with a file size of approximately 200 kilobytes.var imageAddr = \'myimage.jpg\' + \'?n=\' + Math.random() ;
Add the following code on the next line of the script to create the variables to store the test's start time, end time and download size. Set \'downloadSize\' to the size of the image file in bytes.var startTime, endTime
GO
var downloadSize = 200000 ;
Add the following code to set up the image that will be downloaded for the test. \'download\' is set up as an Image object. The action to capture the end of the download is assigned to activate when the image download completes. var download = new Image() ;
download.onload = function() {
endTime = (new Date()).getTime() ;
showResults ()
GO
}
Add the following code that runs the speed test. The current time is captured into startTime. The image address being assigned to download.src starts the image download.startTime = (new Date()).getTime() ;
download.src = imageAddr ;
Add the following function to the script that calculates displays the speed test results. First, it calculates the duration, converting milliseconds to seconds. Next, it converts the download size to bits, calculates the download speed, and converts the speed to kbps and Mbps. Finally, it pops up a message box with the results.function showResults () {
var duration = Math.round((endTime - startTime) / 1000) ;
var bitsLoaded = downloadSize * 8
GO
var speedBps = Math.round(bitsLoaded / duration)
GO
var speedKbps = (speedBps / 1024).toFixed(2)
GO
var speedMbps = (speedKbps / 1024).toFixed(2)
GO
alert (\'Your connection speed is: \n\' +
speedBps + \" bps\\n\" +
speedKbps + \" kbps\\n\" +
speedMbps + \" Mbps\\n\")
GO
}
Open the page in your browser, and test it to make sure the script works correctly. It may take a few seconds for the message box to pop up with the test results.
In Feburary 2016 18,
Showing posts with label random. Show all posts
Showing posts with label random. Show all posts
Thursday, 18 February 2016
Thursday, 4 February 2016
What Is a Port Scan Attack on a Computer?In Feburary 2016 04,
In Feburary 2016 04,
A linear port scan involves scanning every port on a system. Internet Protocol ports use a 16-bit numbering system, which means a total of 65,536 ports can exist on a single IP address. A liner port scan will scan all of these ports to see which ones are open, closed or hidden.
Random Port Scan
A random port scan is similar in concept to a linear port scan. However, with a random port scan, only a specified number of random ports are scanned instead of all of the available port numbers. The reason for doing this is to speed up the scan, particularly when the attacker is scanning multiple computers in attempt to find vulnerabilities. With a random port scan, if any of the scanned ports are found to be open, the attacker will investigate that computer further.
Well-Known Service Port Scan
Many services run on established 'Well-Known' ports, such as ports 25 and 110 for e-mail, 21 for FTP and 80 for the Internet. A port scan that only targets well-known ports is similar in concept to a random port scan, except the port numbers are predefined instead of random. Like a random port scan, if any of the tested ports are found to be open, the attacker will investigate the computer further.
Reconnaisance
After the specified method of port scanning has completed, the attacker views the results and further investigates those computers containing open ports. When a port is found to be open, it means that some type of service is running on that port, and there's a chance that the attacker can exploit it for the purposes of gaining remote access to the computer system. With a proper access exploit in place, an attacker could potentially gain control of the computer system.
In Feburary 2016 04,
A linear port scan involves scanning every port on a system. Internet Protocol ports use a 16-bit numbering system, which means a total of 65,536 ports can exist on a single IP address. A liner port scan will scan all of these ports to see which ones are open, closed or hidden.
Random Port Scan
A random port scan is similar in concept to a linear port scan. However, with a random port scan, only a specified number of random ports are scanned instead of all of the available port numbers. The reason for doing this is to speed up the scan, particularly when the attacker is scanning multiple computers in attempt to find vulnerabilities. With a random port scan, if any of the scanned ports are found to be open, the attacker will investigate that computer further.
Well-Known Service Port Scan
Many services run on established 'Well-Known' ports, such as ports 25 and 110 for e-mail, 21 for FTP and 80 for the Internet. A port scan that only targets well-known ports is similar in concept to a random port scan, except the port numbers are predefined instead of random. Like a random port scan, if any of the tested ports are found to be open, the attacker will investigate the computer further.
Reconnaisance
After the specified method of port scanning has completed, the attacker views the results and further investigates those computers containing open ports. When a port is found to be open, it means that some type of service is running on that port, and there's a chance that the attacker can exploit it for the purposes of gaining remote access to the computer system. With a proper access exploit in place, an attacker could potentially gain control of the computer system.
In Feburary 2016 04,
Subscribe to:
Posts (Atom)