Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Flag Testing after fix completed
Browse files Browse the repository at this point in the history
  • Loading branch information
B3nac committed Jul 26, 2020
1 parent 64e279d commit 7c2d38a
Show file tree
Hide file tree
Showing 6 changed files with 379 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package b3nac.injuredandroid;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
Expand All @@ -10,8 +9,6 @@
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.view.View;

public class ExportedProtectedIntent extends AppCompatActivity {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class FlagOneLoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_flag_one_login)
SecureSharedPrefs.setContext(this)
val toolbar = findViewById<Toolbar>(R.id.toolbar)
setSupportActionBar(toolbar)
val fab = findViewById<FloatingActionButton>(R.id.fab)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class RCEActivity : AppCompatActivity() {
copyAssets()
val data = intent.data
try {
val intentParam = data.getQueryParameter("binary")
val intentParam = data!!.getQueryParameter("binary")
val binaryParam = data.getQueryParameter("param")
val combinedParam = data.getQueryParameter("combined")
childRef.addListenerForSingleValueEvent(object : ValueEventListener {
Expand Down
175 changes: 175 additions & 0 deletions flutter_module/lib/auth-bypass.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import 'package:flutter/material.dart';
import 'package:flutterxssmodule/run_javascript.dart';

void main() => runApp(AuthBypass());

const PrimaryColor = const Color(0xFF008577);

class AuthBypass extends StatelessWidget {

@override
Widget build(BuildContext context) {
final appTitle = 'Flutter XSS';

return MaterialApp(
title: appTitle,
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: PrimaryColor,
),
home: Scaffold(
appBar: AppBar(
title: Text(appTitle),
),
body: MyCustomForm(),
),
);
}
}

// Create a Form widget.
class MyCustomForm extends StatefulWidget {
@override
MyCustomFormState createState() {
return MyCustomFormState();
}
}

// Create a corresponding State class.
// This class holds data related to the form.
class MyCustomFormState extends State<MyCustomForm> {
// Create a global key that uniquely identifies the Form widget
// and allows validation of the form.
//
// Note: This is a GlobalKey<FormState>,
// not a GlobalKey<MyCustomFormState>.
final _formKey = GlobalKey<FormState>();
var usernameKey = GlobalKey<FormFieldState>();

@override
Widget build(BuildContext context) {
// Build a Form widget using the _formKey created above.

return Form(
key: _formKey,
child: Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 2.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Flexible(
child: new Container(
padding: new EdgeInsets.only(right: 15.0),
child: new Text(
'Register a user',
overflow: TextOverflow.ellipsis,
style: new TextStyle(
fontSize: 18.0,
fontFamily: 'Roboto',
color: new Color(0xFF212121),
fontWeight: FontWeight.bold,
),
),
),
),
Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 25.0),
child: new Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
),
],
)),
TextFormField(
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.greenAccent, width: 5.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: PrimaryColor, width: 5.0),
),
//border: InputBorder.none,
hintText: 'Enter a username.', contentPadding: const EdgeInsets.all(20.0)
),
key: usernameKey,
validator: (username) {
if (username.isEmpty) {
return 'Please enter a username.';
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MyHomePage(test: usernameKey.currentState.value,),
));
return null;
},
),
Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 25.0),
child: new Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
),
],
)),
TextFormField(
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.greenAccent, width: 5.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: PrimaryColor, width: 5.0),
),
//border: InputBorder.none,
hintText: 'Enter a password.', contentPadding: const EdgeInsets.all(20.0)
),
validator: (password) {
if (password.isEmpty) {
return 'Please enter a password.';
}
return null;
},
),
Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 25.0),
child: new Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
),
],
)),
Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 2.0),
child: RaisedButton(
onPressed: () {
// Validate returns true if the form is valid, or false
// otherwise.
if (_formKey.currentState.validate()) {
// If the form is valid, display a Snackbar.
Scaffold.of(context)
.showSnackBar(SnackBar(content: Text('Processing Data')));
}
},
child: Text('Sign up'),
),
),
],
),
));
}
}
181 changes: 181 additions & 0 deletions flutter_module/lib/login-xss.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
import 'package:flutter/material.dart';
import 'package:flutterxssmodule/run_javascript.dart';
import 'package:shared_preferences/shared_preferences.dart';

void main() => runApp(LoginXSS());

const PrimaryColor = const Color(0xFF008577);

class LoginXSS extends StatelessWidget {

@override
Widget build(BuildContext context) {
final appTitle = 'Flutter XSS';

return MaterialApp(
title: appTitle,
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: PrimaryColor,
),
home: Scaffold(
appBar: AppBar(
title: Text(appTitle),
),
body: MyCustomForm(),
),
);
}
}

// Create a Form widget.
class MyCustomForm extends StatefulWidget {
@override
MyCustomFormState createState() {
return MyCustomFormState();
}
}

// Create a corresponding State class.
// This class holds data related to the form.
class MyCustomFormState extends State<MyCustomForm> {
// Create a global key that uniquely identifies the Form widget
// and allows validation of the form.
//
// Note: This is a GlobalKey<FormState>,
// not a GlobalKey<MyCustomFormState>.
final _formKey = GlobalKey<FormState>();
var usernameKey = GlobalKey<FormFieldState>();

@override
Widget build(BuildContext context) {
// Build a Form widget using the _formKey created above.

return Form(
key: _formKey,
child: Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 2.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Flexible(
child: new Container(
padding: new EdgeInsets.only(right: 15.0),
child: new Text(
'Register a user',
overflow: TextOverflow.ellipsis,
style: new TextStyle(
fontSize: 18.0,
fontFamily: 'Roboto',
color: new Color(0xFF212121),
fontWeight: FontWeight.bold,
),
),
),
),
Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 25.0),
child: new Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
),
],
)),
TextFormField(
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.greenAccent, width: 5.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: PrimaryColor, width: 5.0),
),
//border: InputBorder.none,
hintText: 'Enter a username.', contentPadding: const EdgeInsets.all(20.0)
),
key: usernameKey,
validator: (username) {
if (username.isEmpty) {
return 'Please enter a username.';
}
storeFlagState() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('username', username);
}
storeFlagState();
return null;
},
),
Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 25.0),
child: new Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
),
],
)),
TextFormField(
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.greenAccent, width: 5.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: PrimaryColor, width: 5.0),
),
//border: InputBorder.none,
hintText: 'Enter a password.', contentPadding: const EdgeInsets.all(20.0)
),
validator: (password) {
if (password.isEmpty) {
return 'Please enter a password.';
}
return null;
},
),
Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 25.0),
child: new Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
),
],
)),
Padding(
padding: EdgeInsets.only(
left: 25.0, right: 25.0, top: 2.0),
child: RaisedButton(
onPressed: () {
// Validate returns true if the form is valid, or false
// otherwise.
if (_formKey.currentState.validate()) {
// If the form is valid, display a Snackbar.
Scaffold.of(context)
.showSnackBar(SnackBar(content: Text('Processing Data')));
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MyHomePage(test: usernameKey.currentState.value,),
));
}
},
child: Text('Sign up'),
),
),
],
),
));
}
}
Loading

0 comments on commit 7c2d38a

Please sign in to comment.