打p扩展器----如何编写入侵者扩展器?

时间:2018-12-01 10:35:06

标签: burp

最近,我需要在burp的入侵者模块中编写一个自定义的有效载荷生成器 enter image description here

然后我在互联网上搜索了它并作为文章来处理,但是有两个界面,我不知道该怎么办。

enter image description here

我应该同时实现它们还是什么?谁能给我答案?

1 个答案:

答案 0 :(得分:2)

是的,您需要同时实现两者才能使发电机正常工作。有一个示例here。关键部分是:

class MyViewPagerAdapter(val id: String) :
    FragmentStatePagerAdapter(supportFragmentManager) {

    val titles = arrayOf(getString(R.string.title1),
        getString(R.string.title2))

    override fun getItem(position: Int) = when (position) {
        0 -> MyFragment1.newInstance(id)
        1 -> MyFragment2.newInstance(id)
        else -> Fragment()
    }

    override fun getCount() = 2

    override fun getPageTitle(position: Int): CharSequence? {
        return titles[position]
    }

    override fun setPrimaryItem(container: ViewGroup, position: Int, `object`: Any) {
        super.setPrimaryItem(container, position, `object`)

        val currentFragment = `object` as Fragment

        if (currentFragment.view != null) { //The first time the view isn't created yet
            for (i in 0 until count) {
                (container.getChildAt(i) as NestedScrollView).isNestedScrollingEnabled = false
            }

            val currentNestedScrollView: NestedScrollView = currentFragment.view as NestedScrollView
            currentNestedScrollView.isNestedScrollingEnabled = true

            container.requestLayout()
        }
    }
}