Web Programming 3. Object Oriented Interface to CGI.pm. Generating Images. Using Headers. Using Cookies. Hidden fields.

Size: px
Start display at page:

Download "Web Programming 3. Object Oriented Interface to CGI.pm. Generating Images. Using Headers. Using Cookies. Hidden fields."

Transcription

1 Web Programming 3 Object Oriented Interface to CGI.pm Generating Images Using Headers Caching/accept/languages Using Cookies Hidden fields File Upload 195 Page 195

2 Object-Oriented interface to CGI.pm CGI.pm supports a procedural approach use use CGI CGI qw(:standard); my my ($name, ($name, $city) $city) = (param('name'), param('city')); print print header.start_html ('Embedded ('Embedded HTML'). HTML'). h1 h1 ('Embedded ('Embedded HTML').'HTML HTML').'HTML by by Perl'.end_html; CGI.pm supports an object-orientated approach use use CGI; CGI; $q $q = new new CGI; CGI; my my ($name, $city) = ($q->param('name'), $q->param('city')); print print $q->header. $q->start_html ('Embedded HTML'). $q->h1 ('Embedded HTML').'HTML by by Perl'.$q->end_html; 196 The CGI module can be used with a procedural interface, as we ve seen so far, or with an object-oriented interface. The object interface is slightly faster and doesn t lead to namespace pollution for large-scale web projects, the object approach is usually preferred. The main difference is in the use command and in how CGI methods are invoked. The two scripts above show how this is done. Page 196

3 Generating images Generating Images Using the GD module Set binmode on MS Windows use use CGI CGI qw(:standard); use use GD::Graph::bars; = (2,2,2,3,3,3,3,3,3,3,4,4); my (10,10,12,12,14,14,16,15,16,15,16,15); = qw(jan qw(jan Feb Feb Mar Mar Apr Apr May May Jun Jun Jul Jul Aug Aug Sep Sep Oct Oct Nov Nov Dec); Dec); my my $graph $graph = GD::Graph::bars->new(400, 300); 300); $graph->set('x_label' => => 'Month', 'Month', 'y_label' 'y_label' => => 'Income 'Income and and Costs', Costs', 'title' 'title' => => '1999 '1999 Income Income and and Costs', Costs', 'y_max_value' 'y_max_value' => => 20); 20); my my $gd $gd = $graph->plot([ \@names, \@names, \@income, \@income, \@costs \@costs ]); ]); my my $format $format = $graph->export_format; print print header("image/$format"); binmode binmode STDOUT; STDOUT; print print $gd->gif; $gd->gif; Use a generic format Output as GIF 197 The example above is a CGI script, so we are printing to STDOUT, but the print could be to a real file instead. The GD module is used for preference, and GD::Graph supports many different graph formats. Output from this program and from GD::Graph::lines is shown below: One of the advantages of GD is the wide range of graphics formats supported. In the example we have specified 'export_format' which enables us the decide later which format we actually want by calling a different method, gif in this case. The GIFGraph module used to be popular, but patent issues with GIF files mean that this module is now deprecated. Page 197

4 Using headers Incoming headers tell CGI script what client wants Accepted MIME types Preferred language Outgoing headers tell web browser what to do MIME type sent Size of data following Expiration time of data 198 The incoming header from the client is placed into environment variables. We have two ways of accessing these values. We can look at %ENV direct, always assuming that we know the name of the variable we want to look at. Second we can call a CGI module method, for example environment variable HTTP_USER_AGENT can be accessed using CGI->user_agent(), which returns the type of browser. See the CGI documentation for other methods (there are about twenty). The slides that follow show how to use some of these values. Page 198

5 Determine client language sub sub get_language_code { my my my my en-gb en-gb en-ie en-ie fr-fr fr-fr de-de) = (undef) x 5; 5; if if (defined $ENV{HTTP_ACCEPT_LANGUAGE) { for for my my $lang $lang (split /,/, /,/, $ENV{HTTP_ACCEPT_LANGUAGE) { return $lang $lang if if (exists $codes{$lang); if if ($lang =~ =~ /^($1)-\w+$/) { return $1 $1 if if (exists $codes{$1); if if ($cgi->user_agent()=~ m!.\((?:[^;]+; ){3([^;]+).+\)! ){ ){ return $1 $1 if if (exists $codes{lc $1); $1); return 'unknown'; 199 The subroutine above shows an approach of trying to determine the user's language code. It tries all user choices (such as en, 'en-us' or de-au ); falls back on the main language code if necessary; then tries to see if the user has a translated browser. HTTP_ACCEPT_LANGUAGE might indicate the locale or the language, assumptions should not be made that it indicates, for example, the collation sequence, although it might. The spec (HTTP/1.1 RFC) says that this means the language, nothing more. A typical browser name is Mozilla/5.0 (X11; U; Linux i686; en-us; rv:1.7.8) Gecko/ (Firefox on Fedora Core 4). Notice that HTTP_USER_AGENT has the locale in mixed case, whereas the HTTP_ACCEPT_LANGUAGE is in lower. Many HTTP_USER_AGENT names have MSIE in them, which does not mean they are Microsoft Internet Explorer, but compatible (?) with it. Unfortunately there is no standard for the text string, so constructing an RE can be difficult. Page 199

6 Send expiry time Tell client when a page expires Browser will now cache the page afterwards my my $counter = 0; 0; $counter = <COUNTER> if if (open (open (COUNTER, 'counter.dat')); open open (COUNTER, '>', '>', 'counter.dat'); print print COUNTER ++$counter; close close COUNTER; print print header(-type => => 'image/gif', -expires => => '-1d'); binmode STDOUT; Generate simple my my $im $im = new new GD::Image(45,20); GIF image my my $white = $im->colorallocate(255,255,255); my my $black = $im->colorallocate(0,0,0); $im->transparent($white); $im->interlaced('true'); $im->string(gdlargefont,2,2, sprintf("%05d",$counter),$black); print print $im->gif; 200 The script above is a very simple graphical counter script. It generates a dynamic GIF image showing a number that increases by one everytime somebody views the page. (On a busy site, locking the file would be useful.) If you refer to the above script from a web page without the expire header, like <IMG src="/cgi-bin/counter.cgi"> you will find the browser caches the GIF image. The only way to get it to update is to do a shift + reload. Once you add the expire header, with in this case a negative expiry time of minus one day, the GIF image image will not be cached. Note that not all browsers cache data. Examples expires => '+30s' 30 seconds from now expires => '+10m' ten minutes from now expires => '+1h' one hour from now expires => '-1d' yesterday expires => 'now' immediately expires => '+3M' in three months expires => '+10y' in ten years time expires => 'Thu, 25-Apr :40:33 GMT' at the indicated time & date Page 200

7 Send download size Tell client how much to expect Browser will now draw progress bar and remaining time Especially important for application MIME types #!/usr/bin/perl -w -w use use strict; use use CGI CGI ':standard'; local local $/; $/; open open (PDF, (PDF, '/home/user1/delegate/delegate.pdf'); my my $data $data = <PDF>; close close PDF; PDF; print print header('-type' => => 'application/pdf', '-Content-Length' => => length($data)); binmode STDOUT; print print $data; 201 When your script send large volumes of data to the client, make sure to indicate the browser how many bytes you re going to send. This allows the browser to put up a progress bar and indicate the remaining download time. For a MIME type that is not handled by a client plug-in, but is going to be saved to disk instead, it is essential that you get the file name right as well. Sadly, this cannot be specified using any header; instead, browsers will use your script name. However, remember that browsers do not know how the web server handles directories, script names and path-information. So, if your script is normally at and you want to send the user a file called data.csv, turn the URL into Page 201

8 Cookies Save transaction information on the client Not reliable! Implemented by an additional header HTML Set-Cookie CGI.pm cookie() method cookie (-name, -value, -domain, -expires, -path, -secure) To set: $cookie $cookie = cookie cookie ('userid', ('userid', 1234); 1234); print print header(-type header(-type => => 'text/html', 'text/html', -cookie -cookie => => $cookie); $cookie); To read: $value $value = cookie cookie ('userid'); ('userid'); 202 HTTP is a stateless protocol, but often we want to save data between requests (a multi-phase transaction). There are a couple of ways of doing that, by saving information on the client (cookies) and saving information on the form itself (hidden fields). The problem with using cookies for state information is that it breaks when the client goes back a few screens. Instead cookies should store persistent information such as the client s address, customer id, or preferences. Cookies are a controversial subject because they can contain user data that can be sent to servers that the user has not contacted a threat to user privacy if abused. The CGI.pm cookie() method makes cookies easy to use. We can default the last three arguments: -domain uses the current domain, -expires is set to the end of the current session, -path is the request path, and secure (use https) is set to 0 (false). The expires argument can use absolute or relative dates, for example '+7d', see the CGI documentation for formats. To retrieve data stored by a cookie, simply default the second argument (-value). Cookies are retained on the client between session, so there is no server maintenance, and different scripts may share information. However some users refuse to use cookies, or delete them, so their use is not guaranteed. It should also be remembered that the same user can use different machines (think of an internet café). Page 202

9 Hidden fields Include information on the form For transmission at the next request Create using an INPUT_TYPE of 'hidden' HTML: <INPUT TYPE="hidden" NAME="name", VALUE="value"> CGI method: hidden('name','value1','value2'...) Retrieve data as normal: $value = param('name'); Hidden fields are insecure The user can make them visible and edit them particularly a Perl programmer using LWP.pm Even using POST user can copy the html and resubmit using GET 203 Hidden fields are more difficult to disable by the user than cookies, however they are visible if the user views the source. Perl modules such as LWP.pm allow browser requests to be made from a user written program, and it is not difficult to alter fields and return a GET request, even if the original was a POST. Viewing and altering cookie data is more difficult, but still not impossible. Page 203

10 File upload Allow the user to send a complete file to the script Requires special form type multipart/form-data Handle file-upload field for named param sub sub read_file_upload { my my ($cgi, my my $image = $cgi->param($name); if if ($image) { local local $/; $/; my my $image_data = <$image>; return ($image, $image_data); return; 204 A file upload field can only be used with a special type of form, multipart/form-data. This can be done most easily by using the CGI function start_multipart_form instead of the normal start_form. In fact this uses a newer format, and can be used instead of start_form elsewhere. For a file upload field, the value returned is an overloaded object that can be used as a file-handle or as a string in the latter case, the name of the file on the client is returned. Page 204

11 Summary CGI.pm can be driven procedurally or using OO Images may be created using GD.pm Headers contain useful information: Client language and browser type Can set expiry time and download size State may be saved on the client using cookies State may be saved on the form using hidden fields 205 Page 205

12

HTTP Protocol and Server-Side Basics

HTTP Protocol and Server-Side Basics HTTP Protocol and Server-Side Basics Web Programming Uta Priss ZELL, Ostfalia University 2013 Web Programming HTTP Protocol and Server-Side Basics Slide 1/26 Outline The HTTP protocol Environment Variables

More information

CGI Programming. What is "CGI"?

CGI Programming. What is CGI? CGI Programming What is "CGI"? Common Gateway Interface A means of running an executable program via the Web. CGI is not a Perl-specific concept. Almost any language can produce CGI programs even C++ (gasp!!)

More information

COSC 2206 Internet Tools. The HTTP Protocol

COSC 2206 Internet Tools. The HTTP Protocol COSC 2206 Internet Tools The HTTP Protocol http://www.w3.org/protocols/ What is TCP/IP? TCP: Transmission Control Protocol IP: Internet Protocol These network protocols provide a standard method for sending

More information

CS105 Perl: Perl CGI. Nathan Clement 24 Feb 2014

CS105 Perl: Perl CGI. Nathan Clement 24 Feb 2014 CS105 Perl: Perl CGI Nathan Clement 24 Feb 2014 Agenda We will cover some CGI basics, including Perl-specific CGI What is CGI? Server Architecture GET vs POST Preserving State in CGI URL Rewriting, Hidden

More information

Lecture 7b: HTTP. Feb. 24, Internet and Intranet Protocols and Applications

Lecture 7b: HTTP. Feb. 24, Internet and Intranet Protocols and Applications Internet and Intranet Protocols and Applications Lecture 7b: HTTP Feb. 24, 2004 Arthur Goldberg Computer Science Department New York University artg@cs.nyu.edu WWW - HTTP/1.1 Web s application layer protocol

More information

How to work with HTTP requests and responses

How to work with HTTP requests and responses How a web server processes static web pages Chapter 18 How to work with HTTP requests and responses How a web server processes dynamic web pages Slide 1 Slide 2 The components of a servlet/jsp application

More information

Outline of Lecture 3 Protocols

Outline of Lecture 3 Protocols Web-Based Information Systems Fall 2007 CMPUT 410: Protocols Dr. Osmar R. Zaïane University of Alberta Course Content Introduction Internet and WWW TML and beyond Animation & WWW CGI & TML Forms Javascript

More information

COMP284 Practical 3 Perl (3)

COMP284 Practical 3 Perl (3) COMP284 Practical 3 Perl (3) Introduction This practical contains further exercises that are intended to familiarise you with Perl Programming. While you work through the tasks below compare your results

More information

CGI Architecture Diagram. Web browser takes response from web server and displays either the received file or error message.

CGI Architecture Diagram. Web browser takes response from web server and displays either the received file or error message. What is CGI? The Common Gateway Interface (CGI) is a set of standards that define how information is exchanged between the web server and a custom script. is a standard for external gateway programs to

More information

Web, HTTP and Web Caching

Web, HTTP and Web Caching Web, HTTP and Web Caching 1 HTTP overview HTTP: hypertext transfer protocol Web s application layer protocol client/ model client: browser that requests, receives, displays Web objects : Web sends objects

More information

Web Programming 4) PHP and the Web

Web Programming 4) PHP and the Web Web Programming 4) PHP and the Web Emmanuel Benoist Fall Term 2013-14 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 PHP a language for Web applications Presentation

More information

World Wide Web, etc.

World Wide Web, etc. World Wide Web, etc. Alex S. Raw data-packets wouldn t be much use to humans if there weren t many application level protocols, such as SMTP (for e-mail), HTTP & HTML (for www), etc. 1 The Web The following

More information

Annex A to the MPEG Audio Patent License Agreement Essential Philips, France Telecom and IRT Patents relevant to DVD-Video Disc - MPEG Audio - general

Annex A to the MPEG Audio Patent License Agreement Essential Philips, France Telecom and IRT Patents relevant to DVD-Video Disc - MPEG Audio - general Essential Philips, France Telecom and IRT Patents relevant to DVD-Video Disc - MPEG Audio - general PUBLICATION AR N 013241-317015 04-Jun-90 11-Oct-96 250211 11-Oct-11 Universal subband coder format AT

More information

Server-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

Server-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University Server-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University 1 Objectives You will learn about Server-side web programming in Python Common Gateway Interface

More information

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

More information

Web Architecture and Technologies

Web Architecture and Technologies Web Architecture and Technologies Ambient intelligence Fulvio Corno Politecnico di Torino, 2015/2016 Goal Understanding Web technologies Adopted for User Interfaces Adopted for Distributed Application

More information

CMSC 332 Computer Networking Web and FTP

CMSC 332 Computer Networking Web and FTP CMSC 332 Computer Networking Web and FTP Professor Szajda CMSC 332: Computer Networks Project The first project has been posted on the website. Check the web page for the link! Due 2/2! Enter strings into

More information

Web History. Systemprogrammering 2006 Föreläsning 9 Web Services. Internet Hosts. Web History (cont) 1945: 1989: Topics 1990:

Web History. Systemprogrammering 2006 Föreläsning 9 Web Services. Internet Hosts. Web History (cont) 1945: 1989: Topics 1990: Systemprogrammering 2006 Föreläsning 9 Web Services Topics HTTP Serving static content Serving dynamic content 1945: 1989: Web History Vannevar Bush, As we may think, Atlantic Monthly, July, 1945. Describes

More information

INTERNET ENGINEERING. HTTP Protocol. Sadegh Aliakbary

INTERNET ENGINEERING. HTTP Protocol. Sadegh Aliakbary INTERNET ENGINEERING HTTP Protocol Sadegh Aliakbary Agenda HTTP Protocol HTTP Methods HTTP Request and Response State in HTTP Internet Engineering 2 HTTP HTTP Hyper-Text Transfer Protocol (HTTP) The fundamental

More information

Web Programming with CGI.pm. Executing CGI scripts

Web Programming with CGI.pm. Executing CGI scripts Web Programming with CGI.pm Sheldon McKay Executing CGI scripts Use your personal web space /Users/yourusername/Sites/cgi-bin 1) Create your script (end with.pl ) 2) $ chmod 755 myscript.pl 1 A CGI Script

More information

POP3 Collect Manual Domino Add-In Server Task (Freeware)

POP3 Collect Manual Domino Add-In Server Task (Freeware) POP3 Collect Manual Domino Add-In Server Task (Freeware) ABdata, Andy Brunner Kappelistrasse 43 CH-8002 Zürich E-Mail andy.brunner@abdata.ch Table of content 1. Introduction... 2 2. Freeware License...

More information

Giving credit where credit is due

Giving credit where credit is due CSCE 230J Computer Organization Web Services Dr. Steve Goddard goddard@cse.unl.edu Giving credit where credit is due Most of slides for this lecture are based on slides created by Drs. Bryant and O Hallaron,

More information

Web Programming with CGI.pm. Executing CGI scripts

Web Programming with CGI.pm. Executing CGI scripts Web Programming with CGI.pm Sheldon McKay, CSHL Executing CGI scripts Use your personal web space ~/Sites 1) Create your script (must end with.pl ) 2) $ chmod 755 myscript.pl A CGI Script that Creates

More information

Annex A to the DVD-R Disc and DVD-RW Disc Patent License Agreement Essential Sony Patents relevant to DVD-RW Disc

Annex A to the DVD-R Disc and DVD-RW Disc Patent License Agreement Essential Sony Patents relevant to DVD-RW Disc Annex A to the DVD-R Disc and DVD-RW Disc Patent License Agreement Essential Sony Patents relevant to DVD-RW Disc AT-EP S95P0391 1103087.1 09-Feb-01 1126619 8/16 Modulation AT-EP S95P0391 1120568.9 29-Aug-01

More information

Fluidity Trader Historical Data for Ensign Software Playback

Fluidity Trader Historical Data for Ensign Software Playback Fluidity Trader Historical Data for Ensign Software Playback This support document will walk you through the steps of obtaining historical data for esignal into your Ensign Software program so that you

More information

University of Osnabruck - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

University of Osnabruck - FTP Site Statistics. Top 20 Directories Sorted by Disk Space University of Osnabruck - FTP Site Statistics Property Value FTP Server ftp.usf.uni-osnabrueck.de Description University of Osnabruck Country Germany Scan Date 17/May/2014 Total Dirs 29 Total Files 92

More information

APPENDIX B. The Future Of Perl & CGI Programming OVERVIEW

APPENDIX B. The Future Of Perl & CGI Programming OVERVIEW APPENDIX B The Future Of Perl & CGI Programming OVERVIEW Although Perl 5 has been available for quite a while now, not many CGI authors have taken advantage of Perl 5 specific features. There are several

More information

Hypertext Transport Protocol

Hypertext Transport Protocol Hypertext Transport Protocol HTTP Hypertext Transport Protocol Language of the Web protocol used for communication between web browsers and web servers TCP port 80 HTTP - URLs URL Uniform Resource Locator

More information

Macomnet Telecommunications - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Macomnet Telecommunications - FTP Site Statistics. Top 20 Directories Sorted by Disk Space Macomnet Telecommunications - FTP Site Statistics Property Value FTP Server mirror.macomnet.net Description Macomnet Telecommunications Country Russia Scan Date 19/Apr/2015 Total Dirs 19,599 Total Files

More information

Lecture 3. HTTP v1.0 application layer protocol. into details. HTTP 1.0: RFC 1945, T. Berners-Lee HTTP 1.1: RFC 2068, 2616

Lecture 3. HTTP v1.0 application layer protocol. into details. HTTP 1.0: RFC 1945, T. Berners-Lee HTTP 1.1: RFC 2068, 2616 Lecture 3. HTTP v1.0 application layer protocol into details HTTP 1.0: RFC 1945, T. Berners-Lee Lee,, R. Fielding, H. Frystyk, may 1996 HTTP 1.1: RFC 2068, 2616 Ascii protocol uses plain text case sensitive

More information

Web Security, Part 2

Web Security, Part 2 Web Security, Part 2 CS 161 - Computer Security Profs. Vern Paxson & David Wagner TAs: John Bethencourt, Erika Chin, Matthew Finifter, Cynthia Sturton, Joel Weinberger http://inst.eecs.berkeley.edu/~cs161/

More information

World-Wide Web Protocols CS 571 Fall Kenneth L. Calvert All rights reserved

World-Wide Web Protocols CS 571 Fall Kenneth L. Calvert All rights reserved World-Wide Web Protocols CS 571 Fall 2006 2006 Kenneth L. Calvert All rights reserved World-Wide Web The Information Universe World-Wide Web structure: hypertext Nonlinear presentation of information Key

More information

Monthly SEO Report. Example Client 16 November 2012 Scott Lawson. Date. Prepared by

Monthly SEO Report. Example Client 16 November 2012 Scott Lawson. Date. Prepared by Date Monthly SEO Report Prepared by Example Client 16 November 212 Scott Lawson Contents Thanks for using TrackPal s automated SEO and Analytics reporting template. Below is a brief explanation of the

More information

18050 (2.48 pages/visit) Jul Sep May Jun Aug Number of visits

18050 (2.48 pages/visit) Jul Sep May Jun Aug Number of visits 30-12- 0:45 Last Update: 29 Dec - 03:05 Reported period: OK Summary Reported period Month Dec First visit 01 Dec - 00:07 Last visit 28 Dec - 23:59 Unique visitors Number of visits Pages Hits Bandwidth

More information

WEB SECURITY p.1

WEB SECURITY p.1 WEB SECURITY 101 - p.1 spritzers - CTF team spritz.math.unipd.it/spritzers.html Disclaimer All information presented here has the only purpose to teach how vulnerabilities work. Use them to win CTFs and

More information

CSCE 463/612 Networks and Distributed Processing Spring 2018

CSCE 463/612 Networks and Distributed Processing Spring 2018 CSCE 463/612 Networks and Distributed Processing Spring 2018 Application Layer II Dmitri Loguinov Texas A&M University February 6, 2018 Original slides copyright 1996-2004 J.F Kurose and K.W. Ross 1 Chapter

More information

Openwave SDK Technical Bulletin #3

Openwave SDK Technical Bulletin #3 Openwave SDK Technical Bulletin #3 Determining the Capabilities of Openwave Mobile Browser Devices Openwave Systems Inc. 1400 Seaport Boulevard Redwood City, CA 94063 U.S.A. http://www.openwave.com Part

More information

Applications & Application-Layer Protocols: The Web & HTTP

Applications & Application-Layer Protocols: The Web & HTTP CPSC 360 Network Programming Applications & Application-Layer Protocols: The Web & HTTP Michele Weigle Department of Computer Science Clemson University mweigle@cs.clemson.edu http://www.cs.clemson.edu/~mweigle/courses/cpsc360

More information

MUC Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

MUC Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space MUC Archive - FTP Site Statistics Property Value FTP Server ftp.muc.de Description MUC Archive Country Germany Scan Date 16/Nov/2015 Total Dirs 237 Total Files 1,033 Total Data 839.68 MB Top 20 Directories

More information

Web Application Security GVSAGE Theater

Web Application Security GVSAGE Theater Web Application Security GVSAGE Theater B2B Tech Expo Oct 29, 2003 Durkee Consulting www.rd1.net 1 Ralph Durkee SANS Certified Mentor/Instructor SANS GSEC, GCIH, GGSC Network Security and Software Development

More information

NETB 329 Lecture 13 Python CGI Programming

NETB 329 Lecture 13 Python CGI Programming NETB 329 Lecture 13 Python CGI Programming 1 of 83 What is CGI? The Common Gateway Interface, or CGI, is a set of standards that define how information is exchanged between the web server and a custom

More information

WEB APPLICATION ENGINEERING II

WEB APPLICATION ENGINEERING II WEB APPLICATION ENGINEERING II Lecture #5 Umar Ibrahim Enesi Objectives Gain understanding of how Cookies and Sessions Work Understand the limitations of Sessions and Cookies Understand how to handle Session

More information

c122jan2714.notebook January 27, 2014

c122jan2714.notebook January 27, 2014 Internet Developer 1 Start here! 2 3 Right click on screen and select View page source if you are in Firefox tells the browser you are using html. Next we have the tag and at the

More information

FITECH FITNESS TECHNOLOGY

FITECH FITNESS TECHNOLOGY Browser Software & Fitech FITECH FITNESS TECHNOLOGY What is a Browser? Well, What is a browser? A browser is the software that you use to work with Fitech. It s called a browser because you use it to browse

More information

HTTP Requests and Header Settings

HTTP Requests and Header Settings Overview, page 1 HTTP Client Requests (HTTP GET), page 1 HTTP Server Requests (HTTP POST), page 2 HTTP Header Settings, page 2 IP Phone Client Capability Identification, page 8 Accept Header, page 9 IP

More information

Hands-On Perl Scripting and CGI Programming

Hands-On Perl Scripting and CGI Programming Hands-On Course Description This hands on Perl programming course provides a thorough introduction to the Perl programming language, teaching attendees how to develop and maintain portable scripts useful

More information

1 of 10 8/10/2009 4:51 PM

1 of 10 8/10/2009 4:51 PM 1 of 10 8/10/ 4:51 PM Last Update: 16:20 Reported period: OK Current Month: Aug Summary Reported period Month Aug First visit 01 Aug - 00:00 Last visit 06:39 Unique visitors Number of visits Pages Hits

More information

Server-side computing

Server-side computing Server-side computing Why server-side? Approaches 1 Why server-side? Markup languages cannot Specify Computations Interactions with users Provide access to Server-side resources Databases Programs Services

More information

3. WWW and HTTP. Fig.3.1 Architecture of WWW

3. WWW and HTTP. Fig.3.1 Architecture of WWW 3. WWW and HTTP The World Wide Web (WWW) is a repository of information linked together from points all over the world. The WWW has a unique combination of flexibility, portability, and user-friendly features

More information

Backschues Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Backschues Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space Property Value FTP Server ftp.backschues.net Description Backschues Archive Country Germany Scan Date 13/Apr/2014 Total Dirs 467 Total Files 1,623 Total Data 6.1 Top 20 Directories Sorted by Disk Space

More information

CORS Attacks. Author: Milad Khoshdel Blog: P a g e. CORS Attacks

CORS Attacks. Author: Milad Khoshdel Blog: P a g e. CORS Attacks Author: Milad Khoshdel Blog: https://blog.regux.com Email: miladkhoshdel@gmail.com 1 P a g e Contents What is CORS?...3 How to Test?...4 CORS Checker Script...6 References...9 2 P a g e What is CORS? CORS

More information

The HTTP protocol. Fulvio Corno, Dario Bonino. 08/10/09 http 1

The HTTP protocol. Fulvio Corno, Dario Bonino. 08/10/09 http 1 The HTTP protocol Fulvio Corno, Dario Bonino 08/10/09 http 1 What is HTTP? HTTP stands for Hypertext Transfer Protocol It is the network protocol used to delivery virtually all data over the WWW: Images

More information

CSSE 460 Computer Networks Group Projects: Implement a Simple HTTP Web Proxy

CSSE 460 Computer Networks Group Projects: Implement a Simple HTTP Web Proxy CSSE 460 Computer Networks Group Projects: Implement a Simple HTTP Web Proxy Project Overview In this project, you will implement a simple web proxy that passes requests and data between a web client and

More information

Dynamic Documents. Kent State University Dept. of Math & Computer Science. CS 4/55231 Internet Engineering. What is a Script?

Dynamic Documents. Kent State University Dept. of Math & Computer Science. CS 4/55231 Internet Engineering. What is a Script? CS 4/55231 Internet Engineering Kent State University Dept. of Math & Computer Science LECT-12 Dynamic Documents 1 2 Why Dynamic Documents are needed? There are many situations when customization of the

More information

CS 5450 HTTP. Vitaly Shmatikov

CS 5450 HTTP. Vitaly Shmatikov CS 5450 HTTP Vitaly Shmatikov Browser and Network Browser OS Hardware request reply website Network slide 2 HTML A web page includes Base HTML file Referenced objects (e.g., images) HTML: Hypertext Markup

More information

Ludost Project Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Ludost Project Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space Property Value FTP Server debian.ludost.net Description Ludost Project Archive Country Bulgaria Scan Date 08/May/2015 Total Dirs 33,109 Total Files 504,217 Total Data 520.74 GB Top 20 Directories Sorted

More information

GWDG Software Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

GWDG Software Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space GWDG Software Archive - FTP Site Statistics Property Value FTP Server ftp5.gwdg.de Description GWDG Software Archive Country Germany Scan Date 18/Jan/2016 Total Dirs 1,068,408 Total Files 30,248,505 Total

More information

MSRS Roadmap. As of January 15, PJM 2019

MSRS Roadmap. As of January 15, PJM 2019 MSRS Roadmap As of January 15, 2019 Impact Details Product - Action Required Deadline Who May Be Affected MSRS - Update processes to use basic authentication MSRS - Org parameter added for SUMA requests

More information

HTTP Security. CSC 482/582: Computer Security Slide #1

HTTP Security. CSC 482/582: Computer Security Slide #1 HTTP Security CSC 482/582: Computer Security Slide #1 Topics 1. How HTTP works 2. HTTP methods, headers, and responses 3. URIs, URLs, and URNs 4. Statelessness 5. Cookies 6. More HTTP methods and headers

More information

Lab 2. All datagrams related to favicon.ico had been ignored. Diagram 1. Diagram 2

Lab 2. All datagrams related to favicon.ico had been ignored. Diagram 1. Diagram 2 Lab 2 All datagrams related to favicon.ico had been ignored. Diagram 1 Diagram 2 1. Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server running? According to the diagram

More information

Lecture 9a: Sessions and Cookies

Lecture 9a: Sessions and Cookies CS 655 / 441 Fall 2007 Lecture 9a: Sessions and Cookies 1 Review: Structure of a Web Application On every interchange between client and server, server must: Parse request. Look up session state and global

More information

HashCookies A Simple Recipe

HashCookies A Simple Recipe OWASP London Chapter - 21st May 2009 HashCookies A Simple Recipe Take a cookie Add some salt Add a sequence number John Fitzpatrick Full paper at http://labs.mwrinfosecurity.com Structure What are hashcookies

More information

National Aeronautics and Space Admin. - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

National Aeronautics and Space Admin. - FTP Site Statistics. Top 20 Directories Sorted by Disk Space National Aeronautics and Space Admin. - FTP Site Statistics Property Value FTP Server ftp.hq.nasa.gov Description National Aeronautics and Space Admin. Country United States Scan Date 26/Apr/2014 Total

More information

IKS Service GmbH - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

IKS Service GmbH - FTP Site Statistics. Top 20 Directories Sorted by Disk Space IKS Service GmbH - FTP Site Statistics Property Value FTP Server ftp.iks-jena.de Description IKS Service GmbH Country Germany Scan Date 20/Nov/2015 Total Dirs 5,112 Total Files 8,741 Total Data 1.44 GB

More information

Eindhoven University of Technology - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Eindhoven University of Technology - FTP Site Statistics. Top 20 Directories Sorted by Disk Space Eindhoven University of Technology - FTP Site Statistics Property Value FTP Server ftp.tue.nl Description Eindhoven University of Technology Country Netherlands Scan Date 10/May/2014 Total Dirs 129 Total

More information

Fuji Xerox Software Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Fuji Xerox Software Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space Fuji Xerox Software Archive - FTP Site Statistics Property Value FTP Server ftp.fujixerox.co.jp Description Fuji Xerox Software Archive Country Japan Scan Date 05/Oct/2015 Total Dirs 515 Total Files 7,581

More information

Abusing Windows Opener to Bypass CSRF Protection (Never Relay On Client Side)

Abusing Windows Opener to Bypass CSRF Protection (Never Relay On Client Side) Abusing Windows Opener to Bypass CSRF Protection (Never Relay On Client Side) Narendra Bhati @NarendraBhatiB http://websecgeeks.com Abusing Windows Opener To Bypass CSRF Protection Narendra Bhati Page

More information

Application Level Protocols

Application Level Protocols Application Level Protocols 2 Application Level Protocols Applications handle different kinds of content e.g.. e-mail, web pages, voice Different types of content require different kinds of protocols Application

More information

This report is based on sampled data. Jun 1 Jul 6 Aug 10 Sep 14 Oct 19 Nov 23 Dec 28 Feb 1 Mar 8 Apr 12 May 17 Ju

This report is based on sampled data. Jun 1 Jul 6 Aug 10 Sep 14 Oct 19 Nov 23 Dec 28 Feb 1 Mar 8 Apr 12 May 17 Ju 0 - Total Traffic Content View Query This report is based on sampled data. Jun 1, 2009 - Jun 25, 2010 Comparing to: Site 300 Unique Pageviews 300 150 150 0 0 Jun 1 Jul 6 Aug 10 Sep 14 Oct 19 Nov 23 Dec

More information

The Power of Prediction: Cloud Bandwidth and Cost Reduction

The Power of Prediction: Cloud Bandwidth and Cost Reduction The Power of Prediction: Cloud Bandwidth and Cost Reduction Eyal Zohar Israel Cidon Technion Osnat(Ossi) Mokryn Tel-Aviv College Traffic Redundancy Elimination (TRE) Traffic redundancy stems from downloading

More information

Web. Computer Organization 4/16/2015. CSC252 - Spring Web and HTTP. URLs. Kai Shen

Web. Computer Organization 4/16/2015. CSC252 - Spring Web and HTTP. URLs. Kai Shen Web and HTTP Web Kai Shen Web: the Internet application for distributed publishing and viewing of content Client/server model server: hosts published content and sends the content upon request client:

More information

Rzeszow University Of Technology - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Rzeszow University Of Technology - FTP Site Statistics. Top 20 Directories Sorted by Disk Space Property Value FTP Server ns2.prz-rzeszow.pl Description Rzeszow University Of Technology Country Poland Scan Date 02/Aug/2014 Total Dirs 1,124 Total Files 13,092 Total Data 48.96 GB Top 20 Directories

More information

Revised: March 8 th, 2017 for Firefox 52.0

Revised: March 8 th, 2017 for Firefox 52.0 Configuring Mozilla Firefox for Spectrum v14 Spectrum v14 runs in a browser window. As a result, there are a number of browser settings that impact how Spectrum will function. This document covers the

More information

How It All Stacks Up - or - Bar Charts with Plotly. ISC1057 Janet Peterson and John Burkardt Computational Thinking Fall Semester 2016

How It All Stacks Up - or - Bar Charts with Plotly. ISC1057 Janet Peterson and John Burkardt Computational Thinking Fall Semester 2016 * How It All Stacks Up - or - Bar Charts with Plotly ISC1057 Janet Peterson and John Burkardt Computational Thinking Fall Semester 2016 In a game of poker, players bet by tossing chips into the center

More information

Assignment, part 2. Statement and concepts INFO-0010

Assignment, part 2. Statement and concepts INFO-0010 Assignment, part 2 Statement and concepts INFO-0010 Outline Statement Implementation of concepts Objective Mastermind game using HTTP GET and HTTP POST methods The platform Architecture Root page ("/")

More information

Creating Web Pages. Getting Started

Creating Web Pages. Getting Started Creating Web Pages Getting Started Overview What Web Pages Are How Web Pages are Formatted Putting Graphics on Web Pages How Web Pages are Linked Linking to other Files What Web Pages Are Web Pages combine

More information

1-1. Switching Networks (Fall 2010) EE 586 Communication and. September Lecture 10

1-1. Switching Networks (Fall 2010) EE 586 Communication and. September Lecture 10 EE 586 Communication and Switching Networks (Fall 2010) Lecture 10 September 17 2010 1-1 Announcement Send me your group and get group ID HW3 (short) out on Monday Personal leave for next two weeks No

More information

(Frequently Asked Questions)

(Frequently Asked Questions) (Frequently Asked Questions) Aptech Ltd. Version 1.0 Page 1 of 9 Table of Contents S# Question 1. How do you create sub domains using PHP? 2. What is the difference between echo and print statements in

More information

IBM Software Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

IBM Software Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space IBM Software Archive - FTP Site Statistics Property Value FTP Server public.dhe.ibm.com Description IBM Software Archive Country United States Scan Date 09/Oct/2015 Total Dirs 202,167 Total Files 4,041,461

More information

software.sci.utah.edu (Select Visitors)

software.sci.utah.edu (Select Visitors) software.sci.utah.edu (Select Visitors) Web Log Analysis Yearly Report 2002 Report Range: 02/01/2002 00:00:0-12/31/2002 23:59:59 www.webtrends.com Table of Contents Top Visitors...3 Top Visitors Over Time...5

More information

WWW: the http protocol

WWW: the http protocol Internet apps: their protocols and transport protocols Application e-mail remote terminal access Web file transfer streaming multimedia remote file Internet telephony Application layer protocol smtp [RFC

More information

Homework 2 50 points. CSE422 Computer Networking Spring 2018

Homework 2 50 points. CSE422 Computer Networking Spring 2018 Homework 2 50 points ATM Application-Level Protocol (10 points) Design and describe an application-level protocol to be used between an automatic teller machine and a bank s centralized computer. Your

More information

(3.62 Pages/Visit) * Not viewed traffic includes traffic generated by robots, worms, or replies with special HTTP status codes.

(3.62 Pages/Visit) * Not viewed traffic includes traffic generated by robots, worms, or replies with special HTTP status codes. Last Update: 31 Aug - 19:00 Reported period: Aug 6 6 OK Reported period Month Aug First visit NA Last visit 31 Aug - 18:59 Viewed traffic * Not viewed traffic * Summary Unique visitors Number of visits

More information

Funcom Multiplayer Online Games - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Funcom Multiplayer Online Games - FTP Site Statistics. Top 20 Directories Sorted by Disk Space Property Value FTP Server ftp.funcom.com Description Funcom Multiplayer Online Games Country United States Scan Date 13/Jul/2014 Total Dirs 186 Total Files 1,556 Total Data 67.25 GB Top 20 Directories

More information

Web Gateway Security Appliances for the Enterprise: Comparison of Malware Blocking Rates

Web Gateway Security Appliances for the Enterprise: Comparison of Malware Blocking Rates Web Gateway Security Appliances for the Enterprise: Comparison of Malware Blocking Rates A test commissioned by McAfee, Inc. and performed by AV-Test GmbH Date of the report: December 7 th, 2010 (last

More information

Project 2 Implementing a Simple HTTP Web Proxy

Project 2 Implementing a Simple HTTP Web Proxy Project 2 Implementing a Simple HTTP Web Proxy Overview: CPSC 460 students are allowed to form a group of up to 3 students. CPSC 560 students each must take it as an individual project. This project aims

More information

FREQUENTLY ASKED QUESTIONS

FREQUENTLY ASKED QUESTIONS DISTRICT 7030 WEBSITE FREQUENTLY ASKED QUESTIONS NB: THIS WILL BE REGULARLY UPDATED FOR YOUR INFORMATION. 1. This website works better with the following browsers: Internet Explorer (IE) and Google Chrome.

More information

Unusual Web Bugs. A Web App Hacker s Bag O Tricks. Alex kuza55 K.

Unusual Web Bugs. A Web App Hacker s Bag O Tricks. Alex kuza55 K. Unusual Web Bugs A Web App Hacker s Bag O Tricks Alex kuza55 K. kuza55@gmail.com http://kuza55.blogspot.com/ I'm Alex Starting Uni next year Working for SIFT http://www.sift.com.au/ This talk is Not an

More information

HTTP Server Application

HTTP Server Application 1 Introduction You are to design and develop a concurrent TCP server that implements the HTTP protocol in the form of what is commonly called a web server. This server will accept and process HEAD and

More information

WEB TECHNOLOGIES CHAPTER 1

WEB TECHNOLOGIES CHAPTER 1 WEB TECHNOLOGIES CHAPTER 1 WEB ESSENTIALS: CLIENTS, SERVERS, AND COMMUNICATION Modified by Ahmed Sallam Based on original slides by Jeffrey C. Jackson THE INTERNET Technical origin: ARPANET (late 1960

More information

Chapter 27 WWW and HTTP Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chapter 27 WWW and HTTP Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 27 WWW and HTTP 27.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 27-1 ARCHITECTURE The WWW today is a distributed client/server service, in which

More information

EECS2301. Example. Testing 3/22/2017. Linux/Unix Part 3. for SCRIPT in /path/to/scripts/dir/* do if [ -f $SCRIPT -a -x $SCRIPT ] then $SCRIPT fi done

EECS2301. Example. Testing 3/22/2017. Linux/Unix Part 3. for SCRIPT in /path/to/scripts/dir/* do if [ -f $SCRIPT -a -x $SCRIPT ] then $SCRIPT fi done Warning: These notes are not complete, it is a Skelton that will be modified/add-to in the class. If you want to us them for studying, either attend the class or get the completed notes from someone who

More information

JOE WIPING OUT CSRF

JOE WIPING OUT CSRF JOE ROZNER @JROZNER WIPING OUT CSRF IT S 2017 WHAT IS CSRF? 4 WHEN AN ATTACKER FORCES A VICTIM TO EXECUTE UNWANTED OR UNINTENTIONAL HTTP REQUESTS WHERE DOES CSRF COME FROM? LET S TALK HTTP SAFE VS. UNSAFE

More information

Opera Web Browser Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Opera Web Browser Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space Property Value FTP Server ftp.opera.com Description Opera Web Browser Archive Country United States Scan Date 04/Nov/2015 Total Dirs 1,557 Total Files 2,211 Total Data 43.83 GB Top 20 Directories Sorted

More information

CSCI-1680 WWW Rodrigo Fonseca

CSCI-1680 WWW Rodrigo Fonseca CSCI-1680 WWW Rodrigo Fonseca Based partly on lecture notes by Scott Shenker and John Jannotti Precursors 1945, Vannevar Bush, Memex: a device in which an individual stores all his books, records, and

More information

Control Center Release Notes

Control Center Release Notes Release 1.4.1 Zenoss, Inc. www.zenoss.com Copyright 2017 Zenoss, Inc. All rights reserved. Zenoss, Own IT, and the Zenoss logo are trademarks or registered trademarks of Zenoss, Inc., in the United States

More information

CSCI-1680 WWW Rodrigo Fonseca

CSCI-1680 WWW Rodrigo Fonseca CSCI-1680 WWW Rodrigo Fonseca Based partly on lecture notes by Sco2 Shenker and John Janno6 Administrivia HW3 out today Will cover HTTP, DNS, TCP TCP Milestone II coming up on Monday Make sure you sign

More information

Project 2 Group Project Implementing a Simple HTTP Web Proxy

Project 2 Group Project Implementing a Simple HTTP Web Proxy Project 2 Group Project Implementing a Simple HTTP Web Proxy Overview: This is a group project. CPSC 460 students are allowed to form a group of 3-4 students (It is ok if you want to take it as an individual

More information

Web Browser Application Troubleshooting Guide. Table of Contents

Web Browser Application Troubleshooting Guide. Table of Contents Web Browser Application Troubleshooting Guide The following trouble shooting guide outlines tips for common problems which may resolve incorrect or unexpected behavior of NMFTA s web based applications.

More information

USQ/CSC2406 Web Publishing

USQ/CSC2406 Web Publishing USQ/CSC2406 Web Publishing Lecture 4: HTML Forms, Server & CGI Scripts Tralvex (Rex) Yeap 19 December 2002 Outline Quick Review on Lecture 3 Topic 7: HTML Forms Topic 8: Server & CGI Scripts Class Activity

More information