public static void main(string[] args)
    {
        try {
            // first case
            TestCase_IOT_MemberTaint testCase = new TestCase_IOT_MemberTaint();
            TaintedStruct            struct1  = new TaintedStruct();
            struct1.m_tainted = testCase.getVulnerableSource(args[0]);
            testCase.writeToVulnerableSink1(struct1.m_tainted);

            // second case
            TaintedStruct struct2 = new TaintedStruct(testCase.getVulnerableSource(args[0]));
            testCase.writeToVulnerableSink2(struct2.getTainted());

            // third case
            TaintedStruct struct3 = new TaintedStruct();
            struct3.setTainted(testCase.getVulnerableSource(args[0]));
            testCase.writeToVulnerableSink3(struct3.getTainted());
        } catch (Exception e) {
            Console.Write(e.StackTrace);
        }
    }
Exemplo n.º 2
0
    public static void main(string[] args)
    {
        try {
            string file = args[0];
            string key  = args[1];

            // first case
            TestCase_IOT_Lost_MemberTaint testCase = new TestCase_IOT_Lost_MemberTaint();
            TaintedStruct taintStruct = new TaintedStruct();
            taintStruct.m_tainted = testCase.getVulnerableSource(file);
            testCase.writeToUnknownSink1(key, taintStruct.m_tainted);

            // second case
            TaintedStruct struct2 = new TaintedStruct(testCase.getVulnerableSource(args[0]));
            testCase.writeToUnknownSink2(struct2.getTainted());

            // third case
            TaintedStruct struct3 = new TaintedStruct();
            struct3.setTainted(testCase.getVulnerableSource(args[0]));
            testCase.writeToUnknownSink3(key, struct3.getTainted());
        } catch (Exception e) {
            Console.Write(e.StackTrace);
        }
    }
Exemplo n.º 3
0
 public void getTaintedStructSource2(string file, TaintedStruct struct1)
 {
     struct1.setTainted(getVulnerableSource(file));
 }