Posts

backdoor CTF evil

Image
backdoor CTF evil hi today we going to solve CTF challenge   let us quick read  it link cool it's service on port 9007 now  time to read source code      now we going to explain how code flow work flag define as variable and also super_secret_code that it's part one now going to part 2 it's condition flow first guess it take inputs using python input and compare it with super_secret_code if condition true it will print flag . ok that flow now time to identify weakness ,input in last python version it act like  eval(raw_input) as we know eval it    function evaluates a string of text which is passed as its parameter, accepting possible second argument for the global values to use during evaluation. through this we can read super_secret_code by type it in prompt it will read variable and save it in guess and use it in if statement . quick example you see we enter secret again now let us print g to s...

python input vulnerability

Image
python input vulnerability hi guys today i will show you how little mistake in write code can lead to expose data or RCE on sever . as we know python has function that take input from user can save it in variable . in python 2.x version we find input function   and it built-in function input in module __builtin__  let check what mean this method by using help(input) it 's  equivalent to eval(raw_input) ok raw_input it's another function take input from user but in input function it's add eval as we know eval it  function evaluates a string of text which is passed as its parameter, accepting possible second argument for the global values to use during evaluation. let make quick demo  and if we enter number it will display it but what if we enter 2+4 it will display 6 because it's use eval as part of input function as we see above from here we can use  __builtin__  module to get  som...

Code injection

Image
Code injection hi guys am going to solve  PentesterLab Code injection  if you dont know about code injection it's one of big bugs that let hacker to execute codes in server i will give link explain all information about this bug now let us begin in  this  section include four task and how to get RCE  and execute php code . this first challenge let pwn it    pentesters  try to get error simple way to add double quotes  oh nice you can see it's use eval ,eval one of function in php that when you pass string it convert it to php code now we get error let try to understand how it work here if you see in second picture it's expecting ! and if you compare it with first one you can see !!! if you change name in parameter it's still add !!! to end  after reversing code  i can write simple code act like this  now we have simple code now let to try to fix error...