Aug 31st, 2010 by carrumba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| using System;
using System.IO;
namespace FileHandling
{
public class FileHandling
{
static void Main(string[] Args)
{
StreamReader lStrReader;
StreamWriter lStrWriter;
string lLine = null;
string lText = "Kevin David Mitnick is a computer\r\n" +
"security consultant and author. In\r\n" +
" the late 20th century, he was\r\n" +
"convicted of various computer- and\r\n" +
" communications-related crimes. At\r\n" +
" the time of his arrest, he was\r\n" +
"the most-wanted computer criminal\r\n" +
"in the United States";
lStrWriter = new StreamWriter("Output.txt");
lStrWriter.WriteLine(lText);
lStrWriter.Close();
lStrReader = new StreamReader("Output.txt");
while ((lLine = lStrReader.ReadLine()) != null)
{
Console.WriteLine(lLine);
}
}
}
} |
tags: C#, File handling
Posted in C#, Coders corner | no comments »
Aug 31st, 2010 by carrumba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| using System;
using System.IO;
namespace FileHandling
{
public class FileHandling
{
static void Main(string[] Args)
{
FileStream lFStream;
StreamReader lStrReader;
string lLine = "";
int lCounter = 0;
Console.WriteLine("test.txt");
try
{
lFStream = new FileStream("test.txt", FileMode.Open);
lStrReader = new StreamReader(lFStream);
while ((lLine = lStrReader.ReadLine()) != null)
{
Console.WriteLine("{0}: {1}", lCounter, lLine);
lCounter++;
}
}
catch (Exception e)
{
Console.WriteLine("Exception : {0}", e);
}
}
}
} |
tags: C#
Posted in C#, Coders corner | no comments »
Aug 31st, 2010 by carrumba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| using System;
using System.Text.RegularExpressions;
namespace RegexTest
{
public class RegexTest
{
static void Main()
{
string lText = "Kevin David Mitnick is a computer " +
"security consultant and author. In" +
" the late 20th century, he was " +
"convicted of various computer- and" +
" communications-related crimes. At" +
" the time of his arrest, he was " +
"the most-wanted computer criminal " +
"in the United States";
Console.WriteLine("Original string : " + lText + "\n");
lText = Regex.Replace(lText, @"\s+computer", " Nintendo Wii");
Console.WriteLine("Processed string : " + lText);
}
}
} |
tags: C#, Regex, Regular expression, replace, string
Posted in C#, Coders corner | no comments »
Aug 31st, 2010 by carrumba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| using System;
using System.Text.RegularExpressions;
namespace RegexTest
{
public class RegexTest
{
static void Main()
{
string lText = "Kevin David Mitnick is a computer " +
"security consultant and author. In" +
" the late 20th century, he was " +
"convicted of various computer- and" +
" communications-related crimes. At" +
" the time of his arrest, he was " +
"the most-wanted computer criminal " +
"in the United States";
Regex lRegex = new Regex("computer", RegexOptions.IgnoreCase);
Match lMatches = lRegex.Match(lText);
while (lMatches.Success)
{
Console.WriteLine("\"{0}\" found, offset {1}" ,
lMatches.Value, lMatches.Index);
lMatches = lMatches.NextMatch();
}
}
}
} |
tags: C#, Regex
Posted in C#, Coders corner | 1 comment »
Aug 28th, 2010 by carrumba
The last weeks I was tinkering around on an old HTTP proxy skript I wrote about one year ago. This script doesn’t contain any rocket science skills and you have the same or probably even more functionality with any other HTTP proxy. Implementing the server in PERL allows me to extend, modify and adjust it according the required needs. I wanted to analyse the traffic caused by people who want to be anonymised and are sitting behind an identity obscuring proxy server, to find out what they are (bots, scripts, humans), what they do and why they want to obscure their identity.
In this post you find an houerly updated statistic from the data collected during two days and some addintional info about what this statistic wants to tell us.
tags: man in the middle, MITM, Open Proxy, Proxy
Posted in Articles, Stuff | no comments »