EG Information
Training Missions
Knowledge Bank
Pimp Us Out!
Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.
|
| |
Affiliates
|
|
Enigma Group's Code Bank
Ping SweepBy: Evil1 - Date Submitted: 2008-05-23 07:47:45 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net.Sockets; using System.IO; using System.Net; using System.Runtime.InteropServices; namespace pingsweep { public partial class Form1 : Form { //StreamWriter sw = new StreamWriter(null, "c:\\output.txt"); public Form1() { InitializeComponent(); } public UInt32 convertIPtoLong(string ip) { string[] digits; digits = ip.Split(".".ToCharArray()); return Convert.ToUInt32( Convert.ToUInt32(digits[3]) * Math.Pow(2, 24) + Convert.ToUInt32(digits[2]) * Math.Pow(2, 16) + Convert.ToUInt32(digits[1]) * Math.Pow(2, 8) + Convert.ToUInt32(digits[0])); } public string describeResponse(uint code) { string Rcode = ""; switch (code) { case 0: Rcode = "Success"; break; case 11001: Rcode = "Buffer too Small"; break; case 11002: Rcode = "Dest Network Not Reachable"; break; case 11003: Rcode = "Dest Host Not Reachable"; break; case 11004: Rcode = "Dest Protocol Not Reachable"; break; case 11005: Rcode = "Dest Port Not Reachable"; break; case 11006: Rcode = "No Resources Available"; break; case 11007: Rcode = "Bad Option"; break; case 11008: Rcode = "Hardware Error"; break; case 11009: Rcode = "Packet too Big"; break; case 11010: Rcode = "Rqst Timed Out"; break; case 11011: Rcode = "Bad Request"; break; case 11012: Rcode = "Bad Route"; break; case 11013: Rcode = "TTL Exprd in Transit"; break; case 11014: Rcode = "TTL Exprd Reassemb"; break; case 11015: Rcode = "Parameter Problem"; break; case 11016: Rcode = "Source Quench"; break; case 11017: Rcode = "Option too Big"; break; case 11018: Rcode = " Bad Destination"; break; case 11019: Rcode = "Address Deleted"; break; case 11020: Rcode = "Spec MTU Change"; break; case 11021: Rcode = "MTU Change"; break; case 11022: Rcode = "Unload"; break; case 11050: Rcode = "General Failure"; break; } return Rcode; } private void btnAbout_Click(object sender, EventArgs e) { MessageBox.Show("A simple ping sweep / whois app by Evil1", "About"); } private void btnDie_Click(object sender, EventArgs e) { // void killit(); method to kill my shit for multithreading Application.Exit(); } private void btnStart_Click(object sender, EventArgs e) { uint LongIP; string buffer; UInt32 hIP; uint timeout; buffer = new StringBuilder (). Append(' ', 32). ToString(); LongIP = convertIPtoLong(txtStartingIP.Text); hIP = PING.IcmpCreateFile(); PING.pIPo.TTL = 255; timeout = 2700; PING.IcmpSendEcho(hIP, LongIP, buffer, (uint)buffer.Length, ref PING.pIPo, ref PING.pIPe, (uint)Marshal. SizeOf(PING. pIPe) + 8, timeout); MessageBox.Show(describeResponse(PING.pIPe.Status)); } } public class ping { public struct IP_OPTION_INFORMATION { public byte TTL, Tos, Flags, OptionSize; [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 128)] public string OptionsData; } public struct ICMP_ECHO_REPLY { public uint Address, Status, RoundTripTime; public ushort DataSize, Reserved; public IP_OPTION_INFORMATION Options; } [System.Runtime.InteropServices.DllImport("icmp.dll", SetLastError = true)] public static extern uint IcmpSendEcho( uint IcmpHandle, uint DestAddress, string RequestData, uint RequestSize, ref IP_OPTION_INFORMATION RequestOptns, ref ICMP_ECHO_REPLY ReplyBuffer, uint ReplySize, uint TimeOut); [System.Runtime.InteropServices.DllImport("icmp.dll", SetLastError = true)] public static extern uint IcmpCreateFile(); public static IP_OPTION_INFORMATION pIPo; public static ICMP_ECHO_REPLY pIPe; /* internal uint IcmpCreateFile() { throw new Exception("Error"); }*/ } }
|
| Return to
csharp category list |
|
|
Who Visited EnigmaGroup Today?
1573 Guests, 267 Users (179 Spiders)
timetrust, 3ntr0py, 2345, BillTuer, advilapyday, silverasianboy, riesenjoe, m0rt, TheHarrisonW, lotato, Rex_Mundi, hkevin, lonely.connection, IvanDimitriev, 2142, CloverCipher, Hessesian, vnd, suetekh, Distorted, aurena, rospark, valy1177, whisperer, Blavatsky, nmobin27, learning, st3alth, Partisan, hackaday, K0gller, fitz, DrOptix, Jayjay, JohnMalkovitzch, psychomarine, whoami, Vspectrum, San Marino, TinCardinal, brunoriversyhn, code-g, yshiau, Psiber_Syn, Klosse, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, GothicLogic, strudels, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, trueorfalse, Sir D. Naut, zach, batsbargy, Rik, Macabre, ellisp, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, limited, Nikhil, evjfvir967nj, blackknight911, Mod777, dark_void, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, NIGHTWOLF, m4f10, Vengeance987, avacraft, Bumpadjuppy, becool, thecoder, ddxc, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, unicornrainbow, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, RomeoG, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, flarornEral, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, Xendz, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful, no, nas0151, Traybo, howisthechicken, thethird3y3, Somethingclever, marplusz, MSI52, twink gay cam dUi8D |
| |
|
|
|
|
|