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. Java基础--常用API--java.lang.Object

    一.简述 1.Object类是所有类的父类,即直接或间接的继承java.lang.Object类.省略了extends Object. 2.方法 (1)protected native Object ...

  2. final、权限、内部类

    final.权限.内部类 final.权限.内部类 final.权限.内部类 final.权限.内部类 final.权限.内部类 final.权限.内部类

  3. web应用,http协议简介,web框架

    一.web应用 web应用程序是一种可以通过Web访问的应用程序,程序的最大好处是用户很容易访问应用程序,用户只需要有浏览器即可,不需要再安装其他软件.应用程序有两种模式C/S.B/S.C/S是客户端 ...

  4. Caused by: MetaException(message:Hive Schema version 2.1.0 does not match metastore's schema version 1.2.0 Metastore is not upgraded or corrupt)_2

    Caused by: MetaException(message:Hive Schema version 2.1.0 does not match metastore's schema version ...

  5. docker jvm 占用高的问题定位

    定位流程 先使用一些轻便的工具查看总体情况, 如果情况糟糕, 再使用重量级的工具 jstack       查看线程数是否过多 jstat -gc -gcutil 查看gc次数和时间是否过多, 各个分 ...

  6. mysql 主从复制以及binlog 测试

    ###mysql查看binlog日志内容 https://blog.csdn.net/nuli888/article/details/52106910 mysql的binlog日志位置可通过show ...

  7. win10的一些设置

    win10进入安全模式: 左下角->设置->更新和安全->恢复->立即重启  (重启后进入的界面可以进行一些设置来进入安全模式) win10切换账户: 任务管理器->账户

  8. Carryon的字符串

    I J I: Carryon的字符串 时间限制: 1 s      内存限制: 128 MB      提交 我的状态 题目描述 Carryon最近喜欢上了一些奇奇怪怪的字符,字符都是英文小写字母,但 ...

  9. Microsoft JET Database Engine (0x80004005)未指定的错误解决

    Microsoft JET Database Engine (0x80004005)未指定的错误,这个错误只有在使用Access数据库时才能出现 出现以上问题,可以使用以下步骤进行解决问题: 1.系统 ...

  10. linux 编程笔记1 crusher for linux

    1.反显示字符crusher #include <stdio.h> int main (int argc, char *argv[]) { printf("\033[7m mor ...