lundi 26 octobre 2020

If U Think U R Good at PHP and CTF, Just Click (preg_match() bypass) [closed]

Try to RCE it!

a very strange bypass problem, but if u r good enough (unlike me), you sure can bypass it :)

easy peasy!

The WAF code is here:

<?php

highlight_file(__FILE__);
echo $_GET['code'];
if(isset($_GET['code'])){  
    $code = $_GET['code'];
    if(strlen($code) > 70 or preg_match('/[A-Za-z0-9]|\'|"|`|\ |,|\.|-|\+|=|\/|\\|<|>|\$|\?|\^|&|\|/ixm',$code)){
        die('<script>alert(\'Failed\');</script>');
    }
        
    else if(';' === preg_replace('/[^\s\(\)]+?\((?R)?\)/', '', $code)){
        eval($code);
        die();
    }       
}
?>

Can U Bypass it?

Happy Trying :)




127.0.0.1:5000 doesn't consider $_SESSION[login_user] [closed]

I'm making a web app. When I log into page 127.0.0.1:5000, if the login_user session variable is not set, then it should bring me back to the index, because I haven't logged in yet. However, this does not happen, and for this reason every time I type 127.0.0.1:5000 in the search bar I'm directed to this page even without login, can anyone give me an explanation? This is the part in the 127.0.0.1:5000 php file where I redirect:

<?php
   session_start();
   if(!isset($_SESSION["login_user"])){
       header('location: http://127.0.0.1');
       exit(0);
   }
?>
<html lang="en">
<head>
...

Anyone can help me?




Error generating route "/": HTML minification failed. Nuxt js

I developed a nuxt app and it works perfectly when run with "npm run dev". But when I generating the site with "npx nuxt generate" console shows following error. I cant find the error. Please help me. enter image description here




Share image with captions on whatsapp and facebook from website

I searched a lot but haven't found any satisfactory answer. My use case is as follows

I have a website using javascript framework and it has social media links to various apps like whatsapp, twitter, fb etc. On whatsapp I can share text message and links using

https://api.whatsapp.com/send?text=

but I dont know how to share an image along with text and link like in these screenshot.

enter image description here

As far as I understand it is only possible in android and ios apps.

Please suggest if there is a way to do it in web/browser?




Weppage scrolling via gesture on touchscreen not working

the horizontal scrolling on my webpage on touch screens is only working if you move the scrollbar not with the dragging motion on the touch screen. As the project is quite complex for me already, I have no idea what could cause the problem with the scrolling. Which factors could play into this? I am testing this on a screen that you can connect via hdmi and usb which has touch enabled. The problem also is when doing the scrolling motion, the content will be highlighted instead.

Thanks in advance even with this short explanation! I will be happy to share some code if I know more precisely what is helpful for others

Also might this be a problem with the browser in general (or on a certain os)? I am just super confused, what is going. I tested to connect this touch screen to my windows pc and a linux one and visited some normal pages like wikipedia. On the linux pc the scrolling motion was just highlighting stuff there too




How to fix error: Could not load file or assembly '" website"' or one of its dependencies

Hello I'm having trouble running my ASP.Net site. I am new to using it to build websites, ijust wanted to know how can i solve this error: Could not load file or assembly '"My Website"' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047).

what is it that i did wrong in order to get it., I looked at other solutions like going to tools>options>web projects enter image description here

But the checkbox to use the 64 bit version of IIS for websites and projects was disabled




Why isn't getElementsByClassName (instead of byID) isn't working? [duplicate]

Why this example of the sticky header doesn't work if I get element by class instead of ID? I need to get it by class, but for some reason, it breaks the logic.

Source: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_sticky_header

It seems it just can't find the object with this class, even though I added it:

Uncaught TypeError: Cannot read property 'remove' of undefined"
window.onscroll = function() {myFunction()};

var header = document.getElementsByClassName("myHeader");
var sticky = header.offsetTop;

function myFunction() {
  if (window.pageYOffset > sticky) {
    header.classList.add("sticky");
  } else {
    header.classList.remove("sticky");
  }
}
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

.top-container {
  background-color: #f1f1f1;
  padding: 30px;
  text-align: center;
}

.header {
  padding: 10px 16px;
  background: #555;
  color: #f1f1f1;
}

.content {
  padding: 16px;
}

.sticky {
  position: fixed;
  top: 0;
  width: 100%;
}

.sticky + .content {
  padding-top: 102px;
}
<div class="top-container">
  <h1>Scroll Down</h1>
  <p>Scroll down to see the sticky effect.</p>
</div>

<div class="myHeader header" id="myHeader">
  <h2>My Header</h2>
</div>

<div class="content">
  <h3>On Scroll Sticky Header</h3>
  <p>The header will stick to the top when you reach its scroll position.</p>
  <p>Scroll back up to remove the sticky effect.</p>
  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>
  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>
  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>
  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p><p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p><p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p><p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p><p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>
  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>
  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>
  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>
  <p>Some text to enable scrolling.. Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p>
</div>