Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/jaeles-project/jaeles/libs"
"github.com/jaeles-project/jaeles/utils"
"github.com/spf13/viper"
"io/ioutil"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -48,7 +47,7 @@ func InitConfig(options *libs.Options) {
if options.Debug {
utils.InforF("Load config from: %v", configPath)
}
b, _ := ioutil.ReadFile(configPath)
b, _ := os.ReadFile(configPath)
v.ReadConfig(bytes.NewBuffer(b))
}

Expand Down
9 changes: 5 additions & 4 deletions core/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"
"github.com/Jeffail/gabs/v2"
"github.com/jaeles-project/jaeles/utils"
"io/ioutil"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
Expand All @@ -21,7 +22,7 @@ import (
// ParseSign parsing YAML signature file
func ParseSign(signFile string) (sign libs.Signature, err error) {
signFile = utils.NormalizePath(signFile)
yamlFile, err := ioutil.ReadFile(signFile)
yamlFile, err := os.ReadFile(signFile)
if err != nil {
utils.ErrorF("Error parsing Signature: #%v - %v", err, signFile)
}
Expand Down Expand Up @@ -88,7 +89,7 @@ func ParseSignFromContent(content string) (sign libs.Signature, err error) {

// ParsePassive parsing YAML passive file
func ParsePassive(passiveFile string) (passive libs.Passive, err error) {
yamlFile, err := ioutil.ReadFile(passiveFile)
yamlFile, err := os.ReadFile(passiveFile)
if err != nil {
utils.ErrorF("Error parsing Signature: #%v - %v", err, passiveFile)
}
Expand Down Expand Up @@ -582,7 +583,7 @@ func ParseBurpResponse(rawReq string, rawRes string) (res libs.Response) {
}
res.Headers = headers

body, _ := ioutil.ReadAll(parsedRes.Body)
body, _ := io.ReadAll(parsedRes.Body)
res.Body = string(body)
return res
}
Expand Down
3 changes: 1 addition & 2 deletions database/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"github.com/jaeles-project/jaeles/utils"
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
"regexp"
"strings"
Expand Down Expand Up @@ -89,7 +88,7 @@ func ImportSign(signPath string) error {

// ParseSign parsing YAML signature file
func ParseSignature(signFile string) (sign libs.Signature, err error) {
yamlFile, err := ioutil.ReadFile(signFile)
yamlFile, err := os.ReadFile(signFile)
if err != nil {
utils.ErrorF("yamlFile.Get err #%v - %v", err, signFile)
}
Expand Down
6 changes: 3 additions & 3 deletions sender/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"fmt"
"github.com/jaeles-project/jaeles/utils"
"io/ioutil"
"io"
"math/rand"
"net/http"
"strconv"
Expand Down Expand Up @@ -55,7 +55,7 @@ func JustSend(options libs.Options, req libs.Request) (res libs.Response, err er
// disable log when retry
logger := logrus.New()
if !options.Debug {
logger.Out = ioutil.Discard
logger.Out = io.Discard
}

client := resty.New()
Expand Down Expand Up @@ -114,7 +114,7 @@ func JustSend(options libs.Options, req libs.Request) (res libs.Response, err er
res.StatusCode = req.Response.StatusCode
res.Status = req.Response.Status
resp := req.Response
bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
utils.ErrorF("%v", err)
}
Expand Down
9 changes: 4 additions & 5 deletions utils/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/url"
"os"
Expand Down Expand Up @@ -66,7 +65,7 @@ func FileLength(filename string) int {
// DirLength count len of file
func DirLength(dir string) int {
dir = NormalizePath(dir)
files, err := ioutil.ReadDir(dir)
files, err := os.ReadDir(dir)
if err != nil {
return 0
}
Expand All @@ -84,7 +83,7 @@ func GetFileContent(filename string) string {
return result
}
defer file.Close()
b, err := ioutil.ReadAll(file)
b, err := io.ReadAll(file)
if err != nil {
return result
}
Expand Down Expand Up @@ -246,7 +245,7 @@ func GenHash(text string) string {
// CopyDir copy directory to dest
func CopyDir(src string, dst string) error {
var err error
var fds []os.FileInfo
var fds []os.DirEntry
var srcInfo os.FileInfo

if srcInfo, err = os.Stat(src); err != nil {
Expand All @@ -257,7 +256,7 @@ func CopyDir(src string, dst string) error {
return err
}

if fds, err = ioutil.ReadDir(src); err != nil {
if fds, err = os.ReadDir(src); err != nil {
return err
}
for _, fd := range fds {
Expand Down
5 changes: 2 additions & 3 deletions utils/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package utils
import (
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -31,7 +30,7 @@ func InitLog(options *libs.Options) {
if options.LogFile != "" {
options.LogFile = NormalizePath(options.LogFile)
dir := path.Dir(options.LogFile)
tmpFile, _ := ioutil.TempFile(dir, "jaeles-*.log")
tmpFile, _ := os.CreateTemp(dir, "jaeles-*.log")
options.LogFile = tmpFile.Name()
dir = filepath.Dir(options.LogFile)
if !FolderExists(dir) {
Expand Down Expand Up @@ -60,7 +59,7 @@ func InitLog(options *libs.Options) {
logger.SetLevel(logrus.InfoLevel)
} else {
logger.SetLevel(logrus.PanicLevel)
logger.SetOutput(ioutil.Discard)
logger.SetOutput(io.Discard)
}
if options.LogFile != "" {
logger.Info(fmt.Sprintf("Store log file to: %v", options.LogFile))
Expand Down