图片注入 javascript 测试

作者: | 更新日期:

想在自己的QQ空间加上自己的 google 广告,于是想到图片注入 javascript 的方法。

javascript 注入图片

背景

其实一年可以转广告费只有2$, 主要是学习一些简单的注入技术。

BMP 文件格式简单认识

每个格式的文件都有自己的固定结构或者类似结构。

而 BMP 文件大概分为四部分:

一般24位图像是没有调色板的,16位的位图文件的调色板是1024字节。

文件头结构如下

typedef struct { 
    /* type : Magic identifier,一般为BM(0x42,0x4d) */ 
    unsigned short int type; 
    unsigned int size;/* File size in bytes,全部的档案大小 */ 
    unsigned short int reserved1, reserved2; /* 保留位 */ 
    unsigned int offset;/* Offset to image data, bytes */ 
} FILEHEADER;

信息头结构如下

typedef struct { 
    unsigned int size;/* Info Header size in bytes */ 
    int width,height;/* Width and height of image */ 
    unsigned short int planes;/* Number of colour planes */ 
    unsigned short int bits; /* Bits per pixel */ 
    unsigned int compression; /* Compression type */ 
    unsigned int imagesize; /* Image size in bytes */ 
    int xresolution,yresolution; /* Pixels per meter */ 
    unsigned int ncolours; /* Number of colours */ 
    unsigned int importantcolours; /* Important colours */ 
} INFOHEADER;

结构参考 o_sun_o .

BMP javascript 注入

有了上面的基础知识,我们就可以尝试注入了。

test

点击查看评论

关注公众号,接收最新消息

tiankonguse +
穿越