0x00 前言

pwn脚本千篇一律,之前也是保存了一份模板,每次都用它,但还是觉得每次都复制一次各种名字还是有的累,于是就写了一份脚本生成器

0x01 ScriptMaker

#!/usr/bin/env python
# coding: UTF-8
import sys
from sys import * def make():
data = """
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
from pwn import *
import os, sys DEBUG = 1 elf = ELF('./""" + argv[1] + """') if DEBUG:
libc = ELF('/home/moonagirl/moonagirl/libc/libc_local_x64')
p = process('./""" + argv[1] + """')
context.log_level = 'debug' else:
libc = ELF('./libc-2.23.so')
www = '47.90.103.10'
port = 6000
p = remote(www,port) system_libc = libc.symbols['system']
success('system_libc:'+hex(system_libc)) def pwn():
p.interactive() if __name__ == '__main__':
pwn()
"""
py = "%s.py" % argv[1] f = open("./%s" % py, "wb")
f.write(data)
f.close() if __name__ == '__main__':
if len(sys.argv) > 1:
make()

0x02 将ScriptMaker加入系统路径

将保存ScriptMaker的路径加入到home下的.profile文件PATH中,如下图,我的路径为/moonagirl/libc/python

➜  ~ cat .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package. # the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022 # if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi # set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$HOME/moonagirl/libc/python:$PATH"

然后重启系统就可以直接在命令台下执行ScriptMaker了,以后有什么新的需求直接修改ScriptMaker文件就行

➜  ~ ScriptMaker Test

  

ScriptMaker的更多相关文章

  1. fadora24安装settools,pip包出错解决方法

    1.fadora24安装Python2.7 [root@dev ~]# python bash: python: 未找到命令... 安装软件包“python”以提供命令“python”? [N/y] ...

随机推荐

  1. ios 自定义导航栏,开启侧滑返回手势

    自定义一个常用ListViewController .h文件 #import <UIKit/UIKit.h> @interface ListViewController : UIViewC ...

  2. UVA - 12563 Jin Ge Jin Qu hao (01背包)

    InputThe first line contains the number of test cases T (T ≤ 100). Each test case begins with two po ...

  3. 1、kubernetes系统基础190622

    1.容器编排工具 docker编排工具三剑客:docker compose, docker swarm, docker machine IDC的操作系统:mesos 提供容器编排框架:marathon ...

  4. 查询缓存及索引:MySQL系列之九

    一.MySQL的架构 连接器 连接池,安全认证.线程池.连接限制.检查内存.缓存 SQL接口 DML.DDL SQL解析器,对SQL语句的权限检查.解析为二进制程序 优化器,优化访问路径 缓存cach ...

  5. A^B mod (大数运算)

    #include<iostream> #include<cstdio> #include<cstring> using namespace std; ; ; cha ...

  6. Nologging操作对standby的影响

    1.primary 首先要设置为 force_log mode ,然后再做备份,在应用到备库上. 2.switch over 之前需要检查v$database_block_corruption  视图 ...

  7. dpkg dependency problems prevent configuration

    dpkg: dependency problems prevent configuration of cr3: cr3 depends on libpng12-0 (>= 1.2.13-4); ...

  8. 跨域和jsonp的了解和学习

    一.为什么会有跨域问题呢 因为有浏览器的同源策略. 同源:如果两个页面的协议,端口(如果有指定)和主机都相同,则两个页面具有相同的源.我们也可以把它称为“协议/主机/端口 tuple”,或简单地叫做“ ...

  9. Hadoop文件压缩

    1. Hadoop的文件压缩需求 文件压缩对于大容量的分布式存储系统而言是必须的,它能带来两个好处: 1)减少了文件所需的存储空间: 2)加快了文件在网络上或磁盘间的传输速度. 2. Hadoop支持 ...

  10. Python3基础(4)匿名函数、装饰器、生成器、迭代器、内置函数、json&pickle序列化、软件目录开发规范、不同目录间模块调用

    ---------------个人学习笔记--------------- ----------------本文作者吴疆-------------- ------点击此处链接至博客园原文------ 1 ...