Skip to content

Instantly share code, notes, and snippets.

View neargle's full-sized avatar
:octocat:
Neargle: Neko~

neargle neargle

:octocat:
Neargle: Neko~
  • Xiamen, China
  • 14:39 (UTC +08:00)
View GitHub Profile
@taterbase
taterbase / upload.php
Created May 13, 2012 15:03
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>
@danburzo
danburzo / README.md
Last active July 29, 2021 08:41
Get all event listeners on the page in Google Chrome
@gkbrk
gkbrk / scanner.py
Created March 10, 2015 21:11
Simple port scanner in Python.
import socket
import sys
import threading
import queue
import time
common_ports = {
"21": "FTP",
"22": "SSH",
"23": "Telnet",
@yosemitebandit
yosemitebandit / xls_to_json.py
Created April 3, 2015 03:28
converting xls files to JSON dicts in python
"""XLS -> json converter
first:
$ pip install xlrd
then:
$ cat in.xls
date, temp, pressure
Jan 1, 73, 455
Jan 3, 72, 344
/*
* CVE-2016-5195 dirtypoc
*
* This PoC is memory only and doesn't write anything on the filesystem.
* /!\ Beware, it triggers a kernel crash a few minutes.
*
* gcc -Wall -o dirtycow-mem dirtycow-mem.c -ldl -lpthread
*/
#define _GNU_SOURCE
@facert
facert / cosine_similarity.py
Last active December 29, 2023 00:29
python 余弦相似度代码示例
# coding: utf-8
from math import sqrt
import jieba.analyse
def cut_word(content):
'''
(u'\u65b9\u5e84', 2.4582479479)
(u'\u82b3\u57ce\u56ed', 1.19547675029)
(u'\u53ef\u6708\u4ed8', 1.19547675029)
@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@phith0n
phith0n / fpm.py
Last active May 9, 2024 08:50
Fastcgi PHP-FPM Client && Code Execution
import socket
import random
import argparse
import sys
from io import BytesIO
# Referrer: https://github.com/wuyunfeng/Python-FastCGI-Client
PY2 = True if sys.version_info.major == 2 else False
@jhaddix
jhaddix / all.txt
Last active May 2, 2024 10:20
all wordlists from every dns enumeration tool... ever. Please excuse the lewd entries =/
This file has been truncated, but you can view the full file.
.
..
........
@
*
*.*
*.*.*
🐎
@neargle
neargle / httplogger.py
Last active August 21, 2020 10:59
该脚本会在80端口开启一个服务并记录所有访问到该服务的HTTP请求,返回访问时间并将请求包转化为Burpsuite等工具可用的格式记录在日志里。依赖Flask(pip install Flask),使用: python httplogger.py log.log
# coding=utf-8
# nearg1e.com@gmail.com
import os
import logging
import datetime
import string
from sys import argv
from flask import Flask, request