Detect Bypass Vulnerabilities in Cellular Isp Filtering System

Total Page:16

File Type:pdf, Size:1020Kb

Detect Bypass Vulnerabilities in Cellular Isp Filtering System MANSOURA UNIVERSITY – FACULTY OF ENGINEERING ELECTRONICS AND COMMUNICATIONS ENGINEERING DEPARTMENT DETECT BYPASS VULNERABILITIES IN CELLULAR ISP FILTERING SYSTEM B. Eng. Final Year Project BY Mohamed Yasser Mohamed Mohamed Gamal Yasien Abdallah Ahmed Abdalaleem SUPERVISOR Assis. Prof. Ahmed Elnakib July 2016 ACKNOWLEDGEMENTS First and foremost, we would like to express our gratitude and appreciation to Dr. Ahmed Elnakib for his support, outstanding guidance and encouragement throughout our senior project. We would also like to thank our family for their encouragement, patience, and assistance over the years. We are forever indebted to our parents, who have always kept us in their prayers. ABSTRACT Cellular internet service provider URL filtering bypass attacks are a set of web vulnerabilities to exploit the web application’s security, by sending a specially crafted HTTP request or inserting a malicious payload into the web application. Their purpose is typically to gain elevated right of entry in order to access filtered sites or get unlimited browsing. This report looks at some of the most common bypass attacks containing the most predominant exploitation outcomes. Subsequently bypass detection and prevention techniques are outlined as a proof of concept. Furthermore, the project will develop a proxy tool to perform security testing and detecting these types of attacks. We will explore how to build the tool and use it for testing. Finally, this report includes remediation tips to fix and patch detected vulnerabilities. TABLE OF CONTENTS LIST OF FIGURES ........................................................................................................................ III LIST OF TABLES .......................................................................................................................... IV GLOSSARY ........................................................................................................................................ V 1 INTRODUCTION .................................................................................................................. 1 1.1 Motivation ............................................................................................................... 1 1.2 Objectives ................................................................................................................ 2 1.3 Project background ................................................................................................ 2 1.3.1 Overview of HTTP ............................................................................................................ 2 1.3.2 Web injections ................................................................................................................... 5 1.3.3 HTTP header injection ....................................................................................................... 6 1.4 Summary ................................................................................................................. 7 2 CREATE BASIC HTTP PROXY .......................................................................................... 9 2.1 Project framework ................................................................................................. 9 2.2 Important built-in python modules .................................................................... 11 2.2.1 Base HTTP server module (BaseHTTPServer) ............................................................... 11 2.2.2 Socket server module (SocketServer) .............................................................................. 11 2.2.3 Socket module (socket) .................................................................................................... 13 2.2.4 URL parse module (urlparse) ........................................................................................... 13 2.3 basic proxy ............................................................................................................ 14 2.4 Summary ............................................................................................................... 14 3 DETECT BYPASS VULNERABILITIES .......................................................................... 15 3.1 Types of bypass attacks ....................................................................................... 15 3.1.1 Modifying request headers ............................................................................................... 15 3.1.2 HTTP Injection ................................................................................................................ 16 3.1.3 Modifying URL ............................................................................................................... 17 3.2 Perform penetration testing ................................................................................ 18 3.2.1 Modify the proxy tool for security testing ....................................................................... 18 3.2.2 Information Gathering...................................................................................................... 18 3.3 Remediation tips ................................................................................................... 19 3.4 Summary ............................................................................................................... 20 4 EXPERIMENTS ................................................................................................................... 21 4.1 Discovered bugs .................................................................................................... 21 4.1.1 Bypass Vodafone captive portal....................................................................................... 21 4.1.2 Vodafone host header trick .............................................................................................. 22 4.1.3 Vodafone front query trick ............................................................................................... 23 4.1.4 Freebasics.com vulnerability in Etisalat Egypt ................................................................ 25 4.1.5 Back inject vulnerability in Etisalat Egypt ....................................................................... 26 I 4.1.6 Browse all websites on social bundles ............................................................................. 27 5 GUI DESIGN AND FEATURES ......................................................................................... 29 5.1 GUI design ............................................................................................................ 29 5.2 GUI Features ........................................................................................................ 29 6 CONCLUSIONS AND FUTURE WORK ........................................................................... 34 6.1 conclusions ............................................................................................................ 34 6.2 future work ........................................................................................................... 34 REFERENCES ................................................................................................................................... 35 II LIST OF FIGURES Figure 1-1: HTTP request-response behavior ................................................................................3 Figure 1-2: General format of an HTTP request message .............................................................4 Figure 1-3: URL components ........................................................................................................5 Figure 1-4: Types of Web injections..............................................................................................6 Figure 2-1: Main idea of bypass vulnerability ...............................................................................9 Figure 2-2: Framework ................................................................................................................10 Figure 3-1: Find ISP proxy server................................................................................................19 Figure 4-1: Redirection to captive portal at zero balance ............................................................21 Figure 4-2: Vodafone bug using Google trick .............................................................................22 Figure 4-3: Security auditing to Ana Vodafone application ........................................................23 Figure 4-4: Vodafone bypass using official website ....................................................................24 Figure 4-5: Reporting a bug .........................................................................................................24 Figure 4-6: Front query trick ........................................................................................................25 Figure 4-7: Reporting Free basics bug to Etisalat ........................................................................26 Figure 4-8: Etisalat back inject bypass ........................................................................................27 Figure 4-9: Browse all sites on a social bundle............................................................................28 Figure 4-10: Front inject attack on social bundles .......................................................................28 Figure 5-1: GUI main window .....................................................................................................30
Recommended publications
  • How to Secure Your Web Site Picked up SQL Injection and Cross-Site Scripting As Sample Cases of Failure Because These Two Are the Two Most Reported Vulnerabilities
    How to Secure your Website rd 3 Edition Approaches to Improve Web Application and Web Site Security June 2008 IT SECURITY CENTER (ISEC) INFORMATION-TECHNOLOGY PROMOTION AGENCY, JAPAN This document is a translation of the original Japanese edition. Please be advises that most of the references referred in this book are offered in Japanese only. Both English and Japanese edition are available for download at: http://www.ipa.go.jp/security/english/third.html (English web page) http://www.ipa.go.jp/security/vuln/websecurity.html (Japanese web page) Translated by Hiroko Okashita (IPA), June 11 2008 Contents Contents ......................................................................................................................................... 1 Preface ........................................................................................................................................... 2 Organization of This Book ........................................................................................................... 3 Intended Reader ......................................................................................................................... 3 Fixing Vulnerabilities – Fundamental Solution and Mitigation Measure - .................................... 3 1. Web Application Security Implementation ............................................................................... 5 1.1 SQL Injection .................................................................................................................... 6 1.2
    [Show full text]
  • Ch 13: Attacking Users: Other Techniques (Part 2) Other Client-Side Injection Attacks HTTP Header Injection
    CNIT 129S: Securing Web Applications Ch 13: Attacking Users: Other Techniques (Part 2) Other Client-Side Injection Attacks HTTP Header Injection • User-controlled data in an HTTP header • Most commonly the Location and Set-Cookie headers Injecting Another Header Exploiting Header Injection • See if %0d and %0a return decoded as carriage- return and line-feed • If only one works, you may still be able to exploit it • If they are blocked or sanitized, try these bypasses Injecting Cookies • Cookies may persist across browser sessions Delivering Other Attacks • HTTP header injection allows an attacker to control the entire body of a response • Can deliver almost any attack • Virtual website defacement • Script injection • Redirection HTTP Response Splitting • Inject a second complete page into the headers • Must inject carriage returns and line feeds • Fixed in modern servers (link Ch 13d) Poisoning the Cache on a Proxy Server Preventing Header Injection • Don't insert user-controllable input into headers • If you must, use • Input validation (context-dependent) • Output validation: block all ASCII characters below 0x20 Cookie Injection • Attacker sets or modifies a cookie in the victim user's browser • This may be possible if: • App has functionality that takes a name and value from parameters and sets those within a cookie, such as "Save user preferences" • HTTP header injection vulnerability Cookie Injection • Setting a malicious cookie via XSS • XSS in related domains can be leveraged to set a cookie on the targeted domain, from any of
    [Show full text]
  • Alibaba Cloud Alibaba Cloud CDN
    Alibaba Cloud Alibaba Cloud CDN Domain Management Issue: 20190815 Alibaba Cloud CDN Domain Management / Legal disclaimer Legal disclaimer Alibaba Cloud reminds you to carefully read and fully understand the terms and conditions of this legal disclaimer before you read or use this document. If you have read or used this document, it shall be deemed as your total acceptance of this legal disclaimer. 1. You shall download and obtain this document from the Alibaba Cloud website or other Alibaba Cloud-authorized channels, and use this document for your own legal business activities only. The content of this document is considered confidential information of Alibaba Cloud. You shall strictly abide by the confidentiality obligations. No part of this document shall be disclosed or provided to any third party for use without the prior written consent of Alibaba Cloud. 2. No part of this document shall be excerpted, translated, reproduced, transmitted, or disseminated by any organization, company, or individual in any form or by any means without the prior written consent of Alibaba Cloud. 3. The content of this document may be changed due to product version upgrades , adjustments, or other reasons. Alibaba Cloud reserves the right to modify the content of this document without notice and the updated versions of this document will be occasionally released through Alibaba Cloud-authorized channels. You shall pay attention to the version changes of this document as they occur and download and obtain the most up-to-date version of this document from Alibaba Cloud-authorized channels. 4. This document serves only as a reference guide for your use of Alibaba Cloud products and services.
    [Show full text]
  • Header Enrichment Or ISP Enrichment? Emerging Privacy Threats in Mobile Networks
    Header Enrichment or ISP Enrichment? Emerging Privacy Threats in Mobile Networks Narseo Vallina-Rodriguez∗, Srikanth Sundaresan∗, Christian Kreibich∗†,Vern Paxson∗‡ ∗ICSI, †Lastline, ‡UC Berkeley {narseo,srikanth}@icsi.berkeley.edu, {christian,vern}@icir.org ABSTRACT with getting good attribution data. — C. Hillier, VP HTTP header enrichment allows mobile operators to anno- of Verizon’s Precision Market Insights division [11] tate HTTP connections via the use of a wide range of re- This quote illustrates two important challenges mobile op- quest headers. Operators employ proxies to introduce such erators face today: how to ease network management and headers for operational purposes, and—as recently widely how to increase revenue by monetizing subscriber metadata publicized—also to assist advertising programs in identi- and traffic. fying the subscriber responsible for the originating traffic, HTTP header enrichment allows operators to kill two with significant consequences for the user’s privacy. In this birds with one stone [6]: first, operators can append infor- paper, we use data collected by the Netalyzr network trou- mation into HTTP traffic to enable attribution (of network re- bleshooting service over 16 months to identify and charac- sources to specific users users), performance enhancement, terize HTTP header enrichment in modern mobile networks. analytics, and content access control and customization [4, p. We present a timeline of HTTP header usage for 299 mobile 62]; second, operators can monetize their network and user service providers from 112 countries, observing three main base through advertising programs by taking advantage of categories: (1) unique user and device identifiers (e.g., IMEI their position to inject unique tracking identifiers into every and IMSI), (2) headers related to advertising programs, and HTTP request, popularly known as “super-cookies” [8].
    [Show full text]
  • How to Secure Your Website
    How to Secure Your Website th 5 Edition Approaches to Improve Web Application and Website Security April 2011 IT SECURITY CENTER (ISEC) INFORMATION-TECHNOLOGY PROMOTION AGENCY, JAPAN Both English and Japanese edition are available for download at: http://www.ipa.go.jp/security/english/third.html#websecurity (English web page) http://www.ipa.go.jp/security/vuln/websecurity.html (Japanese web page) Contents Preface ............................................................................................................................................. 2 Organization of This Book .......................................................................................................... 3 Intended Reader .......................................................................................................................... 3 What is Revised in the 5th Edition ............................................................................................ 3 Fixing Vulnerabilities ................................................................................................................. 4 -Fundamental Solution and Mitigation Measure- ............................................................... 4 1. Web Application Security Implementation ............................................................................ 5 1.1 SQL Injection .................................................................................................................... 6 1.2 OS Command Injection .................................................................................................
    [Show full text]
  • Integrating Automated Security Testing in the Agile Development Process
    DEGREE PROJECT, IN COMPUTER SCIENCE , SECOND LEVEL STOCKHOLM, SWEDEN 2015 Integrating Automated Security Testing in the Agile Development Process EARLIER VULNERABILITY DETECTION IN AN ENVIRONMENT WITH HIGH SECURITY DEMANDS ANDREAS BROSTRÖM KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND COMMUNICATION (CSC) Integrating Automated Security Testing in the Agile Development Process Earlier Vulnerability Detection in an Environment with High Security Demands Integrering av automatiserad säkerhetstestning i den agila utvecklingsprocessen Upptäck sårbarheter tidigare i en miljö med höga säkerhetskrav ANDREAS BROSTRÖM <[email protected]> DA225X, Master’s Thesis in Computer Science (30 ECTS credits) Degree Progr. in Computer Science and Engineering 300 credits Royal Institute of Technology year 2015 Supervisor at CSC was Linda Kann Examiner was Mads Dam Employer was Nordnet Bank AB Supervisor at Nordnet was Joakim Hollstrand June 22, 2015 Abstract The number of vulnerabilities discovered in software has been growing fast the last few years. At the same time the Agile method has quickly become one of the most popular methods for software development. However, it contains no mention of security, and since security is not traditionally agile it is hard to develop secure software using the Agile method. To make software secure, security testing must be included in the development process. The aim of this thesis is to investigate how and where security can be integrated in the Agile development pro- cess when developing web applications. In the thesis some possible approaches for this are presented, one of which is to use a web application security scanner. The crawling and detection abilities of four scanners are compared, on scanner evaluation applications and on applications made by Nordnet.
    [Show full text]
  • The Complete Guide to CORS (In)Security
    The Complete Guide to CORS (In)Security _ Author: Davide Danelon ( @TwiceDi) Version: 1.1 – January 2020 Table of Content 1 _ INTRODUCTION ....................................................... 4 1.1 • WHO SHOULD READ THIS ARTICLE? _ ................................................. 4 2 _ CROSS-ORIGIN RESOURCE SHARING (CORS) ............................... 5 2.1 • SAME ORIGIN POLICY _ ............................................................ 5 2.2 • THE CORS ADVENT _ ............................................................... 6 2.2.1 Credentials .......................................................................................... 7 2.2.2 Preflight request .................................................................................... 7 2.2.3 Allowing multiple origins ............................................................................ 8 2.2.4 Other headers involved ............................................................................... 8 3 _ ATTACKING TECHNIQUES ............................................... 9 3.1 • PROCESS _ ....................................................................... 9 3.1.1 Identification ....................................................................................... 9 3.1.2 Analysis ............................................................................................ 10 3.1.3 Exploitation ........................................................................................ 10 3.2 • EXPLOITING WITH CREDENTIALS _ .................................................
    [Show full text]
  • Overview of the Application-Level Security of the Swiss E-Voting System
    Overview of the Application-Level Security of the Swiss E-voting System Author: Mazin Ahmed <[email protected]> ​ ​ April 2019 1. Introduction This year, 2019, the Swiss government is planning to fully establish E-voting within the next elections. During 25 February to 24 March 2019, the Swiss Post has hosted a public program where researchers, hackers, and professionals can register for a program where they can attack the Swiss E-voting system in a controlled environment. Any individual who identifies a security vulnerability or a potential attack that affects the system can report it to the Swiss Post program, where the Swiss Post will analyze and fix the finding as well as financially rewarding the reporter. The Swiss Post has also released the source code of the system as a separate program, but rewards were only paid if the individual were only able to exploit the weakness on the public program. I wanted to write this research to show an overview of the Swiss Post E-voting system security from an application level. I am a security consultant with years of experience in auditing applications security. You can read more about my work at mazinahmed.net. ​ The conducted analysis mainly focuses on the security overview of the application. It does not cover cryptographic implementations within the system. 2. Findings 2.1 CSP Misconfigurations Content Security Policy (CSP) is a standard for protecting against XSS vulnerabilities on the browser level. Reviewing the Content Security Policy used by The Swiss E-voting system, I found a bypass for the policy: The CSP for Swiss E-voting System (as of February 26th, 2019): Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self'; connect-src 'self'; child-src 'self'; font-src 'self' A well-written CSP should prevent the exploitation of XSS attacks.
    [Show full text]
  • Development and Implementation of Secure Web Applications
    DEVELOPMENT AND IMPLEMENTATION OF SECURE WEB APPLICATIONS AUGUST 2011 Acknowledgements CPNI would like to acknowledge and thank Daniel Martin and NGS Secure for their help in the preparation of this document. Abstract This guide is intended for professional web application developers and technical project managers who want to understand the current threats and trends in the web application security realm, and ensure that the systems they are building will not expose their organisations to an excessive level of risk. Disclaimer: Reference to any specific commercial product, process or service by trade name, trademark, manufacturer, or otherwise, does not constitute or imply its endorsement, recommendation, or favoring by CPNI. The views and opinions of authors expressed within this document shall not be used for advertising or product endorsement purposes. To the fullest extent permitted by law, CPNI accepts no liability for any loss or damage (whether direct, indirect or consequential and including, but not limited to, loss of profits or anticipated profits, loss of data, business or goodwill) incurred by any person and howsoever caused arising from or connected with any error or omission in this document or from any person acting, omitting to act or refraining from acting upon, or otherwise using, the information contained in this document or its references. You should make your own judgment as regards use of this document and seek independent professional advice on your particular circumstances. Executive summary Document scope This document is a practical guide on how to design and implement secure web applications. Any such analysis must start with an understanding of the risks to which your application will be exposed.
    [Show full text]
  • Class on Computer Systems Security, Lecture 9
    6.858 Lecture 9 WEB SECURITY: Part II Last lecture, we looked at a core security mechanism for the web: the same-origin policy. In this lecture, we'll continue to look at how we can build secure web applications. The recent "Shell Shock" bug is a good example of how difficult it is to design web services that compose multiple technologies. • A web client can include extra headers in its HTTP requests, and determine which quer parameters are in a request. Ex: o GET /query.cgi?searchTerm=cats HTTP 1.1 o Host: y www.example.com o Custom-header: Custom-value • CGI servers map the various components of the HTTP request to Unix environment variables. • Vulnerability: Bash has a parsing bug in the way that it handles the setting of environment variables! If a string begins with a certain set of malformed bytes, bash will continue to parse the rest of the string and execute any commands that it finds! For example, if you set an environment variable to a value like this… () { :;}; /bin/id • …will confuse the bash parser, and cause it to execute the /bin/id command (which displays the UID and GID information for the current user). • Live demo o Step 1: Run the CGI server. § ./victimwebserver.py 8082 o Step 2: Run the exploit script. § ./shellshockclient.py localhost:8082 index.html • More information: http://seclists.org/oss-sec/2014/q3/650 Shell Shock is a particular instance of security bugs which arise from imprope content sanitzation. Another type of content sanitzation failure occurs during cross- site scrip ting attacks (XSS).
    [Show full text]
  • Investigation Report Regarding Security Issues of Web Applications Using HTML5
    Investigation Report Regarding Security Issues of Web Applications Using HTML5 JPCERT Coordination Center October 30, 2013 Contents 1. Introduction ...................................................................................................................... 2 2. Purpose and Method of This Investigation ...................................................................... 4 2.1. Purpose .................................................................................................................... 4 2.2. Method ..................................................................................................................... 4 3. Vulnerabilities that need to be noted especially in HTML5 .............................................. 5 3.1. Cross Site Scripting ............................................................................................... 5 3.2. Cross Site Request Forgery ................................................................................ 10 3.3. Open Redirect ....................................................................................................... 12 3.4. Defect in Access or Authorization Control ........................................................ 15 4. HTML5 features that should be noted ........................................................................... 16 4.1. Newly Added HTML Elements ............................................................................. 16 4.2. JavaScript API ......................................................................................................
    [Show full text]
  • Header Enrichment Or ISP Enrichment? Emerging Privacy Threats in Mobile Networks
    Header Enrichment or ISP Enrichment? Emerging Privacy Threats in Mobile Networks Narseo Vallina-Rodriguez∗, Srikanth Sundaresan∗, Christian Kreibich∗†,Vern Paxson∗‡ ∗ICSI, †Lastline, ‡UC Berkeley {narseo,srikanth}@icsi.berkeley.edu, {christian,vern}@icir.org ABSTRACT with getting good attribution data. — C. Hillier, VP HTTP header enrichment allows mobile operators to anno- of Verizon’s Precision Market Insights division [11] tate HTTP connections via the use of a wide range of re- This quote illustrates two important challenges mobile op- quest headers. Operators employ proxies to introduce such erators face today: how to ease network management and headers for operational purposes, and—as recently widely how to increase revenue by monetizing subscriber metadata publicized—also to assist advertising programs in identi- and traffic. fying the subscriber responsible for the originating traffic, HTTP header enrichment allows operators to kill two with significant consequences for the user’s privacy. In this birds with one stone [6]: first, operators can append infor- paper, we use data collected by the Netalyzr network trou- mation into HTTP traffic to enable attribution (of network re- bleshooting service over 16 months to identify and charac- sources to specific users users), performance enhancement, terize HTTP header enrichment in modern mobile networks. analytics, and content access control and customization [4, p. We present a timeline of HTTP header usage for 299 mobile 62]; second, operators can monetize their network and user service providers from 112 countries, observing three main base through advertising programs by taking advantage of categories: (1) unique user and device identifiers (e.g., IMEI their position to inject unique tracking identifiers into every and IMSI), (2) headers related to advertising programs, and HTTP request, popularly known as “super-cookies” [8].
    [Show full text]