Metasploit Web Service

时间:2020-05-03 10:35:49   收藏:0   阅读:321

Metasploit数据库初始化

?  metasploit-framework git:(Search_Command_Unicode_Support) ./msfdb init
Creating database at /home/kali-team/.msf4/db
Starting database at /home/kali-team/.msf4/db...failed
2020-04-19 20:08:15.754 CST [35133] LOG:  database system is shut down
[!] Your database may be corrupt. Try reinitializing.
Creating database users 
Writing client authentication configuration file /home/kali-team/.msf4/db/pg_hba.conf
Database is no longer running at /home/kali-team/.msf4/db
Starting database at /home/kali-team/.msf4/db...failed 
2020-04-19 20:08:17.959 CST [35287] LOG:  database system is shut down
[!] Your database may be corrupt. Try reinitializing.
Creating initial database schema
MSF web service is already running as PID 34484 
?  metasploit-framework git:(Search_Command_Unicode_Support) ./msfdb reinit
[?] Would you like to delete your existing data and configurations?: yes 
Database is no longer running at /home/kali-team/.msf4/db
Deleting all data at /home/kali-team/.msf4/db
Creating database at /home/kali-team/.msf4/db
Starting database at /home/kali-team/.msf4/db...success
Creating database users
Writing client authentication configuration file /home/kali-team/.msf4/db/pg_hba.conf
Stopping database at /home/kali-team/.msf4/db
Starting database at /home/kali-team/.msf4/db...success
Creating initial database schema
Stopping MSF web service PID 34484
[?] Initial MSF web service account username? [kali-team]:
[?] Initial MSF web service account password? (Leave blank for random password): 
Generating SSL key and certificate for MSF web service 
Attempting to start MSF web service...success 

启动Web服务

前端开发

对接api接口

  devServer: {
    port: port,
    https: true,
    host: ‘web.kali-team.cn‘,
    // open: true,
    overlay: {
      warnings: false,
      errors: true
    },
    proxy: {
      ‘/api‘: {
        target: `https://api.kali-team.cn:5443/`,
        changeOrigin: true,
        ws: true,
        secure: false
        // pathRewrite: {
        //   [‘^‘ + process.env.VUE_APP_BASE_API]: ‘‘
        // }
      }
    }
    // before: require(‘./mock/mock-server.js‘)
  },
// create an axios instance
const service = axios.create({
  baseURL: ‘/api/v1‘, // url = base url + request url
  // withCredentials: true, // send cookies when cross-domain requests
  timeout: 5000 // request timeout
})
export function login(data) {
  return request({
    url: ‘/auth/generate-token‘,
    method: ‘post‘,
    data
  })
}

登录认证

export function login(data) {
  return request({
    url: ‘/auth/generate-token‘,
    method: ‘post‘,
    data
  })
}
const TokenKey = ‘Authorization‘
// request interceptor
service.interceptors.request.use(
  config => {
    // do something before request is sent

    if (store.getters.token) {
      // let each request carry token
      // [‘X-Token‘] is a custom headers key
      // please modify it according to the actual situation
      config.headers[‘Authorization‘] = ‘Bearer ‘ + getToken()
    }
    return config
  },
  error => {
    // do something with request error
    console.log(error) // for debug
    return Promise.reject(error)
  }
)

原文:https://www.cnblogs.com/Kali-Team/p/12820923.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!